const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/practices-d-GaMaxG.js","assets/lacrosse-queries-TkwrEsG5.js","assets/button-BKWwiobZ.js","assets/label-CdX7ZraJ.js","assets/select-BV1UrrUl.js","assets/ConfirmDeleteButton-DZQAGuy_.js","assets/login-DNRhLIl0.js","assets/games-uQBiUiCz.js","assets/dashboard-CqDxv2JI.js","assets/seasons.index-DovSN_ac.js","assets/switch-DiEqdH2P.js","assets/seasons._seasonId-CbHKA2Ip.js"])))=>i.map(i=>d[i]);
function Dw(t,e){for(var r=0;r<e.length;r++){const a=e[r];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in t)){const u=Object.getOwnPropertyDescriptor(a,l);u&&Object.defineProperty(t,l,u.get?u:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Jk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var If={exports:{}},$i={};var Vm;function Lw(){if(Vm)return $i;Vm=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(a,l,u){var c=null;if(u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),"key"in l){u={};for(var h in l)h!=="key"&&(u[h]=l[h])}else u=l;return l=u.ref,{$$typeof:t,type:a,key:c,ref:l!==void 0?l:null,props:u}}return $i.Fragment=e,$i.jsx=r,$i.jsxs=r,$i}var Km;function Uw(){return Km||(Km=1,If.exports=Lw()),If.exports}var Q=Uw(),qf={exports:{}},ge={};var Ym;function Pw(){if(Ym)return ge;Ym=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function _(C){return C===null||typeof C!="object"?null:(C=b&&C[b]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,E={};function A(C,q,V){this.props=C,this.context=q,this.refs=E,this.updater=V||S}A.prototype.isReactComponent={},A.prototype.setState=function(C,q){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,q,"setState")},A.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function M(){}M.prototype=A.prototype;function j(C,q,V){this.props=C,this.context=q,this.refs=E,this.updater=V||S}var D=j.prototype=new M;D.constructor=j,O(D,A.prototype),D.isPureReactComponent=!0;var X=Array.isArray;function K(){}var H={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function W(C,q,V){var J=V.ref;return{$$typeof:t,type:C,key:q,ref:J!==void 0?J:null,props:V}}function le(C,q){return W(C.type,q,C.props)}function ie(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function me(C){var q={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(V){return q[V]})}var _e=/\/+/g;function qe(C,q){return typeof C=="object"&&C!==null&&C.key!=null?me(""+C.key):q.toString(36)}function Me(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(K,K):(C.status="pending",C.then(function(q){C.status==="pending"&&(C.status="fulfilled",C.value=q)},function(q){C.status==="pending"&&(C.status="rejected",C.reason=q)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,q,V,J,ee){var ce=typeof C;(ce==="undefined"||ce==="boolean")&&(C=null);var we=!1;if(C===null)we=!0;else switch(ce){case"bigint":case"string":case"number":we=!0;break;case"object":switch(C.$$typeof){case t:case e:we=!0;break;case y:return we=C._init,U(we(C._payload),q,V,J,ee)}}if(we)return ee=ee(C),we=J===""?"."+qe(C,0):J,X(ee)?(V="",we!=null&&(V=we.replace(_e,"$&/")+"/"),U(ee,q,V,"",function(Dt){return Dt})):ee!=null&&(ie(ee)&&(ee=le(ee,V+(ee.key==null||C&&C.key===ee.key?"":(""+ee.key).replace(_e,"$&/")+"/")+we)),q.push(ee)),1;we=0;var de=J===""?".":J+":";if(X(C))for(var xe=0;xe<C.length;xe++)J=C[xe],ce=de+qe(J,xe),we+=U(J,q,V,ce,ee);else if(xe=_(C),typeof xe=="function")for(C=xe.call(C),xe=0;!(J=C.next()).done;)J=J.value,ce=de+qe(J,xe++),we+=U(J,q,V,ce,ee);else if(ce==="object"){if(typeof C.then=="function")return U(Me(C),q,V,J,ee);throw q=String(C),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return we}function F(C,q,V){if(C==null)return C;var J=[],ee=0;return U(C,J,"","",function(ce){return q.call(V,ce,ee++)}),J}function ae(C){if(C._status===-1){var q=C._result;q=q(),q.then(function(V){(C._status===0||C._status===-1)&&(C._status=1,C._result=V)},function(V){(C._status===0||C._status===-1)&&(C._status=2,C._result=V)}),C._status===-1&&(C._status=0,C._result=q)}if(C._status===1)return C._result.default;throw C._result}var Se=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ye={map:F,forEach:function(C,q,V){F(C,function(){q.apply(this,arguments)},V)},count:function(C){var q=0;return F(C,function(){q++}),q},toArray:function(C){return F(C,function(q){return q})||[]},only:function(C){if(!ie(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return ge.Activity=m,ge.Children=ye,ge.Component=A,ge.Fragment=r,ge.Profiler=l,ge.PureComponent=j,ge.StrictMode=a,ge.Suspense=p,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,ge.__COMPILER_RUNTIME={__proto__:null,c:function(C){return H.H.useMemoCache(C)}},ge.cache=function(C){return function(){return C.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(C,q,V){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var J=O({},C.props),ee=C.key;if(q!=null)for(ce in q.key!==void 0&&(ee=""+q.key),q)!Y.call(q,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&q.ref===void 0||(J[ce]=q[ce]);var ce=arguments.length-2;if(ce===1)J.children=V;else if(1<ce){for(var we=Array(ce),de=0;de<ce;de++)we[de]=arguments[de+2];J.children=we}return W(C.type,ee,J)},ge.createContext=function(C){return C={$$typeof:c,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},ge.createElement=function(C,q,V){var J,ee={},ce=null;if(q!=null)for(J in q.key!==void 0&&(ce=""+q.key),q)Y.call(q,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ee[J]=q[J]);var we=arguments.length-2;if(we===1)ee.children=V;else if(1<we){for(var de=Array(we),xe=0;xe<we;xe++)de[xe]=arguments[xe+2];ee.children=de}if(C&&C.defaultProps)for(J in we=C.defaultProps,we)ee[J]===void 0&&(ee[J]=we[J]);return W(C,ce,ee)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(C){return{$$typeof:h,render:C}},ge.isValidElement=ie,ge.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:ae}},ge.memo=function(C,q){return{$$typeof:g,type:C,compare:q===void 0?null:q}},ge.startTransition=function(C){var q=H.T,V={};H.T=V;try{var J=C(),ee=H.S;ee!==null&&ee(V,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(K,Se)}catch(ce){Se(ce)}finally{q!==null&&V.types!==null&&(q.types=V.types),H.T=q}},ge.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},ge.use=function(C){return H.H.use(C)},ge.useActionState=function(C,q,V){return H.H.useActionState(C,q,V)},ge.useCallback=function(C,q){return H.H.useCallback(C,q)},ge.useContext=function(C){return H.H.useContext(C)},ge.useDebugValue=function(){},ge.useDeferredValue=function(C,q){return H.H.useDeferredValue(C,q)},ge.useEffect=function(C,q){return H.H.useEffect(C,q)},ge.useEffectEvent=function(C){return H.H.useEffectEvent(C)},ge.useId=function(){return H.H.useId()},ge.useImperativeHandle=function(C,q,V){return H.H.useImperativeHandle(C,q,V)},ge.useInsertionEffect=function(C,q){return H.H.useInsertionEffect(C,q)},ge.useLayoutEffect=function(C,q){return H.H.useLayoutEffect(C,q)},ge.useMemo=function(C,q){return H.H.useMemo(C,q)},ge.useOptimistic=function(C,q){return H.H.useOptimistic(C,q)},ge.useReducer=function(C,q,V){return H.H.useReducer(C,q,V)},ge.useRef=function(C){return H.H.useRef(C)},ge.useState=function(C){return H.H.useState(C)},ge.useSyncExternalStore=function(C,q,V){return H.H.useSyncExternalStore(C,q,V)},ge.useTransition=function(){return H.H.useTransition()},ge.version="19.2.5",ge}var Fm;function vo(){return Fm||(Fm=1,qf.exports=Pw()),qf.exports}var ne=vo();const Z=Nv(ne),Xk=Dw({__proto__:null,default:Z},[ne]);var $f={exports:{}},Gi={},Gf={exports:{}},Vf={};var Qm;function zw(){return Qm||(Qm=1,(function(t){function e(U,F){var ae=U.length;U.push(F);e:for(;0<ae;){var Se=ae-1>>>1,ye=U[Se];if(0<l(ye,F))U[Se]=F,U[ae]=ye,ae=Se;else break e}}function r(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var F=U[0],ae=U.pop();if(ae!==F){U[0]=ae;e:for(var Se=0,ye=U.length,C=ye>>>1;Se<C;){var q=2*(Se+1)-1,V=U[q],J=q+1,ee=U[J];if(0>l(V,ae))J<ye&&0>l(ee,V)?(U[Se]=ee,U[J]=ae,Se=J):(U[Se]=V,U[q]=ae,Se=q);else if(J<ye&&0>l(ee,ae))U[Se]=ee,U[J]=ae,Se=J;else break e}}return F}function l(U,F){var ae=U.sortIndex-F.sortIndex;return ae!==0?ae:U.id-F.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();t.unstable_now=function(){return c.now()-h}}var p=[],g=[],y=1,m=null,b=3,_=!1,S=!1,O=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function D(U){for(var F=r(g);F!==null;){if(F.callback===null)a(g);else if(F.startTime<=U)a(g),F.sortIndex=F.expirationTime,e(p,F);else break;F=r(g)}}function X(U){if(O=!1,D(U),!S)if(r(p)!==null)S=!0,K||(K=!0,me());else{var F=r(g);F!==null&&Me(X,F.startTime-U)}}var K=!1,H=-1,Y=5,W=-1;function le(){return E?!0:!(t.unstable_now()-W<Y)}function ie(){if(E=!1,K){var U=t.unstable_now();W=U;var F=!0;try{e:{S=!1,O&&(O=!1,M(H),H=-1),_=!0;var ae=b;try{t:{for(D(U),m=r(p);m!==null&&!(m.expirationTime>U&&le());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,b=m.priorityLevel;var ye=Se(m.expirationTime<=U);if(U=t.unstable_now(),typeof ye=="function"){m.callback=ye,D(U),F=!0;break t}m===r(p)&&a(p),D(U)}else a(p);m=r(p)}if(m!==null)F=!0;else{var C=r(g);C!==null&&Me(X,C.startTime-U),F=!1}}break e}finally{m=null,b=ae,_=!1}F=void 0}}finally{F?me():K=!1}}}var me;if(typeof j=="function")me=function(){j(ie)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,qe=_e.port2;_e.port1.onmessage=ie,me=function(){qe.postMessage(null)}}else me=function(){A(ie,0)};function Me(U,F){H=A(function(){U(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(U){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var ae=b;b=F;try{return U()}finally{b=ae}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(U,F){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ae=b;b=U;try{return F()}finally{b=ae}},t.unstable_scheduleCallback=function(U,F,ae){var Se=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Se+ae:Se):ae=Se,U){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=ae+ye,U={id:y++,callback:F,priorityLevel:U,startTime:ae,expirationTime:ye,sortIndex:-1},ae>Se?(U.sortIndex=ae,e(g,U),r(p)===null&&U===r(g)&&(O?(M(H),H=-1):O=!0,Me(X,ae-Se))):(U.sortIndex=ye,e(p,U),S||_||(S=!0,K||(K=!0,me()))),U},t.unstable_shouldYield=le,t.unstable_wrapCallback=function(U){var F=b;return function(){var ae=b;b=F;try{return U.apply(this,arguments)}finally{b=ae}}}})(Vf)),Vf}var Jm;function Bw(){return Jm||(Jm=1,Gf.exports=zw()),Gf.exports}var Kf={exports:{}},Ct={};var Xm;function Hw(){if(Xm)return Ct;Xm=1;var t=vo();function e(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(e(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(p,g,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:m==null?null:""+m,children:p,containerInfo:g,implementation:y}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ct.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return u(p,g,null,y)},Ct.flushSync=function(p){var g=c.T,y=a.p;try{if(c.T=null,a.p=2,p)return p()}finally{c.T=g,a.p=y,a.d.f()}},Ct.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(p,g))},Ct.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},Ct.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,m=h(y,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,_=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?a.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:_}):y==="script"&&a.d.X(p,{crossOrigin:m,integrity:b,fetchPriority:_,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ct.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);a.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(p)},Ct.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,m=h(y,g.crossOrigin);a.d.L(p,y,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ct.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=h(g.as,g.crossOrigin);a.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(p)},Ct.requestFormReset=function(p){a.d.r(p)},Ct.unstable_batchedUpdates=function(p,g){return p(g)},Ct.useFormState=function(p,g,y){return c.H.useFormState(p,g,y)},Ct.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ct.version="19.2.5",Ct}var Zm;function Dv(){if(Zm)return Kf.exports;Zm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Kf.exports=Hw(),Kf.exports}var Wm;function Iw(){if(Wm)return Gi;Wm=1;var t=Bw(),e=vo(),r=Dv();function a(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var s=n,i=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(i=s.return),n=s.return;while(n)}return s.tag===3?i:null}function c(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function h(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function p(n){if(u(n)!==n)throw Error(a(188))}function g(n){var s=n.alternate;if(!s){if(s=u(n),s===null)throw Error(a(188));return s!==n?null:n}for(var i=n,o=s;;){var f=i.return;if(f===null)break;var d=f.alternate;if(d===null){if(o=f.return,o!==null){i=o;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===i)return p(f),n;if(d===o)return p(f),s;d=d.sibling}throw Error(a(188))}if(i.return!==o.return)i=f,o=d;else{for(var v=!1,w=f.child;w;){if(w===i){v=!0,i=f,o=d;break}if(w===o){v=!0,o=f,i=d;break}w=w.sibling}if(!v){for(w=d.child;w;){if(w===i){v=!0,i=d,o=f;break}if(w===o){v=!0,o=d,i=f;break}w=w.sibling}if(!v)throw Error(a(189))}}if(i.alternate!==o)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?n:s}function y(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=y(n),s!==null)return s;n=n.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),j=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function me(n){return n===null||typeof n!="object"?null:(n=ie&&n[ie]||n["@@iterator"],typeof n=="function"?n:null)}var _e=Symbol.for("react.client.reference");function qe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===_e?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case O:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case K:return"SuspenseList";case W:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case j:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case D:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return s=n.displayName||null,s!==null?s:qe(n.type)||"Memo";case Y:s=n._payload,n=n._init;try{return qe(n(s))}catch{}}return null}var Me=Array.isArray,U=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Se=[],ye=-1;function C(n){return{current:n}}function q(n){0>ye||(n.current=Se[ye],Se[ye]=null,ye--)}function V(n,s){ye++,Se[ye]=n.current,n.current=s}var J=C(null),ee=C(null),ce=C(null),we=C(null);function de(n,s){switch(V(ce,s),V(ee,n),V(J,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?pm(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=pm(s),n=gm(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(J),V(J,n)}function xe(){q(J),q(ee),q(ce)}function Dt(n){n.memoizedState!==null&&V(we,n);var s=J.current,i=gm(s,n.type);s!==i&&(V(ee,n),V(J,i))}function Lt(n){ee.current===n&&(q(J),q(ee)),we.current===n&&(q(we),Bi._currentValue=ae)}var kt,as;function Ut(n){if(kt===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);kt=s&&s[1]||"",as=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+kt+n+as}var is=!1;function Gn(n,s){if(!n||is)return"";is=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(s){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(B){var z=B}Reflect.construct(n,[],G)}else{try{G.call()}catch(B){z=B}n.call(G.prototype)}}else{try{throw Error()}catch(B){z=B}(G=n())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(B){if(B&&z&&typeof B.stack=="string")return[B.stack,z.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),v=d[0],w=d[1];if(v&&w){var x=v.split(`
`),P=w.split(`
`);for(f=o=0;o<x.length&&!x[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===x.length||f===P.length)for(o=x.length-1,f=P.length-1;1<=o&&0<=f&&x[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(x[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||x[o]!==P[f]){var I=`
`+x[o].replace(" at new "," at ");return n.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",n.displayName)),I}while(1<=o&&0<=f);break}}}finally{is=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?Ut(i):""}function kn(n,s){switch(n.tag){case 26:case 27:case 5:return Ut(n.type);case 16:return Ut("Lazy");case 13:return n.child!==s&&s!==null?Ut("Suspense Fallback"):Ut("Suspense");case 19:return Ut("SuspenseList");case 0:case 15:return Gn(n.type,!1);case 11:return Gn(n.type.render,!1);case 1:return Gn(n.type,!0);case 31:return Ut("Activity");default:return""}}function ln(n){try{var s="",i=null;do s+=kn(n,i),i=n,n=n.return;while(n);return s}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}var vt=Object.prototype.hasOwnProperty,Zt=t.unstable_scheduleCallback,os=t.unstable_cancelCallback,ft=t.unstable_shouldYield,jn=t.unstable_requestPaint,ht=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,un=t.unstable_UserBlockingPriority,Vn=t.unstable_NormalPriority,Za=t.unstable_LowPriority,Kn=t.unstable_IdlePriority,wo=t.log,_r=t.unstable_setDisableYieldValue,ls=null,jt=null;function wn(n){if(typeof wo=="function"&&_r(n),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(ls,n)}catch{}}var Ot=Math.clz32?Math.clz32:Mn,Cu=Math.log,Wa=Math.LN2;function Mn(n){return n>>>=0,n===0?32:31-(Cu(n)/Wa|0)|0}var Vs=256,Ks=262144,us=4194304;function Nn(n){var s=n&42;if(s!==0)return s;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function pe(n,s,i){var o=n.pendingLanes;if(o===0)return 0;var f=0,d=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var w=o&134217727;return w!==0?(o=w&~d,o!==0?f=Nn(o):(v&=w,v!==0?f=Nn(v):i||(i=w&~n,i!==0&&(f=Nn(i))))):(w=o&~d,w!==0?f=Nn(w):v!==0?f=Nn(v):i||(i=o&~n,i!==0&&(f=Nn(i)))),f===0?0:s!==0&&s!==f&&(s&d)===0&&(d=f&-f,i=s&-s,d>=i||d===32&&(i&4194048)!==0)?s:f}function Ke(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function dt(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 xt(){var n=us;return us<<=1,(us&62914560)===0&&(us=4194304),n}function wr(n){for(var s=[],i=0;31>i;i++)s.push(n);return s}function Qe(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Pt(n,s,i,o,f,d){var v=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var w=n.entanglements,x=n.expirationTimes,P=n.hiddenUpdates;for(i=v&~i;0<i;){var I=31-Ot(i),G=1<<I;w[I]=0,x[I]=-1;var z=P[I];if(z!==null)for(P[I]=null,I=0;I<z.length;I++){var B=z[I];B!==null&&(B.lane&=-536870913)}i&=~G}o!==0&&cs(n,o,0),d!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=d&~(v&~s))}function cs(n,s,i){n.pendingLanes|=s,n.suspendedLanes&=~s;var o=31-Ot(s);n.entangledLanes|=s,n.entanglements[o]=n.entanglements[o]|1073741824|i&261930}function zt(n,s){var i=n.entangledLanes|=s;for(n=n.entanglements;i;){var o=31-Ot(i),f=1<<o;f&s|n[o]&s&&(n[o]|=s),i&=~f}}function Bt(n,s){var i=s&-s;return i=(i&42)!==0?1:Ys(i),(i&(n.suspendedLanes|s))!==0?0:i}function Ys(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Sn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ku(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:zm(n.type))}function ed(n,s){var i=F.p;try{return F.p=n,s()}finally{F.p=i}}var Sr=Math.random().toString(36).slice(2),bt="__reactFiber$"+Sr,Ht="__reactProps$"+Sr,Fs="__reactContainer$"+Sr,ju="__reactEvents$"+Sr,Eb="__reactListeners$"+Sr,Tb="__reactHandles$"+Sr,td="__reactResources$"+Sr,ei="__reactMarker$"+Sr;function Mu(n){delete n[bt],delete n[Ht],delete n[ju],delete n[Eb],delete n[Tb]}function Qs(n){var s=n[bt];if(s)return s;for(var i=n.parentNode;i;){if(s=i[Fs]||i[bt]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(n=Sm(n);n!==null;){if(i=n[bt])return i;n=Sm(n)}return s}n=i,i=n.parentNode}return null}function Js(n){if(n=n[bt]||n[Fs]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}function ti(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(a(33))}function Xs(n){var s=n[td];return s||(s=n[td]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function pt(n){n[ei]=!0}var nd=new Set,rd={};function fs(n,s){Zs(n,s),Zs(n+"Capture",s)}function Zs(n,s){for(rd[n]=s,n=0;n<s.length;n++)nd.add(s[n])}var Rb=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),sd={},ad={};function Ab(n){return vt.call(ad,n)?!0:vt.call(sd,n)?!1:Rb.test(n)?ad[n]=!0:(sd[n]=!0,!1)}function So(n,s,i){if(Ab(s))if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var o=s.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+i)}}function Eo(n,s,i){if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+i)}}function Yn(n,s,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(s,i,""+o)}}function cn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function id(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ob(n,s,i){var o=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,d=o.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return f.call(this)},set:function(v){i=""+v,d.call(this,v)}}),Object.defineProperty(n,s,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function Nu(n){if(!n._valueTracker){var s=id(n)?"checked":"value";n._valueTracker=Ob(n,s,""+n[s])}}function od(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var i=s.getValue(),o="";return n&&(o=id(n)?n.checked?"true":"false":n.value),n=o,n!==i?(s.setValue(n),!0):!1}function To(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var xb=/[\n"\\]/g;function fn(n){return n.replace(xb,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Du(n,s,i,o,f,d,v,w){n.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?n.type=v:n.removeAttribute("type"),s!=null?v==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+cn(s)):n.value!==""+cn(s)&&(n.value=""+cn(s)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),s!=null?Lu(n,v,cn(s)):i!=null?Lu(n,v,cn(i)):o!=null&&n.removeAttribute("value"),f==null&&d!=null&&(n.defaultChecked=!!d),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.name=""+cn(w):n.removeAttribute("name")}function ld(n,s,i,o,f,d,v,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(n.type=d),s!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||s!=null)){Nu(n);return}i=i!=null?""+cn(i):"",s=s!=null?""+cn(s):i,w||s===n.value||(n.value=s),n.defaultValue=s}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,n.checked=w?n.checked:!!o,n.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.name=v),Nu(n)}function Lu(n,s,i){s==="number"&&To(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function Ws(n,s,i,o){if(n=n.options,s){s={};for(var f=0;f<i.length;f++)s["$"+i[f]]=!0;for(i=0;i<n.length;i++)f=s.hasOwnProperty("$"+n[i].value),n[i].selected!==f&&(n[i].selected=f),f&&o&&(n[i].defaultSelected=!0)}else{for(i=""+cn(i),s=null,f=0;f<n.length;f++){if(n[f].value===i){n[f].selected=!0,o&&(n[f].defaultSelected=!0);return}s!==null||n[f].disabled||(s=n[f])}s!==null&&(s.selected=!0)}}function ud(n,s,i){if(s!=null&&(s=""+cn(s),s!==n.value&&(n.value=s),i==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=i!=null?""+cn(i):""}function cd(n,s,i,o){if(s==null){if(o!=null){if(i!=null)throw Error(a(92));if(Me(o)){if(1<o.length)throw Error(a(93));o=o[0]}i=o}i==null&&(i=""),s=i}i=cn(s),n.defaultValue=i,o=n.textContent,o===i&&o!==""&&o!==null&&(n.value=o),Nu(n)}function ea(n,s){if(s){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=s;return}}n.textContent=s}var Cb=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function fd(n,s,i){var o=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?o?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":o?n.setProperty(s,i):typeof i!="number"||i===0||Cb.has(s)?s==="float"?n.cssFloat=i:n[s]=(""+i).trim():n[s]=i+"px"}function hd(n,s,i){if(s!=null&&typeof s!="object")throw Error(a(62));if(n=n.style,i!=null){for(var o in i)!i.hasOwnProperty(o)||s!=null&&s.hasOwnProperty(o)||(o.indexOf("--")===0?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="");for(var f in s)o=s[f],s.hasOwnProperty(f)&&i[f]!==o&&fd(n,f,o)}else for(var d in s)s.hasOwnProperty(d)&&fd(n,d,s[d])}function Uu(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jb=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ro(n){return jb.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Fn(){}var Pu=null;function zu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ta=null,na=null;function dd(n){var s=Js(n);if(s&&(n=s.stateNode)){var i=n[Ht]||null;e:switch(n=s.stateNode,s.type){case"input":if(Du(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+fn(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var o=i[s];if(o!==n&&o.form===n.form){var f=o[Ht]||null;if(!f)throw Error(a(90));Du(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(s=0;s<i.length;s++)o=i[s],o.form===n.form&&od(o)}break e;case"textarea":ud(n,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&Ws(n,!!i.multiple,s,!1)}}}var Bu=!1;function pd(n,s,i){if(Bu)return n(s,i);Bu=!0;try{var o=n(s);return o}finally{if(Bu=!1,(ta!==null||na!==null)&&(hl(),ta&&(s=ta,n=na,na=ta=null,dd(s),n)))for(s=0;s<n.length;s++)dd(n[s])}}function ni(n,s){var i=n.stateNode;if(i===null)return null;var o=i[Ht]||null;if(o===null)return null;i=o[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(n=n.type,o=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!o;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(a(231,s,typeof i));return i}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=!1;if(Qn)try{var ri={};Object.defineProperty(ri,"passive",{get:function(){Hu=!0}}),window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{Hu=!1}var Er=null,Iu=null,Ao=null;function gd(){if(Ao)return Ao;var n,s=Iu,i=s.length,o,f="value"in Er?Er.value:Er.textContent,d=f.length;for(n=0;n<i&&s[n]===f[n];n++);var v=i-n;for(o=1;o<=v&&s[i-o]===f[d-o];o++);return Ao=f.slice(n,1<o?1-o:void 0)}function Oo(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function xo(){return!0}function md(){return!1}function It(n){function s(i,o,f,d,v){this._reactName=i,this._targetInst=f,this.type=o,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var w in n)n.hasOwnProperty(w)&&(i=n[w],this[w]=i?i(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?xo:md,this.isPropagationStopped=md,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=xo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=xo)},persist:function(){},isPersistent:xo}),s}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Co=It(hs),si=m({},hs,{view:0,detail:0}),Mb=It(si),qu,$u,ai,ko=m({},si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ai&&(ai&&n.type==="mousemove"?(qu=n.screenX-ai.screenX,$u=n.screenY-ai.screenY):$u=qu=0,ai=n),qu)},movementY:function(n){return"movementY"in n?n.movementY:$u}}),yd=It(ko),Nb=m({},ko,{dataTransfer:0}),Db=It(Nb),Lb=m({},si,{relatedTarget:0}),Gu=It(Lb),Ub=m({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),Pb=It(Ub),zb=m({},hs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Bb=It(zb),Hb=m({},hs,{data:0}),vd=It(Hb),Ib={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$b={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gb(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=$b[n])?!!s[n]:!1}function Vu(){return Gb}var Vb=m({},si,{key:function(n){if(n.key){var s=Ib[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Oo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?qb[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vu,charCode:function(n){return n.type==="keypress"?Oo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Oo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Kb=It(Vb),Yb=m({},ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bd=It(Yb),Fb=m({},si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vu}),Qb=It(Fb),Jb=m({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xb=It(Jb),Zb=m({},ko,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Wb=It(Zb),e_=m({},hs,{newState:0,oldState:0}),t_=It(e_),n_=[9,13,27,32],Ku=Qn&&"CompositionEvent"in window,ii=null;Qn&&"documentMode"in document&&(ii=document.documentMode);var r_=Qn&&"TextEvent"in window&&!ii,_d=Qn&&(!Ku||ii&&8<ii&&11>=ii),wd=" ",Sd=!1;function Ed(n,s){switch(n){case"keyup":return n_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Td(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ra=!1;function s_(n,s){switch(n){case"compositionend":return Td(s);case"keypress":return s.which!==32?null:(Sd=!0,wd);case"textInput":return n=s.data,n===wd&&Sd?null:n;default:return null}}function a_(n,s){if(ra)return n==="compositionend"||!Ku&&Ed(n,s)?(n=gd(),Ao=Iu=Er=null,ra=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _d&&s.locale!=="ko"?null:s.data;default:return null}}var i_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rd(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!i_[n.type]:s==="textarea"}function Ad(n,s,i,o){ta?na?na.push(o):na=[o]:ta=o,s=bl(s,"onChange"),0<s.length&&(i=new Co("onChange","change",null,i,o),n.push({event:i,listeners:s}))}var oi=null,li=null;function o_(n){lm(n,0)}function jo(n){var s=ti(n);if(od(s))return n}function Od(n,s){if(n==="change")return s}var xd=!1;if(Qn){var Yu;if(Qn){var Fu="oninput"in document;if(!Fu){var Cd=document.createElement("div");Cd.setAttribute("oninput","return;"),Fu=typeof Cd.oninput=="function"}Yu=Fu}else Yu=!1;xd=Yu&&(!document.documentMode||9<document.documentMode)}function kd(){oi&&(oi.detachEvent("onpropertychange",jd),li=oi=null)}function jd(n){if(n.propertyName==="value"&&jo(li)){var s=[];Ad(s,li,n,zu(n)),pd(o_,s)}}function l_(n,s,i){n==="focusin"?(kd(),oi=s,li=i,oi.attachEvent("onpropertychange",jd)):n==="focusout"&&kd()}function u_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return jo(li)}function c_(n,s){if(n==="click")return jo(s)}function f_(n,s){if(n==="input"||n==="change")return jo(s)}function h_(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var Wt=typeof Object.is=="function"?Object.is:h_;function ui(n,s){if(Wt(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var i=Object.keys(n),o=Object.keys(s);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var f=i[o];if(!vt.call(s,f)||!Wt(n[f],s[f]))return!1}return!0}function Md(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Nd(n,s){var i=Md(n);n=0;for(var o;i;){if(i.nodeType===3){if(o=n+i.textContent.length,n<=s&&o>=s)return{node:i,offset:s-n};n=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Md(i)}}function Dd(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?Dd(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Ld(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=To(n.document);s instanceof n.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)n=s.contentWindow;else break;s=To(n.document)}return s}function Qu(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var d_=Qn&&"documentMode"in document&&11>=document.documentMode,sa=null,Ju=null,ci=null,Xu=!1;function Ud(n,s,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Xu||sa==null||sa!==To(o)||(o=sa,"selectionStart"in o&&Qu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ci&&ui(ci,o)||(ci=o,o=bl(Ju,"onSelect"),0<o.length&&(s=new Co("onSelect","select",null,s,i),n.push({event:s,listeners:o}),s.target=sa)))}function ds(n,s){var i={};return i[n.toLowerCase()]=s.toLowerCase(),i["Webkit"+n]="webkit"+s,i["Moz"+n]="moz"+s,i}var aa={animationend:ds("Animation","AnimationEnd"),animationiteration:ds("Animation","AnimationIteration"),animationstart:ds("Animation","AnimationStart"),transitionrun:ds("Transition","TransitionRun"),transitionstart:ds("Transition","TransitionStart"),transitioncancel:ds("Transition","TransitionCancel"),transitionend:ds("Transition","TransitionEnd")},Zu={},Pd={};Qn&&(Pd=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function ps(n){if(Zu[n])return Zu[n];if(!aa[n])return n;var s=aa[n],i;for(i in s)if(s.hasOwnProperty(i)&&i in Pd)return Zu[n]=s[i];return n}var zd=ps("animationend"),Bd=ps("animationiteration"),Hd=ps("animationstart"),p_=ps("transitionrun"),g_=ps("transitionstart"),m_=ps("transitioncancel"),Id=ps("transitionend"),qd=new Map,Wu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wu.push("scrollEnd");function En(n,s){qd.set(n,s),fs(s,[n])}var Mo=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},hn=[],ia=0,ec=0;function No(){for(var n=ia,s=ec=ia=0;s<n;){var i=hn[s];hn[s++]=null;var o=hn[s];hn[s++]=null;var f=hn[s];hn[s++]=null;var d=hn[s];if(hn[s++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}d!==0&&$d(i,f,d)}}function Do(n,s,i,o){hn[ia++]=n,hn[ia++]=s,hn[ia++]=i,hn[ia++]=o,ec|=o,n.lanes|=o,n=n.alternate,n!==null&&(n.lanes|=o)}function tc(n,s,i,o){return Do(n,s,i,o),Lo(n)}function gs(n,s){return Do(n,null,null,s),Lo(n)}function $d(n,s,i){n.lanes|=i;var o=n.alternate;o!==null&&(o.lanes|=i);for(var f=!1,d=n.return;d!==null;)d.childLanes|=i,o=d.alternate,o!==null&&(o.childLanes|=i),d.tag===22&&(n=d.stateNode,n===null||n._visibility&1||(f=!0)),n=d,d=d.return;return n.tag===3?(d=n.stateNode,f&&s!==null&&(f=31-Ot(i),n=d.hiddenUpdates,o=n[f],o===null?n[f]=[s]:o.push(s),s.lane=i|536870912),d):null}function Lo(n){if(50<Mi)throw Mi=0,ff=null,Error(a(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var oa={};function y_(n,s,i,o){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(n,s,i,o){return new y_(n,s,i,o)}function nc(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Jn(n,s){var i=n.alternate;return i===null?(i=en(n.tag,s,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=s,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,s=n.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Gd(n,s){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,s=i.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function Uo(n,s,i,o,f,d){var v=0;if(o=n,typeof n=="function")nc(n)&&(v=1);else if(typeof n=="string")v=Sw(n,i,J.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case W:return n=en(31,i,s,f),n.elementType=W,n.lanes=d,n;case O:return ms(i.children,f,d,s);case E:v=8,f|=24;break;case A:return n=en(12,i,s,f|2),n.elementType=A,n.lanes=d,n;case X:return n=en(13,i,s,f),n.elementType=X,n.lanes=d,n;case K:return n=en(19,i,s,f),n.elementType=K,n.lanes=d,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case j:v=10;break e;case M:v=9;break e;case D:v=11;break e;case H:v=14;break e;case Y:v=16,o=null;break e}v=29,i=Error(a(130,n===null?"null":typeof n,"")),o=null}return s=en(v,i,s,f),s.elementType=n,s.type=o,s.lanes=d,s}function ms(n,s,i,o){return n=en(7,n,o,s),n.lanes=i,n}function rc(n,s,i){return n=en(6,n,null,s),n.lanes=i,n}function Vd(n){var s=en(18,null,null,0);return s.stateNode=n,s}function sc(n,s,i){return s=en(4,n.children!==null?n.children:[],n.key,s),s.lanes=i,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var Kd=new WeakMap;function dn(n,s){if(typeof n=="object"&&n!==null){var i=Kd.get(n);return i!==void 0?i:(s={value:n,source:s,stack:ln(s)},Kd.set(n,s),s)}return{value:n,source:s,stack:ln(s)}}var la=[],ua=0,Po=null,fi=0,pn=[],gn=0,Tr=null,Dn=1,Ln="";function Xn(n,s){la[ua++]=fi,la[ua++]=Po,Po=n,fi=s}function Yd(n,s,i){pn[gn++]=Dn,pn[gn++]=Ln,pn[gn++]=Tr,Tr=n;var o=Dn;n=Ln;var f=32-Ot(o)-1;o&=~(1<<f),i+=1;var d=32-Ot(s)+f;if(30<d){var v=f-f%5;d=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Dn=1<<32-Ot(s)+f|i<<f|o,Ln=d+n}else Dn=1<<d|i<<f|o,Ln=n}function ac(n){n.return!==null&&(Xn(n,1),Yd(n,1,0))}function ic(n){for(;n===Po;)Po=la[--ua],la[ua]=null,fi=la[--ua],la[ua]=null;for(;n===Tr;)Tr=pn[--gn],pn[gn]=null,Ln=pn[--gn],pn[gn]=null,Dn=pn[--gn],pn[gn]=null}function Fd(n,s){pn[gn++]=Dn,pn[gn++]=Ln,pn[gn++]=Tr,Dn=s.id,Ln=s.overflow,Tr=n}var _t=null,Ge=null,Oe=!1,Rr=null,mn=!1,oc=Error(a(519));function Ar(n){var s=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hi(dn(s,n)),oc}function Qd(n){var s=n.stateNode,i=n.type,o=n.memoizedProps;switch(s[bt]=n,s[Ht]=o,i){case"dialog":Te("cancel",s),Te("close",s);break;case"iframe":case"object":case"embed":Te("load",s);break;case"video":case"audio":for(i=0;i<Di.length;i++)Te(Di[i],s);break;case"source":Te("error",s);break;case"img":case"image":case"link":Te("error",s),Te("load",s);break;case"details":Te("toggle",s);break;case"input":Te("invalid",s),ld(s,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Te("invalid",s);break;case"textarea":Te("invalid",s),cd(s,o.value,o.defaultValue,o.children)}i=o.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||o.suppressHydrationWarning===!0||hm(s.textContent,i)?(o.popover!=null&&(Te("beforetoggle",s),Te("toggle",s)),o.onScroll!=null&&Te("scroll",s),o.onScrollEnd!=null&&Te("scrollend",s),o.onClick!=null&&(s.onclick=Fn),s=!0):s=!1,s||Ar(n,!0)}function Jd(n){for(_t=n.return;_t;)switch(_t.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:_t=_t.return}}function ca(n){if(n!==_t)return!1;if(!Oe)return Jd(n),Oe=!0,!1;var s=n.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||Af(n.type,n.memoizedProps)),i=!i),i&&Ge&&Ar(n),Jd(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Ge=wm(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Ge=wm(n)}else s===27?(s=Ge,Hr(n.type)?(n=jf,jf=null,Ge=n):Ge=s):Ge=_t?vn(n.stateNode.nextSibling):null;return!0}function ys(){Ge=_t=null,Oe=!1}function lc(){var n=Rr;return n!==null&&(Vt===null?Vt=n:Vt.push.apply(Vt,n),Rr=null),n}function hi(n){Rr===null?Rr=[n]:Rr.push(n)}var uc=C(null),vs=null,Zn=null;function Or(n,s,i){V(uc,s._currentValue),s._currentValue=i}function Wn(n){n._currentValue=uc.current,q(uc)}function cc(n,s,i){for(;n!==null;){var o=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),n===i)break;n=n.return}}function fc(n,s,i,o){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var d=f.dependencies;if(d!==null){var v=f.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=f;for(var x=0;x<s.length;x++)if(w.context===s[x]){d.lanes|=i,w=d.alternate,w!==null&&(w.lanes|=i),cc(d.return,i,n),o||(v=null);break e}d=w.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(a(341));v.lanes|=i,d=v.alternate,d!==null&&(d.lanes|=i),cc(v,i,n),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===n){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function fa(n,s,i,o){n=null;for(var f=s,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(a(387));if(v=v.memoizedProps,v!==null){var w=f.type;Wt(f.pendingProps.value,v.value)||(n!==null?n.push(w):n=[w])}}else if(f===we.current){if(v=f.alternate,v===null)throw Error(a(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(Bi):n=[Bi])}f=f.return}n!==null&&fc(s,n,i,o),s.flags|=262144}function zo(n){for(n=n.firstContext;n!==null;){if(!Wt(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function bs(n){vs=n,Zn=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function wt(n){return Xd(vs,n)}function Bo(n,s){return vs===null&&bs(n),Xd(n,s)}function Xd(n,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},Zn===null){if(n===null)throw Error(a(308));Zn=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else Zn=Zn.next=s;return i}var v_=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(i,o){n.push(o)}};this.abort=function(){s.aborted=!0,n.forEach(function(i){return i()})}},b_=t.unstable_scheduleCallback,__=t.unstable_NormalPriority,nt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hc(){return{controller:new v_,data:new Map,refCount:0}}function di(n){n.refCount--,n.refCount===0&&b_(__,function(){n.controller.abort()})}var pi=null,dc=0,ha=0,da=null;function w_(n,s){if(pi===null){var i=pi=[];dc=0,ha=yf(),da={status:"pending",value:void 0,then:function(o){i.push(o)}}}return dc++,s.then(Zd,Zd),s}function Zd(){if(--dc===0&&pi!==null){da!==null&&(da.status="fulfilled");var n=pi;pi=null,ha=0,da=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function S_(n,s){var i=[],o={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return n.then(function(){o.status="fulfilled",o.value=s;for(var f=0;f<i.length;f++)(0,i[f])(s)},function(f){for(o.status="rejected",o.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),o}var Wd=U.S;U.S=function(n,s){Ug=ht(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&w_(n,s),Wd!==null&&Wd(n,s)};var _s=C(null);function pc(){var n=_s.current;return n!==null?n:He.pooledCache}function Ho(n,s){s===null?V(_s,_s.current):V(_s,s.pool)}function ep(){var n=pc();return n===null?null:{parent:nt._currentValue,pool:n}}var pa=Error(a(460)),gc=Error(a(474)),Io=Error(a(542)),qo={then:function(){}};function tp(n){return n=n.status,n==="fulfilled"||n==="rejected"}function np(n,s,i){switch(i=n[i],i===void 0?n.push(s):i!==s&&(s.then(Fn,Fn),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,sp(n),n;default:if(typeof s.status=="string")s.then(Fn,Fn);else{if(n=He,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=s,n.status="pending",n.then(function(o){if(s.status==="pending"){var f=s;f.status="fulfilled",f.value=o}},function(o){if(s.status==="pending"){var f=s;f.status="rejected",f.reason=o}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,sp(n),n}throw Ss=s,pa}}function ws(n){try{var s=n._init;return s(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ss=i,pa):i}}var Ss=null;function rp(){if(Ss===null)throw Error(a(459));var n=Ss;return Ss=null,n}function sp(n){if(n===pa||n===Io)throw Error(a(483))}var ga=null,gi=0;function $o(n){var s=gi;return gi+=1,ga===null&&(ga=[]),np(ga,n,s)}function mi(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function Go(n,s){throw s.$$typeof===b?Error(a(525)):(n=Object.prototype.toString.call(s),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function ap(n){function s(N,k){if(n){var L=N.deletions;L===null?(N.deletions=[k],N.flags|=16):L.push(k)}}function i(N,k){if(!n)return null;for(;k!==null;)s(N,k),k=k.sibling;return null}function o(N){for(var k=new Map;N!==null;)N.key!==null?k.set(N.key,N):k.set(N.index,N),N=N.sibling;return k}function f(N,k){return N=Jn(N,k),N.index=0,N.sibling=null,N}function d(N,k,L){return N.index=L,n?(L=N.alternate,L!==null?(L=L.index,L<k?(N.flags|=67108866,k):L):(N.flags|=67108866,k)):(N.flags|=1048576,k)}function v(N){return n&&N.alternate===null&&(N.flags|=67108866),N}function w(N,k,L,$){return k===null||k.tag!==6?(k=rc(L,N.mode,$),k.return=N,k):(k=f(k,L),k.return=N,k)}function x(N,k,L,$){var ue=L.type;return ue===O?I(N,k,L.props.children,$,L.key):k!==null&&(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Y&&ws(ue)===k.type)?(k=f(k,L.props),mi(k,L),k.return=N,k):(k=Uo(L.type,L.key,L.props,null,N.mode,$),mi(k,L),k.return=N,k)}function P(N,k,L,$){return k===null||k.tag!==4||k.stateNode.containerInfo!==L.containerInfo||k.stateNode.implementation!==L.implementation?(k=sc(L,N.mode,$),k.return=N,k):(k=f(k,L.children||[]),k.return=N,k)}function I(N,k,L,$,ue){return k===null||k.tag!==7?(k=ms(L,N.mode,$,ue),k.return=N,k):(k=f(k,L),k.return=N,k)}function G(N,k,L){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=rc(""+k,N.mode,L),k.return=N,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case _:return L=Uo(k.type,k.key,k.props,null,N.mode,L),mi(L,k),L.return=N,L;case S:return k=sc(k,N.mode,L),k.return=N,k;case Y:return k=ws(k),G(N,k,L)}if(Me(k)||me(k))return k=ms(k,N.mode,L,null),k.return=N,k;if(typeof k.then=="function")return G(N,$o(k),L);if(k.$$typeof===j)return G(N,Bo(N,k),L);Go(N,k)}return null}function z(N,k,L,$){var ue=k!==null?k.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ue!==null?null:w(N,k,""+L,$);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return L.key===ue?x(N,k,L,$):null;case S:return L.key===ue?P(N,k,L,$):null;case Y:return L=ws(L),z(N,k,L,$)}if(Me(L)||me(L))return ue!==null?null:I(N,k,L,$,null);if(typeof L.then=="function")return z(N,k,$o(L),$);if(L.$$typeof===j)return z(N,k,Bo(N,L),$);Go(N,L)}return null}function B(N,k,L,$,ue){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return N=N.get(L)||null,w(k,N,""+$,ue);if(typeof $=="object"&&$!==null){switch($.$$typeof){case _:return N=N.get($.key===null?L:$.key)||null,x(k,N,$,ue);case S:return N=N.get($.key===null?L:$.key)||null,P(k,N,$,ue);case Y:return $=ws($),B(N,k,L,$,ue)}if(Me($)||me($))return N=N.get(L)||null,I(k,N,$,ue,null);if(typeof $.then=="function")return B(N,k,L,$o($),ue);if($.$$typeof===j)return B(N,k,L,Bo(k,$),ue);Go(k,$)}return null}function re(N,k,L,$){for(var ue=null,Ce=null,oe=k,be=k=0,Ae=null;oe!==null&&be<L.length;be++){oe.index>be?(Ae=oe,oe=null):Ae=oe.sibling;var ke=z(N,oe,L[be],$);if(ke===null){oe===null&&(oe=Ae);break}n&&oe&&ke.alternate===null&&s(N,oe),k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke,oe=Ae}if(be===L.length)return i(N,oe),Oe&&Xn(N,be),ue;if(oe===null){for(;be<L.length;be++)oe=G(N,L[be],$),oe!==null&&(k=d(oe,k,be),Ce===null?ue=oe:Ce.sibling=oe,Ce=oe);return Oe&&Xn(N,be),ue}for(oe=o(oe);be<L.length;be++)Ae=B(oe,N,be,L[be],$),Ae!==null&&(n&&Ae.alternate!==null&&oe.delete(Ae.key===null?be:Ae.key),k=d(Ae,k,be),Ce===null?ue=Ae:Ce.sibling=Ae,Ce=Ae);return n&&oe.forEach(function(Vr){return s(N,Vr)}),Oe&&Xn(N,be),ue}function fe(N,k,L,$){if(L==null)throw Error(a(151));for(var ue=null,Ce=null,oe=k,be=k=0,Ae=null,ke=L.next();oe!==null&&!ke.done;be++,ke=L.next()){oe.index>be?(Ae=oe,oe=null):Ae=oe.sibling;var Vr=z(N,oe,ke.value,$);if(Vr===null){oe===null&&(oe=Ae);break}n&&oe&&Vr.alternate===null&&s(N,oe),k=d(Vr,k,be),Ce===null?ue=Vr:Ce.sibling=Vr,Ce=Vr,oe=Ae}if(ke.done)return i(N,oe),Oe&&Xn(N,be),ue;if(oe===null){for(;!ke.done;be++,ke=L.next())ke=G(N,ke.value,$),ke!==null&&(k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke);return Oe&&Xn(N,be),ue}for(oe=o(oe);!ke.done;be++,ke=L.next())ke=B(oe,N,be,ke.value,$),ke!==null&&(n&&ke.alternate!==null&&oe.delete(ke.key===null?be:ke.key),k=d(ke,k,be),Ce===null?ue=ke:Ce.sibling=ke,Ce=ke);return n&&oe.forEach(function(Nw){return s(N,Nw)}),Oe&&Xn(N,be),ue}function Be(N,k,L,$){if(typeof L=="object"&&L!==null&&L.type===O&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _:e:{for(var ue=L.key;k!==null;){if(k.key===ue){if(ue=L.type,ue===O){if(k.tag===7){i(N,k.sibling),$=f(k,L.props.children),$.return=N,N=$;break e}}else if(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===Y&&ws(ue)===k.type){i(N,k.sibling),$=f(k,L.props),mi($,L),$.return=N,N=$;break e}i(N,k);break}else s(N,k);k=k.sibling}L.type===O?($=ms(L.props.children,N.mode,$,L.key),$.return=N,N=$):($=Uo(L.type,L.key,L.props,null,N.mode,$),mi($,L),$.return=N,N=$)}return v(N);case S:e:{for(ue=L.key;k!==null;){if(k.key===ue)if(k.tag===4&&k.stateNode.containerInfo===L.containerInfo&&k.stateNode.implementation===L.implementation){i(N,k.sibling),$=f(k,L.children||[]),$.return=N,N=$;break e}else{i(N,k);break}else s(N,k);k=k.sibling}$=sc(L,N.mode,$),$.return=N,N=$}return v(N);case Y:return L=ws(L),Be(N,k,L,$)}if(Me(L))return re(N,k,L,$);if(me(L)){if(ue=me(L),typeof ue!="function")throw Error(a(150));return L=ue.call(L),fe(N,k,L,$)}if(typeof L.then=="function")return Be(N,k,$o(L),$);if(L.$$typeof===j)return Be(N,k,Bo(N,L),$);Go(N,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,k!==null&&k.tag===6?(i(N,k.sibling),$=f(k,L),$.return=N,N=$):(i(N,k),$=rc(L,N.mode,$),$.return=N,N=$),v(N)):i(N,k)}return function(N,k,L,$){try{gi=0;var ue=Be(N,k,L,$);return ga=null,ue}catch(oe){if(oe===pa||oe===Io)throw oe;var Ce=en(29,oe,null,N.mode);return Ce.lanes=$,Ce.return=N,Ce}}}var Es=ap(!0),ip=ap(!1),xr=!1;function mc(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Cr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function kr(n,s,i){var o=n.updateQueue;if(o===null)return null;if(o=o.shared,(Ne&2)!==0){var f=o.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),o.pending=s,s=Lo(n),$d(n,null,i),s}return Do(n,o,s,i),Lo(n)}function yi(n,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var o=s.lanes;o&=n.pendingLanes,i|=o,s.lanes=i,zt(n,i)}}function vc(n,s){var i=n.updateQueue,o=n.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var f=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?f=d=v:d=d.next=v,i=i.next}while(i!==null);d===null?f=d=s:d=d.next=s}else f=d=s;i={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=s:n.next=s,i.lastBaseUpdate=s}var bc=!1;function vi(){if(bc){var n=da;if(n!==null)throw n}}function bi(n,s,i,o){bc=!1;var f=n.updateQueue;xr=!1;var d=f.firstBaseUpdate,v=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var x=w,P=x.next;x.next=null,v===null?d=P:v.next=P,v=x;var I=n.alternate;I!==null&&(I=I.updateQueue,w=I.lastBaseUpdate,w!==v&&(w===null?I.firstBaseUpdate=P:w.next=P,I.lastBaseUpdate=x))}if(d!==null){var G=f.baseState;v=0,I=P=x=null,w=d;do{var z=w.lane&-536870913,B=z!==w.lane;if(B?(Re&z)===z:(o&z)===z){z!==0&&z===ha&&(bc=!0),I!==null&&(I=I.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var re=n,fe=w;z=s;var Be=i;switch(fe.tag){case 1:if(re=fe.payload,typeof re=="function"){G=re.call(Be,G,z);break e}G=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=fe.payload,z=typeof re=="function"?re.call(Be,G,z):re,z==null)break e;G=m({},G,z);break e;case 2:xr=!0}}z=w.callback,z!==null&&(n.flags|=64,B&&(n.flags|=8192),B=f.callbacks,B===null?f.callbacks=[z]:B.push(z))}else B={lane:z,tag:w.tag,payload:w.payload,callback:w.callback,next:null},I===null?(P=I=B,x=G):I=I.next=B,v|=z;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;B=w,w=B.next,B.next=null,f.lastBaseUpdate=B,f.shared.pending=null}}while(!0);I===null&&(x=G),f.baseState=x,f.firstBaseUpdate=P,f.lastBaseUpdate=I,d===null&&(f.shared.lanes=0),Lr|=v,n.lanes=v,n.memoizedState=G}}function op(n,s){if(typeof n!="function")throw Error(a(191,n));n.call(s)}function lp(n,s){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)op(i[n],s)}var ma=C(null),Vo=C(0);function up(n,s){n=lr,V(Vo,n),V(ma,s),lr=n|s.baseLanes}function _c(){V(Vo,lr),V(ma,ma.current)}function wc(){lr=Vo.current,q(ma),q(Vo)}var tn=C(null),yn=null;function jr(n){var s=n.alternate;V(et,et.current&1),V(tn,n),yn===null&&(s===null||ma.current!==null||s.memoizedState!==null)&&(yn=n)}function Sc(n){V(et,et.current),V(tn,n),yn===null&&(yn=n)}function cp(n){n.tag===22?(V(et,et.current),V(tn,n),yn===null&&(yn=n)):Mr()}function Mr(){V(et,et.current),V(tn,tn.current)}function nn(n){q(tn),yn===n&&(yn=null),q(et)}var et=C(0);function Ko(n){for(var s=n;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Cf(i)||kf(i)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var er=0,ve=null,Pe=null,rt=null,Yo=!1,ya=!1,Ts=!1,Fo=0,_i=0,va=null,E_=0;function Xe(){throw Error(a(321))}function Ec(n,s){if(s===null)return!1;for(var i=0;i<s.length&&i<n.length;i++)if(!Wt(n[i],s[i]))return!1;return!0}function Tc(n,s,i,o,f,d){return er=d,ve=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,U.H=n===null||n.memoizedState===null?Yp:Bc,Ts=!1,d=i(o,f),Ts=!1,ya&&(d=hp(s,i,o,f)),fp(n),d}function fp(n){U.H=Ei;var s=Pe!==null&&Pe.next!==null;if(er=0,rt=Pe=ve=null,Yo=!1,_i=0,va=null,s)throw Error(a(300));n===null||st||(n=n.dependencies,n!==null&&zo(n)&&(st=!0))}function hp(n,s,i,o){ve=n;var f=0;do{if(ya&&(va=null),_i=0,ya=!1,25<=f)throw Error(a(301));if(f+=1,rt=Pe=null,n.updateQueue!=null){var d=n.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}U.H=Fp,d=s(i,o)}while(ya);return d}function T_(){var n=U.H,s=n.useState()[0];return s=typeof s.then=="function"?wi(s):s,n=n.useState()[0],(Pe!==null?Pe.memoizedState:null)!==n&&(ve.flags|=1024),s}function Rc(){var n=Fo!==0;return Fo=0,n}function Ac(n,s,i){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~i}function Oc(n){if(Yo){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Yo=!1}er=0,rt=Pe=ve=null,ya=!1,_i=Fo=0,va=null}function Mt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?ve.memoizedState=rt=n:rt=rt.next=n,rt}function tt(){if(Pe===null){var n=ve.alternate;n=n!==null?n.memoizedState:null}else n=Pe.next;var s=rt===null?ve.memoizedState:rt.next;if(s!==null)rt=s,Pe=n;else{if(n===null)throw ve.alternate===null?Error(a(467)):Error(a(310));Pe=n,n={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},rt===null?ve.memoizedState=rt=n:rt=rt.next=n}return rt}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wi(n){var s=_i;return _i+=1,va===null&&(va=[]),n=np(va,n,s),s=ve,(rt===null?s.memoizedState:rt.next)===null&&(s=s.alternate,U.H=s===null||s.memoizedState===null?Yp:Bc),n}function Jo(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return wi(n);if(n.$$typeof===j)return wt(n)}throw Error(a(438,String(n)))}function xc(n){var s=null,i=ve.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var o=ve.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(s={data:o.data.map(function(f){return f.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=Qo(),ve.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(n),o=0;o<n;o++)i[o]=le;return s.index++,i}function tr(n,s){return typeof s=="function"?s(n):s}function Xo(n){var s=tt();return Cc(s,Pe,n)}function Cc(n,s,i){var o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=i;var f=n.baseQueue,d=o.pending;if(d!==null){if(f!==null){var v=f.next;f.next=d.next,d.next=v}s.baseQueue=f=d,o.pending=null}if(d=n.baseState,f===null)n.memoizedState=d;else{s=f.next;var w=v=null,x=null,P=s,I=!1;do{var G=P.lane&-536870913;if(G!==P.lane?(Re&G)===G:(er&G)===G){var z=P.revertLane;if(z===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),G===ha&&(I=!0);else if((er&z)===z){P=P.next,z===ha&&(I=!0);continue}else G={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},x===null?(w=x=G,v=d):x=x.next=G,ve.lanes|=z,Lr|=z;G=P.action,Ts&&i(d,G),d=P.hasEagerState?P.eagerState:i(d,G)}else z={lane:G,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},x===null?(w=x=z,v=d):x=x.next=z,ve.lanes|=G,Lr|=G;P=P.next}while(P!==null&&P!==s);if(x===null?v=d:x.next=w,!Wt(d,n.memoizedState)&&(st=!0,I&&(i=da,i!==null)))throw i;n.memoizedState=d,n.baseState=v,n.baseQueue=x,o.lastRenderedState=d}return f===null&&(o.lanes=0),[n.memoizedState,o.dispatch]}function kc(n){var s=tt(),i=s.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=n;var o=i.dispatch,f=i.pending,d=s.memoizedState;if(f!==null){i.pending=null;var v=f=f.next;do d=n(d,v.action),v=v.next;while(v!==f);Wt(d,s.memoizedState)||(st=!0),s.memoizedState=d,s.baseQueue===null&&(s.baseState=d),i.lastRenderedState=d}return[d,o]}function dp(n,s,i){var o=ve,f=tt(),d=Oe;if(d){if(i===void 0)throw Error(a(407));i=i()}else i=s();var v=!Wt((Pe||f).memoizedState,i);if(v&&(f.memoizedState=i,st=!0),f=f.queue,Nc(mp.bind(null,o,f,n),[n]),f.getSnapshot!==s||v||rt!==null&&rt.memoizedState.tag&1){if(o.flags|=2048,ba(9,{destroy:void 0},gp.bind(null,o,f,i,s),null),He===null)throw Error(a(349));d||(er&127)!==0||pp(o,s,i)}return i}function pp(n,s,i){n.flags|=16384,n={getSnapshot:s,value:i},s=ve.updateQueue,s===null?(s=Qo(),ve.updateQueue=s,s.stores=[n]):(i=s.stores,i===null?s.stores=[n]:i.push(n))}function gp(n,s,i,o){s.value=i,s.getSnapshot=o,yp(s)&&vp(n)}function mp(n,s,i){return i(function(){yp(s)&&vp(n)})}function yp(n){var s=n.getSnapshot;n=n.value;try{var i=s();return!Wt(n,i)}catch{return!0}}function vp(n){var s=gs(n,2);s!==null&&Kt(s,n,2)}function jc(n){var s=Mt();if(typeof n=="function"){var i=n;if(n=i(),Ts){wn(!0);try{i()}finally{wn(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:n},s}function bp(n,s,i,o){return n.baseState=i,Cc(n,Pe,typeof o=="function"?o:tr)}function R_(n,s,i,o,f){if(el(n))throw Error(a(485));if(n=s.action,n!==null){var d={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};U.T!==null?i(!0):d.isTransition=!1,o(d),i=s.pending,i===null?(d.next=s.pending=d,_p(s,d)):(d.next=i.next,s.pending=i.next=d)}}function _p(n,s){var i=s.action,o=s.payload,f=n.state;if(s.isTransition){var d=U.T,v={};U.T=v;try{var w=i(f,o),x=U.S;x!==null&&x(v,w),wp(n,s,w)}catch(P){Mc(n,s,P)}finally{d!==null&&v.types!==null&&(d.types=v.types),U.T=d}}else try{d=i(f,o),wp(n,s,d)}catch(P){Mc(n,s,P)}}function wp(n,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(o){Sp(n,s,o)},function(o){return Mc(n,s,o)}):Sp(n,s,i)}function Sp(n,s,i){s.status="fulfilled",s.value=i,Ep(s),n.state=i,s=n.pending,s!==null&&(i=s.next,i===s?n.pending=null:(i=i.next,s.next=i,_p(n,i)))}function Mc(n,s,i){var o=n.pending;if(n.pending=null,o!==null){o=o.next;do s.status="rejected",s.reason=i,Ep(s),s=s.next;while(s!==o)}n.action=null}function Ep(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function Tp(n,s){return s}function Rp(n,s){if(Oe){var i=He.formState;if(i!==null){e:{var o=ve;if(Oe){if(Ge){t:{for(var f=Ge,d=mn;f.nodeType!==8;){if(!d){f=null;break t}if(f=vn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Ge=vn(f.nextSibling),o=f.data==="F!";break e}}Ar(o)}o=!1}o&&(s=i[0])}}return i=Mt(),i.memoizedState=i.baseState=s,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tp,lastRenderedState:s},i.queue=o,i=Gp.bind(null,ve,o),o.dispatch=i,o=jc(!1),d=zc.bind(null,ve,!1,o.queue),o=Mt(),f={state:s,dispatch:null,action:n,pending:null},o.queue=f,i=R_.bind(null,ve,f,d,i),f.dispatch=i,o.memoizedState=n,[s,i,!1]}function Ap(n){var s=tt();return Op(s,Pe,n)}function Op(n,s,i){if(s=Cc(n,s,Tp)[0],n=Xo(tr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var o=wi(s)}catch(v){throw v===pa?Io:v}else o=s;s=tt();var f=s.queue,d=f.dispatch;return i!==s.memoizedState&&(ve.flags|=2048,ba(9,{destroy:void 0},A_.bind(null,f,i),null)),[o,d,n]}function A_(n,s){n.action=s}function xp(n){var s=tt(),i=Pe;if(i!==null)return Op(s,i,n);tt(),s=s.memoizedState,i=tt();var o=i.queue.dispatch;return i.memoizedState=n,[s,o,!1]}function ba(n,s,i,o){return n={tag:n,create:i,deps:o,inst:s,next:null},s=ve.updateQueue,s===null&&(s=Qo(),ve.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=n.next=n:(o=i.next,i.next=n,n.next=o,s.lastEffect=n),n}function Cp(){return tt().memoizedState}function Zo(n,s,i,o){var f=Mt();ve.flags|=n,f.memoizedState=ba(1|s,{destroy:void 0},i,o===void 0?null:o)}function Wo(n,s,i,o){var f=tt();o=o===void 0?null:o;var d=f.memoizedState.inst;Pe!==null&&o!==null&&Ec(o,Pe.memoizedState.deps)?f.memoizedState=ba(s,d,i,o):(ve.flags|=n,f.memoizedState=ba(1|s,d,i,o))}function kp(n,s){Zo(8390656,8,n,s)}function Nc(n,s){Wo(2048,8,n,s)}function O_(n){ve.flags|=4;var s=ve.updateQueue;if(s===null)s=Qo(),ve.updateQueue=s,s.events=[n];else{var i=s.events;i===null?s.events=[n]:i.push(n)}}function jp(n){var s=tt().memoizedState;return O_({ref:s,nextImpl:n}),function(){if((Ne&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}function Mp(n,s){return Wo(4,2,n,s)}function Np(n,s){return Wo(4,4,n,s)}function Dp(n,s){if(typeof s=="function"){n=n();var i=s(n);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Lp(n,s,i){i=i!=null?i.concat([n]):null,Wo(4,4,Dp.bind(null,s,n),i)}function Dc(){}function Up(n,s){var i=tt();s=s===void 0?null:s;var o=i.memoizedState;return s!==null&&Ec(s,o[1])?o[0]:(i.memoizedState=[n,s],n)}function Pp(n,s){var i=tt();s=s===void 0?null:s;var o=i.memoizedState;if(s!==null&&Ec(s,o[1]))return o[0];if(o=n(),Ts){wn(!0);try{n()}finally{wn(!1)}}return i.memoizedState=[o,s],o}function Lc(n,s,i){return i===void 0||(er&1073741824)!==0&&(Re&261930)===0?n.memoizedState=s:(n.memoizedState=i,n=zg(),ve.lanes|=n,Lr|=n,i)}function zp(n,s,i,o){return Wt(i,s)?i:ma.current!==null?(n=Lc(n,i,o),Wt(n,s)||(st=!0),n):(er&42)===0||(er&1073741824)!==0&&(Re&261930)===0?(st=!0,n.memoizedState=i):(n=zg(),ve.lanes|=n,Lr|=n,s)}function Bp(n,s,i,o,f){var d=F.p;F.p=d!==0&&8>d?d:8;var v=U.T,w={};U.T=w,zc(n,!1,s,i);try{var x=f(),P=U.S;if(P!==null&&P(w,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var I=S_(x,o);Si(n,s,I,an(n))}else Si(n,s,o,an(n))}catch(G){Si(n,s,{then:function(){},status:"rejected",reason:G},an())}finally{F.p=d,v!==null&&w.types!==null&&(v.types=w.types),U.T=v}}function x_(){}function Uc(n,s,i,o){if(n.tag!==5)throw Error(a(476));var f=Hp(n).queue;Bp(n,f,s,ae,i===null?x_:function(){return Ip(n),i(o)})}function Hp(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:ae},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:i},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function Ip(n){var s=Hp(n);s.next===null&&(s=n.alternate.memoizedState),Si(n,s.next.queue,{},an())}function Pc(){return wt(Bi)}function qp(){return tt().memoizedState}function $p(){return tt().memoizedState}function C_(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var i=an();n=Cr(i);var o=kr(s,n,i);o!==null&&(Kt(o,s,i),yi(o,s,i)),s={cache:hc()},n.payload=s;return}s=s.return}}function k_(n,s,i){var o=an();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},el(n)?Vp(s,i):(i=tc(n,s,i,o),i!==null&&(Kt(i,n,o),Kp(i,s,o)))}function Gp(n,s,i){var o=an();Si(n,s,i,o)}function Si(n,s,i,o){var f={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(el(n))Vp(s,f);else{var d=n.alternate;if(n.lanes===0&&(d===null||d.lanes===0)&&(d=s.lastRenderedReducer,d!==null))try{var v=s.lastRenderedState,w=d(v,i);if(f.hasEagerState=!0,f.eagerState=w,Wt(w,v))return Do(n,s,f,0),He===null&&No(),!1}catch{}if(i=tc(n,s,f,o),i!==null)return Kt(i,n,o),Kp(i,s,o),!0}return!1}function zc(n,s,i,o){if(o={lane:2,revertLane:yf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},el(n)){if(s)throw Error(a(479))}else s=tc(n,i,o,2),s!==null&&Kt(s,n,2)}function el(n){var s=n.alternate;return n===ve||s!==null&&s===ve}function Vp(n,s){ya=Yo=!0;var i=n.pending;i===null?s.next=s:(s.next=i.next,i.next=s),n.pending=s}function Kp(n,s,i){if((i&4194048)!==0){var o=s.lanes;o&=n.pendingLanes,i|=o,s.lanes=i,zt(n,i)}}var Ei={readContext:wt,use:Jo,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Ei.useEffectEvent=Xe;var Yp={readContext:wt,use:Jo,useCallback:function(n,s){return Mt().memoizedState=[n,s===void 0?null:s],n},useContext:wt,useEffect:kp,useImperativeHandle:function(n,s,i){i=i!=null?i.concat([n]):null,Zo(4194308,4,Dp.bind(null,s,n),i)},useLayoutEffect:function(n,s){return Zo(4194308,4,n,s)},useInsertionEffect:function(n,s){Zo(4,2,n,s)},useMemo:function(n,s){var i=Mt();s=s===void 0?null:s;var o=n();if(Ts){wn(!0);try{n()}finally{wn(!1)}}return i.memoizedState=[o,s],o},useReducer:function(n,s,i){var o=Mt();if(i!==void 0){var f=i(s);if(Ts){wn(!0);try{i(s)}finally{wn(!1)}}}else f=s;return o.memoizedState=o.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},o.queue=n,n=n.dispatch=k_.bind(null,ve,n),[o.memoizedState,n]},useRef:function(n){var s=Mt();return n={current:n},s.memoizedState=n},useState:function(n){n=jc(n);var s=n.queue,i=Gp.bind(null,ve,s);return s.dispatch=i,[n.memoizedState,i]},useDebugValue:Dc,useDeferredValue:function(n,s){var i=Mt();return Lc(i,n,s)},useTransition:function(){var n=jc(!1);return n=Bp.bind(null,ve,n.queue,!0,!1),Mt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,i){var o=ve,f=Mt();if(Oe){if(i===void 0)throw Error(a(407));i=i()}else{if(i=s(),He===null)throw Error(a(349));(Re&127)!==0||pp(o,s,i)}f.memoizedState=i;var d={value:i,getSnapshot:s};return f.queue=d,kp(mp.bind(null,o,d,n),[n]),o.flags|=2048,ba(9,{destroy:void 0},gp.bind(null,o,d,i,s),null),i},useId:function(){var n=Mt(),s=He.identifierPrefix;if(Oe){var i=Ln,o=Dn;i=(o&~(1<<32-Ot(o)-1)).toString(32)+i,s="_"+s+"R_"+i,i=Fo++,0<i&&(s+="H"+i.toString(32)),s+="_"}else i=E_++,s="_"+s+"r_"+i.toString(32)+"_";return n.memoizedState=s},useHostTransitionStatus:Pc,useFormState:Rp,useActionState:Rp,useOptimistic:function(n){var s=Mt();s.memoizedState=s.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=zc.bind(null,ve,!0,i),i.dispatch=s,[n,s]},useMemoCache:xc,useCacheRefresh:function(){return Mt().memoizedState=C_.bind(null,ve)},useEffectEvent:function(n){var s=Mt(),i={impl:n};return s.memoizedState=i,function(){if((Ne&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Bc={readContext:wt,use:Jo,useCallback:Up,useContext:wt,useEffect:Nc,useImperativeHandle:Lp,useInsertionEffect:Mp,useLayoutEffect:Np,useMemo:Pp,useReducer:Xo,useRef:Cp,useState:function(){return Xo(tr)},useDebugValue:Dc,useDeferredValue:function(n,s){var i=tt();return zp(i,Pe.memoizedState,n,s)},useTransition:function(){var n=Xo(tr)[0],s=tt().memoizedState;return[typeof n=="boolean"?n:wi(n),s]},useSyncExternalStore:dp,useId:qp,useHostTransitionStatus:Pc,useFormState:Ap,useActionState:Ap,useOptimistic:function(n,s){var i=tt();return bp(i,Pe,n,s)},useMemoCache:xc,useCacheRefresh:$p};Bc.useEffectEvent=jp;var Fp={readContext:wt,use:Jo,useCallback:Up,useContext:wt,useEffect:Nc,useImperativeHandle:Lp,useInsertionEffect:Mp,useLayoutEffect:Np,useMemo:Pp,useReducer:kc,useRef:Cp,useState:function(){return kc(tr)},useDebugValue:Dc,useDeferredValue:function(n,s){var i=tt();return Pe===null?Lc(i,n,s):zp(i,Pe.memoizedState,n,s)},useTransition:function(){var n=kc(tr)[0],s=tt().memoizedState;return[typeof n=="boolean"?n:wi(n),s]},useSyncExternalStore:dp,useId:qp,useHostTransitionStatus:Pc,useFormState:xp,useActionState:xp,useOptimistic:function(n,s){var i=tt();return Pe!==null?bp(i,Pe,n,s):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:xc,useCacheRefresh:$p};Fp.useEffectEvent=jp;function Hc(n,s,i,o){s=n.memoizedState,i=i(o,s),i=i==null?s:m({},s,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Ic={enqueueSetState:function(n,s,i){n=n._reactInternals;var o=an(),f=Cr(o);f.payload=s,i!=null&&(f.callback=i),s=kr(n,f,o),s!==null&&(Kt(s,n,o),yi(s,n,o))},enqueueReplaceState:function(n,s,i){n=n._reactInternals;var o=an(),f=Cr(o);f.tag=1,f.payload=s,i!=null&&(f.callback=i),s=kr(n,f,o),s!==null&&(Kt(s,n,o),yi(s,n,o))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var i=an(),o=Cr(i);o.tag=2,s!=null&&(o.callback=s),s=kr(n,o,i),s!==null&&(Kt(s,n,i),yi(s,n,i))}};function Qp(n,s,i,o,f,d,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(o,d,v):s.prototype&&s.prototype.isPureReactComponent?!ui(i,o)||!ui(f,d):!0}function Jp(n,s,i,o){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,o),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,o),s.state!==n&&Ic.enqueueReplaceState(s,s.state,null)}function Rs(n,s){var i=s;if("ref"in s){i={};for(var o in s)o!=="ref"&&(i[o]=s[o])}if(n=n.defaultProps){i===s&&(i=m({},i));for(var f in n)i[f]===void 0&&(i[f]=n[f])}return i}function Xp(n){Mo(n)}function Zp(n){console.error(n)}function Wp(n){Mo(n)}function tl(n,s){try{var i=n.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(o){setTimeout(function(){throw o})}}function eg(n,s,i){try{var o=n.onCaughtError;o(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function qc(n,s,i){return i=Cr(i),i.tag=3,i.payload={element:null},i.callback=function(){tl(n,s)},i}function tg(n){return n=Cr(n),n.tag=3,n}function ng(n,s,i,o){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var d=o.value;n.payload=function(){return f(d)},n.callback=function(){eg(s,i,o)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){eg(s,i,o),typeof f!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function j_(n,s,i,o,f){if(i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(s=i.alternate,s!==null&&fa(s,i,f,!0),i=tn.current,i!==null){switch(i.tag){case 31:case 13:return yn===null?dl():i.alternate===null&&Ze===0&&(Ze=3),i.flags&=-257,i.flags|=65536,i.lanes=f,o===qo?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([o]):s.add(o),pf(n,o,f)),!1;case 22:return i.flags|=65536,o===qo?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([o])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([o]):i.add(o)),pf(n,o,f)),!1}throw Error(a(435,i.tag))}return pf(n,o,f),dl(),!1}if(Oe)return s=tn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=f,o!==oc&&(n=Error(a(422),{cause:o}),hi(dn(n,i)))):(o!==oc&&(s=Error(a(423),{cause:o}),hi(dn(s,i))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,o=dn(o,i),f=qc(n.stateNode,o,f),vc(n,f),Ze!==4&&(Ze=2)),!1;var d=Error(a(520),{cause:o});if(d=dn(d,i),ji===null?ji=[d]:ji.push(d),Ze!==4&&(Ze=2),s===null)return!0;o=dn(o,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,n=f&-f,i.lanes|=n,n=qc(i.stateNode,o,n),vc(i,n),!1;case 1:if(s=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ur===null||!Ur.has(d))))return i.flags|=65536,f&=-f,i.lanes|=f,f=tg(f),ng(f,n,i,o),vc(i,f),!1}i=i.return}while(i!==null);return!1}var $c=Error(a(461)),st=!1;function St(n,s,i,o){s.child=n===null?ip(s,null,i,o):Es(s,n.child,i,o)}function rg(n,s,i,o,f){i=i.render;var d=s.ref;if("ref"in o){var v={};for(var w in o)w!=="ref"&&(v[w]=o[w])}else v=o;return bs(s),o=Tc(n,s,i,v,d,f),w=Rc(),n!==null&&!st?(Ac(n,s,f),nr(n,s,f)):(Oe&&w&&ac(s),s.flags|=1,St(n,s,o,f),s.child)}function sg(n,s,i,o,f){if(n===null){var d=i.type;return typeof d=="function"&&!nc(d)&&d.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=d,ag(n,s,d,o,f)):(n=Uo(i.type,null,o,s,s.mode,f),n.ref=s.ref,n.return=s,s.child=n)}if(d=n.child,!Xc(n,f)){var v=d.memoizedProps;if(i=i.compare,i=i!==null?i:ui,i(v,o)&&n.ref===s.ref)return nr(n,s,f)}return s.flags|=1,n=Jn(d,o),n.ref=s.ref,n.return=s,s.child=n}function ag(n,s,i,o,f){if(n!==null){var d=n.memoizedProps;if(ui(d,o)&&n.ref===s.ref)if(st=!1,s.pendingProps=o=d,Xc(n,f))(n.flags&131072)!==0&&(st=!0);else return s.lanes=n.lanes,nr(n,s,f)}return Gc(n,s,i,o,f)}function ig(n,s,i,o){var f=o.children,d=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((s.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,n!==null){for(o=s.child=n.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~d}else o=0,s.child=null;return og(n,s,d,i,o)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&Ho(s,d!==null?d.cachePool:null),d!==null?up(s,d):_c(),cp(s);else return o=s.lanes=536870912,og(n,s,d!==null?d.baseLanes|i:i,i,o)}else d!==null?(Ho(s,d.cachePool),up(s,d),Mr(),s.memoizedState=null):(n!==null&&Ho(s,null),_c(),Mr());return St(n,s,f,i),s.child}function Ti(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function og(n,s,i,o,f){var d=pc();return d=d===null?null:{parent:nt._currentValue,pool:d},s.memoizedState={baseLanes:i,cachePool:d},n!==null&&Ho(s,null),_c(),cp(s),n!==null&&fa(n,s,o,!0),s.childLanes=f,null}function nl(n,s){return s=sl({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}function lg(n,s,i){return Es(s,n.child,null,i),n=nl(s,s.pendingProps),n.flags|=2,nn(s),s.memoizedState=null,n}function M_(n,s,i){var o=s.pendingProps,f=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(Oe){if(o.mode==="hidden")return n=nl(s,o),s.lanes=536870912,Ti(null,n);if(Sc(s),(n=Ge)?(n=_m(n,mn),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Tr!==null?{id:Dn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=Vd(n),i.return=s,s.child=i,_t=s,Ge=null)):n=null,n===null)throw Ar(s);return s.lanes=536870912,null}return nl(s,o)}var d=n.memoizedState;if(d!==null){var v=d.dehydrated;if(Sc(s),f)if(s.flags&256)s.flags&=-257,s=lg(n,s,i);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(a(558));else if(st||fa(n,s,i,!1),f=(i&n.childLanes)!==0,st||f){if(o=He,o!==null&&(v=Bt(o,i),v!==0&&v!==d.retryLane))throw d.retryLane=v,gs(n,v),Kt(o,n,v),$c;dl(),s=lg(n,s,i)}else n=d.treeContext,Ge=vn(v.nextSibling),_t=s,Oe=!0,Rr=null,mn=!1,n!==null&&Fd(s,n),s=nl(s,o),s.flags|=4096;return s}return n=Jn(n.child,{mode:o.mode,children:o.children}),n.ref=s.ref,s.child=n,n.return=s,n}function rl(n,s){var i=s.ref;if(i===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(n===null||n.ref!==i)&&(s.flags|=4194816)}}function Gc(n,s,i,o,f){return bs(s),i=Tc(n,s,i,o,void 0,f),o=Rc(),n!==null&&!st?(Ac(n,s,f),nr(n,s,f)):(Oe&&o&&ac(s),s.flags|=1,St(n,s,i,f),s.child)}function ug(n,s,i,o,f,d){return bs(s),s.updateQueue=null,i=hp(s,o,i,f),fp(n),o=Rc(),n!==null&&!st?(Ac(n,s,d),nr(n,s,d)):(Oe&&o&&ac(s),s.flags|=1,St(n,s,i,d),s.child)}function cg(n,s,i,o,f){if(bs(s),s.stateNode===null){var d=oa,v=i.contextType;typeof v=="object"&&v!==null&&(d=wt(v)),d=new i(o,d),s.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Ic,s.stateNode=d,d._reactInternals=s,d=s.stateNode,d.props=o,d.state=s.memoizedState,d.refs={},mc(s),v=i.contextType,d.context=typeof v=="object"&&v!==null?wt(v):oa,d.state=s.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Hc(s,i,v,o),d.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Ic.enqueueReplaceState(d,d.state,null),bi(s,o,d,f),vi(),d.state=s.memoizedState),typeof d.componentDidMount=="function"&&(s.flags|=4194308),o=!0}else if(n===null){d=s.stateNode;var w=s.memoizedProps,x=Rs(i,w);d.props=x;var P=d.context,I=i.contextType;v=oa,typeof I=="object"&&I!==null&&(v=wt(I));var G=i.getDerivedStateFromProps;I=typeof G=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,I||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||P!==v)&&Jp(s,d,o,v),xr=!1;var z=s.memoizedState;d.state=z,bi(s,o,d,f),vi(),P=s.memoizedState,w||z!==P||xr?(typeof G=="function"&&(Hc(s,i,G,o),P=s.memoizedState),(x=xr||Qp(s,i,x,o,z,P,v))?(I||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(s.flags|=4194308)):(typeof d.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=o,s.memoizedState=P),d.props=o,d.state=P,d.context=v,o=x):(typeof d.componentDidMount=="function"&&(s.flags|=4194308),o=!1)}else{d=s.stateNode,yc(n,s),v=s.memoizedProps,I=Rs(i,v),d.props=I,G=s.pendingProps,z=d.context,P=i.contextType,x=oa,typeof P=="object"&&P!==null&&(x=wt(P)),w=i.getDerivedStateFromProps,(P=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==G||z!==x)&&Jp(s,d,o,x),xr=!1,z=s.memoizedState,d.state=z,bi(s,o,d,f),vi();var B=s.memoizedState;v!==G||z!==B||xr||n!==null&&n.dependencies!==null&&zo(n.dependencies)?(typeof w=="function"&&(Hc(s,i,w,o),B=s.memoizedState),(I=xr||Qp(s,i,I,o,z,B,x)||n!==null&&n.dependencies!==null&&zo(n.dependencies))?(P||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,B,x),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,B,x)),typeof d.componentDidUpdate=="function"&&(s.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===n.memoizedProps&&z===n.memoizedState||(s.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&z===n.memoizedState||(s.flags|=1024),s.memoizedProps=o,s.memoizedState=B),d.props=o,d.state=B,d.context=x,o=I):(typeof d.componentDidUpdate!="function"||v===n.memoizedProps&&z===n.memoizedState||(s.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&z===n.memoizedState||(s.flags|=1024),o=!1)}return d=o,rl(n,s),o=(s.flags&128)!==0,d||o?(d=s.stateNode,i=o&&typeof i.getDerivedStateFromError!="function"?null:d.render(),s.flags|=1,n!==null&&o?(s.child=Es(s,n.child,null,f),s.child=Es(s,null,i,f)):St(n,s,i,f),s.memoizedState=d.state,n=s.child):n=nr(n,s,f),n}function fg(n,s,i,o){return ys(),s.flags|=256,St(n,s,i,o),s.child}var Vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(n){return{baseLanes:n,cachePool:ep()}}function Yc(n,s,i){return n=n!==null?n.childLanes&~i:0,s&&(n|=sn),n}function hg(n,s,i){var o=s.pendingProps,f=!1,d=(s.flags&128)!==0,v;if((v=d)||(v=n!==null&&n.memoizedState===null?!1:(et.current&2)!==0),v&&(f=!0,s.flags&=-129),v=(s.flags&32)!==0,s.flags&=-33,n===null){if(Oe){if(f?jr(s):Mr(),(n=Ge)?(n=_m(n,mn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Tr!==null?{id:Dn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=Vd(n),i.return=s,s.child=i,_t=s,Ge=null)):n=null,n===null)throw Ar(s);return kf(n)?s.lanes=32:s.lanes=536870912,null}var w=o.children;return o=o.fallback,f?(Mr(),f=s.mode,w=sl({mode:"hidden",children:w},f),o=ms(o,f,i,null),w.return=s,o.return=s,w.sibling=o,s.child=w,o=s.child,o.memoizedState=Kc(i),o.childLanes=Yc(n,v,i),s.memoizedState=Vc,Ti(null,o)):(jr(s),Fc(s,w))}var x=n.memoizedState;if(x!==null&&(w=x.dehydrated,w!==null)){if(d)s.flags&256?(jr(s),s.flags&=-257,s=Qc(n,s,i)):s.memoizedState!==null?(Mr(),s.child=n.child,s.flags|=128,s=null):(Mr(),w=o.fallback,f=s.mode,o=sl({mode:"visible",children:o.children},f),w=ms(w,f,i,null),w.flags|=2,o.return=s,w.return=s,o.sibling=w,s.child=o,Es(s,n.child,null,i),o=s.child,o.memoizedState=Kc(i),o.childLanes=Yc(n,v,i),s.memoizedState=Vc,s=Ti(null,o));else if(jr(s),kf(w)){if(v=w.nextSibling&&w.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(a(419)),o.stack="",o.digest=v,hi({value:o,source:null,stack:null}),s=Qc(n,s,i)}else if(st||fa(n,s,i,!1),v=(i&n.childLanes)!==0,st||v){if(v=He,v!==null&&(o=Bt(v,i),o!==0&&o!==x.retryLane))throw x.retryLane=o,gs(n,o),Kt(v,n,o),$c;Cf(w)||dl(),s=Qc(n,s,i)}else Cf(w)?(s.flags|=192,s.child=n.child,s=null):(n=x.treeContext,Ge=vn(w.nextSibling),_t=s,Oe=!0,Rr=null,mn=!1,n!==null&&Fd(s,n),s=Fc(s,o.children),s.flags|=4096);return s}return f?(Mr(),w=o.fallback,f=s.mode,x=n.child,P=x.sibling,o=Jn(x,{mode:"hidden",children:o.children}),o.subtreeFlags=x.subtreeFlags&65011712,P!==null?w=Jn(P,w):(w=ms(w,f,i,null),w.flags|=2),w.return=s,o.return=s,o.sibling=w,s.child=o,Ti(null,o),o=s.child,w=n.child.memoizedState,w===null?w=Kc(i):(f=w.cachePool,f!==null?(x=nt._currentValue,f=f.parent!==x?{parent:x,pool:x}:f):f=ep(),w={baseLanes:w.baseLanes|i,cachePool:f}),o.memoizedState=w,o.childLanes=Yc(n,v,i),s.memoizedState=Vc,Ti(n.child,o)):(jr(s),i=n.child,n=i.sibling,i=Jn(i,{mode:"visible",children:o.children}),i.return=s,i.sibling=null,n!==null&&(v=s.deletions,v===null?(s.deletions=[n],s.flags|=16):v.push(n)),s.child=i,s.memoizedState=null,i)}function Fc(n,s){return s=sl({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function sl(n,s){return n=en(22,n,null,s),n.lanes=0,n}function Qc(n,s,i){return Es(s,n.child,null,i),n=Fc(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function dg(n,s,i){n.lanes|=s;var o=n.alternate;o!==null&&(o.lanes|=s),cc(n.return,s,i)}function Jc(n,s,i,o,f,d){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:f,treeForkCount:d}:(v.isBackwards=s,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=i,v.tailMode=f,v.treeForkCount=d)}function pg(n,s,i){var o=s.pendingProps,f=o.revealOrder,d=o.tail;o=o.children;var v=et.current,w=(v&2)!==0;if(w?(v=v&1|2,s.flags|=128):v&=1,V(et,v),St(n,s,o,i),o=Oe?fi:0,!w&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&dg(n,i,s);else if(n.tag===19)dg(n,i,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"forwards":for(i=s.child,f=null;i!==null;)n=i.alternate,n!==null&&Ko(n)===null&&(f=i),i=i.sibling;i=f,i===null?(f=s.child,s.child=null):(f=i.sibling,i.sibling=null),Jc(s,!1,f,i,d,o);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=s.child,s.child=null;f!==null;){if(n=f.alternate,n!==null&&Ko(n)===null){s.child=f;break}n=f.sibling,f.sibling=i,i=f,f=n}Jc(s,!0,i,null,d,o);break;case"together":Jc(s,!1,null,null,void 0,o);break;default:s.memoizedState=null}return s.child}function nr(n,s,i){if(n!==null&&(s.dependencies=n.dependencies),Lr|=s.lanes,(i&s.childLanes)===0)if(n!==null){if(fa(n,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(a(153));if(s.child!==null){for(n=s.child,i=Jn(n,n.pendingProps),s.child=i,i.return=s;n.sibling!==null;)n=n.sibling,i=i.sibling=Jn(n,n.pendingProps),i.return=s;i.sibling=null}return s.child}function Xc(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&zo(n)))}function N_(n,s,i){switch(s.tag){case 3:de(s,s.stateNode.containerInfo),Or(s,nt,n.memoizedState.cache),ys();break;case 27:case 5:Dt(s);break;case 4:de(s,s.stateNode.containerInfo);break;case 10:Or(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Sc(s),null;break;case 13:var o=s.memoizedState;if(o!==null)return o.dehydrated!==null?(jr(s),s.flags|=128,null):(i&s.child.childLanes)!==0?hg(n,s,i):(jr(s),n=nr(n,s,i),n!==null?n.sibling:null);jr(s);break;case 19:var f=(n.flags&128)!==0;if(o=(i&s.childLanes)!==0,o||(fa(n,s,i,!1),o=(i&s.childLanes)!==0),f){if(o)return pg(n,s,i);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),V(et,et.current),o)break;return null;case 22:return s.lanes=0,ig(n,s,i,s.pendingProps);case 24:Or(s,nt,n.memoizedState.cache)}return nr(n,s,i)}function gg(n,s,i){if(n!==null)if(n.memoizedProps!==s.pendingProps)st=!0;else{if(!Xc(n,i)&&(s.flags&128)===0)return st=!1,N_(n,s,i);st=(n.flags&131072)!==0}else st=!1,Oe&&(s.flags&1048576)!==0&&Yd(s,fi,s.index);switch(s.lanes=0,s.tag){case 16:e:{var o=s.pendingProps;if(n=ws(s.elementType),s.type=n,typeof n=="function")nc(n)?(o=Rs(n,o),s.tag=1,s=cg(null,s,n,o,i)):(s.tag=0,s=Gc(null,s,n,o,i));else{if(n!=null){var f=n.$$typeof;if(f===D){s.tag=11,s=rg(null,s,n,o,i);break e}else if(f===H){s.tag=14,s=sg(null,s,n,o,i);break e}}throw s=qe(n)||n,Error(a(306,s,""))}}return s;case 0:return Gc(n,s,s.type,s.pendingProps,i);case 1:return o=s.type,f=Rs(o,s.pendingProps),cg(n,s,o,f,i);case 3:e:{if(de(s,s.stateNode.containerInfo),n===null)throw Error(a(387));o=s.pendingProps;var d=s.memoizedState;f=d.element,yc(n,s),bi(s,o,null,i);var v=s.memoizedState;if(o=v.cache,Or(s,nt,o),o!==d.cache&&fc(s,[nt],i,!0),vi(),o=v.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:v.cache},s.updateQueue.baseState=d,s.memoizedState=d,s.flags&256){s=fg(n,s,o,i);break e}else if(o!==f){f=dn(Error(a(424)),s),hi(f),s=fg(n,s,o,i);break e}else for(n=s.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Ge=vn(n.firstChild),_t=s,Oe=!0,Rr=null,mn=!0,i=ip(s,null,o,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ys(),o===f){s=nr(n,s,i);break e}St(n,s,o,i)}s=s.child}return s;case 26:return rl(n,s),n===null?(i=Am(s.type,null,s.pendingProps,null))?s.memoizedState=i:Oe||(i=s.type,n=s.pendingProps,o=_l(ce.current).createElement(i),o[bt]=s,o[Ht]=n,Et(o,i,n),pt(o),s.stateNode=o):s.memoizedState=Am(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return Dt(s),n===null&&Oe&&(o=s.stateNode=Em(s.type,s.pendingProps,ce.current),_t=s,mn=!0,f=Ge,Hr(s.type)?(jf=f,Ge=vn(o.firstChild)):Ge=f),St(n,s,s.pendingProps.children,i),rl(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&Oe&&((f=o=Ge)&&(o=uw(o,s.type,s.pendingProps,mn),o!==null?(s.stateNode=o,_t=s,Ge=vn(o.firstChild),mn=!1,f=!0):f=!1),f||Ar(s)),Dt(s),f=s.type,d=s.pendingProps,v=n!==null?n.memoizedProps:null,o=d.children,Af(f,d)?o=null:v!==null&&Af(f,v)&&(s.flags|=32),s.memoizedState!==null&&(f=Tc(n,s,T_,null,null,i),Bi._currentValue=f),rl(n,s),St(n,s,o,i),s.child;case 6:return n===null&&Oe&&((n=i=Ge)&&(i=cw(i,s.pendingProps,mn),i!==null?(s.stateNode=i,_t=s,Ge=null,n=!0):n=!1),n||Ar(s)),null;case 13:return hg(n,s,i);case 4:return de(s,s.stateNode.containerInfo),o=s.pendingProps,n===null?s.child=Es(s,null,o,i):St(n,s,o,i),s.child;case 11:return rg(n,s,s.type,s.pendingProps,i);case 7:return St(n,s,s.pendingProps,i),s.child;case 8:return St(n,s,s.pendingProps.children,i),s.child;case 12:return St(n,s,s.pendingProps.children,i),s.child;case 10:return o=s.pendingProps,Or(s,s.type,o.value),St(n,s,o.children,i),s.child;case 9:return f=s.type._context,o=s.pendingProps.children,bs(s),f=wt(f),o=o(f),s.flags|=1,St(n,s,o,i),s.child;case 14:return sg(n,s,s.type,s.pendingProps,i);case 15:return ag(n,s,s.type,s.pendingProps,i);case 19:return pg(n,s,i);case 31:return M_(n,s,i);case 22:return ig(n,s,i,s.pendingProps);case 24:return bs(s),o=wt(nt),n===null?(f=pc(),f===null&&(f=He,d=hc(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=i),f=d),s.memoizedState={parent:o,cache:f},mc(s),Or(s,nt,f)):((n.lanes&i)!==0&&(yc(n,s),bi(s,null,null,i),vi()),f=n.memoizedState,d=s.memoizedState,f.parent!==o?(f={parent:o,cache:o},s.memoizedState=f,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=f),Or(s,nt,o)):(o=d.cache,Or(s,nt,o),o!==f.cache&&fc(s,[nt],i,!0))),St(n,s,s.pendingProps.children,i),s.child;case 29:throw s.pendingProps}throw Error(a(156,s.tag))}function rr(n){n.flags|=4}function Zc(n,s,i,o,f){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(qg())n.flags|=8192;else throw Ss=qo,gc}else n.flags&=-16777217}function mg(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!jm(s))if(qg())n.flags|=8192;else throw Ss=qo,gc}function al(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?xt():536870912,n.lanes|=s,Ea|=s)}function Ri(n,s){if(!Oe)switch(n.tailMode){case"hidden":s=n.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:o.sibling=null}}function Ve(n){var s=n.alternate!==null&&n.alternate.child===n.child,i=0,o=0;if(s)for(var f=n.child;f!==null;)i|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)i|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=o,n.childLanes=i,s}function D_(n,s,i){var o=s.pendingProps;switch(ic(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(s),null;case 1:return Ve(s),null;case 3:return i=s.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Wn(nt),xe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(ca(s)?rr(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,lc())),Ve(s),null;case 26:var f=s.type,d=s.memoizedState;return n===null?(rr(s),d!==null?(Ve(s),mg(s,d)):(Ve(s),Zc(s,f,null,o,i))):d?d!==n.memoizedState?(rr(s),Ve(s),mg(s,d)):(Ve(s),s.flags&=-16777217):(n=n.memoizedProps,n!==o&&rr(s),Ve(s),Zc(s,f,n,o,i)),null;case 27:if(Lt(s),i=ce.current,f=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==o&&rr(s);else{if(!o){if(s.stateNode===null)throw Error(a(166));return Ve(s),null}n=J.current,ca(s)?Qd(s):(n=Em(f,o,i),s.stateNode=n,rr(s))}return Ve(s),null;case 5:if(Lt(s),f=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==o&&rr(s);else{if(!o){if(s.stateNode===null)throw Error(a(166));return Ve(s),null}if(d=J.current,ca(s))Qd(s);else{var v=_l(ce.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}d[bt]=s,d[Ht]=o;e:for(v=s.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===s)break e;for(;v.sibling===null;){if(v.return===null||v.return===s)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}s.stateNode=d;e:switch(Et(d,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&rr(s)}}return Ve(s),Zc(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,i),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==o&&rr(s);else{if(typeof o!="string"&&s.stateNode===null)throw Error(a(166));if(n=ce.current,ca(s)){if(n=s.stateNode,i=s.memoizedProps,o=null,f=_t,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}n[bt]=s,n=!!(n.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||hm(n.nodeValue,i)),n||Ar(s,!0)}else n=_l(n).createTextNode(o),n[bt]=s,s.stateNode=n}return Ve(s),null;case 31:if(i=s.memoizedState,n===null||n.memoizedState!==null){if(o=ca(s),i!==null){if(n===null){if(!o)throw Error(a(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[bt]=s}else ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ve(s),n=!1}else i=lc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return s.flags&256?(nn(s),s):(nn(s),null);if((s.flags&128)!==0)throw Error(a(558))}return Ve(s),null;case 13:if(o=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=ca(s),o!==null&&o.dehydrated!==null){if(n===null){if(!f)throw Error(a(318));if(f=s.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[bt]=s}else ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Ve(s),f=!1}else f=lc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return s.flags&256?(nn(s),s):(nn(s),null)}return nn(s),(s.flags&128)!==0?(s.lanes=i,s):(i=o!==null,n=n!==null&&n.memoizedState!==null,i&&(o=s.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==f&&(o.flags|=2048)),i!==n&&i&&(s.child.flags|=8192),al(s,s.updateQueue),Ve(s),null);case 4:return xe(),n===null&&wf(s.stateNode.containerInfo),Ve(s),null;case 10:return Wn(s.type),Ve(s),null;case 19:if(q(et),o=s.memoizedState,o===null)return Ve(s),null;if(f=(s.flags&128)!==0,d=o.rendering,d===null)if(f)Ri(o,!1);else{if(Ze!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(d=Ko(n),d!==null){for(s.flags|=128,Ri(o,!1),n=d.updateQueue,s.updateQueue=n,al(s,n),s.subtreeFlags=0,n=i,i=s.child;i!==null;)Gd(i,n),i=i.sibling;return V(et,et.current&1|2),Oe&&Xn(s,o.treeForkCount),s.child}n=n.sibling}o.tail!==null&&ht()>cl&&(s.flags|=128,f=!0,Ri(o,!1),s.lanes=4194304)}else{if(!f)if(n=Ko(d),n!==null){if(s.flags|=128,f=!0,n=n.updateQueue,s.updateQueue=n,al(s,n),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Oe)return Ve(s),null}else 2*ht()-o.renderingStartTime>cl&&i!==536870912&&(s.flags|=128,f=!0,Ri(o,!1),s.lanes=4194304);o.isBackwards?(d.sibling=s.child,s.child=d):(n=o.last,n!==null?n.sibling=d:s.child=d,o.last=d)}return o.tail!==null?(n=o.tail,o.rendering=n,o.tail=n.sibling,o.renderingStartTime=ht(),n.sibling=null,i=et.current,V(et,f?i&1|2:i&1),Oe&&Xn(s,o.treeForkCount),n):(Ve(s),null);case 22:case 23:return nn(s),wc(),o=s.memoizedState!==null,n!==null?n.memoizedState!==null!==o&&(s.flags|=8192):o&&(s.flags|=8192),o?(i&536870912)!==0&&(s.flags&128)===0&&(Ve(s),s.subtreeFlags&6&&(s.flags|=8192)):Ve(s),i=s.updateQueue,i!==null&&al(s,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==i&&(s.flags|=2048),n!==null&&q(_s),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),Wn(nt),Ve(s),null;case 25:return null;case 30:return null}throw Error(a(156,s.tag))}function L_(n,s){switch(ic(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Wn(nt),xe(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return Lt(s),null;case 31:if(s.memoizedState!==null){if(nn(s),s.alternate===null)throw Error(a(340));ys()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(nn(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(a(340));ys()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return q(et),null;case 4:return xe(),null;case 10:return Wn(s.type),null;case 22:case 23:return nn(s),wc(),n!==null&&q(_s),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return Wn(nt),null;case 25:return null;default:return null}}function yg(n,s){switch(ic(s),s.tag){case 3:Wn(nt),xe();break;case 26:case 27:case 5:Lt(s);break;case 4:xe();break;case 31:s.memoizedState!==null&&nn(s);break;case 13:nn(s);break;case 19:q(et);break;case 10:Wn(s.type);break;case 22:case 23:nn(s),wc(),n!==null&&q(_s);break;case 24:Wn(nt)}}function Ai(n,s){try{var i=s.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var f=o.next;i=f;do{if((i.tag&n)===n){o=void 0;var d=i.create,v=i.inst;o=d(),v.destroy=o}i=i.next}while(i!==f)}}catch(w){Le(s,s.return,w)}}function Nr(n,s,i){try{var o=s.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var d=f.next;o=d;do{if((o.tag&n)===n){var v=o.inst,w=v.destroy;if(w!==void 0){v.destroy=void 0,f=s;var x=i,P=w;try{P()}catch(I){Le(f,x,I)}}}o=o.next}while(o!==d)}}catch(I){Le(s,s.return,I)}}function vg(n){var s=n.updateQueue;if(s!==null){var i=n.stateNode;try{lp(s,i)}catch(o){Le(n,n.return,o)}}}function bg(n,s,i){i.props=Rs(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(o){Le(n,s,o)}}function Oi(n,s){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var o=n.stateNode;break;case 30:o=n.stateNode;break;default:o=n.stateNode}typeof i=="function"?n.refCleanup=i(o):i.current=o}}catch(f){Le(n,s,f)}}function Un(n,s){var i=n.ref,o=n.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(f){Le(n,s,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Le(n,s,f)}else i.current=null}function _g(n){var s=n.type,i=n.memoizedProps,o=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(f){Le(n,n.return,f)}}function Wc(n,s,i){try{var o=n.stateNode;rw(o,n.type,i,s),o[Ht]=s}catch(f){Le(n,n.return,f)}}function wg(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Hr(n.type)||n.tag===4}function ef(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||wg(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Hr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function tf(n,s,i){var o=n.tag;if(o===5||o===6)n=n.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(n),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=Fn));else if(o!==4&&(o===27&&Hr(n.type)&&(i=n.stateNode,s=null),n=n.child,n!==null))for(tf(n,s,i),n=n.sibling;n!==null;)tf(n,s,i),n=n.sibling}function il(n,s,i){var o=n.tag;if(o===5||o===6)n=n.stateNode,s?i.insertBefore(n,s):i.appendChild(n);else if(o!==4&&(o===27&&Hr(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(il(n,s,i),n=n.sibling;n!==null;)il(n,s,i),n=n.sibling}function Sg(n){var s=n.stateNode,i=n.memoizedProps;try{for(var o=n.type,f=s.attributes;f.length;)s.removeAttributeNode(f[0]);Et(s,o,i),s[bt]=n,s[Ht]=i}catch(d){Le(n,n.return,d)}}var sr=!1,at=!1,nf=!1,Eg=typeof WeakSet=="function"?WeakSet:Set,gt=null;function U_(n,s){if(n=n.containerInfo,Tf=Ol,n=Ld(n),Qu(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var f=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var v=0,w=-1,x=-1,P=0,I=0,G=n,z=null;t:for(;;){for(var B;G!==i||f!==0&&G.nodeType!==3||(w=v+f),G!==d||o!==0&&G.nodeType!==3||(x=v+o),G.nodeType===3&&(v+=G.nodeValue.length),(B=G.firstChild)!==null;)z=G,G=B;for(;;){if(G===n)break t;if(z===i&&++P===f&&(w=v),z===d&&++I===o&&(x=v),(B=G.nextSibling)!==null)break;G=z,z=G.parentNode}G=B}i=w===-1||x===-1?null:{start:w,end:x}}else i=null}i=i||{start:0,end:0}}else i=null;for(Rf={focusedElem:n,selectionRange:i},Ol=!1,gt=s;gt!==null;)if(s=gt,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,gt=n;else for(;gt!==null;){switch(s=gt,d=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)f=n[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&d!==null){n=void 0,i=s,f=d.memoizedProps,d=d.memoizedState,o=i.stateNode;try{var re=Rs(i.type,f);n=o.getSnapshotBeforeUpdate(re,d),o.__reactInternalSnapshotBeforeUpdate=n}catch(fe){Le(i,i.return,fe)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,i=n.nodeType,i===9)xf(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":xf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=s.sibling,n!==null){n.return=s.return,gt=n;break}gt=s.return}}function Tg(n,s,i){var o=i.flags;switch(i.tag){case 0:case 11:case 15:ir(n,i),o&4&&Ai(5,i);break;case 1:if(ir(n,i),o&4)if(n=i.stateNode,s===null)try{n.componentDidMount()}catch(v){Le(i,i.return,v)}else{var f=Rs(i.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(f,s,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Le(i,i.return,v)}}o&64&&vg(i),o&512&&Oi(i,i.return);break;case 3:if(ir(n,i),o&64&&(n=i.updateQueue,n!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{lp(n,s)}catch(v){Le(i,i.return,v)}}break;case 27:s===null&&o&4&&Sg(i);case 26:case 5:ir(n,i),s===null&&o&4&&_g(i),o&512&&Oi(i,i.return);break;case 12:ir(n,i);break;case 31:ir(n,i),o&4&&Og(n,i);break;case 13:ir(n,i),o&4&&xg(n,i),o&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=V_.bind(null,i),fw(n,i))));break;case 22:if(o=i.memoizedState!==null||sr,!o){s=s!==null&&s.memoizedState!==null||at,f=sr;var d=at;sr=o,(at=s)&&!d?or(n,i,(i.subtreeFlags&8772)!==0):ir(n,i),sr=f,at=d}break;case 30:break;default:ir(n,i)}}function Rg(n){var s=n.alternate;s!==null&&(n.alternate=null,Rg(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Mu(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ye=null,qt=!1;function ar(n,s,i){for(i=i.child;i!==null;)Ag(n,s,i),i=i.sibling}function Ag(n,s,i){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(ls,i)}catch{}switch(i.tag){case 26:at||Un(i,s),ar(n,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:at||Un(i,s);var o=Ye,f=qt;Hr(i.type)&&(Ye=i.stateNode,qt=!1),ar(n,s,i),Ui(i.stateNode),Ye=o,qt=f;break;case 5:at||Un(i,s);case 6:if(o=Ye,f=qt,Ye=null,ar(n,s,i),Ye=o,qt=f,Ye!==null)if(qt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(i.stateNode)}catch(d){Le(i,s,d)}else try{Ye.removeChild(i.stateNode)}catch(d){Le(i,s,d)}break;case 18:Ye!==null&&(qt?(n=Ye,vm(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),ja(n)):vm(Ye,i.stateNode));break;case 4:o=Ye,f=qt,Ye=i.stateNode.containerInfo,qt=!0,ar(n,s,i),Ye=o,qt=f;break;case 0:case 11:case 14:case 15:Nr(2,i,s),at||Nr(4,i,s),ar(n,s,i);break;case 1:at||(Un(i,s),o=i.stateNode,typeof o.componentWillUnmount=="function"&&bg(i,s,o)),ar(n,s,i);break;case 21:ar(n,s,i);break;case 22:at=(o=at)||i.memoizedState!==null,ar(n,s,i),at=o;break;default:ar(n,s,i)}}function Og(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ja(n)}catch(i){Le(s,s.return,i)}}}function xg(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ja(n)}catch(i){Le(s,s.return,i)}}function P_(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new Eg),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new Eg),s;default:throw Error(a(435,n.tag))}}function ol(n,s){var i=P_(n);s.forEach(function(o){if(!i.has(o)){i.add(o);var f=K_.bind(null,n,o);o.then(f,f)}})}function $t(n,s){var i=s.deletions;if(i!==null)for(var o=0;o<i.length;o++){var f=i[o],d=n,v=s,w=v;e:for(;w!==null;){switch(w.tag){case 27:if(Hr(w.type)){Ye=w.stateNode,qt=!1;break e}break;case 5:Ye=w.stateNode,qt=!1;break e;case 3:case 4:Ye=w.stateNode.containerInfo,qt=!0;break e}w=w.return}if(Ye===null)throw Error(a(160));Ag(d,v,f),Ye=null,qt=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Cg(s,n),s=s.sibling}var Tn=null;function Cg(n,s){var i=n.alternate,o=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:$t(s,n),Gt(n),o&4&&(Nr(3,n,n.return),Ai(3,n),Nr(5,n,n.return));break;case 1:$t(s,n),Gt(n),o&512&&(at||i===null||Un(i,i.return)),o&64&&sr&&(n=n.updateQueue,n!==null&&(o=n.callbacks,o!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:var f=Tn;if($t(s,n),Gt(n),o&512&&(at||i===null||Un(i,i.return)),o&4){var d=i!==null?i.memoizedState:null;if(o=n.memoizedState,i===null)if(o===null)if(n.stateNode===null){e:{o=n.type,i=n.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":d=f.getElementsByTagName("title")[0],(!d||d[ei]||d[bt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),Et(d,o,i),d[bt]=n,pt(d),o=d;break e;case"link":var v=Cm("link","href",f).get(o+(i.href||""));if(v){for(var w=0;w<v.length;w++)if(d=v[w],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){v.splice(w,1);break t}}d=f.createElement(o),Et(d,o,i),f.head.appendChild(d);break;case"meta":if(v=Cm("meta","content",f).get(o+(i.content||""))){for(w=0;w<v.length;w++)if(d=v[w],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){v.splice(w,1);break t}}d=f.createElement(o),Et(d,o,i),f.head.appendChild(d);break;default:throw Error(a(468,o))}d[bt]=n,pt(d),o=d}n.stateNode=o}else km(f,n.type,n.stateNode);else n.stateNode=xm(f,o,n.memoizedProps);else d!==o?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,o===null?km(f,n.type,n.stateNode):xm(f,o,n.memoizedProps)):o===null&&n.stateNode!==null&&Wc(n,n.memoizedProps,i.memoizedProps)}break;case 27:$t(s,n),Gt(n),o&512&&(at||i===null||Un(i,i.return)),i!==null&&o&4&&Wc(n,n.memoizedProps,i.memoizedProps);break;case 5:if($t(s,n),Gt(n),o&512&&(at||i===null||Un(i,i.return)),n.flags&32){f=n.stateNode;try{ea(f,"")}catch(re){Le(n,n.return,re)}}o&4&&n.stateNode!=null&&(f=n.memoizedProps,Wc(n,f,i!==null?i.memoizedProps:f)),o&1024&&(nf=!0);break;case 6:if($t(s,n),Gt(n),o&4){if(n.stateNode===null)throw Error(a(162));o=n.memoizedProps,i=n.stateNode;try{i.nodeValue=o}catch(re){Le(n,n.return,re)}}break;case 3:if(El=null,f=Tn,Tn=wl(s.containerInfo),$t(s,n),Tn=f,Gt(n),o&4&&i!==null&&i.memoizedState.isDehydrated)try{ja(s.containerInfo)}catch(re){Le(n,n.return,re)}nf&&(nf=!1,kg(n));break;case 4:o=Tn,Tn=wl(n.stateNode.containerInfo),$t(s,n),Gt(n),Tn=o;break;case 12:$t(s,n),Gt(n);break;case 31:$t(s,n),Gt(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ol(n,o)));break;case 13:$t(s,n),Gt(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(ul=ht()),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ol(n,o)));break;case 22:f=n.memoizedState!==null;var x=i!==null&&i.memoizedState!==null,P=sr,I=at;if(sr=P||f,at=I||x,$t(s,n),at=I,sr=P,Gt(n),o&8192)e:for(s=n.stateNode,s._visibility=f?s._visibility&-2:s._visibility|1,f&&(i===null||x||sr||at||As(n)),i=null,s=n;;){if(s.tag===5||s.tag===26){if(i===null){x=i=s;try{if(d=x.stateNode,f)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{w=x.stateNode;var G=x.memoizedProps.style,z=G!=null&&G.hasOwnProperty("display")?G.display:null;w.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(re){Le(x,x.return,re)}}}else if(s.tag===6){if(i===null){x=s;try{x.stateNode.nodeValue=f?"":x.memoizedProps}catch(re){Le(x,x.return,re)}}}else if(s.tag===18){if(i===null){x=s;try{var B=x.stateNode;f?bm(B,!0):bm(x.stateNode,!1)}catch(re){Le(x,x.return,re)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;i===s&&(i=null),s=s.return}i===s&&(i=null),s.sibling.return=s.return,s=s.sibling}o&4&&(o=n.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,ol(n,i))));break;case 19:$t(s,n),Gt(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,ol(n,o)));break;case 30:break;case 21:break;default:$t(s,n),Gt(n)}}function Gt(n){var s=n.flags;if(s&2){try{for(var i,o=n.return;o!==null;){if(wg(o)){i=o;break}o=o.return}if(i==null)throw Error(a(160));switch(i.tag){case 27:var f=i.stateNode,d=ef(n);il(n,d,f);break;case 5:var v=i.stateNode;i.flags&32&&(ea(v,""),i.flags&=-33);var w=ef(n);il(n,w,v);break;case 3:case 4:var x=i.stateNode.containerInfo,P=ef(n);tf(n,P,x);break;default:throw Error(a(161))}}catch(I){Le(n,n.return,I)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function kg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;kg(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function ir(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Tg(n,s.alternate,s),s=s.sibling}function As(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Nr(4,s,s.return),As(s);break;case 1:Un(s,s.return);var i=s.stateNode;typeof i.componentWillUnmount=="function"&&bg(s,s.return,i),As(s);break;case 27:Ui(s.stateNode);case 26:case 5:Un(s,s.return),As(s);break;case 22:s.memoizedState===null&&As(s);break;case 30:As(s);break;default:As(s)}n=n.sibling}}function or(n,s,i){for(i=i&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var o=s.alternate,f=n,d=s,v=d.flags;switch(d.tag){case 0:case 11:case 15:or(f,d,i),Ai(4,d);break;case 1:if(or(f,d,i),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){Le(o,o.return,P)}if(o=d,f=o.updateQueue,f!==null){var w=o.stateNode;try{var x=f.shared.hiddenCallbacks;if(x!==null)for(f.shared.hiddenCallbacks=null,f=0;f<x.length;f++)op(x[f],w)}catch(P){Le(o,o.return,P)}}i&&v&64&&vg(d),Oi(d,d.return);break;case 27:Sg(d);case 26:case 5:or(f,d,i),i&&o===null&&v&4&&_g(d),Oi(d,d.return);break;case 12:or(f,d,i);break;case 31:or(f,d,i),i&&v&4&&Og(f,d);break;case 13:or(f,d,i),i&&v&4&&xg(f,d);break;case 22:d.memoizedState===null&&or(f,d,i),Oi(d,d.return);break;case 30:break;default:or(f,d,i)}s=s.sibling}}function rf(n,s){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&di(i))}function sf(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&di(n))}function Rn(n,s,i,o){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)jg(n,s,i,o),s=s.sibling}function jg(n,s,i,o){var f=s.flags;switch(s.tag){case 0:case 11:case 15:Rn(n,s,i,o),f&2048&&Ai(9,s);break;case 1:Rn(n,s,i,o);break;case 3:Rn(n,s,i,o),f&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&di(n)));break;case 12:if(f&2048){Rn(n,s,i,o),n=s.stateNode;try{var d=s.memoizedProps,v=d.id,w=d.onPostCommit;typeof w=="function"&&w(v,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(x){Le(s,s.return,x)}}else Rn(n,s,i,o);break;case 31:Rn(n,s,i,o);break;case 13:Rn(n,s,i,o);break;case 23:break;case 22:d=s.stateNode,v=s.alternate,s.memoizedState!==null?d._visibility&2?Rn(n,s,i,o):xi(n,s):d._visibility&2?Rn(n,s,i,o):(d._visibility|=2,_a(n,s,i,o,(s.subtreeFlags&10256)!==0||!1)),f&2048&&rf(v,s);break;case 24:Rn(n,s,i,o),f&2048&&sf(s.alternate,s);break;default:Rn(n,s,i,o)}}function _a(n,s,i,o,f){for(f=f&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var d=n,v=s,w=i,x=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:_a(d,v,w,x,f),Ai(8,v);break;case 23:break;case 22:var I=v.stateNode;v.memoizedState!==null?I._visibility&2?_a(d,v,w,x,f):xi(d,v):(I._visibility|=2,_a(d,v,w,x,f)),f&&P&2048&&rf(v.alternate,v);break;case 24:_a(d,v,w,x,f),f&&P&2048&&sf(v.alternate,v);break;default:_a(d,v,w,x,f)}s=s.sibling}}function xi(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=n,o=s,f=o.flags;switch(o.tag){case 22:xi(i,o),f&2048&&rf(o.alternate,o);break;case 24:xi(i,o),f&2048&&sf(o.alternate,o);break;default:xi(i,o)}s=s.sibling}}var Ci=8192;function wa(n,s,i){if(n.subtreeFlags&Ci)for(n=n.child;n!==null;)Mg(n,s,i),n=n.sibling}function Mg(n,s,i){switch(n.tag){case 26:wa(n,s,i),n.flags&Ci&&n.memoizedState!==null&&Ew(i,Tn,n.memoizedState,n.memoizedProps);break;case 5:wa(n,s,i);break;case 3:case 4:var o=Tn;Tn=wl(n.stateNode.containerInfo),wa(n,s,i),Tn=o;break;case 22:n.memoizedState===null&&(o=n.alternate,o!==null&&o.memoizedState!==null?(o=Ci,Ci=16777216,wa(n,s,i),Ci=o):wa(n,s,i));break;default:wa(n,s,i)}}function Ng(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function ki(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var o=s[i];gt=o,Lg(o,n)}Ng(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Dg(n),n=n.sibling}function Dg(n){switch(n.tag){case 0:case 11:case 15:ki(n),n.flags&2048&&Nr(9,n,n.return);break;case 3:ki(n);break;case 12:ki(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,ll(n)):ki(n);break;default:ki(n)}}function ll(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var o=s[i];gt=o,Lg(o,n)}Ng(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Nr(8,s,s.return),ll(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,ll(s));break;default:ll(s)}n=n.sibling}}function Lg(n,s){for(;gt!==null;){var i=gt;switch(i.tag){case 0:case 11:case 15:Nr(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var o=i.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:di(i.memoizedState.cache)}if(o=i.child,o!==null)o.return=i,gt=o;else e:for(i=n;gt!==null;){o=gt;var f=o.sibling,d=o.return;if(Rg(o),o===i){gt=null;break e}if(f!==null){f.return=d,gt=f;break e}gt=d}}}var z_={getCacheForType:function(n){var s=wt(nt),i=s.data.get(n);return i===void 0&&(i=n(),s.data.set(n,i)),i},cacheSignal:function(){return wt(nt).controller.signal}},B_=typeof WeakMap=="function"?WeakMap:Map,Ne=0,He=null,Ee=null,Re=0,De=0,rn=null,Dr=!1,Sa=!1,af=!1,lr=0,Ze=0,Lr=0,Os=0,of=0,sn=0,Ea=0,ji=null,Vt=null,lf=!1,ul=0,Ug=0,cl=1/0,fl=null,Ur=null,lt=0,Pr=null,Ta=null,ur=0,uf=0,cf=null,Pg=null,Mi=0,ff=null;function an(){return(Ne&2)!==0&&Re!==0?Re&-Re:U.T!==null?yf():ku()}function zg(){if(sn===0)if((Re&536870912)===0||Oe){var n=Ks;Ks<<=1,(Ks&3932160)===0&&(Ks=262144),sn=n}else sn=536870912;return n=tn.current,n!==null&&(n.flags|=32),sn}function Kt(n,s,i){(n===He&&(De===2||De===9)||n.cancelPendingCommit!==null)&&(Ra(n,0),zr(n,Re,sn,!1)),Qe(n,i),((Ne&2)===0||n!==He)&&(n===He&&((Ne&2)===0&&(Os|=i),Ze===4&&zr(n,Re,sn,!1)),Pn(n))}function Bg(n,s,i){if((Ne&6)!==0)throw Error(a(327));var o=!i&&(s&127)===0&&(s&n.expiredLanes)===0||Ke(n,s),f=o?q_(n,s):df(n,s,!0),d=o;do{if(f===0){Sa&&!o&&zr(n,s,0,!1);break}else{if(i=n.current.alternate,d&&!H_(i)){f=df(n,s,!1),d=!1;continue}if(f===2){if(d=s,n.errorRecoveryDisabledLanes&d)var v=0;else v=n.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){s=v;e:{var w=n;f=ji;var x=w.current.memoizedState.isDehydrated;if(x&&(Ra(w,v).flags|=256),v=df(w,v,!1),v!==2){if(af&&!x){w.errorRecoveryDisabledLanes|=d,Os|=d,f=4;break e}d=Vt,Vt=f,d!==null&&(Vt===null?Vt=d:Vt.push.apply(Vt,d))}f=v}if(d=!1,f!==2)continue}}if(f===1){Ra(n,0),zr(n,s,0,!0);break}e:{switch(o=n,d=f,d){case 0:case 1:throw Error(a(345));case 4:if((s&4194048)!==s)break;case 6:zr(o,s,sn,!Dr);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((s&62914560)===s&&(f=ul+300-ht(),10<f)){if(zr(o,s,sn,!Dr),pe(o,0,!0)!==0)break e;ur=s,o.timeoutHandle=mm(Hg.bind(null,o,i,Vt,fl,lf,s,sn,Os,Ea,Dr,d,"Throttled",-0,0),f);break e}Hg(o,i,Vt,fl,lf,s,sn,Os,Ea,Dr,d,null,-0,0)}}break}while(!0);Pn(n)}function Hg(n,s,i,o,f,d,v,w,x,P,I,G,z,B){if(n.timeoutHandle=-1,G=s.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fn},Mg(s,d,G);var re=(d&62914560)===d?ul-ht():(d&4194048)===d?Ug-ht():0;if(re=Tw(G,re),re!==null){ur=d,n.cancelPendingCommit=re(Fg.bind(null,n,s,d,i,o,f,v,w,x,I,G,null,z,B)),zr(n,d,v,!P);return}}Fg(n,s,d,i,o,f,v,w,x)}function H_(n){for(var s=n;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var o=0;o<i.length;o++){var f=i[o],d=f.getSnapshot;f=f.value;try{if(!Wt(d(),f))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function zr(n,s,i,o){s&=~of,s&=~Os,n.suspendedLanes|=s,n.pingedLanes&=~s,o&&(n.warmLanes|=s),o=n.expirationTimes;for(var f=s;0<f;){var d=31-Ot(f),v=1<<d;o[d]=-1,f&=~v}i!==0&&cs(n,i,s)}function hl(){return(Ne&6)===0?(Ni(0),!1):!0}function hf(){if(Ee!==null){if(De===0)var n=Ee.return;else n=Ee,Zn=vs=null,Oc(n),ga=null,gi=0,n=Ee;for(;n!==null;)yg(n.alternate,n),n=n.return;Ee=null}}function Ra(n,s){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,iw(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),ur=0,hf(),He=n,Ee=i=Jn(n.current,null),Re=s,De=0,rn=null,Dr=!1,Sa=Ke(n,s),af=!1,Ea=sn=of=Os=Lr=Ze=0,Vt=ji=null,lf=!1,(s&8)!==0&&(s|=s&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=s;0<o;){var f=31-Ot(o),d=1<<f;s|=n[f],o&=~d}return lr=s,No(),i}function Ig(n,s){ve=null,U.H=Ei,s===pa||s===Io?(s=rp(),De=3):s===gc?(s=rp(),De=4):De=s===$c?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,rn=s,Ee===null&&(Ze=1,tl(n,dn(s,n.current)))}function qg(){var n=tn.current;return n===null?!0:(Re&4194048)===Re?yn===null:(Re&62914560)===Re||(Re&536870912)!==0?n===yn:!1}function $g(){var n=U.H;return U.H=Ei,n===null?Ei:n}function Gg(){var n=U.A;return U.A=z_,n}function dl(){Ze=4,Dr||(Re&4194048)!==Re&&tn.current!==null||(Sa=!0),(Lr&134217727)===0&&(Os&134217727)===0||He===null||zr(He,Re,sn,!1)}function df(n,s,i){var o=Ne;Ne|=2;var f=$g(),d=Gg();(He!==n||Re!==s)&&(fl=null,Ra(n,s)),s=!1;var v=Ze;e:do try{if(De!==0&&Ee!==null){var w=Ee,x=rn;switch(De){case 8:hf(),v=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(s=!0);var P=De;if(De=0,rn=null,Aa(n,w,x,P),i&&Sa){v=0;break e}break;default:P=De,De=0,rn=null,Aa(n,w,x,P)}}I_(),v=Ze;break}catch(I){Ig(n,I)}while(!0);return s&&n.shellSuspendCounter++,Zn=vs=null,Ne=o,U.H=f,U.A=d,Ee===null&&(He=null,Re=0,No()),v}function I_(){for(;Ee!==null;)Vg(Ee)}function q_(n,s){var i=Ne;Ne|=2;var o=$g(),f=Gg();He!==n||Re!==s?(fl=null,cl=ht()+500,Ra(n,s)):Sa=Ke(n,s);e:do try{if(De!==0&&Ee!==null){s=Ee;var d=rn;t:switch(De){case 1:De=0,rn=null,Aa(n,s,d,1);break;case 2:case 9:if(tp(d)){De=0,rn=null,Kg(s);break}s=function(){De!==2&&De!==9||He!==n||(De=7),Pn(n)},d.then(s,s);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:tp(d)?(De=0,rn=null,Kg(s)):(De=0,rn=null,Aa(n,s,d,7));break;case 5:var v=null;switch(Ee.tag){case 26:v=Ee.memoizedState;case 5:case 27:var w=Ee;if(v?jm(v):w.stateNode.complete){De=0,rn=null;var x=w.sibling;if(x!==null)Ee=x;else{var P=w.return;P!==null?(Ee=P,pl(P)):Ee=null}break t}}De=0,rn=null,Aa(n,s,d,5);break;case 6:De=0,rn=null,Aa(n,s,d,6);break;case 8:hf(),Ze=6;break e;default:throw Error(a(462))}}$_();break}catch(I){Ig(n,I)}while(!0);return Zn=vs=null,U.H=o,U.A=f,Ne=i,Ee!==null?0:(He=null,Re=0,No(),Ze)}function $_(){for(;Ee!==null&&!ft();)Vg(Ee)}function Vg(n){var s=gg(n.alternate,n,lr);n.memoizedProps=n.pendingProps,s===null?pl(n):Ee=s}function Kg(n){var s=n,i=s.alternate;switch(s.tag){case 15:case 0:s=ug(i,s,s.pendingProps,s.type,void 0,Re);break;case 11:s=ug(i,s,s.pendingProps,s.type.render,s.ref,Re);break;case 5:Oc(s);default:yg(i,s),s=Ee=Gd(s,lr),s=gg(i,s,lr)}n.memoizedProps=n.pendingProps,s===null?pl(n):Ee=s}function Aa(n,s,i,o){Zn=vs=null,Oc(s),ga=null,gi=0;var f=s.return;try{if(j_(n,f,s,i,Re)){Ze=1,tl(n,dn(i,n.current)),Ee=null;return}}catch(d){if(f!==null)throw Ee=f,d;Ze=1,tl(n,dn(i,n.current)),Ee=null;return}s.flags&32768?(Oe||o===1?n=!0:Sa||(Re&536870912)!==0?n=!1:(Dr=n=!0,(o===2||o===9||o===3||o===6)&&(o=tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Yg(s,n)):pl(s)}function pl(n){var s=n;do{if((s.flags&32768)!==0){Yg(s,Dr);return}n=s.return;var i=D_(s.alternate,s,lr);if(i!==null){Ee=i;return}if(s=s.sibling,s!==null){Ee=s;return}Ee=s=n}while(s!==null);Ze===0&&(Ze=5)}function Yg(n,s){do{var i=L_(n.alternate,n);if(i!==null){i.flags&=32767,Ee=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(n=n.sibling,n!==null)){Ee=n;return}Ee=n=i}while(n!==null);Ze=6,Ee=null}function Fg(n,s,i,o,f,d,v,w,x){n.cancelPendingCommit=null;do gl();while(lt!==0);if((Ne&6)!==0)throw Error(a(327));if(s!==null){if(s===n.current)throw Error(a(177));if(d=s.lanes|s.childLanes,d|=ec,Pt(n,i,d,v,w,x),n===He&&(Ee=He=null,Re=0),Ta=s,Pr=n,ur=i,uf=d,cf=f,Pg=o,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Y_(Vn,function(){return Wg(),null})):(n.callbackNode=null,n.callbackPriority=0),o=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||o){o=U.T,U.T=null,f=F.p,F.p=2,v=Ne,Ne|=4;try{U_(n,s,i)}finally{Ne=v,F.p=f,U.T=o}}lt=1,Qg(),Jg(),Xg()}}function Qg(){if(lt===1){lt=0;var n=Pr,s=Ta,i=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var o=F.p;F.p=2;var f=Ne;Ne|=4;try{Cg(s,n);var d=Rf,v=Ld(n.containerInfo),w=d.focusedElem,x=d.selectionRange;if(v!==w&&w&&w.ownerDocument&&Dd(w.ownerDocument.documentElement,w)){if(x!==null&&Qu(w)){var P=x.start,I=x.end;if(I===void 0&&(I=P),"selectionStart"in w)w.selectionStart=P,w.selectionEnd=Math.min(I,w.value.length);else{var G=w.ownerDocument||document,z=G&&G.defaultView||window;if(z.getSelection){var B=z.getSelection(),re=w.textContent.length,fe=Math.min(x.start,re),Be=x.end===void 0?fe:Math.min(x.end,re);!B.extend&&fe>Be&&(v=Be,Be=fe,fe=v);var N=Nd(w,fe),k=Nd(w,Be);if(N&&k&&(B.rangeCount!==1||B.anchorNode!==N.node||B.anchorOffset!==N.offset||B.focusNode!==k.node||B.focusOffset!==k.offset)){var L=G.createRange();L.setStart(N.node,N.offset),B.removeAllRanges(),fe>Be?(B.addRange(L),B.extend(k.node,k.offset)):(L.setEnd(k.node,k.offset),B.addRange(L))}}}}for(G=[],B=w;B=B.parentNode;)B.nodeType===1&&G.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<G.length;w++){var $=G[w];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Ol=!!Tf,Rf=Tf=null}finally{Ne=f,F.p=o,U.T=i}}n.current=s,lt=2}}function Jg(){if(lt===2){lt=0;var n=Pr,s=Ta,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var o=F.p;F.p=2;var f=Ne;Ne|=4;try{Tg(n,s.alternate,s)}finally{Ne=f,F.p=o,U.T=i}}lt=3}}function Xg(){if(lt===4||lt===3){lt=0,jn();var n=Pr,s=Ta,i=ur,o=Pg;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?lt=5:(lt=0,Ta=Pr=null,Zg(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(Ur=null),Sn(i),s=s.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(ls,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=U.T,f=F.p,F.p=2,U.T=null;try{for(var d=n.onRecoverableError,v=0;v<o.length;v++){var w=o[v];d(w.value,{componentStack:w.stack})}}finally{U.T=s,F.p=f}}(ur&3)!==0&&gl(),Pn(n),f=n.pendingLanes,(i&261930)!==0&&(f&42)!==0?n===ff?Mi++:(Mi=0,ff=n):Mi=0,Ni(0)}}function Zg(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,di(s)))}function gl(){return Qg(),Jg(),Xg(),Wg()}function Wg(){if(lt!==5)return!1;var n=Pr,s=uf;uf=0;var i=Sn(ur),o=U.T,f=F.p;try{F.p=32>i?32:i,U.T=null,i=cf,cf=null;var d=Pr,v=ur;if(lt=0,Ta=Pr=null,ur=0,(Ne&6)!==0)throw Error(a(331));var w=Ne;if(Ne|=4,Dg(d.current),jg(d,d.current,v,i),Ne=w,Ni(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(ls,d)}catch{}return!0}finally{F.p=f,U.T=o,Zg(n,s)}}function em(n,s,i){s=dn(i,s),s=qc(n.stateNode,s,2),n=kr(n,s,2),n!==null&&(Qe(n,2),Pn(n))}function Le(n,s,i){if(n.tag===3)em(n,n,i);else for(;s!==null;){if(s.tag===3){em(s,n,i);break}else if(s.tag===1){var o=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ur===null||!Ur.has(o))){n=dn(i,n),i=tg(2),o=kr(s,i,2),o!==null&&(ng(i,o,s,n),Qe(o,2),Pn(o));break}}s=s.return}}function pf(n,s,i){var o=n.pingCache;if(o===null){o=n.pingCache=new B_;var f=new Set;o.set(s,f)}else f=o.get(s),f===void 0&&(f=new Set,o.set(s,f));f.has(i)||(af=!0,f.add(i),n=G_.bind(null,n,s,i),s.then(n,n))}function G_(n,s,i){var o=n.pingCache;o!==null&&o.delete(s),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,He===n&&(Re&i)===i&&(Ze===4||Ze===3&&(Re&62914560)===Re&&300>ht()-ul?(Ne&2)===0&&Ra(n,0):of|=i,Ea===Re&&(Ea=0)),Pn(n)}function tm(n,s){s===0&&(s=xt()),n=gs(n,s),n!==null&&(Qe(n,s),Pn(n))}function V_(n){var s=n.memoizedState,i=0;s!==null&&(i=s.retryLane),tm(n,i)}function K_(n,s){var i=0;switch(n.tag){case 31:case 13:var o=n.stateNode,f=n.memoizedState;f!==null&&(i=f.retryLane);break;case 19:o=n.stateNode;break;case 22:o=n.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(s),tm(n,i)}function Y_(n,s){return Zt(n,s)}var ml=null,Oa=null,gf=!1,yl=!1,mf=!1,Br=0;function Pn(n){n!==Oa&&n.next===null&&(Oa===null?ml=Oa=n:Oa=Oa.next=n),yl=!0,gf||(gf=!0,Q_())}function Ni(n,s){if(!mf&&yl){mf=!0;do for(var i=!1,o=ml;o!==null;){if(n!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var v=o.suspendedLanes,w=o.pingedLanes;d=(1<<31-Ot(42|n)+1)-1,d&=f&~(v&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,am(o,d))}else d=Re,d=pe(o,o===He?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Ke(o,d)||(i=!0,am(o,d));o=o.next}while(i);mf=!1}}function F_(){nm()}function nm(){yl=gf=!1;var n=0;Br!==0&&aw()&&(n=Br);for(var s=ht(),i=null,o=ml;o!==null;){var f=o.next,d=rm(o,s);d===0?(o.next=null,i===null?ml=f:i.next=f,f===null&&(Oa=i)):(i=o,(n!==0||(d&3)!==0)&&(yl=!0)),o=f}lt!==0&&lt!==5||Ni(n),Br!==0&&(Br=0)}function rm(n,s){for(var i=n.suspendedLanes,o=n.pingedLanes,f=n.expirationTimes,d=n.pendingLanes&-62914561;0<d;){var v=31-Ot(d),w=1<<v,x=f[v];x===-1?((w&i)===0||(w&o)!==0)&&(f[v]=dt(w,s)):x<=s&&(n.expiredLanes|=w),d&=~w}if(s=He,i=Re,i=pe(n,n===s?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o=n.callbackNode,i===0||n===s&&(De===2||De===9)||n.cancelPendingCommit!==null)return o!==null&&o!==null&&os(o),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Ke(n,i)){if(s=i&-i,s===n.callbackPriority)return s;switch(o!==null&&os(o),Sn(i)){case 2:case 8:i=un;break;case 32:i=Vn;break;case 268435456:i=Kn;break;default:i=Vn}return o=sm.bind(null,n),i=Zt(i,o),n.callbackPriority=s,n.callbackNode=i,s}return o!==null&&o!==null&&os(o),n.callbackPriority=2,n.callbackNode=null,2}function sm(n,s){if(lt!==0&&lt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(gl()&&n.callbackNode!==i)return null;var o=Re;return o=pe(n,n===He?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o===0?null:(Bg(n,o,s),rm(n,ht()),n.callbackNode!=null&&n.callbackNode===i?sm.bind(null,n):null)}function am(n,s){if(gl())return null;Bg(n,s,!0)}function Q_(){ow(function(){(Ne&6)!==0?Zt(Je,F_):nm()})}function yf(){if(Br===0){var n=ha;n===0&&(n=Vs,Vs<<=1,(Vs&261888)===0&&(Vs=256)),Br=n}return Br}function im(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ro(""+n)}function om(n,s){var i=s.ownerDocument.createElement("input");return i.name=s.name,i.value=s.value,n.id&&i.setAttribute("form",n.id),s.parentNode.insertBefore(i,s),n=new FormData(n),i.parentNode.removeChild(i),n}function J_(n,s,i,o,f){if(s==="submit"&&i&&i.stateNode===f){var d=im((f[Ht]||null).action),v=o.submitter;v&&(s=(s=v[Ht]||null)?im(s.formAction):v.getAttribute("formAction"),s!==null&&(d=s,v=null));var w=new Co("action","action",null,o,f);n.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Br!==0){var x=v?om(f,v):new FormData(f);Uc(i,{pending:!0,data:x,method:f.method,action:d},null,x)}}else typeof d=="function"&&(w.preventDefault(),x=v?om(f,v):new FormData(f),Uc(i,{pending:!0,data:x,method:f.method,action:d},d,x))},currentTarget:f}]})}}for(var vf=0;vf<Wu.length;vf++){var bf=Wu[vf],X_=bf.toLowerCase(),Z_=bf[0].toUpperCase()+bf.slice(1);En(X_,"on"+Z_)}En(zd,"onAnimationEnd"),En(Bd,"onAnimationIteration"),En(Hd,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(p_,"onTransitionRun"),En(g_,"onTransitionStart"),En(m_,"onTransitionCancel"),En(Id,"onTransitionEnd"),Zs("onMouseEnter",["mouseout","mouseover"]),Zs("onMouseLeave",["mouseout","mouseover"]),Zs("onPointerEnter",["pointerout","pointerover"]),Zs("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Di="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),W_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Di));function lm(n,s){s=(s&4)!==0;for(var i=0;i<n.length;i++){var o=n[i],f=o.event;o=o.listeners;e:{var d=void 0;if(s)for(var v=o.length-1;0<=v;v--){var w=o[v],x=w.instance,P=w.currentTarget;if(w=w.listener,x!==d&&f.isPropagationStopped())break e;d=w,f.currentTarget=P;try{d(f)}catch(I){Mo(I)}f.currentTarget=null,d=x}else for(v=0;v<o.length;v++){if(w=o[v],x=w.instance,P=w.currentTarget,w=w.listener,x!==d&&f.isPropagationStopped())break e;d=w,f.currentTarget=P;try{d(f)}catch(I){Mo(I)}f.currentTarget=null,d=x}}}}function Te(n,s){var i=s[ju];i===void 0&&(i=s[ju]=new Set);var o=n+"__bubble";i.has(o)||(um(s,n,2,!1),i.add(o))}function _f(n,s,i){var o=0;s&&(o|=4),um(i,n,o,s)}var vl="_reactListening"+Math.random().toString(36).slice(2);function wf(n){if(!n[vl]){n[vl]=!0,nd.forEach(function(i){i!=="selectionchange"&&(W_.has(i)||_f(i,!1,n),_f(i,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[vl]||(s[vl]=!0,_f("selectionchange",!1,s))}}function um(n,s,i,o){switch(zm(s)){case 2:var f=Ow;break;case 8:f=xw;break;default:f=Uf}i=f.bind(null,s,i,n),f=void 0,!Hu||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),o?f!==void 0?n.addEventListener(s,i,{capture:!0,passive:f}):n.addEventListener(s,i,!0):f!==void 0?n.addEventListener(s,i,{passive:f}):n.addEventListener(s,i,!1)}function Sf(n,s,i,o,f){var d=o;if((s&1)===0&&(s&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var w=o.stateNode.containerInfo;if(w===f)break;if(v===4)for(v=o.return;v!==null;){var x=v.tag;if((x===3||x===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;w!==null;){if(v=Qs(w),v===null)return;if(x=v.tag,x===5||x===6||x===26||x===27){o=d=v;continue e}w=w.parentNode}}o=o.return}pd(function(){var P=d,I=zu(i),G=[];e:{var z=qd.get(n);if(z!==void 0){var B=Co,re=n;switch(n){case"keypress":if(Oo(i)===0)break e;case"keydown":case"keyup":B=Kb;break;case"focusin":re="focus",B=Gu;break;case"focusout":re="blur",B=Gu;break;case"beforeblur":case"afterblur":B=Gu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Db;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Qb;break;case zd:case Bd:case Hd:B=Pb;break;case Id:B=Xb;break;case"scroll":case"scrollend":B=Mb;break;case"wheel":B=Wb;break;case"copy":case"cut":case"paste":B=Bb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=bd;break;case"toggle":case"beforetoggle":B=t_}var fe=(s&4)!==0,Be=!fe&&(n==="scroll"||n==="scrollend"),N=fe?z!==null?z+"Capture":null:z;fe=[];for(var k=P,L;k!==null;){var $=k;if(L=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||L===null||N===null||($=ni(k,N),$!=null&&fe.push(Li(k,$,L))),Be)break;k=k.return}0<fe.length&&(z=new B(z,re,null,i,I),G.push({event:z,listeners:fe}))}}if((s&7)===0){e:{if(z=n==="mouseover"||n==="pointerover",B=n==="mouseout"||n==="pointerout",z&&i!==Pu&&(re=i.relatedTarget||i.fromElement)&&(Qs(re)||re[Fs]))break e;if((B||z)&&(z=I.window===I?I:(z=I.ownerDocument)?z.defaultView||z.parentWindow:window,B?(re=i.relatedTarget||i.toElement,B=P,re=re?Qs(re):null,re!==null&&(Be=u(re),fe=re.tag,re!==Be||fe!==5&&fe!==27&&fe!==6)&&(re=null)):(B=null,re=P),B!==re)){if(fe=yd,$="onMouseLeave",N="onMouseEnter",k="mouse",(n==="pointerout"||n==="pointerover")&&(fe=bd,$="onPointerLeave",N="onPointerEnter",k="pointer"),Be=B==null?z:ti(B),L=re==null?z:ti(re),z=new fe($,k+"leave",B,i,I),z.target=Be,z.relatedTarget=L,$=null,Qs(I)===P&&(fe=new fe(N,k+"enter",re,i,I),fe.target=L,fe.relatedTarget=Be,$=fe),Be=$,B&&re)t:{for(fe=ew,N=B,k=re,L=0,$=N;$;$=fe($))L++;$=0;for(var ue=k;ue;ue=fe(ue))$++;for(;0<L-$;)N=fe(N),L--;for(;0<$-L;)k=fe(k),$--;for(;L--;){if(N===k||k!==null&&N===k.alternate){fe=N;break t}N=fe(N),k=fe(k)}fe=null}else fe=null;B!==null&&cm(G,z,B,fe,!1),re!==null&&Be!==null&&cm(G,Be,re,fe,!0)}}e:{if(z=P?ti(P):window,B=z.nodeName&&z.nodeName.toLowerCase(),B==="select"||B==="input"&&z.type==="file")var Ce=Od;else if(Rd(z))if(xd)Ce=f_;else{Ce=u_;var oe=l_}else B=z.nodeName,!B||B.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?P&&Uu(P.elementType)&&(Ce=Od):Ce=c_;if(Ce&&(Ce=Ce(n,P))){Ad(G,Ce,i,I);break e}oe&&oe(n,z,P),n==="focusout"&&P&&z.type==="number"&&P.memoizedProps.value!=null&&Lu(z,"number",z.value)}switch(oe=P?ti(P):window,n){case"focusin":(Rd(oe)||oe.contentEditable==="true")&&(sa=oe,Ju=P,ci=null);break;case"focusout":ci=Ju=sa=null;break;case"mousedown":Xu=!0;break;case"contextmenu":case"mouseup":case"dragend":Xu=!1,Ud(G,i,I);break;case"selectionchange":if(d_)break;case"keydown":case"keyup":Ud(G,i,I)}var be;if(Ku)e:{switch(n){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else ra?Ed(n,i)&&(Ae="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Ae="onCompositionStart");Ae&&(_d&&i.locale!=="ko"&&(ra||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&ra&&(be=gd()):(Er=I,Iu="value"in Er?Er.value:Er.textContent,ra=!0)),oe=bl(P,Ae),0<oe.length&&(Ae=new vd(Ae,n,null,i,I),G.push({event:Ae,listeners:oe}),be?Ae.data=be:(be=Td(i),be!==null&&(Ae.data=be)))),(be=r_?s_(n,i):a_(n,i))&&(Ae=bl(P,"onBeforeInput"),0<Ae.length&&(oe=new vd("onBeforeInput","beforeinput",null,i,I),G.push({event:oe,listeners:Ae}),oe.data=be)),J_(G,n,P,i,I)}lm(G,s)})}function Li(n,s,i){return{instance:n,listener:s,currentTarget:i}}function bl(n,s){for(var i=s+"Capture",o=[];n!==null;){var f=n,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=ni(n,i),f!=null&&o.unshift(Li(n,f,d)),f=ni(n,s),f!=null&&o.push(Li(n,f,d))),n.tag===3)return o;n=n.return}return[]}function ew(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function cm(n,s,i,o,f){for(var d=s._reactName,v=[];i!==null&&i!==o;){var w=i,x=w.alternate,P=w.stateNode;if(w=w.tag,x!==null&&x===o)break;w!==5&&w!==26&&w!==27||P===null||(x=P,f?(P=ni(i,d),P!=null&&v.unshift(Li(i,P,x))):f||(P=ni(i,d),P!=null&&v.push(Li(i,P,x)))),i=i.return}v.length!==0&&n.push({event:s,listeners:v})}var tw=/\r\n?/g,nw=/\u0000|\uFFFD/g;function fm(n){return(typeof n=="string"?n:""+n).replace(tw,`
`).replace(nw,"")}function hm(n,s){return s=fm(s),fm(n)===s}function ze(n,s,i,o,f,d){switch(i){case"children":typeof o=="string"?s==="body"||s==="textarea"&&o===""||ea(n,o):(typeof o=="number"||typeof o=="bigint")&&s!=="body"&&ea(n,""+o);break;case"className":Eo(n,"class",o);break;case"tabIndex":Eo(n,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Eo(n,i,o);break;case"style":hd(n,o,d);break;case"data":if(s!=="object"){Eo(n,"data",o);break}case"src":case"href":if(o===""&&(s!=="a"||i!=="href")){n.removeAttribute(i);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(i);break}o=Ro(""+o),n.setAttribute(i,o);break;case"action":case"formAction":if(typeof o=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(i==="formAction"?(s!=="input"&&ze(n,s,"name",f.name,f,null),ze(n,s,"formEncType",f.formEncType,f,null),ze(n,s,"formMethod",f.formMethod,f,null),ze(n,s,"formTarget",f.formTarget,f,null)):(ze(n,s,"encType",f.encType,f,null),ze(n,s,"method",f.method,f,null),ze(n,s,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(i);break}o=Ro(""+o),n.setAttribute(i,o);break;case"onClick":o!=null&&(n.onclick=Fn);break;case"onScroll":o!=null&&Te("scroll",n);break;case"onScrollEnd":o!=null&&Te("scrollend",n);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(i=o.__html,i!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"multiple":n.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":n.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){n.removeAttribute("xlink:href");break}i=Ro(""+o),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(i,""+o):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":o===!0?n.setAttribute(i,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(i,o):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?n.setAttribute(i,o):n.removeAttribute(i);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?n.removeAttribute(i):n.setAttribute(i,o);break;case"popover":Te("beforetoggle",n),Te("toggle",n),So(n,"popover",o);break;case"xlinkActuate":Yn(n,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Yn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Yn(n,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Yn(n,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Yn(n,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Yn(n,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":So(n,"is",o);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=kb.get(i)||i,So(n,i,o))}}function Ef(n,s,i,o,f,d){switch(i){case"style":hd(n,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(i=o.__html,i!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=i}}break;case"children":typeof o=="string"?ea(n,o):(typeof o=="number"||typeof o=="bigint")&&ea(n,""+o);break;case"onScroll":o!=null&&Te("scroll",n);break;case"onScrollEnd":o!=null&&Te("scrollend",n);break;case"onClick":o!=null&&(n.onclick=Fn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rd.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),s=i.slice(2,f?i.length-7:void 0),d=n[Ht]||null,d=d!=null?d[i]:null,typeof d=="function"&&n.removeEventListener(s,d,f),typeof o=="function")){typeof d!="function"&&d!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(s,o,f);break e}i in n?n[i]=o:o===!0?n.setAttribute(i,""):So(n,i,o)}}}function Et(n,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",n),Te("load",n);var o=!1,f=!1,d;for(d in i)if(i.hasOwnProperty(d)){var v=i[d];if(v!=null)switch(d){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:ze(n,s,d,v,i,null)}}f&&ze(n,s,"srcSet",i.srcSet,i,null),o&&ze(n,s,"src",i.src,i,null);return;case"input":Te("invalid",n);var w=d=v=f=null,x=null,P=null;for(o in i)if(i.hasOwnProperty(o)){var I=i[o];if(I!=null)switch(o){case"name":f=I;break;case"type":v=I;break;case"checked":x=I;break;case"defaultChecked":P=I;break;case"value":d=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(a(137,s));break;default:ze(n,s,o,I,i,null)}}ld(n,d,w,x,P,v,f,!1);return;case"select":Te("invalid",n),o=v=d=null;for(f in i)if(i.hasOwnProperty(f)&&(w=i[f],w!=null))switch(f){case"value":d=w;break;case"defaultValue":v=w;break;case"multiple":o=w;default:ze(n,s,f,w,i,null)}s=d,i=v,n.multiple=!!o,s!=null?Ws(n,!!o,s,!1):i!=null&&Ws(n,!!o,i,!0);return;case"textarea":Te("invalid",n),d=f=o=null;for(v in i)if(i.hasOwnProperty(v)&&(w=i[v],w!=null))switch(v){case"value":o=w;break;case"defaultValue":f=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(a(91));break;default:ze(n,s,v,w,i,null)}cd(n,o,f,d);return;case"option":for(x in i)i.hasOwnProperty(x)&&(o=i[x],o!=null)&&(x==="selected"?n.selected=o&&typeof o!="function"&&typeof o!="symbol":ze(n,s,x,o,i,null));return;case"dialog":Te("beforetoggle",n),Te("toggle",n),Te("cancel",n),Te("close",n);break;case"iframe":case"object":Te("load",n);break;case"video":case"audio":for(o=0;o<Di.length;o++)Te(Di[o],n);break;case"image":Te("error",n),Te("load",n);break;case"details":Te("toggle",n);break;case"embed":case"source":case"link":Te("error",n),Te("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in i)if(i.hasOwnProperty(P)&&(o=i[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:ze(n,s,P,o,i,null)}return;default:if(Uu(s)){for(I in i)i.hasOwnProperty(I)&&(o=i[I],o!==void 0&&Ef(n,s,I,o,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(o=i[w],o!=null&&ze(n,s,w,o,i,null))}function rw(n,s,i,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,v=null,w=null,x=null,P=null,I=null;for(B in i){var G=i[B];if(i.hasOwnProperty(B)&&G!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":x=G;default:o.hasOwnProperty(B)||ze(n,s,B,null,o,G)}}for(var z in o){var B=o[z];if(G=i[z],o.hasOwnProperty(z)&&(B!=null||G!=null))switch(z){case"type":d=B;break;case"name":f=B;break;case"checked":P=B;break;case"defaultChecked":I=B;break;case"value":v=B;break;case"defaultValue":w=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(a(137,s));break;default:B!==G&&ze(n,s,z,B,o,G)}}Du(n,v,w,x,P,I,d,f);return;case"select":B=v=w=z=null;for(d in i)if(x=i[d],i.hasOwnProperty(d)&&x!=null)switch(d){case"value":break;case"multiple":B=x;default:o.hasOwnProperty(d)||ze(n,s,d,null,o,x)}for(f in o)if(d=o[f],x=i[f],o.hasOwnProperty(f)&&(d!=null||x!=null))switch(f){case"value":z=d;break;case"defaultValue":w=d;break;case"multiple":v=d;default:d!==x&&ze(n,s,f,d,o,x)}s=w,i=v,o=B,z!=null?Ws(n,!!i,z,!1):!!o!=!!i&&(s!=null?Ws(n,!!i,s,!0):Ws(n,!!i,i?[]:"",!1));return;case"textarea":B=z=null;for(w in i)if(f=i[w],i.hasOwnProperty(w)&&f!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:ze(n,s,w,null,o,f)}for(v in o)if(f=o[v],d=i[v],o.hasOwnProperty(v)&&(f!=null||d!=null))switch(v){case"value":z=f;break;case"defaultValue":B=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&ze(n,s,v,f,o,d)}ud(n,z,B);return;case"option":for(var re in i)z=i[re],i.hasOwnProperty(re)&&z!=null&&!o.hasOwnProperty(re)&&(re==="selected"?n.selected=!1:ze(n,s,re,null,o,z));for(x in o)z=o[x],B=i[x],o.hasOwnProperty(x)&&z!==B&&(z!=null||B!=null)&&(x==="selected"?n.selected=z&&typeof z!="function"&&typeof z!="symbol":ze(n,s,x,z,o,B));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var fe in i)z=i[fe],i.hasOwnProperty(fe)&&z!=null&&!o.hasOwnProperty(fe)&&ze(n,s,fe,null,o,z);for(P in o)if(z=o[P],B=i[P],o.hasOwnProperty(P)&&z!==B&&(z!=null||B!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(137,s));break;default:ze(n,s,P,z,o,B)}return;default:if(Uu(s)){for(var Be in i)z=i[Be],i.hasOwnProperty(Be)&&z!==void 0&&!o.hasOwnProperty(Be)&&Ef(n,s,Be,void 0,o,z);for(I in o)z=o[I],B=i[I],!o.hasOwnProperty(I)||z===B||z===void 0&&B===void 0||Ef(n,s,I,z,o,B);return}}for(var N in i)z=i[N],i.hasOwnProperty(N)&&z!=null&&!o.hasOwnProperty(N)&&ze(n,s,N,null,o,z);for(G in o)z=o[G],B=i[G],!o.hasOwnProperty(G)||z===B||z==null&&B==null||ze(n,s,G,z,o,B)}function dm(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sw(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,i=performance.getEntriesByType("resource"),o=0;o<i.length;o++){var f=i[o],d=f.transferSize,v=f.initiatorType,w=f.duration;if(d&&w&&dm(v)){for(v=0,w=f.responseEnd,o+=1;o<i.length;o++){var x=i[o],P=x.startTime;if(P>w)break;var I=x.transferSize,G=x.initiatorType;I&&dm(G)&&(x=x.responseEnd,v+=I*(x<w?1:(w-P)/(x-P)))}if(--o,s+=8*(d+v)/(f.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Tf=null,Rf=null;function _l(n){return n.nodeType===9?n:n.ownerDocument}function pm(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gm(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function Af(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Of=null;function aw(){var n=window.event;return n&&n.type==="popstate"?n===Of?!1:(Of=n,!0):(Of=null,!1)}var mm=typeof setTimeout=="function"?setTimeout:void 0,iw=typeof clearTimeout=="function"?clearTimeout:void 0,ym=typeof Promise=="function"?Promise:void 0,ow=typeof queueMicrotask=="function"?queueMicrotask:typeof ym<"u"?function(n){return ym.resolve(null).then(n).catch(lw)}:mm;function lw(n){setTimeout(function(){throw n})}function Hr(n){return n==="head"}function vm(n,s){var i=s,o=0;do{var f=i.nextSibling;if(n.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(o===0){n.removeChild(f),ja(s);return}o--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")o++;else if(i==="html")Ui(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,Ui(i);for(var d=i.firstChild;d;){var v=d.nextSibling,w=d.nodeName;d[ei]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=v}}else i==="body"&&Ui(n.ownerDocument.body);i=f}while(i);ja(s)}function bm(n,s){var i=n;n=0;do{var o=i.nextSibling;if(i.nodeType===1?s?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(s?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=o}while(i)}function xf(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":xf(i),Mu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function uw(n,s,i,o){for(;n.nodeType===1;){var f=i;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!o&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(o){if(!n[ei])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(d=n.getAttribute("rel"),d==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(d!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(d=n.getAttribute("src"),(d!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===d)return n}else return n;if(n=vn(n.nextSibling),n===null)break}return null}function cw(n,s,i){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=vn(n.nextSibling),n===null))return null;return n}function _m(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=vn(n.nextSibling),n===null))return null;return n}function Cf(n){return n.data==="$?"||n.data==="$~"}function kf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function fw(n,s){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||i.readyState!=="loading")s();else{var o=function(){s(),i.removeEventListener("DOMContentLoaded",o)};i.addEventListener("DOMContentLoaded",o),n._reactRetry=o}}function vn(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}var jf=null;function wm(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(s===0)return vn(n.nextSibling);s--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||s++}n=n.nextSibling}return null}function Sm(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(s===0)return n;s--}else i!=="/$"&&i!=="/&"||s++}n=n.previousSibling}return null}function Em(n,s,i){switch(s=_l(i),n){case"html":if(n=s.documentElement,!n)throw Error(a(452));return n;case"head":if(n=s.head,!n)throw Error(a(453));return n;case"body":if(n=s.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Ui(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Mu(n)}var bn=new Map,Tm=new Set;function wl(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var cr=F.d;F.d={f:hw,r:dw,D:pw,C:gw,L:mw,m:yw,X:bw,S:vw,M:_w};function hw(){var n=cr.f(),s=hl();return n||s}function dw(n){var s=Js(n);s!==null&&s.tag===5&&s.type==="form"?Ip(s):cr.r(n)}var xa=typeof document>"u"?null:document;function Rm(n,s,i){var o=xa;if(o&&typeof s=="string"&&s){var f=fn(s);f='link[rel="'+n+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),Tm.has(f)||(Tm.add(f),n={rel:n,crossOrigin:i,href:s},o.querySelector(f)===null&&(s=o.createElement("link"),Et(s,"link",n),pt(s),o.head.appendChild(s)))}}function pw(n){cr.D(n),Rm("dns-prefetch",n,null)}function gw(n,s){cr.C(n,s),Rm("preconnect",n,s)}function mw(n,s,i){cr.L(n,s,i);var o=xa;if(o&&n&&s){var f='link[rel="preload"][as="'+fn(s)+'"]';s==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+fn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+fn(i.imageSizes)+'"]')):f+='[href="'+fn(n)+'"]';var d=f;switch(s){case"style":d=Ca(n);break;case"script":d=ka(n)}bn.has(d)||(n=m({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:n,as:s},i),bn.set(d,n),o.querySelector(f)!==null||s==="style"&&o.querySelector(Pi(d))||s==="script"&&o.querySelector(zi(d))||(s=o.createElement("link"),Et(s,"link",n),pt(s),o.head.appendChild(s)))}}function yw(n,s){cr.m(n,s);var i=xa;if(i&&n){var o=s&&typeof s.as=="string"?s.as:"script",f='link[rel="modulepreload"][as="'+fn(o)+'"][href="'+fn(n)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ka(n)}if(!bn.has(d)&&(n=m({rel:"modulepreload",href:n},s),bn.set(d,n),i.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(zi(d)))return}o=i.createElement("link"),Et(o,"link",n),pt(o),i.head.appendChild(o)}}}function vw(n,s,i){cr.S(n,s,i);var o=xa;if(o&&n){var f=Xs(o).hoistableStyles,d=Ca(n);s=s||"default";var v=f.get(d);if(!v){var w={loading:0,preload:null};if(v=o.querySelector(Pi(d)))w.loading=5;else{n=m({rel:"stylesheet",href:n,"data-precedence":s},i),(i=bn.get(d))&&Mf(n,i);var x=v=o.createElement("link");pt(x),Et(x,"link",n),x._p=new Promise(function(P,I){x.onload=P,x.onerror=I}),x.addEventListener("load",function(){w.loading|=1}),x.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Sl(v,s,o)}v={type:"stylesheet",instance:v,count:1,state:w},f.set(d,v)}}}function bw(n,s){cr.X(n,s);var i=xa;if(i&&n){var o=Xs(i).hoistableScripts,f=ka(n),d=o.get(f);d||(d=i.querySelector(zi(f)),d||(n=m({src:n,async:!0},s),(s=bn.get(f))&&Nf(n,s),d=i.createElement("script"),pt(d),Et(d,"link",n),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function _w(n,s){cr.M(n,s);var i=xa;if(i&&n){var o=Xs(i).hoistableScripts,f=ka(n),d=o.get(f);d||(d=i.querySelector(zi(f)),d||(n=m({src:n,async:!0,type:"module"},s),(s=bn.get(f))&&Nf(n,s),d=i.createElement("script"),pt(d),Et(d,"link",n),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function Am(n,s,i,o){var f=(f=ce.current)?wl(f):null;if(!f)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(s=Ca(i.href),i=Xs(f).hoistableStyles,o=i.get(s),o||(o={type:"style",instance:null,count:0,state:null},i.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Ca(i.href);var d=Xs(f).hoistableStyles,v=d.get(n);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(n,v),(d=f.querySelector(Pi(n)))&&!d._p&&(v.instance=d,v.state.loading=5),bn.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},bn.set(n,i),d||ww(f,n,i,v.state))),s&&o===null)throw Error(a(528,""));return v}if(s&&o!==null)throw Error(a(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ka(i),i=Xs(f).hoistableScripts,o=i.get(s),o||(o={type:"script",instance:null,count:0,state:null},i.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function Ca(n){return'href="'+fn(n)+'"'}function Pi(n){return'link[rel="stylesheet"]['+n+"]"}function Om(n){return m({},n,{"data-precedence":n.precedence,precedence:null})}function ww(n,s,i,o){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?o.loading=1:(s=n.createElement("link"),o.preload=s,s.addEventListener("load",function(){return o.loading|=1}),s.addEventListener("error",function(){return o.loading|=2}),Et(s,"link",i),pt(s),n.head.appendChild(s))}function ka(n){return'[src="'+fn(n)+'"]'}function zi(n){return"script[async]"+n}function xm(n,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var o=n.querySelector('style[data-href~="'+fn(i.href)+'"]');if(o)return s.instance=o,pt(o),o;var f=m({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(n.ownerDocument||n).createElement("style"),pt(o),Et(o,"style",f),Sl(o,i.precedence,n),s.instance=o;case"stylesheet":f=Ca(i.href);var d=n.querySelector(Pi(f));if(d)return s.state.loading|=4,s.instance=d,pt(d),d;o=Om(i),(f=bn.get(f))&&Mf(o,f),d=(n.ownerDocument||n).createElement("link"),pt(d);var v=d;return v._p=new Promise(function(w,x){v.onload=w,v.onerror=x}),Et(d,"link",o),s.state.loading|=4,Sl(d,i.precedence,n),s.instance=d;case"script":return d=ka(i.src),(f=n.querySelector(zi(d)))?(s.instance=f,pt(f),f):(o=i,(f=bn.get(d))&&(o=m({},i),Nf(o,f)),n=n.ownerDocument||n,f=n.createElement("script"),pt(f),Et(f,"link",o),n.head.appendChild(f),s.instance=f);case"void":return null;default:throw Error(a(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(o=s.instance,s.state.loading|=4,Sl(o,i.precedence,n));return s.instance}function Sl(n,s,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,d=f,v=0;v<o.length;v++){var w=o[v];if(w.dataset.precedence===s)d=w;else if(d!==f)break}d?d.parentNode.insertBefore(n,d.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(n,s.firstChild))}function Mf(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function Nf(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var El=null;function Cm(n,s,i){if(El===null){var o=new Map,f=El=new Map;f.set(i,o)}else f=El,o=f.get(i),o||(o=new Map,f.set(i,o));if(o.has(n))return o;for(o.set(n,null),i=i.getElementsByTagName(n),f=0;f<i.length;f++){var d=i[f];if(!(d[ei]||d[bt]||n==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(s)||"";v=n+v;var w=o.get(v);w?w.push(d):o.set(v,[d])}}return o}function km(n,s,i){n=n.ownerDocument||n,n.head.insertBefore(i,s==="title"?n.querySelector("head > title"):null)}function Sw(n,s,i){if(i===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(n=s.disabled,typeof s.precedence=="string"&&n==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function jm(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function Ew(n,s,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Ca(o.href),d=s.querySelector(Pi(f));if(d){s=d._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Tl.bind(n),s.then(n,n)),i.state.loading|=4,i.instance=d,pt(d);return}d=s.ownerDocument||s,o=Om(o),(f=bn.get(f))&&Mf(o,f),d=d.createElement("link"),pt(d);var v=d;v._p=new Promise(function(w,x){v.onload=w,v.onerror=x}),Et(d,"link",o),i.instance=d}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,s),(s=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=Tl.bind(n),s.addEventListener("load",i),s.addEventListener("error",i))}}var Df=0;function Tw(n,s){return n.stylesheets&&n.count===0&&Al(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var o=setTimeout(function(){if(n.stylesheets&&Al(n,n.stylesheets),n.unsuspend){var d=n.unsuspend;n.unsuspend=null,d()}},6e4+s);0<n.imgBytes&&Df===0&&(Df=62500*sw());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Al(n,n.stylesheets),n.unsuspend)){var d=n.unsuspend;n.unsuspend=null,d()}},(n.imgBytes>Df?50:800)+s);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Al(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Rl=null;function Al(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Rl=new Map,s.forEach(Rw,n),Rl=null,Tl.call(n))}function Rw(n,s){if(!(s.state.loading&4)){var i=Rl.get(n);if(i)var o=i.get(null);else{i=new Map,Rl.set(n,i);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var v=f[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(i.set(v.dataset.precedence,v),o=v)}o&&i.set(null,o)}f=s.instance,v=f.getAttribute("data-precedence"),d=i.get(v)||o,d===o&&i.set(null,f),i.set(v,f),this.count++,o=Tl.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),d?d.parentNode.insertBefore(f,d.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),s.state.loading|=4}}var Bi={$$typeof:j,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function Aw(n,s,i,o,f,d,v,w,x){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wr(0),this.hiddenUpdates=wr(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Mm(n,s,i,o,f,d,v,w,x,P,I,G){return n=new Aw(n,s,i,v,x,P,I,G,w),s=1,d===!0&&(s|=24),d=en(3,null,null,s),n.current=d,d.stateNode=n,s=hc(),s.refCount++,n.pooledCache=s,s.refCount++,d.memoizedState={element:o,isDehydrated:i,cache:s},mc(d),n}function Nm(n){return n?(n=oa,n):oa}function Dm(n,s,i,o,f,d){f=Nm(f),o.context===null?o.context=f:o.pendingContext=f,o=Cr(s),o.payload={element:i},d=d===void 0?null:d,d!==null&&(o.callback=d),i=kr(n,o,s),i!==null&&(Kt(i,n,s),yi(i,n,s))}function Lm(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<s?i:s}}function Lf(n,s){Lm(n,s),(n=n.alternate)&&Lm(n,s)}function Um(n){if(n.tag===13||n.tag===31){var s=gs(n,67108864);s!==null&&Kt(s,n,67108864),Lf(n,67108864)}}function Pm(n){if(n.tag===13||n.tag===31){var s=an();s=Ys(s);var i=gs(n,s);i!==null&&Kt(i,n,s),Lf(n,s)}}var Ol=!0;function Ow(n,s,i,o){var f=U.T;U.T=null;var d=F.p;try{F.p=2,Uf(n,s,i,o)}finally{F.p=d,U.T=f}}function xw(n,s,i,o){var f=U.T;U.T=null;var d=F.p;try{F.p=8,Uf(n,s,i,o)}finally{F.p=d,U.T=f}}function Uf(n,s,i,o){if(Ol){var f=Pf(o);if(f===null)Sf(n,s,o,xl,i),Bm(n,o);else if(kw(f,n,s,i,o))o.stopPropagation();else if(Bm(n,o),s&4&&-1<Cw.indexOf(n)){for(;f!==null;){var d=Js(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=Nn(d.pendingLanes);if(v!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;v;){var x=1<<31-Ot(v);w.entanglements[1]|=x,v&=~x}Pn(d),(Ne&6)===0&&(cl=ht()+500,Ni(0))}}break;case 31:case 13:w=gs(d,2),w!==null&&Kt(w,d,2),hl(),Lf(d,2)}if(d=Pf(o),d===null&&Sf(n,s,o,xl,i),d===f)break;f=d}f!==null&&o.stopPropagation()}else Sf(n,s,o,null,i)}}function Pf(n){return n=zu(n),zf(n)}var xl=null;function zf(n){if(xl=null,n=Qs(n),n!==null){var s=u(n);if(s===null)n=null;else{var i=s.tag;if(i===13){if(n=c(s),n!==null)return n;n=null}else if(i===31){if(n=h(s),n!==null)return n;n=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return xl=n,null}function zm(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ue()){case Je:return 2;case un:return 8;case Vn:case Za:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var Bf=!1,Ir=null,qr=null,$r=null,Hi=new Map,Ii=new Map,Gr=[],Cw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Bm(n,s){switch(n){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":qr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":Hi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(s.pointerId)}}function qi(n,s,i,o,f,d){return n===null||n.nativeEvent!==d?(n={blockedOn:s,domEventName:i,eventSystemFlags:o,nativeEvent:d,targetContainers:[f]},s!==null&&(s=Js(s),s!==null&&Um(s)),n):(n.eventSystemFlags|=o,s=n.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),n)}function kw(n,s,i,o,f){switch(s){case"focusin":return Ir=qi(Ir,n,s,i,o,f),!0;case"dragenter":return qr=qi(qr,n,s,i,o,f),!0;case"mouseover":return $r=qi($r,n,s,i,o,f),!0;case"pointerover":var d=f.pointerId;return Hi.set(d,qi(Hi.get(d)||null,n,s,i,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Ii.set(d,qi(Ii.get(d)||null,n,s,i,o,f)),!0}return!1}function Hm(n){var s=Qs(n.target);if(s!==null){var i=u(s);if(i!==null){if(s=i.tag,s===13){if(s=c(i),s!==null){n.blockedOn=s,ed(n.priority,function(){Pm(i)});return}}else if(s===31){if(s=h(i),s!==null){n.blockedOn=s,ed(n.priority,function(){Pm(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Cl(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var i=Pf(n.nativeEvent);if(i===null){i=n.nativeEvent;var o=new i.constructor(i.type,i);Pu=o,i.target.dispatchEvent(o),Pu=null}else return s=Js(i),s!==null&&Um(s),n.blockedOn=i,!1;s.shift()}return!0}function Im(n,s,i){Cl(n)&&i.delete(s)}function jw(){Bf=!1,Ir!==null&&Cl(Ir)&&(Ir=null),qr!==null&&Cl(qr)&&(qr=null),$r!==null&&Cl($r)&&($r=null),Hi.forEach(Im),Ii.forEach(Im)}function kl(n,s){n.blockedOn===s&&(n.blockedOn=null,Bf||(Bf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jw)))}var jl=null;function qm(n){jl!==n&&(jl=n,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jl===n&&(jl=null);for(var s=0;s<n.length;s+=3){var i=n[s],o=n[s+1],f=n[s+2];if(typeof o!="function"){if(zf(o||i)===null)continue;break}var d=Js(i);d!==null&&(n.splice(s,3),s-=3,Uc(d,{pending:!0,data:f,method:i.method,action:o},o,f))}}))}function ja(n){function s(x){return kl(x,n)}Ir!==null&&kl(Ir,n),qr!==null&&kl(qr,n),$r!==null&&kl($r,n),Hi.forEach(s),Ii.forEach(s);for(var i=0;i<Gr.length;i++){var o=Gr[i];o.blockedOn===n&&(o.blockedOn=null)}for(;0<Gr.length&&(i=Gr[0],i.blockedOn===null);)Hm(i),i.blockedOn===null&&Gr.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(o=0;o<i.length;o+=3){var f=i[o],d=i[o+1],v=f[Ht]||null;if(typeof d=="function")v||qm(i);else if(v){var w=null;if(d&&d.hasAttribute("formAction")){if(f=d,v=d[Ht]||null)w=v.formAction;else if(zf(f)!==null)continue}else w=v.action;typeof w=="function"?i[o+1]=w:(i.splice(o,3),o-=3),qm(i)}}}function $m(){function n(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function s(){f!==null&&(f(),f=null),o||setTimeout(i,20)}function i(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(i,100),function(){o=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),f!==null&&(f(),f=null)}}}function Hf(n){this._internalRoot=n}Ml.prototype.render=Hf.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(a(409));var i=s.current,o=an();Dm(i,o,n,s,null,null)},Ml.prototype.unmount=Hf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;Dm(n.current,2,null,n,null,null),hl(),s[Fs]=null}};function Ml(n){this._internalRoot=n}Ml.prototype.unstable_scheduleHydration=function(n){if(n){var s=ku();n={blockedOn:null,target:n,priority:s};for(var i=0;i<Gr.length&&s!==0&&s<Gr[i].priority;i++);Gr.splice(i,0,n),i===0&&Hm(n)}};var Gm=e.version;if(Gm!=="19.2.5")throw Error(a(527,Gm,"19.2.5"));F.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=g(s),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var Mw={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nl.isDisabled&&Nl.supportsFiber)try{ls=Nl.inject(Mw),jt=Nl}catch{}}return Gi.createRoot=function(n,s){if(!l(n))throw Error(a(299));var i=!1,o="",f=Xp,d=Zp,v=Wp;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(d=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError)),s=Mm(n,1,!1,null,null,i,o,null,f,d,v,$m),n[Fs]=s.current,wf(n),new Hf(s)},Gi.hydrateRoot=function(n,s,i){if(!l(n))throw Error(a(299));var o=!1,f="",d=Xp,v=Zp,w=Wp,x=null;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.formState!==void 0&&(x=i.formState)),s=Mm(n,1,!0,s,i??null,o,f,x,d,v,w,$m),s.context=Nm(null),i=s.current,o=an(),o=Ys(o),f=Cr(o),f.callback=null,kr(i,f,o),i=o,s.current.lanes=i,Qe(s,i),Pn(s),n[Fs]=s.current,wf(n),new Ml(s)},Gi.version="19.2.5",Gi}var ey;function qw(){if(ey)return $f.exports;ey=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),$f.exports=Iw(),$f.exports}var $w=qw(),Gw="__TSS_CONTEXT",dh=Symbol.for("TSS_SERVER_FUNCTION"),Zk=Symbol.for("TSS_SERVER_FUNCTION_FACTORY"),Vw="application/x-tss-framed",fr={JSON:0,CHUNK:1,END:2,ERROR:3},Kw=/;\s*v=(\d+)/;function Yw(t){const e=t.match(Kw);return e?parseInt(e[1],10):void 0}function Fw(t){const e=Yw(t);if(e!==void 0&&e!==1)throw new Error(`Incompatible framed protocol version: server=${e}, client=1. Please ensure client and server are using compatible versions.`)}var Lv=()=>window.__TSS_START_OPTIONS__,Uv=!1;function so(t){return t[t.length-1]}function Qw(t){return typeof t=="function"}function Jr(t,e){return Qw(t)?t(e):t}var Jw=Object.prototype.hasOwnProperty,ty=Object.prototype.propertyIsEnumerable,Xw=()=>Object.create(null),xs=(t,e)=>Ms(t,e,Xw);function Ms(t,e,r=()=>({}),a=0){if(t===e)return t;if(a>500)return e;const l=e,u=sy(t)&&sy(l);if(!u&&!(Qa(t)&&Qa(l)))return l;const c=u?t:ny(t);if(!c)return l;const h=u?l:ny(l);if(!h)return l;const p=c.length,g=h.length,y=u?new Array(g):r();let m=0;for(let b=0;b<g;b++){const _=u?b:h[b],S=t[_],O=l[_];if(S===O){y[_]=S,(u?b<p:Jw.call(t,_))&&m++;continue}if(S===null||O===null||typeof S!="object"||typeof O!="object"){y[_]=O;continue}const E=Ms(S,O,r,a+1);y[_]=E,E===S&&m++}return p===g&&m===p?t:y}function ny(t){const e=Object.getOwnPropertyNames(t);for(const l of e)if(!ty.call(t,l))return!1;const r=Object.getOwnPropertySymbols(t);if(r.length===0)return e;const a=e;for(const l of r){if(!ty.call(t,l))return!1;a.push(l)}return a}function Qa(t){if(!ry(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!ry(r)||!r.hasOwnProperty("isPrototypeOf"))}function ry(t){return Object.prototype.toString.call(t)==="[object Object]"}function sy(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Qt(t,e,r){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let a=0,l=t.length;a<l;a++)if(!Qt(t[a],e[a],r))return!1;return!0}if(Qa(t)&&Qa(e)){const a=r?.ignoreUndefined??!0;if(r?.partial){for(const c in e)if((!a||e[c]!==void 0)&&!Qt(t[c],e[c],r))return!1;return!0}let l=0;if(!a)l=Object.keys(t).length;else for(const c in t)t[c]!==void 0&&l++;let u=0;for(const c in e)if((!a||e[c]!==void 0)&&(u++,u>l||!Qt(t[c],e[c],r)))return!1;return l===u}return!1}function Bs(t){let e,r;const a=new Promise((l,u)=>{e=l,r=u});return a.status="pending",a.resolve=l=>{a.status="resolved",a.value=l,e(l),t?.(l)},a.reject=l=>{a.status="rejected",r(l)},a}function Zw(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function ao(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function Ww(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function ay(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return Ww(e)}var eS=["http:","https:","mailto:","tel:"];function nu(t,e){if(!t)return!1;try{const r=new URL(t);return!e.has(r.protocol)}catch{return!1}}var tS={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},nS=/[&><\u2028\u2029]/g;function rS(t){return t.replace(nS,e=>tS[e])}function Vi(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let r=0,a="",l;for(;(l=e.exec(t))!==null;)a+=ay(t.slice(r,l.index))+l[0],r=e.lastIndex;a=a+ay(r?t.slice(r):t);let u=!1;return a.startsWith("//")&&(u=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:u}}function sS(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function aS(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Xt(){throw new Error("Invariant failed")}function io(t){const e=new Map;let r,a;const l=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,a&&(a.next=u,u.prev=a)):(u.next.prev=void 0,r=u.next,u.next=void 0,a&&(u.prev=a,a.next=u)),a=u)};return{get(u){const c=e.get(u);if(c)return l(c),c.value},set(u,c){if(e.size>=t&&r){const p=r;e.delete(p.key),p.next&&(r=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const h=e.get(u);if(h)h.value=c,l(h);else{const p={key:u,value:c,prev:a};a&&(a.next=p),a=p,r||(r=p),e.set(u,p)}},clear(){e.clear(),r=void 0,a=void 0}}}var Xr=4,Pv=5;function iS(t){const e=t.indexOf("{");if(e===-1)return null;const r=t.indexOf("}",e);return r===-1||e+1>=t.length?null:[e,r]}function Bh(t,e,r=new Uint16Array(6)){const a=t.indexOf("/",e),l=a===-1?t.length:a,u=t.substring(e,l);if(!u||!u.includes("$"))return r[0]=0,r[1]=e,r[2]=e,r[3]=l,r[4]=l,r[5]=l,r;if(u==="$"){const h=t.length;return r[0]=2,r[1]=e,r[2]=e,r[3]=h,r[4]=h,r[5]=h,r}if(u.charCodeAt(0)===36)return r[0]=1,r[1]=e,r[2]=e+1,r[3]=l,r[4]=l,r[5]=l,r;const c=iS(u);if(c){const[h,p]=c,g=u.charCodeAt(h+1);if(g===45){if(h+2<u.length&&u.charCodeAt(h+2)===36){const y=h+3,m=p;if(y<m)return r[0]=3,r[1]=e+h,r[2]=e+y,r[3]=e+m,r[4]=e+p+1,r[5]=l,r}}else if(g===36){const y=h+1,m=h+2;return m===p?(r[0]=2,r[1]=e+h,r[2]=e+y,r[3]=e+m,r[4]=e+p+1,r[5]=t.length,r):(r[0]=1,r[1]=e+h,r[2]=e+m,r[3]=e+p,r[4]=e+p+1,r[5]=l,r)}}return r[0]=0,r[1]=e,r[2]=e,r[3]=l,r[4]=l,r[5]=l,r}function mu(t,e,r,a,l,u,c){c?.(r);let h=a;{const p=r.fullPath??r.from,g=p.length,y=r.options?.caseSensitive??t,m=!!(r.options?.params?.parse&&r.options?.skipRouteOnParseError?.params);for(;h<g;){const _=Bh(p,h,e);let S;const O=h,E=_[5];switch(h=E+1,u++,_[0]){case 0:{const A=p.substring(_[2],_[3]);if(y){const M=l.static?.get(A);if(M)S=M;else{l.static??=new Map;const j=Ns(r.fullPath??r.from);j.parent=l,j.depth=u,S=j,l.static.set(A,j)}}else{const M=A.toLowerCase(),j=l.staticInsensitive?.get(M);if(j)S=j;else{l.staticInsensitive??=new Map;const D=Ns(r.fullPath??r.from);D.parent=l,D.depth=u,S=D,l.staticInsensitive.set(M,D)}}break}case 1:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=!m&&l.dynamic?.find(H=>!H.skipOnParamError&&H.caseSensitive===j&&H.prefix===D&&H.suffix===X);if(K)S=K;else{const H=Ff(1,r.fullPath??r.from,j,D,X);S=H,H.depth=u,H.parent=l,l.dynamic??=[],l.dynamic.push(H)}break}case 3:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=!m&&l.optional?.find(H=>!H.skipOnParamError&&H.caseSensitive===j&&H.prefix===D&&H.suffix===X);if(K)S=K;else{const H=Ff(3,r.fullPath??r.from,j,D,X);S=H,H.parent=l,H.depth=u,l.optional??=[],l.optional.push(H)}break}case 2:{const A=p.substring(O,_[1]),M=p.substring(_[4],E),j=y&&!!(A||M),D=A?j?A:A.toLowerCase():void 0,X=M?j?M:M.toLowerCase():void 0,K=Ff(2,r.fullPath??r.from,j,D,X);S=K,K.parent=l,K.depth=u,l.wildcard??=[],l.wildcard.push(K)}}l=S}if(m&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const _=Ns(r.fullPath??r.from);_.kind=Pv,_.parent=l,u++,_.depth=u,l.pathless??=[],l.pathless.push(_),l=_}const b=(r.path||!r.children)&&!r.isRoot;if(b&&p.endsWith("/")){const _=Ns(r.fullPath??r.from);_.kind=Xr,_.parent=l,u++,_.depth=u,l.index=_,l=_}l.parse=r.options?.params?.parse??null,l.skipOnParamError=m,l.parsingPriority=r.options?.skipRouteOnParseError?.priority??0,b&&!l.route&&(l.route=r,l.fullPath=r.fullPath??r.from)}if(r.children)for(const p of r.children)mu(t,e,p,h,l,u,c)}function Yf(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function Kr(t){if(t.pathless)for(const e of t.pathless)Kr(e);if(t.static)for(const e of t.static.values())Kr(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())Kr(e);if(t.dynamic?.length){t.dynamic.sort(Yf);for(const e of t.dynamic)Kr(e)}if(t.optional?.length){t.optional.sort(Yf);for(const e of t.optional)Kr(e)}if(t.wildcard?.length){t.wildcard.sort(Yf);for(const e of t.wildcard)Kr(e)}}function Ns(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ff(t,e,r,a,l){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:a,suffix:l}}function oS(t,e){const r=Ns("/"),a=new Uint16Array(6);for(const l of t)mu(!1,a,l,1,r,0);Kr(r),e.masksTree=r,e.flatCache=io(1e3)}function lS(t,e){t||="/";const r=e.flatCache.get(t);if(r)return r;const a=Hh(t,e.masksTree);return e.flatCache.set(t,a),a}function uS(t,e,r,a,l){t||="/",a||="/";const u=e?`case\0${t}`:t;let c=l.singleCache.get(u);return c||(c=Ns("/"),mu(e,new Uint16Array(6),{from:t},1,c,0),l.singleCache.set(u,c)),Hh(a,c,r)}function cS(t,e,r=!1){const a=r?t:`nofuzz\0${t}`,l=e.matchCache.get(a);if(l!==void 0)return l;t||="/";let u;try{u=Hh(t,e.segmentTree,r)}catch(c){if(c instanceof URIError)u=null;else throw c}return u&&(u.branch=dS(u.route)),e.matchCache.set(a,u),u}function fS(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function hS(t,e=!1,r){const a=Ns(t.fullPath),l=new Uint16Array(6),u={},c={};let h=0;return mu(e,l,t,1,a,0,p=>{if(r?.(p,h),p.id in u&&Xt(),u[p.id]=p,h!==0&&p.path){const g=fS(p.fullPath);(!c[g]||p.fullPath.endsWith("/"))&&(c[g]=p)}h++}),Kr(a),{processedTree:{segmentTree:a,singleCache:io(1e3),matchCache:io(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:c}}function Hh(t,e,r=!1){const a=t.split("/"),l=gS(t,a,e,r);if(!l)return null;const[u]=zv(t,a,l);return{route:l.node.route,rawParams:u,parsedParams:l.parsedParams}}function zv(t,e,r){const a=pS(r.node);let l=null;const u=Object.create(null);let c=r.extract?.part??0,h=r.extract?.node??0,p=r.extract?.path??0,g=r.extract?.segment??0;for(;h<a.length;c++,h++,p++,g++){const y=a[h];if(y.kind===Xr)break;if(y.kind===Pv){g--,c--,p--;continue}const m=e[c],b=p;if(m&&(p+=m.length),y.kind===1){l??=r.node.fullPath.split("/");const _=l[g],S=y.prefix?.length??0;if(_.charCodeAt(S)===123){const O=y.suffix?.length??0,E=_.substring(S+2,_.length-O-1),A=m.substring(S,m.length-O);u[E]=decodeURIComponent(A)}else{const O=_.substring(1);u[O]=decodeURIComponent(m)}}else if(y.kind===3){if(r.skipped&1<<h){c--,p=b-1;continue}l??=r.node.fullPath.split("/");const _=l[g],S=y.prefix?.length??0,O=y.suffix?.length??0,E=_.substring(S+3,_.length-O-1),A=y.suffix||y.prefix?m.substring(S,m.length-O):m;A&&(u[E]=decodeURIComponent(A))}else if(y.kind===2){const _=y,S=t.substring(b+(_.prefix?.length??0),t.length-(_.suffix?.length??0)),O=decodeURIComponent(S);u["*"]=O,u._splat=O;break}}return r.rawParams&&Object.assign(u,r.rawParams),[u,{part:c,node:h,path:p,segment:g}]}function dS(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function pS(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function gS(t,e,r,a){if(t==="/"&&r.index)return{node:r.index,skipped:0};const l=!so(e),u=l&&t!=="/",c=e.length-(l?1:0),h=[{node:r,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let p=null,g=null;for(;h.length;){const y=h.pop(),{node:m,index:b,skipped:_,depth:S,statics:O,dynamics:E,optionals:A}=y;let{extract:M,rawParams:j,parsedParams:D}=y;if(m.kind===2&&m.route&&!Ll(g,y))continue;if(m.skipOnParamError){if(!iy(t,e,y))continue;j=y.rawParams,M=y.extract,D=y.parsedParams}a&&m.route&&m.kind!==Xr&&Ll(p,y)&&(p=y);const X=b===c;if(X&&(m.route&&(!u||m.kind===Xr||m.kind===2)&&Ll(g,y)&&(g=y),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const K=X?void 0:e[b];let H;if(X&&m.index){const Y={node:m.index,index:b,skipped:_,depth:S+1,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D};let W=!0;if(m.index.skipOnParamError&&(iy(t,e,Y)||(W=!1)),W){if(!E&&!A&&!_&&mS(O,c))return Y;Ll(g,Y)&&(g=Y)}}if(m.wildcard)for(let Y=m.wildcard.length-1;Y>=0;Y--){const W=m.wildcard[Y],{prefix:le,suffix:ie}=W;if(!(le&&(X||!(W.caseSensitive?K:H??=K.toLowerCase()).startsWith(le)))){if(ie){if(X)continue;const me=e.slice(b).join("/").slice(-ie.length);if((W.caseSensitive?me:me.toLowerCase())!==ie)continue}h.push({node:W,index:c,skipped:_,depth:S+1,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}}if(m.optional){const Y=_|1<<S,W=S+1;for(let le=m.optional.length-1;le>=0;le--){const ie=m.optional[le];h.push({node:ie,index:b,skipped:Y,depth:W,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X)for(let le=m.optional.length-1;le>=0;le--){const ie=m.optional[le],{prefix:me,suffix:_e}=ie;if(me||_e){const qe=ie.caseSensitive?K:H??=K.toLowerCase();if(me&&!qe.startsWith(me)||_e&&!qe.endsWith(_e))continue}h.push({node:ie,index:b+1,skipped:_,depth:W,statics:O,dynamics:E,optionals:A+Dl(c,b),extract:M,rawParams:j,parsedParams:D})}}if(!X&&m.dynamic&&K)for(let Y=m.dynamic.length-1;Y>=0;Y--){const W=m.dynamic[Y],{prefix:le,suffix:ie}=W;if(le||ie){const me=W.caseSensitive?K:H??=K.toLowerCase();if(le&&!me.startsWith(le)||ie&&!me.endsWith(ie))continue}h.push({node:W,index:b+1,skipped:_,depth:S+1,statics:O,dynamics:E+Dl(c,b),optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X&&m.staticInsensitive){const Y=m.staticInsensitive.get(H??=K.toLowerCase());Y&&h.push({node:Y,index:b+1,skipped:_,depth:S+1,statics:O+Dl(c,b),dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(!X&&m.static){const Y=m.static.get(K);Y&&h.push({node:Y,index:b+1,skipped:_,depth:S+1,statics:O+Dl(c,b),dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}if(m.pathless){const Y=S+1;for(let W=m.pathless.length-1;W>=0;W--){const le=m.pathless[W];h.push({node:le,index:b,skipped:_,depth:Y,statics:O,dynamics:E,optionals:A,extract:M,rawParams:j,parsedParams:D})}}}if(g)return g;if(a&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=e[b].length;const m=y===t.length?"/":t.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(m),p}return null}function Dl(t,e){return 2**(t-e-1)}function mS(t,e){return t===2**(e-1)-1}function iy(t,e,r){try{const[a,l]=zv(t,e,r);r.rawParams=a,r.extract=l;const u=r.node.parse(a);return r.parsedParams=Object.assign(Object.create(null),r.parsedParams,u),!0}catch{return null}}function Ll(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Xr)>(t.node.kind===Xr)||e.node.kind===Xr==(t.node.kind===Xr)&&e.depth>t.depth))):!0}function Ql(t){return Ih(t.filter(e=>e!==void 0).join("/"))}function Ih(t){return t.replace(/\/{2,}/g,"/")}function Bv(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Wr(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function Hv(t){return Wr(Bv(t))}function ru(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function yS(t,e,r){return ru(t,r)===ru(e,r)}function vS({base:t,to:e,trailingSlash:r="never",cache:a}){const l=e.startsWith("/"),u=!l&&e===".";let c;if(a){c=l?e:u?t:t+"\0"+e;const m=a.get(c);if(m)return m}let h;if(u)h=t.split("/");else if(l)h=e.split("/");else{for(h=t.split("/");h.length>1&&so(h)==="";)h.pop();const m=e.split("/");for(let b=0,_=m.length;b<_;b++){const S=m[b];S===""?b?b===_-1&&h.push(S):h=[S]:S===".."?h.pop():S==="."||h.push(S)}}h.length>1&&(so(h)===""?r==="never"&&h.pop():r==="always"&&h.push(""));let p,g="";for(let m=0;m<h.length;m++){m>0&&(g+="/");const b=h[m];if(!b)continue;p=Bh(b,0,p);const _=p[0];if(_===0){g+=b;continue}const S=p[5],O=b.substring(0,p[1]),E=b.substring(p[4],S),A=b.substring(p[2],p[3]);_===1?g+=O||E?`${O}{$${A}}${E}`:`$${A}`:_===2?g+=O||E?`${O}{$}${E}`:"$":g+=`${O}{-$${A}}${E}`}g=Ih(g);const y=g||"/";return c&&a&&a.set(c,y),y}function bS(t){const e=new Map(t.map(l=>[encodeURIComponent(l),l])),r=Array.from(e.keys()).map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(r,"g");return l=>l.replace(a,u=>e.get(u)??u)}function Qf(t,e,r){const a=e[t];return typeof a!="string"?a:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(l=>ly(l,r)).join("/"):ly(a,r)}function oy({path:t,params:e,decoder:r,...a}){let l=!1;const u=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:l};if(!t.includes("$"))return{interpolatedPath:t,usedParams:u,isMissingParams:l};const c=t.length;let h=0,p,g="";for(;h<c;){const y=h;p=Bh(t,y,p);const m=p[5];if(h=m+1,y===m)continue;const b=p[0];if(b===0){g+="/"+t.substring(y,m);continue}if(b===2){const _=e._splat;u._splat=_,u["*"]=_;const S=t.substring(y,p[1]),O=t.substring(p[4],m);if(!_){l=!0,(S||O)&&(g+="/"+S+O);continue}const E=Qf("_splat",e,r);g+="/"+S+E+O;continue}if(b===1){const _=t.substring(p[2],p[3]);!l&&!(_ in e)&&(l=!0),u[_]=e[_];const S=t.substring(y,p[1]),O=t.substring(p[4],m),E=Qf(_,e,r)??"undefined";g+="/"+S+E+O;continue}if(b===3){const _=t.substring(p[2],p[3]),S=e[_];if(S==null)continue;u[_]=S;const O=t.substring(y,p[1]),E=t.substring(p[4],m),A=Qf(_,e,r)??"";g+="/"+O+A+E;continue}}return t.endsWith("/")&&(g+="/"),{usedParams:u,interpolatedPath:g||"/",isMissingParams:l}}function ly(t,e){const r=encodeURIComponent(t);return e?.(r)??r}function yt(t){return t?.isNotFound===!0}function _S(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var wS="tsr-scroll-restoration-v1_3";function SS(){const t=_S();if(!t)return null;let e={};try{const a=JSON.parse(t.getItem("tsr-scroll-restoration-v1_3")||"{}");Qa(a)&&(e=a)}catch{}return{get state(){return e},set:a=>{e=Jr(a,e)||e},persist:()=>{try{t.setItem(wS,JSON.stringify(e))}catch{}}}}var uy=SS(),ES=t=>t.state.__TSR_key||t.href;function TS(t){const e=[];let r;for(;r=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,t)+1})`),t=r;return`${e.reverse().join(" > ")}`.toLowerCase()}var Ul=!1,Ki="window",cy="data-scroll-restoration-id";function RS(t,e){if(!uy)return;const r=uy;if((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!r)return;t.isScrollRestorationSetup=!0,Ul=!1;const a=t.options.getScrollRestorationKey||ES,l=new Map;window.history.scrollRestoration="manual";const u=h=>{if(!(Ul||!t.isScrollRestoring))if(h.target===document||h.target===window)l.set(Ki,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const p=h.target;l.set(p,{scrollX:p.scrollLeft||0,scrollY:p.scrollTop||0})}},c=h=>{if(!t.isScrollRestoring||!h||l.size===0||!r)return;const p=r.state[h]||={};for(const[g,y]of l){let m;if(g===Ki)m=Ki;else if(g.isConnected){const b=g.getAttribute(cy);m=b?`[${cy}="${b}"]`:TS(g)}m&&(p[m]=y)}};document.addEventListener("scroll",u,!0),t.subscribe("onBeforeLoad",h=>{c(h.fromLocation?a(h.fromLocation):void 0),l.clear()}),window.addEventListener("pagehide",()=>{c(a(t.stores.resolvedLocation.get()??t.stores.location.get())),r.persist()}),t.subscribe("onRendered",h=>{const p=a(h.toLocation),g=t.options.scrollRestorationBehavior,y=t.options.scrollToTopSelectors;if(l.clear(),!t.resetNextScroll){t.resetNextScroll=!0;return}if(!(typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))){Ul=!0;try{const m=t.isScrollRestoring?r.state[p]:void 0;let b=!1;if(m)for(const _ in m){const S=m[_];if(!Qa(S))continue;const{scrollX:O,scrollY:E}=S;if(!(!Number.isFinite(O)||!Number.isFinite(E))){if(_===Ki)window.scrollTo({top:E,left:O,behavior:g}),b=!0;else if(_){let A;try{A=document.querySelector(_)}catch{continue}A&&(A.scrollLeft=O,A.scrollTop=E,b=!0)}}}if(!b){const _=t.history.location.hash.slice(1);if(_){const S=window.history.state?.__hashScrollIntoViewOptions??!0;if(S){const O=document.getElementById(_);O&&O.scrollIntoView(S)}}else{const S={top:0,left:0,behavior:g};if(window.scrollTo(S),y)for(const O of y){if(O===Ki)continue;const E=typeof O=="function"?O():document.querySelector(O);E&&E.scrollTo(S)}}}}finally{Ul=!1}t.isScrollRestoring&&r.set(m=>(m[p]||={},m))}})}function Iv(t,e=String){const r=new URLSearchParams;for(const a in t){const l=t[a];l!==void 0&&r.set(a,e(l))}return r.toString()}function Jf(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function AS(t){const e=new URLSearchParams(t),r=Object.create(null);for(const[a,l]of e.entries()){const u=r[a];u==null?r[a]=Jf(l):Array.isArray(u)?u.push(Jf(l)):r[a]=[u,Jf(l)]}return r}var OS=CS(JSON.parse),xS=kS(JSON.stringify,JSON.parse);function CS(t){return e=>{e[0]==="?"&&(e=e.substring(1));const r=AS(e);for(const a in r){const l=r[a];if(typeof l=="string")try{r[a]=t(l)}catch{}}return r}}function kS(t,e){const r=typeof e=="function";function a(l){if(typeof l=="object"&&l!==null)try{return t(l)}catch{}else if(r&&typeof l=="string")try{return e(l),t(l)}catch{}return l}return l=>{const u=Iv(l,a);return u?`?${u}`:""}}var Ps="__root__";function qv(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const r=new Response(null,{status:t.statusCode,headers:e});if(r.options=t,t.throw)throw r;return r}function Jt(t){return t instanceof Response&&!!t.options}function jS(t){if(t!==null&&typeof t=="object"&&t.isSerializedRedirect)return qv(t)}function MS(t){return{input:({url:e})=>{for(const r of t)e=ph(r,e);return e},output:({url:e})=>{for(let r=t.length-1;r>=0;r--)e=$v(t[r],e);return e}}}function NS(t){const e=Hv(t.basepath),r=`/${e}`,a=`${r}/`,l=t.caseSensitive?r:r.toLowerCase(),u=t.caseSensitive?a:a.toLowerCase();return{input:({url:c})=>{const h=t.caseSensitive?c.pathname:c.pathname.toLowerCase();return h===l?c.pathname="/":h.startsWith(u)&&(c.pathname=c.pathname.slice(r.length)),c},output:({url:c})=>(c.pathname=Ql(["/",e,c.pathname]),c)}}function ph(t,e){const r=t?.input?.({url:e});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return e}function $v(t,e){const r=t?.output?.({url:e});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return e}function DS(t,e){const{createMutableStore:r,createReadonlyStore:a,batch:l,init:u}=e,c=new Map,h=new Map,p=new Map,g=r(t.status),y=r(t.loadedAt),m=r(t.isLoading),b=r(t.isTransitioning),_=r(t.location),S=r(t.resolvedLocation),O=r(t.statusCode),E=r(t.redirect),A=r([]),M=r([]),j=r([]),D=a(()=>Xf(c,A.get())),X=a(()=>Xf(h,M.get())),K=a(()=>Xf(p,j.get())),H=a(()=>A.get()[0]),Y=a(()=>A.get().some(F=>c.get(F)?.get().status==="pending")),W=a(()=>({locationHref:_.get().href,resolvedLocationHref:S.get()?.href,status:g.get()})),le=a(()=>({status:g.get(),loadedAt:y.get(),isLoading:m.get(),isTransitioning:b.get(),matches:D.get(),location:_.get(),resolvedLocation:S.get(),statusCode:O.get(),redirect:E.get()})),ie=io(64);function me(F){let ae=ie.get(F);return ae||(ae=a(()=>{const Se=A.get();for(const ye of Se){const C=c.get(ye);if(C&&C.routeId===F)return C.get()}}),ie.set(F,ae)),ae}const _e={status:g,loadedAt:y,isLoading:m,isTransitioning:b,location:_,resolvedLocation:S,statusCode:O,redirect:E,matchesId:A,pendingIds:M,cachedIds:j,matches:D,pendingMatches:X,cachedMatches:K,firstId:H,hasPending:Y,matchRouteDeps:W,matchStores:c,pendingMatchStores:h,cachedMatchStores:p,__store:le,getRouteMatchStore:me,setMatches:qe,setPending:Me,setCached:U};qe(t.matches),u?.(_e);function qe(F){Zf(F,c,A,r,l)}function Me(F){Zf(F,h,M,r,l)}function U(F){Zf(F,p,j,r,l)}return _e}function Xf(t,e){const r=[];for(const a of e){const l=t.get(a);l&&r.push(l.get())}return r}function Zf(t,e,r,a,l){const u=t.map(h=>h.id),c=new Set(u);l(()=>{for(const h of e.keys())c.has(h)||e.delete(h);for(const h of t){const p=e.get(h.id);if(!p){const g=a(h);g.routeId=h.routeId,e.set(h.id,g);continue}p.routeId=h.routeId,p.get()!==h&&p.set(h)}aS(r.get(),u)||r.set(u)})}var gh=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},LS=t=>t.stores.matchesId.get().some(e=>t.stores.matchStores.get(e)?.get()._forcePending),yu=(t,e)=>!!(t.preload&&!t.router.stores.matchStores.has(e)),zs=(t,e,r=!0)=>{const a={...t.router.options.context??{}},l=r?e:e-1;for(let u=0;u<=l;u++){const c=t.matches[u];if(!c)continue;const h=t.router.getMatch(c.id);h&&Object.assign(a,h.__routeContext,h.__beforeLoadContext)}return a},fy=(t,e)=>{if(!t.matches.length)return;const r=e.routeId,a=t.matches.findIndex(c=>c.routeId===t.router.routeTree.id),l=a>=0?a:0;let u=r?t.matches.findIndex(c=>c.routeId===r):t.firstBadMatchIndex??t.matches.length-1;u<0&&(u=l);for(let c=u;c>=0;c--){const h=t.matches[c];if(t.router.looseRoutesById[h.routeId].options.notFoundComponent)return c}return r?u:l},Zr=(t,e,r)=>{if(!(!Jt(r)&&!yt(r)))throw Jt(r)&&r.redirectHandled&&!r.options.reloadDocument||(e&&(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0,e._nonReactive.error=r,t.updateMatch(e.id,a=>({...a,status:Jt(r)?"redirected":yt(r)?"notFound":a.status==="pending"?"success":a.status,context:zs(t,e.index),isFetching:!1,error:r})),yt(r)&&!r.routeId&&(r.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()),Jt(r)&&(t.rendered=!0,r.options._fromLocation=t.location,r.redirectHandled=!0,r=t.router.resolveRedirect(r))),r},Gv=(t,e)=>{const r=t.router.getMatch(e);return!!(!r||r._nonReactive.dehydrated)},hy=(t,e,r)=>{const a=zs(t,r);t.updateMatch(e,l=>({...l,context:a}))},Yi=(t,e,r,a)=>{const{id:l,routeId:u}=t.matches[e],c=t.router.looseRoutesById[u];if(r instanceof Promise)throw r;r.routerCode=a,t.firstBadMatchIndex??=e,Zr(t,t.router.getMatch(l),r);try{c.options.onError?.(r)}catch(h){r=h,Zr(t,t.router.getMatch(l),r)}t.updateMatch(l,h=>(h._nonReactive.beforeLoadPromise?.resolve(),h._nonReactive.beforeLoadPromise=void 0,h._nonReactive.loadPromise?.resolve(),{...h,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!Jt(r)&&!yt(r)&&(t.serialError??=r)},Vv=(t,e,r,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const l=r.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!yu(t,e)&&(r.options.loader||r.options.beforeLoad||Yv(r))&&typeof l=="number"&&l!==1/0&&(r.options.pendingComponent??t.router.options?.defaultPendingComponent)){const u=setTimeout(()=>{gh(t)},l);a._nonReactive.pendingTimeout=u}},US=(t,e,r)=>{const a=t.router.getMatch(e);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;Vv(t,e,r,a);const l=()=>{const u=t.router.getMatch(e);u.preload&&(u.status==="redirected"||u.status==="notFound")&&Zr(t,u,u.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(l):l()},PS=(t,e,r,a)=>{const l=t.router.getMatch(e);let u=l._nonReactive.loadPromise;l._nonReactive.loadPromise=Bs(()=>{u?.resolve(),u=void 0});const{paramsError:c,searchError:h}=l;c&&Yi(t,r,c,"PARSE_PARAMS"),h&&Yi(t,r,h,"VALIDATE_SEARCH"),Vv(t,e,a,l);const p=new AbortController;let g=!1;const y=()=>{g||(g=!0,t.updateMatch(e,D=>({...D,isFetching:"beforeLoad",fetchCount:D.fetchCount+1,abortController:p})))},m=()=>{l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,D=>({...D,isFetching:!1}))};if(!a.options.beforeLoad){t.router.batch(()=>{y(),m()});return}l._nonReactive.beforeLoadPromise=Bs();const b={...zs(t,r,!1),...l.__routeContext},{search:_,params:S,cause:O}=l,E=yu(t,e),A={search:_,abortController:p,params:S,preload:E,context:b,location:t.location,navigate:D=>t.router.navigate({...D,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:E?"preload":O,matches:t.matches,routeId:a.id,...t.router.options.additionalContext},M=D=>{if(D===void 0){t.router.batch(()=>{y(),m()});return}(Jt(D)||yt(D))&&(y(),Yi(t,r,D,"BEFORE_LOAD")),t.router.batch(()=>{y(),t.updateMatch(e,X=>({...X,__beforeLoadContext:D})),m()})};let j;try{if(j=a.options.beforeLoad(A),ao(j))return y(),j.catch(D=>{Yi(t,r,D,"BEFORE_LOAD")}).then(M)}catch(D){y(),Yi(t,r,D,"BEFORE_LOAD")}M(j)},zS=(t,e)=>{const{id:r,routeId:a}=t.matches[e],l=t.router.looseRoutesById[a],u=()=>h(),c=()=>PS(t,r,e,l),h=()=>{if(Gv(t,r))return;const p=US(t,r,l);return ao(p)?p.then(c):c()};return u()},BS=(t,e,r)=>{const a=t.router.getMatch(e);if(!a||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const l={ssr:t.router.options.ssr,matches:t.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([r.options.head?.(l),r.options.scripts?.(l),r.options.headers?.(l)]).then(([u,c,h])=>({meta:u?.meta,links:u?.links,headScripts:u?.scripts,headers:h,scripts:c,styles:u?.styles}))},Kv=(t,e,r,a,l)=>{const u=e[a-1],{params:c,loaderDeps:h,abortController:p,cause:g}=t.router.getMatch(r),y=zs(t,a),m=yu(t,r);return{params:c,deps:h,preload:!!m,parentMatchPromise:u,abortController:p,context:y,location:t.location,navigate:b=>t.router.navigate({...b,_fromLocation:t.location}),cause:m?"preload":g,route:l,...t.router.options.additionalContext}},dy=async(t,e,r,a,l)=>{try{const u=t.router.getMatch(r);try{(!(Uv??t.router.isServer)||u.ssr===!0)&&oo(l);const c=l.options.loader,h=typeof c=="function"?c:c?.handler,p=h?.(Kv(t,e,r,a,l)),g=!!h&&ao(p);if((g||l._lazyPromise||l._componentsPromise||l.options.head||l.options.scripts||l.options.headers||u._nonReactive.minPendingPromise)&&t.updateMatch(r,m=>({...m,isFetching:"loader"})),h){const m=g?await p:p;Zr(t,t.router.getMatch(r),m),m!==void 0&&t.updateMatch(r,b=>({...b,loaderData:m}))}l._lazyPromise&&await l._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,l._componentsPromise&&await l._componentsPromise,t.updateMatch(r,m=>({...m,error:void 0,context:zs(t,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let h=c;if(h?.name==="AbortError"){if(u.abortController.signal.aborted){u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loaderPromise=void 0;return}t.updateMatch(r,g=>({...g,status:g.status==="pending"?"success":g.status,isFetching:!1,context:zs(t,a)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,yt(c)&&await l.options.notFoundComponent?.preload?.(),Zr(t,t.router.getMatch(r),c);try{l.options.onError?.(c)}catch(g){h=g,Zr(t,t.router.getMatch(r),g)}!Jt(h)&&!yt(h)&&await oo(l,["errorComponent"]),t.updateMatch(r,g=>({...g,error:h,context:zs(t,a),status:"error",isFetching:!1}))}}catch(u){const c=t.router.getMatch(r);c&&(c._nonReactive.loaderPromise=void 0),Zr(t,c,u)}},HS=async(t,e,r)=>{async function a(_,S,O,E,A){const M=Date.now()-S.updatedAt,j=_?A.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:A.options.staleTime??t.router.options.defaultStaleTime??0,D=A.options.shouldReload,X=typeof D=="function"?D(Kv(t,e,l,r,A)):D,{status:K,invalid:H}=E,Y=M>=j&&(!!t.forceStaleReload||E.cause==="enter"||O!==void 0&&O!==E.id);c=K==="success"&&(H||(X??Y)),_&&A.options.preload===!1||(c&&!t.sync&&y?(h=!0,(async()=>{try{await dy(t,e,l,r,A);const W=t.router.getMatch(l);W._nonReactive.loaderPromise?.resolve(),W._nonReactive.loadPromise?.resolve(),W._nonReactive.loaderPromise=void 0,W._nonReactive.loadPromise=void 0}catch(W){Jt(W)&&await t.router.navigate(W.options)}})()):K!=="success"||c?await dy(t,e,l,r,A):hy(t,l,r))}const{id:l,routeId:u}=t.matches[r];let c=!1,h=!1;const p=t.router.looseRoutesById[u],g=p.options.loader,y=((typeof g=="function"?void 0:g?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Gv(t,l)){if(!t.router.getMatch(l))return t.matches[r];hy(t,l,r)}else{const _=t.router.getMatch(l),S=t.router.stores.matchesId.get()[r],O=(S&&t.router.stores.matchStores.get(S)||null)?.routeId===u?S:t.router.stores.matches.get().find(A=>A.routeId===u)?.id,E=yu(t,l);if(_._nonReactive.loaderPromise){if(_.status==="success"&&!t.sync&&!_.preload&&y)return _;await _._nonReactive.loaderPromise;const A=t.router.getMatch(l),M=A._nonReactive.error||A.error;M&&Zr(t,A,M),A.status==="pending"&&await a(E,_,O,A,p)}else{const A=E&&!t.router.stores.matchStores.has(l),M=t.router.getMatch(l);M._nonReactive.loaderPromise=Bs(),A!==M.preload&&t.updateMatch(l,j=>({...j,preload:A})),await a(E,_,O,M,p)}}const m=t.router.getMatch(l);h||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,h||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const b=h?m.isFetching:!1;return b!==m.isFetching||m.invalid!==!1?(t.updateMatch(l,_=>({..._,isFetching:b,invalid:!1})),t.router.getMatch(l)):m};async function py(t){const e=t,r=[];LS(e.router)&&gh(e);let a;for(let b=0;b<e.matches.length;b++){try{const _=zS(e,b);ao(_)&&await _}catch(_){if(Jt(_))throw _;if(yt(_))a=_;else if(!e.preload)throw _;break}if(e.serialError||e.firstBadMatchIndex!=null)break}const l=e.firstBadMatchIndex??e.matches.length,u=a&&!e.preload?fy(e,a):void 0,c=a&&e.preload?0:u!==void 0?Math.min(u+1,l):l;let h,p;for(let b=0;b<c;b++)r.push(HS(e,r,b));try{await Promise.all(r)}catch{const b=await Promise.allSettled(r);for(const _ of b){if(_.status!=="rejected")continue;const S=_.reason;if(Jt(S))throw S;yt(S)?h??=S:p??=S}if(p!==void 0)throw p}const g=h??(a&&!e.preload?a:void 0);let y=e.firstBadMatchIndex!==void 0?e.firstBadMatchIndex:e.matches.length-1;if(!g&&a&&e.preload)return e.matches;if(g){const b=fy(e,g);b===void 0&&Xt();const _=e.matches[b],S=e.router.looseRoutesById[_.routeId],O=e.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&O&&(S.options.notFoundComponent=O),g.routeId=_.routeId;const E=_.routeId===e.router.routeTree.id;e.updateMatch(_.id,A=>({...A,...E?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:g},isFetching:!1})),y=b,await oo(S,["notFoundComponent"])}else if(!e.preload){const b=e.matches[0];b.globalNotFound||e.router.getMatch(b.id)?.globalNotFound&&e.updateMatch(b.id,_=>({..._,globalNotFound:!1,error:void 0}))}if(e.serialError&&e.firstBadMatchIndex!==void 0){const b=e.router.looseRoutesById[e.matches[e.firstBadMatchIndex].routeId];await oo(b,["errorComponent"])}for(let b=0;b<=y;b++){const{id:_,routeId:S}=e.matches[b],O=e.router.looseRoutesById[S];try{const E=BS(e,_,O);if(E){const A=await E;e.updateMatch(_,M=>({...M,...A}))}}catch(E){console.error(`Error executing head for route ${S}:`,E)}}const m=gh(e);if(ao(m)&&await m,g)throw g;if(e.serialError&&!e.preload&&!e.onReady)throw e.serialError;return e.matches}function gy(t,e){const r=e.map(a=>t.options[a]?.preload?.()).filter(Boolean);if(r.length!==0)return Promise.all(r)}function oo(t,e=Jl){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(a=>{const{id:l,...u}=a.options;Object.assign(t.options,u),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);const r=()=>t._componentsLoaded?void 0:e===Jl?(()=>{if(t._componentsPromise===void 0){const a=gy(t,Jl);a?t._componentsPromise=a.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():gy(t,e);return t._lazyPromise?t._lazyPromise.then(r):r()}function Yv(t){for(const e of Jl)if(t.options[e]?.preload)return!0;return!1}var Jl=["component","errorComponent","pendingComponent","notFoundComponent"],es="__TSR_index",my="popstate",yy="beforeunload";function IS(t){let e=t.getLocation();const r=new Set,a=c=>{e=t.getLocation(),r.forEach(h=>h({location:e,action:c}))},l=c=>{t.notifyOnIndexChange??!0?a(c):e=t.getLocation()},u=async({task:c,navigateOpts:h,...p})=>{if(h?.ignoreBlocker??!1){c();return}const g=t.getBlockers?.()??[],y=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const m of g){const b=su(p.path,p.state);if(await m.blockerFn({currentLocation:e,nextLocation:b,action:p.type})){t.onBlocked?.();return}}c()};return{get location(){return e},get length(){return t.getLength()},subscribers:r,subscribe:c=>(r.add(c),()=>{r.delete(c)}),push:(c,h,p)=>{const g=e.state[es];h=vy(g+1,h),u({task:()=>{t.pushState(c,h),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:c,state:h})},replace:(c,h,p)=>{const g=e.state[es];h=vy(g,h),u({task:()=>{t.replaceState(c,h),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:c,state:h})},go:(c,h)=>{u({task:()=>{t.go(c),l({type:"GO",index:c})},navigateOpts:h,type:"GO"})},back:c=>{u({task:()=>{t.back(c?.ignoreBlocker??!1),l({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{u({task:()=>{t.forward(c?.ignoreBlocker??!1),l({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>e.state[es]!==0,createHref:c=>t.createHref(c),block:c=>{if(!t.setBlockers)return()=>{};const h=t.getBlockers?.()??[];return t.setBlockers([...h,c]),()=>{const p=t.getBlockers?.()??[];t.setBlockers?.(p.filter(g=>g!==c))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:a}}function vy(t,e){e||(e={});const r=qh();return{...e,key:r,__TSR_key:r,[es]:t}}function qS(t){const e=typeof document<"u"?window:void 0,r=e.history.pushState,a=e.history.replaceState;let l=[];const u=()=>l,c=Y=>l=Y,h=(Y=>Y),p=(()=>su(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const Y=qh();e.history.replaceState({[es]:0,key:Y,__TSR_key:Y},"")}let g=p(),y,m=!1,b=!1,_=!1,S=!1;const O=()=>g;let E,A;const M=()=>{E&&(H._ignoreSubscribers=!0,(E.isPush?e.history.pushState:e.history.replaceState)(E.state,"",E.href),H._ignoreSubscribers=!1,E=void 0,A=void 0,y=void 0)},j=(Y,W,le)=>{const ie=h(W);A||(y=g),g=su(W,le),E={href:ie,state:le,isPush:E?.isPush||Y==="push"},A||(A=Promise.resolve().then(()=>M()))},D=Y=>{g=p(),H.notify({type:Y})},X=async()=>{if(b){b=!1;return}const Y=p(),W=Y.state[es]-g.state[es],le=W===1,ie=W===-1,me=!le&&!ie||m;m=!1;const _e=me?"GO":ie?"BACK":"FORWARD",qe=me?{type:"GO",index:W}:{type:ie?"BACK":"FORWARD"};if(_)_=!1;else{const Me=u();if(typeof document<"u"&&Me.length){for(const U of Me)if(await U.blockerFn({currentLocation:g,nextLocation:Y,action:_e})){b=!0,e.history.go(1),H.notify(qe);return}}}g=p(),H.notify(qe)},K=Y=>{if(S){S=!1;return}let W=!1;const le=u();if(typeof document<"u"&&le.length)for(const ie of le){const me=ie.enableBeforeUnload??!0;if(me===!0){W=!0;break}if(typeof me=="function"&&me()===!0){W=!0;break}}if(W)return Y.preventDefault(),Y.returnValue=""},H=IS({getLocation:O,getLength:()=>e.history.length,pushState:(Y,W)=>j("push",Y,W),replaceState:(Y,W)=>j("replace",Y,W),back:Y=>(Y&&(_=!0),S=!0,e.history.back()),forward:Y=>{Y&&(_=!0),S=!0,e.history.forward()},go:Y=>{m=!0,e.history.go(Y)},createHref:Y=>h(Y),flush:M,destroy:()=>{e.history.pushState=r,e.history.replaceState=a,e.removeEventListener(yy,K,{capture:!0}),e.removeEventListener(my,X)},onBlocked:()=>{y&&g!==y&&(g=y)},getBlockers:u,setBlockers:c,notifyOnIndexChange:!1});return e.addEventListener(yy,K,{capture:!0}),e.addEventListener(my,X),e.history.pushState=function(...Y){const W=r.apply(e.history,Y);return H._ignoreSubscribers||D("PUSH"),W},e.history.replaceState=function(...Y){const W=a.apply(e.history,Y);return H._ignoreSubscribers||D("REPLACE"),W},H}function $S(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function su(t,e){const r=$S(t),a=r.indexOf("#"),l=r.indexOf("?"),u=qh();return{href:r,pathname:r.substring(0,a>0?l>0?Math.min(a,l):a:l>0?l:r.length),hash:a>-1?r.substring(a):"",search:l>-1?r.slice(l,a===-1?void 0:a):"",state:e||{[es]:0,key:u,__TSR_key:u}}}function qh(){return(Math.random()+1).toString(36).substring(7)}function GS(t){return t instanceof Error?{name:t.name,message:t.message}:{data:t}}function Va(t,e){const r=e,a=t;return{fromLocation:r,toLocation:a,pathChanged:r?.pathname!==a.pathname,hrefChanged:r?.href!==a.href,hashChanged:r?.hash!==a.hash}}var VS=class{constructor(t,e){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.startTransition=r=>r(),this.update=r=>{const a=this.options,l=this.basepath??a?.basepath??"/",u=this.basepath===void 0,c=a?.rewrite;if(this.options={...a,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=bS(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=qS()),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 y;this.resolvePathCache=io(1e3),y=this.buildRouteTree(),this.setRoutes(y)}if(!this.stores&&this.latestLocation){const y=this.getStoreConfig(this);this.batch=y.batch,this.stores=DS(YS(this.latestLocation),y),RS(this)}let h=!1;const p=this.options.basepath??"/",g=this.options.rewrite;if(u||l!==p||c!==g){this.basepath=p;const y=[],m=Hv(p);m&&m!=="/"&&y.push(NS({basepath:p})),g&&y.push(g),this.rewrite=y.length===0?void 0:y.length===1?y[0]:MS(y),this.history&&this.updateLatestLocation(),h=!0}h&&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=()=>{const r=hS(this.routeTree,this.options.caseSensitive,(a,l)=>{a.init({originalIndex:l})});return this.options.routeMasks&&oS(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,a)=>{const l={eventType:r,fn:a};return this.subscribers.add(l),()=>{this.subscribers.delete(l)}},this.emit=r=>{this.subscribers.forEach(a=>{a.eventType===r.type&&a.fn(r)})},this.parseLocation=(r,a)=>{const l=({pathname:p,search:g,hash:y,href:m,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const A=this.options.parseSearch(g),M=this.options.stringifySearch(A);return{href:p+M+y,publicHref:p+M+y,pathname:Vi(p).path,external:!1,searchStr:M,search:xs(a?.search,A),hash:Vi(y.slice(1)).path,state:Ms(a?.state,b)}}const _=new URL(m,this.origin),S=ph(this.rewrite,_),O=this.options.parseSearch(S.search),E=this.options.stringifySearch(O);return S.search=E,{href:S.href.replace(S.origin,""),publicHref:m,pathname:Vi(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:E,search:xs(a?.search,O),hash:Vi(S.hash.slice(1)).path,state:Ms(a?.state,b)}},u=l(r),{__tempLocation:c,__tempKey:h}=u.state;if(c&&(!h||h===this.tempLocationKey)){const p=l(c);return p.state.key=u.state.key,p.state.__TSR_key=u.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:u}}return u},this.resolvePathWithBase=(r,a)=>vS({base:r,to:Ih(a),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,a,l)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:a},l):this.matchRoutesInternal(r,a),this.getMatchedRoutes=r=>FS({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const a=this.getMatch(r);a&&(a.abortController.abort(),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(r=>{this.cancelMatch(r)}),this.stores.matchesId.get().forEach(r=>{if(this.stores.pendingMatchStores.has(r))return;const a=this.stores.matchStores.get(r)?.get();a&&(a.status==="pending"||a.isFetching==="loader")&&this.cancelMatch(r)})},this.buildLocation=r=>{const a=(u={})=>{const c=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,h=this.matchRoutesLightweight(c);u.from;const p=u.unsafeRelative==="path"?c.pathname:u.from??h.fullPath,g=this.resolvePathWithBase(p,"."),y=h.search,m=Object.assign(Object.create(null),h.params),b=u.to?this.resolvePathWithBase(g,`${u.to}`):this.resolvePathWithBase(g,"."),_=u.params===!1||u.params===null?Object.create(null):(u.params??!0)===!0?m:Object.assign(m,Jr(u.params,m)),S=this.getMatchedRoutes(b);let O=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(O=[...O,this.options.notFoundRoute]),Object.keys(_).length>0)for(const le of O){const ie=le.options.params?.stringify??le.options.stringifyParams;if(ie)try{Object.assign(_,ie(_))}catch{}}const E=r.leaveParams?b:Vi(oy({path:b,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=y;if(r._includeValidateSearch&&this.options.search?.strict){const le={};O.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(le,Xl(ie.options.validateSearch,{...le,...A}))}catch{}}),A=le}A=QS({search:A,dest:u,destRoutes:O,_includeValidateSearch:r._includeValidateSearch}),A=xs(y,A);const M=this.options.stringifySearch(A),j=u.hash===!0?c.hash:u.hash?Jr(u.hash,c.hash):void 0,D=j?`#${j}`:"";let X=u.state===!0?c.state:u.state?Jr(u.state,c.state):{};X=Ms(c.state,X);const K=`${E}${M}${D}`;let H,Y,W=!1;if(this.rewrite){const le=new URL(K,this.origin),ie=$v(this.rewrite,le);H=le.href.replace(le.origin,""),ie.origin!==this.origin?(Y=ie.href,W=!0):Y=ie.pathname+ie.search+ie.hash}else H=sS(K),Y=H;return{publicHref:Y,href:H,pathname:E,search:A,searchStr:M,state:X,hash:j??"",external:W,unmaskOnReload:u.unmaskOnReload}},l=(u={},c)=>{const h=a(u);let p=c?a(c):void 0;if(!p){const g=Object.create(null);if(this.options.routeMasks){const y=lS(h.pathname,this.processedTree);if(y){Object.assign(g,y.rawParams);const{from:m,params:b,..._}=y.route,S=b===!1||b===null?Object.create(null):(b??!0)===!0?g:Object.assign(g,Jr(b,g));c={from:r.from,..._,params:S},p=a(c)}}}return p&&(h.maskedLocation=p),h};return r.mask?l(r,{from:r.from,...r.mask}):l(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:a,...l})=>{const u=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(y=>{l.state[y]=this.latestLocation.state[y]});const g=Qt(l.state,this.latestLocation.state);return p.forEach(y=>{delete l.state[y]}),g},c=Wr(this.latestLocation.href)===Wr(l.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=Bs(()=>{h?.resolve(),h=void 0}),c&&u())this.load();else{let{maskedLocation:p,hashScrollIntoView:g,...y}=l;p&&(y={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=g??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[l.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:a})}return this.resetNextScroll=l.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:a,hashScrollIntoView:l,viewTransition:u,ignoreBlocker:c,href:h,...p}={})=>{if(h){const m=this.history.location.state.__TSR_index,b=su(h,{__TSR_index:r?m:m+1}),_=new URL(b.pathname,this.origin);p.to=ph(this.rewrite,_).pathname,p.search=this.options.parseSearch(b.search),p.hash=b.hash.slice(1)}const g=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=g;const y=this.commitLocation({...g,viewTransition:u,replace:r,resetScroll:a,hashScrollIntoView:l,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===g&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:r,reloadDocument:a,href:l,publicHref:u,...c})=>{let h=!1;if(l)try{new URL(`${l}`),h=!0}catch{}if(h&&!a&&(a=!0),a){if(r!==void 0||!l){const g=this.buildLocation({to:r,...c});l=l??g.publicHref,u=u??g.publicHref}const p=!h&&u?u:l;if(nu(p,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(p):window.location.href=p,Promise.resolve()}return this.buildAndCommitLocation({...c,href:l,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation),a=this.stores.cachedMatches.get().filter(l=>!r.some(u=>u.id===l.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(r),this.stores.setCached(a)})},this.load=async r=>{let a,l,u;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(u=new Promise(p=>{this.startTransition(async()=>{try{this.beforeLoad();const g=this.latestLocation,y=Va(g,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...y}),this.emit({type:"onBeforeLoad",...y}),await py({router:this,sync:r?.sync,forceStaleReload:c.href===g.href,matches:this.stores.pendingMatches.get(),location:g,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,b=null,_=null,S=null;this.batch(()=>{const O=this.stores.pendingMatches.get(),E=O.length,A=this.stores.matches.get();m=E?A.filter(D=>!this.stores.pendingMatchStores.has(D.id)):null;const M=new Set;for(const D of this.stores.pendingMatchStores.values())D.routeId&&M.add(D.routeId);const j=new Set;for(const D of this.stores.matchStores.values())D.routeId&&j.add(D.routeId);b=E?A.filter(D=>!M.has(D.routeId)):null,_=E?O.filter(D=>!j.has(D.routeId)):null,S=E?O.filter(D=>j.has(D.routeId)):A,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),E&&(this.stores.setMatches(O),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(D=>D.status!=="error"&&D.status!=="notFound"&&D.status!=="redirected")]),this.clearExpiredCache())});for(const[O,E]of[[b,"onLeave"],[_,"onEnter"],[S,"onStay"]])if(O)for(const A of O)this.looseRoutesById[A.routeId].options[E]?.(A)})})}})}catch(g){Jt(g)?(a=g,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):yt(g)&&(l=g);const y=a?a.status:l?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(y),this.stores.redirect.set(a)})}this.latestLoadPromise===u&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()})}),this.latestLoadPromise=u,await u;this.latestLoadPromise&&u!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(p=>p.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},this.startViewTransition=r=>{const a=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,a&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let l;if(typeof a=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,c=this.stores.resolvedLocation.get(),h=typeof a.types=="function"?a.types(Va(u,c)):a.types;if(h===!1){r();return}l={update:r,types:h}}else l=r;document.startViewTransition(l)}else r()},this.updateMatch=(r,a)=>{this.startTransition(()=>{const l=this.stores.pendingMatchStores.get(r);if(l){l.set(a);return}const u=this.stores.matchStores.get(r);if(u){u.set(a);return}const c=this.stores.cachedMatchStores.get(r);if(c){const h=a(c.get());h.status==="redirected"?this.stores.cachedMatchStores.delete(r)&&this.stores.cachedIds.set(p=>p.filter(g=>g!==r)):c.set(h)}})},this.getMatch=r=>this.stores.cachedMatchStores.get(r)?.get()??this.stores.pendingMatchStores.get(r)?.get()??this.stores.matchStores.get(r)?.get(),this.invalidate=r=>{const a=l=>r?.filter?.(l)??!0?{...l,invalid:!0,...r?.forcePending||l.status==="error"||l.status==="notFound"?{status:"pending",error:void 0}:void 0}:l;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(a)),this.stores.setCached(this.stores.cachedMatches.get().map(a)),this.stores.setPending(this.stores.pendingMatches.get().map(a))}),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const a=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const l=r.options._builtLocation??this.buildLocation(r.options),u=this.getParsedLocationHref(l);r.options.href=u,r.headers.set("Location",u)}else if(a)try{const l=new URL(a);if(this.origin&&l.origin===this.origin){const u=l.pathname+l.search+l.hash;r.options.href=u,r.headers.set("Location",u)}}catch{}if(r.options.href&&!r.options._builtLocation&&nu(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const a=r?.filter;a!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(l=>!a(l))):this.stores.setCached([])},this.clearExpiredCache=()=>{const r=Date.now(),a=l=>{const u=this.looseRoutesById[l.routeId];if(!u.options.loader)return!0;const c=(l.preload?u.options.preloadGcTime??this.options.defaultPreloadGcTime:u.options.gcTime??this.options.defaultGcTime)??300*1e3;return l.status==="error"?!0:r-l.updatedAt>=c};this.clearCache({filter:a})},this.loadRouteChunk=oo,this.preloadRoute=async r=>{const a=r._builtLocation??this.buildLocation(r);let l=this.matchRoutes(a,{throwOnError:!0,preload:!0,dest:r});const u=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),c=new Set([...u,...this.stores.cachedIds.get()]),h=l.filter(p=>!c.has(p.id));if(h.length){const p=this.stores.cachedMatches.get();this.stores.setCached([...p,...h])}try{return l=await py({router:this,matches:l,location:a,preload:!0,updateMatch:(p,g)=>{u.has(p)?l=l.map(y=>y.id===p?g(y):y):this.updateMatch(p,g)}}),l}catch(p){if(Jt(p))return p.options.reloadDocument?void 0:await this.preloadRoute({...p.options,_fromLocation:a});yt(p)||console.error(p);return}},this.matchRoute=(r,a)=>{const l={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},u=this.buildLocation(l);if(a?.pending&&this.stores.status.get()!=="pending")return!1;const c=(a?.pending===void 0?!this.stores.isLoading.get():a.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),h=uS(u.pathname,a?.caseSensitive??!1,a?.fuzzy??!1,c.pathname,this.processedTree);return!h||r.params&&!Qt(h.rawParams,r.params,{partial:!0})?!1:a?.includeSearch??!0?Qt(c.search,u.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(r=>r.status==="notFound"||r.globalNotFound),this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??xS,parseSearch:t.parseSearch??OS,protocolAllowlist:t.protocolAllowlist??eS}),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:t,routesByPath:e,processedTree:r}){this.routesById=t,this.routesByPath=e,this.processedTree=r;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,e){const r=this.getMatchedRoutes(t.pathname),{foundRoute:a,routeParams:l,parsedParams:u}=r;let{matchedRoutes:c}=r,h=!1;(a?a.path!=="/"&&l["**"]:Wr(t.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:h=!0);const p=h?XS(this.options.notFoundMode,c):void 0,g=new Array(c.length),y=new Map;for(const m of this.stores.matchStores.values())m.routeId&&y.set(m.routeId,m.get());for(let m=0;m<c.length;m++){const b=c[m],_=g[m-1];let S,O,E;{const _e=_?.search??t.search,qe=_?._strictSearch??void 0;try{const Me=Xl(b.options.validateSearch,{..._e})??void 0;S={..._e,...Me},O={...qe,...Me},E=void 0}catch(Me){let U=Me;if(Me instanceof au||(U=new au(Me.message,{cause:Me})),e?.throwOnError)throw U;S=_e,O={},E=U}}const A=b.options.loaderDeps?.({search:S})??"",M=A?JSON.stringify(A):"",{interpolatedPath:j,usedParams:D}=oy({path:b.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),X=b.id+j+M,K=this.getMatch(X),H=y.get(b.id),Y=K?._strictParams??D;let W;if(!K)try{by(b,D,u,Y)}catch(_e){if(yt(_e)||Jt(_e)?W=_e:W=new KS(_e.message,{cause:_e}),e?.throwOnError)throw W}Object.assign(l,Y);const le=H?"stay":"enter";let ie;if(K)ie={...K,cause:le,params:H?.params??l,_strictParams:Y,search:xs(H?H.search:K.search,S),_strictSearch:O};else{const _e=b.options.loader||b.options.beforeLoad||b.lazyFn||Yv(b)?"pending":"success";ie={id:X,ssr:b.options.ssr,index:m,routeId:b.id,params:H?.params??l,_strictParams:Y,pathname:j,updatedAt:Date.now(),search:H?xs(H.search,S):S,_strictSearch:O,searchError:void 0,status:_e,isFetching:!1,error:void 0,paramsError:W,__routeContext:void 0,_nonReactive:{loadPromise:Bs()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:le,loaderDeps:H?Ms(H.loaderDeps,A):A,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}e?.preload||(ie.globalNotFound=p===b.id),ie.searchError=E;const me=this.getParentContext(_);ie.context={...me,...ie.__routeContext,...ie.__beforeLoadContext},g[m]=ie}for(let m=0;m<g.length;m++){const b=g[m],_=this.looseRoutesById[b.routeId],S=this.getMatch(b.id),O=y.get(b.routeId);if(b.params=O?xs(O.params,l):l,!S){const E=g[m-1],A=this.getParentContext(E);if(_.options.context){const M={deps:b.loaderDeps,params:b.params,context:A??{},location:t,navigate:j=>this.navigate({...j,_fromLocation:t}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:g,routeId:_.id};b.__routeContext=_.options.context(M)??void 0}b.context={...A,...b.__routeContext,...b.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:e,routeParams:r,parsedParams:a}=this.getMatchedRoutes(t.pathname),l=so(e),u={...t.search};for(const y of e)try{Object.assign(u,Xl(y.options.validateSearch,u))}catch{}const c=so(this.stores.matchesId.get()),h=c&&this.stores.matchStores.get(c)?.get(),p=h&&h.routeId===l.id&&h.pathname===t.pathname;let g;if(p)g=h.params;else{const y=Object.assign(Object.create(null),r);for(const m of e)try{by(m,r,a??{},y)}catch{}g=y}return{matchedRoutes:e,fullPath:l.fullPath,search:u,params:g}}},au=class extends Error{},KS=class extends Error{};function YS(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}function Xl(t,e){if(t==null)return{};if("~standard"in t){const r=t["~standard"].validate(e);if(r instanceof Promise)throw new au("Async validation not supported");if(r.issues)throw new au(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function FS({pathname:t,routesById:e,processedTree:r}){const a=Object.create(null),l=Wr(t);let u,c;const h=cS(l,r,!0);return h&&(u=h.route,Object.assign(a,h.rawParams),c=Object.assign(Object.create(null),h.parsedParams)),{matchedRoutes:h?.branch||[e.__root__],routeParams:a,foundRoute:u,parsedParams:c}}function QS({search:t,dest:e,destRoutes:r,_includeValidateSearch:a}){return JS(r)(t,e,a??!1)}function JS(t){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const l of t){if("search"in l.options)l.options.search?.middlewares&&e.middlewares.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const u=({search:c,next:h})=>{let p=c;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(p=l.options.preSearchFilters.reduce((y,m)=>m(y),c));const g=h(p);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((y,m)=>m(y),g):g};e.middlewares.push(u)}if(l.options.validateSearch){const u=({search:c,next:h})=>{const p=h(c);if(!e._includeValidateSearch)return p;try{return{...p,...Xl(l.options.validateSearch,p)??void 0}}catch{return p}};e.middlewares.push(u)}}const r=({search:l})=>{const u=e.dest;return u.search?u.search===!0?l:Jr(u.search,l):{}};e.middlewares.push(r);const a=(l,u,c)=>{if(l>=c.length)return u;const h=c[l];return h({search:u,next:g=>a(l+1,g,c)})};return function(u,c,h){return e.dest=c,e._includeValidateSearch=h,a(0,u,e.middlewares)}}function XS(t,e){if(t!=="root")for(let r=e.length-1;r>=0;r--){const a=e[r];if(a.children)return a.id}return Ps}function by(t,e,r,a){const l=t.options.params?.parse??t.options.parseParams;if(l)if(t.options.skipRouteOnParseError)for(const u in e)u in r&&(a[u]=r[u]);else{const u=l(a);Object.assign(a,u)}}var qn=Symbol.for("TSR_DEFERRED_PROMISE");function ZS(t,e){const r=t;return r[qn]||(r[qn]={status:"pending"},r.then(a=>{r[qn].status="success",r[qn].data=a}).catch(a=>{r[qn].status="error",r[qn].error={data:GS(a),__isServerError:!0}})),r}var WS="Error preloading route! ☝️";function _y(t,e){if(t)return typeof t=="string"?t:t[e]}function eE(t){return typeof t=="string"?{href:t,crossOrigin:void 0}:t}function tE(t){if(t.tag!=="link")return;const e=t.attrs?.rel,r=t.attrs?.href;if(typeof r=="string"&&(typeof e=="string"?e.split(/\s+/):[]).includes("stylesheet"))return r}function nE(t,e){const r=tE(e);return!!r&&t?.inlineCss?.styles[r]!==void 0}var Fv=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Ps:this.parentRoute||Xt();let l=a?Ps:r?.path;l&&l!=="/"&&(l=Bv(l));const u=r?.id||l;let c=a?Ps:Ql([this.parentRoute.id==="__root__"?"":this.parentRoute.id,u]);l==="__root__"&&(l="/"),c!=="__root__"&&(c=Ql(["/",c]));const h=c==="__root__"?"/":Ql([this.parentRoute.fullPath,l]);this._path=l,this._id=c,this._fullPath=h,this._to=Wr(h)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(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=>qv({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},rE=class extends Fv{constructor(t){super(t)}};function sE(t){if(typeof document<"u"&&document.querySelector){const e=t.stores.location.get(),r=e.state.__hashScrollIntoViewOptions??!0;if(r&&e.hash!==""){const a=document.getElementById(e.hash);a&&a.scrollIntoView(r)}}}var aE=(t=>(t[t.AggregateError=1]="AggregateError",t[t.ArrowFunction=2]="ArrowFunction",t[t.ErrorPrototypeStack=4]="ErrorPrototypeStack",t[t.ObjectAssign=8]="ObjectAssign",t[t.BigIntTypedArray=16]="BigIntTypedArray",t[t.RegExp=32]="RegExp",t))(aE||{}),gr=Symbol.asyncIterator,Qv=Symbol.hasInstance,Ka=Symbol.isConcatSpreadable,mr=Symbol.iterator,Jv=Symbol.match,Xv=Symbol.matchAll,Zv=Symbol.replace,Wv=Symbol.search,e0=Symbol.species,t0=Symbol.split,n0=Symbol.toPrimitive,Ya=Symbol.toStringTag,r0=Symbol.unscopables,s0={[gr]:0,[Qv]:1,[Ka]:2,[mr]:3,[Jv]:4,[Xv]:5,[Zv]:6,[Wv]:7,[e0]:8,[t0]:9,[n0]:10,[Ya]:11,[r0]:12},iE={0:gr,1:Qv,2:Ka,3:mr,4:Jv,5:Xv,6:Zv,7:Wv,8:e0,9:t0,10:n0,11:Ya,12:r0},R=void 0,oE={2:!0,3:!1,1:R,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},lE={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},uE={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function je(t,e,r,a,l,u,c,h,p,g,y,m){return{t,i:e,s:r,c:a,m:l,p:u,e:c,a:h,f:p,b:g,o:y,l:m}}function ts(t){return je(2,R,t,R,R,R,R,R,R,R,R,R)}var a0=ts(2),i0=ts(3),cE=ts(1),fE=ts(0),hE=ts(4),dE=ts(5),pE=ts(6),gE=ts(7);function mE(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case`
`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"	":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return R}}function ns(t){let e="",r=0,a;for(let l=0,u=t.length;l<u;l++)a=mE(t[l]),a&&(e+=t.slice(r,l)+a,r=l+1);return r===0?e=t:e+=t.slice(r),e}function yE(t){switch(t){case"\\\\":return"\\";case'\\"':return'"';case"\\n":return`
`;case"\\r":return"\r";case"\\b":return"\b";case"\\t":return"	";case"\\f":return"\f";case"\\x3C":return"<";case"\\u2028":return"\u2028";case"\\u2029":return"\u2029";default:return t}}function rs(t){return t.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,yE)}var Pl="__SEROVAL_REFS__",o0=new Map,$a=new Map;function l0(t){return o0.has(t)}function vE(t){return $a.has(t)}function bE(t){if(l0(t))return o0.get(t);throw new JE(t)}function _E(t){if(vE(t))return $a.get(t);throw new XE(t)}typeof globalThis<"u"?Object.defineProperty(globalThis,Pl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof window<"u"?Object.defineProperty(window,Pl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof self<"u"?Object.defineProperty(self,Pl,{value:$a,configurable:!0,writable:!1,enumerable:!1}):typeof global<"u"&&Object.defineProperty(global,Pl,{value:$a,configurable:!0,writable:!1,enumerable:!1});function $h(t){return t instanceof EvalError?1:t instanceof RangeError?2:t instanceof ReferenceError?3:t instanceof SyntaxError?4:t instanceof TypeError?5:t instanceof URIError?6:0}function wE(t){let e=lE[$h(t)];return t.name!==e?{name:t.name}:t.constructor.name!==e?{name:t.constructor.name}:{}}function u0(t,e){let r=wE(t),a=Object.getOwnPropertyNames(t);for(let l=0,u=a.length,c;l<u;l++)c=a[l],c!=="name"&&c!=="message"&&(c==="stack"?e&4&&(r=r||{},r[c]=t[c]):(r=r||{},r[c]=t[c]));return r}function c0(t){return Object.isFrozen(t)?3:Object.isSealed(t)?2:Object.isExtensible(t)?0:1}function SE(t){switch(t){case Number.POSITIVE_INFINITY:return dE;case Number.NEGATIVE_INFINITY:return pE}return t!==t?gE:Object.is(t,-0)?hE:je(0,R,t,R,R,R,R,R,R,R,R,R)}function f0(t){return je(1,R,ns(t),R,R,R,R,R,R,R,R,R)}function EE(t){return je(3,R,""+t,R,R,R,R,R,R,R,R,R)}function TE(t){return je(4,t,R,R,R,R,R,R,R,R,R,R)}function RE(t,e){let r=e.valueOf();return je(5,t,r!==r?"":e.toISOString(),R,R,R,R,R,R,R,R,R)}function AE(t,e){return je(6,t,R,ns(e.source),e.flags,R,R,R,R,R,R,R)}function OE(t,e){return je(17,t,s0[e],R,R,R,R,R,R,R,R,R)}function xE(t,e){return je(18,t,ns(bE(e)),R,R,R,R,R,R,R,R,R)}function CE(t,e,r){return je(25,t,r,ns(e),R,R,R,R,R,R,R,R)}function kE(t,e,r){return je(9,t,R,R,R,R,R,r,R,R,c0(e),R)}function jE(t,e){return je(21,t,R,R,R,R,R,R,e,R,R,R)}function ME(t,e,r){return je(15,t,R,e.constructor.name,R,R,R,R,r,e.byteOffset,R,e.length)}function NE(t,e,r){return je(16,t,R,e.constructor.name,R,R,R,R,r,e.byteOffset,R,e.byteLength)}function DE(t,e,r){return je(20,t,R,R,R,R,R,R,r,e.byteOffset,R,e.byteLength)}function LE(t,e,r){return je(13,t,$h(e),R,ns(e.message),r,R,R,R,R,R,R)}function UE(t,e,r){return je(14,t,$h(e),R,ns(e.message),r,R,R,R,R,R,R)}function PE(t,e){return je(7,t,R,R,R,R,R,e,R,R,R,R)}function zE(t,e){return je(28,R,R,R,R,R,R,[t,e],R,R,R,R)}function BE(t,e){return je(30,R,R,R,R,R,R,[t,e],R,R,R,R)}function HE(t,e,r){return je(31,t,R,R,R,R,R,r,e,R,R,R)}function IE(t,e){return je(32,t,R,R,R,R,R,R,e,R,R,R)}function qE(t,e){return je(33,t,R,R,R,R,R,R,e,R,R,R)}function $E(t,e){return je(34,t,R,R,R,R,R,R,e,R,R,R)}function GE(t,e,r,a){return je(35,t,r,R,R,R,R,e,R,R,R,a)}var VE={parsing:1,serialization:2,deserialization:3};function KE(t){return`Seroval Error (step: ${VE[t]})`}var YE=(t,e)=>KE(t),h0=class extends Error{constructor(t,e){super(YE(t)),this.cause=e}},wy=class extends h0{constructor(t){super("parsing",t)}},FE=class extends h0{constructor(t){super("deserialization",t)}};function yr(t){return`Seroval Error (specific: ${t})`}var vu=class extends Error{constructor(e){super(yr(1)),this.value=e}},d0=class extends Error{constructor(e){super(yr(2))}},QE=class extends Error{constructor(t){super(yr(3))}},bo=class extends Error{constructor(t){super(yr(4))}},JE=class extends Error{constructor(t){super(yr(5)),this.value=t}},XE=class extends Error{constructor(t){super(yr(6))}},ZE=class extends Error{constructor(t){super(yr(7))}},ss=class extends Error{constructor(t){super(yr(8))}},WE=class extends Error{constructor(e){super(yr(9))}},eT=class{constructor(t,e){this.value=t,this.replacement=e}},bu=()=>{let t={p:0,s:0,f:0};return t.p=new Promise((e,r)=>{t.s=e,t.f=r}),t},tT=(t,e)=>{t.s(e),t.p.s=1,t.p.v=e},nT=(t,e)=>{t.f(e),t.p.s=2,t.p.v=e};bu.toString();tT.toString();nT.toString();var rT=()=>{let t=[],e=[],r=!0,a=!1,l=0,u=(p,g,y)=>{for(y=0;y<l;y++)e[y]&&e[y][g](p)},c=(p,g,y,m)=>{for(g=0,y=t.length;g<y;g++)m=t[g],!r&&g===y-1?p[a?"return":"throw"](m):p.next(m)},h=(p,g)=>(r&&(g=l++,e[g]=p),c(p),()=>{r&&(e[g]=e[l],e[l--]=void 0)});return{__SEROVAL_STREAM__:!0,on:p=>h(p),next:p=>{r&&(t.push(p),u(p,"next"))},throw:p=>{r&&(t.push(p),u(p,"throw"),r=!1,a=!1,e.length=0)},return:p=>{r&&(t.push(p),u(p,"return"),r=!1,a=!0,e.length=0)}}},sT=t=>e=>()=>{let r=0,a={[t]:()=>a,next:()=>{if(r>e.d)return{done:!0,value:void 0};let l=r++,u=e.v[l];if(l===e.t)throw u;return{done:l===e.d,value:u}}};return a},aT=(t,e)=>r=>()=>{let a=0,l=-1,u=!1,c=[],h=[],p=(y=0,m=h.length)=>{for(;y<m;y++)h[y].s({done:!0,value:void 0})};r.on({next:y=>{let m=h.shift();m&&m.s({done:!1,value:y}),c.push(y)},throw:y=>{let m=h.shift();m&&m.f(y),p(),l=c.length,u=!0,c.push(y)},return:y=>{let m=h.shift();m&&m.s({done:!0,value:y}),p(),l=c.length,c.push(y)}});let g={[t]:()=>g,next:()=>{if(l===-1){let b=a++;if(b>=c.length){let _=e();return h.push(_),_.p}return{done:!1,value:c[b]}}if(a>l)return{done:!0,value:void 0};let y=a++,m=c[y];if(y!==l)return{done:!1,value:m};if(u)throw m;return{done:!0,value:m}}};return g},p0=t=>{let e=atob(t),r=e.length,a=new Uint8Array(r);for(let l=0;l<r;l++)a[l]=e.charCodeAt(l);return a.buffer};p0.toString();function iT(t){return"__SEROVAL_SEQUENCE__"in t}function g0(t,e,r){return{__SEROVAL_SEQUENCE__:!0,v:t,t:e,d:r}}function oT(t){let e=[],r=-1,a=-1,l=t[mr]();for(;;)try{let u=l.next();if(e.push(u.value),u.done){a=e.length-1;break}}catch(u){r=e.length,e.push(u)}return g0(e,r,a)}var lT=sT(mr);function uT(t){return lT(t)}var cT={},fT={},hT={0:{},1:{},2:{},3:{},4:{},5:{}};function _u(t){return"__SEROVAL_STREAM__"in t}function Hs(){return rT()}function dT(t){let e=Hs(),r=t[gr]();async function a(){try{let l=await r.next();l.done?e.return(l.value):(e.next(l.value),await a())}catch(l){e.throw(l)}}return a().catch(()=>{}),e}var pT=aT(gr,bu);function gT(t){return pT(t)}async function mT(t){try{return[1,await t]}catch(e){return[0,e]}}function yT(t,e){return{plugins:e.plugins,mode:t,marked:new Set,features:63^(e.disabledFeatures||0),refs:e.refs||new Map,depthLimit:e.depthLimit||1e3}}function Zl(t,e){t.marked.add(e)}function vT(t,e){let r=t.refs.size;return t.refs.set(e,r),r}function wu(t,e){let r=t.refs.get(e);return r!=null?(Zl(t,r),{type:1,value:TE(r)}):{type:0,value:vT(t,e)}}function Gh(t,e){let r=wu(t,e);return r.type===1?r:l0(e)?{type:2,value:xE(r.value,e)}:r}function Ds(t,e){let r=Gh(t,e);if(r.type!==0)return r.value;if(e in s0)return OE(r.value,e);throw new vu(e)}function Su(t,e){let r=wu(t,hT[e]);return r.type===1?r.value:je(26,r.value,e,R,R,R,R,R,R,R,R,R)}function bT(t){let e=wu(t,cT);return e.type===1?e.value:je(27,e.value,R,R,R,R,R,R,Ds(t,mr),R,R,R)}function _T(t){let e=wu(t,fT);return e.type===1?e.value:je(29,e.value,R,R,R,R,R,[Su(t,1),Ds(t,gr)],R,R,R,R)}function wT(t,e,r,a){return je(r?11:10,t,R,R,R,a,R,R,R,R,c0(e),R)}function ST(t,e,r,a){return je(8,e,R,R,R,R,{k:r,v:a},R,Su(t,0),R,R,R)}function ET(t,e,r){let a=new Uint8Array(r),l="";for(let u=0,c=a.length;u<c;u++)l+=String.fromCharCode(a[u]);return je(19,e,ns(btoa(l)),R,R,R,R,R,Su(t,5),R,R,R)}function TT(t,e){return{base:yT(t,e),child:void 0}}var RT=class{constructor(t,e){this._p=t,this.depth=e}parse(t){return ut(this._p,this.depth,t)}};async function AT(t,e,r){let a=[];for(let l=0,u=r.length;l<u;l++)l in r?a[l]=await ut(t,e,r[l]):a[l]=0;return a}async function OT(t,e,r,a){return kE(r,a,await AT(t,e,a))}async function Vh(t,e,r){let a=Object.entries(r),l=[],u=[];for(let c=0,h=a.length;c<h;c++)l.push(ns(a[c][0])),u.push(await ut(t,e,a[c][1]));return mr in r&&(l.push(Ds(t.base,mr)),u.push(zE(bT(t.base),await ut(t,e,oT(r))))),gr in r&&(l.push(Ds(t.base,gr)),u.push(BE(_T(t.base),await ut(t,e,dT(r))))),Ya in r&&(l.push(Ds(t.base,Ya)),u.push(f0(r[Ya]))),Ka in r&&(l.push(Ds(t.base,Ka)),u.push(r[Ka]?a0:i0)),{k:l,v:u}}async function Wf(t,e,r,a,l){return wT(r,a,l,await Vh(t,e,a))}async function xT(t,e,r,a){return jE(r,await ut(t,e,a.valueOf()))}async function CT(t,e,r,a){return ME(r,a,await ut(t,e,a.buffer))}async function kT(t,e,r,a){return NE(r,a,await ut(t,e,a.buffer))}async function jT(t,e,r,a){return DE(r,a,await ut(t,e,a.buffer))}async function Sy(t,e,r,a){let l=u0(a,t.base.features);return LE(r,a,l?await Vh(t,e,l):R)}async function MT(t,e,r,a){let l=u0(a,t.base.features);return UE(r,a,l?await Vh(t,e,l):R)}async function NT(t,e,r,a){let l=[],u=[];for(let[c,h]of a.entries())l.push(await ut(t,e,c)),u.push(await ut(t,e,h));return ST(t.base,r,l,u)}async function DT(t,e,r,a){let l=[];for(let u of a.keys())l.push(await ut(t,e,u));return PE(r,l)}async function m0(t,e,r,a){let l=t.base.plugins;if(l)for(let u=0,c=l.length;u<c;u++){let h=l[u];if(h.parse.async&&h.test(a))return CE(r,h.tag,await h.parse.async(a,new RT(t,e),{id:r}))}return R}async function LT(t,e,r,a){let[l,u]=await mT(a);return je(12,r,l,R,R,R,R,R,await ut(t,e,u),R,R,R)}function UT(t,e,r,a,l){let u=[],c=r.on({next:h=>{Zl(this.base,e),ut(this,t,h).then(p=>{u.push(IE(e,p))},p=>{l(p),c()})},throw:h=>{Zl(this.base,e),ut(this,t,h).then(p=>{u.push(qE(e,p)),a(u),c()},p=>{l(p),c()})},return:h=>{Zl(this.base,e),ut(this,t,h).then(p=>{u.push($E(e,p)),a(u),c()},p=>{l(p),c()})}})}async function PT(t,e,r,a){return HE(r,Su(t.base,4),await new Promise(UT.bind(t,e,r,a)))}async function zT(t,e,r,a){let l=[];for(let u=0,c=a.v.length;u<c;u++)l[u]=await ut(t,e,a.v[u]);return GE(r,l,a.t,a.d)}async function BT(t,e,r,a){if(Array.isArray(a))return OT(t,e,r,a);if(_u(a))return PT(t,e,r,a);if(iT(a))return zT(t,e,r,a);let l=a.constructor;if(l===eT)return ut(t,e,a.replacement);let u=await m0(t,e,r,a);if(u)return u;switch(l){case Object:return Wf(t,e,r,a,!1);case R:return Wf(t,e,r,a,!0);case Date:return RE(r,a);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Sy(t,e,r,a);case Number:case Boolean:case String:case BigInt:return xT(t,e,r,a);case ArrayBuffer:return ET(t.base,r,a);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return CT(t,e,r,a);case DataView:return jT(t,e,r,a);case Map:return NT(t,e,r,a);case Set:return DT(t,e,r,a)}if(l===Promise||a instanceof Promise)return LT(t,e,r,a);let c=t.base.features;if(c&32&&l===RegExp)return AE(r,a);if(c&16)switch(l){case BigInt64Array:case BigUint64Array:return kT(t,e,r,a)}if(c&1&&typeof AggregateError<"u"&&(l===AggregateError||a instanceof AggregateError))return MT(t,e,r,a);if(a instanceof Error)return Sy(t,e,r,a);if(mr in a||gr in a)return Wf(t,e,r,a,!!l);throw new vu(a)}async function HT(t,e,r){let a=Gh(t.base,r);if(a.type!==0)return a.value;let l=await m0(t,e,a.value,r);if(l)return l;throw new vu(r)}async function ut(t,e,r){switch(typeof r){case"boolean":return r?a0:i0;case"undefined":return cE;case"string":return f0(r);case"number":return SE(r);case"bigint":return EE(r);case"object":{if(r){let a=Gh(t.base,r);return a.type===0?await BT(t,e+1,a.value,r):a.value}return fE}case"symbol":return Ds(t.base,r);case"function":return HT(t,e,r);default:throw new vu(r)}}async function IT(t,e){try{return await ut(t,0,e)}catch(r){throw r instanceof wy?r:new wy(r)}}var qT=(t=>(t[t.Vanilla=1]="Vanilla",t[t.Cross=2]="Cross",t))(qT||{});function y0(t,e){for(let r=0,a=e.length;r<a;r++){let l=e[r];t.has(l)||(t.add(l),l.extends&&y0(t,l.extends))}}function v0(t){if(t){let e=new Set;return y0(e,t),[...e]}}function $T(t){switch(t){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new ZE(t)}}var GT=1e6,VT=1e4,KT=2e4;function b0(t,e){switch(e){case 3:return Object.freeze(t);case 1:return Object.preventExtensions(t);case 2:return Object.seal(t);default:return t}}var YT=1e3;function FT(t,e){var r;return{mode:t,plugins:e.plugins,refs:e.refs||new Map,features:(r=e.features)!=null?r:63^(e.disabledFeatures||0),depthLimit:e.depthLimit||YT}}function QT(t){return{mode:2,base:FT(2,t),child:R}}var JT=class{constructor(t,e){this._p=t,this.depth=e}deserialize(t){return Ie(this._p,this.depth,t)}};function _0(t,e){if(e<0||!Number.isFinite(e)||!Number.isInteger(e))throw new ss({t:4,i:e});if(t.refs.has(e))throw new Error("Conflicted ref id: "+e)}function XT(t,e,r){return _0(t.base,e),t.state.marked.has(e)&&t.base.refs.set(e,r),r}function ZT(t,e,r){return _0(t.base,e),t.base.refs.set(e,r),r}function ct(t,e,r){return t.mode===1?XT(t,e,r):ZT(t,e,r)}function mh(t,e,r){if(Object.hasOwn(e,r))return e[r];throw new ss(t)}function WT(t,e){return ct(t,e.i,_E(rs(e.s)))}function e1(t,e,r){let a=r.a,l=a.length,u=ct(t,r.i,new Array(l));for(let c=0,h;c<l;c++)h=a[c],h&&(u[c]=Ie(t,e,h));return b0(u,r.o),u}function t1(t){switch(t){case"constructor":case"__proto__":case"prototype":case"__defineGetter__":case"__defineSetter__":case"__lookupGetter__":case"__lookupSetter__":return!1;default:return!0}}function n1(t){switch(t){case gr:case Ka:case Ya:case mr:return!0;default:return!1}}function Ey(t,e,r){t1(e)?t[e]=r:Object.defineProperty(t,e,{value:r,configurable:!0,enumerable:!0,writable:!0})}function r1(t,e,r,a,l){if(typeof a=="string")Ey(r,rs(a),Ie(t,e,l));else{let u=Ie(t,e,a);switch(typeof u){case"string":Ey(r,u,Ie(t,e,l));break;case"symbol":n1(u)&&(r[u]=Ie(t,e,l));break;default:throw new ss(a)}}}function w0(t,e,r,a){let l=r.k;if(l.length>0)for(let u=0,c=r.v,h=l.length;u<h;u++)r1(t,e,a,l[u],c[u]);return a}function s1(t,e,r){let a=ct(t,r.i,r.t===10?{}:Object.create(null));return w0(t,e,r.p,a),b0(a,r.o),a}function a1(t,e){return ct(t,e.i,new Date(e.s))}function i1(t,e){if(t.base.features&32){let r=rs(e.c);if(r.length>KT)throw new ss(e);return ct(t,e.i,new RegExp(r,e.m))}throw new d0(e)}function o1(t,e,r){let a=ct(t,r.i,new Set);for(let l=0,u=r.a,c=u.length;l<c;l++)a.add(Ie(t,e,u[l]));return a}function l1(t,e,r){let a=ct(t,r.i,new Map);for(let l=0,u=r.e.k,c=r.e.v,h=u.length;l<h;l++)a.set(Ie(t,e,u[l]),Ie(t,e,c[l]));return a}function u1(t,e){if(e.s.length>GT)throw new ss(e);return ct(t,e.i,p0(rs(e.s)))}function c1(t,e,r){var a;let l=$T(r.c),u=Ie(t,e,r.f),c=(a=r.b)!=null?a:0;if(c<0||c>u.byteLength)throw new ss(r);return ct(t,r.i,new l(u,c,r.l))}function f1(t,e,r){var a;let l=Ie(t,e,r.f),u=(a=r.b)!=null?a:0;if(u<0||u>l.byteLength)throw new ss(r);return ct(t,r.i,new DataView(l,u,r.l))}function S0(t,e,r,a){if(r.p){let l=w0(t,e,r.p,{});Object.defineProperties(a,Object.getOwnPropertyDescriptors(l))}return a}function h1(t,e,r){let a=ct(t,r.i,new AggregateError([],rs(r.m)));return S0(t,e,r,a)}function d1(t,e,r){let a=mh(r,uE,r.s),l=ct(t,r.i,new a(rs(r.m)));return S0(t,e,r,l)}function p1(t,e,r){let a=bu(),l=ct(t,r.i,a.p),u=Ie(t,e,r.f);return r.s?a.s(u):a.f(u),l}function g1(t,e,r){return ct(t,r.i,Object(Ie(t,e,r.f)))}function m1(t,e,r){let a=t.base.plugins;if(a){let l=rs(r.c);for(let u=0,c=a.length;u<c;u++){let h=a[u];if(h.tag===l)return ct(t,r.i,h.deserialize(r.s,new JT(t,e),{id:r.i}))}}throw new QE(r.c)}function y1(t,e){return ct(t,e.i,ct(t,e.s,bu()).p)}function v1(t,e,r){let a=t.base.refs.get(r.i);if(a)return a.s(Ie(t,e,r.a[1])),R;throw new bo("Promise")}function b1(t,e,r){let a=t.base.refs.get(r.i);if(a)return a.f(Ie(t,e,r.a[1])),R;throw new bo("Promise")}function _1(t,e,r){Ie(t,e,r.a[0]);let a=Ie(t,e,r.a[1]);return uT(a)}function w1(t,e,r){Ie(t,e,r.a[0]);let a=Ie(t,e,r.a[1]);return gT(a)}function S1(t,e,r){let a=ct(t,r.i,Hs()),l=r.a,u=l.length;if(u)for(let c=0;c<u;c++)Ie(t,e,l[c]);return a}function E1(t,e,r){let a=t.base.refs.get(r.i);if(a&&_u(a))return a.next(Ie(t,e,r.f)),R;throw new bo("Stream")}function T1(t,e,r){let a=t.base.refs.get(r.i);if(a&&_u(a))return a.throw(Ie(t,e,r.f)),R;throw new bo("Stream")}function R1(t,e,r){let a=t.base.refs.get(r.i);if(a&&_u(a))return a.return(Ie(t,e,r.f)),R;throw new bo("Stream")}function A1(t,e,r){return Ie(t,e,r.f),R}function O1(t,e,r){return Ie(t,e,r.a[1]),R}function x1(t,e,r){let a=ct(t,r.i,g0([],r.s,r.l));for(let l=0,u=r.a.length;l<u;l++)a.v[l]=Ie(t,e,r.a[l]);return a}function Ie(t,e,r){if(e>t.base.depthLimit)throw new WE(t.base.depthLimit);switch(e+=1,r.t){case 2:return mh(r,oE,r.s);case 0:return Number(r.s);case 1:return rs(String(r.s));case 3:if(String(r.s).length>VT)throw new ss(r);return BigInt(r.s);case 4:return t.base.refs.get(r.i);case 18:return WT(t,r);case 9:return e1(t,e,r);case 10:case 11:return s1(t,e,r);case 5:return a1(t,r);case 6:return i1(t,r);case 7:return o1(t,e,r);case 8:return l1(t,e,r);case 19:return u1(t,r);case 16:case 15:return c1(t,e,r);case 20:return f1(t,e,r);case 14:return h1(t,e,r);case 13:return d1(t,e,r);case 12:return p1(t,e,r);case 17:return mh(r,iE,r.s);case 21:return g1(t,e,r);case 25:return m1(t,e,r);case 22:return y1(t,r);case 23:return v1(t,e,r);case 24:return b1(t,e,r);case 28:return _1(t,e,r);case 30:return w1(t,e,r);case 31:return S1(t,e,r);case 32:return E1(t,e,r);case 33:return T1(t,e,r);case 34:return R1(t,e,r);case 27:return A1(t,e,r);case 29:return O1(t,e,r);case 35:return x1(t,e,r);default:throw new d0(r)}}function C1(t,e){try{return Ie(t,0,e)}catch(r){throw new FE(r)}}var k1=()=>T;k1.toString();function Ty(t,e){let r=v0(e.plugins),a=QT({plugins:r,refs:e.refs,features:e.features,disabledFeatures:e.disabledFeatures,depthLimit:e.depthLimit});return C1(a,t)}async function j1(t,e={}){let r=v0(e.plugins),a=TT(1,{plugins:r,disabledFeatures:e.disabledFeatures});return{t:await IT(a,t),f:a.base.features,m:Array.from(a.base.marked)}}function M1(t){return{tag:"$TSR/t/"+t.key,test:t.test,parse:{sync(e,r,a){return{v:r.parse(t.toSerializable(e))}},async async(e,r,a){return{v:await r.parse(t.toSerializable(e))}},stream(e,r,a){return{v:r.parse(t.toSerializable(e))}}},serialize:void 0,deserialize(e,r,a){return t.fromSerializable(r.deserialize(e.v))}}}var N1=class{constructor(t,e){this.stream=t,this.hint=e?.hint??"binary"}},iu=globalThis.Buffer,E0=!!iu&&typeof iu.from=="function";function T0(t){if(t.length===0)return"";if(E0)return iu.from(t).toString("base64");const e=32768,r=[];for(let a=0;a<t.length;a+=e){const l=t.subarray(a,a+e);r.push(String.fromCharCode.apply(null,l))}return btoa(r.join(""))}function R0(t){if(t.length===0)return new Uint8Array(0);if(E0){const a=iu.from(t,"base64");return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}const e=atob(t),r=new Uint8Array(e.length);for(let a=0;a<e.length;a++)r[a]=e.charCodeAt(a);return r}var Fi=Object.create(null),Qi=Object.create(null),D1=t=>new ReadableStream({start(e){t.on({next(r){try{e.enqueue(R0(r))}catch{}},throw(r){e.error(r)},return(){try{e.close()}catch{}}})}}),L1=new TextEncoder,U1=t=>new ReadableStream({start(e){t.on({next(r){try{typeof r=="string"?e.enqueue(L1.encode(r)):e.enqueue(R0(r.$b64))}catch{}},throw(r){e.error(r)},return(){try{e.close()}catch{}}})}}),P1="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))",z1="(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})";function Ry(t){const e=Hs(),r=t.getReader();return(async()=>{try{for(;;){const{done:a,value:l}=await r.read();if(a){e.return(void 0);break}e.next(T0(l))}}catch(a){e.throw(a)}finally{r.releaseLock()}})(),e}function Ay(t){const e=Hs(),r=t.getReader(),a=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:l,value:u}=await r.read();if(l){try{const c=a.decode();c.length>0&&e.next(c)}catch{}e.return(void 0);break}try{const c=a.decode(u,{stream:!0});c.length>0&&e.next(c)}catch{e.next({$b64:T0(u)})}}}catch(l){e.throw(l)}finally{r.releaseLock()}})(),e}var B1={tag:"tss/RawStream",extends:[{tag:"tss/RawStreamFactory",test(t){return t===Fi},parse:{sync(t,e,r){return{}},async async(t,e,r){return{}},stream(t,e,r){return{}}},serialize(t,e,r){return P1},deserialize(t,e,r){return Fi}},{tag:"tss/RawStreamFactoryText",test(t){return t===Qi},parse:{sync(t,e,r){return{}},async async(t,e,r){return{}},stream(t,e,r){return{}}},serialize(t,e,r){return z1},deserialize(t,e,r){return Qi}}],test(t){return t instanceof N1},parse:{sync(t,e,r){const a=t.hint==="text"?Qi:Fi;return{hint:e.parse(t.hint),factory:e.parse(a),stream:e.parse(Hs())}},async async(t,e,r){const a=t.hint==="text"?Qi:Fi,l=t.hint==="text"?Ay(t.stream):Ry(t.stream);return{hint:await e.parse(t.hint),factory:await e.parse(a),stream:await e.parse(l)}},stream(t,e,r){const a=t.hint==="text"?Qi:Fi,l=t.hint==="text"?Ay(t.stream):Ry(t.stream);return{hint:e.parse(t.hint),factory:e.parse(a),stream:e.parse(l)}}},serialize(t,e,r){return"("+e.serialize(t.factory)+")("+e.serialize(t.stream)+")"},deserialize(t,e,r){const a=e.deserialize(t.stream);return e.deserialize(t.hint)==="text"?U1(a):D1(a)}};function H1(t){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(e,r,a){return t(typeof r?.deserialize=="function"?r.deserialize(e.streamId):e.streamId)}}}var I1={tag:"$TSR/Error",test(t){return t instanceof Error},parse:{sync(t,e){return{message:e.parse(t.message)}},async async(t,e){return{message:await e.parse(t.message)}},stream(t,e){return{message:e.parse(t.message)}}},serialize(t,e){return"new Error("+e.serialize(t.message)+")"},deserialize(t,e){return new Error(e.deserialize(t.message))}},Yr={},A0=t=>new ReadableStream({start:e=>{t.on({next:r=>{try{e.enqueue(r)}catch{}},throw:r=>{e.error(r)},return:()=>{try{e.close()}catch{}}})}}),q1={tag:"seroval-plugins/web/ReadableStreamFactory",test(t){return t===Yr},parse:{sync(){return Yr},async async(){return await Promise.resolve(Yr)},stream(){return Yr}},serialize(){return A0.toString()},deserialize(){return Yr}};function Oy(t){let e=Hs(),r=t.getReader();async function a(){try{let l=await r.read();l.done?e.return(l.value):(e.next(l.value),await a())}catch(l){e.throw(l)}}return a().catch(()=>{}),e}var $1={tag:"seroval/plugins/web/ReadableStream",extends:[q1],test(t){return typeof ReadableStream>"u"?!1:t instanceof ReadableStream},parse:{sync(t,e){return{factory:e.parse(Yr),stream:e.parse(Hs())}},async async(t,e){return{factory:await e.parse(Yr),stream:await e.parse(Oy(t))}},stream(t,e){return{factory:e.parse(Yr),stream:e.parse(Oy(t))}}},serialize(t,e){return"("+e.serialize(t.factory)+")("+e.serialize(t.stream)+")"},deserialize(t,e){let r=e.deserialize(t.stream);return A0(r)}},G1=$1,V1=[I1,B1,G1];function K1(){return[...Lv()?.serializationAdapters?.map(M1)??[],...V1]}var xy=new TextDecoder,Y1=new Uint8Array(0),Cy=16*1024*1024,ky=32*1024*1024,jy=1024,My=1e5;function F1(t){const e=new Map,r=new Map,a=new Set;let l=!1,u=null,c=0,h;const p=new ReadableStream({start(m){h=m},cancel(){l=!0;try{u?.cancel()}catch{}e.forEach(m=>{try{m.error(new Error("Framed response cancelled"))}catch{}}),e.clear(),r.clear(),a.clear()}});function g(m){const b=r.get(m);if(b)return b;if(a.has(m))return new ReadableStream({start(S){S.close()}});if(r.size>=jy)throw new Error(`Too many raw streams in framed response (max ${jy})`);const _=new ReadableStream({start(S){e.set(m,S)},cancel(){a.add(m),e.delete(m),r.delete(m)}});return r.set(m,_),_}function y(m){return g(m),e.get(m)}return(async()=>{const m=t.getReader();u=m;const b=[];let _=0;function S(){if(_<9)return null;const E=b[0];if(E.length>=9)return{type:E[0],streamId:(E[1]<<24|E[2]<<16|E[3]<<8|E[4])>>>0,length:(E[5]<<24|E[6]<<16|E[7]<<8|E[8])>>>0};const A=new Uint8Array(9);let M=0,j=9;for(let D=0;D<b.length&&j>0;D++){const X=b[D],K=Math.min(X.length,j);A.set(X.subarray(0,K),M),M+=K,j-=K}return{type:A[0],streamId:(A[1]<<24|A[2]<<16|A[3]<<8|A[4])>>>0,length:(A[5]<<24|A[6]<<16|A[7]<<8|A[8])>>>0}}function O(E){if(E===0)return Y1;const A=new Uint8Array(E);let M=0,j=E;for(;j>0&&b.length>0;){const D=b[0];if(!D)break;const X=Math.min(D.length,j);A.set(D.subarray(0,X),M),M+=X,j-=X,X===D.length?b.shift():b[0]=D.subarray(X)}return _-=E,A}try{for(;;){const{done:E,value:A}=await m.read();if(l||E)break;if(A){if(_+A.length>ky)throw new Error(`Framed response buffer exceeded ${ky} bytes`);for(b.push(A),_+=A.length;;){const M=S();if(!M)break;const{type:j,streamId:D,length:X}=M;if(j!==fr.JSON&&j!==fr.CHUNK&&j!==fr.END&&j!==fr.ERROR)throw new Error(`Unknown frame type: ${j}`);if(j===fr.JSON){if(D!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(D===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if(X>Cy)throw new Error(`Frame payload too large: ${X} bytes (max ${Cy})`);const K=9+X;if(_<K)break;if(++c>My)throw new Error(`Too many frames in framed response (max ${My})`);O(9);const H=O(X);switch(j){case fr.JSON:try{h.enqueue(xy.decode(H))}catch{}break;case fr.CHUNK:{const Y=y(D);Y&&Y.enqueue(H);break}case fr.END:{const Y=y(D);if(a.add(D),Y){try{Y.close()}catch{}e.delete(D)}break}case fr.ERROR:{const Y=y(D);if(a.add(D),Y){const W=xy.decode(H);Y.error(new Error(W)),e.delete(D)}break}}}}}if(_!==0)throw new Error("Incomplete frame at end of framed response");try{h.close()}catch{}e.forEach(E=>{try{E.close()}catch{}}),e.clear()}catch(E){try{h.error(E)}catch{}e.forEach(A=>{try{A.error(E)}catch{}}),e.clear()}finally{try{m.releaseLock()}catch{}u=null}})(),{getOrCreateStream:g,jsonChunks:p}}var lo=null;async function yh(t){t.length>0&&await Promise.allSettled(t)}var Q1=Object.prototype.hasOwnProperty;function O0(t){for(const e in t)if(Q1.call(t,e))return!0;return!1}async function J1(t,e,r){lo||(lo=K1());const a=e[0],l=a.fetch??r,u=a.data instanceof FormData?"formData":"payload",c=a.headers?new Headers(a.headers):new Headers;if(c.set("x-tsr-serverFn","true"),u==="payload"&&c.set("accept",`${Vw}, application/x-ndjson, application/json`),a.method==="GET"){if(u==="formData")throw new Error("FormData is not supported with GET requests");const p=await x0(a);if(p!==void 0){const g=Iv({payload:p});t.includes("?")?t+=`&${g}`:t+=`?${g}`}}let h;if(a.method==="POST"){const p=await X1(a);p?.contentType&&c.set("content-type",p.contentType),h=p?.body}return await Z1(async()=>l(t,{method:a.method,headers:c,signal:a.signal,body:h}))}async function x0(t){let e=!1;const r={};if(t.data!==void 0&&(e=!0,r.data=t.data),t.context&&O0(t.context)&&(e=!0,r.context=t.context),e)return C0(r)}async function C0(t){return JSON.stringify(await Promise.resolve(j1(t,{plugins:lo})))}async function X1(t){if(t.data instanceof FormData){let r;return t.context&&O0(t.context)&&(r=await C0(t.context)),r!==void 0&&t.data.set(Gw,r),{body:t.data}}const e=await x0(t);if(e)return{body:e,contentType:"application/json"}}async function Z1(t){let e;try{e=await t()}catch(a){if(a instanceof Response)e=a;else throw console.log(a),a}if(e.headers.get("x-tss-raw")==="true")return e;const r=e.headers.get("content-type");if(r||Xt(),e.headers.get("x-tss-serialized")){let a;if(r.includes("application/x-tss-framed")){if(Fw(r),!e.body)throw new Error("No response body for framed response");const{getOrCreateStream:l,jsonChunks:u}=F1(e.body),c=[H1(l),...lo||[]],h=new Map;a=await W1({jsonStream:u,onMessage:p=>Ty(p,{refs:h,plugins:c}),onError(p,g){console.error(p,g)}})}else if(r.includes("application/json")){const l=await e.json(),u=[];a=Ty(l,{plugins:lo}),await yh(u)}if(a||Xt(),a instanceof Error)throw a;return a}if(r.includes("application/json")){const a=await e.json(),l=jS(a);if(l)throw l;if(yt(a))throw a;return a}if(!e.ok)throw new Error(await e.text());return e}async function W1({jsonStream:t,onMessage:e,onError:r}){const a=t.getReader(),{value:l,done:u}=await a.read();if(u||!l)throw new Error("Stream ended before first object");const c=JSON.parse(l);let h=!1;const p=(async()=>{try{for(;;){const{value:m,done:b}=await a.read();if(b)break;if(m)try{const _=[];try{e(JSON.parse(m))}finally{}await yh(_)}catch(_){r?.(`Invalid JSON: ${m}`,_)}}}catch(m){h||r?.("Stream processing error:",m)}})();let g;const y=[];try{g=e(c)}catch(m){throw h=!0,a.cancel().catch(()=>{}),m}return await yh(y),Promise.resolve(g).catch(()=>{h=!0,a.cancel().catch(()=>{})}),p.finally(()=>{try{a.releaseLock()}catch{}}),g}function eR(t){const e="/_serverFn/"+t;return Object.assign((...l)=>{const u=Lv()?.serverFns?.fetch;return J1(e,l,u??fetch)},{url:e,serverFnMeta:{id:t},[dh]:!0})}var tR={key:"$TSS/serverfn",test:t=>typeof t!="function"||!(dh in t)?!1:!!t[dh],toSerializable:({serverFnMeta:t})=>({functionId:t.id}),fromSerializable:({functionId:t})=>eR(t)};function Ny(t){return t.replaceAll("\0","/").replaceAll("�","/")}function nR(t,e){t.id=e.i,t.__beforeLoadContext=e.b,t.loaderData=e.l,t.status=e.s,t.ssr=e.ssr,t.updatedAt=e.u,t.error=e.e,e.g!==void 0&&(t.globalNotFound=e.g)}async function rR(t){window.$_TSR||Xt();const e=t.options.serializationAdapters;if(e?.length){const E=new Map;e.forEach(A=>{E.set(A.key,A.fromSerializable)}),window.$_TSR.t=E,window.$_TSR.buffer.forEach(A=>A())}window.$_TSR.initialized=!0,window.$_TSR.router||Xt();const r=window.$_TSR.router;r.matches.forEach(E=>{E.i=Ny(E.i)}),r.lastMatchId&&(r.lastMatchId=Ny(r.lastMatchId));const{manifest:a,dehydratedData:l,lastMatchId:u}=r;t.ssr={manifest:a};const c=document.querySelector('meta[property="csp-nonce"]')?.content;t.options.ssr={nonce:c};const h=t.matchRoutes(t.stores.location.get()),p=Promise.all(h.map(E=>t.loadRouteChunk(t.looseRoutesById[E.routeId])));function g(E){const A=t.looseRoutesById[E.routeId].options.pendingMinMs??t.options.defaultPendingMinMs;if(A){const M=Bs();E._nonReactive.minPendingPromise=M,E._forcePending=!0,setTimeout(()=>{M.resolve(),t.updateMatch(E.id,j=>(j._nonReactive.minPendingPromise=void 0,{...j,_forcePending:void 0}))},A)}}function y(E){const A=t.looseRoutesById[E.routeId];A&&(A.options.ssr=E.ssr)}let m;h.forEach(E=>{const A=r.matches.find(M=>M.i===E.id);if(!A){E._nonReactive.dehydrated=!1,E.ssr=!1,y(E);return}nR(E,A),y(E),E._nonReactive.dehydrated=E.ssr!==!1,(E.ssr==="data-only"||E.ssr===!1)&&m===void 0&&(m=E.index,g(E))}),t.stores.setMatches(h),await t.options.hydrate?.(l);const b=t.stores.matches.get(),_=t.stores.location.get();await Promise.all(b.map(async E=>{try{const A=t.looseRoutesById[E.routeId],M=b[E.index-1]?.context??t.options.context;if(A.options.context){const K={deps:E.loaderDeps,params:E.params,context:M??{},location:_,navigate:H=>t.navigate({...H,_fromLocation:_}),buildLocation:t.buildLocation,cause:E.cause,abortController:E.abortController,preload:!1,matches:h,routeId:A.id};E.__routeContext=A.options.context(K)??void 0}E.context={...M,...E.__routeContext,...E.__beforeLoadContext};const j={ssr:t.options.ssr,matches:b,match:E,params:E.params,loaderData:E.loaderData},D=await A.options.head?.(j),X=await A.options.scripts?.(j);E.meta=D?.meta,E.links=D?.links,E.headScripts=D?.scripts,E.styles=D?.styles,E.scripts=X}catch(A){if(yt(A))E.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${E.routeId}`,A);else throw E.error=A,console.error(`Error during hydration for route ${E.routeId}:`,A),A}}));const S=h[h.length-1].id!==u;if(!h.some(E=>E.ssr===!1)&&!S)return h.forEach(E=>{E._nonReactive.dehydrated=void 0}),t.stores.resolvedLocation.set(t.stores.location.get()),p;const O=Promise.resolve().then(()=>t.load()).catch(E=>{console.error("Error during router hydration:",E)});if(S){const E=h[1];E||Xt(),g(E),E._displayPending=!0,E._nonReactive.displayPendingPromise=O,O.then(()=>{t.batch(()=>{t.stores.status.get()==="pending"&&(t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())),t.updateMatch(E.id,A=>({...A,_displayPending:void 0,displayPendingPromise:void 0}))})})}return p}var ou=ne.use,Zi=typeof window<"u"?ne.useLayoutEffect:ne.useEffect;function eh(t){const e=ne.useRef({value:t,prev:null}),r=e.current.value;return t!==r&&(e.current={value:t,prev:r}),e.current.prev}function sR(t,e,r={},a={}){ne.useEffect(()=>{if(!t.current||a.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([u])=>{e(u)},r);return l.observe(t.current),()=>{l.disconnect()}},[e,r,a.disabled,t])}function aR(t){const e=ne.useRef(null);return ne.useImperativeHandle(t,()=>e.current,[]),e}function iR({promise:t}){if(ou)return ou(t);const e=ZS(t);if(e[qn].status==="pending")throw e;if(e[qn].status==="error")throw e[qn].error;return e[qn].data}function oR(t){const e=Q.jsx(lR,{...t});return t.fallback?Q.jsx(ne.Suspense,{fallback:t.fallback,children:e}):e}function lR(t){const e=iR(t);return t.children(e)}function Kh(t){const e=t.errorComponent??Yh;return Q.jsx(uR,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:r,reset:a})=>r?ne.createElement(e,{error:r,reset:a}):t.children})}var uR=class extends ne.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,e){const r=t.getResetKey();return e.error&&e.resetKey!==r?{resetKey:r,error:null}:{resetKey:r}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,e){this.props.onCatch&&this.props.onCatch(t,e)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Yh({error:t}){const[e,r]=ne.useState(!1);return Q.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[Q.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[Q.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),Q.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(a=>!a),children:e?"Hide Error":"Show Error"})]}),Q.jsx("div",{style:{height:".25rem"}}),e?Q.jsx("div",{children:Q.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?Q.jsx("code",{children:t.message}):null})}):null]})}function cR({children:t,fallback:e=null}){return Fh()?Q.jsx(Z.Fragment,{children:t}):Q.jsx(Z.Fragment,{children:e})}function Fh(){return Z.useSyncExternalStore(fR,()=>!0,()=>!1)}function fR(){return()=>{}}var k0=ne.createContext(null);function At(t){return ne.useContext(k0)}var Eu=ne.createContext(void 0),hR=ne.createContext(void 0),Fe=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(Fe||{});function dR({update:t,notify:e,unwatched:r}){return{link:a,unlink:l,propagate:u,checkDirty:c,shallowPropagate:h};function a(g,y,m){const b=y.depsTail;if(b!==void 0&&b.dep===g)return;const _=b!==void 0?b.nextDep:y.deps;if(_!==void 0&&_.dep===g){_.version=m,y.depsTail=_;return}const S=g.subsTail;if(S!==void 0&&S.version===m&&S.sub===y)return;const O=y.depsTail=g.subsTail={version:m,dep:g,sub:y,prevDep:b,nextDep:_,prevSub:S,nextSub:void 0};_!==void 0&&(_.prevDep=O),b!==void 0?b.nextDep=O:y.deps=O,S!==void 0?S.nextSub=O:g.subs=O}function l(g,y=g.sub){const m=g.dep,b=g.prevDep,_=g.nextDep,S=g.nextSub,O=g.prevSub;return _!==void 0?_.prevDep=b:y.depsTail=b,b!==void 0?b.nextDep=_:y.deps=_,S!==void 0?S.prevSub=O:m.subsTail=O,O!==void 0?O.nextSub=S:(m.subs=S)===void 0&&r(m),_}function u(g){let y=g.nextSub,m;e:do{const b=g.sub;let _=b.flags;if(_&60?_&12?_&4?!(_&48)&&p(g,b)?(b.flags=_|40,_&=1):_=0:b.flags=_&-9|32:_=0:b.flags=_|32,_&2&&e(b),_&1){const S=b.subs;if(S!==void 0){const O=(g=S).nextSub;O!==void 0&&(m={value:y,prev:m},y=O);continue}}if((g=y)!==void 0){y=g.nextSub;continue}for(;m!==void 0;)if(g=m.value,m=m.prev,g!==void 0){y=g.nextSub;continue e}break}while(!0)}function c(g,y){let m,b=0,_=!1;e:do{const S=g.dep,O=S.flags;if(y.flags&16)_=!0;else if((O&17)===17){if(t(S)){const E=S.subs;E.nextSub!==void 0&&h(E),_=!0}}else if((O&33)===33){(g.nextSub!==void 0||g.prevSub!==void 0)&&(m={value:g,prev:m}),g=S.deps,y=S,++b;continue}if(!_){const E=g.nextDep;if(E!==void 0){g=E;continue}}for(;b--;){const E=y.subs,A=E.nextSub!==void 0;if(A?(g=m.value,m=m.prev):g=E,_){if(t(y)){A&&h(E),y=g.sub;continue}_=!1}else y.flags&=-33;y=g.sub;const M=g.nextDep;if(M!==void 0){g=M;continue e}}return _}while(!0)}function h(g){do{const y=g.sub,m=y.flags;(m&48)===32&&(y.flags=m|16,(m&6)===2&&e(y))}while((g=g.nextSub)!==void 0)}function p(g,y){let m=y.depsTail;for(;m!==void 0;){if(m===g)return!0;m=m.prevDep}return!1}}function pR(t,e,r){const a=typeof t=="object",l=a?t:void 0;return{next:(a?t.next:t)?.bind(l),error:(a?t.error:e)?.bind(l),complete:(a?t.complete:r)?.bind(l)}}const vh=[];let Wl=0;const{link:Dy,unlink:gR,propagate:mR,checkDirty:j0,shallowPropagate:Ly}=dR({update(t){return t._update()},notify(t){vh[bh++]=t,t.flags&=~Fe.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=Fe.Mutable|Fe.Dirty,lu(t))}});let zl=0,bh=0,Hn,_h=0;function M0(t){try{++_h,t()}finally{--_h||N0()}}function lu(t){const e=t.depsTail;let r=e!==void 0?e.nextDep:t.deps;for(;r!==void 0;)r=gR(r,t)}function N0(){if(!(_h>0)){for(;zl<bh;){const t=vh[zl];vh[zl++]=void 0,t.notify()}zl=0,bh=0}}function Uy(t,e){const r=typeof t=="function",a=t,l={_snapshot:r?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Fe.None:Fe.Mutable,get(){return Hn!==void 0&&Dy(l,Hn,Wl),l._snapshot},subscribe(u){const c=pR(u),h={current:!1},p=yR(()=>{l.get(),h.current?c.next?.(l._snapshot):h.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(u){const c=Hn,h=e?.compare??Object.is;if(r)Hn=l,++Wl,l.depsTail=void 0;else if(u===void 0)return!1;r&&(l.flags=Fe.Mutable|Fe.RecursedCheck);try{const p=l._snapshot,g=typeof u=="function"?u(p):u===void 0&&r?a(p):u;return p===void 0||!h(p,g)?(l._snapshot=g,!0):!1}finally{Hn=c,r&&(l.flags&=~Fe.RecursedCheck),lu(l)}}};return r?(l.flags=Fe.Mutable|Fe.Dirty,l.get=function(){const u=l.flags;if(u&Fe.Dirty||u&Fe.Pending&&j0(l.deps,l)){if(l._update()){const c=l.subs;c!==void 0&&Ly(c)}}else u&Fe.Pending&&(l.flags=u&~Fe.Pending);return Hn!==void 0&&Dy(l,Hn,Wl),l._snapshot}):l.set=function(u){if(l._update(u)){const c=l.subs;c!==void 0&&(mR(c),Ly(c),N0())}},l}function yR(t){const e=()=>{const a=Hn;Hn=r,++Wl,r.depsTail=void 0,r.flags=Fe.Watching|Fe.RecursedCheck;try{return t()}finally{Hn=a,r.flags&=~Fe.RecursedCheck,lu(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Fe.Watching|Fe.RecursedCheck,notify(){const a=this.flags;a&Fe.Dirty||a&Fe.Pending&&j0(this.deps,this)?e():this.flags=Fe.Watching},stop(){this.flags=Fe.None,this.depsTail=void 0,lu(this)}};return e(),r}var th={exports:{}},nh={},rh={exports:{}},sh={};var Py;function vR(){if(Py)return sh;Py=1;var t=vo();function e(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var r=typeof Object.is=="function"?Object.is:e,a=t.useState,l=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function h(m,b){var _=b(),S=a({inst:{value:_,getSnapshot:b}}),O=S[0].inst,E=S[1];return u(function(){O.value=_,O.getSnapshot=b,p(O)&&E({inst:O})},[m,_,b]),l(function(){return p(O)&&E({inst:O}),m(function(){p(O)&&E({inst:O})})},[m]),c(_),_}function p(m){var b=m.getSnapshot;m=m.value;try{var _=b();return!r(m,_)}catch{return!0}}function g(m,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return sh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,sh}var zy;function bR(){return zy||(zy=1,rh.exports=vR()),rh.exports}var By;function _R(){if(By)return nh;By=1;var t=vo(),e=bR();function r(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var a=typeof Object.is=="function"?Object.is:r,l=e.useSyncExternalStore,u=t.useRef,c=t.useEffect,h=t.useMemo,p=t.useDebugValue;return nh.useSyncExternalStoreWithSelector=function(g,y,m,b,_){var S=u(null);if(S.current===null){var O={hasValue:!1,value:null};S.current=O}else O=S.current;S=h(function(){function A(K){if(!M){if(M=!0,j=K,K=b(K),_!==void 0&&O.hasValue){var H=O.value;if(_(H,K))return D=H}return D=K}if(H=D,a(j,K))return H;var Y=b(K);return _!==void 0&&_(H,Y)?(j=K,H):(j=K,D=Y)}var M=!1,j,D,X=m===void 0?null:m;return[function(){return A(y())},X===null?void 0:function(){return A(X())}]},[y,m,b,_]);var E=l(g,S[0],S[1]);return c(function(){O.hasValue=!0,O.value=E},[E]),p(E),E},nh}var Hy;function wR(){return Hy||(Hy=1,th.exports=_R()),th.exports}var SR=wR();function ER(t,e){return t===e}function ot(t,e,r=ER){const a=ne.useCallback(c=>{if(!t)return()=>{};const{unsubscribe:h}=t.subscribe(c);return h},[t]),l=ne.useCallback(()=>t?.get(),[t]);return SR.useSyncExternalStoreWithSelector(a,l,l,e,r)}var TR={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Is(t){const e=At(),r=ne.useContext(t.from?hR:Eu),a=t.from??r,l=a?t.from?e.stores.getRouteMatchStore(a):e.stores.matchStores.get(a):void 0,u=ne.useRef(void 0);return ot(l??TR,c=>{if((t.shouldThrow??!0)&&!c&&Xt(),c===void 0)return;const h=t.select?t.select(c):c;if(t.structuralSharing??e.options.defaultStructuralSharing){const p=Ms(u.current,h);return u.current=p,p}return h})}function D0(t){return Is({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function L0(t){const{select:e,...r}=t;return Is({...r,select:a=>e?e(a.loaderDeps):a.loaderDeps})}function U0(t){return Is({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const r=t.strict===!1?e.params:e._strictParams;return t.select?t.select(r):r}})}function P0(t){return Is({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function z0(t){const e=At();return ne.useCallback(r=>e.navigate({...r,from:r.from??t?.from}),[t?.from,e])}function B0(t){return Is({...t,select:e=>t.select?t.select(e.context):e.context})}var H0=Dv();const RR=Nv(H0);function AR(t,e){const r=At(),a=aR(e),{activeProps:l,inactiveProps:u,activeOptions:c,to:h,preload:p,preloadDelay:g,preloadIntentProximity:y,hashScrollIntoView:m,replace:b,startTransition:_,resetScroll:S,viewTransition:O,children:E,target:A,disabled:M,style:j,className:D,onClick:X,onBlur:K,onFocus:H,onMouseEnter:Y,onMouseLeave:W,onTouchStart:le,ignoreBlocker:ie,params:me,search:_e,hash:qe,state:Me,mask:U,reloadDocument:F,unsafeRelative:ae,from:Se,_fromLocation:ye,...C}=t,q=Fh(),V=ne.useMemo(()=>t,[r,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),J=ot(r.stores.location,Ue=>Ue,(Ue,Je)=>Ue.href===Je.href),ee=ne.useMemo(()=>{const Ue={_fromLocation:J,...V};return r.buildLocation(Ue)},[r,J,V]),ce=ee.maskedLocation?ee.maskedLocation.publicHref:ee.publicHref,we=ee.maskedLocation?ee.maskedLocation.external:ee.external,de=ne.useMemo(()=>MR(ce,we,r.history,M),[M,we,ce,r.history]),xe=ne.useMemo(()=>{if(de?.external)return nu(de.href,r.protocolAllowlist)?void 0:de.href;if(!NR(h)&&!(typeof h!="string"||h.indexOf(":")===-1))try{return new URL(h),nu(h,r.protocolAllowlist)?void 0:h}catch{}},[h,de,r.protocolAllowlist]),Dt=ne.useMemo(()=>{if(xe)return!1;if(c?.exact){if(!yS(J.pathname,ee.pathname,r.basepath))return!1}else{const Ue=ru(J.pathname,r.basepath),Je=ru(ee.pathname,r.basepath);if(!(Ue.startsWith(Je)&&(Ue.length===Je.length||Ue[Je.length]==="/")))return!1}return(c?.includeSearch??!0)&&!Qt(J.search,ee.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?q&&J.hash===ee.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,J,xe,q,ee.hash,ee.pathname,ee.search,r.basepath]),Lt=Dt?Jr(l,{})??OR:ah,kt=Dt?ah:Jr(u,{})??ah,as=[D,Lt.className,kt.className].filter(Boolean).join(" "),Ut=(j||Lt.style||kt.style)&&{...j,...Lt.style,...kt.style},[is,Gn]=ne.useState(!1),kn=ne.useRef(!1),ln=t.reloadDocument||xe?!1:p??r.options.defaultPreload,vt=g??r.options.defaultPreloadDelay??0,Zt=ne.useCallback(()=>{r.preloadRoute({...V,_builtLocation:ee}).catch(Ue=>{console.warn(Ue),console.warn(WS)})},[r,V,ee]);sR(a,ne.useCallback(Ue=>{Ue?.isIntersecting&&Zt()},[Zt]),jR,{disabled:!!M||ln!=="viewport"}),ne.useEffect(()=>{kn.current||!M&&ln==="render"&&(Zt(),kn.current=!0)},[M,Zt,ln]);const os=Ue=>{const Je=Ue.currentTarget.getAttribute("target"),un=A!==void 0?A:Je;if(!M&&!DR(Ue)&&!Ue.defaultPrevented&&(!un||un==="_self")&&Ue.button===0){Ue.preventDefault(),H0.flushSync(()=>{Gn(!0)});const Vn=r.subscribe("onResolved",()=>{Vn(),Gn(!1)});r.navigate({...V,replace:b,resetScroll:S,hashScrollIntoView:m,startTransition:_,viewTransition:O,ignoreBlocker:ie})}};if(xe)return{...C,ref:a,href:xe,...E&&{children:E},...A&&{target:A},...M&&{disabled:M},...j&&{style:j},...D&&{className:D},...X&&{onClick:X},...K&&{onBlur:K},...H&&{onFocus:H},...Y&&{onMouseEnter:Y},...W&&{onMouseLeave:W},...le&&{onTouchStart:le}};const ft=Ue=>{if(M||ln!=="intent")return;if(!vt){Zt();return}const Je=Ue.currentTarget;if(Ji.has(Je))return;const un=setTimeout(()=>{Ji.delete(Je),Zt()},vt);Ji.set(Je,un)},jn=Ue=>{M||ln!=="intent"||Zt()},ht=Ue=>{if(M||!ln||!vt)return;const Je=Ue.currentTarget,un=Ji.get(Je);un&&(clearTimeout(un),Ji.delete(Je))};return{...C,...Lt,...kt,href:de?.href,ref:a,onClick:Ma([X,os]),onBlur:Ma([K,ht]),onFocus:Ma([H,ft]),onMouseEnter:Ma([Y,ft]),onMouseLeave:Ma([W,ht]),onTouchStart:Ma([le,jn]),disabled:!!M,target:A,...Ut&&{style:Ut},...as&&{className:as},...M&&xR,...Dt&&CR,...q&&is&&kR}}var ah={},OR={className:"active"},xR={role:"link","aria-disabled":!0},CR={"data-status":"active","aria-current":"page"},kR={"data-transitioning":"transitioning"},Ji=new WeakMap,jR={rootMargin:"100px"},Ma=t=>e=>{for(const r of t)if(r){if(e.defaultPrevented)return;r(e)}};function MR(t,e,r,a){if(!a)return e?{href:t,external:!0}:{href:r.createHref(t)||"/",external:!1}}function NR(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}var Qh=ne.forwardRef((t,e)=>{const{_asChild:r,...a}=t,{type:l,...u}=AR(a,e),c=typeof a.children=="function"?a.children({isActive:u["data-status"]==="active"}):a.children;if(!r){const{disabled:h,...p}=u;return ne.createElement("a",p,c)}return ne.createElement(r,u,c)});function DR(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var LR=class extends Fv{constructor(e){super(e),this.useMatch=r=>Is({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>B0({...r,from:this.id}),this.useSearch=r=>P0({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>U0({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>L0({...r,from:this.id}),this.useLoaderData=r=>D0({...r,from:this.id}),this.useNavigate=()=>z0({from:this.fullPath}),this.Link=Z.forwardRef((r,a)=>Q.jsx(Qh,{ref:a,from:this.fullPath,...r}))}};function UR(t){return new LR(t)}function PR(){return t=>BR(t)}var zR=class extends rE{constructor(t){super(t),this.useMatch=e=>Is({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>B0({...e,from:this.id}),this.useSearch=e=>P0({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>U0({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>L0({...e,from:this.id}),this.useLoaderData=e=>D0({...e,from:this.id}),this.useNavigate=()=>z0({from:this.fullPath}),this.Link=Z.forwardRef((e,r)=>Q.jsx(Qh,{ref:r,from:this.fullPath,...e}))}};function BR(t){return new zR(t)}function qs(t){return new HR(t,{silent:!0}).createRoute}var HR=class{constructor(t,e){this.path=t,this.createRoute=r=>{const a=UR(r);return a.isRoot=!1,a},this.silent=e?.silent}};function $s(t,e){let r,a,l,u;const c=()=>(r||(r=t().then(p=>{r=void 0,a=p[e]}).catch(p=>{if(l=p,Zw(l)&&l instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const g=`tanstack_router_reload:${l.message}`;sessionStorage.getItem(g)||(sessionStorage.setItem(g,"1"),u=!0)}})),r),h=function(g){if(u)throw window.location.reload(),new Promise(()=>{});if(l)throw l;if(!a)if(ou)ou(c());else throw c();return ne.createElement(a,g)};return h.preload=c,h}function IR(t){const e=At(),r=`not-found-${ot(e.stores.location,a=>a.pathname)}-${ot(e.stores.status,a=>a)}`;return Q.jsx(Kh,{getResetKey:()=>r,onCatch:(a,l)=>{if(yt(a))t.onCatch?.(a,l);else throw a},errorComponent:({error:a})=>{if(yt(a))return t.fallback?.(a);throw a},children:t.children})}function qR(){return Q.jsx("p",{children:"Not Found"})}function za(t){return Q.jsx(Q.Fragment,{children:t.children})}function I0(t,e,r){return e.options.notFoundComponent?Q.jsx(e.options.notFoundComponent,{...r}):t.options.defaultNotFoundComponent?Q.jsx(t.options.defaultNotFoundComponent,{...r}):Q.jsx(qR,{})}function $R(t){return null}function GR(){return $R(At()),null}var q0=ne.memo(function({matchId:e}){const r=At(),a=r.stores.matchStores.get(e);a||Xt();const l=ot(r.stores.loadedAt,c=>c),u=ot(a,c=>c);return Q.jsx(VR,{router:r,matchId:e,resetKey:l,matchState:ne.useMemo(()=>{const c=u.routeId,h=r.routesById[c].parentRoute?.id;return{routeId:c,ssr:u.ssr,_displayPending:u._displayPending,parentRouteId:h}},[u._displayPending,u.routeId,u.ssr,r.routesById])})});function VR({router:t,matchId:e,resetKey:r,matchState:a}){const l=t.routesById[a.routeId],u=l.options.pendingComponent??t.options.defaultPendingComponent,c=u?Q.jsx(u,{}):null,h=l.options.errorComponent??t.options.defaultErrorComponent,p=l.options.onCatch??t.options.defaultOnCatch,g=l.isRoot?l.options.notFoundComponent??t.options.notFoundRoute?.options.component:l.options.notFoundComponent,y=a.ssr===!1||a.ssr==="data-only",m=(!l.isRoot||l.options.wrapInSuspense||y)&&(l.options.wrapInSuspense??u??(l.options.errorComponent?.preload||y))?ne.Suspense:za,b=h?Kh:za,_=g?IR:za;return Q.jsxs(l.isRoot?l.options.shellComponent??za:za,{children:[Q.jsx(Eu.Provider,{value:e,children:Q.jsx(m,{fallback:c,children:Q.jsx(b,{getResetKey:()=>r,errorComponent:h||Yh,onCatch:(S,O)=>{if(yt(S))throw S.routeId??=a.routeId,S;p?.(S,O)},children:Q.jsx(_,{fallback:S=>{if(S.routeId??=a.routeId,!g||S.routeId&&S.routeId!==a.routeId||!S.routeId&&!l.isRoot)throw S;return ne.createElement(g,S)},children:y||a._displayPending?Q.jsx(cR,{fallback:c,children:Q.jsx(Iy,{matchId:e})}):Q.jsx(Iy,{matchId:e})})})})}),a.parentRouteId===Ps?Q.jsxs(Q.Fragment,{children:[Q.jsx(KR,{resetKey:r}),t.options.scrollRestoration&&Uv?Q.jsx(GR,{}):null]}):null]})}function KR({resetKey:t}){const e=At(),r=ne.useRef(void 0);return Zi(()=>{const a=e.latestLocation.href;(r.current===void 0||r.current!==a)&&(e.emit({type:"onRendered",...Va(e.stores.location.get(),e.stores.resolvedLocation.get())}),r.current=a)},[e.latestLocation.state.__TSR_key,t,e]),null}var Iy=ne.memo(function({matchId:e}){const r=At(),a=(y,m)=>r.getMatch(y.id)?._nonReactive[m]??y._nonReactive[m],l=r.stores.matchStores.get(e);l||Xt();const u=ot(l,y=>y),c=u.routeId,h=r.routesById[c],p=ne.useMemo(()=>{const y=(r.routesById[c].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:c,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return y?JSON.stringify(y):void 0},[c,u.loaderDeps,u._strictParams,u._strictSearch,r.options.defaultRemountDeps,r.routesById]),g=ne.useMemo(()=>{const y=h.options.component??r.options.defaultComponent;return y?Q.jsx(y,{},p):Q.jsx($0,{})},[p,h.options.component,r.options.defaultComponent]);if(u._displayPending)throw a(u,"displayPendingPromise");if(u._forcePending)throw a(u,"minPendingPromise");if(u.status==="pending"){const y=h.options.pendingMinMs??r.options.defaultPendingMinMs;if(y){const m=r.getMatch(u.id);if(m&&!m._nonReactive.minPendingPromise){const b=Bs();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},y)}}throw a(u,"loadPromise")}if(u.status==="notFound")return yt(u.error)||Xt(),I0(r,h,u.error);if(u.status==="redirected")throw Jt(u.error)||Xt(),a(u,"loadPromise");if(u.status==="error")throw u.error;return g}),$0=ne.memo(function(){const e=At(),r=ne.useContext(Eu);let a,l=!1,u;{const g=r?e.stores.matchStores.get(r):void 0;[a,l]=ot(g,y=>[y?.routeId,y?.globalNotFound??!1]),u=ot(e.stores.matchesId,y=>y[y.findIndex(m=>m===r)+1])}const c=a?e.routesById[a]:void 0,h=e.options.defaultPendingComponent?Q.jsx(e.options.defaultPendingComponent,{}):null;if(l)return c||Xt(),I0(e,c,void 0);if(!u)return null;const p=Q.jsx(q0,{matchId:u});return a===Ps?Q.jsx(ne.Suspense,{fallback:h,children:p}):p});function YR(){const t=At(),e=ne.useRef({router:t,mounted:!1}),[r,a]=ne.useState(!1),l=ot(t.stores.isLoading,m=>m),u=ot(t.stores.hasPending,m=>m),c=eh(l),h=l||r||u,p=eh(h),g=l||u,y=eh(g);return t.startTransition=m=>{a(!0),ne.startTransition(()=>{m(),a(!1)})},ne.useEffect(()=>{const m=t.history.subscribe(t.load),b=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Wr(t.latestLocation.publicHref)!==Wr(b.publicHref)&&t.commitLocation({...b,replace:!0}),()=>{m()}},[t,t.history]),Zi(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(b){console.error(b)}})()},[t]),Zi(()=>{c&&!l&&t.emit({type:"onLoad",...Va(t.stores.location.get(),t.stores.resolvedLocation.get())})},[c,t,l]),Zi(()=>{y&&!g&&t.emit({type:"onBeforeRouteMount",...Va(t.stores.location.get(),t.stores.resolvedLocation.get())})},[g,y,t]),Zi(()=>{if(p&&!h){const m=Va(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...m}),M0(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())}),m.hrefChanged&&sE(t)}},[h,p,t]),null}function FR(){const t=At(),e=t.routesById[Ps].options.pendingComponent??t.options.defaultPendingComponent,r=e?Q.jsx(e,{}):null,a=Q.jsxs(typeof document<"u"&&t.ssr?za:ne.Suspense,{fallback:r,children:[Q.jsx(YR,{}),Q.jsx(QR,{})]});return t.options.InnerWrap?Q.jsx(t.options.InnerWrap,{children:a}):a}function QR(){const t=At(),e=ot(t.stores.firstId,l=>l),r=ot(t.stores.loadedAt,l=>l),a=e?Q.jsx(q0,{matchId:e}):null;return Q.jsx(Eu.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?a:Q.jsx(Kh,{getResetKey:()=>r,errorComponent:Yh,onCatch:void 0,children:a})})}var JR=t=>({createMutableStore:Uy,createReadonlyStore:Uy,batch:M0}),XR=t=>new ZR(t),ZR=class extends VS{constructor(t){super(t,JR)}};function WR({router:t,children:e,...r}){Object.keys(r).length>0&&t.update({...t.options,...r,context:{...t.options.context,...r.context}});const a=Q.jsx(k0.Provider,{value:t,children:e});return t.options.Wrap?Q.jsx(t.options.Wrap,{children:a}):a}function eA({router:t,...e}){return Q.jsx(WR,{router:t,...e,children:Q.jsx(FR,{})})}function G0(t){const{attrs:e,children:r,nonce:a}=t;switch(t.tag){case"title":return Q.jsx("title",{...e,suppressHydrationWarning:!0,children:r});case"meta":return Q.jsx("meta",{...e,suppressHydrationWarning:!0});case"link":return Q.jsx("link",{...e,precedence:e?.precedence??(e?.rel==="stylesheet"?"default":void 0),nonce:a,suppressHydrationWarning:!0});case"style":return t.inlineCss,Q.jsx("style",{...e,dangerouslySetInnerHTML:{__html:r},nonce:a});case"script":return Q.jsx(tA,{attrs:e,children:r});default:return null}}function tA({attrs:t,children:e}){At();const r=Fh(),a=typeof t?.type=="string"&&t.type!==""&&t.type!=="text/javascript"&&t.type!=="module";if(ne.useEffect(()=>{if(!a){if(t?.src){const l=(()=>{try{const c=document.baseURI||window.location.href;return new URL(t.src,c).href}catch{return t.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(c=>c.src===l))return;const u=document.createElement("script");for(const[c,h]of Object.entries(t))c!=="suppressHydrationWarning"&&h!==void 0&&h!==!1&&u.setAttribute(c,typeof h=="boolean"?"":String(h));return document.head.appendChild(u),()=>{u.parentNode&&u.parentNode.removeChild(u)}}if(typeof e=="string"){const l=typeof t?.type=="string"?t.type:"text/javascript",u=typeof t?.nonce=="string"?t.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(h=>{if(!(h instanceof HTMLScriptElement))return!1;const p=h.getAttribute("type")??"text/javascript",g=h.getAttribute("nonce")??void 0;return h.textContent===e&&p===l&&g===u}))return;const c=document.createElement("script");if(c.textContent=e,t)for(const[h,p]of Object.entries(t))h!=="suppressHydrationWarning"&&p!==void 0&&p!==!1&&c.setAttribute(h,typeof p=="boolean"?"":String(p));return document.head.appendChild(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}}}},[t,e,a]),a&&typeof e=="string")return Q.jsx("script",{...t,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:e}});if(!r){if(t?.src)return Q.jsx("script",{...t,suppressHydrationWarning:!0});if(typeof e=="string")return Q.jsx("script",{...t,dangerouslySetInnerHTML:{__html:e},suppressHydrationWarning:!0})}return null}var nA=t=>{const e=At(),r=e.options.ssr?.nonce,a=ot(e.stores.matches,g=>g.map(y=>y.meta).filter(Boolean),Qt),l=ne.useMemo(()=>{const g=[],y={};let m;for(let b=a.length-1;b>=0;b--){const _=a[b];for(let S=_.length-1;S>=0;S--){const O=_[S];if(O)if(O.title)m||(m={tag:"title",children:O.title});else if("script:ld+json"in O)try{const E=JSON.stringify(O["script:ld+json"]);g.push({tag:"script",attrs:{type:"application/ld+json"},children:rS(E)})}catch{}else{const E=O.name??O.property;if(E){if(y[E])continue;y[E]=!0}g.push({tag:"meta",attrs:{...O,nonce:r}})}}}return m&&g.push(m),r&&g.push({tag:"meta",attrs:{property:"csp-nonce",content:r}}),g.reverse(),g},[a,r]),u=ot(e.stores.matches,g=>{const y=g.map(_=>_.links).filter(Boolean).flat(1).map(_=>({tag:"link",attrs:{..._,nonce:r}})),m=e.ssr?.manifest,b=g.map(_=>m?.routes[_.routeId]?.assets??[]).filter(Boolean).flat(1).flatMap(_=>_.tag==="link"?nE(m,_)?[]:[{tag:"link",attrs:{..._.attrs,crossOrigin:_y(t,"stylesheet")??_.attrs?.crossOrigin,suppressHydrationWarning:!0,nonce:r}}]:_.tag==="style"?[{tag:"style",attrs:{..._.attrs,nonce:r},children:_.children,..._.inlineCss?{inlineCss:!0}:{}}]:[]);return[...y,...b]},Qt),c=ot(e.stores.matches,g=>{const y=[];return g.map(m=>e.looseRoutesById[m.routeId]).forEach(m=>e.ssr?.manifest?.routes[m.id]?.preloads?.filter(Boolean).forEach(b=>{const _=eE(b);y.push({tag:"link",attrs:{rel:"modulepreload",href:_.href,crossOrigin:_y(t,"modulepreload")??_.crossOrigin,nonce:r}})})),y},Qt),h=ot(e.stores.matches,g=>g.map(y=>y.styles).flat(1).filter(Boolean).map(({children:y,...m})=>({tag:"style",attrs:{...m,nonce:r},children:y})),Qt),p=ot(e.stores.matches,g=>g.map(y=>y.headScripts).flat(1).filter(Boolean).map(({children:y,...m})=>({tag:"script",attrs:{...m,nonce:r},children:y})),Qt);return rA([...l,...c,...u,...h,...p],g=>JSON.stringify(g))};function rA(t,e){const r=new Set;return t.filter(a=>{const l=e(a);return r.has(l)?!1:(r.add(l),!0)})}function sA(t){const e=nA(t.assetCrossOrigin),r=At().options.ssr?.nonce;return Q.jsx(Q.Fragment,{children:e.map(a=>ne.createElement(G0,{...a,key:`tsr-meta-${JSON.stringify(a)}`,nonce:r}))})}var aA=()=>{const t=At(),e=t.options.ssr?.nonce,r=u=>{const c=[],h=t.ssr?.manifest;return h?(u.map(p=>t.looseRoutesById[p.routeId]).forEach(p=>h.routes[p.id]?.assets?.filter(g=>g.tag==="script").forEach(g=>{c.push({tag:"script",attrs:{...g.attrs,nonce:e},children:g.children})})),c):[]},a=u=>u.map(c=>c.scripts).flat(1).filter(Boolean).map(({children:c,...h})=>({tag:"script",attrs:{...h,suppressHydrationWarning:!0,nonce:e},children:c})),l=ot(t.stores.matches,r,Qt);return iA(t,ot(t.stores.matches,a,Qt),l)};function iA(t,e,r){let a;t.serverSsr&&(a=t.serverSsr.takeBufferedScripts());const l=[...e,...r];return a&&l.unshift(a),Q.jsx(Q.Fragment,{children:l.map((u,c)=>ne.createElement(G0,{...u,key:`tsr-scripts-${u.tag}-${c}`}))})}var Ls=(t,e)=>{const r={type:"request",...e||t};return{options:r,middleware:a=>Ls({},Object.assign(r,{middleware:a})),inputValidator:a=>Ls({},Object.assign(r,{inputValidator:a})),client:a=>Ls({},Object.assign(r,{client:a})),server:a=>Ls({},Object.assign(r,{server:a}))}};function V0(t,e){for(let r=0,a=e.length;r<a;r++){const l=e[r];t.has(l)||(t.add(l),l.extends&&V0(t,l.extends))}}var oA=t=>({getOptions:async()=>{const e=await t();if(e.serializationAdapters){const r=new Set;V0(r,e.serializationAdapters),e.serializationAdapters=Array.from(r)}return e},createMiddleware:Ls}),qy=function(){return qy=Object.assign||function(e){for(var r,a=1,l=arguments.length;a<l;a++){r=arguments[a];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(e[u]=r[u])}return e},qy.apply(this,arguments)};function Tu(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(t);l<a.length;l++)e.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(t,a[l])&&(r[a[l]]=t[a[l]]);return r}function lA(t,e,r,a){function l(u){return u instanceof r?u:new r(function(c){c(u)})}return new(r||(r=Promise))(function(u,c){function h(y){try{g(a.next(y))}catch(m){c(m)}}function p(y){try{g(a.throw(y))}catch(m){c(m)}}function g(y){y.done?u(y.value):l(y.value).then(h,p)}g((a=a.apply(t,e||[])).next())})}function r2(t,e,r){if(r||arguments.length===2)for(var a=0,l=e.length,u;a<l;a++)(u||!(a in e))&&(u||(u=Array.prototype.slice.call(e,0,a)),u[a]=e[a]);return t.concat(u||Array.prototype.slice.call(e))}const uA=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Jh extends Error{constructor(e,r="FunctionsError",a){super(e),this.name=r,this.context=a}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class cA extends Jh{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class $y extends Jh{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Gy extends Jh{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var wh;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(wh||(wh={}));class fA{constructor(e,{headers:r={},customFetch:a,region:l=wh.Any}={}){this.url=e,this.headers=r,this.region=l,this.fetch=uA(a)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return lA(this,arguments,void 0,function*(r,a={}){var l;let u,c;try{const{headers:h,method:p,body:g,signal:y,timeout:m}=a;let b={},{region:_}=a;_||(_=this.region);const S=new URL(`${this.url}/${r}`);_&&_!=="any"&&(b["x-region"]=_,S.searchParams.set("forceFunctionRegion",_));let O;g&&(h&&!Object.prototype.hasOwnProperty.call(h,"Content-Type")||!h)?typeof Blob<"u"&&g instanceof Blob||g instanceof ArrayBuffer?(b["Content-Type"]="application/octet-stream",O=g):typeof g=="string"?(b["Content-Type"]="text/plain",O=g):typeof FormData<"u"&&g instanceof FormData?O=g:(b["Content-Type"]="application/json",O=JSON.stringify(g)):g&&typeof g!="string"&&!(typeof Blob<"u"&&g instanceof Blob)&&!(g instanceof ArrayBuffer)&&!(typeof FormData<"u"&&g instanceof FormData)?O=JSON.stringify(g):O=g;let E=y;m&&(c=new AbortController,u=setTimeout(()=>c.abort(),m),y?(E=c.signal,y.addEventListener("abort",()=>c.abort())):E=c.signal);const A=yield this.fetch(S.toString(),{method:p||"POST",headers:Object.assign(Object.assign(Object.assign({},b),this.headers),h),body:O,signal:E}).catch(X=>{throw new cA(X)}),M=A.headers.get("x-relay-error");if(M&&M==="true")throw new $y(A);if(!A.ok)throw new Gy(A);let j=((l=A.headers.get("Content-Type"))!==null&&l!==void 0?l:"text/plain").split(";")[0].trim(),D;return j==="application/json"?D=yield A.json():j==="application/octet-stream"||j==="application/pdf"?D=yield A.blob():j==="text/event-stream"?D=A:j==="multipart/form-data"?D=yield A.formData():D=yield A.text(),{data:D,error:null,response:A}}catch(h){return{data:null,error:h,response:h instanceof Gy||h instanceof $y?h.context:void 0}}finally{u&&clearTimeout(u)}})}}const K0=3,Vy=t=>Math.min(1e3*2**t,3e4),hA=[520,503],Y0=["GET","HEAD","OPTIONS"];var dA=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Ky(t,e){return new Promise(r=>{if(e?.aborted){r();return}const a=setTimeout(()=>{e?.removeEventListener("abort",l),r()},t);function l(){clearTimeout(a),r()}e?.addEventListener("abort",l)})}function pA(t,e,r,a){return!(!a||r>=K0||!Y0.includes(t)||!hA.includes(e))}var gA=class{constructor(t){var e,r,a,l,u;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(a=t.shouldStripNulls)!==null&&a!==void 0?a:!1,this.urlLengthLimit=(l=t.urlLengthLimit)!==null&&l!==void 0?l:8e3,this.retryEnabled=(u=t.retry)!==null&&u!==void 0?u:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=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){const c=this.headers.get("Accept");c==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!c||c==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const a=this.fetch;let u=(async()=>{let c=0;for(;;){const g=new Headers(r.headers);c>0&&g.set("X-Retry-Count",String(c));let y;try{y=await a(r.url.toString(),{method:r.method,headers:g,body:JSON.stringify(r.body,(m,b)=>typeof b=="bigint"?b.toString():b),signal:r.signal})}catch(m){if(m?.name==="AbortError"||m?.code==="ABORT_ERR"||!Y0.includes(r.method))throw m;if(r.retryEnabled&&c<K0){const b=Vy(c);c++,await Ky(b,r.signal);continue}throw m}if(pA(r.method,y.status,c,r.retryEnabled)){var h,p;const m=(h=(p=y.headers)===null||p===void 0?void 0:p.get("Retry-After"))!==null&&h!==void 0?h:null,b=m!==null?Math.max(0,parseInt(m,10)||0)*1e3:Vy(c);await y.text(),c++,await Ky(b,r.signal);continue}return await r.processResponse(y)}})();return this.shouldThrowOnError||(u=u.catch(c=>{var h;let p="",g="",y="";const m=c?.cause;if(m){var b,_,S,O;const M=(b=m?.message)!==null&&b!==void 0?b:"",j=(_=m?.code)!==null&&_!==void 0?_:"";p=`${(S=c?.name)!==null&&S!==void 0?S:"FetchError"}: ${c?.message}`,p+=`

Caused by: ${(O=m?.name)!==null&&O!==void 0?O:"Error"}: ${M}`,j&&(p+=` (${j})`),m?.stack&&(p+=`
${m.stack}`)}else{var E;p=(E=c?.stack)!==null&&E!==void 0?E:""}const A=this.url.toString().length;return c?.name==="AbortError"||c?.code==="ABORT_ERR"?(y="",g="Request was aborted (timeout or manual cancellation)",A>this.urlLengthLimit&&(g+=`. 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.`)):(m?.name==="HeadersOverflowError"||m?.code==="UND_ERR_HEADERS_OVERFLOW")&&(y="",g="HTTP headers exceeded server limits (typically 16KB)",A>this.urlLengthLimit&&(g+=`. 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:`${(h=c?.name)!==null&&h!==void 0?h:"FetchError"}: ${c?.message}`,details:p,hint:g,code:y},data:null,count:null,status:0,statusText:""}})),u.then(t,e)}async processResponse(t){var e=this;let r=null,a=null,l=null,u=t.status,c=t.statusText;if(t.ok){var h,p;if(e.method!=="HEAD"){var g;const b=await t.text();b===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((g=e.headers.get("Accept"))===null||g===void 0)&&g.includes("application/vnd.pgrst.plan+text"))?a=b:a=JSON.parse(b))}const y=(h=e.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),m=(p=t.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");y&&m&&m.length>1&&(l=parseInt(m[1])),e.isMaybeSingle&&Array.isArray(a)&&(a.length>1?(r={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,l=null,u=406,c="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{const y=await t.text();try{r=JSON.parse(y),Array.isArray(r)&&t.status===404&&(a=[],r=null,u=200,c="OK")}catch{t.status===404&&y===""?(u=204,c="No Content"):r={message:y}}if(r&&e.shouldThrowOnError)throw new dA(r)}return{success:r===null,error:r,data:a,count:l,status:u,statusText:c}}returns(){return this}overrideTypes(){return this}},mA=class extends gA{select(t){let e=!1;const r=(t??"*").split("").map(a=>/\s/.test(a)&&!e?"":(a==='"'&&(e=!e),a)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:a,referencedTable:l=a}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:a=r}={}){const l=typeof a>"u"?"offset":`${a}.offset`,u=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(l,`${t}`),this.url.searchParams.set(u,`${e-t+1}`),this}abortSignal(t){return this.signal=t,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:t=!1,verbose:e=!1,settings:r=!1,buffers:a=!1,wal:l=!1,format:u="text"}={}){var c;const h=[t?"analyze":null,e?"verbose":null,r?"settings":null,a?"buffers":null,l?"wal":null].filter(Boolean).join("|"),p=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${p}"; options=${h};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Yy=new RegExp("[,()]");var Ba=class extends mA{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(a=>typeof a=="string"&&Yy.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(a=>typeof a=="string"&&Yy.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:a}={}){let l="";a==="plain"?l="pl":a==="phrase"?l="ph":a==="websearch"&&(l="w");const u=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${l}fts${u}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},yA=class{constructor(t,{headers:e={},schema:r,fetch:a,urlLengthLimit:l=8e3,retry:u}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=a,this.urlLengthLimit=l,this.retry=u}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:a}=e??{},l=r?"HEAD":"GET";let u=!1;const c=(t??"*").split("").map(g=>/\s/.test(g)&&!u?"":(g==='"'&&(u=!u),g)).join(""),{url:h,headers:p}=this.cloneRequestState();return h.searchParams.set("select",c),a&&p.append("Prefer",`count=${a}`),new Ba({method:l,url:h,headers:p,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var a;const l="POST",{url:u,headers:c}=this.cloneRequestState();if(e&&c.append("Prefer",`count=${e}`),r||c.append("Prefer","missing=default"),Array.isArray(t)){const h=t.reduce((p,g)=>p.concat(Object.keys(g)),[]);if(h.length>0){const p=[...new Set(h)].map(g=>`"${g}"`);u.searchParams.set("columns",p.join(","))}}return new Ba({method:l,url:u,headers:c,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:a,defaultToNull:l=!0}={}){var u;const c="POST",{url:h,headers:p}=this.cloneRequestState();if(p.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&h.searchParams.set("on_conflict",e),a&&p.append("Prefer",`count=${a}`),l||p.append("Prefer","missing=default"),Array.isArray(t)){const g=t.reduce((y,m)=>y.concat(Object.keys(m)),[]);if(g.length>0){const y=[...new Set(g)].map(m=>`"${m}"`);h.searchParams.set("columns",y.join(","))}}return new Ba({method:c,url:h,headers:p,schema:this.schema,body:t,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const a="PATCH",{url:l,headers:u}=this.cloneRequestState();return e&&u.append("Prefer",`count=${e}`),new Ba({method:a,url:l,headers:u,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:a,headers:l}=this.cloneRequestState();return t&&l.append("Prefer",`count=${t}`),new Ba({method:r,url:a,headers:l,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function uo(t){"@babel/helpers - typeof";return uo=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},uo(t)}function vA(t,e){if(uo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(uo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bA(t){var e=vA(t,"string");return uo(e)=="symbol"?e:e+""}function _A(t,e,r){return(e=bA(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fy(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Bl(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fy(Object(r),!0).forEach(function(a){_A(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fy(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}var wA=class F0{constructor(e,{headers:r={},schema:a,fetch:l,timeout:u,urlLengthLimit:c=8e3,retry:h}={}){this.url=e,this.headers=new Headers(r),this.schemaName=a,this.urlLengthLimit=c;const p=l??globalThis.fetch;u!==void 0&&u>0?this.fetch=(g,y)=>{const m=new AbortController,b=setTimeout(()=>m.abort(),u),_=y?.signal;if(_){if(_.aborted)return clearTimeout(b),p(g,y);const S=()=>{clearTimeout(b),m.abort()};return _.addEventListener("abort",S,{once:!0}),p(g,Bl(Bl({},y),{},{signal:m.signal})).finally(()=>{clearTimeout(b),_.removeEventListener("abort",S)})}return p(g,Bl(Bl({},y),{},{signal:m.signal})).finally(()=>clearTimeout(b))}:this.fetch=p,this.retry=h}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new yA(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new F0(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:a=!1,get:l=!1,count:u}={}){var c;let h;const p=new URL(`${this.url}/rpc/${e}`);let g;const y=_=>_!==null&&typeof _=="object"&&(!Array.isArray(_)||_.some(y)),m=a&&Object.values(r).some(y);m?(h="POST",g=r):a||l?(h=a?"HEAD":"GET",Object.entries(r).filter(([_,S])=>S!==void 0).map(([_,S])=>[_,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([_,S])=>{p.searchParams.append(_,S)})):(h="POST",g=r);const b=new Headers(this.headers);return m?b.set("Prefer",u?`count=${u},return=minimal`:"return=minimal"):u&&b.set("Prefer",`count=${u}`),new Ba({method:h,url:p,headers:b,schema:this.schemaName,body:g,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class SA{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const a=typeof global<"u"?global:void 0;if(a&&typeof a.WebSocket<"u")return{type:"native",wsConstructor:a.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")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"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.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."};const l=globalThis.process;if(l){const u=l.versions;if(u&&u.node){const c=u.node,h=parseInt(c.replace(/^v/,"").split(".")[0]);return h>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${h} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${h} 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(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`

Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const EA="2.106.2",TA=`realtime-js/${EA}`,RA="1.0.0",Q0="2.0.0",AA=Q0,OA=1e4,xA=100,Fr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},J0={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Sh={connecting:"connecting",closing:"closing",closed:"closed"};class CA{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,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let a=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(a))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,a;const l=(a=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,l)}_encodeJsonUserBroadcastPush(e){var r,a;const l=(a=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:{},c=new TextEncoder().encode(JSON.stringify(l)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,c)}_encodeUserBroadcastPush(e,r,a){var l,u;const c=e.topic,h=(l=e.ref)!==null&&l!==void 0?l:"",p=(u=e.join_ref)!==null&&u!==void 0?u:"",g=e.payload.event,y=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},m=Object.keys(y).length===0?"":JSON.stringify(y);if(p.length>255)throw new Error(`joinRef length ${p.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`ref length ${h.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`topic length ${c.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`userEvent length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const b=this.USER_BROADCAST_PUSH_META_LENGTH+p.length+h.length+c.length+g.length+m.length,_=new ArrayBuffer(this.HEADER_LENGTH+b);let S=new DataView(_),O=0;S.setUint8(O++,this.KINDS.userBroadcastPush),S.setUint8(O++,p.length),S.setUint8(O++,h.length),S.setUint8(O++,c.length),S.setUint8(O++,g.length),S.setUint8(O++,m.length),S.setUint8(O++,r),Array.from(p,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(h,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(c,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(g,A=>S.setUint8(O++,A.charCodeAt(0))),Array.from(m,A=>S.setUint8(O++,A.charCodeAt(0)));var E=new Uint8Array(_.byteLength+a.byteLength);return E.set(new Uint8Array(_),0),E.set(new Uint8Array(a),_.byteLength),E.buffer}decode(e,r){if(this._isArrayBuffer(e)){let a=this._binaryDecode(e);return r(a)}if(typeof e=="string"){const a=JSON.parse(e),[l,u,c,h,p]=a;return r({join_ref:l,ref:u,topic:c,event:h,payload:p})}return r({})}_binaryDecode(e){const r=new DataView(e),a=r.getUint8(0),l=new TextDecoder;if(a===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,r,l)}_decodeUserBroadcast(e,r,a){const l=r.getUint8(1),u=r.getUint8(2),c=r.getUint8(3),h=r.getUint8(4);let p=this.HEADER_LENGTH+4;const g=a.decode(e.slice(p,p+l));p=p+l;const y=a.decode(e.slice(p,p+u));p=p+u;const m=a.decode(e.slice(p,p+c));p=p+c;const b=e.slice(p,e.byteLength),_=h===this.JSON_ENCODING?JSON.parse(a.decode(b)):b,S={type:this.BROADCAST_EVENT,event:y,payload:_};return c>0&&(S.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:g,event:this.BROADCAST_EVENT,payload:S}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([a])=>r.includes(a)))}}var $e;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})($e||($e={}));const Qy=(t,e,r={})=>{var a;const l=(a=r.skipTypes)!==null&&a!==void 0?a:[];return e?Object.keys(e).reduce((u,c)=>(u[c]=kA(c,t,e,l),u),{}):{}},kA=(t,e,r,a)=>{const l=e.find(h=>h.name===t),u=l?.type,c=r[t];return u&&!a.includes(u)?X0(u,c):Eh(c)},X0=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return DA(e,r)}switch(t){case $e.bool:return jA(e);case $e.float4:case $e.float8:case $e.int2:case $e.int4:case $e.int8:case $e.numeric:case $e.oid:return MA(e);case $e.json:case $e.jsonb:return NA(e);case $e.timestamp:return LA(e);case $e.abstime:case $e.date:case $e.daterange:case $e.int4range:case $e.int8range:case $e.money:case $e.reltime:case $e.text:case $e.time:case $e.timestamptz:case $e.timetz:case $e.tsrange:case $e.tstzrange:return Eh(e);default:return Eh(e)}},Eh=t=>t,jA=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},MA=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},NA=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},DA=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,a=t[r];if(t[0]==="{"&&a==="}"){let u;const c=t.slice(1,r);try{u=JSON.parse("["+c+"]")}catch{u=c?c.split(","):[]}return u.map(h=>X0(e,h))}return t},LA=t=>typeof t=="string"?t.replace(" ","T"):t,Z0=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var to=t=>typeof t=="function"?t:function(){return t},UA=typeof self<"u"?self:null,Ha=typeof window<"u"?window:null,In=UA||Ha||globalThis,PA="2.0.0",zA=1e4,BA=1e3,$n={connecting:0,open:1,closing:2,closed:3},Yt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},dr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Th={longpoll:"longpoll",websocket:"websocket"},HA={complete:4},Rh="base64url.bearer.phx.",Hl=class{constructor(t,e,r,a){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=a,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,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(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(a=>a.status===t).forEach(a=>a.callback(e))}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,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},W0=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},IA=class{constructor(t,e,r){this.state=Yt.closed,this.topic=t,this.params=to(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Hl(this,dr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new W0(()=>{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=Yt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this.joinPush.receive("error",a=>{this.state=Yt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Yt.closed,this.socket.remove(this)}),this.onError(a=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.isJoining()&&this.joinPush.reset(),this.state=Yt.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 Hl(this,dr.leave,to({}),this.timeout).send(),this.state=Yt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(dr.reply,(a,l)=>{this.trigger(this.replyEventName(l),a)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Yt.closed,this.bindings=[]}onClose(t){this.on(dr.close,t)}onError(t){return this.on(dr.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let a=new Hl(this,t,function(){return e},r);return this.canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Yt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(dr.close,"leave")},r=new Hl(this,dr.leave,to({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,a){return this.topic!==t?!1:a&&a!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:a}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Yt.joining,this.joinPush.resend(t))}trigger(t,e,r,a){let l=this.onMessage(t,e,r,a);if(e&&!l)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let u=this.bindings.filter(c=>c.event===t&&this.filterBindings(c,e,r));for(let c=0;c<u.length;c++)u[c].callback(l,r,a||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Yt.closed}isErrored(){return this.state===Yt.errored}isJoined(){return this.state===Yt.joined}isJoining(){return this.state===Yt.joining}isLeaving(){return this.state===Yt.leaving}},uu=class{static request(t,e,r,a,l,u,c){if(In.XDomainRequest){let h=new In.XDomainRequest;return this.xdomainRequest(h,t,e,a,l,u,c)}else if(In.XMLHttpRequest){let h=new In.XMLHttpRequest;return this.xhrRequest(h,t,e,r,a,l,u,c)}else{if(In.fetch&&In.AbortController)return this.fetchRequest(t,e,r,a,l,u,c);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,a,l,u,c){let h={method:t,headers:r,body:a},p=null;return l&&(p=new AbortController,setTimeout(()=>p.abort(),l),h.signal=p.signal),In.fetch(e,h).then(g=>g.text()).then(g=>this.parseJSON(g)).then(g=>c&&c(g)).catch(g=>{g.name==="AbortError"&&u?u():c&&c(null)}),p}static xdomainRequest(t,e,r,a,l,u,c){return t.timeout=l,t.open(e,r),t.onload=()=>{let h=this.parseJSON(t.responseText);c&&c(h)},u&&(t.ontimeout=u),t.onprogress=()=>{},t.send(a),t}static xhrRequest(t,e,r,a,l,u,c,h){t.open(e,r,!0),t.timeout=u;for(let[p,g]of Object.entries(a))t.setRequestHeader(p,g);return t.onerror=()=>h&&h(null),t.onreadystatechange=()=>{if(t.readyState===HA.complete&&h){let p=this.parseJSON(t.responseText);h(p)}},c&&(t.ontimeout=c),t.send(l),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let l=e?`${e}[${a}]`:a,u=t[a];typeof u=="object"?r.push(this.serialize(u,l)):r.push(encodeURIComponent(l)+"="+encodeURIComponent(u))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},qA=t=>{let e="",r=new Uint8Array(t),a=r.byteLength;for(let l=0;l<a;l++)e+=String.fromCharCode(r[l]);return btoa(e)},Na=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Rh)&&(this.authToken=atob(e[1].slice(Rh.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=$n.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Th.websocket),"$1/"+Th.longpoll)}endpointURL(){return uu.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=$n.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===$n.open||this.readyState===$n.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:a,messages:l}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=a}else r=0;switch(r){case 200:l.forEach(u=>{setTimeout(()=>this.onmessage({data:u}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=$n.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 new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=qA(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.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(t,e,r){for(let l of this.reqs)l.abort();this.readyState=$n.closed;let a=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",a)):this.onclose(a)}ajax(t,e,r,a,l){let u,c=()=>{this.reqs.delete(u),a()};u=uu.request(t,this.endpointURL(),e,r,this.timeout,c,h=>{this.reqs.delete(u),this.isActive()&&l(h)}),this.reqs.add(u)}},$A=class Wi{constructor(e,r={}){let a=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(a.state,l=>{let{onJoin:u,onLeave:c,onSync:h}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Wi.syncState(this.state,l,u,c),this.pendingDiffs.forEach(p=>{this.state=Wi.syncDiff(this.state,p,u,c)}),this.pendingDiffs=[],h()}),this.channel.on(a.diff,l=>{let{onJoin:u,onLeave:c,onSync:h}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(l):(this.state=Wi.syncDiff(this.state,l,u,c),h())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Wi.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,a,l){let u=this.clone(e),c={},h={};return this.map(u,(p,g)=>{r[p]||(h[p]=g)}),this.map(r,(p,g)=>{let y=u[p];if(y){let m=g.metas.map(O=>O.phx_ref),b=y.metas.map(O=>O.phx_ref),_=g.metas.filter(O=>b.indexOf(O.phx_ref)<0),S=y.metas.filter(O=>m.indexOf(O.phx_ref)<0);_.length>0&&(c[p]=g,c[p].metas=_),S.length>0&&(h[p]=this.clone(y),h[p].metas=S)}else c[p]=g}),this.syncDiff(u,{joins:c,leaves:h},a,l)}static syncDiff(e,r,a,l){let{joins:u,leaves:c}=this.clone(r);return a||(a=function(){}),l||(l=function(){}),this.map(u,(h,p)=>{let g=e[h];if(e[h]=this.clone(p),g){let y=e[h].metas.map(b=>b.phx_ref),m=g.metas.filter(b=>y.indexOf(b.phx_ref)<0);e[h].metas.unshift(...m)}a(h,g,p)}),this.map(c,(h,p)=>{let g=e[h];if(!g)return;let y=p.metas.map(m=>m.phx_ref);g.metas=g.metas.filter(m=>y.indexOf(m.phx_ref)<0),l(h,g,p),g.metas.length===0&&delete e[h]}),e}static list(e,r){return r||(r=function(a,l){return l}),this.map(e,(a,l)=>r(a,l))}static map(e,r){return Object.getOwnPropertyNames(e).map(a=>r(a,e[a]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Il={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,a,l,u,c]=JSON.parse(t);return e({join_ref:r,ref:a,topic:l,event:u,payload:c})}},binaryEncode(t){let{join_ref:e,ref:r,event:a,topic:l,payload:u}=t,c=this.META_LENGTH+e.length+r.length+l.length+a.length,h=new ArrayBuffer(this.HEADER_LENGTH+c),p=new DataView(h),g=0;p.setUint8(g++,this.KINDS.push),p.setUint8(g++,e.length),p.setUint8(g++,r.length),p.setUint8(g++,l.length),p.setUint8(g++,a.length),Array.from(e,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(r,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(l,m=>p.setUint8(g++,m.charCodeAt(0))),Array.from(a,m=>p.setUint8(g++,m.charCodeAt(0)));var y=new Uint8Array(h.byteLength+u.byteLength);return y.set(new Uint8Array(h),0),y.set(new Uint8Array(u),h.byteLength),y.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),a=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,a);case this.KINDS.reply:return this.decodeReply(t,e,a);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,a)}},decodePush(t,e,r){let a=e.getUint8(1),l=e.getUint8(2),u=e.getUint8(3),c=this.HEADER_LENGTH+this.META_LENGTH-1,h=r.decode(t.slice(c,c+a));c=c+a;let p=r.decode(t.slice(c,c+l));c=c+l;let g=r.decode(t.slice(c,c+u));c=c+u;let y=t.slice(c,t.byteLength);return{join_ref:h,ref:null,topic:p,event:g,payload:y}},decodeReply(t,e,r){let a=e.getUint8(1),l=e.getUint8(2),u=e.getUint8(3),c=e.getUint8(4),h=this.HEADER_LENGTH+this.META_LENGTH,p=r.decode(t.slice(h,h+a));h=h+a;let g=r.decode(t.slice(h,h+l));h=h+l;let y=r.decode(t.slice(h,h+u));h=h+u;let m=r.decode(t.slice(h,h+c));h=h+c;let b=t.slice(h,t.byteLength),_={status:m,response:b};return{join_ref:p,ref:g,topic:y,event:dr.reply,payload:_}},decodeBroadcast(t,e,r){let a=e.getUint8(1),l=e.getUint8(2),u=this.HEADER_LENGTH+2,c=r.decode(t.slice(u,u+a));u=u+a;let h=r.decode(t.slice(u,u+l));u=u+l;let p=t.slice(u,t.byteLength);return{join_ref:null,ref:null,topic:c,event:h,payload:p}}},GA=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||zA,this.transport=e.transport||In.WebSocket||Na,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=In&&In.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Il.encode.bind(Il),this.defaultDecoder=Il.decode.bind(Il),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Na?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let a=null;Ha&&Ha.addEventListener&&(Ha.addEventListener("pagehide",l=>{this.conn&&(this.disconnect(),a=this.connectClock)}),Ha.addEventListener("pageshow",l=>{a===this.connectClock&&(a=null,this.connect())}),Ha.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=l=>e.rejoinAfterMs?e.rejoinAfterMs(l):[1e3,2e3,5e3][l-1]||1e4,this.reconnectAfterMs=l=>e.reconnectAfterMs?e.reconnectAfterMs(l):[10,50,100,150,200,250,500,1e3,2e3][l-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(l,u,c)=>{console.log(`${l}: ${u}`,c)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=to(e.params||{}),this.endPoint=`${t}/${Th.websocket}`,this.vsn=e.vsn||PA,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new W0(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Na}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=uu.appendParams(uu.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=to(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Na?this.connectWithFallback(Na,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let a=this.onMessage(l=>{l.ref===e&&(this.off([a]),t(Date.now()-r))});return!0}transportName(t){return t===Na?"LongPoll":t.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Rh}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),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(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,a=!0,l,u,c=this.transportName(t),h=p=>{this.log("transport",`falling back to ${c}...`,p),this.off([l,u]),a=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${c}`))return h("memorized");this.fallbackTimer=setTimeout(h,e),u=this.onError(p=>{this.log("transport","error",p),a&&!r&&(clearTimeout(this.fallbackTimer),h(p))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!a){let p=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${p}`,"true"),this.log("transport",`established ${p} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,e),this.ping(p=>{this.log("transport","connected to primary after",p),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(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),BA,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const a=this.conn;this.waitForBufferDone(a,()=>{e?a.close(e,r||""):a.close(),this.waitForSocketClosed(a,()=>{this.conn===a&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===$n.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(dr.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case $n.connecting:return"connecting";case $n.open:return"open";case $n.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new IA(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:a,ref:l,join_ref:u}=t;this.log("push",`${e} ${r} (${u}, ${l})`,a)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}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(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:a,payload:l,ref:u,join_ref:c}=e;if(u&&u===this.pendingHeartbeatRef){const h=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(l.status==="ok"?"ok":"error",h)}catch(p){this.log("error","error in heartbeat callback",p)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${l.status||""} ${r} ${a} ${u&&"("+u+")"||""}`.trim(),l);for(let h=0;h<this.channels.length;h++){const p=this.channels[h];p.isMember(r,a,l,c)&&p.trigger(a,l,u,c)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,a])=>{try{a(...e)}catch(l){this.log("error",`error in ${t} callback`,l)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class no{constructor(e,r){const a=KA(r);this.presence=new $A(e.getChannel(),a),this.presence.onJoin((l,u,c)=>{const h=no.onJoinPayload(l,u,c);e.getChannel().trigger("presence",h)}),this.presence.onLeave((l,u,c)=>{const h=no.onLeavePayload(l,u,c);e.getChannel().trigger("presence",h)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return no.transformState(this.presence.state)}static transformState(e){return e=VA(e),Object.getOwnPropertyNames(e).reduce((r,a)=>{const l=e[a];return r[a]=eu(l),r},{})}static onJoinPayload(e,r,a){const l=Jy(r),u=eu(a);return{event:"join",key:e,currentPresences:l,newPresences:u}}static onLeavePayload(e,r,a){const l=Jy(r),u=eu(a);return{event:"leave",key:e,currentPresences:l,leftPresences:u}}}function eu(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function VA(t){return JSON.parse(JSON.stringify(t))}function KA(t){return t?.events&&{events:t.events}}function Jy(t){return t?.metas?eu(t):[]}var Xy;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Xy||(Xy={}));class YA{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new no(this.channel.channelAdapter,r)}}function FA(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class QA{constructor(e,r,a){const l=JA(a);this.channel=e.getSocket().channel(r,l),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,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}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,r,a){let l;try{l=this.channel.push(e,r,a)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>xA){const u=this.channel.pushBuffer.shift();u.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${u.event}`,u.payload())}return l}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===Fr.joined}isJoined(){return this.state===Fr.joined}isJoining(){return this.state===Fr.joining}isClosed(){return this.state===Fr.closed}isLeaving(){return this.state===Fr.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function JA(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Zy;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Zy||(Zy={}));var Ga;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Ga||(Ga={}));var pr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(pr||(pr={}));class ro{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,r={config:{}},a){var l,u;if(this.topic=e,this.params=r,this.socket=a,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new QA(this.socket.socketAdapter,e,this.params),this.presence=new YA(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Z0(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((u=(l=this.params.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var a,l,u;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:c,presence:h,private:p}}=this.params,g=(l=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(_=>_.filter))!==null&&l!==void 0?l:[],y=!!this.bindings[Ga.PRESENCE]&&this.bindings[Ga.PRESENCE].length>0||((u=this.params.config.presence)===null||u===void 0?void 0:u.enabled)===!0,m={},b={broadcast:c,presence:Object.assign(Object.assign({},h),{enabled:y}),postgres_changes:g,private:p};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(_=>{e?.(pr.CHANNEL_ERROR,FA(_))}),this._onClose(()=>e?.(pr.CLOSED)),this.updateJoinPayload(Object.assign({config:b},m)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:_})=>{if(this.socket._isManualToken()||this.socket.setAuth(),_===void 0){e?.(pr.SUBSCRIBED);return}this._updatePostgresBindings(_,e)}).receive("error",_=>{this.state=Fr.errored;const S=Object.values(_).join(", ")||"error";e?.(pr.CHANNEL_ERROR,new Error(S,{cause:_}))}).receive("timeout",()=>{e?.(pr.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var a;const l=this.bindings.postgres_changes,u=(a=l?.length)!==null&&a!==void 0?a:0,c=[];for(let h=0;h<u;h++){const p=l[h],{filter:{event:g,schema:y,table:m,filter:b}}=p,_=e&&e[h];if(_&&_.event===g&&ro.isFilterValueEqual(_.schema,y)&&ro.isFilterValueEqual(_.table,m)&&ro.isFilterValueEqual(_.filter,b))c.push(Object.assign(Object.assign({},p),{id:_.id}));else{this.unsubscribe(),this.state=Fr.errored,r?.(pr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=c,this.state!=Fr.errored&&r&&r(pr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,a){const l=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),u=e===Ga.PRESENCE||e===Ga.POSTGRES_CHANGES;if(l&&u)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,a)}async httpSend(e,r,a={}){var l;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},h=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(l=a.timeout)!==null&&l!==void 0?l:this.timeout);if(h.status===202)return{success:!0};let p=h.statusText;try{const g=await h.json();p=g.error||g.message||p}catch{}return Promise.reject(new Error(p))}async send(e,r={}){var a,l;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:u,payload:c}=e,h={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(h.Authorization=`Bearer ${this.socket.accessTokenValue}`);const p={method:"POST",headers:h,body:JSON.stringify({messages:[{topic:this.subTopic,event:u,payload:c,private:this.private}]})};try{const g=await this._fetchWithTimeout(this.broadcastEndpointURL,p,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);return await((l=g.body)===null||l===void 0?void 0:l.cancel()),g.ok?"ok":"error"}catch(g){return g instanceof Error&&g.name==="AbortError"?"timed out":"error"}}else return new Promise(u=>{var c,h,p;const g=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((p=(h=(c=this.params)===null||c===void 0?void 0:c.config)===null||h===void 0?void 0:h.broadcast)===null||p===void 0)&&p.ack)&&u("ok"),g.receive("ok",()=>u("ok")),g.receive("error",()=>u("error")),g.receive("timeout",()=>u("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,a){const l=new AbortController,u=setTimeout(()=>l.abort(),a),c=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:l.signal}));return clearTimeout(u),c}_on(e,r,a){const l=e.toLocaleLowerCase(),u=this.channelAdapter.on(e,a),c={type:l,filter:r,callback:a,ref:u};return this.bindings[l]?this.bindings[l].push(c):this.bindings[l]=[c],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,a)=>{var l,u,c,h,p,g,y;const m=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(m,a))return!1;const b=(l=this.bindings[m])===null||l===void 0?void 0:l.find(_=>_.ref===e.ref);if(!b)return!0;if(["broadcast","presence","postgres_changes"].includes(m))if("id"in b){const _=b.id,S=(u=b.filter)===null||u===void 0?void 0:u.event;return _&&((c=r.ids)===null||c===void 0?void 0:c.includes(_))&&(S==="*"||S?.toLocaleLowerCase()===((h=r.data)===null||h===void 0?void 0:h.type.toLocaleLowerCase()))}else{const _=(g=(p=b?.filter)===null||p===void 0?void 0:p.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return _==="*"||_===((y=r?.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return b.type.toLocaleLowerCase()===m})}_notThisChannelEvent(e,r){const{close:a,error:l,leave:u,join:c}=J0;return r&&[a,l,u,c].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,a)=>{if(typeof r=="object"&&"ids"in r){const l=r.data,{schema:u,table:c,commit_timestamp:h,type:p,errors:g}=l;return Object.assign(Object.assign({},{schema:u,table:c,commit_timestamp:h,eventType:p,new:{},old:{},errors:g}),this._getPayloadRecords(l))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const a of e.bindings[r])this._on(a.type,a.filter,a.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Qy(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Qy(e.columns,e.old_record)),r}}class XA{constructor(e,r){this.socket=new GA(e,r)}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,r,a,l=1e4){return new Promise(u=>{setTimeout(()=>u("timeout"),l),this.socket.disconnect(()=>{e(),u("ok")},r,a)})}push(e){this.socket.push(e)}log(e,r,a){this.socket.log(e,r,a)}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()==Sh.connecting}isDisconnecting(){return this.socket.connectionState()==Sh.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Wy={HEARTBEAT_INTERVAL:25e3},ZA=[1e3,2e3,5e3,1e4],WA=1e4;function eO(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function tO(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return eO()}const nO=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class rO{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,r){var a;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new CA,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=u=>u?(...c)=>u(...c):(...c)=>fetch(...c),!(!((a=r?.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const l=this._initializeOptions(r);this.socketAdapter=new XA(e,l),this.httpEndpoint=Z0(e),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}

To 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
  })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async a=>{const l=await a.unsubscribe();return a.teardown(),l}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,a){this.socketAdapter.log(e,r,a)}connectionState(){return this.socketAdapter.connectionState()||Sh.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const a=`realtime:${e}`,l=this.getChannels().find(u=>u.topic===a);if(l)return l;{const u=new ro(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(u),u}}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(r=>r.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 r,a=!1;if(e)r=e,a=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(l){this.log("error","Error fetching access token from callback",l),r=this.accessTokenValue}else r=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(l=>{const u={access_token:r,version:TA};r&&l.updateJoinPayload(u),l.joinedOnce&&l.channelAdapter.isJoined()&&l.channelAdapter.push(J0.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),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(r,a)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,a)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const a=new Blob([nO],{type:"application/javascript"});r=URL.createObjectURL(a)}return r}_initializeOptions(e){var r,a,l,u,c,h,p,g,y,m,b,_;this.worker=(r=e?.worker)!==null&&r!==void 0?r:!1,this.accessToken=(a=e?.accessToken)!==null&&a!==void 0?a:null;const S={};S.timeout=(l=e?.timeout)!==null&&l!==void 0?l:OA,S.heartbeatIntervalMs=(u=e?.heartbeatIntervalMs)!==null&&u!==void 0?u:Wy.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(c=e?.disconnectOnEmptyChannelsAfterMs)!==null&&c!==void 0?c:2*((h=e?.heartbeatIntervalMs)!==null&&h!==void 0?h:Wy.HEARTBEAT_INTERVAL),S.transport=(p=e?.transport)!==null&&p!==void 0?p:SA.getWebSocketConstructor(),S.params=e?.params,S.logger=e?.logger,S.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),S.sessionStorage=(g=e?.sessionStorage)!==null&&g!==void 0?g:tO(),S.reconnectAfterMs=(y=e?.reconnectAfterMs)!==null&&y!==void 0?y:(M=>ZA[M-1]||WA);let O,E;const A=(m=e?.vsn)!==null&&m!==void 0?m:AA;switch(A){case RA:O=(M,j)=>j(JSON.stringify(M)),E=(M,j)=>j(JSON.parse(M));break;case Q0:O=this.serializer.encode.bind(this.serializer),E=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${S.vsn}`)}if(S.vsn=A,S.encode=(b=e?.encode)!==null&&b!==void 0?b:O,S.decode=(_=e?.decode)!==null&&_!==void 0?_:E,S.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,S.params=Object.assign(Object.assign({},S.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e?.workerUrl,S.autoSendHeartbeat=!this.worker}return S}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var co=class extends Error{constructor(t,e){super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&e.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function sO(t,e,r){const a=new URL(e,t);if(r)for(const[l,u]of Object.entries(r))u!==void 0&&a.searchParams.set(l,u);return a.toString()}async function aO(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function iO(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:l,body:u,headers:c}){const h=sO(t.baseUrl,a,l),p=await aO(t.auth),g=await e(h,{method:r,headers:{...u?{"Content-Type":"application/json"}:{},...p,...c},body:u?JSON.stringify(u):void 0}),y=await g.text(),m=(g.headers.get("content-type")||"").includes("application/json"),b=m&&y?JSON.parse(y):y;if(!g.ok){const _=m?b:void 0,S=_?.error;throw new co(S?.message??`Request failed with status ${g.status}`,{status:g.status,icebergType:S?.type,icebergCode:S?.code,details:_})}return{status:g.status,headers:g.headers,data:b}}}}function ql(t){return t.join("")}var oO=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:ql(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ql(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ql(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ql(t.namespace)}`}),!0}catch(e){if(e instanceof co&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof co&&r.status===409)return;throw r}}};function Da(t){return t.join("")}var lO=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String(e?.purge??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Da(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof co&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof co&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},uO=class{constructor(t){let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=iO({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=t.accessDelegation?.join(","),this.namespaceOps=new oO(this.client,e),this.tableOps=new lO(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function fo(t){"@babel/helpers - typeof";return fo=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},fo(t)}function cO(t,e){if(fo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(fo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fO(t){var e=cO(t,"string");return fo(e)=="symbol"?e:e+""}function hO(t,e,r){return(e=fO(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ev(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function he(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ev(Object(r),!0).forEach(function(a){hO(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ev(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}var Ru=class extends Error{constructor(t,e="storage",r,a){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=a}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Au(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Ah=class extends Ru{constructor(t,e,r,a="storage"){super(t,a,e,r),this.name=a==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return he({},super.toJSON())}},eb=class extends Ru{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function cu(t,e,r){const a=he({},t),l=e.toLowerCase();for(const u of Object.keys(a))u.toLowerCase()===l&&delete a[u];return a[l]=r,a}function dO(t){const e={};for(const[r,a]of Object.entries(t))e[r.toLowerCase()]=a;return e}const pO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),gO=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Oh=t=>{if(Array.isArray(t))return t.map(r=>Oh(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,a])=>{const l=r.replace(/([-_][a-z])/gi,u=>u.toUpperCase().replace(/[-_]/g,""));e[l]=Oh(a)}),e},mO=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),tv=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},yO=async(t,e,r,a)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const l=t;let u=parseInt(String(l.status),10);Number.isFinite(u)||(u=500),l.json().then(c=>{const h=c?.statusCode||c?.code||u+"";e(new Ah(tv(c),u,h,a))}).catch(()=>{const c=u+"";e(new Ah(l.statusText||`HTTP ${u} error`,u,c,a))})}else e(new eb(tv(t),t,a))},vO=(t,e,r,a)=>{const l={method:t,headers:e?.headers||{}};if(t==="GET"||t==="HEAD"||!a)return he(he({},l),r);if(gO(a)){var u;const c=e?.headers||{};let h;for(const[p,g]of Object.entries(c))p.toLowerCase()==="content-type"&&(h=g);l.headers=cu(c,"Content-Type",(u=h)!==null&&u!==void 0?u:"application/json"),l.body=JSON.stringify(a)}else l.body=a;return e?.duplex&&(l.duplex=e.duplex),he(he({},l),r)};async function Xi(t,e,r,a,l,u,c){return new Promise((h,p)=>{t(r,vO(e,a,l,u)).then(g=>{if(!g.ok)throw g;if(a?.noResolveJson)return g;if(c==="vectors"){const y=g.headers.get("content-type");if(g.headers.get("content-length")==="0"||g.status===204)return{};if(!y||!y.includes("application/json"))return{}}return g.json()}).then(g=>h(g)).catch(g=>yO(g,p,a,c))})}function tb(t="storage"){return{get:async(e,r,a,l)=>Xi(e,"GET",r,a,l,void 0,t),post:async(e,r,a,l,u)=>Xi(e,"POST",r,l,u,a,t),put:async(e,r,a,l,u)=>Xi(e,"PUT",r,l,u,a,t),head:async(e,r,a,l)=>Xi(e,"HEAD",r,he(he({},a),{},{noResolveJson:!0}),l,void 0,t),remove:async(e,r,a,l,u)=>Xi(e,"DELETE",r,l,u,a,t)}}const bO=tb("storage"),{get:ho,post:On,put:xh,head:_O,remove:Xh}=bO,on=tb("vectors");var Xa=class{constructor(t,e={},r,a="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=dO(e),this.fetch=pO(r),this.namespace=a}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=cu(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Au(r))return{data:null,error:r};throw r}}};let nb;nb=Symbol.toStringTag;var wO=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[nb]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Au(e))return{data:null,error:e};throw e}}};let rb;rb=Symbol.toStringTag;var SO=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[rb]="BlobDownloadBuilder",this.promise=null}asStream(){return new wO(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Au(e))return{data:null,error:e};throw e}}};const EO={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var TO=class extends Xa{constructor(t,e={},r,a){super(t,e,a,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,a){var l=this;return l.handleOperation(async()=>{let u;const c=he(he({},nv),a);let h=he(he({},l.headers),t==="POST"&&{"x-upsert":String(c.upsert)});const p=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),p&&u.append("metadata",l.encodeMetadata(p)),u.append("",r)):typeof FormData<"u"&&r instanceof FormData?(u=r,u.has("cacheControl")||u.append("cacheControl",c.cacheControl),p&&!u.has("metadata")&&u.append("metadata",l.encodeMetadata(p))):(u=r,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType,p&&(h["x-metadata"]=l.toBase64(l.encodeMetadata(p))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!c.duplex&&(c.duplex="half")),a?.headers)for(const[b,_]of Object.entries(a.headers))h=cu(h,b,_);const g=l._removeEmptyFolders(e),y=l._getFinalPath(g),m=await(t=="PUT"?xh:On)(l.fetch,`${l.url}/object/${y}`,u,he({headers:h},c?.duplex?{duplex:c.duplex}:{}));return{path:g,id:m.Id,fullPath:m.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,a){var l=this;const u=l._removeEmptyFolders(t),c=l._getFinalPath(u),h=new URL(l.url+`/object/upload/sign/${c}`);return h.searchParams.set("token",e),l.handleOperation(async()=>{let p;const g=he(he({},nv),a);let y=he(he({},l.headers),{"x-upsert":String(g.upsert)});const m=g.metadata;if(typeof Blob<"u"&&r instanceof Blob?(p=new FormData,p.append("cacheControl",g.cacheControl),m&&p.append("metadata",l.encodeMetadata(m)),p.append("",r)):typeof FormData<"u"&&r instanceof FormData?(p=r,p.has("cacheControl")||p.append("cacheControl",g.cacheControl),m&&!p.has("metadata")&&p.append("metadata",l.encodeMetadata(m))):(p=r,y["cache-control"]=`max-age=${g.cacheControl}`,y["content-type"]=g.contentType,m&&(y["x-metadata"]=l.toBase64(l.encodeMetadata(m))),(typeof ReadableStream<"u"&&p instanceof ReadableStream||p&&typeof p=="object"&&"pipe"in p&&typeof p.pipe=="function")&&!g.duplex&&(g.duplex="half")),a?.headers)for(const[b,_]of Object.entries(a.headers))y=cu(y,b,_);return{path:u,fullPath:(await xh(l.fetch,h.toString(),p,he({headers:y},g?.duplex?{duplex:g.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let a=r._getFinalPath(t);const l=he({},r.headers);e?.upsert&&(l["x-upsert"]="true");const u=await On(r.fetch,`${r.url}/object/upload/sign/${a}`,{},{headers:l}),c=new URL(r.url+u.url),h=c.searchParams.get("token");if(!h)throw new Ru("No token returned by API");return{signedUrl:c.toString(),path:t,token:h}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var a=this;return a.handleOperation(async()=>await On(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:a.headers}))}async copy(t,e,r){var a=this;return a.handleOperation(async()=>({path:(await On(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:a.headers})).Key}))}async createSignedUrl(t,e,r){var a=this;return a.handleOperation(async()=>{let l=a._getFinalPath(t);const u=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let c=await On(a.fetch,`${a.url}/object/sign/${l}`,he({expiresIn:e},u?{transform:r.transform}:{}),{headers:a.headers});const h=new URLSearchParams;r?.download&&h.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&h.set("cacheNonce",String(r.cacheNonce));const p=h.toString();return{signedUrl:encodeURI(`${a.url}${c.signedURL}${p?`&${p}`:""}`)}})}async createSignedUrls(t,e,r){var a=this;return a.handleOperation(async()=>{const l=await On(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:e,paths:t},{headers:a.headers}),u=new URLSearchParams;r?.download&&u.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&u.set("cacheNonce",String(r.cacheNonce));const c=u.toString();return l.map(h=>he(he({},h),{},{signedUrl:h.signedURL?encodeURI(`${a.url}${h.signedURL}${c?`&${c}`:""}`):null}))})}download(t,e,r){const a=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",l=new URLSearchParams;e?.transform&&this.applyTransformOptsToQuery(l,e.transform),e?.cacheNonce!=null&&l.set("cacheNonce",String(e.cacheNonce));const u=l.toString(),c=this._getFinalPath(t),h=()=>ho(this.fetch,`${this.url}/${a}/${c}${u?`?${u}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new SO(h,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>Oh(await ho(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await _O(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(l){if(e.shouldThrowOnError)throw l;if(Au(l)){var a;const u=l instanceof Ah?l.status:l instanceof eb?(a=l.originalError)===null||a===void 0?void 0:a.status:void 0;if(u!==void 0&&[400,404].includes(u))return{data:!1,error:l}}throw l}}getPublicUrl(t,e){const r=this._getFinalPath(t),a=new URLSearchParams;e?.download&&a.set("download",e.download===!0?"":e.download),e?.transform&&this.applyTransformOptsToQuery(a,e.transform),e?.cacheNonce!=null&&a.set("cacheNonce",String(e.cacheNonce));const l=a.toString(),u=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${u}/public/${r}`)+(l?`?${l}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Xh(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var a=this;return a.handleOperation(async()=>{const l=he(he(he({},EO),e),{},{prefix:t||""});return await On(a.fetch,`${a.url}/object/list/${a.bucketId}`,l,{headers:a.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const a=he({},t);return await On(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,a,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const RO="2.106.2",_o={"X-Client-Info":`storage-js/${RO}`};var AO=class extends Xa{constructor(t,e={},r,a){const l=new URL(t);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(l.hostname)&&!l.hostname.includes("storage.supabase.")&&(l.hostname=l.hostname.replace("supabase.","storage.supabase."));const u=l.href.replace(/\/$/,""),c=he(he({},_o),e);super(u,c,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await ho(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await ho(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await On(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await xh(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await On(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Xh(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},OO=class extends Xa{constructor(t,e={},r){const a=t.replace(/\/$/,""),l=he(he({},_o),e);super(a,l,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await On(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;t?.limit!==void 0&&r.set("limit",t.limit.toString()),t?.offset!==void 0&&r.set("offset",t.offset.toString()),t?.sortColumn&&r.set("sortColumn",t.sortColumn),t?.sortOrder&&r.set("sortOrder",t.sortOrder),t?.search&&r.set("search",t.search);const a=r.toString(),l=a?`${e.url}/bucket?${a}`:`${e.url}/bucket`;return await ho(e.fetch,l,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Xh(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!mO(t))throw new Ru("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new uO({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(r,{get(l,u){const c=l[u];return typeof c!="function"?c:async(...h)=>{try{return{data:await c.apply(l,h),error:null}}catch(p){if(a)throw p;return{data:null,error:p}}}}})}},xO=class extends Xa{constructor(t,e={},r){const a=t.replace(/\/$/,""),l=he(he({},_o),{},{"Content-Type":"application/json"},e);super(a,l,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await on.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await on.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},CO=class extends Xa{constructor(t,e={},r){const a=t.replace(/\/$/,""),l=he(he({},_o),{},{"Content-Type":"application/json"},e);super(a,l,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},kO=class extends Xa{constructor(t,e={},r){const a=t.replace(/\/$/,""),l=he(he({},_o),{},{"Content-Type":"application/json"},e);super(a,l,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await on.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},jO=class extends kO{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new MO(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},MO=class extends xO{constructor(t,e,r,a){super(t,e,a),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new NO(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},NO=class extends CO{constructor(t,e,r,a,l){super(t,e,l),this.vectorBucketName=r,this.indexName=a}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,he(he({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},DO=class extends AO{constructor(t,e={},r,a){super(t,e,r,a)}from(t){return new TO(this.url,this.headers,t,this.fetch)}get vectors(){return new jO(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new OO(this.url+"/iceberg",this.headers,this.fetch)}};const sb="2.106.2",Ia=30*1e3,Ch=3,ih=Ch*Ia,LO="http://localhost:9999",UO="supabase.auth.token",PO={"X-Client-Info":`gotrue-js/${sb}`},kh="X-Supabase-Api-Version",ab={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},zO=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,BO=600*1e3;class Ja extends Error{constructor(e,r,a){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function te(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class HO extends Ja{constructor(e,r,a){super(e,r,a),this.name="AuthApiError",this.status=r,this.code=a}}function IO(t){return te(t)&&t.name==="AuthApiError"}class Cn extends Ja{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class vr extends Ja{constructor(e,r,a,l){super(e,a,l),this.name=r,this.status=a}}class mt extends vr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function $l(t){return te(t)&&t.name==="AuthSessionMissingError"}class La extends vr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Gl extends vr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Vl extends vr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function qO(t){return te(t)&&t.name==="AuthImplicitGrantRedirectError"}class rv extends vr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class $O extends vr{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")}}class jh extends vr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function oh(t){return te(t)&&t.name==="AuthRetryableFetchError"}class sv extends vr{constructor(e,r,a){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Mh extends vr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const fu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),av=` 	
\r=`.split(""),GO=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<av.length;e+=1)t[av[e].charCodeAt(0)]=-2;for(let e=0;e<fu.length;e+=1)t[fu[e].charCodeAt(0)]=e;return t})();function iv(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const a=e.queue>>e.queuedBits-6&63;r(fu[a]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const a=e.queue>>e.queuedBits-6&63;r(fu[a]),e.queuedBits-=6}}function ib(t,e,r){const a=GO[t];if(a>-1)for(e.queue=e.queue<<6|a,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function ov(t){const e=[],r=c=>{e.push(String.fromCodePoint(c))},a={utf8seq:0,codepoint:0},l={queue:0,queuedBits:0},u=c=>{YO(c,a,r)};for(let c=0;c<t.length;c+=1)ib(t.charCodeAt(c),l,u);return e.join("")}function VO(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function KO(t,e){for(let r=0;r<t.length;r+=1){let a=t.charCodeAt(r);if(a>55295&&a<=56319){const l=(a-55296)*1024&65535;a=(t.charCodeAt(r+1)-56320&65535|l)+65536,r+=1}VO(a,e)}}function YO(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let a=1;a<6;a+=1)if((t>>7-a&1)===0){e.utf8seq=a;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Fa(t){const e=[],r={queue:0,queuedBits:0},a=l=>{e.push(l)};for(let l=0;l<t.length;l+=1)ib(t.charCodeAt(l),r,a);return new Uint8Array(e)}function FO(t){const e=[];return KO(t,r=>e.push(r)),new Uint8Array(e)}function Us(t){const e=[],r={queue:0,queuedBits:0},a=l=>{e.push(l)};return t.forEach(l=>iv(l,r,a)),iv(null,r,a),e.join("")}function QO(t){return Math.round(Date.now()/1e3)+t}function JO(){return Symbol("auth-callback")}const Rt=()=>typeof window<"u"&&typeof document<"u",Cs={tested:!1,writable:!1},ob=()=>{if(!Rt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Cs.tested)return Cs.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Cs.tested=!0,Cs.writable=!0}catch{Cs.tested=!0,Cs.writable=!1}return Cs.writable};function XO(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((l,u)=>{e[u]=l})}catch{}return r.searchParams.forEach((a,l)=>{e[l]=a}),e}const lb=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),ZO=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",qa=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},ks=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},Tt=async(t,e)=>{await t.removeItem(e)};class Ou{constructor(){this.promise=new Ou.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Ou.promiseConstructor=Promise;function Kl(t){const e=t.split(".");if(e.length!==3)throw new Mh("Invalid JWT structure");for(let a=0;a<e.length;a++)if(!zO.test(e[a]))throw new Mh("JWT not in base64url format");return{header:JSON.parse(ov(e[0])),payload:JSON.parse(ov(e[1])),signature:Fa(e[2]),raw:{header:e[0],payload:e[1]}}}async function WO(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function ex(t,e){return new Promise((a,l)=>{(async()=>{for(let u=0;u<1/0;u++)try{const c=await t(u);if(!e(u,null,c)){a(c);return}}catch(c){if(!e(u,c)){l(c);return}}})()})}function tx(t){return("0"+t.toString(16)).substr(-2)}function nx(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=r.length;let l="";for(let u=0;u<56;u++)l+=r.charAt(Math.floor(Math.random()*a));return l}return crypto.getRandomValues(e),Array.from(e,tx).join("")}async function rx(t){const r=new TextEncoder().encode(t),a=await crypto.subtle.digest("SHA-256",r),l=new Uint8Array(a);return Array.from(l).map(u=>String.fromCharCode(u)).join("")}async function sx(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await rx(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ua(t,e,r=!1){const a=nx();let l=a;r&&(l+="/recovery"),await qa(t,`${e}-code-verifier`,l);const u=await sx(a);return[u,a===u?"plain":"s256"]}const ax=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function ix(t){const e=t.headers.get(kh);if(!e||!e.match(ax))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function ox(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function lx(t){switch(t){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 new Error("Invalid alg claim")}}const ux=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function hr(t){if(!ux.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function An(t){if(!t.passkey)throw new 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 lh(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function cx(t,e){return new Proxy(t,{get:(r,a,l)=>{if(a==="__isInsecureUserWarningProxy")return!0;if(typeof a=="symbol"){const u=a.toString();if(u==="Symbol(Symbol.toPrimitive)"||u==="Symbol(Symbol.toStringTag)"||u==="Symbol(util.inspect.custom)"||u==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,a,l)}return!e.value&&typeof a=="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."),e.value=!0),Reflect.get(r,a,l)}})}function lv(t){return JSON.parse(JSON.stringify(t))}const js=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},fx=[502,503,504,520,521,522,523,524,530];async function uv(t){var e;if(!ZO(t))throw new jh(js(t),0);if(fx.includes(t.status))throw new jh(js(t),t.status);let r;try{r=await t.json()}catch(u){throw new Cn(js(u),u)}let a;const l=ix(t);if(l&&l.getTime()>=ab["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?a=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(a=r.error_code),a){if(a==="weak_password")throw new sv(js(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(a==="session_not_found")throw new mt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((u,c)=>u&&typeof c=="string",!0))throw new sv(js(r),t.status,r.weak_password.reasons);throw new HO(js(r),t.status||500,a)}const hx=(t,e,r,a)=>{const l={method:t,headers:e?.headers||{}};return t==="GET"?l:(l.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),l.body=JSON.stringify(a),Object.assign(Object.assign({},l),r))};async function se(t,e,r,a){var l;const u=Object.assign({},a?.headers);u[kh]||(u[kh]=ab["2024-01-01"].name),a?.jwt&&(u.Authorization=`Bearer ${a.jwt}`);const c=(l=a?.query)!==null&&l!==void 0?l:{};a?.redirectTo&&(c.redirect_to=a.redirectTo);const h=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",p=await dx(t,e,r+h,{headers:u,noResolveJson:a?.noResolveJson},{},a?.body);return a?.xform?a?.xform(p):{data:Object.assign({},p),error:null}}async function dx(t,e,r,a,l,u){const c=hx(e,a,l,u);let h;try{h=await t(r,Object.assign({},c))}catch(p){throw console.error(p),new jh(js(p),0)}if(h.ok||await uv(h),a?.noResolveJson)return h;try{return await h.json()}catch(p){await uv(p)}}function _n(t){var e;let r=null;mx(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=QO(t.expires_in)));const a=(e=t.user)!==null&&e!==void 0?e:typeof t?.id=="string"?t:null;return{data:{session:r,user:a},error:null}}function cv(t){const e=_n(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,a)=>r&&typeof a=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Qr(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function px(t){return{data:t,error:null}}function gx(t){const{action_link:e,email_otp:r,hashed_token:a,redirect_to:l,verification_type:u}=t,c=Tu(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),h={action_link:e,email_otp:r,hashed_token:a,redirect_to:l,verification_type:u},p=Object.assign({},c);return{data:{properties:h,user:p},error:null}}function fv(t){return t}function mx(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const uh=["global","local","others"];class yx{_encodePathSegment(e){if(e==="."||e==="..")throw new Ja("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:r={},fetch:a,experimental:l}){this.url=e,this.headers=r,this.fetch=lb(a),this.experimental=l??{},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,r=uh[0]){if(uh.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${uh.join(", ")}`);try{return await se(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(a){if(te(a))return{data:null,error:a};throw a}}async inviteUserByEmail(e,r={}){try{return await se(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Qr})}catch(a){if(te(a))return{data:{user:null},error:a};throw a}}async generateLink(e){try{const{options:r}=e,a=Tu(e,["options"]),l=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(l.new_email=a?.newEmail,delete l.newEmail),await se(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:l,headers:this.headers,xform:gx,redirectTo:r?.redirectTo})}catch(r){if(te(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await se(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Qr})}catch(r){if(te(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,a,l,u,c,h,p;try{const g={nextPage:null,lastPage:0,total:0},y=await se(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(u=(l=e?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:fv});if(y.error)throw y.error;const m=await y.json(),b=(c=y.headers.get("x-total-count"))!==null&&c!==void 0?c:0,_=(p=(h=y.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&p!==void 0?p:[];return _.length>0&&(_.forEach(S=>{const O=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),E=JSON.parse(S.split(";")[1].split("=")[1]);g[`${E}Page`]=O}),g.total=parseInt(b)),{data:Object.assign(Object.assign({},m),g),error:null}}catch(g){if(te(g))return{data:{users:[]},error:g};throw g}}async getUserById(e){hr(e);try{return await se(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Qr})}catch(r){if(te(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){hr(e);try{return await se(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Qr})}catch(a){if(te(a))return{data:{user:null},error:a};throw a}}async deleteUser(e,r=!1){hr(e);try{return await se(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Qr})}catch(a){if(te(a))return{data:{user:null},error:a};throw a}}async _listFactors(e){hr(e.userId);try{const{data:r,error:a}=await se(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:l=>({data:{factors:l},error:null})});return{data:r,error:a}}catch(r){if(te(r))return{data:null,error:r};throw r}}async _deleteFactor(e){hr(e.userId),hr(e.id);try{return{data:await se(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(te(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,a,l,u,c,h,p;try{const g={nextPage:null,lastPage:0,total:0},y=await se(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(u=(l=e?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:fv});if(y.error)throw y.error;const m=await y.json(),b=(c=y.headers.get("x-total-count"))!==null&&c!==void 0?c:0,_=(p=(h=y.headers.get("link"))===null||h===void 0?void 0:h.split(","))!==null&&p!==void 0?p:[];return _.length>0&&(_.forEach(S=>{const O=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),E=JSON.parse(S.split(";")[1].split("=")[1]);g[`${E}Page`]=O}),g.total=parseInt(b)),{data:Object.assign(Object.assign({},m),g),error:null}}catch(g){if(te(g))return{data:{clients:[]},error:g};throw g}}async _createOAuthClient(e){try{return await se(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{const r=this._encodePathSegment(e);return await se(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{const a=this._encodePathSegment(e);return await se(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${a}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(a){if(te(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(e){try{const r=this._encodePathSegment(e);return await se(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(te(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{const r=this._encodePathSegment(e);return await se(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e?.type&&(r.type=e.type),await se(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:a=>{var l;return{data:{providers:(l=a?.providers)!==null&&l!==void 0?l:[]},error:null}}})}catch(r){if(te(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await se(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{const r=this._encodePathSegment(e);return await se(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{const a=this._encodePathSegment(e);return await se(this.fetch,"PUT",`${this.url}/admin/custom-providers/${a}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(a){if(te(a))return{data:null,error:a};throw a}}async _deleteCustomProvider(e){try{const r=this._encodePathSegment(e);return await se(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(te(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){An(this.experimental),hr(e.userId);try{return await se(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(te(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){An(this.experimental),hr(e.userId),hr(e.passkeyId);try{return await se(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(te(r))return{data:null,error:r};throw r}}}function hv(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const zn={debug:!!(globalThis&&ob()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class ub extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class dv extends ub{}async function vx(t,e,r){zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const a=new globalThis.AbortController;let l;e>0&&(l=setTimeout(()=>{a.abort(),zn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async u=>{if(u){clearTimeout(l),zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,u.name);try{return await r()}finally{zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,u.name)}}else{if(e===0)throw zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new dv(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(zn.debug)try{const c=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(c,null,"  "))}catch(c){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",c)}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(l),await r()}})}catch(u){if(e>0&&clearTimeout(l),u!==null&&typeof u=="object"&&"name"in u&&u.name==="AbortError"&&e>0){if(a.signal.aborted)return zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}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(t,{mode:"exclusive",steal:!0},async c=>{if(c){zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,c.name);try{return await r()}finally{zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,c.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw zn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new dv(`Lock "${t}" was released because another request stole it`)}throw u}}function bx(){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 cb(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function _x(t){return parseInt(t,16)}function wx(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,a=>a.toString(16).padStart(2,"0")).join("")}function Sx(t){var e;const{chainId:r,domain:a,expirationTime:l,issuedAt:u=new Date,nonce:c,notBefore:h,requestId:p,resources:g,scheme:y,uri:m,version:b}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(c&&c.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${c}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(b!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${b}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const _=cb(t.address),S=y?`${y}://${a}`:a,O=t.statement?`${t.statement}
`:"",E=`${S} wants you to sign in with your Ethereum account:
${_}

${O}`;let A=`URI: ${m}
Version: ${b}
Chain ID: ${r}${c?`
Nonce: ${c}`:""}
Issued At: ${u.toISOString()}`;if(l&&(A+=`
Expiration Time: ${l.toISOString()}`),h&&(A+=`
Not Before: ${h.toISOString()}`),p&&(A+=`
Request ID: ${p}`),g){let M=`
Resources:`;for(const j of g){if(!j||typeof j!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${j}`);M+=`
- ${j}`}A+=M}return`${E}
${A}`}class it extends Error{constructor({message:e,code:r,cause:a,name:l}){var u;super(e,{cause:a}),this.__isWebAuthnError=!0,this.name=(u=l??(a instanceof Error?a.name:void 0))!==null&&u!==void 0?u:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class hu extends it{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function Ex({error:t,options:e}){var r,a,l;const{publicKey:u}=e;if(!u)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new it({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=u.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new it({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((a=u.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new it({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((l=u.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new it({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new it({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new it({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return u.pubKeyCredParams.filter(h=>h.type==="public-key").length===0?new it({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new it({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const c=window.location.hostname;if(fb(c)){if(u.rp.id!==c)return new it({message:`The RP ID "${u.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(u.user.id.byteLength<1||u.user.id.byteLength>64)return new it({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Tx({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new it({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new it({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(fb(a)){if(r.rpId!==a)return new it({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new it({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new it({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new it({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Rx{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Nh=new Rx;function pv(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:a}=t,l=Tu(t,["challenge","user","excludeCredentials"]),u=Fa(e).buffer,c=Object.assign(Object.assign({},r),{id:Fa(r.id).buffer}),h=Object.assign(Object.assign({},l),{challenge:u,user:c});if(a&&a.length>0){h.excludeCredentials=new Array(a.length);for(let p=0;p<a.length;p++){const g=a[p];h.excludeCredentials[p]=Object.assign(Object.assign({},g),{id:Fa(g.id).buffer,type:g.type||"public-key",transports:g.transports})}}return h}function gv(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,a=Tu(t,["challenge","allowCredentials"]),l=Fa(e).buffer,u=Object.assign(Object.assign({},a),{challenge:l});if(r&&r.length>0){u.allowCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const h=r[c];u.allowCredentials[c]=Object.assign(Object.assign({},h),{id:Fa(h.id).buffer,type:h.type||"public-key",transports:h.transports})}}return u}function mv(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:Us(new Uint8Array(t.response.attestationObject)),clientDataJSON:Us(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function yv(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,a=t.getClientExtensionResults(),l=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Us(new Uint8Array(l.authenticatorData)),clientDataJSON:Us(new Uint8Array(l.clientDataJSON)),signature:Us(new Uint8Array(l.signature)),userHandle:l.userHandle?Us(new Uint8Array(l.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function fb(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function du(){var t,e;return!!(Rt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.get)=="function")}async function hb(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new hu("Browser returned unexpected credential type",e)}:{data:null,error:new hu("Empty credential response",e)}}catch(e){return{data:null,error:Ex({error:e,options:t})}}}async function db(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new hu("Browser returned unexpected credential type",e)}:{data:null,error:new hu("Empty credential response",e)}}catch(e){return{data:null,error:Tx({error:e,options:t})}}}const Ax={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Ox={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function pu(...t){const e=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),r=l=>l instanceof ArrayBuffer||ArrayBuffer.isView(l),a={};for(const l of t)if(l)for(const u in l){const c=l[u];if(c!==void 0)if(Array.isArray(c))a[u]=c;else if(r(c))a[u]=c;else if(e(c)){const h=a[u];e(h)?a[u]=pu(h,c):a[u]=pu(c)}else a[u]=c}return a}function xx(t,e){return pu(Ax,t,e||{})}function Cx(t,e){return pu(Ox,t,e||{})}class kx{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:r,friendlyName:a,signal:l},u){var c;try{const{data:h,error:p}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!h)return{data:null,error:p};const g=l??Nh.createNewAbortSignal();if(h.webauthn.type==="create"){const{user:y}=h.webauthn.credential_options.publicKey;if(!y.name){const m=a;if(m)y.name=`${y.id}:${m}`;else{const _=(await this.client.getUser()).data.user,S=((c=_?.user_metadata)===null||c===void 0?void 0:c.name)||_?.email||_?.id||"User";y.name=`${y.id}:${S}`}}y.displayName||(y.displayName=y.name)}switch(h.webauthn.type){case"create":{const y=xx(h.webauthn.credential_options.publicKey,u?.create),{data:m,error:b}=await hb({publicKey:y,signal:g});return m?{data:{factorId:e,challengeId:h.id,webauthn:{type:h.webauthn.type,credential_response:m}},error:null}:{data:null,error:b}}case"request":{const y=Cx(h.webauthn.credential_options.publicKey,u?.request),{data:m,error:b}=await db(Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:y,signal:g}));return m?{data:{factorId:e,challengeId:h.id,webauthn:{type:h.webauthn.type,credential_response:m}},error:null}:{data:null,error:b}}}}catch(h){return te(h)?{data:null,error:h}:{data:null,error:new Cn("Unexpected error in challenge",h)}}}async _verify({challengeId:e,factorId:r,webauthn:a}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:a})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!r)return{data:null,error:new Ja("rpId is required for WebAuthn authentication")};try{if(!du())return{data:null,error:new Cn("Browser does not support WebAuthn",null)};const{data:c,error:h}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:a},signal:l},{request:u});if(!c)return{data:null,error:h};const{webauthn:p}=c;return this._verify({factorId:e,challengeId:c.challengeId,webauthn:{type:p.type,rpId:r,rpOrigins:a,credential_response:p.credential_response}})}catch(c){return te(c)?{data:null,error:c}:{data:null,error:new Cn("Unexpected error in authenticate",c)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!r)return{data:null,error:new Ja("rpId is required for WebAuthn registration")};try{if(!du())return{data:null,error:new Cn("Browser does not support WebAuthn",null)};const{data:c,error:h}=await this._enroll({friendlyName:e});if(!c)return await this.client.mfa.listFactors().then(y=>{var m;return(m=y.data)===null||m===void 0?void 0:m.all.find(b=>b.factor_type==="webauthn"&&b.friendly_name===e&&b.status!=="unverified")}).then(y=>y?this.client.mfa.unenroll({factorId:y?.id}):void 0),{data:null,error:h};const{data:p,error:g}=await this._challenge({factorId:c.id,friendlyName:c.friendly_name,webauthn:{rpId:r,rpOrigins:a},signal:l},{create:u});return p?this._verify({factorId:c.id,challengeId:p.challengeId,webauthn:{rpId:r,rpOrigins:a,type:p.webauthn.type,credential_response:p.webauthn.credential_response}}):{data:null,error:g}}catch(c){return te(c)?{data:null,error:c}:{data:null,error:new Cn("Unexpected error in register",c)}}}}bx();const jx={url:LO,storageKey:UO,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:PO,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function vv(t,e,r){return await r()}const Pa={};class po{get jwks(){var e,r;return(r=(e=Pa[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Pa[this.storageKey]=Object.assign(Object.assign({},Pa[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Pa[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Pa[this.storageKey]=Object.assign(Object.assign({},Pa[this.storageKey]),{cachedAt:e})}constructor(e){var r,a,l,u;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;const c=Object.assign(Object.assign({},jx),e);if(this.storageKey=c.storageKey,this.instanceID=(r=po.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,po.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&Rt()){const h=`${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(h),this.logDebugMessages&&console.trace(h)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.experimental=(a=c.experimental)!==null&&a!==void 0?a:{},this.admin=new yx({url:c.url,headers:c.headers,fetch:c.fetch,experimental:this.experimental}),this.url=c.url,this.headers=c.headers,this.fetch=lb(c.fetch),this.lock=c.lock||vv,this.detectSessionInUrl=c.detectSessionInUrl,this.flowType=c.flowType,this.hasCustomAuthorizationHeader=c.hasCustomAuthorizationHeader,this.throwOnError=c.throwOnError,this.lockAcquireTimeout=c.lockAcquireTimeout,c.lock?this.lock=c.lock:this.persistSession&&Rt()&&(!((l=globalThis?.navigator)===null||l===void 0)&&l.locks)?this.lock=vx:this.lock=vv,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),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 kx(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?(c.storage?this.storage=c.storage:ob()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=hv(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=hv(this.memoryStorage)),Rt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(h){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",h)}(u=this.broadcastChannel)===null||u===void 0||u.addEventListener("message",async h=>{this._debug("received broadcast notification from other tab or client",h);try{await this._notifyAllSubscribers(h.data.event,h.data.session,!1)}catch(p){this._debug("#broadcastChannel","error",p)}})}c.skipAutoInitialize||this.initialize().catch(h=>{this._debug("#initialize()","error",h)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${sb}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},a="none";if(Rt()&&(r=XO(window.location.href),this._isImplicitGrantCallback(r)?a="implicit":await this._isPKCECallback(r)&&(a="pkce")),Rt()&&this.detectSessionInUrl&&a!=="none"){const{data:l,error:u}=await this._getSessionFromURL(r,a);if(u){if(this._debug("#_initialize()","error detecting session from URL",u),qO(u)){const p=(e=u.details)===null||e===void 0?void 0:e.code;if(p==="identity_already_exists"||p==="identity_not_found"||p==="single_identity_not_deletable")return{error:u}}return{error:u}}const{session:c,redirectType:h}=l;return this._debug("#_initialize()","detected session in URL",c,"redirect type",h),await this._saveSession(c),setTimeout(async()=>{h==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return te(r)?this._returnResult({error:r}):this._returnResult({error:new Cn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,a,l;try{const u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(l=e?.options)===null||l===void 0?void 0:l.captchaToken}},xform:_n}),{data:c,error:h}=u;if(h||!c)return this._returnResult({data:{user:null,session:null},error:h});const p=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(u){if(te(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signUp(e){var r,a,l;try{let u;if("email"in e){const{email:y,password:m,options:b}=e;let _=null,S=null;this.flowType==="pkce"&&([_,S]=await Ua(this.storage,this.storageKey)),u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:b?.emailRedirectTo,body:{email:y,password:m,data:(r=b?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:b?.captchaToken},code_challenge:_,code_challenge_method:S},xform:_n})}else if("phone"in e){const{phone:y,password:m,options:b}=e;u=await se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:y,password:m,data:(a=b?.data)!==null&&a!==void 0?a:{},channel:(l=b?.channel)!==null&&l!==void 0?l:"sms",gotrue_meta_security:{captcha_token:b?.captchaToken}},xform:_n})}else throw new Gl("You must provide either an email or phone number and a password");const{data:c,error:h}=u;if(h||!c)return await Tt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:h});const p=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(u){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithPassword(e){try{let r;if("email"in e){const{email:u,password:c,options:h}=e;r=await se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:u,password:c,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:cv})}else if("phone"in e){const{phone:u,password:c,options:h}=e;r=await se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:u,password:c,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:cv})}else throw new Gl("You must provide either an email or phone number and a password");const{data:a,error:l}=r;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a||!a.session||!a.user){const u=new La;return this._returnResult({data:{user:null,session:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:l})}catch(r){if(te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,a,l,u;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:(u=e.options)===null||u===void 0?void 0:u.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,a,l,u,c,h,p,g,y,m,b;let _,S;if("message"in e)_=e.message,S=e.signature;else{const{chain:O,wallet:E,statement:A,options:M}=e;let j;if(Rt())if(typeof E=="object")j=E;else{const W=window;if("ethereum"in W&&typeof W.ethereum=="object"&&"request"in W.ethereum&&typeof W.ethereum.request=="function")j=W.ethereum;else throw new 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.")}else{if(typeof E!="object"||!M?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=E}const D=new URL((r=M?.url)!==null&&r!==void 0?r:window.location.href),X=await j.request({method:"eth_requestAccounts"}).then(W=>W).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!X||X.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const K=cb(X[0]);let H=(a=M?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!H){const W=await j.request({method:"eth_chainId"});H=_x(W)}const Y={domain:D.host,address:K,statement:A,uri:D.href,version:"1",chainId:H,nonce:(l=M?.signInWithEthereum)===null||l===void 0?void 0:l.nonce,issuedAt:(c=(u=M?.signInWithEthereum)===null||u===void 0?void 0:u.issuedAt)!==null&&c!==void 0?c:new Date,expirationTime:(h=M?.signInWithEthereum)===null||h===void 0?void 0:h.expirationTime,notBefore:(p=M?.signInWithEthereum)===null||p===void 0?void 0:p.notBefore,requestId:(g=M?.signInWithEthereum)===null||g===void 0?void 0:g.requestId,resources:(y=M?.signInWithEthereum)===null||y===void 0?void 0:y.resources};_=Sx(Y),S=await j.request({method:"personal_sign",params:[wx(_),K]})}try{const{data:O,error:E}=await se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:_,signature:S},!((m=e.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(b=e.options)===null||b===void 0?void 0:b.captchaToken}}:null),xform:_n});if(E)throw E;if(!O||!O.session||!O.user){const A=new La;return this._returnResult({data:{user:null,session:null},error:A})}return O.session&&(await this._saveSession(O.session),await this._notifyAllSubscribers("SIGNED_IN",O.session)),this._returnResult({data:Object.assign({},O),error:E})}catch(O){if(te(O))return this._returnResult({data:{user:null,session:null},error:O});throw O}}async signInWithSolana(e){var r,a,l,u,c,h,p,g,y,m,b,_;let S,O;if("message"in e)S=e.message,O=e.signature;else{const{chain:E,wallet:A,statement:M,options:j}=e;let D;if(Rt())if(typeof A=="object")D=A;else{const K=window;if("solana"in K&&typeof K.solana=="object"&&("signIn"in K.solana&&typeof K.solana.signIn=="function"||"signMessage"in K.solana&&typeof K.solana.signMessage=="function"))D=K.solana;else throw new 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.")}else{if(typeof A!="object"||!j?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");D=A}const X=new URL((r=j?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in D&&D.signIn){const K=await D.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},j?.signInWithSolana),{version:"1",domain:X.host,uri:X.href}),M?{statement:M}:null));let H;if(Array.isArray(K)&&K[0]&&typeof K[0]=="object")H=K[0];else if(K&&typeof K=="object"&&"signedMessage"in K&&"signature"in K)H=K;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in H&&"signature"in H&&(typeof H.signedMessage=="string"||H.signedMessage instanceof Uint8Array)&&H.signature instanceof Uint8Array)S=typeof H.signedMessage=="string"?H.signedMessage:new TextDecoder().decode(H.signedMessage),O=H.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in D)||typeof D.signMessage!="function"||!("publicKey"in D)||typeof D!="object"||!D.publicKey||!("toBase58"in D.publicKey)||typeof D.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");S=[`${X.host} wants you to sign in with your Solana account:`,D.publicKey.toBase58(),...M?["",M,""]:[""],"Version: 1",`URI: ${X.href}`,`Issued At: ${(l=(a=j?.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&l!==void 0?l:new Date().toISOString()}`,...!((u=j?.signInWithSolana)===null||u===void 0)&&u.notBefore?[`Not Before: ${j.signInWithSolana.notBefore}`]:[],...!((c=j?.signInWithSolana)===null||c===void 0)&&c.expirationTime?[`Expiration Time: ${j.signInWithSolana.expirationTime}`]:[],...!((h=j?.signInWithSolana)===null||h===void 0)&&h.chainId?[`Chain ID: ${j.signInWithSolana.chainId}`]:[],...!((p=j?.signInWithSolana)===null||p===void 0)&&p.nonce?[`Nonce: ${j.signInWithSolana.nonce}`]:[],...!((g=j?.signInWithSolana)===null||g===void 0)&&g.requestId?[`Request ID: ${j.signInWithSolana.requestId}`]:[],...!((m=(y=j?.signInWithSolana)===null||y===void 0?void 0:y.resources)===null||m===void 0)&&m.length?["Resources",...j.signInWithSolana.resources.map(H=>`- ${H}`)]:[]].join(`
`);const K=await D.signMessage(new TextEncoder().encode(S),"utf8");if(!K||!(K instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");O=K}}try{const{data:E,error:A}=await se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:S,signature:Us(O)},!((b=e.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(_=e.options)===null||_===void 0?void 0:_.captchaToken}}:null),xform:_n});if(A)throw A;if(!E||!E.session||!E.user){const M=new La;return this._returnResult({data:{user:null,session:null},error:M})}return E.session&&(await this._saveSession(E.session),await this._notifyAllSubscribers("SIGNED_IN",E.session)),this._returnResult({data:Object.assign({},E),error:A})}catch(E){if(te(E))return this._returnResult({data:{user:null,session:null},error:E});throw E}}async _exchangeCodeForSession(e){const r=await ks(this.storage,`${this.storageKey}-code-verifier`),[a,l]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new $O;const{data:u,error:c}=await se(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:a},xform:_n});if(await Tt(this.storage,`${this.storageKey}-code-verifier`),c)throw c;if(!u||!u.session||!u.user){const h=new La;return this._returnResult({data:{user:null,session:null,redirectType:null},error:h})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers(l==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:l??null}),error:c})}catch(u){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(e){try{const{options:r,provider:a,token:l,access_token:u,nonce:c}=e,h=await se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:l,access_token:u,nonce:c,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:_n}),{data:p,error:g}=h;if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!p||!p.session||!p.user){const y=new La;return this._returnResult({data:{user:null,session:null},error:y})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:p,error:g})}catch(r){if(te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,a,l,u,c;try{if("email"in e){const{email:h,options:p}=e;let g=null,y=null;this.flowType==="pkce"&&([g,y]=await Ua(this.storage,this.storageKey));const{error:m}=await se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:h,data:(r=p?.data)!==null&&r!==void 0?r:{},create_user:(a=p?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},code_challenge:g,code_challenge_method:y},redirectTo:p?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in e){const{phone:h,options:p}=e,{data:g,error:y}=await se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:h,data:(l=p?.data)!==null&&l!==void 0?l:{},create_user:(u=p?.shouldCreateUser)!==null&&u!==void 0?u:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},channel:(c=p?.channel)!==null&&c!==void 0?c:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:g?.message_id},error:y})}throw new Gl("You must provide either an email or phone number.")}catch(h){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(h))return this._returnResult({data:{user:null,session:null},error:h});throw h}}async verifyOtp(e){var r,a;try{let l,u;"options"in e&&(l=(r=e.options)===null||r===void 0?void 0:r.redirectTo,u=(a=e.options)===null||a===void 0?void 0:a.captchaToken);const{data:c,error:h}=await se(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:u}}),redirectTo:l,xform:_n});if(h)throw h;if(!c)throw new Error("An error occurred on token verification.");const p=c.session,g=c.user;return p?.access_token&&(await this._saveSession(p),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",p)),this._returnResult({data:{user:g,session:p},error:null})}catch(l){if(te(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async signInWithSSO(e){var r,a,l,u,c;try{let h=null,p=null;this.flowType==="pkce"&&([h,p]=await Ua(this.storage,this.storageKey));const g=await se(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:(a=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&a!==void 0?a:void 0}),!((l=e?.options)===null||l===void 0)&&l.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:h,code_challenge_method:p}),headers:this.headers,xform:px});return!((u=g.data)===null||u===void 0)&&u.url&&Rt()&&!(!((c=e.options)===null||c===void 0)&&c.skipBrowserRedirect)&&window.location.assign(g.data.url),this._returnResult(g)}catch(h){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(h))return this._returnResult({data:null,error:h});throw h}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:a}=e;if(a)throw a;if(!r)throw new mt;const{error:l}=await se(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:l})})}catch(e){if(te(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:a,type:l,options:u}=e,{error:c}=await se(this.fetch,"POST",r,{headers:this.headers,body:{email:a,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in e){const{phone:a,type:l,options:u}=e,{data:c,error:h}=await se(this.fetch,"POST",r,{headers:this.headers,body:{phone:a,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:h})}throw new Gl("You must provide either an email or phone number and a type")}catch(r){if(te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),l=(async()=>(await a,await r()))();return this.pendingInLock.push((async()=>{try{await l}catch{}})()),l}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const a=r();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){const l=[...this.pendingInLock];await Promise.all(l),this.pendingInLock.splice(0,l.length)}return await a}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{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await ks(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const a=e.expires_at?e.expires_at*1e3-Date.now()<ih:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",e.expires_at),!a){if(this.userStorage){const c=await ks(this.userStorage,this.storageKey+"-user");c?.user?e.user=c.user:e.user=lh()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const c={value:this.suppressGetSessionWarning};e.user=cx(e.user,c),c.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:l,error:u}=await this._callRefreshToken(e.refresh_token);return u?this._returnResult({data:{session:null},error:u}):this._returnResult({data:{session:l},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Qr}):await this._useSession(async r=>{var a,l,u;const{data:c,error:h}=r;if(h)throw h;return!(!((a=c.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new mt}:await se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(u=(l=c.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0,xform:Qr})})}catch(r){if(te(r))return $l(r)&&(await this._removeSession(),await Tt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async a=>{const{data:l,error:u}=a;if(u)throw u;if(!l.session)throw new mt;const c=l.session;let h=null,p=null;this.flowType==="pkce"&&e.email!=null&&([h,p]=await Ua(this.storage,this.storageKey));const{data:g,error:y}=await se(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:h,code_challenge_method:p}),jwt:c.access_token,xform:Qr});if(y)throw y;return c.user=g.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),this._returnResult({data:{user:c.user},error:null})})}catch(a){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(a))return this._returnResult({data:{user:null},error:a});throw a}}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 mt;const r=Date.now()/1e3;let a=r,l=!0,u=null;const{payload:c}=Kl(e.access_token);if(c.exp&&(a=c.exp,l=a<=r),l){const{data:h,error:p}=await this._callRefreshToken(e.refresh_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!h)return{data:{user:null,session:null},error:null};u=h}else{const{data:h,error:p}=await this._getUser(e.access_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});u={access_token:e.access_token,refresh_token:e.refresh_token,user:h.user,token_type:"bearer",expires_in:a-r,expires_at:a},await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)}return this._returnResult({data:{user:u.user,session:u},error:null})}catch(r){if(te(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}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 r=>{var a;if(!e){const{data:c,error:h}=r;if(h)throw h;e=(a=c.session)!==null&&a!==void 0?a:void 0}if(!e?.refresh_token)throw new mt;const{data:l,error:u}=await this._callRefreshToken(e.refresh_token);return u?this._returnResult({data:{user:null,session:null},error:u}):l?this._returnResult({data:{user:l.user,session:l},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(te(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var a;try{if(!Rt())throw new Vl("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Vl(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new rv("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Vl("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new rv("No code detected.");const{data:j,error:D}=await this._exchangeCodeForSession(e.code);if(D)throw D;const X=new URL(window.location.href);return X.searchParams.delete("code"),window.history.replaceState(window.history.state,"",X.toString()),{data:{session:j.session,redirectType:(a=j.redirectType)!==null&&a!==void 0?a:null},error:null}}const{provider_token:l,provider_refresh_token:u,access_token:c,refresh_token:h,expires_in:p,expires_at:g,token_type:y}=e;if(!c||!p||!h||!y)throw new Vl("No session defined in URL");const m=Math.round(Date.now()/1e3),b=parseInt(p);let _=m+b;g&&(_=parseInt(g));const S=_-m;S*1e3<=Ia&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${S}s, should have been closer to ${b}s`);const O=_-b;m-O>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",O,_,m):m-O<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",O,_,m);const{data:E,error:A}=await this._getUser(c);if(A)throw A;const M={provider_token:l,provider_refresh_token:u,access_token:c,expires_in:b,expires_at:_,refresh_token:h,token_type:y,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:M,redirectType:e.type},error:null})}catch(l){if(te(l))return this._returnResult({data:{session:null,redirectType:null},error:l});throw l}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await ks(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}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 r=>{var a;const{data:l,error:u}=r;if(u&&!$l(u))return this._returnResult({error:u});const c=(a=l.session)===null||a===void 0?void 0:a.access_token;if(c){const{error:h}=await this.admin.signOut(c,e);if(h&&!(IO(h)&&(h.status===404||h.status===401||h.status===403)||$l(h)))return this._returnResult({error:h})}return e!=="others"&&(await this._removeSession(),await Tt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=JO(),a={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:a}}}async _emitInitialSession(e){return await this._useSession(async r=>{var a,l;try{const{data:{session:u},error:c}=r;if(c)throw c;await((a=this.stateChangeEmitters.get(e))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",u)),this._debug("INITIAL_SESSION","callback id",e,"session",u)}catch(u){await((l=this.stateChangeEmitters.get(e))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",u),$l(u)?console.warn(u):console.error(u)}})}async resetPasswordForEmail(e,r={}){let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Ua(this.storage,this.storageKey,!0));try{return await se(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:a,code_challenge_method:l,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(u){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(u))return this._returnResult({data:null,error:u});throw u}}async getUserIdentities(){var e;try{const{data:r,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:a,error:l}=await this._useSession(async u=>{var c,h,p,g,y;const{data:m,error:b}=u;if(b)throw b;const _=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(c=e.options)===null||c===void 0?void 0:c.redirectTo,scopes:(h=e.options)===null||h===void 0?void 0:h.scopes,queryParams:(p=e.options)===null||p===void 0?void 0:p.queryParams,skipBrowserRedirect:!0});return await se(this.fetch,"GET",_,{headers:this.headers,jwt:(y=(g=m.session)===null||g===void 0?void 0:g.access_token)!==null&&y!==void 0?y:void 0})});if(l)throw l;return Rt()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(a?.url),this._returnResult({data:{provider:e.provider,url:a?.url},error:null})}catch(a){if(te(a))return this._returnResult({data:{provider:e.provider,url:null},error:a});throw a}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var a;try{const{error:l,data:{session:u}}=r;if(l)throw l;const{options:c,provider:h,token:p,access_token:g,nonce:y}=e,m=await se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=u?.access_token)!==null&&a!==void 0?a:void 0,body:{provider:h,id_token:p,access_token:g,nonce:y,link_identity:!0,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:_n}),{data:b,error:_}=m;return _?this._returnResult({data:{user:null,session:null},error:_}):!b||!b.session||!b.user?this._returnResult({data:{user:null,session:null},error:new La}):(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("USER_UPDATED",b.session)),this._returnResult({data:b,error:_}))}catch(l){if(await Tt(this.storage,`${this.storageKey}-code-verifier`),te(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var a,l;const{data:u,error:c}=r;if(c)throw c;return await se(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(l=(a=u.session)===null||a===void 0?void 0:a.access_token)!==null&&l!==void 0?l:void 0})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const a=Date.now();return await ex(async l=>(l>0&&await WO(200*Math.pow(2,l-1)),this._debug(r,"refreshing attempt",l),await se(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:_n})),(l,u)=>{const c=200*Math.pow(2,l);return u&&oh(u)&&Date.now()+c-a<Ia})}catch(a){if(this._debug(r,"error",a),te(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const a=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",a),Rt()&&!r.skipBrowserRedirect&&window.location.assign(a),{data:{provider:e,url:a},error:null}}async _recoverAndRefresh(){var e,r;const a="#_recoverAndRefresh()";this._debug(a,"begin");try{const l=await ks(this.storage,this.storageKey);if(l&&this.userStorage){let c=await ks(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!c&&(c={user:l.user},await qa(this.userStorage,this.storageKey+"-user",c)),l.user=(e=c?.user)!==null&&e!==void 0?e:lh()}else if(l&&!l.user&&!l.user){const c=await ks(this.storage,this.storageKey+"-user");c&&c?.user?(l.user=c.user,await Tt(this.storage,this.storageKey+"-user"),await qa(this.storage,this.storageKey,l)):l.user=lh()}if(this._debug(a,"session from storage",l),!this._isValidSession(l)){this._debug(a,"session is not valid"),l!==null&&await this._removeSession();return}const u=((r=l.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<ih;if(this._debug(a,`session has${u?"":" not"} expired with margin of ${ih}s`),u){if(this.autoRefreshToken&&l.refresh_token){const{error:c}=await this._callRefreshToken(l.refresh_token);c&&(console.error(c),oh(c)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else if(l.user&&l.user.__isUserNotAvailableProxy===!0)try{const{data:c,error:h}=await this._getUser(l.access_token);!h&&c?.user?(l.user=c.user,await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(c){console.error("Error getting user data:",c),this._debug(a,"error getting user data, skipping SIGNED_IN notification",c)}else await this._notifyAllSubscribers("SIGNED_IN",l)}catch(l){this._debug(a,"error",l),console.error(l);return}finally{this._debug(a,"end")}}async _callRefreshToken(e){var r,a;if(!e)throw new mt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const l=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(l,"begin");try{this.refreshingDeferred=new Ou;const{data:u,error:c}=await this._refreshAccessToken(e);if(c)throw c;if(!u.session)throw new mt;await this._saveSession(u.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",u.session);const h={data:u.session,error:null};return this.refreshingDeferred.resolve(h),h}catch(u){if(this._debug(l,"error",u),te(u)){const c={data:null,error:u};return oh(u)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(c),c}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(u),u}finally{this.refreshingDeferred=null,this._debug(l,"end")}}async _notifyAllSubscribers(e,r,a=!0){const l=`#_notifyAllSubscribers(${e})`;this._debug(l,"begin",r,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:e,session:r});const u=[],c=Array.from(this.stateChangeEmitters.values()).map(async h=>{try{await h.callback(e,r)}catch(p){u.push(p)}});if(await Promise.all(c),u.length>0){for(let h=0;h<u.length;h+=1)console.error(u[h]);throw u[0]}}finally{this._debug(l,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Tt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),a=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&r.user&&await qa(this.userStorage,this.storageKey+"-user",{user:r.user});const l=Object.assign({},r);delete l.user;const u=lv(l);await qa(this.storage,this.storageKey,u)}else{const l=lv(r);await qa(this.storage,this.storageKey,l)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Tt(this.storage,this.storageKey),await Tt(this.storage,this.storageKey+"-code-verifier"),await Tt(this.storage,this.storageKey+"-user"),this.userStorage&&await Tt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Rt()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Ia);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}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{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:a}}=r;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const l=Math.floor((a.expires_at*1e3-e)/Ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${l} ticks, a tick lasts ${Ia}ms, refresh threshold is ${Ch} ticks`),l<=Ch&&await this._callRefreshToken(a.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof ub)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Rt()||!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?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"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(r,"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,r,a){const l=[`provider=${encodeURIComponent(r)}`];if(a?.redirectTo&&l.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a?.scopes&&l.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){const[u,c]=await Ua(this.storage,this.storageKey),h=new URLSearchParams({code_challenge:`${encodeURIComponent(u)}`,code_challenge_method:`${encodeURIComponent(c)}`});l.push(h.toString())}if(a?.queryParams){const u=new URLSearchParams(a.queryParams);l.push(u.toString())}return a?.skipBrowserRedirect&&l.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${e}?${l.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var a;const{data:l,error:u}=r;return u?this._returnResult({data:null,error:u}):await se(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var a,l;const{data:u,error:c}=r;if(c)return this._returnResult({data:null,error:c});const h=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:p,error:g}=await se(this.fetch,"POST",`${this.url}/factors`,{body:h,headers:this.headers,jwt:(a=u?.session)===null||a===void 0?void 0:a.access_token});return g?this._returnResult({data:null,error:g}):(e.factorType==="totp"&&p.type==="totp"&&(!((l=p?.totp)===null||l===void 0)&&l.qr_code)&&(p.totp.qr_code=`data:image/svg+xml;utf-8,${p.totp.qr_code}`),this._returnResult({data:p,error:null}))})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;const{data:l,error:u}=r;if(u)return this._returnResult({data:null,error:u});const c=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?mv(e.webauthn.credential_response):yv(e.webauthn.credential_response)})}:{code:e.code}),{data:h,error:p}=await se(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:c,headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+h.expires_in},h)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",h),this._returnResult({data:h,error:p}))})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;const{data:l,error:u}=r;if(u)return this._returnResult({data:null,error:u});const c=await se(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token});if(c.error)return c;const{data:h}=c;if(h.type!=="webauthn")return{data:h,error:null};switch(h.webauthn.type){case"create":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:pv(h.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},h),{webauthn:Object.assign(Object.assign({},h.webauthn),{credential_options:Object.assign(Object.assign({},h.webauthn.credential_options),{publicKey:gv(h.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:a}=await this._challenge({factorId:e.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:a}=await this.getUser();if(a)return{data:null,error:a};const l={all:[],phone:[],totp:[],webauthn:[]};for(const u of(e=r?.factors)!==null&&e!==void 0?e:[])l.all.push(u),u.status==="verified"&&l[u.factor_type].push(u);return{data:l,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,a,l,u;if(e)try{const{payload:_}=Kl(e);let S=null;_.aal&&(S=_.aal);let O=S;const{data:{user:E},error:A}=await this.getUser(e);if(A)return this._returnResult({data:null,error:A});((a=(r=E?.factors)===null||r===void 0?void 0:r.filter(D=>D.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(O="aal2");const j=_.amr||[];return{data:{currentLevel:S,nextLevel:O,currentAuthenticationMethods:j},error:null}}catch(_){if(te(_))return this._returnResult({data:null,error:_});throw _}const{data:{session:c},error:h}=await this.getSession();if(h)return this._returnResult({data:null,error:h});if(!c)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:p}=Kl(c.access_token);let g=null;p.aal&&(g=p.aal);let y=g;((u=(l=c.user.factors)===null||l===void 0?void 0:l.filter(_=>_.status==="verified"))!==null&&u!==void 0?u:[]).length>0&&(y="aal2");const b=p.amr||[];return{data:{currentLevel:g,nextLevel:y,currentAuthenticationMethods:b},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:a},error:l}=r;return l?this._returnResult({data:null,error:l}):a?await se(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:a.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new mt})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async a=>{const{data:{session:l},error:u}=a;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new mt});const c=await se(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"approve"},xform:h=>({data:h,error:null})});return c.data&&c.data.redirect_url&&Rt()&&!r?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(a){if(te(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(e,r){try{return await this._useSession(async a=>{const{data:{session:l},error:u}=a;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new mt});const c=await se(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"deny"},xform:h=>({data:h,error:null})});return c.data&&c.data.redirect_url&&Rt()&&!r?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(a){if(te(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:a}=e;return a?this._returnResult({data:null,error:a}):r?await se(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:l=>({data:l,error:null})}):this._returnResult({data:null,error:new mt})})}catch(e){if(te(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:a},error:l}=r;return l?this._returnResult({data:null,error:l}):a?(await se(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new mt})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let a=r.keys.find(h=>h.kid===e);if(a)return a;const l=Date.now();if(a=this.jwks.keys.find(h=>h.kid===e),a&&this.jwks_cached_at+BO>l)return a;const{data:u,error:c}=await se(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(c)throw c;return!u.keys||u.keys.length===0||(this.jwks=u,this.jwks_cached_at=l,a=u.keys.find(h=>h.kid===e),!a)?null:a}async getClaims(e,r={}){try{let a=e;if(!a){const{data:_,error:S}=await this.getSession();if(S||!_.session)return this._returnResult({data:null,error:S});a=_.session.access_token}const{header:l,payload:u,signature:c,raw:{header:h,payload:p}}=Kl(a);r?.allowExpired||ox(u.exp);const g=!l.alg||l.alg.startsWith("HS")||!l.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(l.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!g){const{error:_}=await this.getUser(a);if(_)throw _;return{data:{claims:u,header:l,signature:c},error:null}}const y=lx(l.alg),m=await crypto.subtle.importKey("jwk",g,y,!0,["verify"]);if(!await crypto.subtle.verify(y,m,c,FO(`${h}.${p}`)))throw new Mh("Invalid JWT signature");return{data:{claims:u,header:l,signature:c},error:null}}catch(a){if(te(a))return this._returnResult({data:null,error:a});throw a}}async signInWithPasskey(e){var r,a,l;An(this.experimental);try{if(!du())return this._returnResult({data:null,error:new Cn("Browser does not support WebAuthn",null)});const{data:u,error:c}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}});if(c||!u)return this._returnResult({data:null,error:c});const h=gv(u.options),p=(l=(a=e?.options)===null||a===void 0?void 0:a.signal)!==null&&l!==void 0?l:Nh.createNewAbortSignal(),{data:g,error:y}=await db({publicKey:h,signal:p});if(y||!g)return this._returnResult({data:null,error:y??new Cn("WebAuthn ceremony failed",null)});const m=yv(g);return this._verifyPasskeyAuthentication({challengeId:u.challenge_id,credential:m})}catch(u){if(te(u))return this._returnResult({data:null,error:u});throw u}}async registerPasskey(e){var r,a;An(this.experimental);try{if(!du())return this._returnResult({data:null,error:new Cn("Browser does not support WebAuthn",null)});const{data:l,error:u}=await this._startPasskeyRegistration();if(u||!l)return this._returnResult({data:null,error:u});const c=pv(l.options),h=(a=(r=e?.options)===null||r===void 0?void 0:r.signal)!==null&&a!==void 0?a:Nh.createNewAbortSignal(),{data:p,error:g}=await hb({publicKey:c,signal:h});if(g||!p)return this._returnResult({data:null,error:g??new Cn("WebAuthn ceremony failed",null)});const y=mv(p);return this._verifyPasskeyRegistration({challengeId:l.challenge_id,credential:y})}catch(l){if(te(l))return this._returnResult({data:null,error:l});throw l}}async _startPasskeyRegistration(){An(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:a}=e;if(a)return this._returnResult({data:null,error:a});if(!r)return this._returnResult({data:null,error:new mt});const{data:l,error:u}=await se(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(e){if(te(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){An(this.experimental);try{return await this._useSession(async r=>{const{data:{session:a},error:l}=r;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new mt});const{data:u,error:c}=await se(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:a.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;An(this.experimental);try{const{data:a,error:l}=await se(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:a,error:null})}catch(a){if(te(a))return this._returnResult({data:null,error:a});throw a}}async _verifyPasskeyAuthentication(e){An(this.experimental);try{const{data:r,error:a}=await se(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:_n});return a?this._returnResult({data:null,error:a}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){An(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:a}=e;if(a)return this._returnResult({data:null,error:a});if(!r)return this._returnResult({data:null,error:new mt});const{data:l,error:u}=await se(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:c=>({data:c,error:null})});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(e){if(te(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){An(this.experimental);try{return await this._useSession(async r=>{const{data:{session:a},error:l}=r;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new mt});const{data:u,error:c}=await se(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:a.access_token,body:{friendly_name:e.friendlyName}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){An(this.experimental);try{return await this._useSession(async r=>{const{data:{session:a},error:l}=r;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new mt});const{error:u}=await se(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:a.access_token,noResolveJson:!0});return u?this._returnResult({data:null,error:u}):this._returnResult({data:null,error:null})})}catch(r){if(te(r))return this._returnResult({data:null,error:r});throw r}}}po.nextInstanceID={};const Mx=po,Nx="2.106.2";let eo="";typeof Deno<"u"?eo="deno":typeof document<"u"?eo="web":typeof navigator<"u"&&navigator.product==="ReactNative"?eo="react-native":eo="node";const Dx={"X-Client-Info":`supabase-js-${eo}/${Nx}`},Lx={headers:Dx},Ux={schema:"public"},Px={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},zx={},Bx={enabled:!1,respectSamplingDecision:!0};function Hx(t,e,r,a){function l(u){return u instanceof r?u:new r(function(c){c(u)})}return new(r||(r=Promise))(function(u,c){function h(y){try{g(a.next(y))}catch(m){c(m)}}function p(y){try{g(a.throw(y))}catch(m){c(m)}}function g(y){y.done?u(y.value):l(y.value).then(h,p)}g((a=a.apply(t,[])).next())})}let ch=null;const Ix="@opentelemetry/api";function qx(){return ch===null&&(ch=import(Ix).catch(()=>null)),ch}function $x(){return Hx(this,void 0,void 0,function*(){try{const t=yield qx();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function Gx(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,a,l,u]=e;if(r.length!==2||a.length!==32||l.length!==16||u.length!==2)return null;const c=/^[0-9a-f]+$/i;return!c.test(r)||!c.test(a)||!c.test(l)||!c.test(u)||a==="00000000000000000000000000000000"||l==="0000000000000000"?null:{version:r,traceId:a,parentId:l,traceFlags:u,isSampled:(parseInt(u,16)&1)===1}}function Vx(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const a of e)try{if(typeof a=="string"){if(Kx(r.hostname,a))return!0}else if(a instanceof RegExp){if(a.test(r.hostname))return!0}else if(typeof a=="function"&&a(r))return!0}catch{continue}return!1}function Kx(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function Yx(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function go(t){"@babel/helpers - typeof";return go=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},go(t)}function Fx(t,e){if(go(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(go(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qx(t){var e=Fx(t,"string");return go(e)=="symbol"?e:e+""}function Jx(t,e,r){return(e=Qx(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function We(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bv(Object(r),!0).forEach(function(a){Jx(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bv(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}const Xx=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Zx=()=>Headers,Wx=(t,e,r,a,l)=>{const u=Xx(a),c=Zx(),h=l?.enabled===!0,p=l?.respectSamplingDecision!==!1,g=h?Yx(e):null;return async(y,m)=>{var b;const _=(b=await r())!==null&&b!==void 0?b:t;let S=new c(m?.headers);if(S.has("apikey")||S.set("apikey",t),S.has("Authorization")||S.set("Authorization",`Bearer ${_}`),g){const O=await eC(y,g,p);O&&(O.traceparent&&!S.has("traceparent")&&S.set("traceparent",O.traceparent),O.tracestate&&!S.has("tracestate")&&S.set("tracestate",O.tracestate),O.baggage&&!S.has("baggage")&&S.set("baggage",O.baggage))}return u(y,We(We({},m),{},{headers:S}))}};async function eC(t,e,r){if(!Vx(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const a=await $x();if(!a||!a.traceparent)return null;if(r){const l=Gx(a.traceparent);if(l&&!l.isSampled)return null}return a}function _v(t){return typeof t=="boolean"?{enabled:t}:t}function tC(t){return t.endsWith("/")?t:t+"/"}function nC(t,e){var r,a,l,u,c,h;const{db:p,auth:g,realtime:y,global:m}=t,{db:b,auth:_,realtime:S,global:O}=e,E=_v(t.tracePropagation),A=_v(e.tracePropagation),M={db:We(We({},b),p),auth:We(We({},_),g),realtime:We(We({},S),y),storage:{},global:We(We(We({},O),m),{},{headers:We(We({},(r=O?.headers)!==null&&r!==void 0?r:{}),(a=m?.headers)!==null&&a!==void 0?a:{})}),tracePropagation:{enabled:(l=(u=E?.enabled)!==null&&u!==void 0?u:A?.enabled)!==null&&l!==void 0?l:!1,respectSamplingDecision:(c=(h=E?.respectSamplingDecision)!==null&&h!==void 0?h:A?.respectSamplingDecision)!==null&&c!==void 0?c:!0},accessToken:async()=>""};return t.accessToken?M.accessToken=t.accessToken:delete M.accessToken,M}function rC(t){const e=t?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(tC(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var sC=class extends Mx{constructor(t){super(t)}},aC=class{constructor(t,e,r){var a,l;this.supabaseUrl=t,this.supabaseKey=e;const u=rC(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",u),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",u),this.storageUrl=new URL("storage/v1",u),this.functionsUrl=new URL("functions/v1",u);const c=`sb-${u.hostname.split(".")[0]}-auth-token`,h={db:Ux,realtime:zx,auth:We(We({},Px),{},{storageKey:c}),global:Lx,tracePropagation:Bx},p=nC(r??{},h);if(this.settings=p,this.storageKey=(a=p.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(l=p.global.headers)!==null&&l!==void 0?l:{},p.accessToken)this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(y,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var g;this.auth=this._initSupabaseAuthClient((g=p.auth)!==null&&g!==void 0?g:{},this.headers,p.global.fetch)}this.fetch=Wx(e,t,this._getAccessToken.bind(this),p.global.fetch,p.tracePropagation),this.realtime=this._initRealtimeClient(We({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},p.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(y=>this.realtime.setAuth(y)).catch(y=>console.warn("Failed to set initial Realtime auth token:",y)),this.rest=new wA(new URL("rest/v1",u).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch,timeout:p.db.timeout,urlLengthLimit:p.db.urlLengthLimit}),this.storage=new DO(this.storageUrl.href,this.headers,this.fetch,r?.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new fA(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:a}=await t.auth.getSession();return(e=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:a,userStorage:l,storageKey:u,flowType:c,lock:h,debug:p,throwOnError:g,experimental:y,lockAcquireTimeout:m,skipAutoInitialize:b},_,S){const O={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new sC({url:this.authUrl.href,headers:We(We({},O),_),storageKey:u,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:a,userStorage:l,flowType:c,lock:h,debug:p,throwOnError:g,experimental:y,fetch:S,lockAcquireTimeout:m,skipAutoInitialize:b,hasCustomAuthorizationHeader:Object.keys(this.headers).some(E=>E.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new rO(this.realtimeUrl.href,We(We({},t),{},{params:We(We({},{apikey:this.supabaseKey}),t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e?.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const iC=(t,e,r)=>new aC(t,e,r);function oC(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}oC()&&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");function lC(){return iC("https://wrihaledmchlrvtsjrsu.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndyaWhhbGVkbWNobHJ2dHNqcnN1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODAwODMyNjAsImV4cCI6MjA5NTY1OTI2MH0.YxHrFgYyMmGo07v0IwqSlUq9Xj6kvICvTPNfh4wAgbQ",{auth:{storage:typeof window<"u"?localStorage:void 0,persistSession:!0,autoRefreshToken:!0}})}let fh;const tu=new Proxy({},{get(t,e,r){return fh||(fh=lC()),Reflect.get(fh,e,r)}}),uC=Ls({type:"function"}).client(async({next:t})=>{const{data:e}=await tu.auth.getSession(),r=e.session?.access_token;return t({headers:r?{Authorization:`Bearer ${r}`}:{}})}),cC=Ls(),wv=oA(()=>({functionMiddleware:[uC],requestMiddleware:[cC]}));var xu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fC=class extends xu{#e;#n;#t;constructor(){super(),this.#t=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(t){this.#t=t,this.#n?.(),this.#n=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},pb=new fC,hC={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},dC=class{#e=hC;#n=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Dh=new dC;function pC(t){setTimeout(t,0)}var gC=typeof window>"u"||"Deno"in globalThis;function xn(){}function mC(t,e){return typeof t=="function"?t(e):t}function yC(t){return typeof t=="number"&&t>=0&&t!==1/0}function vC(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Lh(t,e){return typeof t=="function"?t(e):t}function bC(t,e){return typeof t=="function"?t(e):t}function Sv(t,e){const{type:r="all",exact:a,fetchStatus:l,predicate:u,queryKey:c,stale:h}=t;if(c){if(a){if(e.queryHash!==Zh(c,e.options))return!1}else if(!yo(e.queryKey,c))return!1}if(r!=="all"){const p=e.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof h=="boolean"&&e.isStale()!==h||l&&l!==e.state.fetchStatus||u&&!u(e))}function Ev(t,e){const{exact:r,status:a,predicate:l,mutationKey:u}=t;if(u){if(!e.options.mutationKey)return!1;if(r){if(mo(e.options.mutationKey)!==mo(u))return!1}else if(!yo(e.options.mutationKey,u))return!1}return!(a&&e.state.status!==a||l&&!l(e))}function Zh(t,e){return(e?.queryKeyHashFn||mo)(t)}function mo(t){return JSON.stringify(t,(e,r)=>Uh(r)?Object.keys(r).sort().reduce((a,l)=>(a[l]=r[l],a),{}):r)}function yo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>yo(t[r],e[r])):!1}var _C=Object.prototype.hasOwnProperty;function gb(t,e,r=0){if(t===e)return t;if(r>500)return e;const a=Tv(t)&&Tv(e);if(!a&&!(Uh(t)&&Uh(e)))return e;const u=(a?t:Object.keys(t)).length,c=a?e:Object.keys(e),h=c.length,p=a?new Array(h):{};let g=0;for(let y=0;y<h;y++){const m=a?y:c[y],b=t[m],_=e[m];if(b===_){p[m]=b,(a?y<u:_C.call(t,m))&&g++;continue}if(b===null||_===null||typeof b!="object"||typeof _!="object"){p[m]=_;continue}const S=gb(b,_,r+1);p[m]=S,S===b&&g++}return u===h&&g===u?t:p}function s2(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Tv(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Uh(t){if(!Rv(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Rv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Rv(t){return Object.prototype.toString.call(t)==="[object Object]"}function wC(t){return new Promise(e=>{Dh.setTimeout(e,t)})}function SC(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?gb(t,e):e}function EC(t,e,r=0){const a=[...t,e];return r&&a.length>r?a.slice(1):a}function TC(t,e,r=0){const a=[e,...t];return r&&a.length>r?a.slice(0,-1):a}var Wh=Symbol();function mb(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Wh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function a2(t,e){return typeof t=="function"?t(...e):!!t}function RC(t,e,r){let a=!1,l;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(l??=e(),a||(a=!0,l.aborted?r():l.addEventListener("abort",r,{once:!0})),l)}),t}var yb=(()=>{let t=()=>gC;return{isServer(){return t()},setIsServer(e){t=e}}})();function AC(){let t,e;const r=new Promise((l,u)=>{t=l,e=u});r.status="pending",r.catch(()=>{});function a(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{a({status:"fulfilled",value:l}),t(l)},r.reject=l=>{a({status:"rejected",reason:l}),e(l)},r}var OC=pC;function xC(){let t=[],e=0,r=h=>{h()},a=h=>{h()},l=OC;const u=h=>{e?t.push(h):l(()=>{r(h)})},c=()=>{const h=t;t=[],h.length&&l(()=>{a(()=>{h.forEach(p=>{r(p)})})})};return{batch:h=>{let p;e++;try{p=h()}finally{e--,e||c()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{a=h},setScheduler:h=>{l=h}}}var Nt=xC(),CC=class extends xu{#e=!0;#n;#t;constructor(){super(),this.#t=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(t){this.#t=t,this.#n?.(),this.#n=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#e}},gu=new CC;function kC(t){return Math.min(1e3*2**t,3e4)}function vb(t){return(t??"online")==="online"?gu.isOnline():!0}var Ph=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function bb(t){let e=!1,r=0,a;const l=AC(),u=()=>l.status!=="pending",c=O=>{if(!u()){const E=new Ph(O);b(E),t.onCancel?.(E)}},h=()=>{e=!0},p=()=>{e=!1},g=()=>pb.isFocused()&&(t.networkMode==="always"||gu.isOnline())&&t.canRun(),y=()=>vb(t.networkMode)&&t.canRun(),m=O=>{u()||(a?.(),l.resolve(O))},b=O=>{u()||(a?.(),l.reject(O))},_=()=>new Promise(O=>{a=E=>{(u()||g())&&O(E)},t.onPause?.()}).then(()=>{a=void 0,u()||t.onContinue?.()}),S=()=>{if(u())return;let O;const E=r===0?t.initialPromise:void 0;try{O=E??t.fn()}catch(A){O=Promise.reject(A)}Promise.resolve(O).then(m).catch(A=>{if(u())return;const M=t.retry??(yb.isServer()?0:3),j=t.retryDelay??kC,D=typeof j=="function"?j(r,A):j,X=M===!0||typeof M=="number"&&r<M||typeof M=="function"&&M(r,A);if(e||!X){b(A);return}r++,t.onFail?.(r,A),wC(D).then(()=>g()?void 0:_()).then(()=>{e?b(A):S()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a?.(),l),cancelRetry:h,continueRetry:p,canStart:y,start:()=>(y()?S():_().then(S),l)}}var _b=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yC(this.gcTime)&&(this.#e=Dh.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(yb.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Dh.clearTimeout(this.#e),this.#e=void 0)}},jC=class extends _b{#e;#n;#t;#s;#r;#a;#i;constructor(t){super(),this.#i=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#s=t.client,this.#t=this.#s.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=Ov(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=Ov(this.options);e.data!==void 0&&(this.setState(Av(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(t,e){const r=SC(this.state.data,t,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>bC(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Lh(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!vC(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#i||this.#l()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},l=()=>{const h=mb(this.options,e),g=(()=>{const y={client:this.#s,queryKey:this.queryKey,meta:this.meta};return a(y),y})();return this.#i=!1,this.options.persister?this.options.persister(h,g,this):h(g)},c=(()=>{const h={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:l};return a(h),h})();this.options.behavior?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#o({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=bb({initialPromise:e?.initialPromise,fn:c.fetchFn,onCancel:h=>{h instanceof Ph&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(h,p)=>{this.#o({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#t.config.onSuccess?.(h,this),this.#t.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Ph){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#o({type:"error",error:h}),this.#t.config.onError?.(h,this),this.#t.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#o(t){const e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...MC(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...Av(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?a:void 0,a;case"error":const l=t.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),Nt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:t})})}};function MC(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vb(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Av(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ov(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,a=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function xv(t){return{onFetch:(e,r)=>{const a=e.options,l=e.fetchOptions?.meta?.fetchMore?.direction,u=e.state.data?.pages||[],c=e.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const g=async()=>{let y=!1;const m=S=>{RC(S,()=>e.signal,()=>y=!0)},b=mb(e.options,e.fetchOptions),_=async(S,O,E)=>{if(y)return Promise.reject();if(O==null&&S.pages.length)return Promise.resolve(S);const M=(()=>{const K={client:e.client,queryKey:e.queryKey,pageParam:O,direction:E?"backward":"forward",meta:e.options.meta};return m(K),K})(),j=await b(M),{maxPages:D}=e.options,X=E?TC:EC;return{pages:X(S.pages,j,D),pageParams:X(S.pageParams,O,D)}};if(l&&u.length){const S=l==="backward",O=S?NC:Cv,E={pages:u,pageParams:c},A=O(a,E);h=await _(E,A,S)}else{const S=t??u.length;do{const O=p===0?c[0]??a.initialPageParam:Cv(a,h);if(p>0&&O==null)break;h=await _(h,O),p++}while(p<S)}return h};e.options.persister?e.fetchFn=()=>e.options.persister?.(g,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=g}}}function Cv(t,{pages:e,pageParams:r}){const a=e.length-1;return e.length>0?t.getNextPageParam(e[a],e,r[a],r):void 0}function NC(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var DC=class extends _b{#e;#n;#t;#s;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#n=[],this.state=t.state||LC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#n.includes(t)||(this.#n.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#n=this.#n.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=bb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#r({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const a=this.state.status==="pending",l=!this.#s.canStart();try{if(a)e();else{this.#r({type:"pending",variables:t,isPaused:l}),this.#t.config.onMutate&&await this.#t.config.onMutate(t,this,r);const c=await this.options.onMutate?.(t,r);c!==this.state.context&&this.#r({type:"pending",context:c,variables:t,isPaused:l})}const u=await this.#s.start();return await this.#t.config.onSuccess?.(u,t,this.state.context,this,r),await this.options.onSuccess?.(u,t,this.state.context,r),await this.#t.config.onSettled?.(u,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(u,null,t,this.state.context,r),this.#r({type:"success",data:u}),u}catch(u){try{await this.#t.config.onError?.(u,t,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,t,this.state.context,r)}catch(c){Promise.reject(c)}try{await this.#t.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,t,this.state.context,r)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:u}),u}finally{this.#t.runNext(this)}}#r(t){const e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Nt.batch(()=>{this.#n.forEach(r=>{r.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function LC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var UC=class extends xu{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(t,e,r){const a=new DC({client:t,mutationCache:this,mutationId:++this.#t,options:t.defaultMutationOptions(e),state:r});return this.add(a),a}add(t){this.#e.add(t);const e=Yl(t);if(typeof e=="string"){const r=this.#n.get(e);r?r.push(t):this.#n.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Yl(t);if(typeof e=="string"){const r=this.#n.get(e);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&this.#n.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Yl(t);if(typeof e=="string"){const a=this.#n.get(e)?.find(l=>l.state.status==="pending");return!a||a===t}else return!0}runNext(t){const e=Yl(t);return typeof e=="string"?this.#n.get(e)?.find(a=>a!==t&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nt.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(r=>Ev(e,r))}findAll(t={}){return this.getAll().filter(e=>Ev(t,e))}notify(t){Nt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Nt.batch(()=>Promise.all(t.map(e=>e.continue().catch(xn))))}};function Yl(t){return t.options.scope?.id}var PC=class extends xu{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){const a=e.queryKey,l=e.queryHash??Zh(a,e);let u=this.get(l);return u||(u=new jC({client:t,queryKey:a,queryHash:l,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Nt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(r=>Sv(e,r))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(r=>Sv(t,r)):e}notify(t){Nt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},zC=class{#e;#n;#t;#s;#r;#a;#i;#l;constructor(t={}){this.#e=t.queryCache||new PC,this.#n=t.mutationCache||new UC,this.#t=t.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=pb.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=gu.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#n.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=this.#e.build(this,e),a=r.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Lh(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(a))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:r})=>{const a=r.data;return[e,a]})}setQueryData(t,e,r){const a=this.defaultQueryOptions({queryKey:t}),u=this.#e.get(a.queryHash)?.state.data,c=mC(e,u);if(c!==void 0)return this.#e.build(this,a).setData(c,{...r,manual:!0})}setQueriesData(t,e,r){return Nt.batch(()=>this.#e.findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,e,r)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Nt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=this.#e;return Nt.batch(()=>(r.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},a=Nt.batch(()=>this.#e.findAll(t).map(l=>l.cancel(r)));return Promise.all(a).then(xn).catch(xn)}invalidateQueries(t,e={}){return Nt.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},a=Nt.batch(()=>this.#e.findAll(t).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,r);return r.throwOnError||(u=u.catch(xn)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(a).then(xn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=this.#e.build(this,e);return r.isStaleByTime(Lh(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xn).catch(xn)}fetchInfiniteQuery(t){return t.behavior=xv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xn).catch(xn)}ensureInfiniteQueryData(t){return t.behavior=xv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return gu.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(t){this.#t=t}setQueryDefaults(t,e){this.#s.set(mo(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#s.values()],r={};return e.forEach(a=>{yo(t,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(t,e){this.#r.set(mo(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],r={};return e.forEach(a=>{yo(t,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#t.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Zh(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Wh&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#t.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},wb=ne.createContext(void 0),i2=t=>{const e=ne.useContext(wb);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},BC=({client:t,children:e})=>(ne.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Q.jsx(wb.Provider,{value:t,children:e}));const HC="/assets/styles-CaLOOksH.css";function IC(t,e={}){typeof window>"u"||window.__lovableEvents?.captureException?.(t,{source:"react_error_boundary",route:window.location.pathname,...e},{mechanism:"react_error_boundary",handled:!1,severity:"error"})}const Sb=ne.createContext({user:null,session:null,loading:!0,signOut:async()=>{}});function qC({children:t}){const[e,r]=ne.useState(null),[a,l]=ne.useState(!0);return ne.useEffect(()=>{const{data:u}=tu.auth.onAuthStateChange((c,h)=>{r(h)});return tu.auth.getSession().then(({data:c})=>{r(c.session),l(!1)}),()=>u.subscription.unsubscribe()},[]),Q.jsx(Sb.Provider,{value:{user:e?.user??null,session:e,loading:a,signOut:async()=>{await tu.auth.signOut()}},children:t})}const o2=()=>ne.useContext(Sb);function $C(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const GC=t=>{switch(t){case"success":return YC;case"info":return QC;case"warning":return FC;case"error":return JC;default:return null}},VC=Array(12).fill(0),KC=({visible:t,className:e})=>Z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Z.createElement("div",{className:"sonner-spinner"},VC.map((r,a)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),YC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),FC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),JC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),XC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ZC=()=>{const[t,e]=Z.useState(document.hidden);return Z.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let zh=1;class WC{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:a,...l}=e,u=typeof e?.id=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:zh++,c=this.toasts.find(p=>p.id===u),h=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),c?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...e,id:u,title:a}),{...p,...e,id:u,dismissible:h,title:a}):p):this.addToast({title:a,...l,dismissible:h,id:u}),u},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(a=>a({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let a;r.loading!==void 0&&(a=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const l=Promise.resolve(e instanceof Function?e():e);let u=a!==void 0,c;const h=l.then(async g=>{if(c=["resolve",g],Z.isValidElement(g))u=!1,this.create({id:a,type:"default",message:g});else if(tk(g)&&!g.ok){u=!1;const m=typeof r.error=="function"?await r.error(`HTTP error! status: ${g.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${g.status}`):r.description,S=typeof m=="object"&&!Z.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...S})}else if(g instanceof Error){u=!1;const m=typeof r.error=="function"?await r.error(g):r.error,b=typeof r.description=="function"?await r.description(g):r.description,S=typeof m=="object"&&!Z.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...S})}else if(r.success!==void 0){u=!1;const m=typeof r.success=="function"?await r.success(g):r.success,b=typeof r.description=="function"?await r.description(g):r.description,S=typeof m=="object"&&!Z.isValidElement(m)?m:{message:m};this.create({id:a,type:"success",description:b,...S})}}).catch(async g=>{if(c=["reject",g],r.error!==void 0){u=!1;const y=typeof r.error=="function"?await r.error(g):r.error,m=typeof r.description=="function"?await r.description(g):r.description,_=typeof y=="object"&&!Z.isValidElement(y)?y:{message:y};this.create({id:a,type:"error",description:m,..._})}}).finally(()=>{u&&(this.dismiss(a),a=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((g,y)=>h.then(()=>c[0]==="reject"?y(c[1]):g(c[1])).catch(y));return typeof a!="string"&&typeof a!="number"?{unwrap:p}:Object.assign(a,{unwrap:p})},this.custom=(e,r)=>{const a=r?.id||zh++;return this.create({jsx:e(a),id:a,...r}),a},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ft=new WC,ek=(t,e)=>{const r=e?.id||zh++;return Ft.addToast({title:t,...e,id:r}),r},tk=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",nk=ek,rk=()=>Ft.toasts,sk=()=>Ft.getActiveToasts(),l2=Object.assign(nk,{success:Ft.success,info:Ft.info,warning:Ft.warning,error:Ft.error,custom:Ft.custom,message:Ft.message,promise:Ft.promise,dismiss:Ft.dismiss,loading:Ft.loading},{getHistory:rk,getToasts:sk});$C("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Fl(t){return t.label!==void 0}const ak=3,ik="24px",ok="16px",kv=4e3,lk=356,uk=14,ck=45,fk=200;function Bn(...t){return t.filter(Boolean).join(" ")}function hk(t){const[e,r]=t.split("-"),a=[];return e&&a.push(e),r&&a.push(r),a}const dk=t=>{var e,r,a,l,u,c,h,p,g;const{invert:y,toast:m,unstyled:b,interacting:_,setHeights:S,visibleToasts:O,heights:E,index:A,toasts:M,expanded:j,removeToast:D,defaultRichColors:X,closeButton:K,style:H,cancelButtonStyle:Y,actionButtonStyle:W,className:le="",descriptionClassName:ie="",duration:me,position:_e,gap:qe,expandByDefault:Me,classNames:U,icons:F,closeButtonAriaLabel:ae="Close toast"}=t,[Se,ye]=Z.useState(null),[C,q]=Z.useState(null),[V,J]=Z.useState(!1),[ee,ce]=Z.useState(!1),[we,de]=Z.useState(!1),[xe,Dt]=Z.useState(!1),[Lt,kt]=Z.useState(!1),[as,Ut]=Z.useState(0),[is,Gn]=Z.useState(0),kn=Z.useRef(m.duration||me||kv),ln=Z.useRef(null),vt=Z.useRef(null),Zt=A===0,os=A+1<=O,ft=m.type,jn=m.dismissible!==!1,ht=m.className||"",Ue=m.descriptionClassName||"",Je=Z.useMemo(()=>E.findIndex(pe=>pe.toastId===m.id)||0,[E,m.id]),un=Z.useMemo(()=>{var pe;return(pe=m.closeButton)!=null?pe:K},[m.closeButton,K]),Vn=Z.useMemo(()=>m.duration||me||kv,[m.duration,me]),Za=Z.useRef(0),Kn=Z.useRef(0),wo=Z.useRef(0),_r=Z.useRef(null),[ls,jt]=_e.split("-"),wn=Z.useMemo(()=>E.reduce((pe,Ke,dt)=>dt>=Je?pe:pe+Ke.height,0),[E,Je]),Ot=ZC(),Cu=m.invert||y,Wa=ft==="loading";Kn.current=Z.useMemo(()=>Je*qe+wn,[Je,wn]),Z.useEffect(()=>{kn.current=Vn},[Vn]),Z.useEffect(()=>{J(!0)},[]),Z.useEffect(()=>{const pe=vt.current;if(pe){const Ke=pe.getBoundingClientRect().height;return Gn(Ke),S(dt=>[{toastId:m.id,height:Ke,position:m.position},...dt]),()=>S(dt=>dt.filter(xt=>xt.toastId!==m.id))}},[S,m.id]),Z.useLayoutEffect(()=>{if(!V)return;const pe=vt.current,Ke=pe.style.height;pe.style.height="auto";const dt=pe.getBoundingClientRect().height;pe.style.height=Ke,Gn(dt),S(xt=>xt.find(Qe=>Qe.toastId===m.id)?xt.map(Qe=>Qe.toastId===m.id?{...Qe,height:dt}:Qe):[{toastId:m.id,height:dt,position:m.position},...xt])},[V,m.title,m.description,S,m.id,m.jsx,m.action,m.cancel]);const Mn=Z.useCallback(()=>{ce(!0),Ut(Kn.current),S(pe=>pe.filter(Ke=>Ke.toastId!==m.id)),setTimeout(()=>{D(m)},fk)},[m,D,S,Kn]);Z.useEffect(()=>{if(m.promise&&ft==="loading"||m.duration===1/0||m.type==="loading")return;let pe;return j||_||Ot?(()=>{if(wo.current<Za.current){const xt=new Date().getTime()-Za.current;kn.current=kn.current-xt}wo.current=new Date().getTime()})():kn.current!==1/0&&(Za.current=new Date().getTime(),pe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Mn()},kn.current)),()=>clearTimeout(pe)},[j,_,m,ft,Ot,Mn]),Z.useEffect(()=>{m.delete&&(Mn(),m.onDismiss==null||m.onDismiss.call(m,m))},[Mn,m.delete]);function Vs(){var pe;if(F?.loading){var Ke;return Z.createElement("div",{className:Bn(U?.loader,m==null||(Ke=m.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":ft==="loading"},F.loading)}return Z.createElement(KC,{className:Bn(U?.loader,m==null||(pe=m.classNames)==null?void 0:pe.loader),visible:ft==="loading"})}const Ks=m.icon||F?.[ft]||GC(ft);var us,Nn;return Z.createElement("li",{tabIndex:0,ref:vt,className:Bn(le,ht,U?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,U?.default,U?.[ft],m==null||(r=m.classNames)==null?void 0:r[ft]),"data-sonner-toast":"","data-rich-colors":(us=m.richColors)!=null?us:X,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":V,"data-promise":!!m.promise,"data-swiped":Lt,"data-removed":ee,"data-visible":os,"data-y-position":ls,"data-x-position":jt,"data-index":A,"data-front":Zt,"data-swiping":we,"data-dismissible":jn,"data-type":ft,"data-invert":Cu,"data-swipe-out":xe,"data-swipe-direction":C,"data-expanded":!!(j||Me&&V),"data-testid":m.testId,style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${ee?as:Kn.current}px`,"--initial-height":Me?"auto":`${is}px`,...H,...m.style},onDragEnd:()=>{de(!1),ye(null),_r.current=null},onPointerDown:pe=>{pe.button!==2&&(Wa||!jn||(ln.current=new Date,Ut(Kn.current),pe.target.setPointerCapture(pe.pointerId),pe.target.tagName!=="BUTTON"&&(de(!0),_r.current={x:pe.clientX,y:pe.clientY})))},onPointerUp:()=>{var pe,Ke,dt;if(xe||!jn)return;_r.current=null;const xt=Number(((pe=vt.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wr=Number(((Ke=vt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((dt=ln.current)==null?void 0:dt.getTime()),Pt=Se==="x"?xt:wr,cs=Math.abs(Pt)/Qe;if(Math.abs(Pt)>=ck||cs>.11){Ut(Kn.current),m.onDismiss==null||m.onDismiss.call(m,m),q(Se==="x"?xt>0?"right":"left":wr>0?"down":"up"),Mn(),Dt(!0);return}else{var zt,Bt;(zt=vt.current)==null||zt.style.setProperty("--swipe-amount-x","0px"),(Bt=vt.current)==null||Bt.style.setProperty("--swipe-amount-y","0px")}kt(!1),de(!1),ye(null)},onPointerMove:pe=>{var Ke,dt,xt;if(!_r.current||!jn||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const Qe=pe.clientY-_r.current.y,Pt=pe.clientX-_r.current.x;var cs;const zt=(cs=t.swipeDirections)!=null?cs:hk(_e);!Se&&(Math.abs(Pt)>1||Math.abs(Qe)>1)&&ye(Math.abs(Pt)>Math.abs(Qe)?"x":"y");let Bt={x:0,y:0};const Ys=Sn=>1/(1.5+Math.abs(Sn)/20);if(Se==="y"){if(zt.includes("top")||zt.includes("bottom"))if(zt.includes("top")&&Qe<0||zt.includes("bottom")&&Qe>0)Bt.y=Qe;else{const Sn=Qe*Ys(Qe);Bt.y=Math.abs(Sn)<Math.abs(Qe)?Sn:Qe}}else if(Se==="x"&&(zt.includes("left")||zt.includes("right")))if(zt.includes("left")&&Pt<0||zt.includes("right")&&Pt>0)Bt.x=Pt;else{const Sn=Pt*Ys(Pt);Bt.x=Math.abs(Sn)<Math.abs(Pt)?Sn:Pt}(Math.abs(Bt.x)>0||Math.abs(Bt.y)>0)&&kt(!0),(dt=vt.current)==null||dt.style.setProperty("--swipe-amount-x",`${Bt.x}px`),(xt=vt.current)==null||xt.style.setProperty("--swipe-amount-y",`${Bt.y}px`)}},un&&!m.jsx&&ft!=="loading"?Z.createElement("button",{"aria-label":ae,"data-disabled":Wa,"data-close-button":!0,onClick:Wa||!jn?()=>{}:()=>{Mn(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Bn(U?.closeButton,m==null||(a=m.classNames)==null?void 0:a.closeButton)},(Nn=F?.close)!=null?Nn:XC):null,(ft||m.icon||m.promise)&&m.icon!==null&&(F?.[ft]!==null||m.icon)?Z.createElement("div",{"data-icon":"",className:Bn(U?.icon,m==null||(l=m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Vs():null,m.type!=="loading"?Ks:null):null,Z.createElement("div",{"data-content":"",className:Bn(U?.content,m==null||(u=m.classNames)==null?void 0:u.content)},Z.createElement("div",{"data-title":"",className:Bn(U?.title,m==null||(c=m.classNames)==null?void 0:c.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?Z.createElement("div",{"data-description":"",className:Bn(ie,Ue,U?.description,m==null||(h=m.classNames)==null?void 0:h.description)},typeof m.description=="function"?m.description():m.description):null),Z.isValidElement(m.cancel)?m.cancel:m.cancel&&Fl(m.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||Y,onClick:pe=>{Fl(m.cancel)&&jn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,pe),Mn())},className:Bn(U?.cancelButton,m==null||(p=m.classNames)==null?void 0:p.cancelButton)},m.cancel.label):null,Z.isValidElement(m.action)?m.action:m.action&&Fl(m.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||W,onClick:pe=>{Fl(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,pe),!pe.defaultPrevented&&Mn())},className:Bn(U?.actionButton,m==null||(g=m.classNames)==null?void 0:g.actionButton)},m.action.label):null)};function jv(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function pk(t,e){const r={};return[t,e].forEach((a,l)=>{const u=l===1,c=u?"--mobile-offset":"--offset",h=u?ok:ik;function p(g){["top","right","bottom","left"].forEach(y=>{r[`${c}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof a=="number"||typeof a=="string"?p(a):typeof a=="object"?["top","right","bottom","left"].forEach(g=>{a[g]===void 0?r[`${c}-${g}`]=h:r[`${c}-${g}`]=typeof a[g]=="number"?`${a[g]}px`:a[g]}):p(h)}),r}const gk=Z.forwardRef(function(e,r){const{id:a,invert:l,position:u="bottom-right",hotkey:c=["altKey","KeyT"],expand:h,closeButton:p,className:g,offset:y,mobileOffset:m,theme:b="light",richColors:_,duration:S,style:O,visibleToasts:E=ak,toastOptions:A,dir:M=jv(),gap:j=uk,icons:D,containerAriaLabel:X="Notifications"}=e,[K,H]=Z.useState([]),Y=Z.useMemo(()=>a?K.filter(V=>V.toasterId===a):K.filter(V=>!V.toasterId),[K,a]),W=Z.useMemo(()=>Array.from(new Set([u].concat(Y.filter(V=>V.position).map(V=>V.position)))),[Y,u]),[le,ie]=Z.useState([]),[me,_e]=Z.useState(!1),[qe,Me]=Z.useState(!1),[U,F]=Z.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ae=Z.useRef(null),Se=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ye=Z.useRef(null),C=Z.useRef(!1),q=Z.useCallback(V=>{H(J=>{var ee;return(ee=J.find(ce=>ce.id===V.id))!=null&&ee.delete||Ft.dismiss(V.id),J.filter(({id:ce})=>ce!==V.id)})},[]);return Z.useEffect(()=>Ft.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{H(J=>J.map(ee=>ee.id===V.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{RR.flushSync(()=>{H(J=>{const ee=J.findIndex(ce=>ce.id===V.id);return ee!==-1?[...J.slice(0,ee),{...J[ee],...V},...J.slice(ee+1)]:[V,...J]})})})}),[K]),Z.useEffect(()=>{if(b!=="system"){F(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:J})=>{F(J?"dark":"light")})}catch{V.addListener(({matches:ee})=>{try{F(ee?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),Z.useEffect(()=>{K.length<=1&&_e(!1)},[K]),Z.useEffect(()=>{const V=J=>{var ee;if(c.every(de=>J[de]||J.code===de)){var we;_e(!0),(we=ae.current)==null||we.focus()}J.code==="Escape"&&(document.activeElement===ae.current||(ee=ae.current)!=null&&ee.contains(document.activeElement))&&_e(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[c]),Z.useEffect(()=>{if(ae.current)return()=>{ye.current&&(ye.current.focus({preventScroll:!0}),ye.current=null,C.current=!1)}},[ae.current]),Z.createElement("section",{ref:r,"aria-label":`${X} ${Se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},W.map((V,J)=>{var ee;const[ce,we]=V.split("-");return Y.length?Z.createElement("ol",{key:V,dir:M==="auto"?jv():M,tabIndex:-1,ref:ae,className:g,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":ce,"data-x-position":we,style:{"--front-toast-height":`${((ee=le[0])==null?void 0:ee.height)||0}px`,"--width":`${lk}px`,"--gap":`${j}px`,...O,...pk(y,m)},onBlur:de=>{C.current&&!de.currentTarget.contains(de.relatedTarget)&&(C.current=!1,ye.current&&(ye.current.focus({preventScroll:!0}),ye.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||C.current||(C.current=!0,ye.current=de.relatedTarget)},onMouseEnter:()=>_e(!0),onMouseMove:()=>_e(!0),onMouseLeave:()=>{qe||_e(!1)},onDragEnd:()=>_e(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||Me(!0)},onPointerUp:()=>Me(!1)},Y.filter(de=>!de.position&&J===0||de.position===V).map((de,xe)=>{var Dt,Lt;return Z.createElement(dk,{key:de.id,icons:D,index:xe,toast:de,defaultRichColors:_,duration:(Dt=A?.duration)!=null?Dt:S,className:A?.className,descriptionClassName:A?.descriptionClassName,invert:l,visibleToasts:E,closeButton:(Lt=A?.closeButton)!=null?Lt:p,interacting:qe,position:V,style:A?.style,unstyled:A?.unstyled,classNames:A?.classNames,cancelButtonStyle:A?.cancelButtonStyle,actionButtonStyle:A?.actionButtonStyle,closeButtonAriaLabel:A?.closeButtonAriaLabel,removeToast:q,toasts:Y.filter(kt=>kt.position==de.position),heights:le.filter(kt=>kt.position==de.position),setHeights:ie,expandByDefault:h,gap:j,expanded:me,swipeDirections:e.swipeDirections})})):null}))}),mk=({...t})=>Q.jsx(gk,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t});function yk(){return Q.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:Q.jsxs("div",{className:"max-w-md text-center",children:[Q.jsx("h1",{className:"text-7xl font-bold text-foreground",children:"404"}),Q.jsx("h2",{className:"mt-4 text-xl font-semibold text-foreground",children:"Page not found"}),Q.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),Q.jsx("div",{className:"mt-6",children:Q.jsx(Qh,{to:"/",className:"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Go home"})})]})})}function vk({error:t,reset:e}){console.error(t);const r=At();return ne.useEffect(()=>{IC(t,{boundary:"tanstack_root_error_component"})},[t]),Q.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:Q.jsxs("div",{className:"max-w-md text-center",children:[Q.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground",children:"This page didn't load"}),Q.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Something went wrong on our end. You can try refreshing or head back home."}),Q.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-2",children:[Q.jsx("button",{onClick:()=>{r.invalidate(),e()},className:"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Try again"}),Q.jsx("a",{href:"/",className:"inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:"Go home"})]})]})})}const br=PR()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Crosse — Lacrosse Tracker"},{name:"description",content:"Track wins, losses, seasons, games, and practices for lacrosse."},{property:"og:title",content:"Crosse — Lacrosse Tracker"},{property:"og:description",content:"Track wins, losses, seasons, games, and practices for lacrosse."},{property:"og:type",content:"website"},{name:"twitter:card",content:"summary"},{name:"twitter:title",content:"Crosse — Lacrosse Tracker"},{name:"twitter:description",content:"Track wins, losses, seasons, games, and practices for lacrosse."},{property:"og:image",content:"https://storage.googleapis.com/gpt-engineer-file-uploads/attachments/og-images/2e5dfccd-d7a1-414d-a2a4-6c0a31d42363"},{name:"twitter:image",content:"https://storage.googleapis.com/gpt-engineer-file-uploads/attachments/og-images/2e5dfccd-d7a1-414d-a2a4-6c0a31d42363"}],links:[{rel:"stylesheet",href:HC},{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:""},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap"}]}),shellComponent:bk,component:_k,notFoundComponent:yk,errorComponent:vk});function bk({children:t}){return Q.jsxs("html",{lang:"en",children:[Q.jsx("head",{children:Q.jsx(sA,{})}),Q.jsxs("body",{children:[t,Q.jsx(aA,{})]})]})}function _k(){const{queryClient:t}=br.useRouteContext();return Q.jsx(BC,{client:t,children:Q.jsxs(qC,{children:[Q.jsx($0,{}),Q.jsx(mk,{})]})})}const wk="modulepreload",Sk=function(t){return"/"+t},Mv={},Gs=function(e,r,a){let l=Promise.resolve();if(r&&r.length>0){let p=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");l=p(r.map(g=>{if(g=Sk(g),g in Mv)return;Mv[g]=!0;const y=g.endsWith(".css"),m=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${m}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":wk,y||(b.as="script"),b.crossOrigin="",b.href=g,h&&b.setAttribute("nonce",h),document.head.appendChild(b),y)return new Promise((_,S)=>{b.addEventListener("load",_),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return l.then(c=>{for(const h of c||[])h.status==="rejected"&&u(h.reason);return e().catch(u)})},Ek=()=>Gs(()=>import("./practices-d-GaMaxG.js"),__vite__mapDeps([0,1,2,3,4,5])),Tk=qs("/practices")({head:()=>({meta:[{title:"Practices — Crosse"}]}),component:$s(Ek,"component")}),Rk=()=>Gs(()=>import("./login-DNRhLIl0.js"),__vite__mapDeps([6,2,3])),Ak=qs("/login")({head:()=>({meta:[{title:"Sign in — Crosse"},{name:"description",content:"Sign in to track your lacrosse seasons, games, and practices."}]}),component:$s(Rk,"component")}),Ok=()=>Gs(()=>import("./games-uQBiUiCz.js"),__vite__mapDeps([7,1,2,3,4,5])),xk=qs("/games")({head:()=>({meta:[{title:"Games — Crosse"}]}),component:$s(Ok,"component")}),Ck=()=>Gs(()=>import("./dashboard-CqDxv2JI.js"),__vite__mapDeps([8,1,2])),kk=qs("/dashboard")({head:()=>({meta:[{title:"Dashboard — Crosse"}]}),component:$s(Ck,"component")}),jk=()=>Gs(()=>import("./index-CAuXec3S.js"),[]),Mk=qs("/")({component:$s(jk,"component")}),Nk=()=>Gs(()=>import("./seasons.index-DovSN_ac.js"),__vite__mapDeps([9,1,2,3,5,10])),Dk=qs("/seasons/")({head:()=>({meta:[{title:"Seasons — Crosse"}]}),component:$s(Nk,"component")}),Lk=()=>Gs(()=>import("./seasons._seasonId-CbHKA2Ip.js"),__vite__mapDeps([11,1,2,5,3,10])),Uk=qs("/seasons/$seasonId")({head:()=>({meta:[{title:"Season — Crosse"}]}),component:$s(Lk,"component")}),Pk=Tk.update({id:"/practices",path:"/practices",getParentRoute:()=>br}),zk=Ak.update({id:"/login",path:"/login",getParentRoute:()=>br}),Bk=xk.update({id:"/games",path:"/games",getParentRoute:()=>br}),Hk=kk.update({id:"/dashboard",path:"/dashboard",getParentRoute:()=>br}),Ik=Mk.update({id:"/",path:"/",getParentRoute:()=>br}),qk=Dk.update({id:"/seasons/",path:"/seasons/",getParentRoute:()=>br}),$k=Uk.update({id:"/seasons/$seasonId",path:"/seasons/$seasonId",getParentRoute:()=>br}),Gk={IndexRoute:Ik,DashboardRoute:Hk,GamesRoute:Bk,LoginRoute:zk,PracticesRoute:Pk,SeasonsSeasonIdRoute:$k,SeasonsIndexRoute:qk},Vk=br._addFileChildren(Gk),Kk=()=>{const t=new zC;return XR({routeTree:Vk,context:{queryClient:t},scrollRestoration:!0,defaultPreloadStaleTime:0})};async function Yk(){const t=await Kk();let e;if(wv){const r=await wv.getOptions();r.serializationAdapters=r.serializationAdapters??[],window.__TSS_START_OPTIONS__=r,e=r.serializationAdapters,t.options.defaultSsr=r.defaultSsr}else e=[],window.__TSS_START_OPTIONS__={serializationAdapters:e};return e.push(tR),t.options.serializationAdapters&&e.push(...t.options.serializationAdapters),t.update({basepath:"",serializationAdapters:e}),t.stores.matchesId.get().length||await rR(t),t}async function Fk(){const t=await Yk();return window.$_TSR?.h(),t}var hh;function Qk(){return hh||(hh=Fk()),Q.jsx(oR,{promise:hh,children:t=>Q.jsx(eA,{router:t})})}ne.startTransition(()=>{$w.hydrateRoot(document,Q.jsx(ne.StrictMode,{children:Q.jsx(Qk,{})}))});export{yC as A,vC as B,Dh as C,pb as D,MC as E,SC as F,Nt as G,a2 as H,Qh as L,Z as R,xu as S,Zk as T,qy as _,i2 as a,z0 as b,At as c,eR as d,H0 as e,Jk as f,Lv as g,Nv as h,Jt as i,Q as j,Uk as k,Xk as l,RR as m,Tu as n,r2 as o,jS as p,AC as q,ne as r,tu as s,l2 as t,o2 as u,bC as v,s2 as w,Lh as x,xn as y,yb as z};
