@pinkpixel/promptzy 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,227 +0,0 @@
1
- function k1(e,n){for(var a=0;a<n.length;a++){const s=n[a];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(s,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=a(o);fetch(o.href,c)}})();function b0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tf={exports:{}},Zi={};var Ov;function j1(){if(Ov)return Zi;Ov=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(s,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:u,ref:o!==void 0?o:null,props:c}}return Zi.Fragment=n,Zi.jsx=a,Zi.jsxs=a,Zi}var Nv;function D1(){return Nv||(Nv=1,Tf.exports=j1()),Tf.exports}var v=D1(),Cf={exports:{}},eo={},Rf={exports:{}},Af={};var kv;function M1(){return kv||(kv=1,(function(e){function n(D,V){var Z=D.length;D.push(V);e:for(;0<Z;){var se=Z-1>>>1,J=D[se];if(0<o(J,V))D[se]=V,D[Z]=J,Z=se;else break e}}function a(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var V=D[0],Z=D.pop();if(Z!==V){D[0]=Z;e:for(var se=0,J=D.length,j=J>>>1;se<j;){var G=2*(se+1)-1,K=D[G],ee=G+1,U=D[ee];if(0>o(K,Z))ee<J&&0>o(U,K)?(D[se]=U,D[ee]=Z,se=ee):(D[se]=K,D[G]=Z,se=G);else if(ee<J&&0>o(U,Z))D[se]=U,D[ee]=Z,se=ee;else break e}}return V}function o(D,V){var Z=D.sortIndex-V.sortIndex;return Z!==0?Z:D.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],y=1,g=null,x=3,S=!1,_=!1,E=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function k(D){for(var V=a(m);V!==null;){if(V.callback===null)s(m);else if(V.startTime<=D)s(m),V.sortIndex=V.expirationTime,n(p,V);else break;V=a(m)}}function I(D){if(E=!1,k(D),!_)if(a(p)!==null)_=!0,B||(B=!0,le());else{var V=a(m);V!==null&&ae(I,V.startTime-D)}}var B=!1,$=-1,q=5,ne=-1;function de(){return T?!0:!(e.unstable_now()-ne<q)}function he(){if(T=!1,B){var D=e.unstable_now();ne=D;var V=!0;try{e:{_=!1,E&&(E=!1,O($),$=-1),S=!0;var Z=x;try{t:{for(k(D),g=a(p);g!==null&&!(g.expirationTime>D&&de());){var se=g.callback;if(typeof se=="function"){g.callback=null,x=g.priorityLevel;var J=se(g.expirationTime<=D);if(D=e.unstable_now(),typeof J=="function"){g.callback=J,k(D),V=!0;break t}g===a(p)&&s(p),k(D)}else s(p);g=a(p)}if(g!==null)V=!0;else{var j=a(m);j!==null&&ae(I,j.startTime-D),V=!1}}break e}finally{g=null,x=Z,S=!1}V=void 0}}finally{V?le():B=!1}}}var le;if(typeof A=="function")le=function(){A(he)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,W=me.port2;me.port1.onmessage=he,le=function(){W.postMessage(null)}}else le=function(){R(he,0)};function ae(D,V){$=R(function(){D(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var Z=x;x=V;try{return D()}finally{x=Z}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,V){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var Z=x;x=D;try{return V()}finally{x=Z}},e.unstable_scheduleCallback=function(D,V,Z){var se=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?se+Z:se):Z=se,D){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=Z+J,D={id:y++,callback:V,priorityLevel:D,startTime:Z,expirationTime:J,sortIndex:-1},Z>se?(D.sortIndex=Z,n(m,D),a(p)===null&&D===a(m)&&(E?(O($),$=-1):E=!0,ae(I,Z-se))):(D.sortIndex=J,n(p,D),_||S||(_=!0,B||(B=!0,le()))),D},e.unstable_shouldYield=de,e.unstable_wrapCallback=function(D){var V=x;return function(){var Z=x;x=V;try{return D.apply(this,arguments)}finally{x=Z}}}})(Af)),Af}var jv;function L1(){return jv||(jv=1,Rf.exports=M1()),Rf.exports}var Of={exports:{}},Te={};var Dv;function U1(){if(Dv)return Te;Dv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function S(j){return j===null||typeof j!="object"?null:(j=x&&j[x]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function R(j,G,K){this.props=j,this.context=G,this.refs=T,this.updater=K||_}R.prototype.isReactComponent={},R.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,G,"setState")},R.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function O(){}O.prototype=R.prototype;function A(j,G,K){this.props=j,this.context=G,this.refs=T,this.updater=K||_}var k=A.prototype=new O;k.constructor=A,E(k,R.prototype),k.isPureReactComponent=!0;var I=Array.isArray;function B(){}var $={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function ne(j,G,K){var ee=K.ref;return{$$typeof:e,type:j,key:G,ref:ee!==void 0?ee:null,props:K}}function de(j,G){return ne(j.type,G,j.props)}function he(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function le(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(K){return G[K]})}var me=/\/+/g;function W(j,G){return typeof j=="object"&&j!==null&&j.key!=null?le(""+j.key):G.toString(36)}function ae(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(B,B):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function D(j,G,K,ee,U){var re=typeof j;(re==="undefined"||re==="boolean")&&(j=null);var ge=!1;if(j===null)ge=!0;else switch(re){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(j.$$typeof){case e:case n:ge=!0;break;case y:return ge=j._init,D(ge(j._payload),G,K,ee,U)}}if(ge)return U=U(j),ge=ee===""?"."+W(j,0):ee,I(U)?(K="",ge!=null&&(K=ge.replace(me,"$&/")+"/"),D(U,G,K,"",function(ce){return ce})):U!=null&&(he(U)&&(U=de(U,K+(U.key==null||j&&j.key===U.key?"":(""+U.key).replace(me,"$&/")+"/")+ge)),G.push(U)),1;ge=0;var Se=ee===""?".":ee+":";if(I(j))for(var ve=0;ve<j.length;ve++)ee=j[ve],re=Se+W(ee,ve),ge+=D(ee,G,K,re,U);else if(ve=S(j),typeof ve=="function")for(j=ve.call(j),ve=0;!(ee=j.next()).done;)ee=ee.value,re=Se+W(ee,ve++),ge+=D(ee,G,K,re,U);else if(re==="object"){if(typeof j.then=="function")return D(ae(j),G,K,ee,U);throw G=String(j),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ge}function V(j,G,K){if(j==null)return j;var ee=[],U=0;return D(j,ee,"","",function(re){return G.call(K,re,U++)}),ee}function Z(j){if(j._status===-1){var G=j._result;G=G(),G.then(function(K){(j._status===0||j._status===-1)&&(j._status=1,j._result=K)},function(K){(j._status===0||j._status===-1)&&(j._status=2,j._result=K)}),j._status===-1&&(j._status=0,j._result=G)}if(j._status===1)return j._result.default;throw j._result}var se=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},J={map:V,forEach:function(j,G,K){V(j,function(){G.apply(this,arguments)},K)},count:function(j){var G=0;return V(j,function(){G++}),G},toArray:function(j){return V(j,function(G){return G})||[]},only:function(j){if(!he(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Te.Activity=g,Te.Children=J,Te.Component=R,Te.Fragment=a,Te.Profiler=o,Te.PureComponent=A,Te.StrictMode=s,Te.Suspense=p,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Te.__COMPILER_RUNTIME={__proto__:null,c:function(j){return $.H.useMemoCache(j)}},Te.cache=function(j){return function(){return j.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(j,G,K){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ee=E({},j.props),U=j.key;if(G!=null)for(re in G.key!==void 0&&(U=""+G.key),G)!q.call(G,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&G.ref===void 0||(ee[re]=G[re]);var re=arguments.length-2;if(re===1)ee.children=K;else if(1<re){for(var ge=Array(re),Se=0;Se<re;Se++)ge[Se]=arguments[Se+2];ee.children=ge}return ne(j.type,U,ee)},Te.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:c,_context:j},j},Te.createElement=function(j,G,K){var ee,U={},re=null;if(G!=null)for(ee in G.key!==void 0&&(re=""+G.key),G)q.call(G,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(U[ee]=G[ee]);var ge=arguments.length-2;if(ge===1)U.children=K;else if(1<ge){for(var Se=Array(ge),ve=0;ve<ge;ve++)Se[ve]=arguments[ve+2];U.children=Se}if(j&&j.defaultProps)for(ee in ge=j.defaultProps,ge)U[ee]===void 0&&(U[ee]=ge[ee]);return ne(j,re,U)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(j){return{$$typeof:f,render:j}},Te.isValidElement=he,Te.lazy=function(j){return{$$typeof:y,_payload:{_status:-1,_result:j},_init:Z}},Te.memo=function(j,G){return{$$typeof:m,type:j,compare:G===void 0?null:G}},Te.startTransition=function(j){var G=$.T,K={};$.T=K;try{var ee=j(),U=$.S;U!==null&&U(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(B,se)}catch(re){se(re)}finally{G!==null&&K.types!==null&&(G.types=K.types),$.T=G}},Te.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Te.use=function(j){return $.H.use(j)},Te.useActionState=function(j,G,K){return $.H.useActionState(j,G,K)},Te.useCallback=function(j,G){return $.H.useCallback(j,G)},Te.useContext=function(j){return $.H.useContext(j)},Te.useDebugValue=function(){},Te.useDeferredValue=function(j,G){return $.H.useDeferredValue(j,G)},Te.useEffect=function(j,G){return $.H.useEffect(j,G)},Te.useEffectEvent=function(j){return $.H.useEffectEvent(j)},Te.useId=function(){return $.H.useId()},Te.useImperativeHandle=function(j,G,K){return $.H.useImperativeHandle(j,G,K)},Te.useInsertionEffect=function(j,G){return $.H.useInsertionEffect(j,G)},Te.useLayoutEffect=function(j,G){return $.H.useLayoutEffect(j,G)},Te.useMemo=function(j,G){return $.H.useMemo(j,G)},Te.useOptimistic=function(j,G){return $.H.useOptimistic(j,G)},Te.useReducer=function(j,G,K){return $.H.useReducer(j,G,K)},Te.useRef=function(j){return $.H.useRef(j)},Te.useState=function(j){return $.H.useState(j)},Te.useSyncExternalStore=function(j,G,K){return $.H.useSyncExternalStore(j,G,K)},Te.useTransition=function(){return $.H.useTransition()},Te.version="19.2.4",Te}var Mv;function Ph(){return Mv||(Mv=1,Of.exports=U1()),Of.exports}var Nf={exports:{}},kt={};var Lv;function P1(){if(Lv)return kt;Lv=1;var e=Ph();function n(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(p,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:p,containerInfo:m,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,kt.createPortal=function(p,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return c(p,m,null,y)},kt.flushSync=function(p){var m=u.T,y=s.p;try{if(u.T=null,s.p=2,p)return p()}finally{u.T=m,s.p=y,s.d.f()}},kt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,s.d.C(p,m))},kt.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},kt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?s.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:S}):y==="script"&&s.d.X(p,{crossOrigin:g,integrity:x,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},kt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);s.d.M(p,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&s.d.M(p)},kt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin);s.d.L(p,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},kt.preloadModule=function(p,m){if(typeof p=="string")if(m){var y=f(m.as,m.crossOrigin);s.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else s.d.m(p)},kt.requestFormReset=function(p){s.d.r(p)},kt.unstable_batchedUpdates=function(p,m){return p(m)},kt.useFormState=function(p,m,y){return u.H.useFormState(p,m,y)},kt.useFormStatus=function(){return u.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var Uv;function w0(){if(Uv)return Nf.exports;Uv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Nf.exports=P1(),Nf.exports}var Pv;function z1(){if(Pv)return eo;Pv=1;var e=L1(),n=Ph(),a=w0();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(s(188))}function m(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(s(188));return r!==t?null:t}for(var i=t,l=r;;){var d=i.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===i)return p(d),t;if(h===l)return p(d),r;h=h.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=h;else{for(var w=!1,C=d.child;C;){if(C===i){w=!0,i=d,l=h;break}if(C===l){w=!0,l=d,i=h;break}C=C.sibling}if(!w){for(C=h.child;C;){if(C===i){w=!0,i=h,l=d;break}if(C===l){w=!0,l=h,i=d;break}C=C.sibling}if(!w)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),A=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function le(t){return t===null||typeof t!="object"?null:(t=he&&t[he]||t["@@iterator"],typeof t=="function"?t:null)}var me=Symbol.for("react.client.reference");function W(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===me?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case B:return"SuspenseList";case ne:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case A:return t.displayName||"Context";case O:return(t._context.displayName||"Context")+".Consumer";case k:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case $:return r=t.displayName||null,r!==null?r:W(t.type)||"Memo";case q:r=t._payload,t=t._init;try{return W(t(r))}catch{}}return null}var ae=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},se=[],J=-1;function j(t){return{current:t}}function G(t){0>J||(t.current=se[J],se[J]=null,J--)}function K(t,r){J++,se[J]=t.current,t.current=r}var ee=j(null),U=j(null),re=j(null),ge=j(null);function Se(t,r){switch(K(re,r),K(U,t),K(ee,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Jy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Jy(r),t=Zy(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(ee),K(ee,t)}function ve(){G(ee),G(U),G(re)}function ce(t){t.memoizedState!==null&&K(ge,t);var r=ee.current,i=Zy(r,t.type);r!==i&&(K(U,t),K(ee,i))}function be(t){U.current===t&&(G(ee),G(U)),ge.current===t&&(G(ge),Xi._currentValue=Z)}var Ce,et;function Ue(t){if(Ce===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);Ce=r&&r[1]||"",et=-1<i.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Ce+t+et}var Kt=!1;function Fa(t,r){if(!t||Kt)return"";Kt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(F){var H=F}Reflect.construct(t,[],Q)}else{try{Q.call()}catch(F){H=F}t.call(Q.prototype)}}else{try{throw Error()}catch(F){H=F}(Q=t())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(F){if(F&&H&&typeof F.stack=="string")return[F.stack,H.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),w=h[0],C=h[1];if(w&&C){var N=w.split(`
4
- `),z=C.split(`
5
- `);for(d=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;d<z.length&&!z[d].includes("DetermineComponentFrameRoot");)d++;if(l===N.length||d===z.length)for(l=N.length-1,d=z.length-1;1<=l&&0<=d&&N[l]!==z[d];)d--;for(;1<=l&&0<=d;l--,d--)if(N[l]!==z[d]){if(l!==1||d!==1)do if(l--,d--,0>d||N[l]!==z[d]){var Y=`
6
- `+N[l].replace(" at new "," at ");return t.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",t.displayName)),Y}while(1<=l&&0<=d);break}}}finally{Kt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Ue(i):""}function ca(t,r){switch(t.tag){case 26:case 27:case 5:return Ue(t.type);case 16:return Ue("Lazy");case 13:return t.child!==r&&r!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return Fa(t.type,!1);case 11:return Fa(t.type.render,!1);case 1:return Fa(t.type,!0);case 31:return Ue("Activity");default:return""}}function si(t){try{var r="",i=null;do r+=ca(t,i),i=t,t=t.return;while(t);return r}catch(l){return`
7
- Error generating stack: `+l.message+`
8
- `+l.stack}}var Xt=Object.prototype.hasOwnProperty,ii=e.unstable_scheduleCallback,oi=e.unstable_cancelCallback,jt=e.unstable_shouldYield,Cr=e.unstable_requestPaint,Dt=e.unstable_now,fu=e.unstable_getCurrentPriorityLevel,ua=e.unstable_ImmediatePriority,Po=e.unstable_UserBlockingPriority,da=e.unstable_NormalPriority,li=e.unstable_LowPriority,Kn=e.unstable_IdlePriority,zo=e.log,Rr=e.unstable_setDisableYieldValue,fa=null,Mt=null;function bn(t){if(typeof zo=="function"&&Rr(t),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(fa,t)}catch{}}var Ot=Math.clz32?Math.clz32:Dn,hu=Math.log,ci=Math.LN2;function Dn(t){return t>>>=0,t===0?32:31-(hu(t)/ci|0)|0}var Va=256,Ga=262144,ha=4194304;function Mn(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _e(t,r,i){var l=t.pendingLanes;if(l===0)return 0;var d=0,h=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var C=l&134217727;return C!==0?(l=C&~h,l!==0?d=Mn(l):(w&=C,w!==0?d=Mn(w):i||(i=C&~t,i!==0&&(d=Mn(i))))):(C=l&~h,C!==0?d=Mn(C):w!==0?d=Mn(w):i||(i=l&~t,i!==0&&(d=Mn(i)))),d===0?0:r!==0&&r!==d&&(r&h)===0&&(h=d&-d,i=r&-r,h>=i||h===32&&(i&4194048)!==0)?r:d}function We(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function vt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Nt(){var t=ha;return ha<<=1,(ha&62914560)===0&&(ha=4194304),t}function Ar(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function tt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Pt(t,r,i,l,d,h){var w=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var C=t.entanglements,N=t.expirationTimes,z=t.hiddenUpdates;for(i=w&~i;0<i;){var Y=31-Ot(i),Q=1<<Y;C[Y]=0,N[Y]=-1;var H=z[Y];if(H!==null)for(z[Y]=null,Y=0;Y<H.length;Y++){var F=H[Y];F!==null&&(F.lane&=-536870913)}i&=~Q}l!==0&&pa(t,l,0),h!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=h&~(w&~r))}function pa(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Ot(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|i&261930}function zt(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var l=31-Ot(i),d=1<<l;d&r|t[l]&r&&(t[l]|=r),i&=~d}}function It(t,r){var i=r&-r;return i=(i&42)!==0?1:Ya(i),(i&(t.suspendedLanes|r))!==0?0:i}function Ya(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function wn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pu(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:Sv(t.type))}function zp(t,r){var i=V.p;try{return V.p=t,r()}finally{V.p=i}}var Or=Math.random().toString(36).slice(2),St="__reactFiber$"+Or,Bt="__reactProps$"+Or,Ka="__reactContainer$"+Or,mu="__reactEvents$"+Or,wE="__reactListeners$"+Or,xE="__reactHandles$"+Or,Ip="__reactResources$"+Or,ui="__reactMarker$"+Or;function gu(t){delete t[St],delete t[Bt],delete t[mu],delete t[wE],delete t[xE]}function Xa(t){var r=t[St];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Ka]||i[St]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=iv(t);t!==null;){if(i=t[St])return i;t=iv(t)}return r}t=i,i=t.parentNode}return null}function Qa(t){if(t=t[St]||t[Ka]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function di(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function Wa(t){var r=t[Ip];return r||(r=t[Ip]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function bt(t){t[ui]=!0}var Bp=new Set,$p={};function ma(t,r){Ja(t,r),Ja(t+"Capture",r)}function Ja(t,r){for($p[t]=r,t=0;t<r.length;t++)Bp.add(r[t])}var SE=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]*$"),Hp={},qp={};function EE(t){return Xt.call(qp,t)?!0:Xt.call(Hp,t)?!1:SE.test(t)?qp[t]=!0:(Hp[t]=!0,!1)}function Io(t,r,i){if(EE(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+i)}}function Bo(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+i)}}function Xn(t,r,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,""+l)}}function ln(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Fp(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function _E(t,r,i){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(w){i=""+w,h.call(this,w)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function yu(t){if(!t._valueTracker){var r=Fp(t)?"checked":"value";t._valueTracker=_E(t,r,""+t[r])}}function Vp(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return t&&(l=Fp(t)?t.checked?"true":"false":t.value),t=l,t!==i?(r.setValue(t),!0):!1}function $o(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var TE=/[\n"\\]/g;function cn(t){return t.replace(TE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function vu(t,r,i,l,d,h,w,C){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),r!=null?w==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+ln(r)):t.value!==""+ln(r)&&(t.value=""+ln(r)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),r!=null?bu(t,w,ln(r)):i!=null?bu(t,w,ln(i)):l!=null&&t.removeAttribute("value"),d==null&&h!=null&&(t.defaultChecked=!!h),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+ln(C):t.removeAttribute("name")}function Gp(t,r,i,l,d,h,w,C){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),r!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||r!=null)){yu(t);return}i=i!=null?""+ln(i):"",r=r!=null?""+ln(r):i,C||r===t.value||(t.value=r),t.defaultValue=r}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=C?t.checked:!!l,t.defaultChecked=!!l,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),yu(t)}function bu(t,r,i){r==="number"&&$o(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Za(t,r,i,l){if(t=t.options,r){r={};for(var d=0;d<i.length;d++)r["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=r.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&l&&(t[i].defaultSelected=!0)}else{for(i=""+ln(i),r=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,l&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function Yp(t,r,i){if(r!=null&&(r=""+ln(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i!=null?""+ln(i):""}function Kp(t,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(ae(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),r=i}i=ln(r),t.defaultValue=i,l=t.textContent,l===i&&l!==""&&l!==null&&(t.value=l),yu(t)}function es(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var CE=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 Xp(t,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,i):typeof i!="number"||i===0||CE.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function Qp(t,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var d in r)l=r[d],r.hasOwnProperty(d)&&i[d]!==l&&Xp(t,d,l)}else for(var h in r)r.hasOwnProperty(h)&&Xp(t,h,r[h])}function wu(t){if(t.indexOf("-")===-1)return!1;switch(t){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 RE=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"]]),AE=/^[\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 Ho(t){return AE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Qn(){}var xu=null;function Su(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ts=null,ns=null;function Wp(t){var r=Qa(t);if(r&&(t=r.stateNode)){var i=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(vu(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+cn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==t&&l.form===t.form){var d=l[Bt]||null;if(!d)throw Error(s(90));vu(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===t.form&&Vp(l)}break e;case"textarea":Yp(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Za(t,!!i.multiple,r,!1)}}}var Eu=!1;function Jp(t,r,i){if(Eu)return t(r,i);Eu=!0;try{var l=t(r);return l}finally{if(Eu=!1,(ts!==null||ns!==null)&&(Ol(),ts&&(r=ts,t=ns,ns=ts=null,Wp(r),t)))for(r=0;r<t.length;r++)Wp(t[r])}}function fi(t,r){var i=t.stateNode;if(i===null)return null;var l=i[Bt]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=!1;if(Wn)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){_u=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{_u=!1}var Nr=null,Tu=null,qo=null;function Zp(){if(qo)return qo;var t,r=Tu,i=r.length,l,d="value"in Nr?Nr.value:Nr.textContent,h=d.length;for(t=0;t<i&&r[t]===d[t];t++);var w=i-t;for(l=1;l<=w&&r[i-l]===d[h-l];l++);return qo=d.slice(t,1<l?1-l:void 0)}function Fo(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Vo(){return!0}function em(){return!1}function $t(t){function r(i,l,d,h,w){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=w,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(i=t[C],this[C]=i?i(h):h[C]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Vo:em,this.isPropagationStopped=em,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Vo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Vo)},persist:function(){},isPersistent:Vo}),r}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=$t(ga),pi=g({},ga,{view:0,detail:0}),OE=$t(pi),Cu,Ru,mi,Yo=g({},pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ou,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==mi&&(mi&&t.type==="mousemove"?(Cu=t.screenX-mi.screenX,Ru=t.screenY-mi.screenY):Ru=Cu=0,mi=t),Cu)},movementY:function(t){return"movementY"in t?t.movementY:Ru}}),tm=$t(Yo),NE=g({},Yo,{dataTransfer:0}),kE=$t(NE),jE=g({},pi,{relatedTarget:0}),Au=$t(jE),DE=g({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),ME=$t(DE),LE=g({},ga,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),UE=$t(LE),PE=g({},ga,{data:0}),nm=$t(PE),zE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IE={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"},BE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $E(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=BE[t])?!!r[t]:!1}function Ou(){return $E}var HE=g({},pi,{key:function(t){if(t.key){var r=zE[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Fo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?IE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ou,charCode:function(t){return t.type==="keypress"?Fo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Fo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qE=$t(HE),FE=g({},Yo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rm=$t(FE),VE=g({},pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ou}),GE=$t(VE),YE=g({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),KE=$t(YE),XE=g({},Yo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),QE=$t(XE),WE=g({},ga,{newState:0,oldState:0}),JE=$t(WE),ZE=[9,13,27,32],Nu=Wn&&"CompositionEvent"in window,gi=null;Wn&&"documentMode"in document&&(gi=document.documentMode);var e_=Wn&&"TextEvent"in window&&!gi,am=Wn&&(!Nu||gi&&8<gi&&11>=gi),sm=" ",im=!1;function om(t,r){switch(t){case"keyup":return ZE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var rs=!1;function t_(t,r){switch(t){case"compositionend":return lm(r);case"keypress":return r.which!==32?null:(im=!0,sm);case"textInput":return t=r.data,t===sm&&im?null:t;default:return null}}function n_(t,r){if(rs)return t==="compositionend"||!Nu&&om(t,r)?(t=Zp(),qo=Tu=Nr=null,rs=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return am&&r.locale!=="ko"?null:r.data;default:return null}}var r_={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 cm(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!r_[t.type]:r==="textarea"}function um(t,r,i,l){ts?ns?ns.push(l):ns=[l]:ts=l,r=Ul(r,"onChange"),0<r.length&&(i=new Go("onChange","change",null,i,l),t.push({event:i,listeners:r}))}var yi=null,vi=null;function a_(t){Gy(t,0)}function Ko(t){var r=di(t);if(Vp(r))return t}function dm(t,r){if(t==="change")return r}var fm=!1;if(Wn){var ku;if(Wn){var ju="oninput"in document;if(!ju){var hm=document.createElement("div");hm.setAttribute("oninput","return;"),ju=typeof hm.oninput=="function"}ku=ju}else ku=!1;fm=ku&&(!document.documentMode||9<document.documentMode)}function pm(){yi&&(yi.detachEvent("onpropertychange",mm),vi=yi=null)}function mm(t){if(t.propertyName==="value"&&Ko(vi)){var r=[];um(r,vi,t,Su(t)),Jp(a_,r)}}function s_(t,r,i){t==="focusin"?(pm(),yi=r,vi=i,yi.attachEvent("onpropertychange",mm)):t==="focusout"&&pm()}function i_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ko(vi)}function o_(t,r){if(t==="click")return Ko(r)}function l_(t,r){if(t==="input"||t==="change")return Ko(r)}function c_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Qt=typeof Object.is=="function"?Object.is:c_;function bi(t,r){if(Qt(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!Xt.call(r,d)||!Qt(t[d],r[d]))return!1}return!0}function gm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ym(t,r){var i=gm(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=r&&l>=r)return{node:i,offset:r-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=gm(i)}}function vm(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?vm(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function bm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=$o(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=$o(t.document)}return r}function Du(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var u_=Wn&&"documentMode"in document&&11>=document.documentMode,as=null,Mu=null,wi=null,Lu=!1;function wm(t,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Lu||as==null||as!==$o(l)||(l=as,"selectionStart"in l&&Du(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),wi&&bi(wi,l)||(wi=l,l=Ul(Mu,"onSelect"),0<l.length&&(r=new Go("onSelect","select",null,r,i),t.push({event:r,listeners:l}),r.target=as)))}function ya(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var ss={animationend:ya("Animation","AnimationEnd"),animationiteration:ya("Animation","AnimationIteration"),animationstart:ya("Animation","AnimationStart"),transitionrun:ya("Transition","TransitionRun"),transitionstart:ya("Transition","TransitionStart"),transitioncancel:ya("Transition","TransitionCancel"),transitionend:ya("Transition","TransitionEnd")},Uu={},xm={};Wn&&(xm=document.createElement("div").style,"AnimationEvent"in window||(delete ss.animationend.animation,delete ss.animationiteration.animation,delete ss.animationstart.animation),"TransitionEvent"in window||delete ss.transitionend.transition);function va(t){if(Uu[t])return Uu[t];if(!ss[t])return t;var r=ss[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in xm)return Uu[t]=r[i];return t}var Sm=va("animationend"),Em=va("animationiteration"),_m=va("animationstart"),d_=va("transitionrun"),f_=va("transitionstart"),h_=va("transitioncancel"),Tm=va("transitionend"),Cm=new Map,Pu="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(" ");Pu.push("scrollEnd");function xn(t,r){Cm.set(t,r),ma(r,[t])}var Xo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},un=[],is=0,zu=0;function Qo(){for(var t=is,r=zu=is=0;r<t;){var i=un[r];un[r++]=null;var l=un[r];un[r++]=null;var d=un[r];un[r++]=null;var h=un[r];if(un[r++]=null,l!==null&&d!==null){var w=l.pending;w===null?d.next=d:(d.next=w.next,w.next=d),l.pending=d}h!==0&&Rm(i,d,h)}}function Wo(t,r,i,l){un[is++]=t,un[is++]=r,un[is++]=i,un[is++]=l,zu|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Iu(t,r,i,l){return Wo(t,r,i,l),Jo(t)}function ba(t,r){return Wo(t,null,null,r),Jo(t)}function Rm(t,r,i){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i);for(var d=!1,h=t.return;h!==null;)h.childLanes|=i,l=h.alternate,l!==null&&(l.childLanes|=i),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(d=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,d&&r!==null&&(d=31-Ot(i),t=h.hiddenUpdates,l=t[d],l===null?t[d]=[r]:l.push(r),r.lane=i|536870912),h):null}function Jo(t){if(50<Hi)throw Hi=0,Kd=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var os={};function p_(t,r,i,l){this.tag=t,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=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(t,r,i,l){return new p_(t,r,i,l)}function Bu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jn(t,r){var i=t.alternate;return i===null?(i=Wt(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Am(t,r){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Zo(t,r,i,l,d,h){var w=0;if(l=t,typeof t=="function")Bu(t)&&(w=1);else if(typeof t=="string")w=b1(t,i,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ne:return t=Wt(31,i,r,d),t.elementType=ne,t.lanes=h,t;case E:return wa(i.children,d,h,r);case T:w=8,d|=24;break;case R:return t=Wt(12,i,r,d|2),t.elementType=R,t.lanes=h,t;case I:return t=Wt(13,i,r,d),t.elementType=I,t.lanes=h,t;case B:return t=Wt(19,i,r,d),t.elementType=B,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A:w=10;break e;case O:w=9;break e;case k:w=11;break e;case $:w=14;break e;case q:w=16,l=null;break e}w=29,i=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=Wt(w,i,r,d),r.elementType=t,r.type=l,r.lanes=h,r}function wa(t,r,i,l){return t=Wt(7,t,l,r),t.lanes=i,t}function $u(t,r,i){return t=Wt(6,t,null,r),t.lanes=i,t}function Om(t){var r=Wt(18,null,null,0);return r.stateNode=t,r}function Hu(t,r,i){return r=Wt(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Nm=new WeakMap;function dn(t,r){if(typeof t=="object"&&t!==null){var i=Nm.get(t);return i!==void 0?i:(r={value:t,source:r,stack:si(r)},Nm.set(t,r),r)}return{value:t,source:r,stack:si(r)}}var ls=[],cs=0,el=null,xi=0,fn=[],hn=0,kr=null,Ln=1,Un="";function Zn(t,r){ls[cs++]=xi,ls[cs++]=el,el=t,xi=r}function km(t,r,i){fn[hn++]=Ln,fn[hn++]=Un,fn[hn++]=kr,kr=t;var l=Ln;t=Un;var d=32-Ot(l)-1;l&=~(1<<d),i+=1;var h=32-Ot(r)+d;if(30<h){var w=d-d%5;h=(l&(1<<w)-1).toString(32),l>>=w,d-=w,Ln=1<<32-Ot(r)+d|i<<d|l,Un=h+t}else Ln=1<<h|i<<d|l,Un=t}function qu(t){t.return!==null&&(Zn(t,1),km(t,1,0))}function Fu(t){for(;t===el;)el=ls[--cs],ls[cs]=null,xi=ls[--cs],ls[cs]=null;for(;t===kr;)kr=fn[--hn],fn[hn]=null,Un=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null}function jm(t,r){fn[hn++]=Ln,fn[hn++]=Un,fn[hn++]=kr,Ln=r.id,Un=r.overflow,kr=t}var Et=null,Xe=null,Le=!1,jr=null,pn=!1,Vu=Error(s(519));function Dr(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Si(dn(r,t)),Vu}function Dm(t){var r=t.stateNode,i=t.type,l=t.memoizedProps;switch(r[St]=t,r[Bt]=l,i){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(i=0;i<Fi.length;i++)ke(Fi[i],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":ke("invalid",r),Gp(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ke("invalid",r);break;case"textarea":ke("invalid",r),Kp(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||Qy(r.textContent,i)?(l.popover!=null&&(ke("beforetoggle",r),ke("toggle",r)),l.onScroll!=null&&ke("scroll",r),l.onScrollEnd!=null&&ke("scrollend",r),l.onClick!=null&&(r.onclick=Qn),r=!0):r=!1,r||Dr(t,!0)}function Mm(t){for(Et=t.return;Et;)switch(Et.tag){case 5:case 31:case 13:pn=!1;return;case 27:case 3:pn=!0;return;default:Et=Et.return}}function us(t){if(t!==Et)return!1;if(!Le)return Mm(t),Le=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||uf(t.type,t.memoizedProps)),i=!i),i&&Xe&&Dr(t),Mm(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Xe=sv(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Xe=sv(t)}else r===27?(r=Xe,Yr(t.type)?(t=mf,mf=null,Xe=t):Xe=r):Xe=Et?gn(t.stateNode.nextSibling):null;return!0}function xa(){Xe=Et=null,Le=!1}function Gu(){var t=jr;return t!==null&&(Vt===null?Vt=t:Vt.push.apply(Vt,t),jr=null),t}function Si(t){jr===null?jr=[t]:jr.push(t)}var Yu=j(null),Sa=null,er=null;function Mr(t,r,i){K(Yu,r._currentValue),r._currentValue=i}function tr(t){t._currentValue=Yu.current,G(Yu)}function Ku(t,r,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),t===i)break;t=t.return}}function Xu(t,r,i,l){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var h=d.dependencies;if(h!==null){var w=d.child;h=h.firstContext;e:for(;h!==null;){var C=h;h=d;for(var N=0;N<r.length;N++)if(C.context===r[N]){h.lanes|=i,C=h.alternate,C!==null&&(C.lanes|=i),Ku(h.return,i,t),l||(w=null);break e}h=C.next}}else if(d.tag===18){if(w=d.return,w===null)throw Error(s(341));w.lanes|=i,h=w.alternate,h!==null&&(h.lanes|=i),Ku(w,i,t),w=null}else w=d.child;if(w!==null)w.return=d;else for(w=d;w!==null;){if(w===t){w=null;break}if(d=w.sibling,d!==null){d.return=w.return,w=d;break}w=w.return}d=w}}function ds(t,r,i,l){t=null;for(var d=r,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var w=d.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var C=d.type;Qt(d.pendingProps.value,w.value)||(t!==null?t.push(C):t=[C])}}else if(d===ge.current){if(w=d.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(Xi):t=[Xi])}d=d.return}t!==null&&Xu(r,t,i,l),r.flags|=262144}function tl(t){for(t=t.firstContext;t!==null;){if(!Qt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ea(t){Sa=t,er=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function _t(t){return Lm(Sa,t)}function nl(t,r){return Sa===null&&Ea(t),Lm(t,r)}function Lm(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},er===null){if(t===null)throw Error(s(308));er=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else er=er.next=r;return i}var m_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},g_=e.unstable_scheduleCallback,y_=e.unstable_NormalPriority,lt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qu(){return{controller:new m_,data:new Map,refCount:0}}function Ei(t){t.refCount--,t.refCount===0&&g_(y_,function(){t.controller.abort()})}var _i=null,Wu=0,fs=0,hs=null;function v_(t,r){if(_i===null){var i=_i=[];Wu=0,fs=ef(),hs={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Wu++,r.then(Um,Um),r}function Um(){if(--Wu===0&&_i!==null){hs!==null&&(hs.status="fulfilled");var t=_i;_i=null,fs=0,hs=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function b_(t,r){var i=[],l={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var d=0;d<i.length;d++)(0,i[d])(r)},function(d){for(l.status="rejected",l.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),l}var Pm=D.S;D.S=function(t,r){wy=Dt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&v_(t,r),Pm!==null&&Pm(t,r)};var _a=j(null);function Ju(){var t=_a.current;return t!==null?t:Ye.pooledCache}function rl(t,r){r===null?K(_a,_a.current):K(_a,r.pool)}function zm(){var t=Ju();return t===null?null:{parent:lt._currentValue,pool:t}}var ps=Error(s(460)),Zu=Error(s(474)),al=Error(s(542)),sl={then:function(){}};function Im(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Bm(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then(Qn,Qn),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Hm(t),t;default:if(typeof r.status=="string")r.then(Qn,Qn);else{if(t=Ye,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=l}},function(l){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Hm(t),t}throw Ca=r,ps}}function Ta(t){try{var r=t._init;return r(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ca=i,ps):i}}var Ca=null;function $m(){if(Ca===null)throw Error(s(459));var t=Ca;return Ca=null,t}function Hm(t){if(t===ps||t===al)throw Error(s(483))}var ms=null,Ti=0;function il(t){var r=Ti;return Ti+=1,ms===null&&(ms=[]),Bm(ms,t,r)}function Ci(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function ol(t,r){throw r.$$typeof===x?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function qm(t){function r(L,M){if(t){var P=L.deletions;P===null?(L.deletions=[M],L.flags|=16):P.push(M)}}function i(L,M){if(!t)return null;for(;M!==null;)r(L,M),M=M.sibling;return null}function l(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function d(L,M){return L=Jn(L,M),L.index=0,L.sibling=null,L}function h(L,M,P){return L.index=P,t?(P=L.alternate,P!==null?(P=P.index,P<M?(L.flags|=67108866,M):P):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function w(L){return t&&L.alternate===null&&(L.flags|=67108866),L}function C(L,M,P,X){return M===null||M.tag!==6?(M=$u(P,L.mode,X),M.return=L,M):(M=d(M,P),M.return=L,M)}function N(L,M,P,X){var ye=P.type;return ye===E?Y(L,M,P.props.children,X,P.key):M!==null&&(M.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===q&&Ta(ye)===M.type)?(M=d(M,P.props),Ci(M,P),M.return=L,M):(M=Zo(P.type,P.key,P.props,null,L.mode,X),Ci(M,P),M.return=L,M)}function z(L,M,P,X){return M===null||M.tag!==4||M.stateNode.containerInfo!==P.containerInfo||M.stateNode.implementation!==P.implementation?(M=Hu(P,L.mode,X),M.return=L,M):(M=d(M,P.children||[]),M.return=L,M)}function Y(L,M,P,X,ye){return M===null||M.tag!==7?(M=wa(P,L.mode,X,ye),M.return=L,M):(M=d(M,P),M.return=L,M)}function Q(L,M,P){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=$u(""+M,L.mode,P),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return P=Zo(M.type,M.key,M.props,null,L.mode,P),Ci(P,M),P.return=L,P;case _:return M=Hu(M,L.mode,P),M.return=L,M;case q:return M=Ta(M),Q(L,M,P)}if(ae(M)||le(M))return M=wa(M,L.mode,P,null),M.return=L,M;if(typeof M.then=="function")return Q(L,il(M),P);if(M.$$typeof===A)return Q(L,nl(L,M),P);ol(L,M)}return null}function H(L,M,P,X){var ye=M!==null?M.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return ye!==null?null:C(L,M,""+P,X);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case S:return P.key===ye?N(L,M,P,X):null;case _:return P.key===ye?z(L,M,P,X):null;case q:return P=Ta(P),H(L,M,P,X)}if(ae(P)||le(P))return ye!==null?null:Y(L,M,P,X,null);if(typeof P.then=="function")return H(L,M,il(P),X);if(P.$$typeof===A)return H(L,M,nl(L,P),X);ol(L,P)}return null}function F(L,M,P,X,ye){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return L=L.get(P)||null,C(M,L,""+X,ye);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case S:return L=L.get(X.key===null?P:X.key)||null,N(M,L,X,ye);case _:return L=L.get(X.key===null?P:X.key)||null,z(M,L,X,ye);case q:return X=Ta(X),F(L,M,P,X,ye)}if(ae(X)||le(X))return L=L.get(P)||null,Y(M,L,X,ye,null);if(typeof X.then=="function")return F(L,M,P,il(X),ye);if(X.$$typeof===A)return F(L,M,P,nl(M,X),ye);ol(M,X)}return null}function ie(L,M,P,X){for(var ye=null,Pe=null,fe=M,Ae=M=0,Me=null;fe!==null&&Ae<P.length;Ae++){fe.index>Ae?(Me=fe,fe=null):Me=fe.sibling;var ze=H(L,fe,P[Ae],X);if(ze===null){fe===null&&(fe=Me);break}t&&fe&&ze.alternate===null&&r(L,fe),M=h(ze,M,Ae),Pe===null?ye=ze:Pe.sibling=ze,Pe=ze,fe=Me}if(Ae===P.length)return i(L,fe),Le&&Zn(L,Ae),ye;if(fe===null){for(;Ae<P.length;Ae++)fe=Q(L,P[Ae],X),fe!==null&&(M=h(fe,M,Ae),Pe===null?ye=fe:Pe.sibling=fe,Pe=fe);return Le&&Zn(L,Ae),ye}for(fe=l(fe);Ae<P.length;Ae++)Me=F(fe,L,Ae,P[Ae],X),Me!==null&&(t&&Me.alternate!==null&&fe.delete(Me.key===null?Ae:Me.key),M=h(Me,M,Ae),Pe===null?ye=Me:Pe.sibling=Me,Pe=Me);return t&&fe.forEach(function(Jr){return r(L,Jr)}),Le&&Zn(L,Ae),ye}function we(L,M,P,X){if(P==null)throw Error(s(151));for(var ye=null,Pe=null,fe=M,Ae=M=0,Me=null,ze=P.next();fe!==null&&!ze.done;Ae++,ze=P.next()){fe.index>Ae?(Me=fe,fe=null):Me=fe.sibling;var Jr=H(L,fe,ze.value,X);if(Jr===null){fe===null&&(fe=Me);break}t&&fe&&Jr.alternate===null&&r(L,fe),M=h(Jr,M,Ae),Pe===null?ye=Jr:Pe.sibling=Jr,Pe=Jr,fe=Me}if(ze.done)return i(L,fe),Le&&Zn(L,Ae),ye;if(fe===null){for(;!ze.done;Ae++,ze=P.next())ze=Q(L,ze.value,X),ze!==null&&(M=h(ze,M,Ae),Pe===null?ye=ze:Pe.sibling=ze,Pe=ze);return Le&&Zn(L,Ae),ye}for(fe=l(fe);!ze.done;Ae++,ze=P.next())ze=F(fe,L,Ae,ze.value,X),ze!==null&&(t&&ze.alternate!==null&&fe.delete(ze.key===null?Ae:ze.key),M=h(ze,M,Ae),Pe===null?ye=ze:Pe.sibling=ze,Pe=ze);return t&&fe.forEach(function(N1){return r(L,N1)}),Le&&Zn(L,Ae),ye}function Ge(L,M,P,X){if(typeof P=="object"&&P!==null&&P.type===E&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case S:e:{for(var ye=P.key;M!==null;){if(M.key===ye){if(ye=P.type,ye===E){if(M.tag===7){i(L,M.sibling),X=d(M,P.props.children),X.return=L,L=X;break e}}else if(M.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===q&&Ta(ye)===M.type){i(L,M.sibling),X=d(M,P.props),Ci(X,P),X.return=L,L=X;break e}i(L,M);break}else r(L,M);M=M.sibling}P.type===E?(X=wa(P.props.children,L.mode,X,P.key),X.return=L,L=X):(X=Zo(P.type,P.key,P.props,null,L.mode,X),Ci(X,P),X.return=L,L=X)}return w(L);case _:e:{for(ye=P.key;M!==null;){if(M.key===ye)if(M.tag===4&&M.stateNode.containerInfo===P.containerInfo&&M.stateNode.implementation===P.implementation){i(L,M.sibling),X=d(M,P.children||[]),X.return=L,L=X;break e}else{i(L,M);break}else r(L,M);M=M.sibling}X=Hu(P,L.mode,X),X.return=L,L=X}return w(L);case q:return P=Ta(P),Ge(L,M,P,X)}if(ae(P))return ie(L,M,P,X);if(le(P)){if(ye=le(P),typeof ye!="function")throw Error(s(150));return P=ye.call(P),we(L,M,P,X)}if(typeof P.then=="function")return Ge(L,M,il(P),X);if(P.$$typeof===A)return Ge(L,M,nl(L,P),X);ol(L,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,M!==null&&M.tag===6?(i(L,M.sibling),X=d(M,P),X.return=L,L=X):(i(L,M),X=$u(P,L.mode,X),X.return=L,L=X),w(L)):i(L,M)}return function(L,M,P,X){try{Ti=0;var ye=Ge(L,M,P,X);return ms=null,ye}catch(fe){if(fe===ps||fe===al)throw fe;var Pe=Wt(29,fe,null,L.mode);return Pe.lanes=X,Pe.return=L,Pe}}}var Ra=qm(!0),Fm=qm(!1),Lr=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ur(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(t,r,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var d=l.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r,r=Jo(t),Rm(t,null,i),r}return Wo(t,l,r,i),Jo(t)}function Ri(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,zt(t,i)}}function nd(t,r){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?d=h=w:h=h.next=w,i=i.next}while(i!==null);h===null?d=h=r:h=h.next=r}else d=h=r;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var rd=!1;function Ai(){if(rd){var t=hs;if(t!==null)throw t}}function Oi(t,r,i,l){rd=!1;var d=t.updateQueue;Lr=!1;var h=d.firstBaseUpdate,w=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var N=C,z=N.next;N.next=null,w===null?h=z:w.next=z,w=N;var Y=t.alternate;Y!==null&&(Y=Y.updateQueue,C=Y.lastBaseUpdate,C!==w&&(C===null?Y.firstBaseUpdate=z:C.next=z,Y.lastBaseUpdate=N))}if(h!==null){var Q=d.baseState;w=0,Y=z=N=null,C=h;do{var H=C.lane&-536870913,F=H!==C.lane;if(F?(De&H)===H:(l&H)===H){H!==0&&H===fs&&(rd=!0),Y!==null&&(Y=Y.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var ie=t,we=C;H=r;var Ge=i;switch(we.tag){case 1:if(ie=we.payload,typeof ie=="function"){Q=ie.call(Ge,Q,H);break e}Q=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=we.payload,H=typeof ie=="function"?ie.call(Ge,Q,H):ie,H==null)break e;Q=g({},Q,H);break e;case 2:Lr=!0}}H=C.callback,H!==null&&(t.flags|=64,F&&(t.flags|=8192),F=d.callbacks,F===null?d.callbacks=[H]:F.push(H))}else F={lane:H,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Y===null?(z=Y=F,N=Q):Y=Y.next=F,w|=H;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;F=C,C=F.next,F.next=null,d.lastBaseUpdate=F,d.shared.pending=null}}while(!0);Y===null&&(N=Q),d.baseState=N,d.firstBaseUpdate=z,d.lastBaseUpdate=Y,h===null&&(d.shared.lanes=0),Hr|=w,t.lanes=w,t.memoizedState=Q}}function Vm(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Gm(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)Vm(i[t],r)}var gs=j(null),ll=j(0);function Ym(t,r){t=ur,K(ll,t),K(gs,r),ur=t|r.baseLanes}function ad(){K(ll,ur),K(gs,gs.current)}function sd(){ur=ll.current,G(gs),G(ll)}var Jt=j(null),mn=null;function zr(t){var r=t.alternate;K(it,it.current&1),K(Jt,t),mn===null&&(r===null||gs.current!==null||r.memoizedState!==null)&&(mn=t)}function id(t){K(it,it.current),K(Jt,t),mn===null&&(mn=t)}function Km(t){t.tag===22?(K(it,it.current),K(Jt,t),mn===null&&(mn=t)):Ir()}function Ir(){K(it,it.current),K(Jt,Jt.current)}function Zt(t){G(Jt),mn===t&&(mn=null),G(it)}var it=j(0);function cl(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||hf(i)||pf(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var nr=0,Re=null,Fe=null,ct=null,ul=!1,ys=!1,Aa=!1,dl=0,Ni=0,vs=null,w_=0;function rt(){throw Error(s(321))}function od(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!Qt(t[i],r[i]))return!1;return!0}function ld(t,r,i,l,d,h){return nr=h,Re=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=t===null||t.memoizedState===null?kg:Ed,Aa=!1,h=i(l,d),Aa=!1,ys&&(h=Qm(r,i,l,d)),Xm(t),h}function Xm(t){D.H=Di;var r=Fe!==null&&Fe.next!==null;if(nr=0,ct=Fe=Re=null,ul=!1,Ni=0,vs=null,r)throw Error(s(300));t===null||ut||(t=t.dependencies,t!==null&&tl(t)&&(ut=!0))}function Qm(t,r,i,l){Re=t;var d=0;do{if(ys&&(vs=null),Ni=0,ys=!1,25<=d)throw Error(s(301));if(d+=1,ct=Fe=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}D.H=jg,h=r(i,l)}while(ys);return h}function x_(){var t=D.H,r=t.useState()[0];return r=typeof r.then=="function"?ki(r):r,t=t.useState()[0],(Fe!==null?Fe.memoizedState:null)!==t&&(Re.flags|=1024),r}function cd(){var t=dl!==0;return dl=0,t}function ud(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function dd(t){if(ul){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}ul=!1}nr=0,ct=Fe=Re=null,ys=!1,Ni=dl=0,vs=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Re.memoizedState=ct=t:ct=ct.next=t,ct}function ot(){if(Fe===null){var t=Re.alternate;t=t!==null?t.memoizedState:null}else t=Fe.next;var r=ct===null?Re.memoizedState:ct.next;if(r!==null)ct=r,Fe=t;else{if(t===null)throw Re.alternate===null?Error(s(467)):Error(s(310));Fe=t,t={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},ct===null?Re.memoizedState=ct=t:ct=ct.next=t}return ct}function fl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ki(t){var r=Ni;return Ni+=1,vs===null&&(vs=[]),t=Bm(vs,t,r),r=Re,(ct===null?r.memoizedState:ct.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?kg:Ed),t}function hl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ki(t);if(t.$$typeof===A)return _t(t)}throw Error(s(438,String(t)))}function fd(t){var r=null,i=Re.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Re.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=fl(),Re.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),l=0;l<t;l++)i[l]=de;return r.index++,i}function rr(t,r){return typeof r=="function"?r(t):r}function pl(t){var r=ot();return hd(r,Fe,t)}function hd(t,r,i){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var d=t.baseQueue,h=l.pending;if(h!==null){if(d!==null){var w=d.next;d.next=h.next,h.next=w}r.baseQueue=d=h,l.pending=null}if(h=t.baseState,d===null)t.memoizedState=h;else{r=d.next;var C=w=null,N=null,z=r,Y=!1;do{var Q=z.lane&-536870913;if(Q!==z.lane?(De&Q)===Q:(nr&Q)===Q){var H=z.revertLane;if(H===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Q===fs&&(Y=!0);else if((nr&H)===H){z=z.next,H===fs&&(Y=!0);continue}else Q={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(C=N=Q,w=h):N=N.next=Q,Re.lanes|=H,Hr|=H;Q=z.action,Aa&&i(h,Q),h=z.hasEagerState?z.eagerState:i(h,Q)}else H={lane:Q,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(C=N=H,w=h):N=N.next=H,Re.lanes|=Q,Hr|=Q;z=z.next}while(z!==null&&z!==r);if(N===null?w=h:N.next=C,!Qt(h,t.memoizedState)&&(ut=!0,Y&&(i=hs,i!==null)))throw i;t.memoizedState=h,t.baseState=w,t.baseQueue=N,l.lastRenderedState=h}return d===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function pd(t){var r=ot(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=t;var l=i.dispatch,d=i.pending,h=r.memoizedState;if(d!==null){i.pending=null;var w=d=d.next;do h=t(h,w.action),w=w.next;while(w!==d);Qt(h,r.memoizedState)||(ut=!0),r.memoizedState=h,r.baseQueue===null&&(r.baseState=h),i.lastRenderedState=h}return[h,l]}function Wm(t,r,i){var l=Re,d=ot(),h=Le;if(h){if(i===void 0)throw Error(s(407));i=i()}else i=r();var w=!Qt((Fe||d).memoizedState,i);if(w&&(d.memoizedState=i,ut=!0),d=d.queue,yd(eg.bind(null,l,d,t),[t]),d.getSnapshot!==r||w||ct!==null&&ct.memoizedState.tag&1){if(l.flags|=2048,bs(9,{destroy:void 0},Zm.bind(null,l,d,i,r),null),Ye===null)throw Error(s(349));h||(nr&127)!==0||Jm(l,r,i)}return i}function Jm(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Re.updateQueue,r===null?(r=fl(),Re.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function Zm(t,r,i,l){r.value=i,r.getSnapshot=l,tg(r)&&ng(t)}function eg(t,r,i){return i(function(){tg(r)&&ng(t)})}function tg(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!Qt(t,i)}catch{return!0}}function ng(t){var r=ba(t,2);r!==null&&Gt(r,t,2)}function md(t){var r=Lt();if(typeof t=="function"){var i=t;if(t=i(),Aa){bn(!0);try{i()}finally{bn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:t},r}function rg(t,r,i,l){return t.baseState=i,hd(t,Fe,typeof l=="function"?l:rr)}function S_(t,r,i,l,d){if(yl(t))throw Error(s(485));if(t=r.action,t!==null){var h={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){h.listeners.push(w)}};D.T!==null?i(!0):h.isTransition=!1,l(h),i=r.pending,i===null?(h.next=r.pending=h,ag(r,h)):(h.next=i.next,r.pending=i.next=h)}}function ag(t,r){var i=r.action,l=r.payload,d=t.state;if(r.isTransition){var h=D.T,w={};D.T=w;try{var C=i(d,l),N=D.S;N!==null&&N(w,C),sg(t,r,C)}catch(z){gd(t,r,z)}finally{h!==null&&w.types!==null&&(h.types=w.types),D.T=h}}else try{h=i(d,l),sg(t,r,h)}catch(z){gd(t,r,z)}}function sg(t,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){ig(t,r,l)},function(l){return gd(t,r,l)}):ig(t,r,i)}function ig(t,r,i){r.status="fulfilled",r.value=i,og(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,ag(t,i)))}function gd(t,r,i){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,og(r),r=r.next;while(r!==l)}t.action=null}function og(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function lg(t,r){return r}function cg(t,r){if(Le){var i=Ye.formState;if(i!==null){e:{var l=Re;if(Le){if(Xe){t:{for(var d=Xe,h=pn;d.nodeType!==8;){if(!h){d=null;break t}if(d=gn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Xe=gn(d.nextSibling),l=d.data==="F!";break e}}Dr(l)}l=!1}l&&(r=i[0])}}return i=Lt(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lg,lastRenderedState:r},i.queue=l,i=Ag.bind(null,Re,l),l.dispatch=i,l=md(!1),h=Sd.bind(null,Re,!1,l.queue),l=Lt(),d={state:r,dispatch:null,action:t,pending:null},l.queue=d,i=S_.bind(null,Re,d,h,i),d.dispatch=i,l.memoizedState=t,[r,i,!1]}function ug(t){var r=ot();return dg(r,Fe,t)}function dg(t,r,i){if(r=hd(t,r,lg)[0],t=pl(rr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=ki(r)}catch(w){throw w===ps?al:w}else l=r;r=ot();var d=r.queue,h=d.dispatch;return i!==r.memoizedState&&(Re.flags|=2048,bs(9,{destroy:void 0},E_.bind(null,d,i),null)),[l,h,t]}function E_(t,r){t.action=r}function fg(t){var r=ot(),i=Fe;if(i!==null)return dg(r,i,t);ot(),r=r.memoizedState,i=ot();var l=i.queue.dispatch;return i.memoizedState=t,[r,l,!1]}function bs(t,r,i,l){return t={tag:t,create:i,deps:l,inst:r,next:null},r=Re.updateQueue,r===null&&(r=fl(),Re.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,r.lastEffect=t),t}function hg(){return ot().memoizedState}function ml(t,r,i,l){var d=Lt();Re.flags|=t,d.memoizedState=bs(1|r,{destroy:void 0},i,l===void 0?null:l)}function gl(t,r,i,l){var d=ot();l=l===void 0?null:l;var h=d.memoizedState.inst;Fe!==null&&l!==null&&od(l,Fe.memoizedState.deps)?d.memoizedState=bs(r,h,i,l):(Re.flags|=t,d.memoizedState=bs(1|r,h,i,l))}function pg(t,r){ml(8390656,8,t,r)}function yd(t,r){gl(2048,8,t,r)}function __(t){Re.flags|=4;var r=Re.updateQueue;if(r===null)r=fl(),Re.updateQueue=r,r.events=[t];else{var i=r.events;i===null?r.events=[t]:i.push(t)}}function mg(t){var r=ot().memoizedState;return __({ref:r,nextImpl:t}),function(){if((Be&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function gg(t,r){return gl(4,2,t,r)}function yg(t,r){return gl(4,4,t,r)}function vg(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function bg(t,r,i){i=i!=null?i.concat([t]):null,gl(4,4,vg.bind(null,r,t),i)}function vd(){}function wg(t,r){var i=ot();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&od(r,l[1])?l[0]:(i.memoizedState=[t,r],t)}function xg(t,r){var i=ot();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&od(r,l[1]))return l[0];if(l=t(),Aa){bn(!0);try{t()}finally{bn(!1)}}return i.memoizedState=[l,r],l}function bd(t,r,i){return i===void 0||(nr&1073741824)!==0&&(De&261930)===0?t.memoizedState=r:(t.memoizedState=i,t=Sy(),Re.lanes|=t,Hr|=t,i)}function Sg(t,r,i,l){return Qt(i,r)?i:gs.current!==null?(t=bd(t,i,l),Qt(t,r)||(ut=!0),t):(nr&42)===0||(nr&1073741824)!==0&&(De&261930)===0?(ut=!0,t.memoizedState=i):(t=Sy(),Re.lanes|=t,Hr|=t,r)}function Eg(t,r,i,l,d){var h=V.p;V.p=h!==0&&8>h?h:8;var w=D.T,C={};D.T=C,Sd(t,!1,r,i);try{var N=d(),z=D.S;if(z!==null&&z(C,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var Y=b_(N,l);ji(t,r,Y,nn(t))}else ji(t,r,l,nn(t))}catch(Q){ji(t,r,{then:function(){},status:"rejected",reason:Q},nn())}finally{V.p=h,w!==null&&C.types!==null&&(w.types=C.types),D.T=w}}function T_(){}function wd(t,r,i,l){if(t.tag!==5)throw Error(s(476));var d=_g(t).queue;Eg(t,d,r,Z,i===null?T_:function(){return Tg(t),i(l)})}function _g(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:Z},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Tg(t){var r=_g(t);r.next===null&&(r=t.alternate.memoizedState),ji(t,r.next.queue,{},nn())}function xd(){return _t(Xi)}function Cg(){return ot().memoizedState}function Rg(){return ot().memoizedState}function C_(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=nn();t=Ur(i);var l=Pr(r,t,i);l!==null&&(Gt(l,r,i),Ri(l,r,i)),r={cache:Qu()},t.payload=r;return}r=r.return}}function R_(t,r,i){var l=nn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},yl(t)?Og(r,i):(i=Iu(t,r,i,l),i!==null&&(Gt(i,t,l),Ng(i,r,l)))}function Ag(t,r,i){var l=nn();ji(t,r,i,l)}function ji(t,r,i,l){var d={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(yl(t))Og(r,d);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=r.lastRenderedReducer,h!==null))try{var w=r.lastRenderedState,C=h(w,i);if(d.hasEagerState=!0,d.eagerState=C,Qt(C,w))return Wo(t,r,d,0),Ye===null&&Qo(),!1}catch{}if(i=Iu(t,r,d,l),i!==null)return Gt(i,t,l),Ng(i,r,l),!0}return!1}function Sd(t,r,i,l){if(l={lane:2,revertLane:ef(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},yl(t)){if(r)throw Error(s(479))}else r=Iu(t,i,l,2),r!==null&&Gt(r,t,2)}function yl(t){var r=t.alternate;return t===Re||r!==null&&r===Re}function Og(t,r){ys=ul=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Ng(t,r,i){if((i&4194048)!==0){var l=r.lanes;l&=t.pendingLanes,i|=l,r.lanes=i,zt(t,i)}}var Di={readContext:_t,use:hl,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};Di.useEffectEvent=rt;var kg={readContext:_t,use:hl,useCallback:function(t,r){return Lt().memoizedState=[t,r===void 0?null:r],t},useContext:_t,useEffect:pg,useImperativeHandle:function(t,r,i){i=i!=null?i.concat([t]):null,ml(4194308,4,vg.bind(null,r,t),i)},useLayoutEffect:function(t,r){return ml(4194308,4,t,r)},useInsertionEffect:function(t,r){ml(4,2,t,r)},useMemo:function(t,r){var i=Lt();r=r===void 0?null:r;var l=t();if(Aa){bn(!0);try{t()}finally{bn(!1)}}return i.memoizedState=[l,r],l},useReducer:function(t,r,i){var l=Lt();if(i!==void 0){var d=i(r);if(Aa){bn(!0);try{i(r)}finally{bn(!1)}}}else d=r;return l.memoizedState=l.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},l.queue=t,t=t.dispatch=R_.bind(null,Re,t),[l.memoizedState,t]},useRef:function(t){var r=Lt();return t={current:t},r.memoizedState=t},useState:function(t){t=md(t);var r=t.queue,i=Ag.bind(null,Re,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:vd,useDeferredValue:function(t,r){var i=Lt();return bd(i,t,r)},useTransition:function(){var t=md(!1);return t=Eg.bind(null,Re,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var l=Re,d=Lt();if(Le){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Ye===null)throw Error(s(349));(De&127)!==0||Jm(l,r,i)}d.memoizedState=i;var h={value:i,getSnapshot:r};return d.queue=h,pg(eg.bind(null,l,h,t),[t]),l.flags|=2048,bs(9,{destroy:void 0},Zm.bind(null,l,h,i,r),null),i},useId:function(){var t=Lt(),r=Ye.identifierPrefix;if(Le){var i=Un,l=Ln;i=(l&~(1<<32-Ot(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=dl++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=w_++,r="_"+r+"r_"+i.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:xd,useFormState:cg,useActionState:cg,useOptimistic:function(t){var r=Lt();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Sd.bind(null,Re,!0,i),i.dispatch=r,[t,r]},useMemoCache:fd,useCacheRefresh:function(){return Lt().memoizedState=C_.bind(null,Re)},useEffectEvent:function(t){var r=Lt(),i={impl:t};return r.memoizedState=i,function(){if((Be&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},Ed={readContext:_t,use:hl,useCallback:wg,useContext:_t,useEffect:yd,useImperativeHandle:bg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:xg,useReducer:pl,useRef:hg,useState:function(){return pl(rr)},useDebugValue:vd,useDeferredValue:function(t,r){var i=ot();return Sg(i,Fe.memoizedState,t,r)},useTransition:function(){var t=pl(rr)[0],r=ot().memoizedState;return[typeof t=="boolean"?t:ki(t),r]},useSyncExternalStore:Wm,useId:Cg,useHostTransitionStatus:xd,useFormState:ug,useActionState:ug,useOptimistic:function(t,r){var i=ot();return rg(i,Fe,t,r)},useMemoCache:fd,useCacheRefresh:Rg};Ed.useEffectEvent=mg;var jg={readContext:_t,use:hl,useCallback:wg,useContext:_t,useEffect:yd,useImperativeHandle:bg,useInsertionEffect:gg,useLayoutEffect:yg,useMemo:xg,useReducer:pd,useRef:hg,useState:function(){return pd(rr)},useDebugValue:vd,useDeferredValue:function(t,r){var i=ot();return Fe===null?bd(i,t,r):Sg(i,Fe.memoizedState,t,r)},useTransition:function(){var t=pd(rr)[0],r=ot().memoizedState;return[typeof t=="boolean"?t:ki(t),r]},useSyncExternalStore:Wm,useId:Cg,useHostTransitionStatus:xd,useFormState:fg,useActionState:fg,useOptimistic:function(t,r){var i=ot();return Fe!==null?rg(i,Fe,t,r):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:fd,useCacheRefresh:Rg};jg.useEffectEvent=mg;function _d(t,r,i,l){r=t.memoizedState,i=i(l,r),i=i==null?r:g({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Td={enqueueSetState:function(t,r,i){t=t._reactInternals;var l=nn(),d=Ur(l);d.payload=r,i!=null&&(d.callback=i),r=Pr(t,d,l),r!==null&&(Gt(r,t,l),Ri(r,t,l))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var l=nn(),d=Ur(l);d.tag=1,d.payload=r,i!=null&&(d.callback=i),r=Pr(t,d,l),r!==null&&(Gt(r,t,l),Ri(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=nn(),l=Ur(i);l.tag=2,r!=null&&(l.callback=r),r=Pr(t,l,i),r!==null&&(Gt(r,t,i),Ri(r,t,i))}};function Dg(t,r,i,l,d,h,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,h,w):r.prototype&&r.prototype.isPureReactComponent?!bi(i,l)||!bi(d,h):!0}function Mg(t,r,i,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==t&&Td.enqueueReplaceState(r,r.state,null)}function Oa(t,r){var i=r;if("ref"in r){i={};for(var l in r)l!=="ref"&&(i[l]=r[l])}if(t=t.defaultProps){i===r&&(i=g({},i));for(var d in t)i[d]===void 0&&(i[d]=t[d])}return i}function Lg(t){Xo(t)}function Ug(t){console.error(t)}function Pg(t){Xo(t)}function vl(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function zg(t,r,i){try{var l=t.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Cd(t,r,i){return i=Ur(i),i.tag=3,i.payload={element:null},i.callback=function(){vl(t,r)},i}function Ig(t){return t=Ur(t),t.tag=3,t}function Bg(t,r,i,l){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;t.payload=function(){return d(h)},t.callback=function(){zg(r,i,l)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){zg(r,i,l),typeof d!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})})}function A_(t,r,i,l,d){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=i.alternate,r!==null&&ds(r,i,d,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:return mn===null?Nl():i.alternate===null&&at===0&&(at=3),i.flags&=-257,i.flags|=65536,i.lanes=d,l===sl?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Wd(t,l,d)),!1;case 22:return i.flags|=65536,l===sl?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Wd(t,l,d)),!1}throw Error(s(435,i.tag))}return Wd(t,l,d),Nl(),!1}if(Le)return r=Jt.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,l!==Vu&&(t=Error(s(422),{cause:l}),Si(dn(t,i)))):(l!==Vu&&(r=Error(s(423),{cause:l}),Si(dn(r,i))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,l=dn(l,i),d=Cd(t.stateNode,l,d),nd(t,d),at!==4&&(at=2)),!1;var h=Error(s(520),{cause:l});if(h=dn(h,i),$i===null?$i=[h]:$i.push(h),at!==4&&(at=2),r===null)return!0;l=dn(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=d&-d,i.lanes|=t,t=Cd(i.stateNode,l,t),nd(i,t),!1;case 1:if(r=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(qr===null||!qr.has(h))))return i.flags|=65536,d&=-d,i.lanes|=d,d=Ig(d),Bg(d,t,i,l),nd(i,d),!1}i=i.return}while(i!==null);return!1}var Rd=Error(s(461)),ut=!1;function Tt(t,r,i,l){r.child=t===null?Fm(r,null,i,l):Ra(r,t.child,i,l)}function $g(t,r,i,l,d){i=i.render;var h=r.ref;if("ref"in l){var w={};for(var C in l)C!=="ref"&&(w[C]=l[C])}else w=l;return Ea(r),l=ld(t,r,i,w,h,d),C=cd(),t!==null&&!ut?(ud(t,r,d),ar(t,r,d)):(Le&&C&&qu(r),r.flags|=1,Tt(t,r,l,d),r.child)}function Hg(t,r,i,l,d){if(t===null){var h=i.type;return typeof h=="function"&&!Bu(h)&&h.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=h,qg(t,r,h,l,d)):(t=Zo(i.type,null,l,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(h=t.child,!Ld(t,d)){var w=h.memoizedProps;if(i=i.compare,i=i!==null?i:bi,i(w,l)&&t.ref===r.ref)return ar(t,r,d)}return r.flags|=1,t=Jn(h,l),t.ref=r.ref,t.return=r,r.child=t}function qg(t,r,i,l,d){if(t!==null){var h=t.memoizedProps;if(bi(h,l)&&t.ref===r.ref)if(ut=!1,r.pendingProps=l=h,Ld(t,d))(t.flags&131072)!==0&&(ut=!0);else return r.lanes=t.lanes,ar(t,r,d)}return Ad(t,r,i,l,d)}function Fg(t,r,i,l){var d=l.children,h=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(h=h!==null?h.baseLanes|i:i,t!==null){for(l=r.child=t.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,r.child=null;return Vg(t,r,h,i,l)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&rl(r,h!==null?h.cachePool:null),h!==null?Ym(r,h):ad(),Km(r);else return l=r.lanes=536870912,Vg(t,r,h!==null?h.baseLanes|i:i,i,l)}else h!==null?(rl(r,h.cachePool),Ym(r,h),Ir(),r.memoizedState=null):(t!==null&&rl(r,null),ad(),Ir());return Tt(t,r,d,i),r.child}function Mi(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Vg(t,r,i,l,d){var h=Ju();return h=h===null?null:{parent:lt._currentValue,pool:h},r.memoizedState={baseLanes:i,cachePool:h},t!==null&&rl(r,null),ad(),Km(r),t!==null&&ds(t,r,l,!0),r.childLanes=d,null}function bl(t,r){return r=xl({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Gg(t,r,i){return Ra(r,t.child,null,i),t=bl(r,r.pendingProps),t.flags|=2,Zt(r),r.memoizedState=null,t}function O_(t,r,i){var l=r.pendingProps,d=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Le){if(l.mode==="hidden")return t=bl(r,l),r.lanes=536870912,Mi(null,t);if(id(r),(t=Xe)?(t=av(t,pn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:kr!==null?{id:Ln,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},i=Om(t),i.return=r,r.child=i,Et=r,Xe=null)):t=null,t===null)throw Dr(r);return r.lanes=536870912,null}return bl(r,l)}var h=t.memoizedState;if(h!==null){var w=h.dehydrated;if(id(r),d)if(r.flags&256)r.flags&=-257,r=Gg(t,r,i);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(ut||ds(t,r,i,!1),d=(i&t.childLanes)!==0,ut||d){if(l=Ye,l!==null&&(w=It(l,i),w!==0&&w!==h.retryLane))throw h.retryLane=w,ba(t,w),Gt(l,t,w),Rd;Nl(),r=Gg(t,r,i)}else t=h.treeContext,Xe=gn(w.nextSibling),Et=r,Le=!0,jr=null,pn=!1,t!==null&&jm(r,t),r=bl(r,l),r.flags|=4096;return r}return t=Jn(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function wl(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function Ad(t,r,i,l,d){return Ea(r),i=ld(t,r,i,l,void 0,d),l=cd(),t!==null&&!ut?(ud(t,r,d),ar(t,r,d)):(Le&&l&&qu(r),r.flags|=1,Tt(t,r,i,d),r.child)}function Yg(t,r,i,l,d,h){return Ea(r),r.updateQueue=null,i=Qm(r,l,i,d),Xm(t),l=cd(),t!==null&&!ut?(ud(t,r,h),ar(t,r,h)):(Le&&l&&qu(r),r.flags|=1,Tt(t,r,i,h),r.child)}function Kg(t,r,i,l,d){if(Ea(r),r.stateNode===null){var h=os,w=i.contextType;typeof w=="object"&&w!==null&&(h=_t(w)),h=new i(l,h),r.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Td,r.stateNode=h,h._reactInternals=r,h=r.stateNode,h.props=l,h.state=r.memoizedState,h.refs={},ed(r),w=i.contextType,h.context=typeof w=="object"&&w!==null?_t(w):os,h.state=r.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(_d(r,i,w,l),h.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(w=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),w!==h.state&&Td.enqueueReplaceState(h,h.state,null),Oi(r,l,h,d),Ai(),h.state=r.memoizedState),typeof h.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){h=r.stateNode;var C=r.memoizedProps,N=Oa(i,C);h.props=N;var z=h.context,Y=i.contextType;w=os,typeof Y=="object"&&Y!==null&&(w=_t(Y));var Q=i.getDerivedStateFromProps;Y=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(C||z!==w)&&Mg(r,h,l,w),Lr=!1;var H=r.memoizedState;h.state=H,Oi(r,l,h,d),Ai(),z=r.memoizedState,C||H!==z||Lr?(typeof Q=="function"&&(_d(r,i,Q,l),z=r.memoizedState),(N=Lr||Dg(r,i,N,l,H,z,w))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(r.flags|=4194308)):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=z),h.props=l,h.state=z,h.context=w,l=N):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{h=r.stateNode,td(t,r),w=r.memoizedProps,Y=Oa(i,w),h.props=Y,Q=r.pendingProps,H=h.context,z=i.contextType,N=os,typeof z=="object"&&z!==null&&(N=_t(z)),C=i.getDerivedStateFromProps,(z=typeof C=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w!==Q||H!==N)&&Mg(r,h,l,N),Lr=!1,H=r.memoizedState,h.state=H,Oi(r,l,h,d),Ai();var F=r.memoizedState;w!==Q||H!==F||Lr||t!==null&&t.dependencies!==null&&tl(t.dependencies)?(typeof C=="function"&&(_d(r,i,C,l),F=r.memoizedState),(Y=Lr||Dg(r,i,Y,l,H,F,N)||t!==null&&t.dependencies!==null&&tl(t.dependencies))?(z||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,F,N),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,F,N)),typeof h.componentDidUpdate=="function"&&(r.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof h.componentDidUpdate!="function"||w===t.memoizedProps&&H===t.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&H===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=F),h.props=l,h.state=F,h.context=N,l=Y):(typeof h.componentDidUpdate!="function"||w===t.memoizedProps&&H===t.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&H===t.memoizedState||(r.flags|=1024),l=!1)}return h=l,wl(t,r),l=(r.flags&128)!==0,h||l?(h=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:h.render(),r.flags|=1,t!==null&&l?(r.child=Ra(r,t.child,null,d),r.child=Ra(r,null,i,d)):Tt(t,r,i,d),r.memoizedState=h.state,t=r.child):t=ar(t,r,d),t}function Xg(t,r,i,l){return xa(),r.flags|=256,Tt(t,r,i,l),r.child}var Od={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nd(t){return{baseLanes:t,cachePool:zm()}}function kd(t,r,i){return t=t!==null?t.childLanes&~i:0,r&&(t|=tn),t}function Qg(t,r,i){var l=r.pendingProps,d=!1,h=(r.flags&128)!==0,w;if((w=h)||(w=t!==null&&t.memoizedState===null?!1:(it.current&2)!==0),w&&(d=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,t===null){if(Le){if(d?zr(r):Ir(),(t=Xe)?(t=av(t,pn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:kr!==null?{id:Ln,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},i=Om(t),i.return=r,r.child=i,Et=r,Xe=null)):t=null,t===null)throw Dr(r);return pf(t)?r.lanes=32:r.lanes=536870912,null}var C=l.children;return l=l.fallback,d?(Ir(),d=r.mode,C=xl({mode:"hidden",children:C},d),l=wa(l,d,i,null),C.return=r,l.return=r,C.sibling=l,r.child=C,l=r.child,l.memoizedState=Nd(i),l.childLanes=kd(t,w,i),r.memoizedState=Od,Mi(null,l)):(zr(r),jd(r,C))}var N=t.memoizedState;if(N!==null&&(C=N.dehydrated,C!==null)){if(h)r.flags&256?(zr(r),r.flags&=-257,r=Dd(t,r,i)):r.memoizedState!==null?(Ir(),r.child=t.child,r.flags|=128,r=null):(Ir(),C=l.fallback,d=r.mode,l=xl({mode:"visible",children:l.children},d),C=wa(C,d,i,null),C.flags|=2,l.return=r,C.return=r,l.sibling=C,r.child=l,Ra(r,t.child,null,i),l=r.child,l.memoizedState=Nd(i),l.childLanes=kd(t,w,i),r.memoizedState=Od,r=Mi(null,l));else if(zr(r),pf(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var z=w.dgst;w=z,l=Error(s(419)),l.stack="",l.digest=w,Si({value:l,source:null,stack:null}),r=Dd(t,r,i)}else if(ut||ds(t,r,i,!1),w=(i&t.childLanes)!==0,ut||w){if(w=Ye,w!==null&&(l=It(w,i),l!==0&&l!==N.retryLane))throw N.retryLane=l,ba(t,l),Gt(w,t,l),Rd;hf(C)||Nl(),r=Dd(t,r,i)}else hf(C)?(r.flags|=192,r.child=t.child,r=null):(t=N.treeContext,Xe=gn(C.nextSibling),Et=r,Le=!0,jr=null,pn=!1,t!==null&&jm(r,t),r=jd(r,l.children),r.flags|=4096);return r}return d?(Ir(),C=l.fallback,d=r.mode,N=t.child,z=N.sibling,l=Jn(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,z!==null?C=Jn(z,C):(C=wa(C,d,i,null),C.flags|=2),C.return=r,l.return=r,l.sibling=C,r.child=l,Mi(null,l),l=r.child,C=t.child.memoizedState,C===null?C=Nd(i):(d=C.cachePool,d!==null?(N=lt._currentValue,d=d.parent!==N?{parent:N,pool:N}:d):d=zm(),C={baseLanes:C.baseLanes|i,cachePool:d}),l.memoizedState=C,l.childLanes=kd(t,w,i),r.memoizedState=Od,Mi(t.child,l)):(zr(r),i=t.child,t=i.sibling,i=Jn(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,t!==null&&(w=r.deletions,w===null?(r.deletions=[t],r.flags|=16):w.push(t)),r.child=i,r.memoizedState=null,i)}function jd(t,r){return r=xl({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function xl(t,r){return t=Wt(22,t,null,r),t.lanes=0,t}function Dd(t,r,i){return Ra(r,t.child,null,i),t=jd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Wg(t,r,i){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Ku(t.return,r,i)}function Md(t,r,i,l,d,h){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d,treeForkCount:h}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=l,w.tail=i,w.tailMode=d,w.treeForkCount=h)}function Jg(t,r,i){var l=r.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var w=it.current,C=(w&2)!==0;if(C?(w=w&1|2,r.flags|=128):w&=1,K(it,w),Tt(t,r,l,i),l=Le?xi:0,!C&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Wg(t,i,r);else if(t.tag===19)Wg(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(i=r.child,d=null;i!==null;)t=i.alternate,t!==null&&cl(t)===null&&(d=i),i=i.sibling;i=d,i===null?(d=r.child,r.child=null):(d=i.sibling,i.sibling=null),Md(r,!1,d,i,h,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&cl(t)===null){r.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}Md(r,!0,i,null,h,l);break;case"together":Md(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function ar(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),Hr|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(ds(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,i=Jn(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=Jn(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function Ld(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&tl(t)))}function N_(t,r,i){switch(r.tag){case 3:Se(r,r.stateNode.containerInfo),Mr(r,lt,t.memoizedState.cache),xa();break;case 27:case 5:ce(r);break;case 4:Se(r,r.stateNode.containerInfo);break;case 10:Mr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,id(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(zr(r),r.flags|=128,null):(i&r.child.childLanes)!==0?Qg(t,r,i):(zr(r),t=ar(t,r,i),t!==null?t.sibling:null);zr(r);break;case 19:var d=(t.flags&128)!==0;if(l=(i&r.childLanes)!==0,l||(ds(t,r,i,!1),l=(i&r.childLanes)!==0),d){if(l)return Jg(t,r,i);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),K(it,it.current),l)break;return null;case 22:return r.lanes=0,Fg(t,r,i,r.pendingProps);case 24:Mr(r,lt,t.memoizedState.cache)}return ar(t,r,i)}function Zg(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)ut=!0;else{if(!Ld(t,i)&&(r.flags&128)===0)return ut=!1,N_(t,r,i);ut=(t.flags&131072)!==0}else ut=!1,Le&&(r.flags&1048576)!==0&&km(r,xi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=Ta(r.elementType),r.type=t,typeof t=="function")Bu(t)?(l=Oa(t,l),r.tag=1,r=Kg(null,r,t,l,i)):(r.tag=0,r=Ad(null,r,t,l,i));else{if(t!=null){var d=t.$$typeof;if(d===k){r.tag=11,r=$g(null,r,t,l,i);break e}else if(d===$){r.tag=14,r=Hg(null,r,t,l,i);break e}}throw r=W(t)||t,Error(s(306,r,""))}}return r;case 0:return Ad(t,r,r.type,r.pendingProps,i);case 1:return l=r.type,d=Oa(l,r.pendingProps),Kg(t,r,l,d,i);case 3:e:{if(Se(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var h=r.memoizedState;d=h.element,td(t,r),Oi(r,l,null,i);var w=r.memoizedState;if(l=w.cache,Mr(r,lt,l),l!==h.cache&&Xu(r,[lt],i,!0),Ai(),l=w.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=h,r.memoizedState=h,r.flags&256){r=Xg(t,r,l,i);break e}else if(l!==d){d=dn(Error(s(424)),r),Si(d),r=Xg(t,r,l,i);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Xe=gn(t.firstChild),Et=r,Le=!0,jr=null,pn=!0,i=Fm(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(xa(),l===d){r=ar(t,r,i);break e}Tt(t,r,l,i)}r=r.child}return r;case 26:return wl(t,r),t===null?(i=uv(r.type,null,r.pendingProps,null))?r.memoizedState=i:Le||(i=r.type,t=r.pendingProps,l=Pl(re.current).createElement(i),l[St]=r,l[Bt]=t,Ct(l,i,t),bt(l),r.stateNode=l):r.memoizedState=uv(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ce(r),t===null&&Le&&(l=r.stateNode=ov(r.type,r.pendingProps,re.current),Et=r,pn=!0,d=Xe,Yr(r.type)?(mf=d,Xe=gn(l.firstChild)):Xe=d),Tt(t,r,r.pendingProps.children,i),wl(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Le&&((d=l=Xe)&&(l=i1(l,r.type,r.pendingProps,pn),l!==null?(r.stateNode=l,Et=r,Xe=gn(l.firstChild),pn=!1,d=!0):d=!1),d||Dr(r)),ce(r),d=r.type,h=r.pendingProps,w=t!==null?t.memoizedProps:null,l=h.children,uf(d,h)?l=null:w!==null&&uf(d,w)&&(r.flags|=32),r.memoizedState!==null&&(d=ld(t,r,x_,null,null,i),Xi._currentValue=d),wl(t,r),Tt(t,r,l,i),r.child;case 6:return t===null&&Le&&((t=i=Xe)&&(i=o1(i,r.pendingProps,pn),i!==null?(r.stateNode=i,Et=r,Xe=null,t=!0):t=!1),t||Dr(r)),null;case 13:return Qg(t,r,i);case 4:return Se(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Ra(r,null,l,i):Tt(t,r,l,i),r.child;case 11:return $g(t,r,r.type,r.pendingProps,i);case 7:return Tt(t,r,r.pendingProps,i),r.child;case 8:return Tt(t,r,r.pendingProps.children,i),r.child;case 12:return Tt(t,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,Mr(r,r.type,l.value),Tt(t,r,l.children,i),r.child;case 9:return d=r.type._context,l=r.pendingProps.children,Ea(r),d=_t(d),l=l(d),r.flags|=1,Tt(t,r,l,i),r.child;case 14:return Hg(t,r,r.type,r.pendingProps,i);case 15:return qg(t,r,r.type,r.pendingProps,i);case 19:return Jg(t,r,i);case 31:return O_(t,r,i);case 22:return Fg(t,r,i,r.pendingProps);case 24:return Ea(r),l=_t(lt),t===null?(d=Ju(),d===null&&(d=Ye,h=Qu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=i),d=h),r.memoizedState={parent:l,cache:d},ed(r),Mr(r,lt,d)):((t.lanes&i)!==0&&(td(t,r),Oi(r,null,null,i),Ai()),d=t.memoizedState,h=r.memoizedState,d.parent!==l?(d={parent:l,cache:l},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Mr(r,lt,l)):(l=h.cache,Mr(r,lt,l),l!==d.cache&&Xu(r,[lt],i,!0))),Tt(t,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function sr(t){t.flags|=4}function Ud(t,r,i,l,d){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(Cy())t.flags|=8192;else throw Ca=sl,Zu}else t.flags&=-16777217}function ey(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!mv(r))if(Cy())t.flags|=8192;else throw Ca=sl,Zu}function Sl(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Nt():536870912,t.lanes|=r,Es|=r)}function Li(t,r){if(!Le)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Qe(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(r)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=l,t.childLanes=i,r}function k_(t,r,i){var l=r.pendingProps;switch(Fu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(r),null;case 1:return Qe(r),null;case 3:return i=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),tr(lt),ve(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(us(r)?sr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Gu())),Qe(r),null;case 26:var d=r.type,h=r.memoizedState;return t===null?(sr(r),h!==null?(Qe(r),ey(r,h)):(Qe(r),Ud(r,d,null,l,i))):h?h!==t.memoizedState?(sr(r),Qe(r),ey(r,h)):(Qe(r),r.flags&=-16777217):(t=t.memoizedProps,t!==l&&sr(r),Qe(r),Ud(r,d,t,l,i)),null;case 27:if(be(r),i=re.current,d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&sr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Qe(r),null}t=ee.current,us(r)?Dm(r):(t=ov(d,l,i),r.stateNode=t,sr(r))}return Qe(r),null;case 5:if(be(r),d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&sr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Qe(r),null}if(h=ee.current,us(r))Dm(r);else{var w=Pl(re.current);switch(h){case 1:h=w.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=w.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=w.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?w.createElement("select",{is:l.is}):w.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?w.createElement(d,{is:l.is}):w.createElement(d)}}h[St]=r,h[Bt]=l;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)h.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=h;e:switch(Ct(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&sr(r)}}return Qe(r),Ud(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&sr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=re.current,us(r)){if(t=r.stateNode,i=r.memoizedProps,l=null,d=Et,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}t[St]=r,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Qy(t.nodeValue,i)),t||Dr(r,!0)}else t=Pl(t).createTextNode(l),t[St]=r,r.stateNode=t}return Qe(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(l=us(r),i!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[St]=r}else xa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Qe(r),t=!1}else i=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(Zt(r),r):(Zt(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Qe(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=us(r),l!==null&&l.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[St]=r}else xa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Qe(r),d=!1}else d=Gu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(Zt(r),r):(Zt(r),null)}return Zt(r),(r.flags&128)!==0?(r.lanes=i,r):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=r.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),Sl(r,r.updateQueue),Qe(r),null);case 4:return ve(),t===null&&af(r.stateNode.containerInfo),Qe(r),null;case 10:return tr(r.type),Qe(r),null;case 19:if(G(it),l=r.memoizedState,l===null)return Qe(r),null;if(d=(r.flags&128)!==0,h=l.rendering,h===null)if(d)Li(l,!1);else{if(at!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(h=cl(t),h!==null){for(r.flags|=128,Li(l,!1),t=h.updateQueue,r.updateQueue=t,Sl(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Am(i,t),i=i.sibling;return K(it,it.current&1|2),Le&&Zn(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Dt()>Rl&&(r.flags|=128,d=!0,Li(l,!1),r.lanes=4194304)}else{if(!d)if(t=cl(h),t!==null){if(r.flags|=128,d=!0,t=t.updateQueue,r.updateQueue=t,Sl(r,t),Li(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Le)return Qe(r),null}else 2*Dt()-l.renderingStartTime>Rl&&i!==536870912&&(r.flags|=128,d=!0,Li(l,!1),r.lanes=4194304);l.isBackwards?(h.sibling=r.child,r.child=h):(t=l.last,t!==null?t.sibling=h:r.child=h,l.last=h)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Dt(),t.sibling=null,i=it.current,K(it,d?i&1|2:i&1),Le&&Zn(r,l.treeForkCount),t):(Qe(r),null);case 22:case 23:return Zt(r),sd(),l=r.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(i&536870912)!==0&&(r.flags&128)===0&&(Qe(r),r.subtreeFlags&6&&(r.flags|=8192)):Qe(r),i=r.updateQueue,i!==null&&Sl(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),t!==null&&G(_a),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),tr(lt),Qe(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function j_(t,r){switch(Fu(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return tr(lt),ve(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return be(r),null;case 31:if(r.memoizedState!==null){if(Zt(r),r.alternate===null)throw Error(s(340));xa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Zt(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));xa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return G(it),null;case 4:return ve(),null;case 10:return tr(r.type),null;case 22:case 23:return Zt(r),sd(),t!==null&&G(_a),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return tr(lt),null;case 25:return null;default:return null}}function ty(t,r){switch(Fu(r),r.tag){case 3:tr(lt),ve();break;case 26:case 27:case 5:be(r);break;case 4:ve();break;case 31:r.memoizedState!==null&&Zt(r);break;case 13:Zt(r);break;case 19:G(it);break;case 10:tr(r.type);break;case 22:case 23:Zt(r),sd(),t!==null&&G(_a);break;case 24:tr(lt)}}function Ui(t,r){try{var i=r.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var d=l.next;i=d;do{if((i.tag&t)===t){l=void 0;var h=i.create,w=i.inst;l=h(),w.destroy=l}i=i.next}while(i!==d)}}catch(C){He(r,r.return,C)}}function Br(t,r,i){try{var l=r.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&t)===t){var w=l.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,d=r;var N=i,z=C;try{z()}catch(Y){He(d,N,Y)}}}l=l.next}while(l!==h)}}catch(Y){He(r,r.return,Y)}}function ny(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{Gm(r,i)}catch(l){He(t,t.return,l)}}}function ry(t,r,i){i.props=Oa(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){He(t,r,l)}}function Pi(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(d){He(t,r,d)}}function Pn(t,r){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(d){He(t,r,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){He(t,r,d)}else i.current=null}function ay(t){var r=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(d){He(t,t.return,d)}}function Pd(t,r,i){try{var l=t.stateNode;e1(l,t.type,i,r),l[Bt]=r}catch(d){He(t,t.return,d)}}function sy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Yr(t.type)||t.tag===4}function zd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||sy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Yr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Id(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Qn));else if(l!==4&&(l===27&&Yr(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(Id(t,r,i),t=t.sibling;t!==null;)Id(t,r,i),t=t.sibling}function El(t,r,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(l!==4&&(l===27&&Yr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(El(t,r,i),t=t.sibling;t!==null;)El(t,r,i),t=t.sibling}function iy(t){var r=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Ct(r,l,i),r[St]=t,r[Bt]=i}catch(h){He(t,t.return,h)}}var ir=!1,dt=!1,Bd=!1,oy=typeof WeakSet=="function"?WeakSet:Set,wt=null;function D_(t,r){if(t=t.containerInfo,lf=Fl,t=bm(t),Du(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var w=0,C=-1,N=-1,z=0,Y=0,Q=t,H=null;t:for(;;){for(var F;Q!==i||d!==0&&Q.nodeType!==3||(C=w+d),Q!==h||l!==0&&Q.nodeType!==3||(N=w+l),Q.nodeType===3&&(w+=Q.nodeValue.length),(F=Q.firstChild)!==null;)H=Q,Q=F;for(;;){if(Q===t)break t;if(H===i&&++z===d&&(C=w),H===h&&++Y===l&&(N=w),(F=Q.nextSibling)!==null)break;Q=H,H=Q.parentNode}Q=F}i=C===-1||N===-1?null:{start:C,end:N}}else i=null}i=i||{start:0,end:0}}else i=null;for(cf={focusedElem:t,selectionRange:i},Fl=!1,wt=r;wt!==null;)if(r=wt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,wt=t;else for(;wt!==null;){switch(r=wt,h=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)d=t[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,i=r,d=h.memoizedProps,h=h.memoizedState,l=i.stateNode;try{var ie=Oa(i.type,d);t=l.getSnapshotBeforeUpdate(ie,h),l.__reactInternalSnapshotBeforeUpdate=t}catch(we){He(i,i.return,we)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,i=t.nodeType,i===9)ff(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ff(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,wt=t;break}wt=r.return}}function ly(t,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:lr(t,i),l&4&&Ui(5,i);break;case 1:if(lr(t,i),l&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(w){He(i,i.return,w)}else{var d=Oa(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(d,r,t.__reactInternalSnapshotBeforeUpdate)}catch(w){He(i,i.return,w)}}l&64&&ny(i),l&512&&Pi(i,i.return);break;case 3:if(lr(t,i),l&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{Gm(t,r)}catch(w){He(i,i.return,w)}}break;case 27:r===null&&l&4&&iy(i);case 26:case 5:lr(t,i),r===null&&l&4&&ay(i),l&512&&Pi(i,i.return);break;case 12:lr(t,i);break;case 31:lr(t,i),l&4&&dy(t,i);break;case 13:lr(t,i),l&4&&fy(t,i),l&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=H_.bind(null,i),l1(t,i))));break;case 22:if(l=i.memoizedState!==null||ir,!l){r=r!==null&&r.memoizedState!==null||dt,d=ir;var h=dt;ir=l,(dt=r)&&!h?cr(t,i,(i.subtreeFlags&8772)!==0):lr(t,i),ir=d,dt=h}break;case 30:break;default:lr(t,i)}}function cy(t){var r=t.alternate;r!==null&&(t.alternate=null,cy(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&gu(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Je=null,Ht=!1;function or(t,r,i){for(i=i.child;i!==null;)uy(t,r,i),i=i.sibling}function uy(t,r,i){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(fa,i)}catch{}switch(i.tag){case 26:dt||Pn(i,r),or(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:dt||Pn(i,r);var l=Je,d=Ht;Yr(i.type)&&(Je=i.stateNode,Ht=!1),or(t,r,i),Gi(i.stateNode),Je=l,Ht=d;break;case 5:dt||Pn(i,r);case 6:if(l=Je,d=Ht,Je=null,or(t,r,i),Je=l,Ht=d,Je!==null)if(Ht)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(i.stateNode)}catch(h){He(i,r,h)}else try{Je.removeChild(i.stateNode)}catch(h){He(i,r,h)}break;case 18:Je!==null&&(Ht?(t=Je,nv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),ks(t)):nv(Je,i.stateNode));break;case 4:l=Je,d=Ht,Je=i.stateNode.containerInfo,Ht=!0,or(t,r,i),Je=l,Ht=d;break;case 0:case 11:case 14:case 15:Br(2,i,r),dt||Br(4,i,r),or(t,r,i);break;case 1:dt||(Pn(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&ry(i,r,l)),or(t,r,i);break;case 21:or(t,r,i);break;case 22:dt=(l=dt)||i.memoizedState!==null,or(t,r,i),dt=l;break;default:or(t,r,i)}}function dy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ks(t)}catch(i){He(r,r.return,i)}}}function fy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ks(t)}catch(i){He(r,r.return,i)}}function M_(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new oy),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new oy),r;default:throw Error(s(435,t.tag))}}function _l(t,r){var i=M_(t);r.forEach(function(l){if(!i.has(l)){i.add(l);var d=q_.bind(null,t,l);l.then(d,d)}})}function qt(t,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l],h=t,w=r,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(Yr(C.type)){Je=C.stateNode,Ht=!1;break e}break;case 5:Je=C.stateNode,Ht=!1;break e;case 3:case 4:Je=C.stateNode.containerInfo,Ht=!0;break e}C=C.return}if(Je===null)throw Error(s(160));uy(h,w,d),Je=null,Ht=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)hy(r,t),r=r.sibling}var Sn=null;function hy(t,r){var i=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:qt(r,t),Ft(t),l&4&&(Br(3,t,t.return),Ui(3,t),Br(5,t,t.return));break;case 1:qt(r,t),Ft(t),l&512&&(dt||i===null||Pn(i,i.return)),l&64&&ir&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var d=Sn;if(qt(r,t),Ft(t),l&512&&(dt||i===null||Pn(i,i.return)),l&4){var h=i!==null?i.memoizedState:null;if(l=t.memoizedState,i===null)if(l===null)if(t.stateNode===null){e:{l=t.type,i=t.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":h=d.getElementsByTagName("title")[0],(!h||h[ui]||h[St]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(l),d.head.insertBefore(h,d.querySelector("head > title"))),Ct(h,l,i),h[St]=t,bt(h),l=h;break e;case"link":var w=hv("link","href",d).get(l+(i.href||""));if(w){for(var C=0;C<w.length;C++)if(h=w[C],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(C,1);break t}}h=d.createElement(l),Ct(h,l,i),d.head.appendChild(h);break;case"meta":if(w=hv("meta","content",d).get(l+(i.content||""))){for(C=0;C<w.length;C++)if(h=w[C],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(C,1);break t}}h=d.createElement(l),Ct(h,l,i),d.head.appendChild(h);break;default:throw Error(s(468,l))}h[St]=t,bt(h),l=h}t.stateNode=l}else pv(d,t.type,t.stateNode);else t.stateNode=fv(d,l,t.memoizedProps);else h!==l?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,l===null?pv(d,t.type,t.stateNode):fv(d,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Pd(t,t.memoizedProps,i.memoizedProps)}break;case 27:qt(r,t),Ft(t),l&512&&(dt||i===null||Pn(i,i.return)),i!==null&&l&4&&Pd(t,t.memoizedProps,i.memoizedProps);break;case 5:if(qt(r,t),Ft(t),l&512&&(dt||i===null||Pn(i,i.return)),t.flags&32){d=t.stateNode;try{es(d,"")}catch(ie){He(t,t.return,ie)}}l&4&&t.stateNode!=null&&(d=t.memoizedProps,Pd(t,d,i!==null?i.memoizedProps:d)),l&1024&&(Bd=!0);break;case 6:if(qt(r,t),Ft(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,i=t.stateNode;try{i.nodeValue=l}catch(ie){He(t,t.return,ie)}}break;case 3:if(Bl=null,d=Sn,Sn=zl(r.containerInfo),qt(r,t),Sn=d,Ft(t),l&4&&i!==null&&i.memoizedState.isDehydrated)try{ks(r.containerInfo)}catch(ie){He(t,t.return,ie)}Bd&&(Bd=!1,py(t));break;case 4:l=Sn,Sn=zl(t.stateNode.containerInfo),qt(r,t),Ft(t),Sn=l;break;case 12:qt(r,t),Ft(t);break;case 31:qt(r,t),Ft(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,_l(t,l)));break;case 13:qt(r,t),Ft(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Cl=Dt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,_l(t,l)));break;case 22:d=t.memoizedState!==null;var N=i!==null&&i.memoizedState!==null,z=ir,Y=dt;if(ir=z||d,dt=Y||N,qt(r,t),dt=Y,ir=z,Ft(t),l&8192)e:for(r=t.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(i===null||N||ir||dt||Na(t)),i=null,r=t;;){if(r.tag===5||r.tag===26){if(i===null){N=i=r;try{if(h=N.stateNode,d)w=h.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=N.stateNode;var Q=N.memoizedProps.style,H=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;C.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(ie){He(N,N.return,ie)}}}else if(r.tag===6){if(i===null){N=r;try{N.stateNode.nodeValue=d?"":N.memoizedProps}catch(ie){He(N,N.return,ie)}}}else if(r.tag===18){if(i===null){N=r;try{var F=N.stateNode;d?rv(F,!0):rv(N.stateNode,!1)}catch(ie){He(N,N.return,ie)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,_l(t,i))));break;case 19:qt(r,t),Ft(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,_l(t,l)));break;case 30:break;case 21:break;default:qt(r,t),Ft(t)}}function Ft(t){var r=t.flags;if(r&2){try{for(var i,l=t.return;l!==null;){if(sy(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var d=i.stateNode,h=zd(t);El(t,h,d);break;case 5:var w=i.stateNode;i.flags&32&&(es(w,""),i.flags&=-33);var C=zd(t);El(t,C,w);break;case 3:case 4:var N=i.stateNode.containerInfo,z=zd(t);Id(t,z,N);break;default:throw Error(s(161))}}catch(Y){He(t,t.return,Y)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function py(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;py(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function lr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)ly(t,r.alternate,r),r=r.sibling}function Na(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Br(4,r,r.return),Na(r);break;case 1:Pn(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&ry(r,r.return,i),Na(r);break;case 27:Gi(r.stateNode);case 26:case 5:Pn(r,r.return),Na(r);break;case 22:r.memoizedState===null&&Na(r);break;case 30:Na(r);break;default:Na(r)}t=t.sibling}}function cr(t,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,d=t,h=r,w=h.flags;switch(h.tag){case 0:case 11:case 15:cr(d,h,i),Ui(4,h);break;case 1:if(cr(d,h,i),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(z){He(l,l.return,z)}if(l=h,d=l.updateQueue,d!==null){var C=l.stateNode;try{var N=d.shared.hiddenCallbacks;if(N!==null)for(d.shared.hiddenCallbacks=null,d=0;d<N.length;d++)Vm(N[d],C)}catch(z){He(l,l.return,z)}}i&&w&64&&ny(h),Pi(h,h.return);break;case 27:iy(h);case 26:case 5:cr(d,h,i),i&&l===null&&w&4&&ay(h),Pi(h,h.return);break;case 12:cr(d,h,i);break;case 31:cr(d,h,i),i&&w&4&&dy(d,h);break;case 13:cr(d,h,i),i&&w&4&&fy(d,h);break;case 22:h.memoizedState===null&&cr(d,h,i),Pi(h,h.return);break;case 30:break;default:cr(d,h,i)}r=r.sibling}}function $d(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Ei(i))}function Hd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ei(t))}function En(t,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)my(t,r,i,l),r=r.sibling}function my(t,r,i,l){var d=r.flags;switch(r.tag){case 0:case 11:case 15:En(t,r,i,l),d&2048&&Ui(9,r);break;case 1:En(t,r,i,l);break;case 3:En(t,r,i,l),d&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Ei(t)));break;case 12:if(d&2048){En(t,r,i,l),t=r.stateNode;try{var h=r.memoizedProps,w=h.id,C=h.onPostCommit;typeof C=="function"&&C(w,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(N){He(r,r.return,N)}}else En(t,r,i,l);break;case 31:En(t,r,i,l);break;case 13:En(t,r,i,l);break;case 23:break;case 22:h=r.stateNode,w=r.alternate,r.memoizedState!==null?h._visibility&2?En(t,r,i,l):zi(t,r):h._visibility&2?En(t,r,i,l):(h._visibility|=2,ws(t,r,i,l,(r.subtreeFlags&10256)!==0||!1)),d&2048&&$d(w,r);break;case 24:En(t,r,i,l),d&2048&&Hd(r.alternate,r);break;default:En(t,r,i,l)}}function ws(t,r,i,l,d){for(d=d&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var h=t,w=r,C=i,N=l,z=w.flags;switch(w.tag){case 0:case 11:case 15:ws(h,w,C,N,d),Ui(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?ws(h,w,C,N,d):zi(h,w):(Y._visibility|=2,ws(h,w,C,N,d)),d&&z&2048&&$d(w.alternate,w);break;case 24:ws(h,w,C,N,d),d&&z&2048&&Hd(w.alternate,w);break;default:ws(h,w,C,N,d)}r=r.sibling}}function zi(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,l=r,d=l.flags;switch(l.tag){case 22:zi(i,l),d&2048&&$d(l.alternate,l);break;case 24:zi(i,l),d&2048&&Hd(l.alternate,l);break;default:zi(i,l)}r=r.sibling}}var Ii=8192;function xs(t,r,i){if(t.subtreeFlags&Ii)for(t=t.child;t!==null;)gy(t,r,i),t=t.sibling}function gy(t,r,i){switch(t.tag){case 26:xs(t,r,i),t.flags&Ii&&t.memoizedState!==null&&w1(i,Sn,t.memoizedState,t.memoizedProps);break;case 5:xs(t,r,i);break;case 3:case 4:var l=Sn;Sn=zl(t.stateNode.containerInfo),xs(t,r,i),Sn=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Ii,Ii=16777216,xs(t,r,i),Ii=l):xs(t,r,i));break;default:xs(t,r,i)}}function yy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Bi(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,by(l,t)}yy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vy(t),t=t.sibling}function vy(t){switch(t.tag){case 0:case 11:case 15:Bi(t),t.flags&2048&&Br(9,t,t.return);break;case 3:Bi(t);break;case 12:Bi(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Tl(t)):Bi(t);break;default:Bi(t)}}function Tl(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,by(l,t)}yy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Br(8,r,r.return),Tl(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Tl(r));break;default:Tl(r)}t=t.sibling}}function by(t,r){for(;wt!==null;){var i=wt;switch(i.tag){case 0:case 11:case 15:Br(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ei(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,wt=l;else e:for(i=t;wt!==null;){l=wt;var d=l.sibling,h=l.return;if(cy(l),l===i){wt=null;break e}if(d!==null){d.return=h,wt=d;break e}wt=h}}}var L_={getCacheForType:function(t){var r=_t(lt),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i},cacheSignal:function(){return _t(lt).controller.signal}},U_=typeof WeakMap=="function"?WeakMap:Map,Be=0,Ye=null,Ne=null,De=0,$e=0,en=null,$r=!1,Ss=!1,qd=!1,ur=0,at=0,Hr=0,ka=0,Fd=0,tn=0,Es=0,$i=null,Vt=null,Vd=!1,Cl=0,wy=0,Rl=1/0,Al=null,qr=null,pt=0,Fr=null,_s=null,dr=0,Gd=0,Yd=null,xy=null,Hi=0,Kd=null;function nn(){return(Be&2)!==0&&De!==0?De&-De:D.T!==null?ef():pu()}function Sy(){if(tn===0)if((De&536870912)===0||Le){var t=Ga;Ga<<=1,(Ga&3932160)===0&&(Ga=262144),tn=t}else tn=536870912;return t=Jt.current,t!==null&&(t.flags|=32),tn}function Gt(t,r,i){(t===Ye&&($e===2||$e===9)||t.cancelPendingCommit!==null)&&(Ts(t,0),Vr(t,De,tn,!1)),tt(t,i),((Be&2)===0||t!==Ye)&&(t===Ye&&((Be&2)===0&&(ka|=i),at===4&&Vr(t,De,tn,!1)),zn(t))}function Ey(t,r,i){if((Be&6)!==0)throw Error(s(327));var l=!i&&(r&127)===0&&(r&t.expiredLanes)===0||We(t,r),d=l?I_(t,r):Qd(t,r,!0),h=l;do{if(d===0){Ss&&!l&&Vr(t,r,0,!1);break}else{if(i=t.current.alternate,h&&!P_(i)){d=Qd(t,r,!1),h=!1;continue}if(d===2){if(h=r,t.errorRecoveryDisabledLanes&h)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var C=t;d=$i;var N=C.current.memoizedState.isDehydrated;if(N&&(Ts(C,w).flags|=256),w=Qd(C,w,!1),w!==2){if(qd&&!N){C.errorRecoveryDisabledLanes|=h,ka|=h,d=4;break e}h=Vt,Vt=d,h!==null&&(Vt===null?Vt=h:Vt.push.apply(Vt,h))}d=w}if(h=!1,d!==2)continue}}if(d===1){Ts(t,0),Vr(t,r,0,!0);break}e:{switch(l=t,h=d,h){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Vr(l,r,tn,!$r);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(d=Cl+300-Dt(),10<d)){if(Vr(l,r,tn,!$r),_e(l,0,!0)!==0)break e;dr=r,l.timeoutHandle=ev(_y.bind(null,l,i,Vt,Al,Vd,r,tn,ka,Es,$r,h,"Throttled",-0,0),d);break e}_y(l,i,Vt,Al,Vd,r,tn,ka,Es,$r,h,null,-0,0)}}break}while(!0);zn(t)}function _y(t,r,i,l,d,h,w,C,N,z,Y,Q,H,F){if(t.timeoutHandle=-1,Q=r.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},gy(r,h,Q);var ie=(h&62914560)===h?Cl-Dt():(h&4194048)===h?wy-Dt():0;if(ie=x1(Q,ie),ie!==null){dr=h,t.cancelPendingCommit=ie(jy.bind(null,t,r,h,i,l,d,w,C,N,Y,Q,null,H,F)),Vr(t,h,w,!z);return}}jy(t,r,h,i,l,d,w,C,N)}function P_(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var d=i[l],h=d.getSnapshot;d=d.value;try{if(!Qt(h(),d))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Vr(t,r,i,l){r&=~Fd,r&=~ka,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var d=r;0<d;){var h=31-Ot(d),w=1<<h;l[h]=-1,d&=~w}i!==0&&pa(t,i,r)}function Ol(){return(Be&6)===0?(qi(0),!1):!0}function Xd(){if(Ne!==null){if($e===0)var t=Ne.return;else t=Ne,er=Sa=null,dd(t),ms=null,Ti=0,t=Ne;for(;t!==null;)ty(t.alternate,t),t=t.return;Ne=null}}function Ts(t,r){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,r1(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),dr=0,Xd(),Ye=t,Ne=i=Jn(t.current,null),De=r,$e=0,en=null,$r=!1,Ss=We(t,r),qd=!1,Es=tn=Fd=ka=Hr=at=0,Vt=$i=null,Vd=!1,(r&8)!==0&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var d=31-Ot(l),h=1<<d;r|=t[d],l&=~h}return ur=r,Qo(),i}function Ty(t,r){Re=null,D.H=Di,r===ps||r===al?(r=$m(),$e=3):r===Zu?(r=$m(),$e=4):$e=r===Rd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,en=r,Ne===null&&(at=1,vl(t,dn(r,t.current)))}function Cy(){var t=Jt.current;return t===null?!0:(De&4194048)===De?mn===null:(De&62914560)===De||(De&536870912)!==0?t===mn:!1}function Ry(){var t=D.H;return D.H=Di,t===null?Di:t}function Ay(){var t=D.A;return D.A=L_,t}function Nl(){at=4,$r||(De&4194048)!==De&&Jt.current!==null||(Ss=!0),(Hr&134217727)===0&&(ka&134217727)===0||Ye===null||Vr(Ye,De,tn,!1)}function Qd(t,r,i){var l=Be;Be|=2;var d=Ry(),h=Ay();(Ye!==t||De!==r)&&(Al=null,Ts(t,r)),r=!1;var w=at;e:do try{if($e!==0&&Ne!==null){var C=Ne,N=en;switch($e){case 8:Xd(),w=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(r=!0);var z=$e;if($e=0,en=null,Cs(t,C,N,z),i&&Ss){w=0;break e}break;default:z=$e,$e=0,en=null,Cs(t,C,N,z)}}z_(),w=at;break}catch(Y){Ty(t,Y)}while(!0);return r&&t.shellSuspendCounter++,er=Sa=null,Be=l,D.H=d,D.A=h,Ne===null&&(Ye=null,De=0,Qo()),w}function z_(){for(;Ne!==null;)Oy(Ne)}function I_(t,r){var i=Be;Be|=2;var l=Ry(),d=Ay();Ye!==t||De!==r?(Al=null,Rl=Dt()+500,Ts(t,r)):Ss=We(t,r);e:do try{if($e!==0&&Ne!==null){r=Ne;var h=en;t:switch($e){case 1:$e=0,en=null,Cs(t,r,h,1);break;case 2:case 9:if(Im(h)){$e=0,en=null,Ny(r);break}r=function(){$e!==2&&$e!==9||Ye!==t||($e=7),zn(t)},h.then(r,r);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:Im(h)?($e=0,en=null,Ny(r)):($e=0,en=null,Cs(t,r,h,7));break;case 5:var w=null;switch(Ne.tag){case 26:w=Ne.memoizedState;case 5:case 27:var C=Ne;if(w?mv(w):C.stateNode.complete){$e=0,en=null;var N=C.sibling;if(N!==null)Ne=N;else{var z=C.return;z!==null?(Ne=z,kl(z)):Ne=null}break t}}$e=0,en=null,Cs(t,r,h,5);break;case 6:$e=0,en=null,Cs(t,r,h,6);break;case 8:Xd(),at=6;break e;default:throw Error(s(462))}}B_();break}catch(Y){Ty(t,Y)}while(!0);return er=Sa=null,D.H=l,D.A=d,Be=i,Ne!==null?0:(Ye=null,De=0,Qo(),at)}function B_(){for(;Ne!==null&&!jt();)Oy(Ne)}function Oy(t){var r=Zg(t.alternate,t,ur);t.memoizedProps=t.pendingProps,r===null?kl(t):Ne=r}function Ny(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=Yg(i,r,r.pendingProps,r.type,void 0,De);break;case 11:r=Yg(i,r,r.pendingProps,r.type.render,r.ref,De);break;case 5:dd(r);default:ty(i,r),r=Ne=Am(r,ur),r=Zg(i,r,ur)}t.memoizedProps=t.pendingProps,r===null?kl(t):Ne=r}function Cs(t,r,i,l){er=Sa=null,dd(r),ms=null,Ti=0;var d=r.return;try{if(A_(t,d,r,i,De)){at=1,vl(t,dn(i,t.current)),Ne=null;return}}catch(h){if(d!==null)throw Ne=d,h;at=1,vl(t,dn(i,t.current)),Ne=null;return}r.flags&32768?(Le||l===1?t=!0:Ss||(De&536870912)!==0?t=!1:($r=t=!0,(l===2||l===9||l===3||l===6)&&(l=Jt.current,l!==null&&l.tag===13&&(l.flags|=16384))),ky(r,t)):kl(r)}function kl(t){var r=t;do{if((r.flags&32768)!==0){ky(r,$r);return}t=r.return;var i=k_(r.alternate,r,ur);if(i!==null){Ne=i;return}if(r=r.sibling,r!==null){Ne=r;return}Ne=r=t}while(r!==null);at===0&&(at=5)}function ky(t,r){do{var i=j_(t.alternate,t);if(i!==null){i.flags&=32767,Ne=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){Ne=t;return}Ne=t=i}while(t!==null);at=6,Ne=null}function jy(t,r,i,l,d,h,w,C,N){t.cancelPendingCommit=null;do jl();while(pt!==0);if((Be&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(h=r.lanes|r.childLanes,h|=zu,Pt(t,i,h,w,C,N),t===Ye&&(Ne=Ye=null,De=0),_s=r,Fr=t,dr=i,Gd=h,Yd=d,xy=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,F_(da,function(){return Py(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=D.T,D.T=null,d=V.p,V.p=2,w=Be,Be|=4;try{D_(t,r,i)}finally{Be=w,V.p=d,D.T=l}}pt=1,Dy(),My(),Ly()}}function Dy(){if(pt===1){pt=0;var t=Fr,r=_s,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=D.T,D.T=null;var l=V.p;V.p=2;var d=Be;Be|=4;try{hy(r,t);var h=cf,w=bm(t.containerInfo),C=h.focusedElem,N=h.selectionRange;if(w!==C&&C&&C.ownerDocument&&vm(C.ownerDocument.documentElement,C)){if(N!==null&&Du(C)){var z=N.start,Y=N.end;if(Y===void 0&&(Y=z),"selectionStart"in C)C.selectionStart=z,C.selectionEnd=Math.min(Y,C.value.length);else{var Q=C.ownerDocument||document,H=Q&&Q.defaultView||window;if(H.getSelection){var F=H.getSelection(),ie=C.textContent.length,we=Math.min(N.start,ie),Ge=N.end===void 0?we:Math.min(N.end,ie);!F.extend&&we>Ge&&(w=Ge,Ge=we,we=w);var L=ym(C,we),M=ym(C,Ge);if(L&&M&&(F.rangeCount!==1||F.anchorNode!==L.node||F.anchorOffset!==L.offset||F.focusNode!==M.node||F.focusOffset!==M.offset)){var P=Q.createRange();P.setStart(L.node,L.offset),F.removeAllRanges(),we>Ge?(F.addRange(P),F.extend(M.node,M.offset)):(P.setEnd(M.node,M.offset),F.addRange(P))}}}}for(Q=[],F=C;F=F.parentNode;)F.nodeType===1&&Q.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<Q.length;C++){var X=Q[C];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Fl=!!lf,cf=lf=null}finally{Be=d,V.p=l,D.T=i}}t.current=r,pt=2}}function My(){if(pt===2){pt=0;var t=Fr,r=_s,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=D.T,D.T=null;var l=V.p;V.p=2;var d=Be;Be|=4;try{ly(t,r.alternate,r)}finally{Be=d,V.p=l,D.T=i}}pt=3}}function Ly(){if(pt===4||pt===3){pt=0,Cr();var t=Fr,r=_s,i=dr,l=xy;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?pt=5:(pt=0,_s=Fr=null,Uy(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(qr=null),wn(i),r=r.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(fa,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=D.T,d=V.p,V.p=2,D.T=null;try{for(var h=t.onRecoverableError,w=0;w<l.length;w++){var C=l[w];h(C.value,{componentStack:C.stack})}}finally{D.T=r,V.p=d}}(dr&3)!==0&&jl(),zn(t),d=t.pendingLanes,(i&261930)!==0&&(d&42)!==0?t===Kd?Hi++:(Hi=0,Kd=t):Hi=0,qi(0)}}function Uy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Ei(r)))}function jl(){return Dy(),My(),Ly(),Py()}function Py(){if(pt!==5)return!1;var t=Fr,r=Gd;Gd=0;var i=wn(dr),l=D.T,d=V.p;try{V.p=32>i?32:i,D.T=null,i=Yd,Yd=null;var h=Fr,w=dr;if(pt=0,_s=Fr=null,dr=0,(Be&6)!==0)throw Error(s(331));var C=Be;if(Be|=4,vy(h.current),my(h,h.current,w,i),Be=C,qi(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(fa,h)}catch{}return!0}finally{V.p=d,D.T=l,Uy(t,r)}}function zy(t,r,i){r=dn(i,r),r=Cd(t.stateNode,r,2),t=Pr(t,r,2),t!==null&&(tt(t,2),zn(t))}function He(t,r,i){if(t.tag===3)zy(t,t,i);else for(;r!==null;){if(r.tag===3){zy(r,t,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(qr===null||!qr.has(l))){t=dn(i,t),i=Ig(2),l=Pr(r,i,2),l!==null&&(Bg(i,l,r,t),tt(l,2),zn(l));break}}r=r.return}}function Wd(t,r,i){var l=t.pingCache;if(l===null){l=t.pingCache=new U_;var d=new Set;l.set(r,d)}else d=l.get(r),d===void 0&&(d=new Set,l.set(r,d));d.has(i)||(qd=!0,d.add(i),t=$_.bind(null,t,r,i),r.then(t,t))}function $_(t,r,i){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,Ye===t&&(De&i)===i&&(at===4||at===3&&(De&62914560)===De&&300>Dt()-Cl?(Be&2)===0&&Ts(t,0):Fd|=i,Es===De&&(Es=0)),zn(t)}function Iy(t,r){r===0&&(r=Nt()),t=ba(t,r),t!==null&&(tt(t,r),zn(t))}function H_(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),Iy(t,i)}function q_(t,r){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),Iy(t,i)}function F_(t,r){return ii(t,r)}var Dl=null,Rs=null,Jd=!1,Ml=!1,Zd=!1,Gr=0;function zn(t){t!==Rs&&t.next===null&&(Rs===null?Dl=Rs=t:Rs=Rs.next=t),Ml=!0,Jd||(Jd=!0,G_())}function qi(t,r){if(!Zd&&Ml){Zd=!0;do for(var i=!1,l=Dl;l!==null;){if(t!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var w=l.suspendedLanes,C=l.pingedLanes;h=(1<<31-Ot(42|t)+1)-1,h&=d&~(w&~C),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,qy(l,h))}else h=De,h=_e(l,l===Ye?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||We(l,h)||(i=!0,qy(l,h));l=l.next}while(i);Zd=!1}}function V_(){By()}function By(){Ml=Jd=!1;var t=0;Gr!==0&&n1()&&(t=Gr);for(var r=Dt(),i=null,l=Dl;l!==null;){var d=l.next,h=$y(l,r);h===0?(l.next=null,i===null?Dl=d:i.next=d,d===null&&(Rs=i)):(i=l,(t!==0||(h&3)!==0)&&(Ml=!0)),l=d}pt!==0&&pt!==5||qi(t),Gr!==0&&(Gr=0)}function $y(t,r){for(var i=t.suspendedLanes,l=t.pingedLanes,d=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var w=31-Ot(h),C=1<<w,N=d[w];N===-1?((C&i)===0||(C&l)!==0)&&(d[w]=vt(C,r)):N<=r&&(t.expiredLanes|=C),h&=~C}if(r=Ye,i=De,i=_e(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,i===0||t===r&&($e===2||$e===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&oi(l),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||We(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(l!==null&&oi(l),wn(i)){case 2:case 8:i=Po;break;case 32:i=da;break;case 268435456:i=Kn;break;default:i=da}return l=Hy.bind(null,t),i=ii(i,l),t.callbackPriority=r,t.callbackNode=i,r}return l!==null&&l!==null&&oi(l),t.callbackPriority=2,t.callbackNode=null,2}function Hy(t,r){if(pt!==0&&pt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(jl()&&t.callbackNode!==i)return null;var l=De;return l=_e(t,t===Ye?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Ey(t,l,r),$y(t,Dt()),t.callbackNode!=null&&t.callbackNode===i?Hy.bind(null,t):null)}function qy(t,r){if(jl())return null;Ey(t,r,!0)}function G_(){a1(function(){(Be&6)!==0?ii(ua,V_):By()})}function ef(){if(Gr===0){var t=fs;t===0&&(t=Va,Va<<=1,(Va&261888)===0&&(Va=256)),Gr=t}return Gr}function Fy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ho(""+t)}function Vy(t,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,t.id&&i.setAttribute("form",t.id),r.parentNode.insertBefore(i,r),t=new FormData(t),i.parentNode.removeChild(i),t}function Y_(t,r,i,l,d){if(r==="submit"&&i&&i.stateNode===d){var h=Fy((d[Bt]||null).action),w=l.submitter;w&&(r=(r=w[Bt]||null)?Fy(r.formAction):w.getAttribute("formAction"),r!==null&&(h=r,w=null));var C=new Go("action","action",null,l,d);t.push({event:C,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Gr!==0){var N=w?Vy(d,w):new FormData(d);wd(i,{pending:!0,data:N,method:d.method,action:h},null,N)}}else typeof h=="function"&&(C.preventDefault(),N=w?Vy(d,w):new FormData(d),wd(i,{pending:!0,data:N,method:d.method,action:h},h,N))},currentTarget:d}]})}}for(var tf=0;tf<Pu.length;tf++){var nf=Pu[tf],K_=nf.toLowerCase(),X_=nf[0].toUpperCase()+nf.slice(1);xn(K_,"on"+X_)}xn(Sm,"onAnimationEnd"),xn(Em,"onAnimationIteration"),xn(_m,"onAnimationStart"),xn("dblclick","onDoubleClick"),xn("focusin","onFocus"),xn("focusout","onBlur"),xn(d_,"onTransitionRun"),xn(f_,"onTransitionStart"),xn(h_,"onTransitionCancel"),xn(Tm,"onTransitionEnd"),Ja("onMouseEnter",["mouseout","mouseover"]),Ja("onMouseLeave",["mouseout","mouseover"]),Ja("onPointerEnter",["pointerout","pointerover"]),Ja("onPointerLeave",["pointerout","pointerover"]),ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fi="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(" "),Q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fi));function Gy(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var l=t[i],d=l.event;l=l.listeners;e:{var h=void 0;if(r)for(var w=l.length-1;0<=w;w--){var C=l[w],N=C.instance,z=C.currentTarget;if(C=C.listener,N!==h&&d.isPropagationStopped())break e;h=C,d.currentTarget=z;try{h(d)}catch(Y){Xo(Y)}d.currentTarget=null,h=N}else for(w=0;w<l.length;w++){if(C=l[w],N=C.instance,z=C.currentTarget,C=C.listener,N!==h&&d.isPropagationStopped())break e;h=C,d.currentTarget=z;try{h(d)}catch(Y){Xo(Y)}d.currentTarget=null,h=N}}}}function ke(t,r){var i=r[mu];i===void 0&&(i=r[mu]=new Set);var l=t+"__bubble";i.has(l)||(Yy(r,t,2,!1),i.add(l))}function rf(t,r,i){var l=0;r&&(l|=4),Yy(i,t,l,r)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function af(t){if(!t[Ll]){t[Ll]=!0,Bp.forEach(function(i){i!=="selectionchange"&&(Q_.has(i)||rf(i,!1,t),rf(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Ll]||(r[Ll]=!0,rf("selectionchange",!1,r))}}function Yy(t,r,i,l){switch(Sv(r)){case 2:var d=_1;break;case 8:d=T1;break;default:d=wf}i=d.bind(null,r,i,t),d=void 0,!_u||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),l?d!==void 0?t.addEventListener(r,i,{capture:!0,passive:d}):t.addEventListener(r,i,!0):d!==void 0?t.addEventListener(r,i,{passive:d}):t.addEventListener(r,i,!1)}function sf(t,r,i,l,d){var h=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var C=l.stateNode.containerInfo;if(C===d)break;if(w===4)for(w=l.return;w!==null;){var N=w.tag;if((N===3||N===4)&&w.stateNode.containerInfo===d)return;w=w.return}for(;C!==null;){if(w=Xa(C),w===null)return;if(N=w.tag,N===5||N===6||N===26||N===27){l=h=w;continue e}C=C.parentNode}}l=l.return}Jp(function(){var z=h,Y=Su(i),Q=[];e:{var H=Cm.get(t);if(H!==void 0){var F=Go,ie=t;switch(t){case"keypress":if(Fo(i)===0)break e;case"keydown":case"keyup":F=qE;break;case"focusin":ie="focus",F=Au;break;case"focusout":ie="blur",F=Au;break;case"beforeblur":case"afterblur":F=Au;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":F=tm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=kE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=GE;break;case Sm:case Em:case _m:F=ME;break;case Tm:F=KE;break;case"scroll":case"scrollend":F=OE;break;case"wheel":F=QE;break;case"copy":case"cut":case"paste":F=UE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=rm;break;case"toggle":case"beforetoggle":F=JE}var we=(r&4)!==0,Ge=!we&&(t==="scroll"||t==="scrollend"),L=we?H!==null?H+"Capture":null:H;we=[];for(var M=z,P;M!==null;){var X=M;if(P=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||P===null||L===null||(X=fi(M,L),X!=null&&we.push(Vi(M,X,P))),Ge)break;M=M.return}0<we.length&&(H=new F(H,ie,null,i,Y),Q.push({event:H,listeners:we}))}}if((r&7)===0){e:{if(H=t==="mouseover"||t==="pointerover",F=t==="mouseout"||t==="pointerout",H&&i!==xu&&(ie=i.relatedTarget||i.fromElement)&&(Xa(ie)||ie[Ka]))break e;if((F||H)&&(H=Y.window===Y?Y:(H=Y.ownerDocument)?H.defaultView||H.parentWindow:window,F?(ie=i.relatedTarget||i.toElement,F=z,ie=ie?Xa(ie):null,ie!==null&&(Ge=c(ie),we=ie.tag,ie!==Ge||we!==5&&we!==27&&we!==6)&&(ie=null)):(F=null,ie=z),F!==ie)){if(we=tm,X="onMouseLeave",L="onMouseEnter",M="mouse",(t==="pointerout"||t==="pointerover")&&(we=rm,X="onPointerLeave",L="onPointerEnter",M="pointer"),Ge=F==null?H:di(F),P=ie==null?H:di(ie),H=new we(X,M+"leave",F,i,Y),H.target=Ge,H.relatedTarget=P,X=null,Xa(Y)===z&&(we=new we(L,M+"enter",ie,i,Y),we.target=P,we.relatedTarget=Ge,X=we),Ge=X,F&&ie)t:{for(we=W_,L=F,M=ie,P=0,X=L;X;X=we(X))P++;X=0;for(var ye=M;ye;ye=we(ye))X++;for(;0<P-X;)L=we(L),P--;for(;0<X-P;)M=we(M),X--;for(;P--;){if(L===M||M!==null&&L===M.alternate){we=L;break t}L=we(L),M=we(M)}we=null}else we=null;F!==null&&Ky(Q,H,F,we,!1),ie!==null&&Ge!==null&&Ky(Q,Ge,ie,we,!0)}}e:{if(H=z?di(z):window,F=H.nodeName&&H.nodeName.toLowerCase(),F==="select"||F==="input"&&H.type==="file")var Pe=dm;else if(cm(H))if(fm)Pe=l_;else{Pe=i_;var fe=s_}else F=H.nodeName,!F||F.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?z&&wu(z.elementType)&&(Pe=dm):Pe=o_;if(Pe&&(Pe=Pe(t,z))){um(Q,Pe,i,Y);break e}fe&&fe(t,H,z),t==="focusout"&&z&&H.type==="number"&&z.memoizedProps.value!=null&&bu(H,"number",H.value)}switch(fe=z?di(z):window,t){case"focusin":(cm(fe)||fe.contentEditable==="true")&&(as=fe,Mu=z,wi=null);break;case"focusout":wi=Mu=as=null;break;case"mousedown":Lu=!0;break;case"contextmenu":case"mouseup":case"dragend":Lu=!1,wm(Q,i,Y);break;case"selectionchange":if(u_)break;case"keydown":case"keyup":wm(Q,i,Y)}var Ae;if(Nu)e:{switch(t){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else rs?om(t,i)&&(Me="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Me="onCompositionStart");Me&&(am&&i.locale!=="ko"&&(rs||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&rs&&(Ae=Zp()):(Nr=Y,Tu="value"in Nr?Nr.value:Nr.textContent,rs=!0)),fe=Ul(z,Me),0<fe.length&&(Me=new nm(Me,t,null,i,Y),Q.push({event:Me,listeners:fe}),Ae?Me.data=Ae:(Ae=lm(i),Ae!==null&&(Me.data=Ae)))),(Ae=e_?t_(t,i):n_(t,i))&&(Me=Ul(z,"onBeforeInput"),0<Me.length&&(fe=new nm("onBeforeInput","beforeinput",null,i,Y),Q.push({event:fe,listeners:Me}),fe.data=Ae)),Y_(Q,t,z,i,Y)}Gy(Q,r)})}function Vi(t,r,i){return{instance:t,listener:r,currentTarget:i}}function Ul(t,r){for(var i=r+"Capture",l=[];t!==null;){var d=t,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=fi(t,i),d!=null&&l.unshift(Vi(t,d,h)),d=fi(t,r),d!=null&&l.push(Vi(t,d,h))),t.tag===3)return l;t=t.return}return[]}function W_(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ky(t,r,i,l,d){for(var h=r._reactName,w=[];i!==null&&i!==l;){var C=i,N=C.alternate,z=C.stateNode;if(C=C.tag,N!==null&&N===l)break;C!==5&&C!==26&&C!==27||z===null||(N=z,d?(z=fi(i,h),z!=null&&w.unshift(Vi(i,z,N))):d||(z=fi(i,h),z!=null&&w.push(Vi(i,z,N)))),i=i.return}w.length!==0&&t.push({event:r,listeners:w})}var J_=/\r\n?/g,Z_=/\u0000|\uFFFD/g;function Xy(t){return(typeof t=="string"?t:""+t).replace(J_,`
9
- `).replace(Z_,"")}function Qy(t,r){return r=Xy(r),Xy(t)===r}function Ve(t,r,i,l,d,h){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||es(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&es(t,""+l);break;case"className":Bo(t,"class",l);break;case"tabIndex":Bo(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Bo(t,i,l);break;case"style":Qp(t,l,h);break;case"data":if(r!=="object"){Bo(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=Ho(""+l),t.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){t.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 h=="function"&&(i==="formAction"?(r!=="input"&&Ve(t,r,"name",d.name,d,null),Ve(t,r,"formEncType",d.formEncType,d,null),Ve(t,r,"formMethod",d.formMethod,d,null),Ve(t,r,"formTarget",d.formTarget,d,null)):(Ve(t,r,"encType",d.encType,d,null),Ve(t,r,"method",d.method,d,null),Ve(t,r,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=Ho(""+l),t.setAttribute(i,l);break;case"onClick":l!=null&&(t.onclick=Qn);break;case"onScroll":l!=null&&ke("scroll",t);break;case"onScrollEnd":l!=null&&ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}i=Ho(""+l),t.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":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""+l):t.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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":l===!0?t.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(i,l):t.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(i):t.setAttribute(i,l);break;case"popover":ke("beforetoggle",t),ke("toggle",t),Io(t,"popover",l);break;case"xlinkActuate":Xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Xn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Xn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Xn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Xn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Io(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=RE.get(i)||i,Io(t,i,l))}}function of(t,r,i,l,d,h){switch(i){case"style":Qp(t,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(s(60));t.innerHTML=i}}break;case"children":typeof l=="string"?es(t,l):(typeof l=="number"||typeof l=="bigint")&&es(t,""+l);break;case"onScroll":l!=null&&ke("scroll",t);break;case"onScrollEnd":l!=null&&ke("scrollend",t);break;case"onClick":l!=null&&(t.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$p.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),r=i.slice(2,d?i.length-7:void 0),h=t[Bt]||null,h=h!=null?h[i]:null,typeof h=="function"&&t.removeEventListener(r,h,d),typeof l=="function")){typeof h!="function"&&h!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(r,l,d);break e}i in t?t[i]=l:l===!0?t.setAttribute(i,""):Io(t,i,l)}}}function Ct(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",t),ke("load",t);var l=!1,d=!1,h;for(h in i)if(i.hasOwnProperty(h)){var w=i[h];if(w!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ve(t,r,h,w,i,null)}}d&&Ve(t,r,"srcSet",i.srcSet,i,null),l&&Ve(t,r,"src",i.src,i,null);return;case"input":ke("invalid",t);var C=h=w=d=null,N=null,z=null;for(l in i)if(i.hasOwnProperty(l)){var Y=i[l];if(Y!=null)switch(l){case"name":d=Y;break;case"type":w=Y;break;case"checked":N=Y;break;case"defaultChecked":z=Y;break;case"value":h=Y;break;case"defaultValue":C=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,r));break;default:Ve(t,r,l,Y,i,null)}}Gp(t,h,C,N,z,w,d,!1);return;case"select":ke("invalid",t),l=w=h=null;for(d in i)if(i.hasOwnProperty(d)&&(C=i[d],C!=null))switch(d){case"value":h=C;break;case"defaultValue":w=C;break;case"multiple":l=C;default:Ve(t,r,d,C,i,null)}r=h,i=w,t.multiple=!!l,r!=null?Za(t,!!l,r,!1):i!=null&&Za(t,!!l,i,!0);return;case"textarea":ke("invalid",t),h=d=l=null;for(w in i)if(i.hasOwnProperty(w)&&(C=i[w],C!=null))switch(w){case"value":l=C;break;case"defaultValue":d=C;break;case"children":h=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:Ve(t,r,w,C,i,null)}Kp(t,l,d,h);return;case"option":for(N in i)i.hasOwnProperty(N)&&(l=i[N],l!=null)&&(N==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Ve(t,r,N,l,i,null));return;case"dialog":ke("beforetoggle",t),ke("toggle",t),ke("cancel",t),ke("close",t);break;case"iframe":case"object":ke("load",t);break;case"video":case"audio":for(l=0;l<Fi.length;l++)ke(Fi[l],t);break;case"image":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"embed":case"source":case"link":ke("error",t),ke("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in i)if(i.hasOwnProperty(z)&&(l=i[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ve(t,r,z,l,i,null)}return;default:if(wu(r)){for(Y in i)i.hasOwnProperty(Y)&&(l=i[Y],l!==void 0&&of(t,r,Y,l,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(l=i[C],l!=null&&Ve(t,r,C,l,i,null))}function e1(t,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,w=null,C=null,N=null,z=null,Y=null;for(F in i){var Q=i[F];if(i.hasOwnProperty(F)&&Q!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":N=Q;default:l.hasOwnProperty(F)||Ve(t,r,F,null,l,Q)}}for(var H in l){var F=l[H];if(Q=i[H],l.hasOwnProperty(H)&&(F!=null||Q!=null))switch(H){case"type":h=F;break;case"name":d=F;break;case"checked":z=F;break;case"defaultChecked":Y=F;break;case"value":w=F;break;case"defaultValue":C=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(s(137,r));break;default:F!==Q&&Ve(t,r,H,F,l,Q)}}vu(t,w,C,N,z,Y,h,d);return;case"select":F=w=C=H=null;for(h in i)if(N=i[h],i.hasOwnProperty(h)&&N!=null)switch(h){case"value":break;case"multiple":F=N;default:l.hasOwnProperty(h)||Ve(t,r,h,null,l,N)}for(d in l)if(h=l[d],N=i[d],l.hasOwnProperty(d)&&(h!=null||N!=null))switch(d){case"value":H=h;break;case"defaultValue":C=h;break;case"multiple":w=h;default:h!==N&&Ve(t,r,d,h,l,N)}r=C,i=w,l=F,H!=null?Za(t,!!i,H,!1):!!l!=!!i&&(r!=null?Za(t,!!i,r,!0):Za(t,!!i,i?[]:"",!1));return;case"textarea":F=H=null;for(C in i)if(d=i[C],i.hasOwnProperty(C)&&d!=null&&!l.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Ve(t,r,C,null,l,d)}for(w in l)if(d=l[w],h=i[w],l.hasOwnProperty(w)&&(d!=null||h!=null))switch(w){case"value":H=d;break;case"defaultValue":F=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==h&&Ve(t,r,w,d,l,h)}Yp(t,H,F);return;case"option":for(var ie in i)H=i[ie],i.hasOwnProperty(ie)&&H!=null&&!l.hasOwnProperty(ie)&&(ie==="selected"?t.selected=!1:Ve(t,r,ie,null,l,H));for(N in l)H=l[N],F=i[N],l.hasOwnProperty(N)&&H!==F&&(H!=null||F!=null)&&(N==="selected"?t.selected=H&&typeof H!="function"&&typeof H!="symbol":Ve(t,r,N,H,l,F));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 we in i)H=i[we],i.hasOwnProperty(we)&&H!=null&&!l.hasOwnProperty(we)&&Ve(t,r,we,null,l,H);for(z in l)if(H=l[z],F=i[z],l.hasOwnProperty(z)&&H!==F&&(H!=null||F!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,r));break;default:Ve(t,r,z,H,l,F)}return;default:if(wu(r)){for(var Ge in i)H=i[Ge],i.hasOwnProperty(Ge)&&H!==void 0&&!l.hasOwnProperty(Ge)&&of(t,r,Ge,void 0,l,H);for(Y in l)H=l[Y],F=i[Y],!l.hasOwnProperty(Y)||H===F||H===void 0&&F===void 0||of(t,r,Y,H,l,F);return}}for(var L in i)H=i[L],i.hasOwnProperty(L)&&H!=null&&!l.hasOwnProperty(L)&&Ve(t,r,L,null,l,H);for(Q in l)H=l[Q],F=i[Q],!l.hasOwnProperty(Q)||H===F||H==null&&F==null||Ve(t,r,Q,H,l,F)}function Wy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function t1(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var d=i[l],h=d.transferSize,w=d.initiatorType,C=d.duration;if(h&&C&&Wy(w)){for(w=0,C=d.responseEnd,l+=1;l<i.length;l++){var N=i[l],z=N.startTime;if(z>C)break;var Y=N.transferSize,Q=N.initiatorType;Y&&Wy(Q)&&(N=N.responseEnd,w+=Y*(N<C?1:(C-z)/(N-z)))}if(--l,r+=8*(h+w)/(d.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var lf=null,cf=null;function Pl(t){return t.nodeType===9?t:t.ownerDocument}function Jy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zy(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function uf(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var df=null;function n1(){var t=window.event;return t&&t.type==="popstate"?t===df?!1:(df=t,!0):(df=null,!1)}var ev=typeof setTimeout=="function"?setTimeout:void 0,r1=typeof clearTimeout=="function"?clearTimeout:void 0,tv=typeof Promise=="function"?Promise:void 0,a1=typeof queueMicrotask=="function"?queueMicrotask:typeof tv<"u"?function(t){return tv.resolve(null).then(t).catch(s1)}:ev;function s1(t){setTimeout(function(){throw t})}function Yr(t){return t==="head"}function nv(t,r){var i=r,l=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(l===0){t.removeChild(d),ks(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Gi(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Gi(i);for(var h=i.firstChild;h;){var w=h.nextSibling,C=h.nodeName;h[ui]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=w}}else i==="body"&&Gi(t.ownerDocument.body);i=d}while(i);ks(r)}function rv(t,r){var i=t;t=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=l}while(i)}function ff(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":ff(i),gu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function i1(t,r,i,l){for(;t.nodeType===1;){var d=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[ui])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=gn(t.nextSibling),t===null)break}return null}function o1(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=gn(t.nextSibling),t===null))return null;return t}function av(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=gn(t.nextSibling),t===null))return null;return t}function hf(t){return t.data==="$?"||t.data==="$~"}function pf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function l1(t,r){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function gn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var mf=null;function sv(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(r===0)return gn(t.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}t=t.nextSibling}return null}function iv(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return t;r--}else i!=="/$"&&i!=="/&"||r++}t=t.previousSibling}return null}function ov(t,r,i){switch(r=Pl(i),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Gi(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);gu(t)}var yn=new Map,lv=new Set;function zl(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var fr=V.d;V.d={f:c1,r:u1,D:d1,C:f1,L:h1,m:p1,X:g1,S:m1,M:y1};function c1(){var t=fr.f(),r=Ol();return t||r}function u1(t){var r=Qa(t);r!==null&&r.tag===5&&r.type==="form"?Tg(r):fr.r(t)}var As=typeof document>"u"?null:document;function cv(t,r,i){var l=As;if(l&&typeof r=="string"&&r){var d=cn(r);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),lv.has(d)||(lv.add(d),t={rel:t,crossOrigin:i,href:r},l.querySelector(d)===null&&(r=l.createElement("link"),Ct(r,"link",t),bt(r),l.head.appendChild(r)))}}function d1(t){fr.D(t),cv("dns-prefetch",t,null)}function f1(t,r){fr.C(t,r),cv("preconnect",t,r)}function h1(t,r,i){fr.L(t,r,i);var l=As;if(l&&t&&r){var d='link[rel="preload"][as="'+cn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+cn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+cn(i.imageSizes)+'"]')):d+='[href="'+cn(t)+'"]';var h=d;switch(r){case"style":h=Os(t);break;case"script":h=Ns(t)}yn.has(h)||(t=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),yn.set(h,t),l.querySelector(d)!==null||r==="style"&&l.querySelector(Yi(h))||r==="script"&&l.querySelector(Ki(h))||(r=l.createElement("link"),Ct(r,"link",t),bt(r),l.head.appendChild(r)))}}function p1(t,r){fr.m(t,r);var i=As;if(i&&t){var l=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+cn(l)+'"][href="'+cn(t)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ns(t)}if(!yn.has(h)&&(t=g({rel:"modulepreload",href:t},r),yn.set(h,t),i.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ki(h)))return}l=i.createElement("link"),Ct(l,"link",t),bt(l),i.head.appendChild(l)}}}function m1(t,r,i){fr.S(t,r,i);var l=As;if(l&&t){var d=Wa(l).hoistableStyles,h=Os(t);r=r||"default";var w=d.get(h);if(!w){var C={loading:0,preload:null};if(w=l.querySelector(Yi(h)))C.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":r},i),(i=yn.get(h))&&gf(t,i);var N=w=l.createElement("link");bt(N),Ct(N,"link",t),N._p=new Promise(function(z,Y){N.onload=z,N.onerror=Y}),N.addEventListener("load",function(){C.loading|=1}),N.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Il(w,r,l)}w={type:"stylesheet",instance:w,count:1,state:C},d.set(h,w)}}}function g1(t,r){fr.X(t,r);var i=As;if(i&&t){var l=Wa(i).hoistableScripts,d=Ns(t),h=l.get(d);h||(h=i.querySelector(Ki(d)),h||(t=g({src:t,async:!0},r),(r=yn.get(d))&&yf(t,r),h=i.createElement("script"),bt(h),Ct(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function y1(t,r){fr.M(t,r);var i=As;if(i&&t){var l=Wa(i).hoistableScripts,d=Ns(t),h=l.get(d);h||(h=i.querySelector(Ki(d)),h||(t=g({src:t,async:!0,type:"module"},r),(r=yn.get(d))&&yf(t,r),h=i.createElement("script"),bt(h),Ct(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function uv(t,r,i,l){var d=(d=re.current)?zl(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Os(i.href),i=Wa(d).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Os(i.href);var h=Wa(d).hoistableStyles,w=h.get(t);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,w),(h=d.querySelector(Yi(t)))&&!h._p&&(w.instance=h,w.state.loading=5),yn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},yn.set(t,i),h||v1(d,t,i,w.state))),r&&l===null)throw Error(s(528,""));return w}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ns(i),i=Wa(d).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Os(t){return'href="'+cn(t)+'"'}function Yi(t){return'link[rel="stylesheet"]['+t+"]"}function dv(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function v1(t,r,i,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Ct(r,"link",i),bt(r),t.head.appendChild(r))}function Ns(t){return'[src="'+cn(t)+'"]'}function Ki(t){return"script[async]"+t}function fv(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+cn(i.href)+'"]');if(l)return r.instance=l,bt(l),l;var d=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),bt(l),Ct(l,"style",d),Il(l,i.precedence,t),r.instance=l;case"stylesheet":d=Os(i.href);var h=t.querySelector(Yi(d));if(h)return r.state.loading|=4,r.instance=h,bt(h),h;l=dv(i),(d=yn.get(d))&&gf(l,d),h=(t.ownerDocument||t).createElement("link"),bt(h);var w=h;return w._p=new Promise(function(C,N){w.onload=C,w.onerror=N}),Ct(h,"link",l),r.state.loading|=4,Il(h,i.precedence,t),r.instance=h;case"script":return h=Ns(i.src),(d=t.querySelector(Ki(h)))?(r.instance=d,bt(d),d):(l=i,(d=yn.get(h))&&(l=g({},i),yf(l,d)),t=t.ownerDocument||t,d=t.createElement("script"),bt(d),Ct(d,"link",l),t.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Il(l,i.precedence,t));return r.instance}function Il(t,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,w=0;w<l.length;w++){var C=l[w];if(C.dataset.precedence===r)h=C;else if(h!==d)break}h?h.parentNode.insertBefore(t,h.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function gf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function yf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Bl=null;function hv(t,r,i){if(Bl===null){var l=new Map,d=Bl=new Map;d.set(i,l)}else d=Bl,l=d.get(i),l||(l=new Map,d.set(i,l));if(l.has(t))return l;for(l.set(t,null),i=i.getElementsByTagName(t),d=0;d<i.length;d++){var h=i[d];if(!(h[ui]||h[St]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var w=h.getAttribute(r)||"";w=t+w;var C=l.get(w);C?C.push(h):l.set(w,[h])}}return l}function pv(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function b1(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function mv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function w1(t,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=Os(l.href),h=r.querySelector(Yi(d));if(h){r=h._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=$l.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=h,bt(h);return}h=r.ownerDocument||r,l=dv(l),(d=yn.get(d))&&gf(l,d),h=h.createElement("link"),bt(h);var w=h;w._p=new Promise(function(C,N){w.onload=C,w.onerror=N}),Ct(h,"link",l),i.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=$l.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var vf=0;function x1(t,r){return t.stylesheets&&t.count===0&&ql(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var l=setTimeout(function(){if(t.stylesheets&&ql(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+r);0<t.imgBytes&&vf===0&&(vf=62500*t1());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&ql(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>vf?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function $l(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ql(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Hl=null;function ql(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Hl=new Map,r.forEach(S1,t),Hl=null,$l.call(t))}function S1(t,r){if(!(r.state.loading&4)){var i=Hl.get(t);if(i)var l=i.get(null);else{i=new Map,Hl.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var w=d[h];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),l=w)}l&&i.set(null,l)}d=r.instance,w=d.getAttribute("data-precedence"),h=i.get(w)||l,h===l&&i.set(null,d),i.set(w,d),this.count++,l=$l.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),r.state.loading|=4}}var Xi={$$typeof:A,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function E1(t,r,i,l,d,h,w,C,N){this.tag=1,this.containerInfo=t,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=Ar(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.hiddenUpdates=Ar(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function gv(t,r,i,l,d,h,w,C,N,z,Y,Q){return t=new E1(t,r,i,w,N,z,Y,Q,C),r=1,h===!0&&(r|=24),h=Wt(3,null,null,r),t.current=h,h.stateNode=t,r=Qu(),r.refCount++,t.pooledCache=r,r.refCount++,h.memoizedState={element:l,isDehydrated:i,cache:r},ed(h),t}function yv(t){return t?(t=os,t):os}function vv(t,r,i,l,d,h){d=yv(d),l.context===null?l.context=d:l.pendingContext=d,l=Ur(r),l.payload={element:i},h=h===void 0?null:h,h!==null&&(l.callback=h),i=Pr(t,l,r),i!==null&&(Gt(i,t,r),Ri(i,t,r))}function bv(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function bf(t,r){bv(t,r),(t=t.alternate)&&bv(t,r)}function wv(t){if(t.tag===13||t.tag===31){var r=ba(t,67108864);r!==null&&Gt(r,t,67108864),bf(t,67108864)}}function xv(t){if(t.tag===13||t.tag===31){var r=nn();r=Ya(r);var i=ba(t,r);i!==null&&Gt(i,t,r),bf(t,r)}}var Fl=!0;function _1(t,r,i,l){var d=D.T;D.T=null;var h=V.p;try{V.p=2,wf(t,r,i,l)}finally{V.p=h,D.T=d}}function T1(t,r,i,l){var d=D.T;D.T=null;var h=V.p;try{V.p=8,wf(t,r,i,l)}finally{V.p=h,D.T=d}}function wf(t,r,i,l){if(Fl){var d=xf(l);if(d===null)sf(t,r,l,Vl,i),Ev(t,l);else if(R1(d,t,r,i,l))l.stopPropagation();else if(Ev(t,l),r&4&&-1<C1.indexOf(t)){for(;d!==null;){var h=Qa(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var w=Mn(h.pendingLanes);if(w!==0){var C=h;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var N=1<<31-Ot(w);C.entanglements[1]|=N,w&=~N}zn(h),(Be&6)===0&&(Rl=Dt()+500,qi(0))}}break;case 31:case 13:C=ba(h,2),C!==null&&Gt(C,h,2),Ol(),bf(h,2)}if(h=xf(l),h===null&&sf(t,r,l,Vl,i),h===d)break;d=h}d!==null&&l.stopPropagation()}else sf(t,r,l,null,i)}}function xf(t){return t=Su(t),Sf(t)}var Vl=null;function Sf(t){if(Vl=null,t=Xa(t),t!==null){var r=c(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=u(r),t!==null)return t;t=null}else if(i===31){if(t=f(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Vl=t,null}function Sv(t){switch(t){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(fu()){case ua:return 2;case Po:return 8;case da:case li:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var Ef=!1,Kr=null,Xr=null,Qr=null,Qi=new Map,Wi=new Map,Wr=[],C1="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 Ev(t,r){switch(t){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Qr=null;break;case"pointerover":case"pointerout":Qi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wi.delete(r.pointerId)}}function Ji(t,r,i,l,d,h){return t===null||t.nativeEvent!==h?(t={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},r!==null&&(r=Qa(r),r!==null&&wv(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function R1(t,r,i,l,d){switch(r){case"focusin":return Kr=Ji(Kr,t,r,i,l,d),!0;case"dragenter":return Xr=Ji(Xr,t,r,i,l,d),!0;case"mouseover":return Qr=Ji(Qr,t,r,i,l,d),!0;case"pointerover":var h=d.pointerId;return Qi.set(h,Ji(Qi.get(h)||null,t,r,i,l,d)),!0;case"gotpointercapture":return h=d.pointerId,Wi.set(h,Ji(Wi.get(h)||null,t,r,i,l,d)),!0}return!1}function _v(t){var r=Xa(t.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=u(i),r!==null){t.blockedOn=r,zp(t.priority,function(){xv(i)});return}}else if(r===31){if(r=f(i),r!==null){t.blockedOn=r,zp(t.priority,function(){xv(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gl(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=xf(t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);xu=l,i.target.dispatchEvent(l),xu=null}else return r=Qa(i),r!==null&&wv(r),t.blockedOn=i,!1;r.shift()}return!0}function Tv(t,r,i){Gl(t)&&i.delete(r)}function A1(){Ef=!1,Kr!==null&&Gl(Kr)&&(Kr=null),Xr!==null&&Gl(Xr)&&(Xr=null),Qr!==null&&Gl(Qr)&&(Qr=null),Qi.forEach(Tv),Wi.forEach(Tv)}function Yl(t,r){t.blockedOn===r&&(t.blockedOn=null,Ef||(Ef=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,A1)))}var Kl=null;function Cv(t){Kl!==t&&(Kl=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kl===t&&(Kl=null);for(var r=0;r<t.length;r+=3){var i=t[r],l=t[r+1],d=t[r+2];if(typeof l!="function"){if(Sf(l||i)===null)continue;break}var h=Qa(i);h!==null&&(t.splice(r,3),r-=3,wd(h,{pending:!0,data:d,method:i.method,action:l},l,d))}}))}function ks(t){function r(N){return Yl(N,t)}Kr!==null&&Yl(Kr,t),Xr!==null&&Yl(Xr,t),Qr!==null&&Yl(Qr,t),Qi.forEach(r),Wi.forEach(r);for(var i=0;i<Wr.length;i++){var l=Wr[i];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Wr.length&&(i=Wr[0],i.blockedOn===null);)_v(i),i.blockedOn===null&&Wr.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var d=i[l],h=i[l+1],w=d[Bt]||null;if(typeof h=="function")w||Cv(i);else if(w){var C=null;if(h&&h.hasAttribute("formAction")){if(d=h,w=h[Bt]||null)C=w.formAction;else if(Sf(d)!==null)continue}else C=w.action;typeof C=="function"?i[l+1]=C:(i.splice(l,3),l-=3),Cv(i)}}}function Rv(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(w){return d=w})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function _f(t){this._internalRoot=t}Xl.prototype.render=_f.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current,l=nn();vv(i,l,t,r,null,null)},Xl.prototype.unmount=_f.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;vv(t.current,2,null,t,null,null),Ol(),r[Ka]=null}};function Xl(t){this._internalRoot=t}Xl.prototype.unstable_scheduleHydration=function(t){if(t){var r=pu();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Wr.length&&r!==0&&r<Wr[i].priority;i++);Wr.splice(i,0,t),i===0&&_v(t)}};var Av=n.version;if(Av!=="19.2.4")throw Error(s(527,Av,"19.2.4"));V.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=m(r),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var O1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ql=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ql.isDisabled&&Ql.supportsFiber)try{fa=Ql.inject(O1),Mt=Ql}catch{}}return eo.createRoot=function(t,r){if(!o(t))throw Error(s(299));var i=!1,l="",d=Lg,h=Ug,w=Pg;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(h=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=gv(t,1,!1,null,null,i,l,null,d,h,w,Rv),t[Ka]=r.current,af(t),new _f(r)},eo.hydrateRoot=function(t,r,i){if(!o(t))throw Error(s(299));var l=!1,d="",h=Lg,w=Ug,C=Pg,N=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(N=i.formState)),r=gv(t,1,!0,r,i??null,l,d,N,h,w,C,Rv),r.context=yv(null),i=r.current,l=nn(),l=Ya(l),d=Ur(l),d.callback=null,Pr(i,d,l),i=l,r.current.lanes=i,tt(r,i),zn(r),t[Ka]=r.current,af(t),new Xl(r)},eo.version="19.2.4",eo}var zv;function I1(){if(zv)return Cf.exports;zv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Cf.exports=z1(),Cf.exports}var B1=I1(),b=Ph();const te=b0(b),zh=k1({__proto__:null,default:te},[b]),$1=1,H1=1e6;let kf=0;function q1(){return kf=(kf+1)%Number.MAX_SAFE_INTEGER,kf.toString()}const jf=new Map,Iv=e=>{if(jf.has(e))return;const n=setTimeout(()=>{jf.delete(e),uo({type:"REMOVE_TOAST",toastId:e})},H1);jf.set(e,n)},F1=(e,n)=>{switch(n.type){case"ADD_TOAST":return{...e,toasts:[n.toast,...e.toasts].slice(0,$1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===n.toast.id?{...a,...n.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=n;return a?Iv(a):e.toasts.forEach(s=>{Iv(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===a||a===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return n.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==n.toastId)}}},vc=[];let bc={toasts:[]};function uo(e){bc=F1(bc,e),vc.forEach(n=>{n(bc)})}function V1({...e}){const n=q1(),a=o=>uo({type:"UPDATE_TOAST",toast:{...o,id:n}}),s=()=>uo({type:"DISMISS_TOAST",toastId:n});return uo({type:"ADD_TOAST",toast:{...e,id:n,open:!0,onOpenChange:o=>{o||s()}}}),{id:n,dismiss:s,update:a}}function Qs(){const[e,n]=b.useState(bc);return b.useEffect(()=>(vc.push(n),()=>{const a=vc.indexOf(n);a>-1&&vc.splice(a,1)}),[e]),{...e,toast:V1,dismiss:a=>uo({type:"DISMISS_TOAST",toastId:a})}}var qc=w0();const x0=b0(qc);function je(e,n,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return n?.(o)}}function Bv(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Oo(...e){return n=>{let a=!1;const s=e.map(o=>{const c=Bv(o,n);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let o=0;o<s.length;o++){const c=s[o];typeof c=="function"?c():Bv(e[o],null)}}}}function Ze(...e){return b.useCallback(Oo(...e),e)}function G1(e,n){const a=b.createContext(n),s=c=>{const{children:u,...f}=c,p=b.useMemo(()=>f,Object.values(f));return v.jsx(a.Provider,{value:p,children:u})};s.displayName=e+"Provider";function o(c){const u=b.useContext(a);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,o]}function kn(e,n=[]){let a=[];function s(c,u){const f=b.createContext(u),p=a.length;a=[...a,u];const m=g=>{const{scope:x,children:S,..._}=g,E=x?.[e]?.[p]||f,T=b.useMemo(()=>_,Object.values(_));return v.jsx(E.Provider,{value:T,children:S})};m.displayName=c+"Provider";function y(g,x){const S=x?.[e]?.[p]||f,_=b.useContext(S);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[m,y]}const o=()=>{const c=a.map(u=>b.createContext(u));return function(f){const p=f?.[e]||c;return b.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return o.scopeName=e,[s,Y1(o,...n)]}function Y1(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const u=s.reduce((f,{useScope:p,scopeName:m})=>{const g=p(c)[`__scope${m}`];return{...f,...g}},{});return b.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return a.scopeName=n.scopeName,a}function $v(e){const n=K1(e),a=b.forwardRef((s,o)=>{const{children:c,...u}=s,f=b.Children.toArray(c),p=f.find(Q1);if(p){const m=p.props.children,y=f.map(g=>g===p?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:g);return v.jsx(n,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return v.jsx(n,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function K1(e){const n=b.forwardRef((a,s)=>{const{children:o,...c}=a;if(b.isValidElement(o)){const u=J1(o),f=W1(c,o.props);return o.type!==b.Fragment&&(f.ref=s?Oo(s,u):u),b.cloneElement(o,f)}return b.Children.count(o)>1?b.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var X1=Symbol("radix.slottable");function Q1(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X1}function W1(e,n){const a={...n};for(const s in n){const o=e[s],c=n[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...f)=>{const p=c(...f);return o(...f),p}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function J1(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function S0(e){const n=e+"CollectionProvider",[a,s]=kn(n),[o,c]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=E=>{const{scope:T,children:R}=E,O=te.useRef(null),A=te.useRef(new Map).current;return v.jsx(o,{scope:T,itemMap:A,collectionRef:O,children:R})};u.displayName=n;const f=e+"CollectionSlot",p=$v(f),m=te.forwardRef((E,T)=>{const{scope:R,children:O}=E,A=c(f,R),k=Ze(T,A.collectionRef);return v.jsx(p,{ref:k,children:O})});m.displayName=f;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=$v(y),S=te.forwardRef((E,T)=>{const{scope:R,children:O,...A}=E,k=te.useRef(null),I=Ze(T,k),B=c(y,R);return te.useEffect(()=>(B.itemMap.set(k,{ref:k,...A}),()=>{B.itemMap.delete(k)})),v.jsx(x,{[g]:"",ref:I,children:O})});S.displayName=y;function _(E){const T=c(e+"CollectionConsumer",E);return te.useCallback(()=>{const O=T.collectionRef.current;if(!O)return[];const A=Array.from(O.querySelectorAll(`[${g}]`));return Array.from(T.itemMap.values()).sort((B,$)=>A.indexOf(B.ref.current)-A.indexOf($.ref.current))},[T.collectionRef,T.itemMap])}return[{Provider:u,Slot:m,ItemSlot:S},_,s]}function Z1(e){const n=eT(e),a=b.forwardRef((s,o)=>{const{children:c,...u}=s,f=b.Children.toArray(c),p=f.find(nT);if(p){const m=p.props.children,y=f.map(g=>g===p?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:g);return v.jsx(n,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return v.jsx(n,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function eT(e){const n=b.forwardRef((a,s)=>{const{children:o,...c}=a;if(b.isValidElement(o)){const u=aT(o),f=rT(c,o.props);return o.type!==b.Fragment&&(f.ref=s?Oo(s,u):u),b.cloneElement(o,f)}return b.Children.count(o)>1?b.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var tT=Symbol("radix.slottable");function nT(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tT}function rT(e,n){const a={...n};for(const s in n){const o=e[s],c=n[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...f)=>{const p=c(...f);return o(...f),p}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function aT(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var sT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=sT.reduce((e,n)=>{const a=Z1(`Primitive.${n}`),s=b.forwardRef((o,c)=>{const{asChild:u,...f}=o,p=u?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(p,{...f,ref:c})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function E0(e,n){e&&qc.flushSync(()=>e.dispatchEvent(n))}function An(e){const n=b.useRef(e);return b.useEffect(()=>{n.current=e}),b.useMemo(()=>(...a)=>n.current?.(...a),[])}function iT(e,n=globalThis?.document){const a=An(e);b.useEffect(()=>{const s=o=>{o.key==="Escape"&&a(o)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[a,n])}var oT="DismissableLayer",sh="dismissableLayer.update",lT="dismissableLayer.pointerDownOutside",cT="dismissableLayer.focusOutside",Hv,_0=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fc=b.forwardRef((e,n)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...p}=e,m=b.useContext(_0),[y,g]=b.useState(null),x=y?.ownerDocument??globalThis?.document,[,S]=b.useState({}),_=Ze(n,$=>g($)),E=Array.from(m.layers),[T]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=E.indexOf(T),O=y?E.indexOf(y):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,k=O>=R,I=dT($=>{const q=$.target,ne=[...m.branches].some(de=>de.contains(q));!k||ne||(o?.($),u?.($),$.defaultPrevented||f?.())},x),B=fT($=>{const q=$.target;[...m.branches].some(de=>de.contains(q))||(c?.($),u?.($),$.defaultPrevented||f?.())},x);return iT($=>{O===m.layers.size-1&&(s?.($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},x),b.useEffect(()=>{if(y)return a&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Hv=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),qv(),()=>{a&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Hv)}},[y,x,a,m]),b.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),qv())},[y,m]),b.useEffect(()=>{const $=()=>S({});return document.addEventListener(sh,$),()=>document.removeEventListener(sh,$)},[]),v.jsx(Ie.div,{...p,ref:_,style:{pointerEvents:A?k?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,B.onFocusCapture),onBlurCapture:je(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,I.onPointerDownCapture)})});Fc.displayName=oT;var uT="DismissableLayerBranch",T0=b.forwardRef((e,n)=>{const a=b.useContext(_0),s=b.useRef(null),o=Ze(n,s);return b.useEffect(()=>{const c=s.current;if(c)return a.branches.add(c),()=>{a.branches.delete(c)}},[a.branches]),v.jsx(Ie.div,{...e,ref:o})});T0.displayName=uT;function dT(e,n=globalThis?.document){const a=An(e),s=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const c=f=>{if(f.target&&!s.current){let p=function(){C0(lT,a,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=p,n.addEventListener("click",o.current,{once:!0})):p()}else n.removeEventListener("click",o.current);s.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",c),n.removeEventListener("click",o.current)}},[n,a]),{onPointerDownCapture:()=>s.current=!0}}function fT(e,n=globalThis?.document){const a=An(e),s=b.useRef(!1);return b.useEffect(()=>{const o=c=>{c.target&&!s.current&&C0(cT,a,{originalEvent:c},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function qv(){const e=new CustomEvent(sh);document.dispatchEvent(e)}function C0(e,n,a,{discrete:s}){const o=a.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});n&&o.addEventListener(e,n,{once:!0}),s?E0(o,c):o.dispatchEvent(c)}var hT=Fc,pT=T0,Fn=globalThis?.document?b.useLayoutEffect:()=>{},mT="Portal",Ih=b.forwardRef((e,n)=>{const{container:a,...s}=e,[o,c]=b.useState(!1);Fn(()=>c(!0),[]);const u=a||o&&globalThis?.document?.body;return u?x0.createPortal(v.jsx(Ie.div,{...s,ref:n}),u):null});Ih.displayName=mT;function gT(e,n){return b.useReducer((a,s)=>n[a][s]??a,e)}var xr=e=>{const{present:n,children:a}=e,s=yT(n),o=typeof a=="function"?a({present:s.isPresent}):b.Children.only(a),c=Ze(s.ref,vT(o));return typeof a=="function"||s.isPresent?b.cloneElement(o,{ref:c}):null};xr.displayName="Presence";function yT(e){const[n,a]=b.useState(),s=b.useRef(null),o=b.useRef(e),c=b.useRef("none"),u=e?"mounted":"unmounted",[f,p]=gT(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=Wl(s.current);c.current=f==="mounted"?m:"none"},[f]),Fn(()=>{const m=s.current,y=o.current;if(y!==e){const x=c.current,S=Wl(m);e?p("MOUNT"):S==="none"||m?.display==="none"?p("UNMOUNT"):p(y&&x!==S?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Fn(()=>{if(n){let m;const y=n.ownerDocument.defaultView??window,g=S=>{const E=Wl(s.current).includes(CSS.escape(S.animationName));if(S.target===n&&E&&(p("ANIMATION_END"),!o.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",m=y.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},x=S=>{S.target===n&&(c.current=Wl(s.current))};return n.addEventListener("animationstart",x),n.addEventListener("animationcancel",g),n.addEventListener("animationend",g),()=>{y.clearTimeout(m),n.removeEventListener("animationstart",x),n.removeEventListener("animationcancel",g),n.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:b.useCallback(m=>{s.current=m?getComputedStyle(m):null,a(m)},[])}}function Wl(e){return e?.animationName||"none"}function vT(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var bT=zh[" useInsertionEffect ".trim().toString()]||Fn;function Ws({prop:e,defaultProp:n,onChange:a=()=>{},caller:s}){const[o,c,u]=wT({defaultProp:n,onChange:a}),f=e!==void 0,p=f?e:o;{const y=b.useRef(e!==void 0);b.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,s])}const m=b.useCallback(y=>{if(f){const g=xT(y)?y(e):y;g!==e&&u.current?.(g)}else c(y)},[f,e,c,u]);return[p,m]}function wT({defaultProp:e,onChange:n}){const[a,s]=b.useState(e),o=b.useRef(a),c=b.useRef(n);return bT(()=>{c.current=n},[n]),b.useEffect(()=>{o.current!==a&&(c.current?.(a),o.current=a)},[a,o]),[a,s,c]}function xT(e){return typeof e=="function"}var ST=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ET="VisuallyHidden",Vc=b.forwardRef((e,n)=>v.jsx(Ie.span,{...e,ref:n,style:{...ST,...e.style}}));Vc.displayName=ET;var _T=Vc,Bh="ToastProvider",[$h,TT,CT]=S0("Toast"),[R0]=kn("Toast",[CT]),[RT,Gc]=R0(Bh),A0=e=>{const{__scopeToast:n,label:a="Notification",duration:s=5e3,swipeDirection:o="right",swipeThreshold:c=50,children:u}=e,[f,p]=b.useState(null),[m,y]=b.useState(0),g=b.useRef(!1),x=b.useRef(!1);return a.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bh}\`. Expected non-empty \`string\`.`),v.jsx($h.Provider,{scope:n,children:v.jsx(RT,{scope:n,label:a,duration:s,swipeDirection:o,swipeThreshold:c,toastCount:m,viewport:f,onViewportChange:p,onToastAdd:b.useCallback(()=>y(S=>S+1),[]),onToastRemove:b.useCallback(()=>y(S=>S-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:x,children:u})})};A0.displayName=Bh;var O0="ToastViewport",AT=["F8"],ih="toast.viewportPause",oh="toast.viewportResume",N0=b.forwardRef((e,n)=>{const{__scopeToast:a,hotkey:s=AT,label:o="Notifications ({hotkey})",...c}=e,u=Gc(O0,a),f=TT(a),p=b.useRef(null),m=b.useRef(null),y=b.useRef(null),g=b.useRef(null),x=Ze(n,g,u.onViewportChange),S=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=u.toastCount>0;b.useEffect(()=>{const T=R=>{s.length!==0&&s.every(A=>R[A]||R.code===A)&&g.current?.focus()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[s]),b.useEffect(()=>{const T=p.current,R=g.current;if(_&&T&&R){const O=()=>{if(!u.isClosePausedRef.current){const B=new CustomEvent(ih);R.dispatchEvent(B),u.isClosePausedRef.current=!0}},A=()=>{if(u.isClosePausedRef.current){const B=new CustomEvent(oh);R.dispatchEvent(B),u.isClosePausedRef.current=!1}},k=B=>{!T.contains(B.relatedTarget)&&A()},I=()=>{T.contains(document.activeElement)||A()};return T.addEventListener("focusin",O),T.addEventListener("focusout",k),T.addEventListener("pointermove",O),T.addEventListener("pointerleave",I),window.addEventListener("blur",O),window.addEventListener("focus",A),()=>{T.removeEventListener("focusin",O),T.removeEventListener("focusout",k),T.removeEventListener("pointermove",O),T.removeEventListener("pointerleave",I),window.removeEventListener("blur",O),window.removeEventListener("focus",A)}}},[_,u.isClosePausedRef]);const E=b.useCallback(({tabbingDirection:T})=>{const O=f().map(A=>{const k=A.ref.current,I=[k,...$T(k)];return T==="forwards"?I:I.reverse()});return(T==="forwards"?O.reverse():O).flat()},[f]);return b.useEffect(()=>{const T=g.current;if(T){const R=O=>{const A=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!A){const I=document.activeElement,B=O.shiftKey;if(O.target===T&&B){m.current?.focus();return}const ne=E({tabbingDirection:B?"backwards":"forwards"}),de=ne.findIndex(he=>he===I);Df(ne.slice(de+1))?O.preventDefault():B?m.current?.focus():y.current?.focus()}};return T.addEventListener("keydown",R),()=>T.removeEventListener("keydown",R)}},[f,E]),v.jsxs(pT,{ref:p,role:"region","aria-label":o.replace("{hotkey}",S),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&v.jsx(lh,{ref:m,onFocusFromOutsideViewport:()=>{const T=E({tabbingDirection:"forwards"});Df(T)}}),v.jsx($h.Slot,{scope:a,children:v.jsx(Ie.ol,{tabIndex:-1,...c,ref:x})}),_&&v.jsx(lh,{ref:y,onFocusFromOutsideViewport:()=>{const T=E({tabbingDirection:"backwards"});Df(T)}})]})});N0.displayName=O0;var k0="ToastFocusProxy",lh=b.forwardRef((e,n)=>{const{__scopeToast:a,onFocusFromOutsideViewport:s,...o}=e,c=Gc(k0,a);return v.jsx(Vc,{tabIndex:0,...o,ref:n,style:{position:"fixed"},onFocus:u=>{const f=u.relatedTarget;!c.viewport?.contains(f)&&s()}})});lh.displayName=k0;var No="Toast",OT="toast.swipeStart",NT="toast.swipeMove",kT="toast.swipeCancel",jT="toast.swipeEnd",j0=b.forwardRef((e,n)=>{const{forceMount:a,open:s,defaultOpen:o,onOpenChange:c,...u}=e,[f,p]=Ws({prop:s,defaultProp:o??!0,onChange:c,caller:No});return v.jsx(xr,{present:a||f,children:v.jsx(LT,{open:f,...u,ref:n,onClose:()=>p(!1),onPause:An(e.onPause),onResume:An(e.onResume),onSwipeStart:je(e.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:je(e.onSwipeMove,m=>{const{x:y,y:g}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${y}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:je(e.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:je(e.onSwipeEnd,m=>{const{x:y,y:g}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${y}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),p(!1)})})})});j0.displayName=No;var[DT,MT]=R0(No,{onClose(){}}),LT=b.forwardRef((e,n)=>{const{__scopeToast:a,type:s="foreground",duration:o,open:c,onClose:u,onEscapeKeyDown:f,onPause:p,onResume:m,onSwipeStart:y,onSwipeMove:g,onSwipeCancel:x,onSwipeEnd:S,..._}=e,E=Gc(No,a),[T,R]=b.useState(null),O=Ze(n,W=>R(W)),A=b.useRef(null),k=b.useRef(null),I=o||E.duration,B=b.useRef(0),$=b.useRef(I),q=b.useRef(0),{onToastAdd:ne,onToastRemove:de}=E,he=An(()=>{T?.contains(document.activeElement)&&E.viewport?.focus(),u()}),le=b.useCallback(W=>{!W||W===1/0||(window.clearTimeout(q.current),B.current=new Date().getTime(),q.current=window.setTimeout(he,W))},[he]);b.useEffect(()=>{const W=E.viewport;if(W){const ae=()=>{le($.current),m?.()},D=()=>{const V=new Date().getTime()-B.current;$.current=$.current-V,window.clearTimeout(q.current),p?.()};return W.addEventListener(ih,D),W.addEventListener(oh,ae),()=>{W.removeEventListener(ih,D),W.removeEventListener(oh,ae)}}},[E.viewport,I,p,m,le]),b.useEffect(()=>{c&&!E.isClosePausedRef.current&&le(I)},[c,I,E.isClosePausedRef,le]),b.useEffect(()=>(ne(),()=>de()),[ne,de]);const me=b.useMemo(()=>T?I0(T):null,[T]);return E.viewport?v.jsxs(v.Fragment,{children:[me&&v.jsx(UT,{__scopeToast:a,role:"status","aria-live":s==="foreground"?"assertive":"polite",children:me}),v.jsx(DT,{scope:a,onClose:he,children:qc.createPortal(v.jsx($h.ItemSlot,{scope:a,children:v.jsx(hT,{asChild:!0,onEscapeKeyDown:je(f,()=>{E.isFocusedToastEscapeKeyDownRef.current||he(),E.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(Ie.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":E.swipeDirection,..._,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:je(e.onKeyDown,W=>{W.key==="Escape"&&(f?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(E.isFocusedToastEscapeKeyDownRef.current=!0,he()))}),onPointerDown:je(e.onPointerDown,W=>{W.button===0&&(A.current={x:W.clientX,y:W.clientY})}),onPointerMove:je(e.onPointerMove,W=>{if(!A.current)return;const ae=W.clientX-A.current.x,D=W.clientY-A.current.y,V=!!k.current,Z=["left","right"].includes(E.swipeDirection),se=["left","up"].includes(E.swipeDirection)?Math.min:Math.max,J=Z?se(0,ae):0,j=Z?0:se(0,D),G=W.pointerType==="touch"?10:2,K={x:J,y:j},ee={originalEvent:W,delta:K};V?(k.current=K,Jl(NT,g,ee,{discrete:!1})):Fv(K,E.swipeDirection,G)?(k.current=K,Jl(OT,y,ee,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(ae)>G||Math.abs(D)>G)&&(A.current=null)}),onPointerUp:je(e.onPointerUp,W=>{const ae=k.current,D=W.target;if(D.hasPointerCapture(W.pointerId)&&D.releasePointerCapture(W.pointerId),k.current=null,A.current=null,ae){const V=W.currentTarget,Z={originalEvent:W,delta:ae};Fv(ae,E.swipeDirection,E.swipeThreshold)?Jl(jT,S,Z,{discrete:!0}):Jl(kT,x,Z,{discrete:!0}),V.addEventListener("click",se=>se.preventDefault(),{once:!0})}})})})}),E.viewport)})]}):null}),UT=e=>{const{__scopeToast:n,children:a,...s}=e,o=Gc(No,n),[c,u]=b.useState(!1),[f,p]=b.useState(!1);return IT(()=>u(!0)),b.useEffect(()=>{const m=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(m)},[]),f?null:v.jsx(Ih,{asChild:!0,children:v.jsx(Vc,{...s,children:c&&v.jsxs(v.Fragment,{children:[o.label," ",a]})})})},PT="ToastTitle",D0=b.forwardRef((e,n)=>{const{__scopeToast:a,...s}=e;return v.jsx(Ie.div,{...s,ref:n})});D0.displayName=PT;var zT="ToastDescription",M0=b.forwardRef((e,n)=>{const{__scopeToast:a,...s}=e;return v.jsx(Ie.div,{...s,ref:n})});M0.displayName=zT;var L0="ToastAction",U0=b.forwardRef((e,n)=>{const{altText:a,...s}=e;return a.trim()?v.jsx(z0,{altText:a,asChild:!0,children:v.jsx(Hh,{...s,ref:n})}):(console.error(`Invalid prop \`altText\` supplied to \`${L0}\`. Expected non-empty \`string\`.`),null)});U0.displayName=L0;var P0="ToastClose",Hh=b.forwardRef((e,n)=>{const{__scopeToast:a,...s}=e,o=MT(P0,a);return v.jsx(z0,{asChild:!0,children:v.jsx(Ie.button,{type:"button",...s,ref:n,onClick:je(e.onClick,o.onClose)})})});Hh.displayName=P0;var z0=b.forwardRef((e,n)=>{const{__scopeToast:a,altText:s,...o}=e;return v.jsx(Ie.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...o,ref:n})});function I0(e){const n=[];return Array.from(e.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&n.push(s.textContent),BT(s)){const o=s.ariaHidden||s.hidden||s.style.display==="none",c=s.dataset.radixToastAnnounceExclude==="";if(!o)if(c){const u=s.dataset.radixToastAnnounceAlt;u&&n.push(u)}else n.push(...I0(s))}}),n}function Jl(e,n,a,{discrete:s}){const o=a.originalEvent.currentTarget,c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:a});n&&o.addEventListener(e,n,{once:!0}),s?E0(o,c):o.dispatchEvent(c)}var Fv=(e,n,a=0)=>{const s=Math.abs(e.x),o=Math.abs(e.y),c=s>o;return n==="left"||n==="right"?c&&s>a:!c&&o>a};function IT(e=()=>{}){const n=An(e);Fn(()=>{let a=0,s=0;return a=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(n)),()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(s)}},[n])}function BT(e){return e.nodeType===e.ELEMENT_NODE}function $T(e){const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)n.push(a.currentNode);return n}function Df(e){const n=document.activeElement;return e.some(a=>a===n?!0:(a.focus(),document.activeElement!==n))}var HT=A0,B0=N0,$0=j0,H0=D0,q0=M0,F0=U0,V0=Hh;function G0(e){var n,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(a=G0(e[n]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function Y0(){for(var e,n,a=0,s="",o=arguments.length;a<o;a++)(e=arguments[a])&&(n=G0(e))&&(s&&(s+=" "),s+=n);return s}const Vv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gv=Y0,qh=(e,n)=>a=>{var s;if(n?.variants==null)return Gv(e,a?.class,a?.className);const{variants:o,defaultVariants:c}=n,u=Object.keys(o).map(m=>{const y=a?.[m],g=c?.[m];if(y===null)return null;const x=Vv(y)||Vv(g);return o[m][x]}),f=a&&Object.entries(a).reduce((m,y)=>{let[g,x]=y;return x===void 0||(m[g]=x),m},{}),p=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((m,y)=>{let{class:g,className:x,...S}=y;return Object.entries(S).every(_=>{let[E,T]=_;return Array.isArray(T)?T.includes({...c,...f}[E]):{...c,...f}[E]===T})?[...m,g,x]:m},[]);return Gv(e,u,p,a?.class,a?.className)};const K0=(...e)=>e.filter((n,a,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===a).join(" ").trim();const qT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const FT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,s)=>s?s.toUpperCase():a.toLowerCase());const Yv=e=>{const n=FT(e);return n.charAt(0).toUpperCase()+n.slice(1)};var VT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const GT=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const YT=b.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:c,iconNode:u,...f},p)=>b.createElement("svg",{ref:p,...VT,width:n,height:n,stroke:e,strokeWidth:s?Number(a)*24/Number(n):a,className:K0("lucide",o),...!c&&!GT(f)&&{"aria-hidden":"true"},...f},[...u.map(([m,y])=>b.createElement(m,y)),...Array.isArray(c)?c:[c]]));const yt=(e,n)=>{const a=b.forwardRef(({className:s,...o},c)=>b.createElement(YT,{ref:c,iconNode:n,className:K0(`lucide-${qT(Yv(e))}`,`lucide-${e}`,s),...o}));return a.displayName=Yv(e),a};const KT=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],XT=yt("book-open",KT);const QT=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],WT=yt("bot",QT);const JT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ZT=yt("check",JT);const eC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],X0=yt("chevron-down",eC);const tC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Q0=yt("chevron-up",tC);const nC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Mf=yt("circle-alert",nC);const rC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aC=yt("circle-check-big",rC);const sC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],iC=yt("circle",sC);const oC=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],fo=yt("copy",oC);const lC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Zl=yt("database",lC);const cC=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],uC=yt("external-link",cC);const dC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fh=yt("plus",dC);const fC=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],io=yt("refresh-cw",fC);const hC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pC=yt("search",hC);const mC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],W0=yt("settings",mC);const gC=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],J0=yt("sparkles",gC);const yC=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],vC=yt("square-pen",yC);const bC=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],wC=yt("trash",bC);const xC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vh=yt("x",xC),SC=(e,n)=>{const a=new Array(e.length+n.length);for(let s=0;s<e.length;s++)a[s]=e[s];for(let s=0;s<n.length;s++)a[e.length+s]=n[s];return a},EC=(e,n)=>({classGroupId:e,validator:n}),Z0=(e=new Map,n=null,a)=>({nextPart:e,validators:n,classGroupId:a}),Cc="-",Kv=[],_C="arbitrary..",TC=e=>{const n=RC(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return CC(u);const f=u.split(Cc),p=f[0]===""&&f.length>1?1:0;return ew(f,p,n)},getConflictingClassGroupIds:(u,f)=>{if(f){const p=s[u],m=a[u];return p?m?SC(m,p):p:m||Kv}return a[u]||Kv}}},ew=(e,n,a)=>{if(e.length-n===0)return a.classGroupId;const o=e[n],c=a.nextPart.get(o);if(c){const m=ew(e,n+1,c);if(m)return m}const u=a.validators;if(u===null)return;const f=n===0?e.join(Cc):e.slice(n).join(Cc),p=u.length;for(let m=0;m<p;m++){const y=u[m];if(y.validator(f))return y.classGroupId}},CC=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),a=n.indexOf(":"),s=n.slice(0,a);return s?_C+s:void 0})(),RC=e=>{const{theme:n,classGroups:a}=e;return AC(a,n)},AC=(e,n)=>{const a=Z0();for(const s in e){const o=e[s];Gh(o,a,s,n)}return a},Gh=(e,n,a,s)=>{const o=e.length;for(let c=0;c<o;c++){const u=e[c];OC(u,n,a,s)}},OC=(e,n,a,s)=>{if(typeof e=="string"){NC(e,n,a);return}if(typeof e=="function"){kC(e,n,a,s);return}jC(e,n,a,s)},NC=(e,n,a)=>{const s=e===""?n:tw(n,e);s.classGroupId=a},kC=(e,n,a,s)=>{if(DC(e)){Gh(e(s),n,a,s);return}n.validators===null&&(n.validators=[]),n.validators.push(EC(a,e))},jC=(e,n,a,s)=>{const o=Object.entries(e),c=o.length;for(let u=0;u<c;u++){const[f,p]=o[u];Gh(p,tw(n,f),a,s)}},tw=(e,n)=>{let a=e;const s=n.split(Cc),o=s.length;for(let c=0;c<o;c++){const u=s[c];let f=a.nextPart.get(u);f||(f=Z0(),a.nextPart.set(u,f)),a=f}return a},DC=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,MC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=Object.create(null),s=Object.create(null);const o=(c,u)=>{a[c]=u,n++,n>e&&(n=0,s=a,a=Object.create(null))};return{get(c){let u=a[c];if(u!==void 0)return u;if((u=s[c])!==void 0)return o(c,u),u},set(c,u){c in a?a[c]=u:o(c,u)}}},ch="!",Xv=":",LC=[],Qv=(e,n,a,s,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:a,maybePostfixModifierPosition:s,isExternal:o}),UC=e=>{const{prefix:n,experimentalParseClassName:a}=e;let s=o=>{const c=[];let u=0,f=0,p=0,m;const y=o.length;for(let E=0;E<y;E++){const T=o[E];if(u===0&&f===0){if(T===Xv){c.push(o.slice(p,E)),p=E+1;continue}if(T==="/"){m=E;continue}}T==="["?u++:T==="]"?u--:T==="("?f++:T===")"&&f--}const g=c.length===0?o:o.slice(p);let x=g,S=!1;g.endsWith(ch)?(x=g.slice(0,-1),S=!0):g.startsWith(ch)&&(x=g.slice(1),S=!0);const _=m&&m>p?m-p:void 0;return Qv(c,S,x,_)};if(n){const o=n+Xv,c=s;s=u=>u.startsWith(o)?c(u.slice(o.length)):Qv(LC,!1,u,void 0,!0)}if(a){const o=s;s=c=>a({className:c,parseClassName:o})}return s},PC=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((a,s)=>{n.set(a,1e6+s)}),a=>{const s=[];let o=[];for(let c=0;c<a.length;c++){const u=a[c],f=u[0]==="[",p=n.has(u);f||p?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(u)):o.push(u)}return o.length>0&&(o.sort(),s.push(...o)),s}},zC=e=>({cache:MC(e.cacheSize),parseClassName:UC(e),sortModifiers:PC(e),...TC(e)}),IC=/\s+/,BC=(e,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:c}=n,u=[],f=e.trim().split(IC);let p="";for(let m=f.length-1;m>=0;m-=1){const y=f[m],{isExternal:g,modifiers:x,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:E}=a(y);if(g){p=y+(p.length>0?" "+p:p);continue}let T=!!E,R=s(T?_.substring(0,E):_);if(!R){if(!T){p=y+(p.length>0?" "+p:p);continue}if(R=s(_),!R){p=y+(p.length>0?" "+p:p);continue}T=!1}const O=x.length===0?"":x.length===1?x[0]:c(x).join(":"),A=S?O+ch:O,k=A+R;if(u.indexOf(k)>-1)continue;u.push(k);const I=o(R,T);for(let B=0;B<I.length;++B){const $=I[B];u.push(A+$)}p=y+(p.length>0?" "+p:p)}return p},$C=(...e)=>{let n=0,a,s,o="";for(;n<e.length;)(a=e[n++])&&(s=nw(a))&&(o&&(o+=" "),o+=s);return o},nw=e=>{if(typeof e=="string")return e;let n,a="";for(let s=0;s<e.length;s++)e[s]&&(n=nw(e[s]))&&(a&&(a+=" "),a+=n);return a},HC=(e,...n)=>{let a,s,o,c;const u=p=>{const m=n.reduce((y,g)=>g(y),e());return a=zC(m),s=a.cache.get,o=a.cache.set,c=f,f(p)},f=p=>{const m=s(p);if(m)return m;const y=BC(p,a);return o(p,y),y};return c=u,(...p)=>c($C(...p))},qC=[],mt=e=>{const n=a=>a[e]||qC;return n.isThemeGetter=!0,n},rw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,FC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,YC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zr=e=>FC.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),ea=e=>!!e&&Number.isInteger(Number(e)),Lf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),hr=e=>VC.test(e),sw=()=>!0,QC=e=>GC.test(e)&&!YC.test(e),Yh=()=>!1,WC=e=>KC.test(e),JC=e=>XC.test(e),ZC=e=>!oe(e)&&!ue(e),eR=e=>la(e,lw,Yh),oe=e=>rw.test(e),ja=e=>la(e,cw,QC),Wv=e=>la(e,lR,Oe),tR=e=>la(e,dw,sw),nR=e=>la(e,uw,Yh),Jv=e=>la(e,iw,Yh),rR=e=>la(e,ow,JC),ec=e=>la(e,fw,WC),ue=e=>aw.test(e),to=e=>qa(e,cw),aR=e=>qa(e,uw),Zv=e=>qa(e,iw),sR=e=>qa(e,lw),iR=e=>qa(e,ow),tc=e=>qa(e,fw,!0),oR=e=>qa(e,dw,!0),la=(e,n,a)=>{const s=rw.exec(e);return s?s[1]?n(s[1]):a(s[2]):!1},qa=(e,n,a=!1)=>{const s=aw.exec(e);return s?s[1]?n(s[1]):a:!1},iw=e=>e==="position"||e==="percentage",ow=e=>e==="image"||e==="url",lw=e=>e==="length"||e==="size"||e==="bg-size",cw=e=>e==="length",lR=e=>e==="number",uw=e=>e==="family-name",dw=e=>e==="number"||e==="weight",fw=e=>e==="shadow",cR=()=>{const e=mt("color"),n=mt("font"),a=mt("text"),s=mt("font-weight"),o=mt("tracking"),c=mt("leading"),u=mt("breakpoint"),f=mt("container"),p=mt("spacing"),m=mt("radius"),y=mt("shadow"),g=mt("inset-shadow"),x=mt("text-shadow"),S=mt("drop-shadow"),_=mt("blur"),E=mt("perspective"),T=mt("aspect"),R=mt("ease"),O=mt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),ue,oe],B=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],q=()=>[ue,oe,p],ne=()=>[Zr,"full","auto",...q()],de=()=>[ea,"none","subgrid",ue,oe],he=()=>["auto",{span:["full",ea,ue,oe]},ea,ue,oe],le=()=>[ea,"auto",ue,oe],me=()=>["auto","min","max","fr",ue,oe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...q()],V=()=>[Zr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...q()],Z=()=>[Zr,"screen","full","dvw","lvw","svw","min","max","fit",...q()],se=()=>[Zr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...q()],J=()=>[e,ue,oe],j=()=>[...k(),Zv,Jv,{position:[ue,oe]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",sR,eR,{size:[ue,oe]}],ee=()=>[Lf,to,ja],U=()=>["","none","full",m,ue,oe],re=()=>["",Oe,to,ja],ge=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[Oe,Lf,Zv,Jv],ce=()=>["","none",_,ue,oe],be=()=>["none",Oe,ue,oe],Ce=()=>["none",Oe,ue,oe],et=()=>[Oe,ue,oe],Ue=()=>[Zr,"full",...q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hr],breakpoint:[hr],color:[sw],container:[hr],"drop-shadow":[hr],ease:["in","out","in-out"],font:[ZC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hr],shadow:[hr],spacing:["px",Oe],text:[hr],"text-shadow":[hr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zr,oe,ue,T]}],container:["container"],columns:[{columns:[Oe,oe,ue,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:["visible","invisible","collapse"],z:[{z:[ea,"auto",ue,oe]}],basis:[{basis:[Zr,"full","auto",f,...q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Zr,"auto","initial","none",oe]}],grow:[{grow:["",Oe,ue,oe]}],shrink:[{shrink:["",Oe,ue,oe]}],order:[{order:[ea,"first","last","none",ue,oe]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:he()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:he()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:q()}],px:[{px:q()}],py:[{py:q()}],ps:[{ps:q()}],pe:[{pe:q()}],pbs:[{pbs:q()}],pbe:[{pbe:q()}],pt:[{pt:q()}],pr:[{pr:q()}],pb:[{pb:q()}],pl:[{pl:q()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":q()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",a,to,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,oR,tR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lf,oe]}],"font-family":[{font:[aR,nR,n]}],"font-features":[{"font-features":[oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ue,oe]}],"line-clamp":[{"line-clamp":[Oe,"none",ue,Wv]}],leading:[{leading:[c,...q()]}],"list-image":[{"list-image":["none",ue,oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ue,ja]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Oe,"auto",ue,oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue,oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ea,ue,oe],radial:["",ue,oe],conic:[ea,ue,oe]},iR,rR]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ue,oe]}],"outline-w":[{outline:["",Oe,to,ja]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",y,tc,ec]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",g,tc,ec]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Oe,ja]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",x,tc,ec]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Oe,ue,oe]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ue,oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,oe]}],filter:[{filter:["","none",ue,oe]}],blur:[{blur:ce()}],brightness:[{brightness:[Oe,ue,oe]}],contrast:[{contrast:[Oe,ue,oe]}],"drop-shadow":[{"drop-shadow":["","none",S,tc,ec]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Oe,ue,oe]}],"hue-rotate":[{"hue-rotate":[Oe,ue,oe]}],invert:[{invert:["",Oe,ue,oe]}],saturate:[{saturate:[Oe,ue,oe]}],sepia:[{sepia:["",Oe,ue,oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,oe]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ue,oe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ue,oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ue,oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ue,oe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ue,oe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ue,oe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ue,oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ue,oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":q()}],"border-spacing-x":[{"border-spacing-x":q()}],"border-spacing-y":[{"border-spacing-y":q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ue,oe]}],ease:[{ease:["linear","initial",R,ue,oe]}],delay:[{delay:[Oe,ue,oe]}],animate:[{animate:["none",O,ue,oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ue,oe]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[ue,oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue,oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mbs":[{"scroll-mbs":q()}],"scroll-mbe":[{"scroll-mbe":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pbs":[{"scroll-pbs":q()}],"scroll-pbe":[{"scroll-pbe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue,oe]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Oe,to,ja,Wv]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uR=HC(cR);function qe(...e){return uR(Y0(e))}const dR=HT,hw=b.forwardRef(({className:e,...n},a)=>v.jsx(B0,{ref:a,className:qe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:left-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...n}));hw.displayName=B0.displayName;const fR=qh("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),pw=b.forwardRef(({className:e,variant:n,...a},s)=>v.jsx($0,{ref:s,className:qe(fR({variant:n}),e),...a}));pw.displayName=$0.displayName;const hR=b.forwardRef(({className:e,...n},a)=>v.jsx(F0,{ref:a,className:qe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...n}));hR.displayName=F0.displayName;const mw=b.forwardRef(({className:e,...n},a)=>v.jsx(V0,{ref:a,className:qe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...n,children:v.jsx(Vh,{className:"h-4 w-4"})}));mw.displayName=V0.displayName;const gw=b.forwardRef(({className:e,...n},a)=>v.jsx(H0,{ref:a,className:qe("text-sm font-semibold",e),...n}));gw.displayName=H0.displayName;const yw=b.forwardRef(({className:e,...n},a)=>v.jsx(q0,{ref:a,className:qe("text-sm opacity-90",e),...n}));yw.displayName=q0.displayName;function pR(){const{toasts:e}=Qs();return v.jsxs(dR,{children:[e.map(function({id:n,title:a,description:s,action:o,...c}){return v.jsxs(pw,{...c,children:[v.jsxs("div",{className:"grid gap-1",children:[a&&v.jsx(gw,{children:a}),s&&v.jsx(yw,{children:s})]}),o,v.jsx(mw,{})]},n)}),v.jsx(hw,{})]})}var mR=(e,n,a,s,o,c,u,f)=>{let p=document.documentElement,m=["light","dark"];function y(S){(Array.isArray(e)?e:[e]).forEach(_=>{let E=_==="class",T=E&&c?o.map(R=>c[R]||R):o;E?(p.classList.remove(...T),p.classList.add(c&&c[S]?c[S]:S)):p.setAttribute(_,S)}),g(S)}function g(S){f&&m.includes(S)&&(p.style.colorScheme=S)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)y(s);else try{let S=localStorage.getItem(n)||a,_=u&&S==="system"?x():S;y(_)}catch{}},gR=b.createContext(void 0),yR={setTheme:e=>{},themes:[]},vR=()=>{var e;return(e=b.useContext(gR))!=null?e:yR};b.memo(({forcedTheme:e,storageKey:n,attribute:a,enableSystem:s,enableColorScheme:o,defaultTheme:c,value:u,themes:f,nonce:p,scriptProps:m})=>{let y=JSON.stringify([a,n,c,e,f,u,s,o]).slice(1,-1);return b.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${mR.toString()})(${y})`}})});function bR(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const wR=e=>{switch(e){case"success":return ER;case"info":return TR;case"warning":return _R;case"error":return CR;default:return null}},xR=Array(12).fill(0),SR=({visible:e,className:n})=>te.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},te.createElement("div",{className:"sonner-spinner"},xR.map((a,s)=>te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),ER=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),_R=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},te.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"})),TR=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),CR=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),RR=te.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"},te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),AR=()=>{const[e,n]=te.useState(document.hidden);return te.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let uh=1;class OR{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:s,...o}=n,c=typeof n?.id=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:uh++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:s}),{...p,...n,id:c,dismissible:f,title:s}):p):this.addToast({title:s,...o,dismissible:f,id:c}),c},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let c=s!==void 0,u;const f=o.then(async m=>{if(u=["resolve",m],te.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(kR(m)&&!m.ok){c=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description,_=typeof g=="object"&&!te.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:x,..._})}else if(m instanceof Error){c=!1;const g=typeof a.error=="function"?await a.error(m):a.error,x=typeof a.description=="function"?await a.description(m):a.description,_=typeof g=="object"&&!te.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:x,..._})}else if(a.success!==void 0){c=!1;const g=typeof a.success=="function"?await a.success(m):a.success,x=typeof a.description=="function"?await a.description(m):a.description,_=typeof g=="object"&&!te.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:x,..._})}}).catch(async m=>{if(u=["reject",m],a.error!==void 0){c=!1;const y=typeof a.error=="function"?await a.error(m):a.error,g=typeof a.description=="function"?await a.description(m):a.description,S=typeof y=="object"&&!te.isValidElement(y)?y:{message:y};this.create({id:s,type:"error",description:g,...S})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),p=()=>new Promise((m,y)=>f.then(()=>u[0]==="reject"?y(u[1]):m(u[1])).catch(y));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(n,a)=>{const s=a?.id||uh++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yt=new OR,NR=(e,n)=>{const a=n?.id||uh++;return Yt.addToast({title:e,...n,id:a}),a},kR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jR=NR,DR=()=>Yt.toasts,MR=()=>Yt.getActiveToasts();Object.assign(jR,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:DR,getToasts:MR});bR("[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 nc(e){return e.label!==void 0}const LR=3,UR="24px",PR="16px",eb=4e3,zR=356,IR=14,BR=45,$R=200;function In(...e){return e.filter(Boolean).join(" ")}function HR(e){const[n,a]=e.split("-"),s=[];return n&&s.push(n),a&&s.push(a),s}const qR=e=>{var n,a,s,o,c,u,f,p,m;const{invert:y,toast:g,unstyled:x,interacting:S,setHeights:_,visibleToasts:E,heights:T,index:R,toasts:O,expanded:A,removeToast:k,defaultRichColors:I,closeButton:B,style:$,cancelButtonStyle:q,actionButtonStyle:ne,className:de="",descriptionClassName:he="",duration:le,position:me,gap:W,expandByDefault:ae,classNames:D,icons:V,closeButtonAriaLabel:Z="Close toast"}=e,[se,J]=te.useState(null),[j,G]=te.useState(null),[K,ee]=te.useState(!1),[U,re]=te.useState(!1),[ge,Se]=te.useState(!1),[ve,ce]=te.useState(!1),[be,Ce]=te.useState(!1),[et,Ue]=te.useState(0),[Kt,Fa]=te.useState(0),ca=te.useRef(g.duration||le||eb),si=te.useRef(null),Xt=te.useRef(null),ii=R===0,oi=R+1<=E,jt=g.type,Cr=g.dismissible!==!1,Dt=g.className||"",fu=g.descriptionClassName||"",ua=te.useMemo(()=>T.findIndex(_e=>_e.toastId===g.id)||0,[T,g.id]),Po=te.useMemo(()=>{var _e;return(_e=g.closeButton)!=null?_e:B},[g.closeButton,B]),da=te.useMemo(()=>g.duration||le||eb,[g.duration,le]),li=te.useRef(0),Kn=te.useRef(0),zo=te.useRef(0),Rr=te.useRef(null),[fa,Mt]=me.split("-"),bn=te.useMemo(()=>T.reduce((_e,We,vt)=>vt>=ua?_e:_e+We.height,0),[T,ua]),Ot=AR(),hu=g.invert||y,ci=jt==="loading";Kn.current=te.useMemo(()=>ua*W+bn,[ua,bn]),te.useEffect(()=>{ca.current=da},[da]),te.useEffect(()=>{ee(!0)},[]),te.useEffect(()=>{const _e=Xt.current;if(_e){const We=_e.getBoundingClientRect().height;return Fa(We),_(vt=>[{toastId:g.id,height:We,position:g.position},...vt]),()=>_(vt=>vt.filter(Nt=>Nt.toastId!==g.id))}},[_,g.id]),te.useLayoutEffect(()=>{if(!K)return;const _e=Xt.current,We=_e.style.height;_e.style.height="auto";const vt=_e.getBoundingClientRect().height;_e.style.height=We,Fa(vt),_(Nt=>Nt.find(tt=>tt.toastId===g.id)?Nt.map(tt=>tt.toastId===g.id?{...tt,height:vt}:tt):[{toastId:g.id,height:vt,position:g.position},...Nt])},[K,g.title,g.description,_,g.id,g.jsx,g.action,g.cancel]);const Dn=te.useCallback(()=>{re(!0),Ue(Kn.current),_(_e=>_e.filter(We=>We.toastId!==g.id)),setTimeout(()=>{k(g)},$R)},[g,k,_,Kn]);te.useEffect(()=>{if(g.promise&&jt==="loading"||g.duration===1/0||g.type==="loading")return;let _e;return A||S||Ot?(()=>{if(zo.current<li.current){const Nt=new Date().getTime()-li.current;ca.current=ca.current-Nt}zo.current=new Date().getTime()})():ca.current!==1/0&&(li.current=new Date().getTime(),_e=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Dn()},ca.current)),()=>clearTimeout(_e)},[A,S,g,jt,Ot,Dn]),te.useEffect(()=>{g.delete&&(Dn(),g.onDismiss==null||g.onDismiss.call(g,g))},[Dn,g.delete]);function Va(){var _e;if(V?.loading){var We;return te.createElement("div",{className:In(D?.loader,g==null||(We=g.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":jt==="loading"},V.loading)}return te.createElement(SR,{className:In(D?.loader,g==null||(_e=g.classNames)==null?void 0:_e.loader),visible:jt==="loading"})}const Ga=g.icon||V?.[jt]||wR(jt);var ha,Mn;return te.createElement("li",{tabIndex:0,ref:Xt,className:In(de,Dt,D?.toast,g==null||(n=g.classNames)==null?void 0:n.toast,D?.default,D?.[jt],g==null||(a=g.classNames)==null?void 0:a[jt]),"data-sonner-toast":"","data-rich-colors":(ha=g.richColors)!=null?ha:I,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":K,"data-promise":!!g.promise,"data-swiped":be,"data-removed":U,"data-visible":oi,"data-y-position":fa,"data-x-position":Mt,"data-index":R,"data-front":ii,"data-swiping":ge,"data-dismissible":Cr,"data-type":jt,"data-invert":hu,"data-swipe-out":ve,"data-swipe-direction":j,"data-expanded":!!(A||ae&&K),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":O.length-R,"--offset":`${U?et:Kn.current}px`,"--initial-height":ae?"auto":`${Kt}px`,...$,...g.style},onDragEnd:()=>{Se(!1),J(null),Rr.current=null},onPointerDown:_e=>{_e.button!==2&&(ci||!Cr||(si.current=new Date,Ue(Kn.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(Se(!0),Rr.current={x:_e.clientX,y:_e.clientY})))},onPointerUp:()=>{var _e,We,vt;if(ve||!Cr)return;Rr.current=null;const Nt=Number(((_e=Xt.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ar=Number(((We=Xt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((vt=si.current)==null?void 0:vt.getTime()),Pt=se==="x"?Nt:Ar,pa=Math.abs(Pt)/tt;if(Math.abs(Pt)>=BR||pa>.11){Ue(Kn.current),g.onDismiss==null||g.onDismiss.call(g,g),G(se==="x"?Nt>0?"right":"left":Ar>0?"down":"up"),Dn(),ce(!0);return}else{var zt,It;(zt=Xt.current)==null||zt.style.setProperty("--swipe-amount-x","0px"),(It=Xt.current)==null||It.style.setProperty("--swipe-amount-y","0px")}Ce(!1),Se(!1),J(null)},onPointerMove:_e=>{var We,vt,Nt;if(!Rr.current||!Cr||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;const tt=_e.clientY-Rr.current.y,Pt=_e.clientX-Rr.current.x;var pa;const zt=(pa=e.swipeDirections)!=null?pa:HR(me);!se&&(Math.abs(Pt)>1||Math.abs(tt)>1)&&J(Math.abs(Pt)>Math.abs(tt)?"x":"y");let It={x:0,y:0};const Ya=wn=>1/(1.5+Math.abs(wn)/20);if(se==="y"){if(zt.includes("top")||zt.includes("bottom"))if(zt.includes("top")&&tt<0||zt.includes("bottom")&&tt>0)It.y=tt;else{const wn=tt*Ya(tt);It.y=Math.abs(wn)<Math.abs(tt)?wn:tt}}else if(se==="x"&&(zt.includes("left")||zt.includes("right")))if(zt.includes("left")&&Pt<0||zt.includes("right")&&Pt>0)It.x=Pt;else{const wn=Pt*Ya(Pt);It.x=Math.abs(wn)<Math.abs(Pt)?wn:Pt}(Math.abs(It.x)>0||Math.abs(It.y)>0)&&Ce(!0),(vt=Xt.current)==null||vt.style.setProperty("--swipe-amount-x",`${It.x}px`),(Nt=Xt.current)==null||Nt.style.setProperty("--swipe-amount-y",`${It.y}px`)}},Po&&!g.jsx&&jt!=="loading"?te.createElement("button",{"aria-label":Z,"data-disabled":ci,"data-close-button":!0,onClick:ci||!Cr?()=>{}:()=>{Dn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:In(D?.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(Mn=V?.close)!=null?Mn:RR):null,(jt||g.icon||g.promise)&&g.icon!==null&&(V?.[jt]!==null||g.icon)?te.createElement("div",{"data-icon":"",className:In(D?.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Va():null,g.type!=="loading"?Ga:null):null,te.createElement("div",{"data-content":"",className:In(D?.content,g==null||(c=g.classNames)==null?void 0:c.content)},te.createElement("div",{"data-title":"",className:In(D?.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?te.createElement("div",{"data-description":"",className:In(he,fu,D?.description,g==null||(f=g.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),te.isValidElement(g.cancel)?g.cancel:g.cancel&&nc(g.cancel)?te.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:_e=>{nc(g.cancel)&&Cr&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,_e),Dn())},className:In(D?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,te.isValidElement(g.action)?g.action:g.action&&nc(g.action)?te.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||ne,onClick:_e=>{nc(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,_e),!_e.defaultPrevented&&Dn())},className:In(D?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function tb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function FR(e,n){const a={};return[e,n].forEach((s,o)=>{const c=o===1,u=c?"--mobile-offset":"--offset",f=c?PR:UR;function p(m){["top","right","bottom","left"].forEach(y=>{a[`${u}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?a[`${u}-${m}`]=f:a[`${u}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(f)}),a}const VR=te.forwardRef(function(n,a){const{id:s,invert:o,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:f,closeButton:p,className:m,offset:y,mobileOffset:g,theme:x="light",richColors:S,duration:_,style:E,visibleToasts:T=LR,toastOptions:R,dir:O=tb(),gap:A=IR,icons:k,containerAriaLabel:I="Notifications"}=n,[B,$]=te.useState([]),q=te.useMemo(()=>s?B.filter(K=>K.toasterId===s):B.filter(K=>!K.toasterId),[B,s]),ne=te.useMemo(()=>Array.from(new Set([c].concat(q.filter(K=>K.position).map(K=>K.position)))),[q,c]),[de,he]=te.useState([]),[le,me]=te.useState(!1),[W,ae]=te.useState(!1),[D,V]=te.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=te.useRef(null),se=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=te.useRef(null),j=te.useRef(!1),G=te.useCallback(K=>{$(ee=>{var U;return(U=ee.find(re=>re.id===K.id))!=null&&U.delete||Yt.dismiss(K.id),ee.filter(({id:re})=>re!==K.id)})},[]);return te.useEffect(()=>Yt.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{$(ee=>ee.map(U=>U.id===K.id?{...U,delete:!0}:U))});return}setTimeout(()=>{x0.flushSync(()=>{$(ee=>{const U=ee.findIndex(re=>re.id===K.id);return U!==-1?[...ee.slice(0,U),{...ee[U],...K},...ee.slice(U+1)]:[K,...ee]})})})}),[B]),te.useEffect(()=>{if(x!=="system"){V(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:ee})=>{V(ee?"dark":"light")})}catch{K.addListener(({matches:U})=>{try{V(U?"dark":"light")}catch(re){console.error(re)}})}},[x]),te.useEffect(()=>{B.length<=1&&me(!1)},[B]),te.useEffect(()=>{const K=ee=>{var U;if(u.every(Se=>ee[Se]||ee.code===Se)){var ge;me(!0),(ge=Z.current)==null||ge.focus()}ee.code==="Escape"&&(document.activeElement===Z.current||(U=Z.current)!=null&&U.contains(document.activeElement))&&me(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[u]),te.useEffect(()=>{if(Z.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,j.current=!1)}},[Z.current]),te.createElement("section",{ref:a,"aria-label":`${I} ${se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ne.map((K,ee)=>{var U;const[re,ge]=K.split("-");return q.length?te.createElement("ol",{key:K,dir:O==="auto"?tb():O,tabIndex:-1,ref:Z,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":re,"data-x-position":ge,style:{"--front-toast-height":`${((U=de[0])==null?void 0:U.height)||0}px`,"--width":`${zR}px`,"--gap":`${A}px`,...E,...FR(y,g)},onBlur:Se=>{j.current&&!Se.currentTarget.contains(Se.relatedTarget)&&(j.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||j.current||(j.current=!0,J.current=Se.relatedTarget)},onMouseEnter:()=>me(!0),onMouseMove:()=>me(!0),onMouseLeave:()=>{W||me(!1)},onDragEnd:()=>me(!1),onPointerDown:Se=>{Se.target instanceof HTMLElement&&Se.target.dataset.dismissible==="false"||ae(!0)},onPointerUp:()=>ae(!1)},q.filter(Se=>!Se.position&&ee===0||Se.position===K).map((Se,ve)=>{var ce,be;return te.createElement(qR,{key:Se.id,icons:k,index:ve,toast:Se,defaultRichColors:S,duration:(ce=R?.duration)!=null?ce:_,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:T,closeButton:(be=R?.closeButton)!=null?be:p,interacting:W,position:K,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:G,toasts:q.filter(Ce=>Ce.position==Se.position),heights:de.filter(Ce=>Ce.position==Se.position),setHeights:he,expandByDefault:f,gap:A,expanded:le,swipeDirections:n.swipeDirections})})):null}))}),GR=({...e})=>{const{theme:n="system"}=vR();return v.jsx(VR,{theme:n,className:"toaster group",position:"bottom-left",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"}},...e})};var YR=zh[" useId ".trim().toString()]||(()=>{}),KR=0;function ho(e){const[n,a]=b.useState(YR());return Fn(()=>{a(s=>s??String(KR++))},[e]),n?`radix-${n}`:""}const XR=["top","right","bottom","left"],sa=Math.min,an=Math.max,Rc=Math.round,rc=Math.floor,Hn=e=>({x:e,y:e}),QR={left:"right",right:"left",bottom:"top",top:"bottom"},WR={start:"end",end:"start"};function dh(e,n,a){return an(e,sa(n,a))}function vr(e,n){return typeof e=="function"?e(n):e}function br(e){return e.split("-")[0]}function Js(e){return e.split("-")[1]}function Kh(e){return e==="x"?"y":"x"}function Xh(e){return e==="y"?"height":"width"}const JR=new Set(["top","bottom"]);function $n(e){return JR.has(br(e))?"y":"x"}function Qh(e){return Kh($n(e))}function ZR(e,n,a){a===void 0&&(a=!1);const s=Js(e),o=Qh(e),c=Xh(o);let u=o==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(u=Ac(u)),[u,Ac(u)]}function eA(e){const n=Ac(e);return[fh(e),n,fh(n)]}function fh(e){return e.replace(/start|end/g,n=>WR[n])}const nb=["left","right"],rb=["right","left"],tA=["top","bottom"],nA=["bottom","top"];function rA(e,n,a){switch(e){case"top":case"bottom":return a?n?rb:nb:n?nb:rb;case"left":case"right":return n?tA:nA;default:return[]}}function aA(e,n,a,s){const o=Js(e);let c=rA(br(e),a==="start",s);return o&&(c=c.map(u=>u+"-"+o),n&&(c=c.concat(c.map(fh)))),c}function Ac(e){return e.replace(/left|right|bottom|top/g,n=>QR[n])}function sA(e){return{top:0,right:0,bottom:0,left:0,...e}}function vw(e){return typeof e!="number"?sA(e):{top:e,right:e,bottom:e,left:e}}function Oc(e){const{x:n,y:a,width:s,height:o}=e;return{width:s,height:o,top:a,left:n,right:n+s,bottom:a+o,x:n,y:a}}function ab(e,n,a){let{reference:s,floating:o}=e;const c=$n(n),u=Qh(n),f=Xh(u),p=br(n),m=c==="y",y=s.x+s.width/2-o.width/2,g=s.y+s.height/2-o.height/2,x=s[f]/2-o[f]/2;let S;switch(p){case"top":S={x:y,y:s.y-o.height};break;case"bottom":S={x:y,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:g};break;case"left":S={x:s.x-o.width,y:g};break;default:S={x:s.x,y:s.y}}switch(Js(n)){case"start":S[u]-=x*(a&&m?-1:1);break;case"end":S[u]+=x*(a&&m?-1:1);break}return S}async function iA(e,n){var a;n===void 0&&(n={});const{x:s,y:o,platform:c,rects:u,elements:f,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:x=!1,padding:S=0}=vr(n,e),_=vw(S),T=f[x?g==="floating"?"reference":"floating":g],R=Oc(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(T)))==null||a?T:T.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:y,strategy:p})),O=g==="floating"?{x:s,y:o,width:u.floating.width,height:u.floating.height}:u.reference,A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),k=await(c.isElement==null?void 0:c.isElement(A))?await(c.getScale==null?void 0:c.getScale(A))||{x:1,y:1}:{x:1,y:1},I=Oc(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:O,offsetParent:A,strategy:p}):O);return{top:(R.top-I.top+_.top)/k.y,bottom:(I.bottom-R.bottom+_.bottom)/k.y,left:(R.left-I.left+_.left)/k.x,right:(I.right-R.right+_.right)/k.x}}const oA=async(e,n,a)=>{const{placement:s="bottom",strategy:o="absolute",middleware:c=[],platform:u}=a,f=c.filter(Boolean),p=await(u.isRTL==null?void 0:u.isRTL(n));let m=await u.getElementRects({reference:e,floating:n,strategy:o}),{x:y,y:g}=ab(m,s,p),x=s,S={},_=0;for(let T=0;T<f.length;T++){var E;const{name:R,fn:O}=f[T],{x:A,y:k,data:I,reset:B}=await O({x:y,y:g,initialPlacement:s,placement:x,strategy:o,middlewareData:S,rects:m,platform:{...u,detectOverflow:(E=u.detectOverflow)!=null?E:iA},elements:{reference:e,floating:n}});y=A??y,g=k??g,S={...S,[R]:{...S[R],...I}},B&&_<=50&&(_++,typeof B=="object"&&(B.placement&&(x=B.placement),B.rects&&(m=B.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:o}):B.rects),{x:y,y:g}=ab(m,x,p)),T=-1)}return{x:y,y:g,placement:x,strategy:o,middlewareData:S}},lA=e=>({name:"arrow",options:e,async fn(n){const{x:a,y:s,placement:o,rects:c,platform:u,elements:f,middlewareData:p}=n,{element:m,padding:y=0}=vr(e,n)||{};if(m==null)return{};const g=vw(y),x={x:a,y:s},S=Qh(o),_=Xh(S),E=await u.getDimensions(m),T=S==="y",R=T?"top":"left",O=T?"bottom":"right",A=T?"clientHeight":"clientWidth",k=c.reference[_]+c.reference[S]-x[S]-c.floating[_],I=x[S]-c.reference[S],B=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let $=B?B[A]:0;(!$||!await(u.isElement==null?void 0:u.isElement(B)))&&($=f.floating[A]||c.floating[_]);const q=k/2-I/2,ne=$/2-E[_]/2-1,de=sa(g[R],ne),he=sa(g[O],ne),le=de,me=$-E[_]-he,W=$/2-E[_]/2+q,ae=dh(le,W,me),D=!p.arrow&&Js(o)!=null&&W!==ae&&c.reference[_]/2-(W<le?de:he)-E[_]/2<0,V=D?W<le?W-le:W-me:0;return{[S]:x[S]+V,data:{[S]:ae,centerOffset:W-ae-V,...D&&{alignmentOffset:V}},reset:D}}}),cA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var a,s;const{placement:o,middlewareData:c,rects:u,initialPlacement:f,platform:p,elements:m}=n,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:E=!0,...T}=vr(e,n);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const R=br(o),O=$n(f),A=br(f)===f,k=await(p.isRTL==null?void 0:p.isRTL(m.floating)),I=x||(A||!E?[Ac(f)]:eA(f)),B=_!=="none";!x&&B&&I.push(...aA(f,E,_,k));const $=[f,...I],q=await p.detectOverflow(n,T),ne=[];let de=((s=c.flip)==null?void 0:s.overflows)||[];if(y&&ne.push(q[R]),g){const W=ZR(o,u,k);ne.push(q[W[0]],q[W[1]])}if(de=[...de,{placement:o,overflows:ne}],!ne.every(W=>W<=0)){var he,le;const W=(((he=c.flip)==null?void 0:he.index)||0)+1,ae=$[W];if(ae&&(!(g==="alignment"?O!==$n(ae):!1)||de.every(Z=>$n(Z.placement)===O?Z.overflows[0]>0:!0)))return{data:{index:W,overflows:de},reset:{placement:ae}};let D=(le=de.filter(V=>V.overflows[0]<=0).sort((V,Z)=>V.overflows[1]-Z.overflows[1])[0])==null?void 0:le.placement;if(!D)switch(S){case"bestFit":{var me;const V=(me=de.filter(Z=>{if(B){const se=$n(Z.placement);return se===O||se==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(se=>se>0).reduce((se,J)=>se+J,0)]).sort((Z,se)=>Z[1]-se[1])[0])==null?void 0:me[0];V&&(D=V);break}case"initialPlacement":D=f;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function sb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function ib(e){return XR.some(n=>e[n]>=0)}const uA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:a,platform:s}=n,{strategy:o="referenceHidden",...c}=vr(e,n);switch(o){case"referenceHidden":{const u=await s.detectOverflow(n,{...c,elementContext:"reference"}),f=sb(u,a.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:ib(f)}}}case"escaped":{const u=await s.detectOverflow(n,{...c,altBoundary:!0}),f=sb(u,a.floating);return{data:{escapedOffsets:f,escaped:ib(f)}}}default:return{}}}}},bw=new Set(["left","top"]);async function dA(e,n){const{placement:a,platform:s,elements:o}=e,c=await(s.isRTL==null?void 0:s.isRTL(o.floating)),u=br(a),f=Js(a),p=$n(a)==="y",m=bw.has(u)?-1:1,y=c&&p?-1:1,g=vr(n,e);let{mainAxis:x,crossAxis:S,alignmentAxis:_}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof _=="number"&&(S=f==="end"?_*-1:_),p?{x:S*y,y:x*m}:{x:x*m,y:S*y}}const fA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var a,s;const{x:o,y:c,placement:u,middlewareData:f}=n,p=await dA(n,e);return u===((a=f.offset)==null?void 0:a.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:o+p.x,y:c+p.y,data:{...p,placement:u}}}}},hA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:a,y:s,placement:o,platform:c}=n,{mainAxis:u=!0,crossAxis:f=!1,limiter:p={fn:R=>{let{x:O,y:A}=R;return{x:O,y:A}}},...m}=vr(e,n),y={x:a,y:s},g=await c.detectOverflow(n,m),x=$n(br(o)),S=Kh(x);let _=y[S],E=y[x];if(u){const R=S==="y"?"top":"left",O=S==="y"?"bottom":"right",A=_+g[R],k=_-g[O];_=dh(A,_,k)}if(f){const R=x==="y"?"top":"left",O=x==="y"?"bottom":"right",A=E+g[R],k=E-g[O];E=dh(A,E,k)}const T=p.fn({...n,[S]:_,[x]:E});return{...T,data:{x:T.x-a,y:T.y-s,enabled:{[S]:u,[x]:f}}}}}},pA=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:a,y:s,placement:o,rects:c,middlewareData:u}=n,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=vr(e,n),y={x:a,y:s},g=$n(o),x=Kh(g);let S=y[x],_=y[g];const E=vr(f,n),T=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(p){const A=x==="y"?"height":"width",k=c.reference[x]-c.floating[A]+T.mainAxis,I=c.reference[x]+c.reference[A]-T.mainAxis;S<k?S=k:S>I&&(S=I)}if(m){var R,O;const A=x==="y"?"width":"height",k=bw.has(br(o)),I=c.reference[g]-c.floating[A]+(k&&((R=u.offset)==null?void 0:R[g])||0)+(k?0:T.crossAxis),B=c.reference[g]+c.reference[A]+(k?0:((O=u.offset)==null?void 0:O[g])||0)-(k?T.crossAxis:0);_<I?_=I:_>B&&(_=B)}return{[x]:S,[g]:_}}}},mA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var a,s;const{placement:o,rects:c,platform:u,elements:f}=n,{apply:p=()=>{},...m}=vr(e,n),y=await u.detectOverflow(n,m),g=br(o),x=Js(o),S=$n(o)==="y",{width:_,height:E}=c.floating;let T,R;g==="top"||g==="bottom"?(T=g,R=x===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(R=g,T=x==="end"?"top":"bottom");const O=E-y.top-y.bottom,A=_-y.left-y.right,k=sa(E-y[T],O),I=sa(_-y[R],A),B=!n.middlewareData.shift;let $=k,q=I;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(q=A),(s=n.middlewareData.shift)!=null&&s.enabled.y&&($=O),B&&!x){const de=an(y.left,0),he=an(y.right,0),le=an(y.top,0),me=an(y.bottom,0);S?q=_-2*(de!==0||he!==0?de+he:an(y.left,y.right)):$=E-2*(le!==0||me!==0?le+me:an(y.top,y.bottom))}await p({...n,availableWidth:q,availableHeight:$});const ne=await u.getDimensions(f.floating);return _!==ne.width||E!==ne.height?{reset:{rects:!0}}:{}}}};function Yc(){return typeof window<"u"}function Zs(e){return ww(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Yn(e){var n;return(n=(ww(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function ww(e){return Yc()?e instanceof Node||e instanceof on(e).Node:!1}function On(e){return Yc()?e instanceof Element||e instanceof on(e).Element:!1}function Vn(e){return Yc()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function ob(e){return!Yc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}const gA=new Set(["inline","contents"]);function ko(e){const{overflow:n,overflowX:a,overflowY:s,display:o}=Nn(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+a)&&!gA.has(o)}const yA=new Set(["table","td","th"]);function vA(e){return yA.has(Zs(e))}const bA=[":popover-open",":modal"];function Kc(e){return bA.some(n=>{try{return e.matches(n)}catch{return!1}})}const wA=["transform","translate","scale","rotate","perspective"],xA=["transform","translate","scale","rotate","perspective","filter"],SA=["paint","layout","strict","content"];function Wh(e){const n=Jh(),a=On(e)?Nn(e):e;return wA.some(s=>a[s]?a[s]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!n&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!n&&(a.filter?a.filter!=="none":!1)||xA.some(s=>(a.willChange||"").includes(s))||SA.some(s=>(a.contain||"").includes(s))}function EA(e){let n=ia(e);for(;Vn(n)&&!Ks(n);){if(Wh(n))return n;if(Kc(n))return null;n=ia(n)}return null}function Jh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _A=new Set(["html","body","#document"]);function Ks(e){return _A.has(Zs(e))}function Nn(e){return on(e).getComputedStyle(e)}function Xc(e){return On(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Zs(e)==="html")return e;const n=e.assignedSlot||e.parentNode||ob(e)&&e.host||Yn(e);return ob(n)?n.host:n}function xw(e){const n=ia(e);return Ks(n)?e.ownerDocument?e.ownerDocument.body:e.body:Vn(n)&&ko(n)?n:xw(n)}function yo(e,n,a){var s;n===void 0&&(n=[]),a===void 0&&(a=!0);const o=xw(e),c=o===((s=e.ownerDocument)==null?void 0:s.body),u=on(o);if(c){const f=hh(u);return n.concat(u,u.visualViewport||[],ko(o)?o:[],f&&a?yo(f):[])}return n.concat(o,yo(o,[],a))}function hh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sw(e){const n=Nn(e);let a=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const o=Vn(e),c=o?e.offsetWidth:a,u=o?e.offsetHeight:s,f=Rc(a)!==c||Rc(s)!==u;return f&&(a=c,s=u),{width:a,height:s,$:f}}function Zh(e){return On(e)?e:e.contextElement}function Fs(e){const n=Zh(e);if(!Vn(n))return Hn(1);const a=n.getBoundingClientRect(),{width:s,height:o,$:c}=Sw(n);let u=(c?Rc(a.width):a.width)/s,f=(c?Rc(a.height):a.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const TA=Hn(0);function Ew(e){const n=on(e);return!Jh()||!n.visualViewport?TA:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function CA(e,n,a){return n===void 0&&(n=!1),!a||n&&a!==on(e)?!1:n}function Ba(e,n,a,s){n===void 0&&(n=!1),a===void 0&&(a=!1);const o=e.getBoundingClientRect(),c=Zh(e);let u=Hn(1);n&&(s?On(s)&&(u=Fs(s)):u=Fs(e));const f=CA(c,a,s)?Ew(c):Hn(0);let p=(o.left+f.x)/u.x,m=(o.top+f.y)/u.y,y=o.width/u.x,g=o.height/u.y;if(c){const x=on(c),S=s&&On(s)?on(s):s;let _=x,E=hh(_);for(;E&&s&&S!==_;){const T=Fs(E),R=E.getBoundingClientRect(),O=Nn(E),A=R.left+(E.clientLeft+parseFloat(O.paddingLeft))*T.x,k=R.top+(E.clientTop+parseFloat(O.paddingTop))*T.y;p*=T.x,m*=T.y,y*=T.x,g*=T.y,p+=A,m+=k,_=on(E),E=hh(_)}}return Oc({width:y,height:g,x:p,y:m})}function Qc(e,n){const a=Xc(e).scrollLeft;return n?n.left+a:Ba(Yn(e)).left+a}function _w(e,n){const a=e.getBoundingClientRect(),s=a.left+n.scrollLeft-Qc(e,a),o=a.top+n.scrollTop;return{x:s,y:o}}function RA(e){let{elements:n,rect:a,offsetParent:s,strategy:o}=e;const c=o==="fixed",u=Yn(s),f=n?Kc(n.floating):!1;if(s===u||f&&c)return a;let p={scrollLeft:0,scrollTop:0},m=Hn(1);const y=Hn(0),g=Vn(s);if((g||!g&&!c)&&((Zs(s)!=="body"||ko(u))&&(p=Xc(s)),Vn(s))){const S=Ba(s);m=Fs(s),y.x=S.x+s.clientLeft,y.y=S.y+s.clientTop}const x=u&&!g&&!c?_w(u,p):Hn(0);return{width:a.width*m.x,height:a.height*m.y,x:a.x*m.x-p.scrollLeft*m.x+y.x+x.x,y:a.y*m.y-p.scrollTop*m.y+y.y+x.y}}function AA(e){return Array.from(e.getClientRects())}function OA(e){const n=Yn(e),a=Xc(e),s=e.ownerDocument.body,o=an(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),c=an(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let u=-a.scrollLeft+Qc(e);const f=-a.scrollTop;return Nn(s).direction==="rtl"&&(u+=an(n.clientWidth,s.clientWidth)-o),{width:o,height:c,x:u,y:f}}const lb=25;function NA(e,n){const a=on(e),s=Yn(e),o=a.visualViewport;let c=s.clientWidth,u=s.clientHeight,f=0,p=0;if(o){c=o.width,u=o.height;const y=Jh();(!y||y&&n==="fixed")&&(f=o.offsetLeft,p=o.offsetTop)}const m=Qc(s);if(m<=0){const y=s.ownerDocument,g=y.body,x=getComputedStyle(g),S=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,_=Math.abs(s.clientWidth-g.clientWidth-S);_<=lb&&(c-=_)}else m<=lb&&(c+=m);return{width:c,height:u,x:f,y:p}}const kA=new Set(["absolute","fixed"]);function jA(e,n){const a=Ba(e,!0,n==="fixed"),s=a.top+e.clientTop,o=a.left+e.clientLeft,c=Vn(e)?Fs(e):Hn(1),u=e.clientWidth*c.x,f=e.clientHeight*c.y,p=o*c.x,m=s*c.y;return{width:u,height:f,x:p,y:m}}function cb(e,n,a){let s;if(n==="viewport")s=NA(e,a);else if(n==="document")s=OA(Yn(e));else if(On(n))s=jA(n,a);else{const o=Ew(e);s={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return Oc(s)}function Tw(e,n){const a=ia(e);return a===n||!On(a)||Ks(a)?!1:Nn(a).position==="fixed"||Tw(a,n)}function DA(e,n){const a=n.get(e);if(a)return a;let s=yo(e,[],!1).filter(f=>On(f)&&Zs(f)!=="body"),o=null;const c=Nn(e).position==="fixed";let u=c?ia(e):e;for(;On(u)&&!Ks(u);){const f=Nn(u),p=Wh(u);!p&&f.position==="fixed"&&(o=null),(c?!p&&!o:!p&&f.position==="static"&&!!o&&kA.has(o.position)||ko(u)&&!p&&Tw(e,u))?s=s.filter(y=>y!==u):o=f,u=ia(u)}return n.set(e,s),s}function MA(e){let{element:n,boundary:a,rootBoundary:s,strategy:o}=e;const u=[...a==="clippingAncestors"?Kc(n)?[]:DA(n,this._c):[].concat(a),s],f=u[0],p=u.reduce((m,y)=>{const g=cb(n,y,o);return m.top=an(g.top,m.top),m.right=sa(g.right,m.right),m.bottom=sa(g.bottom,m.bottom),m.left=an(g.left,m.left),m},cb(n,f,o));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function LA(e){const{width:n,height:a}=Sw(e);return{width:n,height:a}}function UA(e,n,a){const s=Vn(n),o=Yn(n),c=a==="fixed",u=Ba(e,!0,c,n);let f={scrollLeft:0,scrollTop:0};const p=Hn(0);function m(){p.x=Qc(o)}if(s||!s&&!c)if((Zs(n)!=="body"||ko(o))&&(f=Xc(n)),s){const S=Ba(n,!0,c,n);p.x=S.x+n.clientLeft,p.y=S.y+n.clientTop}else o&&m();c&&!s&&o&&m();const y=o&&!s&&!c?_w(o,f):Hn(0),g=u.left+f.scrollLeft-p.x-y.x,x=u.top+f.scrollTop-p.y-y.y;return{x:g,y:x,width:u.width,height:u.height}}function Uf(e){return Nn(e).position==="static"}function ub(e,n){if(!Vn(e)||Nn(e).position==="fixed")return null;if(n)return n(e);let a=e.offsetParent;return Yn(e)===a&&(a=a.ownerDocument.body),a}function Cw(e,n){const a=on(e);if(Kc(e))return a;if(!Vn(e)){let o=ia(e);for(;o&&!Ks(o);){if(On(o)&&!Uf(o))return o;o=ia(o)}return a}let s=ub(e,n);for(;s&&vA(s)&&Uf(s);)s=ub(s,n);return s&&Ks(s)&&Uf(s)&&!Wh(s)?a:s||EA(e)||a}const PA=async function(e){const n=this.getOffsetParent||Cw,a=this.getDimensions,s=await a(e.floating);return{reference:UA(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function zA(e){return Nn(e).direction==="rtl"}const IA={convertOffsetParentRelativeRectToViewportRelativeRect:RA,getDocumentElement:Yn,getClippingRect:MA,getOffsetParent:Cw,getElementRects:PA,getClientRects:AA,getDimensions:LA,getScale:Fs,isElement:On,isRTL:zA};function Rw(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function BA(e,n){let a=null,s;const o=Yn(e);function c(){var f;clearTimeout(s),(f=a)==null||f.disconnect(),a=null}function u(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),c();const m=e.getBoundingClientRect(),{left:y,top:g,width:x,height:S}=m;if(f||n(),!x||!S)return;const _=rc(g),E=rc(o.clientWidth-(y+x)),T=rc(o.clientHeight-(g+S)),R=rc(y),A={rootMargin:-_+"px "+-E+"px "+-T+"px "+-R+"px",threshold:an(0,sa(1,p))||1};let k=!0;function I(B){const $=B[0].intersectionRatio;if($!==p){if(!k)return u();$?u(!1,$):s=setTimeout(()=>{u(!1,1e-7)},1e3)}$===1&&!Rw(m,e.getBoundingClientRect())&&u(),k=!1}try{a=new IntersectionObserver(I,{...A,root:o.ownerDocument})}catch{a=new IntersectionObserver(I,A)}a.observe(e)}return u(!0),c}function $A(e,n,a,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=Zh(e),y=o||c?[...m?yo(m):[],...yo(n)]:[];y.forEach(R=>{o&&R.addEventListener("scroll",a,{passive:!0}),c&&R.addEventListener("resize",a)});const g=m&&f?BA(m,a):null;let x=-1,S=null;u&&(S=new ResizeObserver(R=>{let[O]=R;O&&O.target===m&&S&&(S.unobserve(n),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var A;(A=S)==null||A.observe(n)})),a()}),m&&!p&&S.observe(m),S.observe(n));let _,E=p?Ba(e):null;p&&T();function T(){const R=Ba(e);E&&!Rw(E,R)&&a(),E=R,_=requestAnimationFrame(T)}return a(),()=>{var R;y.forEach(O=>{o&&O.removeEventListener("scroll",a),c&&O.removeEventListener("resize",a)}),g?.(),(R=S)==null||R.disconnect(),S=null,p&&cancelAnimationFrame(_)}}const HA=fA,qA=hA,FA=cA,VA=mA,GA=uA,db=lA,YA=pA,KA=(e,n,a)=>{const s=new Map,o={platform:IA,...a},c={...o.platform,_c:s};return oA(e,n,{...o,platform:c})};var XA=typeof document<"u",QA=function(){},wc=XA?b.useLayoutEffect:QA;function Nc(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let a,s,o;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==n.length)return!1;for(s=a;s--!==0;)if(!Nc(e[s],n[s]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(n).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(n,o[s]))return!1;for(s=a;s--!==0;){const c=o[s];if(!(c==="_owner"&&e.$$typeof)&&!Nc(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function Aw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fb(e,n){const a=Aw(e);return Math.round(n*a)/a}function Pf(e){const n=b.useRef(e);return wc(()=>{n.current=e}),n}function WA(e){e===void 0&&(e={});const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:o,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:p,open:m}=e,[y,g]=b.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(s);Nc(x,s)||S(s);const[_,E]=b.useState(null),[T,R]=b.useState(null),O=b.useCallback(Z=>{Z!==B.current&&(B.current=Z,E(Z))},[]),A=b.useCallback(Z=>{Z!==$.current&&($.current=Z,R(Z))},[]),k=c||_,I=u||T,B=b.useRef(null),$=b.useRef(null),q=b.useRef(y),ne=p!=null,de=Pf(p),he=Pf(o),le=Pf(m),me=b.useCallback(()=>{if(!B.current||!$.current)return;const Z={placement:n,strategy:a,middleware:x};he.current&&(Z.platform=he.current),KA(B.current,$.current,Z).then(se=>{const J={...se,isPositioned:le.current!==!1};W.current&&!Nc(q.current,J)&&(q.current=J,qc.flushSync(()=>{g(J)}))})},[x,n,a,he,le]);wc(()=>{m===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,g(Z=>({...Z,isPositioned:!1})))},[m]);const W=b.useRef(!1);wc(()=>(W.current=!0,()=>{W.current=!1}),[]),wc(()=>{if(k&&(B.current=k),I&&($.current=I),k&&I){if(de.current)return de.current(k,I,me);me()}},[k,I,me,de,ne]);const ae=b.useMemo(()=>({reference:B,floating:$,setReference:O,setFloating:A}),[O,A]),D=b.useMemo(()=>({reference:k,floating:I}),[k,I]),V=b.useMemo(()=>{const Z={position:a,left:0,top:0};if(!D.floating)return Z;const se=fb(D.floating,y.x),J=fb(D.floating,y.y);return f?{...Z,transform:"translate("+se+"px, "+J+"px)",...Aw(D.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:se,top:J}},[a,f,D.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:me,refs:ae,elements:D,floatingStyles:V}),[y,me,ae,D,V])}const JA=e=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:s,padding:o}=typeof e=="function"?e(a):e;return s&&n(s)?s.current!=null?db({element:s.current,padding:o}).fn(a):{}:s?db({element:s,padding:o}).fn(a):{}}}},ZA=(e,n)=>({...HA(e),options:[e,n]}),e2=(e,n)=>({...qA(e),options:[e,n]}),t2=(e,n)=>({...YA(e),options:[e,n]}),n2=(e,n)=>({...FA(e),options:[e,n]}),r2=(e,n)=>({...VA(e),options:[e,n]}),a2=(e,n)=>({...GA(e),options:[e,n]}),s2=(e,n)=>({...JA(e),options:[e,n]});var i2="Arrow",Ow=b.forwardRef((e,n)=>{const{children:a,width:s=10,height:o=5,...c}=e;return v.jsx(Ie.svg,{...c,ref:n,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ow.displayName=i2;var o2=Ow;function ep(e){const[n,a]=b.useState(void 0);return Fn(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let u,f;if("borderBoxSize"in c){const p=c.borderBoxSize,m=Array.isArray(p)?p[0]:p;u=m.inlineSize,f=m.blockSize}else u=e.offsetWidth,f=e.offsetHeight;a({width:u,height:f})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),n}var Nw="Popper",[kw,jw]=kn(Nw),[a5,Dw]=kw(Nw),Mw="PopperAnchor",Lw=b.forwardRef((e,n)=>{const{__scopePopper:a,virtualRef:s,...o}=e,c=Dw(Mw,a),u=b.useRef(null),f=Ze(n,u),p=b.useRef(null);return b.useEffect(()=>{const m=p.current;p.current=s?.current||u.current,m!==p.current&&c.onAnchorChange(p.current)}),s?null:v.jsx(Ie.div,{...o,ref:f})});Lw.displayName=Mw;var tp="PopperContent",[l2,c2]=kw(tp),Uw=b.forwardRef((e,n)=>{const{__scopePopper:a,side:s="bottom",sideOffset:o=0,align:c="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:S="optimized",onPlaced:_,...E}=e,T=Dw(tp,a),[R,O]=b.useState(null),A=Ze(n,ge=>O(ge)),[k,I]=b.useState(null),B=ep(k),$=B?.width??0,q=B?.height??0,ne=s+(c!=="center"?"-"+c:""),de=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},he=Array.isArray(m)?m:[m],le=he.length>0,me={padding:de,boundary:he.filter(d2),altBoundary:le},{refs:W,floatingStyles:ae,placement:D,isPositioned:V,middlewareData:Z}=WA({strategy:"fixed",placement:ne,whileElementsMounted:(...ge)=>$A(...ge,{animationFrame:S==="always"}),elements:{reference:T.anchor},middleware:[ZA({mainAxis:o+q,alignmentAxis:u}),p&&e2({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?t2():void 0,...me}),p&&n2({...me}),r2({...me,apply:({elements:ge,rects:Se,availableWidth:ve,availableHeight:ce})=>{const{width:be,height:Ce}=Se.reference,et=ge.floating.style;et.setProperty("--radix-popper-available-width",`${ve}px`),et.setProperty("--radix-popper-available-height",`${ce}px`),et.setProperty("--radix-popper-anchor-width",`${be}px`),et.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),k&&s2({element:k,padding:f}),f2({arrowWidth:$,arrowHeight:q}),x&&a2({strategy:"referenceHidden",...me})]}),[se,J]=Iw(D),j=An(_);Fn(()=>{V&&j?.()},[V,j]);const G=Z.arrow?.x,K=Z.arrow?.y,ee=Z.arrow?.centerOffset!==0,[U,re]=b.useState();return Fn(()=>{R&&re(window.getComputedStyle(R).zIndex)},[R]),v.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:V?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(l2,{scope:a,placedSide:se,onArrowChange:I,arrowX:G,arrowY:K,shouldHideArrow:ee,children:v.jsx(Ie.div,{"data-side":se,"data-align":J,...E,ref:A,style:{...E.style,animation:V?void 0:"none"}})})})});Uw.displayName=tp;var Pw="PopperArrow",u2={top:"bottom",right:"left",bottom:"top",left:"right"},zw=b.forwardRef(function(n,a){const{__scopePopper:s,...o}=n,c=c2(Pw,s),u=u2[c.placedSide];return v.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:v.jsx(o2,{...o,ref:a,style:{...o.style,display:"block"}})})});zw.displayName=Pw;function d2(e){return e!==null}var f2=e=>({name:"transformOrigin",options:e,fn(n){const{placement:a,rects:s,middlewareData:o}=n,u=o.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[m,y]=Iw(a),g={start:"0%",center:"50%",end:"100%"}[y],x=(o.arrow?.x??0)+f/2,S=(o.arrow?.y??0)+p/2;let _="",E="";return m==="bottom"?(_=u?g:`${x}px`,E=`${-p}px`):m==="top"?(_=u?g:`${x}px`,E=`${s.floating.height+p}px`):m==="right"?(_=`${-p}px`,E=u?g:`${S}px`):m==="left"&&(_=`${s.floating.width+p}px`,E=u?g:`${S}px`),{data:{x:_,y:E}}}});function Iw(e){const[n,a="center"]=e.split("-");return[n,a]}var h2=Lw,p2=Uw,m2=zw,g2=Symbol("radix.slottable");function y2(e){const n=({children:a})=>v.jsx(v.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=g2,n}var[Wc]=kn("Tooltip",[jw]),np=jw(),Bw="TooltipProvider",v2=700,hb="tooltip.open",[b2,$w]=Wc(Bw),Hw=e=>{const{__scopeTooltip:n,delayDuration:a=v2,skipDelayDuration:s=300,disableHoverableContent:o=!1,children:c}=e,u=b.useRef(!0),f=b.useRef(!1),p=b.useRef(0);return b.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),v.jsx(b2,{scope:n,isOpenDelayedRef:u,delayDuration:a,onOpen:b.useCallback(()=>{window.clearTimeout(p.current),u.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,s)},[s]),isPointerInTransitRef:f,onPointerInTransitChange:b.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:c})};Hw.displayName=Bw;var qw="Tooltip",[s5,Jc]=Wc(qw),ph="TooltipTrigger",w2=b.forwardRef((e,n)=>{const{__scopeTooltip:a,...s}=e,o=Jc(ph,a),c=$w(ph,a),u=np(a),f=b.useRef(null),p=Ze(n,f,o.onTriggerChange),m=b.useRef(!1),y=b.useRef(!1),g=b.useCallback(()=>m.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),v.jsx(h2,{asChild:!0,...u,children:v.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:p,onPointerMove:je(e.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!c.isPointerInTransitRef.current&&(o.onTriggerEnter(),y.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{o.onTriggerLeave(),y.current=!1}),onPointerDown:je(e.onPointerDown,()=>{o.open&&o.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:je(e.onFocus,()=>{m.current||o.onOpen()}),onBlur:je(e.onBlur,o.onClose),onClick:je(e.onClick,o.onClose)})})});w2.displayName=ph;var x2="TooltipPortal",[i5,S2]=Wc(x2,{forceMount:void 0}),Xs="TooltipContent",Fw=b.forwardRef((e,n)=>{const a=S2(Xs,e.__scopeTooltip),{forceMount:s=a.forceMount,side:o="top",...c}=e,u=Jc(Xs,e.__scopeTooltip);return v.jsx(xr,{present:s||u.open,children:u.disableHoverableContent?v.jsx(Vw,{side:o,...c,ref:n}):v.jsx(E2,{side:o,...c,ref:n})})}),E2=b.forwardRef((e,n)=>{const a=Jc(Xs,e.__scopeTooltip),s=$w(Xs,e.__scopeTooltip),o=b.useRef(null),c=Ze(n,o),[u,f]=b.useState(null),{trigger:p,onClose:m}=a,y=o.current,{onPointerInTransitChange:g}=s,x=b.useCallback(()=>{f(null),g(!1)},[g]),S=b.useCallback((_,E)=>{const T=_.currentTarget,R={x:_.clientX,y:_.clientY},O=A2(R,T.getBoundingClientRect()),A=O2(R,O),k=N2(E.getBoundingClientRect()),I=j2([...A,...k]);f(I),g(!0)},[g]);return b.useEffect(()=>()=>x(),[x]),b.useEffect(()=>{if(p&&y){const _=T=>S(T,y),E=T=>S(T,p);return p.addEventListener("pointerleave",_),y.addEventListener("pointerleave",E),()=>{p.removeEventListener("pointerleave",_),y.removeEventListener("pointerleave",E)}}},[p,y,S,x]),b.useEffect(()=>{if(u){const _=E=>{const T=E.target,R={x:E.clientX,y:E.clientY},O=p?.contains(T)||y?.contains(T),A=!k2(R,u);O?x():A&&(x(),m())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[p,y,u,m,x]),v.jsx(Vw,{...e,ref:c})}),[_2,T2]=Wc(qw,{isInside:!1}),C2=y2("TooltipContent"),Vw=b.forwardRef((e,n)=>{const{__scopeTooltip:a,children:s,"aria-label":o,onEscapeKeyDown:c,onPointerDownOutside:u,...f}=e,p=Jc(Xs,a),m=np(a),{onClose:y}=p;return b.useEffect(()=>(document.addEventListener(hb,y),()=>document.removeEventListener(hb,y)),[y]),b.useEffect(()=>{if(p.trigger){const g=x=>{x.target?.contains(p.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[p.trigger,y]),v.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:v.jsxs(p2,{"data-state":p.stateAttribute,...m,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(C2,{children:s}),v.jsx(_2,{scope:a,isInside:!0,children:v.jsx(_T,{id:p.contentId,role:"tooltip",children:o||s})})]})})});Fw.displayName=Xs;var Gw="TooltipArrow",R2=b.forwardRef((e,n)=>{const{__scopeTooltip:a,...s}=e,o=np(a);return T2(Gw,a).isInside?null:v.jsx(m2,{...o,...s,ref:n})});R2.displayName=Gw;function A2(e,n){const a=Math.abs(n.top-e.y),s=Math.abs(n.bottom-e.y),o=Math.abs(n.right-e.x),c=Math.abs(n.left-e.x);switch(Math.min(a,s,o,c)){case c:return"left";case o:return"right";case a:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function O2(e,n,a=5){const s=[];switch(n){case"top":s.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":s.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":s.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":s.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return s}function N2(e){const{top:n,right:a,bottom:s,left:o}=e;return[{x:o,y:n},{x:a,y:n},{x:a,y:s},{x:o,y:s}]}function k2(e,n){const{x:a,y:s}=e;let o=!1;for(let c=0,u=n.length-1;c<n.length;u=c++){const f=n[c],p=n[u],m=f.x,y=f.y,g=p.x,x=p.y;y>s!=x>s&&a<(g-m)*(s-y)/(x-y)+m&&(o=!o)}return o}function j2(e){const n=e.slice();return n.sort((a,s)=>a.x<s.x?-1:a.x>s.x?1:a.y<s.y?-1:a.y>s.y?1:0),D2(n)}function D2(e){if(e.length<=1)return e.slice();const n=[];for(let s=0;s<e.length;s++){const o=e[s];for(;n.length>=2;){const c=n[n.length-1],u=n[n.length-2];if((c.x-u.x)*(o.y-u.y)>=(c.y-u.y)*(o.x-u.x))n.pop();else break}n.push(o)}n.pop();const a=[];for(let s=e.length-1;s>=0;s--){const o=e[s];for(;a.length>=2;){const c=a[a.length-1],u=a[a.length-2];if((c.x-u.x)*(o.y-u.y)>=(c.y-u.y)*(o.x-u.x))a.pop();else break}a.push(o)}return a.pop(),n.length===1&&a.length===1&&n[0].x===a[0].x&&n[0].y===a[0].y?n:n.concat(a)}var M2=Hw,Yw=Fw;const L2=M2,U2=b.forwardRef(({className:e,sideOffset:n=4,...a},s)=>v.jsx(Yw,{ref:s,sideOffset:n,className:qe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a}));U2.displayName=Yw.displayName;var Zc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},P2={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},z2=class{#e=P2;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},mh=new z2;function I2(e){setTimeout(e,0)}var eu=typeof window>"u"||"Deno"in globalThis;function Tn(){}function B2(e,n){return typeof e=="function"?e(n):e}function $2(e){return typeof e=="number"&&e>=0&&e!==1/0}function H2(e,n){return Math.max(e+(n||0)-Date.now(),0)}function gh(e,n){return typeof e=="function"?e(n):e}function q2(e,n){return typeof e=="function"?e(n):e}function pb(e,n){const{type:a="all",exact:s,fetchStatus:o,predicate:c,queryKey:u,stale:f}=e;if(u){if(s){if(n.queryHash!==rp(u,n.options))return!1}else if(!bo(n.queryKey,u))return!1}if(a!=="all"){const p=n.isActive();if(a==="active"&&!p||a==="inactive"&&p)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||o&&o!==n.state.fetchStatus||c&&!c(n))}function mb(e,n){const{exact:a,status:s,predicate:o,mutationKey:c}=e;if(c){if(!n.options.mutationKey)return!1;if(a){if(vo(n.options.mutationKey)!==vo(c))return!1}else if(!bo(n.options.mutationKey,c))return!1}return!(s&&n.state.status!==s||o&&!o(n))}function rp(e,n){return(n?.queryKeyHashFn||vo)(e)}function vo(e){return JSON.stringify(e,(n,a)=>yh(a)?Object.keys(a).sort().reduce((s,o)=>(s[o]=a[o],s),{}):a)}function bo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(a=>bo(e[a],n[a])):!1}var F2=Object.prototype.hasOwnProperty;function Kw(e,n,a=0){if(e===n)return e;if(a>500)return n;const s=gb(e)&&gb(n);if(!s&&!(yh(e)&&yh(n)))return n;const c=(s?e:Object.keys(e)).length,u=s?n:Object.keys(n),f=u.length,p=s?new Array(f):{};let m=0;for(let y=0;y<f;y++){const g=s?y:u[y],x=e[g],S=n[g];if(x===S){p[g]=x,(s?y<c:F2.call(e,g))&&m++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[g]=S;continue}const _=Kw(x,S,a+1);p[g]=_,_===x&&m++}return c===f&&m===c?e:p}function gb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yh(e){if(!yb(e))return!1;const n=e.constructor;if(n===void 0)return!0;const a=n.prototype;return!(!yb(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function yb(e){return Object.prototype.toString.call(e)==="[object Object]"}function V2(e){return new Promise(n=>{mh.setTimeout(n,e)})}function G2(e,n,a){return typeof a.structuralSharing=="function"?a.structuralSharing(e,n):a.structuralSharing!==!1?Kw(e,n):n}function Y2(e,n,a=0){const s=[...e,n];return a&&s.length>a?s.slice(1):s}function K2(e,n,a=0){const s=[n,...e];return a&&s.length>a?s.slice(0,-1):s}var ap=Symbol();function Xw(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===ap?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function X2(e,n,a){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),s||(s=!0,o.aborted?a():o.addEventListener("abort",a,{once:!0})),o)}),e}var Q2=class extends Zc{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!eu&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Qw=new Q2;function W2(){let e,n;const a=new Promise((o,c)=>{e=o,n=c});a.status="pending",a.catch(()=>{});function s(o){Object.assign(a,o),delete a.resolve,delete a.reject}return a.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},a.reject=o=>{s({status:"rejected",reason:o}),n(o)},a}var J2=I2;function Z2(){let e=[],n=0,a=f=>{f()},s=f=>{f()},o=J2;const c=f=>{n?e.push(f):o(()=>{a(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{s(()=>{f.forEach(p=>{a(p)})})})};return{batch:f=>{let p;n++;try{p=f()}finally{n--,n||u()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{a=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{o=f}}}var Ut=Z2(),eO=class extends Zc{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!eu&&window.addEventListener){const n=()=>e(!0),a=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(a=>{a(e)}))}isOnline(){return this.#e}},kc=new eO;function tO(e){return Math.min(1e3*2**e,3e4)}function Ww(e){return(e??"online")==="online"?kc.isOnline():!0}var vh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Jw(e){let n=!1,a=0,s;const o=W2(),c=()=>o.status!=="pending",u=E=>{if(!c()){const T=new vh(E);x(T),e.onCancel?.(T)}},f=()=>{n=!0},p=()=>{n=!1},m=()=>Qw.isFocused()&&(e.networkMode==="always"||kc.isOnline())&&e.canRun(),y=()=>Ww(e.networkMode)&&e.canRun(),g=E=>{c()||(s?.(),o.resolve(E))},x=E=>{c()||(s?.(),o.reject(E))},S=()=>new Promise(E=>{s=T=>{(c()||m())&&E(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let E;const T=a===0?e.initialPromise:void 0;try{E=T??e.fn()}catch(R){E=Promise.reject(R)}Promise.resolve(E).then(g).catch(R=>{if(c())return;const O=e.retry??(eu?0:3),A=e.retryDelay??tO,k=typeof A=="function"?A(a,R):A,I=O===!0||typeof O=="number"&&a<O||typeof O=="function"&&O(a,R);if(n||!I){x(R);return}a++,e.onFail?.(a,R),V2(k).then(()=>m()?void 0:S()).then(()=>{n?x(R):_()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(s?.(),o),cancelRetry:f,continueRetry:p,canStart:y,start:()=>(y()?_():S().then(_),o)}}var Zw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$2(this.gcTime)&&(this.#e=mh.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(eu?1/0:300*1e3))}clearGcTimeout(){this.#e&&(mh.clearTimeout(this.#e),this.#e=void 0)}},nO=class extends Zw{#e;#n;#t;#a;#r;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#t=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=bb(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bb(this.options);n.data!==void 0&&(this.setState(vb(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,n){const a=G2(this.state.data,e,this.options);return this.#s({data:a,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),a}setState(e,n){this.#s({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(Tn).catch(Tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>q2(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ap||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>gh(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!H2(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const a=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,a.signal)})},o=()=>{const f=Xw(this.options,n),m=(()=>{const y={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(y),y})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},u=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return s(f),f})();this.options.behavior?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#s({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=Jw({initialPromise:n?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof vh&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),a.abort()},onFail:(f,p)=>{this.#s({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#t.config.onSuccess?.(f,this),this.#t.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof vh){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#s({type:"error",error:f}),this.#t.config.onError?.(f,this),this.#t.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#s(e){const n=a=>{switch(e.type){case"failed":return{...a,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...rO(a.data,this.options),fetchMeta:e.meta??null};case"success":const s={...a,...vb(e.data,e.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?s:void 0,s;case"error":const o=e.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...e.state}}};this.state=n(this.state),Ut.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function rO(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ww(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vb(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bb(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,a=n!==void 0,s=a?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:a?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}function wb(e){return{onFetch:(n,a)=>{const s=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,c=n.state.data?.pages||[],u=n.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let y=!1;const g=_=>{X2(_,()=>n.signal,()=>y=!0)},x=Xw(n.options,n.fetchOptions),S=async(_,E,T)=>{if(y)return Promise.reject();if(E==null&&_.pages.length)return Promise.resolve(_);const O=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:E,direction:T?"backward":"forward",meta:n.options.meta};return g(B),B})(),A=await x(O),{maxPages:k}=n.options,I=T?K2:Y2;return{pages:I(_.pages,A,k),pageParams:I(_.pageParams,E,k)}};if(o&&c.length){const _=o==="backward",E=_?aO:xb,T={pages:c,pageParams:u},R=E(s,T);f=await S(T,R,_)}else{const _=e??c.length;do{const E=p===0?u[0]??s.initialPageParam:xb(s,f);if(p>0&&E==null)break;f=await S(f,E),p++}while(p<_)}return f};n.options.persister?n.fetchFn=()=>n.options.persister?.(m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},a):n.fetchFn=m}}}function xb(e,{pages:n,pageParams:a}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,a[s],a):void 0}function aO(e,{pages:n,pageParams:a}){return n.length>0?e.getPreviousPageParam?.(n[0],n,a[0],a):void 0}var sO=class extends Zw{#e;#n;#t;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||iO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(n=>n!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=Jw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,a):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#r({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const s=this.state.status==="pending",o=!this.#a.canStart();try{if(s)n();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,a);const u=await this.options.onMutate?.(e,a);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:o})}const c=await this.#a.start();return await this.#t.config.onSuccess?.(c,e,this.state.context,this,a),await this.options.onSuccess?.(c,e,this.state.context,a),await this.#t.config.onSettled?.(c,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(c,null,e,this.state.context,a),this.#r({type:"success",data:c}),c}catch(c){try{await this.#t.config.onError?.(c,e,this.state.context,this,a)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,a)}catch(u){Promise.reject(u)}try{await this.#t.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,a)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,a)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:c}),c}finally{this.#t.runNext(this)}}#r(e){const n=a=>{switch(e.type){case"failed":return{...a,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...a,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:e.error,failureCount:a.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ut.batch(()=>{this.#n.forEach(a=>{a.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function iO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oO=class extends Zc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,n,a){const s=new sO({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(n),state:a});return this.add(s),s}add(e){this.#e.add(e);const n=ac(e);if(typeof n=="string"){const a=this.#n.get(n);a?a.push(e):this.#n.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=ac(e);if(typeof n=="string"){const a=this.#n.get(n);if(a)if(a.length>1){const s=a.indexOf(e);s!==-1&&a.splice(s,1)}else a[0]===e&&this.#n.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=ac(e);if(typeof n=="string"){const s=this.#n.get(n)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=ac(e);return typeof n=="string"?this.#n.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ut.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(a=>mb(n,a))}findAll(e={}){return this.getAll().filter(n=>mb(e,n))}notify(e){Ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ut.batch(()=>Promise.all(e.map(n=>n.continue().catch(Tn))))}};function ac(e){return e.options.scope?.id}var lO=class extends Zc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,a){const s=n.queryKey,o=n.queryHash??rp(s,n);let c=this.get(o);return c||(c=new nO({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:a,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(a=>pb(n,a))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(a=>pb(e,a)):n}notify(e){Ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},cO=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new lO,this.#n=e.mutationCache||new oO,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Qw.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=kc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),a=this.#e.build(this,n),s=a.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&a.isStaleByTime(gh(n.staleTime,a))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:a})=>{const s=a.data;return[n,s]})}setQueryData(e,n,a){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,u=B2(n,c);if(u!==void 0)return this.#e.build(this,s).setData(u,{...a,manual:!0})}setQueriesData(e,n,a){return Ut.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,a)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Ut.batch(()=>{n.findAll(e).forEach(a=>{n.remove(a)})})}resetQueries(e,n){const a=this.#e;return Ut.batch(()=>(a.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const a={revert:!0,...n},s=Ut.batch(()=>this.#e.findAll(e).map(o=>o.cancel(a)));return Promise.all(s).then(Tn).catch(Tn)}invalidateQueries(e,n={}){return Ut.batch(()=>(this.#e.findAll(e).forEach(a=>{a.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const a={...n,cancelRefetch:n.cancelRefetch??!0},s=Ut.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,a);return a.throwOnError||(c=c.catch(Tn)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Tn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const a=this.#e.build(this,n);return a.isStaleByTime(gh(n.staleTime,a))?a.fetch(n):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tn).catch(Tn)}fetchInfiniteQuery(e){return e.behavior=wb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tn).catch(Tn)}ensureInfiniteQueryData(e){return e.behavior=wb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return kc.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,n){this.#a.set(vo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#a.values()],a={};return n.forEach(s=>{bo(e,s.queryKey)&&Object.assign(a,s.defaultOptions)}),a}setMutationDefaults(e,n){this.#r.set(vo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],a={};return n.forEach(s=>{bo(e,s.mutationKey)&&Object.assign(a,s.defaultOptions)}),a}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=rp(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ap&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},uO=b.createContext(void 0),dO=({client:e,children:n})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(uO.Provider,{value:e,children:n}));var Sb="popstate";function Eb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fO(e={}){function n(s,o){let c=o.state?.masked,{pathname:u,search:f,hash:p}=c||s.location;return bh("",{pathname:u,search:f,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:wo(o)}return pO(n,a,null,e)}function nt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Gn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function hO(){return Math.random().toString(36).substring(2,10)}function _b(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function bh(e,n,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ei(n):n,state:a,key:n&&n.key||s||hO(),unstable_mask:o}}function wo({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function ei(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function pO(e,n,a,s={}){let{window:o=document.defaultView,v5Compat:c=!1}=s,u=o.history,f="POP",p=null,m=y();m==null&&(m=0,u.replaceState({...u.state,idx:m},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let T=y(),R=T==null?null:T-m;m=T,p&&p({action:f,location:E.location,delta:R})}function x(T,R){f="PUSH";let O=Eb(T)?T:bh(E.location,T,R);m=y()+1;let A=_b(O,m),k=E.createHref(O.unstable_mask||O);try{u.pushState(A,"",k)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;o.location.assign(k)}c&&p&&p({action:f,location:E.location,delta:1})}function S(T,R){f="REPLACE";let O=Eb(T)?T:bh(E.location,T,R);m=y();let A=_b(O,m),k=E.createHref(O.unstable_mask||O);u.replaceState(A,"",k),c&&p&&p({action:f,location:E.location,delta:0})}function _(T){return mO(T)}let E={get action(){return f},get location(){return e(o,u)},listen(T){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Sb,g),p=T,()=>{o.removeEventListener(Sb,g),p=null}},createHref(T){return n(o,T)},createURL:_,encodeLocation(T){let R=_(T);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:S,go(T){return u.go(T)}};return E}function mO(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),nt(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:wo(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function ex(e,n,a="/"){return gO(e,n,a,!1)}function gO(e,n,a,s){let o=typeof n=="string"?ei(n):n,c=wr(o.pathname||"/",a);if(c==null)return null;let u=tx(e);yO(u);let f=null;for(let p=0;f==null&&p<u.length;++p){let m=AO(c);f=CO(u[p],m,s)}return f}function tx(e,n=[],a=[],s="",o=!1){let c=(u,f,p=o,m)=>{let y={relativePath:m===void 0?u.path||"":m,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&p)return;nt(y.relativePath.startsWith(s),`Absolute route path "${y.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(s.length)}let g=qn([s,y.relativePath]),x=a.concat(y);u.children&&u.children.length>0&&(nt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),tx(u.children,n,x,g,p)),!(u.path==null&&!u.index)&&n.push({path:g,score:_O(g,u.index),routesMeta:x})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))c(u,f);else for(let p of nx(u.path))c(u,f,!0,p)}),n}function nx(e){let n=e.split("/");if(n.length===0)return[];let[a,...s]=n,o=a.endsWith("?"),c=a.replace(/\?$/,"");if(s.length===0)return o?[c,""]:[c];let u=nx(s.join("/")),f=[];return f.push(...u.map(p=>p===""?c:[c,p].join("/"))),o&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function yO(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:TO(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var vO=/^:[\w-]+$/,bO=3,wO=2,xO=1,SO=10,EO=-2,Tb=e=>e==="*";function _O(e,n){let a=e.split("/"),s=a.length;return a.some(Tb)&&(s+=EO),n&&(s+=wO),a.filter(o=>!Tb(o)).reduce((o,c)=>o+(vO.test(c)?bO:c===""?xO:SO),s)}function TO(e,n){return e.length===n.length&&e.slice(0,-1).every((s,o)=>s===n[o])?e[e.length-1]-n[n.length-1]:0}function CO(e,n,a=!1){let{routesMeta:s}=e,o={},c="/",u=[];for(let f=0;f<s.length;++f){let p=s[f],m=f===s.length-1,y=c==="/"?n:n.slice(c.length)||"/",g=jc({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},y),x=p.route;if(!g&&m&&a&&!s[s.length-1].route.index&&(g=jc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:qn([c,g.pathname]),pathnameBase:jO(qn([c,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(c=qn([c,g.pathnameBase]))}return u}function jc(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=RO(e.path,e.caseSensitive,e.end),o=n.match(a);if(!o)return null;let c=o[0],u=c.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:s.reduce((m,{paramName:y,isOptional:g},x)=>{if(y==="*"){let _=f[x]||"";u=c.slice(0,c.length-_.length).replace(/(.)\/+$/,"$1")}const S=f[x];return g&&!S?m[y]=void 0:m[y]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:u,pattern:e}}function RO(e,n=!1,a=!0){Gn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,p,m,y)=>{if(s.push({paramName:f,isOptional:p!=null}),p){let g=y.charAt(m+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function AO(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Gn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function wr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var OO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function NO(e,n="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?ei(e):e,c;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?c=Cb(a.substring(1),"/"):c=Cb(a,n)):c=n,{pathname:c,search:DO(s),hash:MO(o)}}function Cb(e,n){let a=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function zf(e,n,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kO(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function rx(e){let n=kO(e);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function sp(e,n,a,s=!1){let o;typeof e=="string"?o=ei(e):(o={...e},nt(!o.pathname||!o.pathname.includes("?"),zf("?","pathname","search",o)),nt(!o.pathname||!o.pathname.includes("#"),zf("#","pathname","hash",o)),nt(!o.search||!o.search.includes("#"),zf("#","search","hash",o)));let c=e===""||o.pathname==="",u=c?"/":o.pathname,f;if(u==null)f=a;else{let g=n.length-1;if(!s&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;o.pathname=x.join("/")}f=g>=0?n[g]:"/"}let p=NO(o,f),m=u&&u!=="/"&&u.endsWith("/"),y=(c||u===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(m||y)&&(p.pathname+="/"),p}var qn=e=>e.join("/").replace(/\/\/+/g,"/"),jO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,MO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,LO=class{constructor(e,n,a,s=!1){this.status=e,this.statusText=n||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function UO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function PO(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ax=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sx(e,n){let a=e;if(typeof a!="string"||!OO.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(ax)try{let c=new URL(window.location.href),u=a.startsWith("//")?new URL(c.protocol+a):new URL(a),f=wr(u.pathname,n);u.origin===c.origin&&f!=null?a=f+u.search+u.hash:o=!0}catch{Gn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ix=["POST","PUT","PATCH","DELETE"];new Set(ix);var zO=["GET",...ix];new Set(zO);var ti=b.createContext(null);ti.displayName="DataRouter";var tu=b.createContext(null);tu.displayName="DataRouterState";var IO=b.createContext(!1),ox=b.createContext({isTransitioning:!1});ox.displayName="ViewTransition";var BO=b.createContext(new Map);BO.displayName="Fetchers";var $O=b.createContext(null);$O.displayName="Await";var vn=b.createContext(null);vn.displayName="Navigation";var jo=b.createContext(null);jo.displayName="Location";var Sr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Sr.displayName="Route";var ip=b.createContext(null);ip.displayName="RouteError";var lx="REACT_ROUTER_ERROR",HO="REDIRECT",qO="ROUTE_ERROR_RESPONSE";function FO(e){if(e.startsWith(`${lx}:${HO}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function VO(e){if(e.startsWith(`${lx}:${qO}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new LO(n.status,n.statusText,n.data)}catch{}}function GO(e,{relative:n}={}){nt(Do(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=b.useContext(vn),{hash:o,pathname:c,search:u}=Mo(e,{relative:n}),f=c;return a!=="/"&&(f=c==="/"?a:qn([a,c])),s.createHref({pathname:f,search:u,hash:o})}function Do(){return b.useContext(jo)!=null}function Er(){return nt(Do(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(jo).location}var cx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ux(e){b.useContext(vn).static||b.useLayoutEffect(e)}function YO(){let{isDataRoute:e}=b.useContext(Sr);return e?iN():KO()}function KO(){nt(Do(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(ti),{basename:n,navigator:a}=b.useContext(vn),{matches:s}=b.useContext(Sr),{pathname:o}=Er(),c=JSON.stringify(rx(s)),u=b.useRef(!1);return ux(()=>{u.current=!0}),b.useCallback((p,m={})=>{if(Gn(u.current,cx),!u.current)return;if(typeof p=="number"){a.go(p);return}let y=sp(p,JSON.parse(c),o,m.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:qn([n,y.pathname])),(m.replace?a.replace:a.push)(y,m.state,m)},[n,a,c,o,e])}b.createContext(null);function Mo(e,{relative:n}={}){let{matches:a}=b.useContext(Sr),{pathname:s}=Er(),o=JSON.stringify(rx(a));return b.useMemo(()=>sp(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function XO(e,n){return dx(e,n)}function dx(e,n,a){nt(Do(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=b.useContext(vn),{matches:o}=b.useContext(Sr),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let T=m&&m.path||"";hx(f,!m||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=Er(),g;if(n){let T=typeof n=="string"?ei(n):n;nt(p==="/"||T.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${T.pathname}" was given in the \`location\` prop.`),g=T}else g=y;let x=g.pathname||"/",S=x;if(p!=="/"){let T=p.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let _=ex(e,{pathname:S});Gn(m||_!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Gn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=eN(_&&_.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:qn([p,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:qn([p,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),o,a);return n&&E?b.createElement(jo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},E):E}function QO(){let e=sN(),n=UO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:c},"ErrorBoundary")," or"," ",b.createElement("code",{style:c},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},n),a?b.createElement("pre",{style:o},a):null,u)}var WO=b.createElement(QO,null),fx=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=VO(e.digest);a&&(e=a)}let n=e!==void 0?b.createElement(Sr.Provider,{value:this.props.routeContext},b.createElement(ip.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(JO,{error:e},n):n}};fx.contextType=IO;var If=new WeakMap;function JO({children:e,error:n}){let{basename:a}=b.useContext(vn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=FO(n.digest);if(s){let o=If.get(n);if(o)throw o;let c=sx(s.location,a);if(ax&&!If.get(n))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw If.set(n,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function ZO({routeContext:e,match:n,children:a}){let s=b.useContext(ti);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Sr.Provider,{value:e},a)}function eN(e,n=[],a){let s=a?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,c=s?.errors;if(c!=null){let y=o.findIndex(g=>g.route.id&&c?.[g.route.id]!==void 0);nt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let u=!1,f=-1;if(a&&s){u=s.renderFallback;for(let y=0;y<o.length;y++){let g=o[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:S}=s,_=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!S||S[g.route.id]===void 0);if(g.route.lazy||_){a.isStatic&&(u=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let p=a?.onError,m=s&&p?(y,g)=>{p(y,{location:s.location,params:s.matches?.[0]?.params??{},unstable_pattern:PO(s.matches),errorInfo:g})}:void 0;return o.reduceRight((y,g,x)=>{let S,_=!1,E=null,T=null;s&&(S=c&&g.route.id?c[g.route.id]:void 0,E=g.route.errorElement||WO,u&&(f<0&&x===0?(hx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,T=null):f===x&&(_=!0,T=g.route.hydrateFallbackElement||null)));let R=n.concat(o.slice(0,x+1)),O=()=>{let A;return S?A=E:_?A=T:g.route.Component?A=b.createElement(g.route.Component,null):g.route.element?A=g.route.element:A=y,b.createElement(ZO,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:s!=null},children:A})};return s&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?b.createElement(fx,{location:s.location,revalidation:s.revalidation,component:E,error:S,children:O(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):O()},null)}function op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tN(e){let n=b.useContext(ti);return nt(n,op(e)),n}function nN(e){let n=b.useContext(tu);return nt(n,op(e)),n}function rN(e){let n=b.useContext(Sr);return nt(n,op(e)),n}function lp(e){let n=rN(e),a=n.matches[n.matches.length-1];return nt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function aN(){return lp("useRouteId")}function sN(){let e=b.useContext(ip),n=nN("useRouteError"),a=lp("useRouteError");return e!==void 0?e:n.errors?.[a]}function iN(){let{router:e}=tN("useNavigate"),n=lp("useNavigate"),a=b.useRef(!1);return ux(()=>{a.current=!0}),b.useCallback(async(o,c={})=>{Gn(a.current,cx),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...c}))},[e,n])}var Rb={};function hx(e,n,a){!n&&!Rb[e]&&(Rb[e]=!0,Gn(!1,a))}b.memo(oN);function oN({routes:e,future:n,state:a,isStatic:s,onError:o}){return dx(e,void 0,{state:a,isStatic:s,onError:o})}function wh(e){nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function lN({basename:e="/",children:n=null,location:a,navigationType:s="POP",navigator:o,static:c=!1,unstable_useTransitions:u}){nt(!Do(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:f,navigator:o,static:c,unstable_useTransitions:u,future:{}}),[f,o,c,u]);typeof a=="string"&&(a=ei(a));let{pathname:m="/",search:y="",hash:g="",state:x=null,key:S="default",unstable_mask:_}=a,E=b.useMemo(()=>{let T=wr(m,f);return T==null?null:{location:{pathname:T,search:y,hash:g,state:x,key:S,unstable_mask:_},navigationType:s}},[f,m,y,g,x,S,s,_]);return Gn(E!=null,`<Router basename="${f}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:b.createElement(vn.Provider,{value:p},b.createElement(jo.Provider,{children:n,value:E}))}function cN({children:e,location:n}){return XO(xh(e),n)}function xh(e,n=[]){let a=[];return b.Children.forEach(e,(s,o)=>{if(!b.isValidElement(s))return;let c=[...n,o];if(s.type===b.Fragment){a.push.apply(a,xh(s.props.children,c));return}nt(s.type===wh,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||c.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=xh(s.props.children,c)),a.push(u)}),a}var xc="get",Sc="application/x-www-form-urlencoded";function nu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uN(e){return nu(e)&&e.tagName.toLowerCase()==="button"}function dN(e){return nu(e)&&e.tagName.toLowerCase()==="form"}function fN(e){return nu(e)&&e.tagName.toLowerCase()==="input"}function hN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pN(e,n){return e.button===0&&(!n||n==="_self")&&!hN(e)}var sc=null;function mN(){if(sc===null)try{new FormData(document.createElement("form"),0),sc=!1}catch{sc=!0}return sc}var gN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bf(e){return e!=null&&!gN.has(e)?(Gn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function yN(e,n){let a,s,o,c,u;if(dN(e)){let f=e.getAttribute("action");s=f?wr(f,n):null,a=e.getAttribute("method")||xc,o=Bf(e.getAttribute("enctype"))||Sc,c=new FormData(e)}else if(uN(e)||fN(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||f.getAttribute("action");if(s=p?wr(p,n):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||xc,o=Bf(e.getAttribute("formenctype"))||Bf(f.getAttribute("enctype"))||Sc,c=new FormData(f,e),!mN()){let{name:m,type:y,value:g}=e;if(y==="image"){let x=m?`${m}.`:"";c.append(`${x}x`,"0"),c.append(`${x}y`,"0")}else m&&c.append(m,g)}}else{if(nu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=xc,s=null,o=Sc,u=e}return c&&o==="text/plain"&&(u=c,c=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:c,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cp(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function vN(e,n,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&wr(o.pathname,n)==="/"?o.pathname=`${n.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function bN(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wN(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function xN(e,n,a){let s=await Promise.all(e.map(async o=>{let c=n.routes[o.route.id];if(c){let u=await bN(c,a);return u.links?u.links():[]}return[]}));return TN(s.flat(1).filter(wN).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Ab(e,n,a,s,o,c){let u=(p,m)=>a[m]?p.route.id!==a[m].route.id:!0,f=(p,m)=>a[m].pathname!==p.pathname||a[m].route.path?.endsWith("*")&&a[m].params["*"]!==p.params["*"];return c==="assets"?n.filter((p,m)=>u(p,m)||f(p,m)):c==="data"?n.filter((p,m)=>{let y=s.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(u(p,m)||f(p,m))return!0;if(p.route.shouldRevalidate){let g=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function SN(e,n,{includeHydrateFallback:a}={}){return EN(e.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function EN(e){return[...new Set(e)]}function _N(e){let n={},a=Object.keys(e).sort();for(let s of a)n[s]=e[s];return n}function TN(e,n){let a=new Set;return new Set(n),e.reduce((s,o)=>{let c=JSON.stringify(_N(o));return a.has(c)||(a.add(c),s.push({key:c,link:o})),s},[])}function px(){let e=b.useContext(ti);return cp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function CN(){let e=b.useContext(tu);return cp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var up=b.createContext(void 0);up.displayName="FrameworkContext";function mx(){let e=b.useContext(up);return cp(e,"You must render this element inside a <HydratedRouter> element"),e}function RN(e,n){let a=b.useContext(up),[s,o]=b.useState(!1),[c,u]=b.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=n,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let E=R=>{R.forEach(O=>{u(O.isIntersecting)})},T=new IntersectionObserver(E,{threshold:.5});return x.current&&T.observe(x.current),()=>{T.disconnect()}}},[e]),b.useEffect(()=>{if(s){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[s]);let S=()=>{o(!0)},_=()=>{o(!1),u(!1)};return a?e!=="intent"?[c,x,{}]:[c,x,{onFocus:no(f,S),onBlur:no(p,_),onMouseEnter:no(m,S),onMouseLeave:no(y,_),onTouchStart:no(g,S)}]:[!1,x,{}]}function no(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function AN({page:e,...n}){let{router:a}=px(),s=b.useMemo(()=>ex(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?b.createElement(NN,{page:e,matches:s,...n}):null}function ON(e){let{manifest:n,routeModules:a}=mx(),[s,o]=b.useState([]);return b.useEffect(()=>{let c=!1;return xN(e,n,a).then(u=>{c||o(u)}),()=>{c=!0}},[e,n,a]),s}function NN({page:e,matches:n,...a}){let s=Er(),{future:o,manifest:c,routeModules:u}=mx(),{basename:f}=px(),{loaderData:p,matches:m}=CN(),y=b.useMemo(()=>Ab(e,n,m,c,s,"data"),[e,n,m,c,s]),g=b.useMemo(()=>Ab(e,n,m,c,s,"assets"),[e,n,m,c,s]),x=b.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let E=new Set,T=!1;if(n.forEach(O=>{let A=c.routes[O.route.id];!A||!A.hasLoader||(!y.some(k=>k.route.id===O.route.id)&&O.route.id in p&&u[O.route.id]?.shouldRevalidate||A.hasClientLoader?T=!0:E.add(O.route.id))}),E.size===0)return[];let R=vN(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return T&&E.size>0&&R.searchParams.set("_routes",n.filter(O=>E.has(O.route.id)).map(O=>O.route.id).join(",")),[R.pathname+R.search]},[f,o.unstable_trailingSlashAwareDataRequests,p,s,c,y,n,e,u]),S=b.useMemo(()=>SN(g,c),[g,c]),_=ON(g);return b.createElement(b.Fragment,null,x.map(E=>b.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...a})),S.map(E=>b.createElement("link",{key:E,rel:"modulepreload",href:E,...a})),_.map(({key:E,link:T})=>b.createElement("link",{key:E,nonce:a.nonce,...T,crossOrigin:T.crossOrigin??a.crossOrigin})))}function kN(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var jN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jN&&(window.__reactRouterVersion="7.13.1")}catch{}function DN({basename:e,children:n,unstable_useTransitions:a,window:s}){let o=b.useRef();o.current==null&&(o.current=fO({window:s,v5Compat:!0}));let c=o.current,[u,f]=b.useState({action:c.action,location:c.location}),p=b.useCallback(m=>{a===!1?f(m):b.startTransition(()=>f(m))},[a]);return b.useLayoutEffect(()=>c.listen(p),[c,p]),b.createElement(lN,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:c,unstable_useTransitions:a})}var gx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yx=b.forwardRef(function({onClick:n,discover:a="render",prefetch:s="none",relative:o,reloadDocument:c,replace:u,unstable_mask:f,state:p,target:m,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:S,..._},E){let{basename:T,navigator:R,unstable_useTransitions:O}=b.useContext(vn),A=typeof y=="string"&&gx.test(y),k=sx(y,T);y=k.to;let I=GO(y,{relative:o}),B=Er(),$=null;if(f){let ae=sp(f,[],B.unstable_mask?B.unstable_mask.pathname:"/",!0);T!=="/"&&(ae.pathname=ae.pathname==="/"?T:qn([T,ae.pathname])),$=R.createHref(ae)}let[q,ne,de]=RN(s,_),he=PN(y,{replace:u,unstable_mask:f,state:p,target:m,preventScrollReset:g,relative:o,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:O});function le(ae){n&&n(ae),ae.defaultPrevented||he(ae)}let me=!(k.isExternal||c),W=b.createElement("a",{..._,...de,href:(me?$:void 0)||k.absoluteURL||I,onClick:me?le:n,ref:kN(E,ne),target:m,"data-discover":!A&&a==="render"?"true":void 0});return q&&!A?b.createElement(b.Fragment,null,W,b.createElement(AN,{page:I})):W});yx.displayName="Link";var MN=b.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:s="",end:o=!1,style:c,to:u,viewTransition:f,children:p,...m},y){let g=Mo(u,{relative:m.relative}),x=Er(),S=b.useContext(tu),{navigator:_,basename:E}=b.useContext(vn),T=S!=null&&HN(g)&&f===!0,R=_.encodeLocation?_.encodeLocation(g).pathname:g.pathname,O=x.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(O=O.toLowerCase(),A=A?A.toLowerCase():null,R=R.toLowerCase()),A&&E&&(A=wr(A,E)||A);const k=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let I=O===R||!o&&O.startsWith(R)&&O.charAt(k)==="/",B=A!=null&&(A===R||!o&&A.startsWith(R)&&A.charAt(R.length)==="/"),$={isActive:I,isPending:B,isTransitioning:T},q=I?n:void 0,ne;typeof s=="function"?ne=s($):ne=[s,I?"active":null,B?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let de=typeof c=="function"?c($):c;return b.createElement(yx,{...m,"aria-current":q,className:ne,ref:y,style:de,to:u,viewTransition:f},typeof p=="function"?p($):p)});MN.displayName="NavLink";var LN=b.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:s,replace:o,state:c,method:u=xc,action:f,onSubmit:p,relative:m,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...S},_)=>{let{unstable_useTransitions:E}=b.useContext(vn),T=BN(),R=$N(f,{relative:m}),O=u.toLowerCase()==="get"?"get":"post",A=typeof f=="string"&&gx.test(f),k=I=>{if(p&&p(I),I.defaultPrevented)return;I.preventDefault();let B=I.nativeEvent.submitter,$=B?.getAttribute("formmethod")||u,q=()=>T(B||I.currentTarget,{fetcherKey:n,method:$,navigate:a,replace:o,state:c,relative:m,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});E&&a!==!1?b.startTransition(()=>q()):q()};return b.createElement("form",{ref:_,method:O,action:R,onSubmit:s?p:k,...S,"data-discover":!A&&e==="render"?"true":void 0})});LN.displayName="Form";function UN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vx(e){let n=b.useContext(ti);return nt(n,UN(e)),n}function PN(e,{target:n,replace:a,unstable_mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let y=YO(),g=Er(),x=Mo(e,{relative:u});return b.useCallback(S=>{if(pN(S,n)){S.preventDefault();let _=a!==void 0?a:wo(g)===wo(x),E=()=>y(e,{replace:_,unstable_mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:p});m?b.startTransition(()=>E()):E()}},[g,y,x,a,s,o,n,e,c,u,f,p,m])}var zN=0,IN=()=>`__${String(++zN)}__`;function BN(){let{router:e}=vx("useSubmit"),{basename:n}=b.useContext(vn),a=aN(),s=e.fetch,o=e.navigate;return b.useCallback(async(c,u={})=>{let{action:f,method:p,encType:m,formData:y,body:g}=yN(c,n);if(u.navigate===!1){let x=u.fetcherKey||IN();await s(x,a,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||m,flushSync:u.flushSync})}else await o(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||m,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,n,a])}function $N(e,{relative:n}={}){let{basename:a}=b.useContext(vn),s=b.useContext(Sr);nt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),c={...Mo(e||".",{relative:n})},u=Er();if(e==null){c.search=u.search;let f=new URLSearchParams(c.search),p=f.getAll("index");if(p.some(y=>y==="")){f.delete("index"),p.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();c.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:qn([a,c.pathname])),wo(c)}function HN(e,{relative:n}={}){let a=b.useContext(ox);nt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=vx("useViewTransitionState"),o=Mo(e,{relative:n});if(!a.isTransitioning)return!1;let c=wr(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=wr(a.nextLocation.pathname,s)||a.nextLocation.pathname;return jc(o.pathname,u)!=null||jc(o.pathname,c)!=null}var qN=Symbol.for("react.lazy"),Dc=zh[" use ".trim().toString()];function FN(e){return typeof e=="object"&&e!==null&&"then"in e}function bx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qN&&"_payload"in e&&FN(e._payload)}function wx(e){const n=GN(e),a=b.forwardRef((s,o)=>{let{children:c,...u}=s;bx(c)&&typeof Dc=="function"&&(c=Dc(c._payload));const f=b.Children.toArray(c),p=f.find(KN);if(p){const m=p.props.children,y=f.map(g=>g===p?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:g);return v.jsx(n,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return v.jsx(n,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}var VN=wx("Slot");function GN(e){const n=b.forwardRef((a,s)=>{let{children:o,...c}=a;if(bx(o)&&typeof Dc=="function"&&(o=Dc(o._payload)),b.isValidElement(o)){const u=QN(o),f=XN(c,o.props);return o.type!==b.Fragment&&(f.ref=s?Oo(s,u):u),b.cloneElement(o,f)}return b.Children.count(o)>1?b.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var YN=Symbol("radix.slottable");function KN(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YN}function XN(e,n){const a={...n};for(const s in n){const o=e[s],c=n[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...f)=>{const p=c(...f);return o(...f),p}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function QN(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}const dp=qh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ht=b.forwardRef(({className:e,variant:n,size:a,asChild:s=!1,...o},c)=>{const u=s?VN:"button";return v.jsx(u,{className:qe(dp({variant:n,size:a,className:e})),ref:c,...o})});ht.displayName="Button";var $f="focusScope.autoFocusOnMount",Hf="focusScope.autoFocusOnUnmount",Ob={bubbles:!1,cancelable:!0},WN="FocusScope",xx=b.forwardRef((e,n)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=e,[f,p]=b.useState(null),m=An(o),y=An(c),g=b.useRef(null),x=Ze(n,E=>p(E)),S=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(s){let E=function(A){if(S.paused||!f)return;const k=A.target;f.contains(k)?g.current=k:ta(g.current,{select:!0})},T=function(A){if(S.paused||!f)return;const k=A.relatedTarget;k!==null&&(f.contains(k)||ta(g.current,{select:!0}))},R=function(A){if(document.activeElement===document.body)for(const I of A)I.removedNodes.length>0&&ta(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",T);const O=new MutationObserver(R);return f&&O.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),O.disconnect()}}},[s,f,S.paused]),b.useEffect(()=>{if(f){kb.add(S);const E=document.activeElement;if(!f.contains(E)){const R=new CustomEvent($f,Ob);f.addEventListener($f,m),f.dispatchEvent(R),R.defaultPrevented||(JN(rk(Sx(f)),{select:!0}),document.activeElement===E&&ta(f))}return()=>{f.removeEventListener($f,m),setTimeout(()=>{const R=new CustomEvent(Hf,Ob);f.addEventListener(Hf,y),f.dispatchEvent(R),R.defaultPrevented||ta(E??document.body,{select:!0}),f.removeEventListener(Hf,y),kb.remove(S)},0)}}},[f,m,y,S]);const _=b.useCallback(E=>{if(!a&&!s||S.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(T&&R){const O=E.currentTarget,[A,k]=ZN(O);A&&k?!E.shiftKey&&R===k?(E.preventDefault(),a&&ta(A,{select:!0})):E.shiftKey&&R===A&&(E.preventDefault(),a&&ta(k,{select:!0})):R===O&&E.preventDefault()}},[a,s,S.paused]);return v.jsx(Ie.div,{tabIndex:-1,...u,ref:x,onKeyDown:_})});xx.displayName=WN;function JN(e,{select:n=!1}={}){const a=document.activeElement;for(const s of e)if(ta(s,{select:n}),document.activeElement!==a)return}function ZN(e){const n=Sx(e),a=Nb(n,e),s=Nb(n.reverse(),e);return[a,s]}function Sx(e){const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)n.push(a.currentNode);return n}function Nb(e,n){for(const a of e)if(!ek(a,{upTo:n}))return a}function ek(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tk(e){return e instanceof HTMLInputElement&&"select"in e}function ta(e,{select:n=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&tk(e)&&n&&e.select()}}var kb=nk();function nk(){let e=[];return{add(n){const a=e[0];n!==a&&a?.pause(),e=jb(e,n),e.unshift(n)},remove(n){e=jb(e,n),e[0]?.resume()}}}function jb(e,n){const a=[...e],s=a.indexOf(n);return s!==-1&&a.splice(s,1),a}function rk(e){return e.filter(n=>n.tagName!=="A")}var qf=0;function ak(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Db()),document.body.insertAdjacentElement("beforeend",e[1]??Db()),qf++,()=>{qf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),qf--}},[])}function Db(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Bn=function(){return Bn=Object.assign||function(n){for(var a,s=1,o=arguments.length;s<o;s++){a=arguments[s];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(n[c]=a[c])}return n},Bn.apply(this,arguments)};function ni(e,n){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)n.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(a[s[o]]=e[s[o]]);return a}function sk(e,n,a,s){function o(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function f(y){try{m(s.next(y))}catch(g){u(g)}}function p(y){try{m(s.throw(y))}catch(g){u(g)}}function m(y){y.done?c(y.value):o(y.value).then(f,p)}m((s=s.apply(e,n||[])).next())})}function ik(e,n,a){if(a||arguments.length===2)for(var s=0,o=n.length,c;s<o;s++)(c||!(s in n))&&(c||(c=Array.prototype.slice.call(n,0,s)),c[s]=n[s]);return e.concat(c||Array.prototype.slice.call(n))}var Ec="right-scroll-bar-position",_c="width-before-scroll-bar",ok="with-scroll-bars-hidden",lk="--removed-body-scroll-bar-size";function Ff(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function ck(e,n){var a=b.useState(function(){return{value:e,callback:n,facade:{get current(){return a.value},set current(s){var o=a.value;o!==s&&(a.value=s,a.callback(s,o))}}}})[0];return a.callback=n,a.facade}var uk=typeof window<"u"?b.useLayoutEffect:b.useEffect,Mb=new WeakMap;function dk(e,n){var a=ck(null,function(s){return e.forEach(function(o){return Ff(o,s)})});return uk(function(){var s=Mb.get(a);if(s){var o=new Set(s),c=new Set(e),u=a.current;o.forEach(function(f){c.has(f)||Ff(f,null)}),c.forEach(function(f){o.has(f)||Ff(f,u)})}Mb.set(a,e)},[e]),a}function fk(e){return e}function hk(e,n){n===void 0&&(n=fk);var a=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(c){var u=n(c,s);return a.push(u),function(){a=a.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(s=!0;a.length;){var u=a;a=[],u.forEach(c)}a={push:function(f){return c(f)},filter:function(){return a}}},assignMedium:function(c){s=!0;var u=[];if(a.length){var f=a;a=[],f.forEach(c),u=a}var p=function(){var y=u;u=[],y.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),a={push:function(y){u.push(y),m()},filter:function(y){return u=u.filter(y),a}}}};return o}function pk(e){e===void 0&&(e={});var n=hk(null);return n.options=Bn({async:!0,ssr:!1},e),n}var Ex=function(e){var n=e.sideCar,a=ni(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return b.createElement(s,Bn({},a))};Ex.isSideCarExport=!0;function mk(e,n){return e.useMedium(n),Ex}var _x=pk(),Vf=function(){},ru=b.forwardRef(function(e,n){var a=b.useRef(null),s=b.useState({onScrollCapture:Vf,onWheelCapture:Vf,onTouchMoveCapture:Vf}),o=s[0],c=s[1],u=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,S=e.noRelative,_=e.noIsolation,E=e.inert,T=e.allowPinchZoom,R=e.as,O=R===void 0?"div":R,A=e.gapMode,k=ni(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=x,B=dk([a,n]),$=Bn(Bn({},k),o);return b.createElement(b.Fragment,null,y&&b.createElement(I,{sideCar:_x,removeScrollBar:m,shards:g,noRelative:S,noIsolation:_,inert:E,setCallbacks:c,allowPinchZoom:!!T,lockRef:a,gapMode:A}),u?b.cloneElement(b.Children.only(f),Bn(Bn({},$),{ref:B})):b.createElement(O,Bn({},$,{className:p,ref:B}),f))});ru.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ru.classNames={fullWidth:_c,zeroRight:Ec};var gk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=gk();return n&&e.setAttribute("nonce",n),e}function vk(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function bk(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var wk=function(){var e=0,n=null;return{add:function(a){e==0&&(n=yk())&&(vk(n,a),bk(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},xk=function(){var e=wk();return function(n,a){b.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&a])}},Tx=function(){var e=xk(),n=function(a){var s=a.styles,o=a.dynamic;return e(s,o),null};return n},Sk={left:0,top:0,right:0,gap:0},Gf=function(e){return parseInt(e||"",10)||0},Ek=function(e){var n=window.getComputedStyle(document.body),a=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],o=n[e==="padding"?"paddingRight":"marginRight"];return[Gf(a),Gf(s),Gf(o)]},_k=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Sk;var n=Ek(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-a+n[2]-n[0])}},Tk=Tx(),Vs="data-scroll-locked",Ck=function(e,n,a,s){var o=e.left,c=e.top,u=e.right,f=e.gap;return a===void 0&&(a="margin"),`
12
- .`.concat(ok,` {
13
- overflow: hidden `).concat(s,`;
14
- padding-right: `).concat(f,"px ").concat(s,`;
15
- }
16
- body[`).concat(Vs,`] {
17
- overflow: hidden `).concat(s,`;
18
- overscroll-behavior: contain;
19
- `).concat([n&&"position: relative ".concat(s,";"),a==="margin"&&`
20
- padding-left: `.concat(o,`px;
21
- padding-top: `).concat(c,`px;
22
- padding-right: `).concat(u,`px;
23
- margin-left:0;
24
- margin-top:0;
25
- margin-right: `).concat(f,"px ").concat(s,`;
26
- `),a==="padding"&&"padding-right: ".concat(f,"px ").concat(s,";")].filter(Boolean).join(""),`
27
- }
28
-
29
- .`).concat(Ec,` {
30
- right: `).concat(f,"px ").concat(s,`;
31
- }
32
-
33
- .`).concat(_c,` {
34
- margin-right: `).concat(f,"px ").concat(s,`;
35
- }
36
-
37
- .`).concat(Ec," .").concat(Ec,` {
38
- right: 0 `).concat(s,`;
39
- }
40
-
41
- .`).concat(_c," .").concat(_c,` {
42
- margin-right: 0 `).concat(s,`;
43
- }
44
-
45
- body[`).concat(Vs,`] {
46
- `).concat(lk,": ").concat(f,`px;
47
- }
48
- `)},Lb=function(){var e=parseInt(document.body.getAttribute(Vs)||"0",10);return isFinite(e)?e:0},Rk=function(){b.useEffect(function(){return document.body.setAttribute(Vs,(Lb()+1).toString()),function(){var e=Lb()-1;e<=0?document.body.removeAttribute(Vs):document.body.setAttribute(Vs,e.toString())}},[])},Ak=function(e){var n=e.noRelative,a=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;Rk();var c=b.useMemo(function(){return _k(o)},[o]);return b.createElement(Tk,{styles:Ck(c,!n,o,a?"":"!important")})},Sh=!1;if(typeof window<"u")try{var ic=Object.defineProperty({},"passive",{get:function(){return Sh=!0,!0}});window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{Sh=!1}var js=Sh?{passive:!1}:!1,Ok=function(e){return e.tagName==="TEXTAREA"},Cx=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!Ok(e)&&a[n]==="visible")},Nk=function(e){return Cx(e,"overflowY")},kk=function(e){return Cx(e,"overflowX")},Ub=function(e,n){var a=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Rx(e,s);if(o){var c=Ax(e,s),u=c[1],f=c[2];if(u>f)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},jk=function(e){var n=e.scrollTop,a=e.scrollHeight,s=e.clientHeight;return[n,a,s]},Dk=function(e){var n=e.scrollLeft,a=e.scrollWidth,s=e.clientWidth;return[n,a,s]},Rx=function(e,n){return e==="v"?Nk(n):kk(n)},Ax=function(e,n){return e==="v"?jk(n):Dk(n)},Mk=function(e,n){return e==="h"&&n==="rtl"?-1:1},Lk=function(e,n,a,s,o){var c=Mk(e,window.getComputedStyle(n).direction),u=c*s,f=a.target,p=n.contains(f),m=!1,y=u>0,g=0,x=0;do{if(!f)break;var S=Ax(e,f),_=S[0],E=S[1],T=S[2],R=E-T-c*_;(_||R)&&Rx(e,f)&&(g+=R,x+=_);var O=f.parentNode;f=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!p&&f!==document.body||p&&(n.contains(f)||n===f));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(m=!0),m},oc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pb=function(e){return[e.deltaX,e.deltaY]},zb=function(e){return e&&"current"in e?e.current:e},Uk=function(e,n){return e[0]===n[0]&&e[1]===n[1]},Pk=function(e){return`
49
- .block-interactivity-`.concat(e,` {pointer-events: none;}
50
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
51
- `)},zk=0,Ds=[];function Ik(e){var n=b.useRef([]),a=b.useRef([0,0]),s=b.useRef(),o=b.useState(zk++)[0],c=b.useState(Tx)[0],u=b.useRef(e);b.useEffect(function(){u.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=ik([e.lockRef.current],(e.shards||[]).map(zb),!0).filter(Boolean);return E.forEach(function(T){return T.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(E,T){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var R=oc(E),O=a.current,A="deltaX"in E?E.deltaX:O[0]-R[0],k="deltaY"in E?E.deltaY:O[1]-R[1],I,B=E.target,$=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in E&&$==="h"&&B.type==="range")return!1;var q=window.getSelection(),ne=q&&q.anchorNode,de=ne?ne===B||ne.contains(B):!1;if(de)return!1;var he=Ub($,B);if(!he)return!0;if(he?I=$:(I=$==="v"?"h":"v",he=Ub($,B)),!he)return!1;if(!s.current&&"changedTouches"in E&&(A||k)&&(s.current=I),!I)return!0;var le=s.current||I;return Lk(le,T,E,le==="h"?A:k)},[]),p=b.useCallback(function(E){var T=E;if(!(!Ds.length||Ds[Ds.length-1]!==c)){var R="deltaY"in T?Pb(T):oc(T),O=n.current.filter(function(I){return I.name===T.type&&(I.target===T.target||T.target===I.shadowParent)&&Uk(I.delta,R)})[0];if(O&&O.should){T.cancelable&&T.preventDefault();return}if(!O){var A=(u.current.shards||[]).map(zb).filter(Boolean).filter(function(I){return I.contains(T.target)}),k=A.length>0?f(T,A[0]):!u.current.noIsolation;k&&T.cancelable&&T.preventDefault()}}},[]),m=b.useCallback(function(E,T,R,O){var A={name:E,delta:T,target:R,should:O,shadowParent:Bk(R)};n.current.push(A),setTimeout(function(){n.current=n.current.filter(function(k){return k!==A})},1)},[]),y=b.useCallback(function(E){a.current=oc(E),s.current=void 0},[]),g=b.useCallback(function(E){m(E.type,Pb(E),E.target,f(E,e.lockRef.current))},[]),x=b.useCallback(function(E){m(E.type,oc(E),E.target,f(E,e.lockRef.current))},[]);b.useEffect(function(){return Ds.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",p,js),document.addEventListener("touchmove",p,js),document.addEventListener("touchstart",y,js),function(){Ds=Ds.filter(function(E){return E!==c}),document.removeEventListener("wheel",p,js),document.removeEventListener("touchmove",p,js),document.removeEventListener("touchstart",y,js)}},[]);var S=e.removeScrollBar,_=e.inert;return b.createElement(b.Fragment,null,_?b.createElement(c,{styles:Pk(o)}):null,S?b.createElement(Ak,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bk(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const $k=mk(_x,Ik);var Ox=b.forwardRef(function(e,n){return b.createElement(ru,Bn({},e,{ref:n,sideCar:$k}))});Ox.classNames=ru.classNames;var Hk=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ms=new WeakMap,lc=new WeakMap,cc={},Yf=0,Nx=function(e){return e&&(e.host||Nx(e.parentNode))},qk=function(e,n){return n.map(function(a){if(e.contains(a))return a;var s=Nx(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},Fk=function(e,n,a,s){var o=qk(n,Array.isArray(e)?e:[e]);cc[a]||(cc[a]=new WeakMap);var c=cc[a],u=[],f=new Set,p=new Set(o),m=function(g){!g||f.has(g)||(f.add(g),m(g.parentNode))};o.forEach(m);var y=function(g){!g||p.has(g)||Array.prototype.forEach.call(g.children,function(x){if(f.has(x))y(x);else try{var S=x.getAttribute(s),_=S!==null&&S!=="false",E=(Ms.get(x)||0)+1,T=(c.get(x)||0)+1;Ms.set(x,E),c.set(x,T),u.push(x),E===1&&_&&lc.set(x,!0),T===1&&x.setAttribute(a,"true"),_||x.setAttribute(s,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return y(n),f.clear(),Yf++,function(){u.forEach(function(g){var x=Ms.get(g)-1,S=c.get(g)-1;Ms.set(g,x),c.set(g,S),x||(lc.has(g)||g.removeAttribute(s),lc.delete(g)),S||g.removeAttribute(a)}),Yf--,Yf||(Ms=new WeakMap,Ms=new WeakMap,lc=new WeakMap,cc={})}},Vk=function(e,n,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=Hk(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),Fk(s,o,a,"aria-hidden")):function(){return null}};function Gk(e){const n=Yk(e),a=b.forwardRef((s,o)=>{const{children:c,...u}=s,f=b.Children.toArray(c),p=f.find(Xk);if(p){const m=p.props.children,y=f.map(g=>g===p?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:g);return v.jsx(n,{...u,ref:o,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return v.jsx(n,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function Yk(e){const n=b.forwardRef((a,s)=>{const{children:o,...c}=a;if(b.isValidElement(o)){const u=Wk(o),f=Qk(c,o.props);return o.type!==b.Fragment&&(f.ref=s?Oo(s,u):u),b.cloneElement(o,f)}return b.Children.count(o)>1?b.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Kk=Symbol("radix.slottable");function Xk(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kk}function Qk(e,n){const a={...n};for(const s in n){const o=e[s],c=n[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...f)=>{const p=c(...f);return o(...f),p}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function Wk(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var au="Dialog",[kx,jx]=kn(au),[Jk,jn]=kx(au),Dx=e=>{const{__scopeDialog:n,children:a,open:s,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,f=b.useRef(null),p=b.useRef(null),[m,y]=Ws({prop:s,defaultProp:o??!1,onChange:c,caller:au});return v.jsx(Jk,{scope:n,triggerRef:f,contentRef:p,contentId:ho(),titleId:ho(),descriptionId:ho(),open:m,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(g=>!g),[y]),modal:u,children:a})};Dx.displayName=au;var Mx="DialogTrigger",Lx=b.forwardRef((e,n)=>{const{__scopeDialog:a,...s}=e,o=jn(Mx,a),c=Ze(n,o.triggerRef);return v.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pp(o.open),...s,ref:c,onClick:je(e.onClick,o.onOpenToggle)})});Lx.displayName=Mx;var fp="DialogPortal",[Zk,Ux]=kx(fp,{forceMount:void 0}),Px=e=>{const{__scopeDialog:n,forceMount:a,children:s,container:o}=e,c=jn(fp,n);return v.jsx(Zk,{scope:n,forceMount:a,children:b.Children.map(s,u=>v.jsx(xr,{present:a||c.open,children:v.jsx(Ih,{asChild:!0,container:o,children:u})}))})};Px.displayName=fp;var Mc="DialogOverlay",zx=b.forwardRef((e,n)=>{const a=Ux(Mc,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=jn(Mc,e.__scopeDialog);return c.modal?v.jsx(xr,{present:s||c.open,children:v.jsx(tj,{...o,ref:n})}):null});zx.displayName=Mc;var ej=Gk("DialogOverlay.RemoveScroll"),tj=b.forwardRef((e,n)=>{const{__scopeDialog:a,...s}=e,o=jn(Mc,a);return v.jsx(Ox,{as:ej,allowPinchZoom:!0,shards:[o.contentRef],children:v.jsx(Ie.div,{"data-state":pp(o.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),$a="DialogContent",Ix=b.forwardRef((e,n)=>{const a=Ux($a,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=jn($a,e.__scopeDialog);return v.jsx(xr,{present:s||c.open,children:c.modal?v.jsx(nj,{...o,ref:n}):v.jsx(rj,{...o,ref:n})})});Ix.displayName=$a;var nj=b.forwardRef((e,n)=>{const a=jn($a,e.__scopeDialog),s=b.useRef(null),o=Ze(n,a.contentRef,s);return b.useEffect(()=>{const c=s.current;if(c)return Vk(c)},[]),v.jsx(Bx,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,c=>{c.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:je(e.onFocusOutside,c=>c.preventDefault())})}),rj=b.forwardRef((e,n)=>{const a=jn($a,e.__scopeDialog),s=b.useRef(!1),o=b.useRef(!1);return v.jsx(Bx,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(s.current||a.triggerRef.current?.focus(),c.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=c.target;a.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),Bx=b.forwardRef((e,n)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:c,...u}=e,f=jn($a,a),p=b.useRef(null),m=Ze(n,p);return ak(),v.jsxs(v.Fragment,{children:[v.jsx(xx,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:c,children:v.jsx(Fc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":pp(f.open),...u,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(sj,{titleId:f.titleId}),v.jsx(oj,{contentRef:p,descriptionId:f.descriptionId})]})]})}),hp="DialogTitle",$x=b.forwardRef((e,n)=>{const{__scopeDialog:a,...s}=e,o=jn(hp,a);return v.jsx(Ie.h2,{id:o.titleId,...s,ref:n})});$x.displayName=hp;var Hx="DialogDescription",qx=b.forwardRef((e,n)=>{const{__scopeDialog:a,...s}=e,o=jn(Hx,a);return v.jsx(Ie.p,{id:o.descriptionId,...s,ref:n})});qx.displayName=Hx;var Fx="DialogClose",Vx=b.forwardRef((e,n)=>{const{__scopeDialog:a,...s}=e,o=jn(Fx,a);return v.jsx(Ie.button,{type:"button",...s,ref:n,onClick:je(e.onClick,()=>o.onOpenChange(!1))})});Vx.displayName=Fx;function pp(e){return e?"open":"closed"}var Gx="DialogTitleWarning",[aj,Yx]=G1(Gx,{contentName:$a,titleName:hp,docsSlug:"dialog"}),sj=({titleId:e})=>{const n=Yx(Gx),a=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
52
-
53
- If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
54
-
55
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},ij="DialogDescriptionWarning",oj=({contentRef:e,descriptionId:n})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yx(ij).contentName}}.`;return b.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");n&&o&&(document.getElementById(n)||console.warn(s))},[s,e,n]),null},Kx=Dx,lj=Lx,Xx=Px,mp=zx,gp=Ix,yp=$x,vp=qx,bp=Vx;const Eh=Kx,cj=Xx,Qx=b.forwardRef(({className:e,...n},a)=>v.jsx(mp,{ref:a,className:qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));Qx.displayName=mp.displayName;const Lc=b.forwardRef(({className:e,children:n,...a},s)=>v.jsxs(cj,{children:[v.jsx(Qx,{}),v.jsxs(gp,{ref:s,className:qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-zinc-800 bg-zinc-950 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl",e),...a,children:[n,v.jsxs(bp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(Vh,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Lc.displayName=gp.displayName;const Uc=({className:e,...n})=>v.jsx("div",{className:qe("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Uc.displayName="DialogHeader";const Pc=({className:e,...n})=>v.jsx("div",{className:qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Pc.displayName="DialogFooter";const zc=b.forwardRef(({className:e,...n},a)=>v.jsx(yp,{ref:a,className:qe("text-lg font-semibold leading-none tracking-tight",e),...n}));zc.displayName=yp.displayName;const Ic=b.forwardRef(({className:e,...n},a)=>v.jsx(vp,{ref:a,className:qe("text-sm text-muted-foreground",e),...n}));Ic.displayName=vp.displayName;var uj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dj=uj.reduce((e,n)=>{const a=wx(`Primitive.${n}`),s=b.forwardRef((o,c)=>{const{asChild:u,...f}=o,p=u?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(p,{...f,ref:c})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{}),fj="Label",Wx=b.forwardRef((e,n)=>v.jsx(dj.label,{...e,ref:n,onMouseDown:a=>{a.target.closest("button, input, select, textarea")||(e.onMouseDown?.(a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));Wx.displayName=fj;var Jx=Wx;const hj=qh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...n},a)=>v.jsx(Jx,{ref:a,className:qe(hj(),e),...n}));xt.displayName=Jx.displayName;const po=b.forwardRef(({className:e,type:n,...a},s)=>v.jsx("input",{type:n,className:qe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...a}));po.displayName="Input";const su=b.forwardRef(({className:e,...n},a)=>v.jsx("textarea",{className:qe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));su.displayName="Textarea";function Zx(e){const n=b.useRef({value:e,previous:e});return b.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var iu="Checkbox",[pj]=kn(iu),[mj,wp]=pj(iu);function gj(e){const{__scopeCheckbox:n,checked:a,children:s,defaultChecked:o,disabled:c,form:u,name:f,onCheckedChange:p,required:m,value:y="on",internal_do_not_use_render:g}=e,[x,S]=Ws({prop:a,defaultProp:o??!1,onChange:p,caller:iu}),[_,E]=b.useState(null),[T,R]=b.useState(null),O=b.useRef(!1),A=_?!!u||!!_.closest("form"):!0,k={checked:x,disabled:c,setChecked:S,control:_,setControl:E,name:f,form:u,value:y,hasConsumerStoppedPropagationRef:O,required:m,defaultChecked:aa(o)?!1:o,isFormControl:A,bubbleInput:T,setBubbleInput:R};return v.jsx(mj,{scope:n,...k,children:yj(g)?g(k):s})}var eS="CheckboxTrigger",tS=b.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:a,...s},o)=>{const{control:c,value:u,disabled:f,checked:p,required:m,setControl:y,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:S,bubbleInput:_}=wp(eS,e),E=Ze(o,y),T=b.useRef(p);return b.useEffect(()=>{const R=c?.form;if(R){const O=()=>g(T.current);return R.addEventListener("reset",O),()=>R.removeEventListener("reset",O)}},[c,g]),v.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":aa(p)?"mixed":p,"aria-required":m,"data-state":iS(p),"data-disabled":f?"":void 0,disabled:f,value:u,...s,ref:E,onKeyDown:je(n,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:je(a,R=>{g(O=>aa(O)?!0:!O),_&&S&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});tS.displayName=eS;var xp=b.forwardRef((e,n)=>{const{__scopeCheckbox:a,name:s,checked:o,defaultChecked:c,required:u,disabled:f,value:p,onCheckedChange:m,form:y,...g}=e;return v.jsx(gj,{__scopeCheckbox:a,checked:o,defaultChecked:c,disabled:f,required:u,onCheckedChange:m,name:s,form:y,value:p,internal_do_not_use_render:({isFormControl:x})=>v.jsxs(v.Fragment,{children:[v.jsx(tS,{...g,ref:n,__scopeCheckbox:a}),x&&v.jsx(sS,{__scopeCheckbox:a})]})})});xp.displayName=iu;var nS="CheckboxIndicator",rS=b.forwardRef((e,n)=>{const{__scopeCheckbox:a,forceMount:s,...o}=e,c=wp(nS,a);return v.jsx(xr,{present:s||aa(c.checked)||c.checked===!0,children:v.jsx(Ie.span,{"data-state":iS(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:n,style:{pointerEvents:"none",...e.style}})})});rS.displayName=nS;var aS="CheckboxBubbleInput",sS=b.forwardRef(({__scopeCheckbox:e,...n},a)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:c,defaultChecked:u,required:f,disabled:p,name:m,value:y,form:g,bubbleInput:x,setBubbleInput:S}=wp(aS,e),_=Ze(a,S),E=Zx(c),T=ep(s);b.useEffect(()=>{const O=x;if(!O)return;const A=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(A,"checked").set,B=!o.current;if(E!==c&&I){const $=new Event("click",{bubbles:B});O.indeterminate=aa(c),I.call(O,aa(c)?!1:c),O.dispatchEvent($)}},[x,E,c,o]);const R=b.useRef(aa(c)?!1:c);return v.jsx(Ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??R.current,required:f,disabled:p,name:m,value:y,form:g,...n,tabIndex:-1,ref:_,style:{...n.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});sS.displayName=aS;function yj(e){return typeof e=="function"}function aa(e){return e==="indeterminate"}function iS(e){return aa(e)?"indeterminate":e?"checked":"unchecked"}const Sp=b.forwardRef(({className:e,...n},a)=>v.jsx(xp,{ref:a,className:qe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...n,children:v.jsx(rS,{className:qe("flex items-center justify-center text-current"),children:v.jsx(ZT,{className:"h-4 w-4"})})}));Sp.displayName=xp.displayName;const vj=e=>e?(...n)=>e(...n):(...n)=>fetch(...n);class Ep extends Error{constructor(n,a="FunctionsError",s){super(n),this.name=a,this.context=s}}class bj extends Ep{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class Ib extends Ep{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class Bb extends Ep{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var _h;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(_h||(_h={}));class wj{constructor(n,{headers:a={},customFetch:s,region:o=_h.Any}={}){this.url=n,this.headers=a,this.region=o,this.fetch=vj(s)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return sk(this,arguments,void 0,function*(a,s={}){var o;let c,u;try{const{headers:f,method:p,body:m,signal:y,timeout:g}=s;let x={},{region:S}=s;S||(S=this.region);const _=new URL(`${this.url}/${a}`);S&&S!=="any"&&(x["x-region"]=S,_.searchParams.set("forceFunctionRegion",S));let E;m&&(f&&!Object.prototype.hasOwnProperty.call(f,"Content-Type")||!f)?typeof Blob<"u"&&m instanceof Blob||m instanceof ArrayBuffer?(x["Content-Type"]="application/octet-stream",E=m):typeof m=="string"?(x["Content-Type"]="text/plain",E=m):typeof FormData<"u"&&m instanceof FormData?E=m:(x["Content-Type"]="application/json",E=JSON.stringify(m)):m&&typeof m!="string"&&!(typeof Blob<"u"&&m instanceof Blob)&&!(m instanceof ArrayBuffer)&&!(typeof FormData<"u"&&m instanceof FormData)?E=JSON.stringify(m):E=m;let T=y;g&&(u=new AbortController,c=setTimeout(()=>u.abort(),g),y?(T=u.signal,y.addEventListener("abort",()=>u.abort())):T=u.signal);const R=yield this.fetch(_.toString(),{method:p||"POST",headers:Object.assign(Object.assign(Object.assign({},x),this.headers),f),body:E,signal:T}).catch(I=>{throw new bj(I)}),O=R.headers.get("x-relay-error");if(O&&O==="true")throw new Ib(R);if(!R.ok)throw new Bb(R);let A=((o=R.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),k;return A==="application/json"?k=yield R.json():A==="application/octet-stream"||A==="application/pdf"?k=yield R.blob():A==="text/event-stream"?k=R:A==="multipart/form-data"?k=yield R.formData():k=yield R.text(),{data:k,error:null,response:R}}catch(f){return{data:null,error:f,response:f instanceof Bb||f instanceof Ib?f.context:void 0}}finally{c&&clearTimeout(c)}})}}var xj=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},Sj=class{constructor(e){var n,a,s;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(n=e.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=e.signal,this.isMaybeSingle=(a=e.isMaybeSingle)!==null&&a!==void 0?a:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,n){return this.headers=new Headers(this.headers),this.headers.set(e,n),this}then(e,n){var a=this;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");const s=this.fetch;let o=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{let u=null,f=null,p=null,m=c.status,y=c.statusText;if(c.ok){var g,x;if(a.method!=="HEAD"){var S;const R=await c.text();R===""||(a.headers.get("Accept")==="text/csv"||a.headers.get("Accept")&&(!((S=a.headers.get("Accept"))===null||S===void 0)&&S.includes("application/vnd.pgrst.plan+text"))?f=R:f=JSON.parse(R))}const E=(g=a.headers.get("Prefer"))===null||g===void 0?void 0:g.match(/count=(exact|planned|estimated)/),T=(x=c.headers.get("content-range"))===null||x===void 0?void 0:x.split("/");E&&T&&T.length>1&&(p=parseInt(T[1])),a.isMaybeSingle&&a.method==="GET"&&Array.isArray(f)&&(f.length>1?(u={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,p=null,m=406,y="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{var _;const E=await c.text();try{u=JSON.parse(E),Array.isArray(u)&&c.status===404&&(f=[],u=null,m=200,y="OK")}catch{c.status===404&&E===""?(m=204,y="No Content"):u={message:E}}if(u&&a.isMaybeSingle&&(!(u==null||(_=u.details)===null||_===void 0)&&_.includes("0 rows"))&&(u=null,m=200,y="OK"),u&&a.shouldThrowOnError)throw new xj(u)}return{error:u,data:f,count:p,status:m,statusText:y}});return this.shouldThrowOnError||(o=o.catch(c=>{var u;let f="",p="",m="";const y=c?.cause;if(y){var g,x,S,_;const R=(g=y?.message)!==null&&g!==void 0?g:"",O=(x=y?.code)!==null&&x!==void 0?x:"";f=`${(S=c?.name)!==null&&S!==void 0?S:"FetchError"}: ${c?.message}`,f+=`
56
-
57
- Caused by: ${(_=y?.name)!==null&&_!==void 0?_:"Error"}: ${R}`,O&&(f+=` (${O})`),y?.stack&&(f+=`
58
- ${y.stack}`)}else{var E;f=(E=c?.stack)!==null&&E!==void 0?E:""}const T=this.url.toString().length;return c?.name==="AbortError"||c?.code==="ABORT_ERR"?(m="",p="Request was aborted (timeout or manual cancellation)",T>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${T} 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.`)):(y?.name==="HeadersOverflowError"||y?.code==="UND_ERR_HEADERS_OVERFLOW")&&(m="",p="HTTP headers exceeded server limits (typically 16KB)",T>this.urlLengthLimit&&(p+=`. Your request URL is ${T} 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.`)),{error:{message:`${(u=c?.name)!==null&&u!==void 0?u:"FetchError"}: ${c?.message}`,details:f,hint:p,code:m},data:null,count:null,status:0,statusText:""}})),o.then(e,n)}returns(){return this}overrideTypes(){return this}},Ej=class extends Sj{select(e){let n=!1;const a=(e??"*").split("").map(s=>/\s/.test(s)&&!n?"":(s==='"'&&(n=!n),s)).join("");return this.url.searchParams.set("select",a),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:n=!0,nullsFirst:a,foreignTable:s,referencedTable:o=s}={}){const c=o?`${o}.order`:"order",u=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${u?`${u},`:""}${e}.${n?"asc":"desc"}${a===void 0?"":a?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:n,referencedTable:a=n}={}){const s=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,n,{foreignTable:a,referencedTable:s=a}={}){const o=typeof s>"u"?"offset":`${s}.offset`,c=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(c,`${n-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:n=!1,settings:a=!1,buffers:s=!1,wal:o=!1,format:c="text"}={}){var u;const f=[e?"analyze":null,n?"verbose":null,a?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),p=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${p}"; options=${f};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const $b=new RegExp("[,()]");var Bs=class extends Ej{eq(e,n){return this.url.searchParams.append(e,`eq.${n}`),this}neq(e,n){return this.url.searchParams.append(e,`neq.${n}`),this}gt(e,n){return this.url.searchParams.append(e,`gt.${n}`),this}gte(e,n){return this.url.searchParams.append(e,`gte.${n}`),this}lt(e,n){return this.url.searchParams.append(e,`lt.${n}`),this}lte(e,n){return this.url.searchParams.append(e,`lte.${n}`),this}like(e,n){return this.url.searchParams.append(e,`like.${n}`),this}likeAllOf(e,n){return this.url.searchParams.append(e,`like(all).{${n.join(",")}}`),this}likeAnyOf(e,n){return this.url.searchParams.append(e,`like(any).{${n.join(",")}}`),this}ilike(e,n){return this.url.searchParams.append(e,`ilike.${n}`),this}ilikeAllOf(e,n){return this.url.searchParams.append(e,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(e,n){return this.url.searchParams.append(e,`ilike(any).{${n.join(",")}}`),this}regexMatch(e,n){return this.url.searchParams.append(e,`match.${n}`),this}regexIMatch(e,n){return this.url.searchParams.append(e,`imatch.${n}`),this}is(e,n){return this.url.searchParams.append(e,`is.${n}`),this}isDistinct(e,n){return this.url.searchParams.append(e,`isdistinct.${n}`),this}in(e,n){const a=Array.from(new Set(n)).map(s=>typeof s=="string"&&$b.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${a})`),this}notIn(e,n){const a=Array.from(new Set(n)).map(s=>typeof s=="string"&&$b.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${a})`),this}contains(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cs.{${n.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(n)}`),this}containedBy(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cd.{${n.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(n)}`),this}rangeGt(e,n){return this.url.searchParams.append(e,`sr.${n}`),this}rangeGte(e,n){return this.url.searchParams.append(e,`nxl.${n}`),this}rangeLt(e,n){return this.url.searchParams.append(e,`sl.${n}`),this}rangeLte(e,n){return this.url.searchParams.append(e,`nxr.${n}`),this}rangeAdjacent(e,n){return this.url.searchParams.append(e,`adj.${n}`),this}overlaps(e,n){return typeof n=="string"?this.url.searchParams.append(e,`ov.${n}`):this.url.searchParams.append(e,`ov.{${n.join(",")}}`),this}textSearch(e,n,{config:a,type:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const c=a===void 0?"":`(${a})`;return this.url.searchParams.append(e,`${o}fts${c}.${n}`),this}match(e){return Object.entries(e).forEach(([n,a])=>{this.url.searchParams.append(n,`eq.${a}`)}),this}not(e,n,a){return this.url.searchParams.append(e,`not.${n}.${a}`),this}or(e,{foreignTable:n,referencedTable:a=n}={}){const s=a?`${a}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,n,a){return this.url.searchParams.append(e,`${n}.${a}`),this}},_j=class{constructor(e,{headers:n={},schema:a,fetch:s,urlLengthLimit:o=8e3}){this.url=e,this.headers=new Headers(n),this.schema=a,this.fetch=s,this.urlLengthLimit=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,n){const{head:a=!1,count:s}=n??{},o=a?"HEAD":"GET";let c=!1;const u=(e??"*").split("").map(m=>/\s/.test(m)&&!c?"":(m==='"'&&(c=!c),m)).join(""),{url:f,headers:p}=this.cloneRequestState();return f.searchParams.set("select",u),s&&p.append("Prefer",`count=${s}`),new Bs({method:o,url:f,headers:p,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:n,defaultToNull:a=!0}={}){var s;const o="POST",{url:c,headers:u}=this.cloneRequestState();if(n&&u.append("Prefer",`count=${n}`),a||u.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((p,m)=>p.concat(Object.keys(m)),[]);if(f.length>0){const p=[...new Set(f)].map(m=>`"${m}"`);c.searchParams.set("columns",p.join(","))}}return new Bs({method:o,url:c,headers:u,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:n,ignoreDuplicates:a=!1,count:s,defaultToNull:o=!0}={}){var c;const u="POST",{url:f,headers:p}=this.cloneRequestState();if(p.append("Prefer",`resolution=${a?"ignore":"merge"}-duplicates`),n!==void 0&&f.searchParams.set("on_conflict",n),s&&p.append("Prefer",`count=${s}`),o||p.append("Prefer","missing=default"),Array.isArray(e)){const m=e.reduce((y,g)=>y.concat(Object.keys(g)),[]);if(m.length>0){const y=[...new Set(m)].map(g=>`"${g}"`);f.searchParams.set("columns",y.join(","))}}return new Bs({method:u,url:f,headers:p,schema:this.schema,body:e,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:n}={}){var a;const s="PATCH",{url:o,headers:c}=this.cloneRequestState();return n&&c.append("Prefer",`count=${n}`),new Bs({method:s,url:o,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var n;const a="DELETE",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Bs({method:a,url:s,headers:o,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}};function xo(e){"@babel/helpers - typeof";return xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xo(e)}function Tj(e,n){if(xo(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,n);if(xo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Cj(e){var n=Tj(e,"string");return xo(n)=="symbol"?n:n+""}function Rj(e,n,a){return(n=Cj(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Hb(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function uc(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Hb(Object(a),!0).forEach(function(s){Rj(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Hb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var Aj=class oS{constructor(n,{headers:a={},schema:s,fetch:o,timeout:c,urlLengthLimit:u=8e3}={}){this.url=n,this.headers=new Headers(a),this.schemaName=s,this.urlLengthLimit=u;const f=o??globalThis.fetch;c!==void 0&&c>0?this.fetch=(p,m)=>{const y=new AbortController,g=setTimeout(()=>y.abort(),c),x=m?.signal;if(x){if(x.aborted)return clearTimeout(g),f(p,m);const S=()=>{clearTimeout(g),y.abort()};return x.addEventListener("abort",S,{once:!0}),f(p,uc(uc({},m),{},{signal:y.signal})).finally(()=>{clearTimeout(g),x.removeEventListener("abort",S)})}return f(p,uc(uc({},m),{},{signal:y.signal})).finally(()=>clearTimeout(g))}:this.fetch=f}from(n){if(!n||typeof n!="string"||n.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new _j(new URL(`${this.url}/${n}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(n){return new oS(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(n,a={},{head:s=!1,get:o=!1,count:c}={}){var u;let f;const p=new URL(`${this.url}/rpc/${n}`);let m;const y=S=>S!==null&&typeof S=="object"&&(!Array.isArray(S)||S.some(y)),g=s&&Object.values(a).some(y);g?(f="POST",m=a):s||o?(f=s?"HEAD":"GET",Object.entries(a).filter(([S,_])=>_!==void 0).map(([S,_])=>[S,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([S,_])=>{p.searchParams.append(S,_)})):(f="POST",m=a);const x=new Headers(this.headers);return g?x.set("Prefer",c?`count=${c},return=minimal`:"return=minimal"):c&&x.set("Prefer",`count=${c}`),new Bs({method:f,url:p,headers:x,schema:this.schemaName,body:m,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit})}};class Oj{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((n=navigator.userAgent)===null||n===void 0)&&n.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 a=globalThis.process;if(a){const s=a.versions;if(s&&s.node){const o=s.node,c=parseInt(o.replace(/^v/,"").split(".")[0]);return c>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${c} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${c} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
59
- import ws from "ws"
60
- 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 n=this.detectEnvironment();if(n.constructor)return n.constructor;let a=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(a+=`
61
-
62
- Suggested solution: ${n.workaround}`),new Error(a)}static createWebSocket(n,a){const s=this.getWebSocketConstructor();return new s(n,a)}static isWebSocketSupported(){try{const n=this.detectEnvironment();return n.type==="native"||n.type==="ws"}catch{return!1}}}const Nj="2.98.0",kj=`realtime-js/${Nj}`,jj="1.0.0",lS="2.0.0",qb=lS,Th=1e4,Dj=1e3,Mj=100;var na;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(na||(na={}));var gt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(gt||(gt={}));var Rn;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Rn||(Rn={}));var Ch;(function(e){e.websocket="websocket"})(Ch||(Ch={}));var Ua;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Ua||(Ua={}));class Lj{constructor(n){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=n??[]}encode(n,a){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return a(this._binaryEncodeUserBroadcastPush(n));let s=[n.join_ref,n.ref,n.topic,n.event,n.payload];return a(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(n){var a;return this._isArrayBuffer((a=n.payload)===null||a===void 0?void 0:a.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var a,s;const o=(s=(a=n.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(n){var a,s;const o=(s=(a=n.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:{},u=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,u)}_encodeUserBroadcastPush(n,a,s){var o,c;const u=n.topic,f=(o=n.ref)!==null&&o!==void 0?o:"",p=(c=n.join_ref)!==null&&c!==void 0?c:"",m=n.payload.event,y=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},g=Object.keys(y).length===0?"":JSON.stringify(y);if(p.length>255)throw new Error(`joinRef length ${p.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`ref length ${f.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`topic length ${u.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`userEvent length ${m.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const x=this.USER_BROADCAST_PUSH_META_LENGTH+p.length+f.length+u.length+m.length+g.length,S=new ArrayBuffer(this.HEADER_LENGTH+x);let _=new DataView(S),E=0;_.setUint8(E++,this.KINDS.userBroadcastPush),_.setUint8(E++,p.length),_.setUint8(E++,f.length),_.setUint8(E++,u.length),_.setUint8(E++,m.length),_.setUint8(E++,g.length),_.setUint8(E++,a),Array.from(p,R=>_.setUint8(E++,R.charCodeAt(0))),Array.from(f,R=>_.setUint8(E++,R.charCodeAt(0))),Array.from(u,R=>_.setUint8(E++,R.charCodeAt(0))),Array.from(m,R=>_.setUint8(E++,R.charCodeAt(0))),Array.from(g,R=>_.setUint8(E++,R.charCodeAt(0)));var T=new Uint8Array(S.byteLength+s.byteLength);return T.set(new Uint8Array(S),0),T.set(new Uint8Array(s),S.byteLength),T.buffer}decode(n,a){if(this._isArrayBuffer(n)){let s=this._binaryDecode(n);return a(s)}if(typeof n=="string"){const s=JSON.parse(n),[o,c,u,f,p]=s;return a({join_ref:o,ref:c,topic:u,event:f,payload:p})}return a({})}_binaryDecode(n){const a=new DataView(n),s=a.getUint8(0),o=new TextDecoder;if(s===this.KINDS.userBroadcast)return this._decodeUserBroadcast(n,a,o)}_decodeUserBroadcast(n,a,s){const o=a.getUint8(1),c=a.getUint8(2),u=a.getUint8(3),f=a.getUint8(4);let p=this.HEADER_LENGTH+4;const m=s.decode(n.slice(p,p+o));p=p+o;const y=s.decode(n.slice(p,p+c));p=p+c;const g=s.decode(n.slice(p,p+u));p=p+u;const x=n.slice(p,n.byteLength),S=f===this.JSON_ENCODING?JSON.parse(s.decode(x)):x,_={type:this.BROADCAST_EVENT,event:y,payload:S};return u>0&&(_.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:m,event:this.BROADCAST_EVENT,payload:_}}_isArrayBuffer(n){var a;return n instanceof ArrayBuffer||((a=n?.constructor)===null||a===void 0?void 0:a.name)==="ArrayBuffer"}_pick(n,a){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([s])=>a.includes(s)))}}class cS{constructor(n,a){this.callback=n,this.timerCalc=a,this.timer=void 0,this.tries=0,this.callback=n,this.timerCalc=a}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ke;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Ke||(Ke={}));const Fb=(e,n,a={})=>{var s;const o=(s=a.skipTypes)!==null&&s!==void 0?s:[];return n?Object.keys(n).reduce((c,u)=>(c[u]=Uj(u,e,n,o),c),{}):{}},Uj=(e,n,a,s)=>{const o=n.find(f=>f.name===e),c=o?.type,u=a[e];return c&&!s.includes(c)?uS(c,u):Rh(u)},uS=(e,n)=>{if(e.charAt(0)==="_"){const a=e.slice(1,e.length);return Bj(n,a)}switch(e){case Ke.bool:return Pj(n);case Ke.float4:case Ke.float8:case Ke.int2:case Ke.int4:case Ke.int8:case Ke.numeric:case Ke.oid:return zj(n);case Ke.json:case Ke.jsonb:return Ij(n);case Ke.timestamp:return $j(n);case Ke.abstime:case Ke.date:case Ke.daterange:case Ke.int4range:case Ke.int8range:case Ke.money:case Ke.reltime:case Ke.text:case Ke.time:case Ke.timestamptz:case Ke.timetz:case Ke.tsrange:case Ke.tstzrange:return Rh(n);default:return Rh(n)}},Rh=e=>e,Pj=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},zj=e=>{if(typeof e=="string"){const n=parseFloat(e);if(!Number.isNaN(n))return n}return e},Ij=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Bj=(e,n)=>{if(typeof e!="string")return e;const a=e.length-1,s=e[a];if(e[0]==="{"&&s==="}"){let c;const u=e.slice(1,a);try{c=JSON.parse("["+u+"]")}catch{c=u?u.split(","):[]}return c.map(f=>uS(n,f))}return e},$j=e=>typeof e=="string"?e.replace(" ","T"):e,dS=e=>{const n=new URL(e);return n.protocol=n.protocol.replace(/^ws/i,"http"),n.pathname=n.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),n.pathname===""||n.pathname==="/"?n.pathname="/api/broadcast":n.pathname=n.pathname+"/api/broadcast",n.href};class Kf{constructor(n,a,s={},o=Th){this.channel=n,this.event=a,this.payload=s,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(n){this.timeout=n,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(n){this.payload=Object.assign(Object.assign({},this.payload),n)}receive(n,a){var s;return this._hasReceived(n)&&a((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:n,callback:a}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const n=a=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=a,this._matchReceive(a)};this.channel._on(this.refEvent,{},n),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(n,a){this.refEvent&&this.channel._trigger(this.refEvent,{status:n,response:a})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:n,response:a}){this.recHooks.filter(s=>s.status===n).forEach(s=>s.callback(a))}_hasReceived(n){return this.receivedResp&&this.receivedResp.status===n}}var Vb;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Vb||(Vb={}));class mo{constructor(n,a){this.channel=n,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=a?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},o=>{const{onJoin:c,onLeave:u,onSync:f}=this.caller;this.joinRef=this.channel._joinRef(),this.state=mo.syncState(this.state,o,c,u),this.pendingDiffs.forEach(p=>{this.state=mo.syncDiff(this.state,p,c,u)}),this.pendingDiffs=[],f()}),this.channel._on(s.diff,{},o=>{const{onJoin:c,onLeave:u,onSync:f}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=mo.syncDiff(this.state,o,c,u),f())}),this.onJoin((o,c,u)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:c,newPresences:u})}),this.onLeave((o,c,u)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:c,leftPresences:u})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(n,a,s,o){const c=this.cloneDeep(n),u=this.transformState(a),f={},p={};return this.map(c,(m,y)=>{u[m]||(p[m]=y)}),this.map(u,(m,y)=>{const g=c[m];if(g){const x=y.map(T=>T.presence_ref),S=g.map(T=>T.presence_ref),_=y.filter(T=>S.indexOf(T.presence_ref)<0),E=g.filter(T=>x.indexOf(T.presence_ref)<0);_.length>0&&(f[m]=_),E.length>0&&(p[m]=E)}else f[m]=y}),this.syncDiff(c,{joins:f,leaves:p},s,o)}static syncDiff(n,a,s,o){const{joins:c,leaves:u}={joins:this.transformState(a.joins),leaves:this.transformState(a.leaves)};return s||(s=()=>{}),o||(o=()=>{}),this.map(c,(f,p)=>{var m;const y=(m=n[f])!==null&&m!==void 0?m:[];if(n[f]=this.cloneDeep(p),y.length>0){const g=n[f].map(S=>S.presence_ref),x=y.filter(S=>g.indexOf(S.presence_ref)<0);n[f].unshift(...x)}s(f,y,p)}),this.map(u,(f,p)=>{let m=n[f];if(!m)return;const y=p.map(g=>g.presence_ref);m=m.filter(g=>y.indexOf(g.presence_ref)<0),n[f]=m,o(f,m,p),m.length===0&&delete n[f]}),n}static map(n,a){return Object.getOwnPropertyNames(n).map(s=>a(s,n[s]))}static transformState(n){return n=this.cloneDeep(n),Object.getOwnPropertyNames(n).reduce((a,s)=>{const o=n[s];return"metas"in o?a[s]=o.metas.map(c=>(c.presence_ref=c.phx_ref,delete c.phx_ref,delete c.phx_ref_prev,c)):a[s]=o,a},{})}static cloneDeep(n){return JSON.parse(JSON.stringify(n))}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Gb;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Gb||(Gb={}));var go;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(go||(go={}));var mr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(mr||(mr={}));class qs{constructor(n,a={config:{}},s){var o,c;if(this.topic=n,this.params=a,this.socket=s,this.bindings={},this.state=gt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},a.config),this.timeout=this.socket.timeout,this.joinPush=new Kf(this,Rn.join,this.params,this.timeout),this.rejoinTimer=new cS(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=gt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(u=>u.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=gt.closed,this.socket._remove(this)}),this._onError(u=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,u),this.state=gt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=gt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",u=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,u),this.state=gt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Rn.reply,{},(u,f)=>{this._trigger(this._replyEventName(f),u)}),this.presence=new mo(this),this.broadcastEndpointURL=dS(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((c=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(n,a=this.timeout){var s,o,c;if(this.socket.isConnected()||this.socket.connect(),this.state==gt.closed){const{config:{broadcast:u,presence:f,private:p}}=this.params,m=(o=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(S=>S.filter))!==null&&o!==void 0?o:[],y=!!this.bindings[go.PRESENCE]&&this.bindings[go.PRESENCE].length>0||((c=this.params.config.presence)===null||c===void 0?void 0:c.enabled)===!0,g={},x={broadcast:u,presence:Object.assign(Object.assign({},f),{enabled:y}),postgres_changes:m,private:p};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(S=>n?.(mr.CHANNEL_ERROR,S)),this._onClose(()=>n?.(mr.CLOSED)),this.updateJoinPayload(Object.assign({config:x},g)),this.joinedOnce=!0,this._rejoin(a),this.joinPush.receive("ok",async({postgres_changes:S})=>{var _;if(this.socket._isManualToken()||this.socket.setAuth(),S===void 0){n?.(mr.SUBSCRIBED);return}else{const E=this.bindings.postgres_changes,T=(_=E?.length)!==null&&_!==void 0?_:0,R=[];for(let O=0;O<T;O++){const A=E[O],{filter:{event:k,schema:I,table:B,filter:$}}=A,q=S&&S[O];if(q&&q.event===k&&qs.isFilterValueEqual(q.schema,I)&&qs.isFilterValueEqual(q.table,B)&&qs.isFilterValueEqual(q.filter,$))R.push(Object.assign(Object.assign({},A),{id:q.id}));else{this.unsubscribe(),this.state=gt.errored,n?.(mr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=R,n&&n(mr.SUBSCRIBED);return}}).receive("error",S=>{this.state=gt.errored,n?.(mr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(S).join(", ")||"error")))}).receive("timeout",()=>{n?.(mr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(n,a={}){return await this.send({type:"presence",event:"track",payload:n},a.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,a,s){return this.state===gt.joined&&n===go.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(n,a,s)}async httpSend(n,a,s={}){var o;if(a==null)return Promise.reject("Payload is required for httpSend()");const c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:a,private:this.private}]})},f=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(o=s.timeout)!==null&&o!==void 0?o:this.timeout);if(f.status===202)return{success:!0};let p=f.statusText;try{const m=await f.json();p=m.error||m.message||p}catch{}return Promise.reject(new Error(p))}async send(n,a={}){var s,o;if(!this._canPush()&&n.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:c,payload:u}=n,f={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(f.Authorization=`Bearer ${this.socket.accessTokenValue}`);const p={method:"POST",headers:f,body:JSON.stringify({messages:[{topic:this.subTopic,event:c,payload:u,private:this.private}]})};try{const m=await this._fetchWithTimeout(this.broadcastEndpointURL,p,(s=a.timeout)!==null&&s!==void 0?s:this.timeout);return await((o=m.body)===null||o===void 0?void 0:o.cancel()),m.ok?"ok":"error"}catch(m){return m.name==="AbortError"?"timed out":"error"}}else return new Promise(c=>{var u,f,p;const m=this._push(n.type,n,a.timeout||this.timeout);n.type==="broadcast"&&!(!((p=(f=(u=this.params)===null||u===void 0?void 0:u.config)===null||f===void 0?void 0:f.broadcast)===null||p===void 0)&&p.ack)&&c("ok"),m.receive("ok",()=>c("ok")),m.receive("error",()=>c("error")),m.receive("timeout",()=>c("timed out"))})}updateJoinPayload(n){this.joinPush.updatePayload(n)}unsubscribe(n=this.timeout){this.state=gt.leaving;const a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Rn.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(o=>{s=new Kf(this,Rn.leave,{},n),s.receive("ok",()=>{a(),o("ok")}).receive("timeout",()=>{a(),o("timed out")}).receive("error",()=>{o("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s?.destroy()})}teardown(){this.pushBuffer.forEach(n=>n.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=gt.closed,this.bindings={}}async _fetchWithTimeout(n,a,s){const o=new AbortController,c=setTimeout(()=>o.abort(),s),u=await this.socket.fetch(n,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(c),u}_push(n,a,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${n}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Kf(this,n,a,s);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(n){if(n.startTimeout(),this.pushBuffer.push(n),this.pushBuffer.length>Mj){const a=this.pushBuffer.shift();a&&(a.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload))}}_onMessage(n,a,s){return a}_isMember(n){return this.topic===n}_joinRef(){return this.joinPush.ref}_trigger(n,a,s){var o,c;const u=n.toLocaleLowerCase(),{close:f,error:p,leave:m,join:y}=Rn;if(s&&[f,p,m,y].indexOf(u)>=0&&s!==this._joinRef())return;let x=this._onMessage(u,a,s);if(a&&!x)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(u)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(S=>{var _,E,T;return((_=S.filter)===null||_===void 0?void 0:_.event)==="*"||((T=(E=S.filter)===null||E===void 0?void 0:E.event)===null||T===void 0?void 0:T.toLocaleLowerCase())===u}).map(S=>S.callback(x,s)):(c=this.bindings[u])===null||c===void 0||c.filter(S=>{var _,E,T,R,O,A;if(["broadcast","presence","postgres_changes"].includes(u))if("id"in S){const k=S.id,I=(_=S.filter)===null||_===void 0?void 0:_.event;return k&&((E=a.ids)===null||E===void 0?void 0:E.includes(k))&&(I==="*"||I?.toLocaleLowerCase()===((T=a.data)===null||T===void 0?void 0:T.type.toLocaleLowerCase()))}else{const k=(O=(R=S?.filter)===null||R===void 0?void 0:R.event)===null||O===void 0?void 0:O.toLocaleLowerCase();return k==="*"||k===((A=a?.event)===null||A===void 0?void 0:A.toLocaleLowerCase())}else return S.type.toLocaleLowerCase()===u}).map(S=>{if(typeof x=="object"&&"ids"in x){const _=x.data,{schema:E,table:T,commit_timestamp:R,type:O,errors:A}=_;x=Object.assign(Object.assign({},{schema:E,table:T,commit_timestamp:R,eventType:O,new:{},old:{},errors:A}),this._getPayloadRecords(_))}S.callback(x,s)})}_isClosed(){return this.state===gt.closed}_isJoined(){return this.state===gt.joined}_isJoining(){return this.state===gt.joining}_isLeaving(){return this.state===gt.leaving}_replyEventName(n){return`chan_reply_${n}`}_on(n,a,s){const o=n.toLocaleLowerCase(),c={type:o,filter:a,callback:s};return this.bindings[o]?this.bindings[o].push(c):this.bindings[o]=[c],this}_off(n,a){const s=n.toLocaleLowerCase();return this.bindings[s]&&(this.bindings[s]=this.bindings[s].filter(o=>{var c;return!(((c=o.type)===null||c===void 0?void 0:c.toLocaleLowerCase())===s&&qs.isEqual(o.filter,a))})),this}static isEqual(n,a){if(Object.keys(n).length!==Object.keys(a).length)return!1;for(const s in n)if(n[s]!==a[s])return!1;return!0}static isFilterValueEqual(n,a){return(n??void 0)===(a??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(n){this._on(Rn.close,{},n)}_onError(n){this._on(Rn.error,{},a=>n(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(n=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=gt.joining,this.joinPush.resend(n))}_getPayloadRecords(n){const a={new:{},old:{}};return(n.type==="INSERT"||n.type==="UPDATE")&&(a.new=Fb(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(a.old=Fb(n.columns,n.old_record)),a}}const Xf=()=>{},dc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Hj=[1e3,2e3,5e3,1e4],qj=1e4,Fj=`
63
- addEventListener("message", (e) => {
64
- if (e.data.event === "start") {
65
- setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
66
- }
67
- });`;class Vj{constructor(n,a){var s;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Th,this.transport=null,this.heartbeatIntervalMs=dc.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Xf,this.ref=0,this.reconnectTimer=null,this.vsn=qb,this.logger=Xf,this.conn=null,this.sendBuffer=[],this.serializer=new Lj,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=o=>o?(...c)=>o(...c):(...c)=>fetch(...c),!(!((s=a?.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=a.params.apikey,this.endPoint=`${n}/${Ch.websocket}`,this.httpEndpoint=dS(n),this._initializeOptions(a),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(a?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Oj.createWebSocket(this.endpointURL())}catch(n){this._setConnectionState("disconnected");const a=n.message;throw a.includes("Node.js")?new Error(`${a}
68
-
69
- To use Realtime in Node.js, you need to provide a WebSocket implementation:
70
-
71
- Option 1: Use Node.js 22+ which has native WebSocket support
72
- Option 2: Install and provide the "ws" package:
73
-
74
- npm install ws
75
-
76
- import ws from "ws"
77
- const client = new RealtimeClient(url, {
78
- ...options,
79
- transport: ws
80
- })`):new Error(`WebSocket not available: ${a}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(n,a){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const s=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(s),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(n?this.conn.close(n,a??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(n){const a=await n.unsubscribe();return this.channels.length===0&&this.disconnect(),a}async removeAllChannels(){const n=await Promise.all(this.channels.map(a=>a.unsubscribe()));return this.channels=[],this.disconnect(),n}log(n,a,s){this.logger(n,a,s)}connectionState(){switch(this.conn&&this.conn.readyState){case na.connecting:return Ua.Connecting;case na.open:return Ua.Open;case na.closing:return Ua.Closing;default:return Ua.Closed}}isConnected(){return this.connectionState()===Ua.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(n,a={config:{}}){const s=`realtime:${n}`,o=this.getChannels().find(c=>c.topic===s);if(o)return o;{const c=new qs(`realtime:${n}`,a,this);return this.channels.push(c),c}}push(n){const{topic:a,event:s,payload:o,ref:c}=n,u=()=>{this.encode(n,f=>{var p;(p=this.conn)===null||p===void 0||p.send(f)})};this.log("push",`${a} ${s} (${c})`,o),this.isConnected()?u():this.sendBuffer.push(u)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var n;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(a){this.log("error","error in heartbeat callback",a)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(a){this.log("error","error in heartbeat callback",a)}this._wasManualDisconnect=!1,(n=this.conn)===null||n===void 0||n.close(Dj,"heartbeat timeout"),setTimeout(()=>{var a;this.isConnected()||(a=this.reconnectTimer)===null||a===void 0||a.scheduleTimeout()},dc.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(a){this.log("error","error in heartbeat callback",a)}this._setAuthSafely("heartbeat")}onHeartbeat(n){this.heartbeatCallback=n}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(n=>n()),this.sendBuffer=[])}_makeRef(){let n=this.ref+1;return n===this.ref?this.ref=0:this.ref=n,this.ref.toString()}_leaveOpenTopic(n){let a=this.channels.find(s=>s.topic===n&&(s._isJoined()||s._isJoining()));a&&(this.log("transport",`leaving duplicate topic "${n}"`),a.unsubscribe())}_remove(n){this.channels=this.channels.filter(a=>a.topic!==n.topic)}_onConnMessage(n){this.decode(n.data,a=>{if(a.topic==="phoenix"&&a.event==="phx_reply"&&a.ref&&a.ref===this.pendingHeartbeatRef){const m=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(a.payload.status==="ok"?"ok":"error",m)}catch(y){this.log("error","error in heartbeat callback",y)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:s,event:o,payload:c,ref:u}=a,f=u?`(${u})`:"",p=c.status||"";this.log("receive",`${p} ${s} ${o} ${f}`.trim(),c),this.channels.filter(m=>m._isMember(s)).forEach(m=>m._trigger(o,c,u)),this._triggerStateCallbacks("message",a)})}_clearTimer(n){var a;n==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):n==="reconnect"&&((a=this.reconnectTimer)===null||a===void 0||a.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=n=>this._onConnError(n),this.conn.onmessage=n=>this._onConnMessage(n),this.conn.onclose=n=>this._onConnClose(n),this.conn.readyState===na.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===na.open||this.conn.readyState===na.connecting)try{this.conn.close()}catch(n){this.log("error","Error closing connection",n)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(n=>n.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(a=>{a.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(a=>{a._isJoining()&&(a.joinPush.sent=!1,a.joinPush.send())})),this.flushSendBuffer()}).catch(a=>{this.log("error","error waiting for auth on connect",a),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const n=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(n),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this._terminateWorker()},this.workerRef.onmessage=a=>{a.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)}_onConnClose(n){var a;this._setConnectionState("disconnected"),this.log("transport","close",n),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(a=this.reconnectTimer)===null||a===void 0||a.scheduleTimeout(),this._triggerStateCallbacks("close",n)}_onConnError(n){this._setConnectionState("disconnected"),this.log("transport",`${n}`),this._triggerChanError(),this._triggerStateCallbacks("error",n);try{this.heartbeatCallback("error")}catch(a){this.log("error","error in heartbeat callback",a)}}_triggerChanError(){this.channels.forEach(n=>n._trigger(Rn.error))}_appendParams(n,a){if(Object.keys(a).length===0)return n;const s=n.match(/\?/)?"&":"?",o=new URLSearchParams(a);return`${n}${s}${o}`}_workerObjectUrl(n){let a;if(n)a=n;else{const s=new Blob([Fj],{type:"application/javascript"});a=URL.createObjectURL(s)}return a}_setConnectionState(n,a=!1){this._connectionState=n,n==="connecting"?this._wasManualDisconnect=!1:n==="disconnecting"&&(this._wasManualDisconnect=a)}async _performAuth(n=null){let a,s=!1;if(n)a=n,s=!0;else if(this.accessToken)try{a=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),a=this.accessTokenValue}else a=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(o=>{const c={access_token:a,version:kj};a&&o.updateJoinPayload(c),o.joinedOnce&&o._isJoined()&&o._push(Rn.access_token,{access_token:a})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(a=>{this.log("error",`Error setting auth in ${n}`,a)})}_triggerStateCallbacks(n,a){try{this.stateChangeCallbacks[n].forEach(s=>{try{s(a)}catch(o){this.log("error",`error in ${n} callback`,o)}})}catch(s){this.log("error",`error triggering ${n} callbacks`,s)}}_setupReconnectionTimer(){this.reconnectTimer=new cS(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},dc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(n){var a,s,o,c,u,f,p,m,y,g,x,S;switch(this.transport=(a=n?.transport)!==null&&a!==void 0?a:null,this.timeout=(s=n?.timeout)!==null&&s!==void 0?s:Th,this.heartbeatIntervalMs=(o=n?.heartbeatIntervalMs)!==null&&o!==void 0?o:dc.HEARTBEAT_INTERVAL,this.worker=(c=n?.worker)!==null&&c!==void 0?c:!1,this.accessToken=(u=n?.accessToken)!==null&&u!==void 0?u:null,this.heartbeatCallback=(f=n?.heartbeatCallback)!==null&&f!==void 0?f:Xf,this.vsn=(p=n?.vsn)!==null&&p!==void 0?p:qb,n?.params&&(this.params=n.params),n?.logger&&(this.logger=n.logger),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(m=n?.reconnectAfterMs)!==null&&m!==void 0?m:(_=>Hj[_-1]||qj),this.vsn){case jj:this.encode=(y=n?.encode)!==null&&y!==void 0?y:((_,E)=>E(JSON.stringify(_))),this.decode=(g=n?.decode)!==null&&g!==void 0?g:((_,E)=>E(JSON.parse(_)));break;case lS:this.encode=(x=n?.encode)!==null&&x!==void 0?x:this.serializer.encode.bind(this.serializer),this.decode=(S=n?.decode)!==null&&S!==void 0?S:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl}}}var So=class extends Error{constructor(e,n){super(e),this.name="IcebergError",this.status=n.status,this.icebergType=n.icebergType,this.icebergCode=n.icebergCode,this.details=n.details,this.isCommitStateUnknown=n.icebergType==="CommitStateUnknownException"||[500,502,504].includes(n.status)&&n.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Gj(e,n,a){const s=new URL(n,e);if(a)for(const[o,c]of Object.entries(a))c!==void 0&&s.searchParams.set(o,c);return s.toString()}async function Yj(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function Kj(e){const n=e.fetchImpl??globalThis.fetch;return{async request({method:a,path:s,query:o,body:c,headers:u}){const f=Gj(e.baseUrl,s,o),p=await Yj(e.auth),m=await n(f,{method:a,headers:{...c?{"Content-Type":"application/json"}:{},...p,...u},body:c?JSON.stringify(c):void 0}),y=await m.text(),g=(m.headers.get("content-type")||"").includes("application/json"),x=g&&y?JSON.parse(y):y;if(!m.ok){const S=g?x:void 0,_=S?.error;throw new So(_?.message??`Request failed with status ${m.status}`,{status:m.status,icebergType:_?.type,icebergCode:_?.code,details:S})}return{status:m.status,headers:m.headers,data:x}}}}function fc(e){return e.join("")}var Xj=class{constructor(e,n=""){this.client=e,this.prefix=n}async listNamespaces(e){const n=e?{parent:fc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,n){const a={namespace:e.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:a})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${fc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${fc(e.namespace)}`}),!0}catch(n){if(n instanceof So&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(e,n){try{return await this.createNamespace(e,n)}catch(a){if(a instanceof So&&a.status===409)return;throw a}}};function Ls(e){return e.join("")}var Qj=class{constructor(e,n="",a){this.client=e,this.prefix=n,this.accessDelegation=a}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables`})).data.identifiers}async createTable(e,n){const a={};return this.accessDelegation&&(a["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables`,body:n,headers:a})).data.metadata}async updateTable(e,n){const a=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables/${e.name}`,body:n});return{"metadata-location":a.data["metadata-location"],metadata:a.data.metadata}}async dropTable(e,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables/${e.name}`,headers:n})).data.metadata}async tableExists(e){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ls(e.namespace)}/tables/${e.name}`,headers:n}),!0}catch(a){if(a instanceof So&&a.status===404)return!1;throw a}}async createTableIfNotExists(e,n){try{return await this.createTable(e,n)}catch(a){if(a instanceof So&&a.status===409)return await this.loadTable({namespace:e.namespace,name:n.name});throw a}}},Wj=class{constructor(e){let n="v1";e.catalogName&&(n+=`/${e.catalogName}`);const a=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=Kj({baseUrl:a,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new Xj(this.client,n),this.tableOps=new Qj(this.client,n,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,n){return this.namespaceOps.createNamespace(e,n)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,n){return this.tableOps.createTable(e,n)}async updateTable(e,n){return this.tableOps.updateTable(e,n)}async dropTable(e,n){await this.tableOps.dropTable(e,n)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,n){return this.namespaceOps.createNamespaceIfNotExists(e,n)}async createTableIfNotExists(e,n){return this.tableOps.createTableIfNotExists(e,n)}},ou=class extends Error{constructor(e,n="storage",a,s){super(e),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=a,this.statusCode=s}};function lu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var hc=class extends ou{constructor(e,n,a,s="storage"){super(e,s,n,a),this.name=s==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=a}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},fS=class extends ou{constructor(e,n,a="storage"){super(e,a),this.name=a==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};const Jj=e=>e?(...n)=>e(...n):(...n)=>fetch(...n),Zj=e=>{if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ah=e=>{if(Array.isArray(e))return e.map(a=>Ah(a));if(typeof e=="function"||e!==Object(e))return e;const n={};return Object.entries(e).forEach(([a,s])=>{const o=a.replace(/([-_][a-z])/gi,c=>c.toUpperCase().replace(/[-_]/g,""));n[o]=Ah(s)}),n},eD=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Eo(e){"@babel/helpers - typeof";return Eo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Eo(e)}function tD(e,n){if(Eo(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,n);if(Eo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function nD(e){var n=tD(e,"string");return Eo(n)=="symbol"?n:n+""}function rD(e,n,a){return(n=nD(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Yb(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function xe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Yb(Object(a),!0).forEach(function(s){rD(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Yb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}const Kb=e=>{var n;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(n=e.error)===null||n===void 0?void 0:n.message)||JSON.stringify(e)},aD=async(e,n,a,s)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!a?.noResolveJson){const o=e,c=o.status||500;if(typeof o.json=="function")o.json().then(u=>{const f=u?.statusCode||u?.code||c+"";n(new hc(Kb(u),c,f,s))}).catch(()=>{if(s==="vectors"){const u=c+"";n(new hc(o.statusText||`HTTP ${c} error`,c,u,s))}else{const u=c+"";n(new hc(o.statusText||`HTTP ${c} error`,c,u,s))}});else{const u=c+"";n(new hc(o.statusText||`HTTP ${c} error`,c,u,s))}}else n(new fS(Kb(e),e,s))},sD=(e,n,a,s)=>{const o={method:e,headers:n?.headers||{}};return e==="GET"||e==="HEAD"||!s?xe(xe({},o),a):(Zj(s)?(o.headers=xe({"Content-Type":"application/json"},n?.headers),o.body=JSON.stringify(s)):o.body=s,n?.duplex&&(o.duplex=n.duplex),xe(xe({},o),a))};async function ro(e,n,a,s,o,c,u){return new Promise((f,p)=>{e(a,sD(n,s,o,c)).then(m=>{if(!m.ok)throw m;if(s?.noResolveJson)return m;if(u==="vectors"){const y=m.headers.get("content-type");if(m.headers.get("content-length")==="0"||m.status===204)return{};if(!y||!y.includes("application/json"))return{}}return m.json()}).then(m=>f(m)).catch(m=>aD(m,p,s,u))})}function hS(e="storage"){return{get:async(n,a,s,o)=>ro(n,"GET",a,s,o,void 0,e),post:async(n,a,s,o,c)=>ro(n,"POST",a,o,c,s,e),put:async(n,a,s,o,c)=>ro(n,"PUT",a,o,c,s,e),head:async(n,a,s,o)=>ro(n,"HEAD",a,xe(xe({},s),{},{noResolveJson:!0}),o,void 0,e),remove:async(n,a,s,o,c)=>ro(n,"DELETE",a,o,c,s,e)}}const iD=hS("storage"),{get:_o,post:Cn,put:Oh,head:oD,remove:_p}=iD,sn=hS("vectors");var ri=class{constructor(e,n={},a,s="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=n,this.fetch=Jj(a),this.namespace=s}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,n){return this.headers=xe(xe({},this.headers),{},{[e]:n}),this}async handleOperation(e){var n=this;try{return{data:await e(),error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(lu(a))return{data:null,error:a};throw a}}},lD=class{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n}then(e,n){return this.execute().then(e,n)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(lu(n))return{data:null,error:n};throw n}}};let pS;pS=Symbol.toStringTag;var cD=class{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n,this[pS]="BlobDownloadBuilder",this.promise=null}asStream(){return new lD(this.downloadFn,this.shouldThrowOnError)}then(e,n){return this.getPromise().then(e,n)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(lu(n))return{data:null,error:n};throw n}}};const uD={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Xb={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var dD=class extends ri{constructor(e,n={},a,s){super(e,n,s,"storage"),this.bucketId=a}async uploadOrUpdate(e,n,a,s){var o=this;return o.handleOperation(async()=>{let c;const u=xe(xe({},Xb),s);let f=xe(xe({},o.headers),e==="POST"&&{"x-upsert":String(u.upsert)});const p=u.metadata;typeof Blob<"u"&&a instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),p&&c.append("metadata",o.encodeMetadata(p)),c.append("",a)):typeof FormData<"u"&&a instanceof FormData?(c=a,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),p&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(p))):(c=a,f["cache-control"]=`max-age=${u.cacheControl}`,f["content-type"]=u.contentType,p&&(f["x-metadata"]=o.toBase64(o.encodeMetadata(p))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),s?.headers&&(f=xe(xe({},f),s.headers));const m=o._removeEmptyFolders(n),y=o._getFinalPath(m),g=await(e=="PUT"?Oh:Cn)(o.fetch,`${o.url}/object/${y}`,c,xe({headers:f},u?.duplex?{duplex:u.duplex}:{}));return{path:m,id:g.Id,fullPath:g.Key}})}async upload(e,n,a){return this.uploadOrUpdate("POST",e,n,a)}async uploadToSignedUrl(e,n,a,s){var o=this;const c=o._removeEmptyFolders(e),u=o._getFinalPath(c),f=new URL(o.url+`/object/upload/sign/${u}`);return f.searchParams.set("token",n),o.handleOperation(async()=>{let p;const m=xe({upsert:Xb.upsert},s),y=xe(xe({},o.headers),{"x-upsert":String(m.upsert)});return typeof Blob<"u"&&a instanceof Blob?(p=new FormData,p.append("cacheControl",m.cacheControl),p.append("",a)):typeof FormData<"u"&&a instanceof FormData?(p=a,p.append("cacheControl",m.cacheControl)):(p=a,y["cache-control"]=`max-age=${m.cacheControl}`,y["content-type"]=m.contentType),{path:c,fullPath:(await Oh(o.fetch,f.toString(),p,{headers:y})).Key}})}async createSignedUploadUrl(e,n){var a=this;return a.handleOperation(async()=>{let s=a._getFinalPath(e);const o=xe({},a.headers);n?.upsert&&(o["x-upsert"]="true");const c=await Cn(a.fetch,`${a.url}/object/upload/sign/${s}`,{},{headers:o}),u=new URL(a.url+c.url),f=u.searchParams.get("token");if(!f)throw new ou("No token returned by API");return{signedUrl:u.toString(),path:e,token:f}})}async update(e,n,a){return this.uploadOrUpdate("PUT",e,n,a)}async move(e,n,a){var s=this;return s.handleOperation(async()=>await Cn(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:n,destinationBucket:a?.destinationBucket},{headers:s.headers}))}async copy(e,n,a){var s=this;return s.handleOperation(async()=>({path:(await Cn(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:n,destinationBucket:a?.destinationBucket},{headers:s.headers})).Key}))}async createSignedUrl(e,n,a){var s=this;return s.handleOperation(async()=>{let o=s._getFinalPath(e),c=await Cn(s.fetch,`${s.url}/object/sign/${o}`,xe({expiresIn:n},a?.transform?{transform:a.transform}:{}),{headers:s.headers});const u=a?.download?`&download=${a.download===!0?"":a.download}`:"";return{signedUrl:encodeURI(`${s.url}${c.signedURL}${u}`)}})}async createSignedUrls(e,n,a){var s=this;return s.handleOperation(async()=>{const o=await Cn(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:n,paths:e},{headers:s.headers}),c=a?.download?`&download=${a.download===!0?"":a.download}`:"";return o.map(u=>xe(xe({},u),{},{signedUrl:u.signedURL?encodeURI(`${s.url}${u.signedURL}${c}`):null}))})}download(e,n,a){const s=typeof n?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(n?.transform||{}),c=o?`?${o}`:"",u=this._getFinalPath(e),f=()=>_o(this.fetch,`${this.url}/${s}/${u}${c}`,{headers:this.headers,noResolveJson:!0},a);return new cD(f,this.shouldThrowOnError)}async info(e){var n=this;const a=n._getFinalPath(e);return n.handleOperation(async()=>Ah(await _o(n.fetch,`${n.url}/object/info/${a}`,{headers:n.headers})))}async exists(e){var n=this;const a=n._getFinalPath(e);try{return await oD(n.fetch,`${n.url}/object/${a}`,{headers:n.headers}),{data:!0,error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(lu(s)&&s instanceof fS){const o=s.originalError;if([400,404].includes(o?.status))return{data:!1,error:s}}throw s}}getPublicUrl(e,n){const a=this._getFinalPath(e),s=[],o=n?.download?`download=${n.download===!0?"":n.download}`:"";o!==""&&s.push(o);const c=typeof n?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(n?.transform||{});u!==""&&s.push(u);let f=s.join("&");return f!==""&&(f=`?${f}`),{data:{publicUrl:encodeURI(`${this.url}/${c}/public/${a}${f}`)}}}async remove(e){var n=this;return n.handleOperation(async()=>await _p(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:e},{headers:n.headers}))}async list(e,n,a){var s=this;return s.handleOperation(async()=>{const o=xe(xe(xe({},uD),n),{},{prefix:e||""});return await Cn(s.fetch,`${s.url}/object/list/${s.bucketId}`,o,{headers:s.headers},a)})}async listV2(e,n){var a=this;return a.handleOperation(async()=>{const s=xe({},e);return await Cn(a.fetch,`${a.url}/object/list-v2/${a.bucketId}`,s,{headers:a.headers},n)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}};const fD="2.98.0",Lo={"X-Client-Info":`storage-js/${fD}`};var hD=class extends ri{constructor(e,n={},a,s){const o=new URL(e);s?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const c=o.href.replace(/\/$/,""),u=xe(xe({},Lo),n);super(c,u,a,"storage")}async listBuckets(e){var n=this;return n.handleOperation(async()=>{const a=n.listBucketOptionsToQueryString(e);return await _o(n.fetch,`${n.url}/bucket${a}`,{headers:n.headers})})}async getBucket(e){var n=this;return n.handleOperation(async()=>await _o(n.fetch,`${n.url}/bucket/${e}`,{headers:n.headers}))}async createBucket(e,n={public:!1}){var a=this;return a.handleOperation(async()=>await Cn(a.fetch,`${a.url}/bucket`,{id:e,name:e,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:a.headers}))}async updateBucket(e,n){var a=this;return a.handleOperation(async()=>await Oh(a.fetch,`${a.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:a.headers}))}async emptyBucket(e){var n=this;return n.handleOperation(async()=>await Cn(n.fetch,`${n.url}/bucket/${e}/empty`,{},{headers:n.headers}))}async deleteBucket(e){var n=this;return n.handleOperation(async()=>await _p(n.fetch,`${n.url}/bucket/${e}`,{},{headers:n.headers}))}listBucketOptionsToQueryString(e){const n={};return e&&("limit"in e&&(n.limit=String(e.limit)),"offset"in e&&(n.offset=String(e.offset)),e.search&&(n.search=e.search),e.sortColumn&&(n.sortColumn=e.sortColumn),e.sortOrder&&(n.sortOrder=e.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},pD=class extends ri{constructor(e,n={},a){const s=e.replace(/\/$/,""),o=xe(xe({},Lo),n);super(s,o,a,"storage")}async createBucket(e){var n=this;return n.handleOperation(async()=>await Cn(n.fetch,`${n.url}/bucket`,{name:e},{headers:n.headers}))}async listBuckets(e){var n=this;return n.handleOperation(async()=>{const a=new URLSearchParams;e?.limit!==void 0&&a.set("limit",e.limit.toString()),e?.offset!==void 0&&a.set("offset",e.offset.toString()),e?.sortColumn&&a.set("sortColumn",e.sortColumn),e?.sortOrder&&a.set("sortOrder",e.sortOrder),e?.search&&a.set("search",e.search);const s=a.toString(),o=s?`${n.url}/bucket?${s}`:`${n.url}/bucket`;return await _o(n.fetch,o,{headers:n.headers})})}async deleteBucket(e){var n=this;return n.handleOperation(async()=>await _p(n.fetch,`${n.url}/bucket/${e}`,{},{headers:n.headers}))}from(e){var n=this;if(!eD(e))throw new ou("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 a=new Wj({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(a,{get(o,c){const u=o[c];return typeof u!="function"?u:async(...f)=>{try{return{data:await u.apply(o,f),error:null}}catch(p){if(s)throw p;return{data:null,error:p}}}}})}},mD=class extends ri{constructor(e,n={},a){const s=e.replace(/\/$/,""),o=xe(xe({},Lo),{},{"Content-Type":"application/json"},n);super(s,o,a,"vectors")}async createIndex(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/CreateIndex`,e,{headers:n.headers})||{})}async getIndex(e,n){var a=this;return a.handleOperation(async()=>await sn.post(a.fetch,`${a.url}/GetIndex`,{vectorBucketName:e,indexName:n},{headers:a.headers}))}async listIndexes(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/ListIndexes`,e,{headers:n.headers}))}async deleteIndex(e,n){var a=this;return a.handleOperation(async()=>await sn.post(a.fetch,`${a.url}/DeleteIndex`,{vectorBucketName:e,indexName:n},{headers:a.headers})||{})}},gD=class extends ri{constructor(e,n={},a){const s=e.replace(/\/$/,""),o=xe(xe({},Lo),{},{"Content-Type":"application/json"},n);super(s,o,a,"vectors")}async putVectors(e){var n=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/PutVectors`,e,{headers:n.headers})||{})}async getVectors(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/GetVectors`,e,{headers:n.headers}))}async listVectors(e){var n=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/ListVectors`,e,{headers:n.headers}))}async queryVectors(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/QueryVectors`,e,{headers:n.headers}))}async deleteVectors(e){var n=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/DeleteVectors`,e,{headers:n.headers})||{})}},yD=class extends ri{constructor(e,n={},a){const s=e.replace(/\/$/,""),o=xe(xe({},Lo),{},{"Content-Type":"application/json"},n);super(s,o,a,"vectors")}async createBucket(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:n.headers})||{})}async getBucket(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:e},{headers:n.headers}))}async listBuckets(e={}){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/ListVectorBuckets`,e,{headers:n.headers}))}async deleteBucket(e){var n=this;return n.handleOperation(async()=>await sn.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:n.headers})||{})}},vD=class extends yD{constructor(e,n={}){super(e,n.headers||{},n.fetch)}from(e){return new bD(this.url,this.headers,e,this.fetch)}async createBucket(e){var n=()=>super.createBucket,a=this;return n().call(a,e)}async getBucket(e){var n=()=>super.getBucket,a=this;return n().call(a,e)}async listBuckets(e={}){var n=()=>super.listBuckets,a=this;return n().call(a,e)}async deleteBucket(e){var n=()=>super.deleteBucket,a=this;return n().call(a,e)}},bD=class extends mD{constructor(e,n,a,s){super(e,n,s),this.vectorBucketName=a}async createIndex(e){var n=()=>super.createIndex,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName}))}async listIndexes(e={}){var n=()=>super.listIndexes,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName}))}async getIndex(e){var n=()=>super.getIndex,a=this;return n().call(a,a.vectorBucketName,e)}async deleteIndex(e){var n=()=>super.deleteIndex,a=this;return n().call(a,a.vectorBucketName,e)}index(e){return new wD(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},wD=class extends gD{constructor(e,n,a,s,o){super(e,n,o),this.vectorBucketName=a,this.indexName=s}async putVectors(e){var n=()=>super.putVectors,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async getVectors(e){var n=()=>super.getVectors,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async listVectors(e={}){var n=()=>super.listVectors,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async queryVectors(e){var n=()=>super.queryVectors,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async deleteVectors(e){var n=()=>super.deleteVectors,a=this;return n().call(a,xe(xe({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}},xD=class extends hD{constructor(e,n={},a,s){super(e,n,a,s)}from(e){return new dD(this.url,this.headers,e,this.fetch)}get vectors(){return new vD(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new pD(this.url+"/iceberg",this.headers,this.fetch)}};const mS="2.98.0",$s=30*1e3,Nh=3,Qf=Nh*$s,SD="http://localhost:9999",ED="supabase.auth.token",_D={"X-Client-Info":`gotrue-js/${mS}`},kh="X-Supabase-Api-Version",gS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},TD=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,CD=600*1e3;class To extends Error{constructor(n,a,s){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=s}}function pe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class RD extends To{constructor(n,a,s){super(n,a,s),this.name="AuthApiError",this.status=a,this.code=s}}function AD(e){return pe(e)&&e.name==="AuthApiError"}class Pa extends To{constructor(n,a){super(n),this.name="AuthUnknownError",this.originalError=a}}class _r extends To{constructor(n,a,s,o){super(n,s,o),this.name=a,this.status=s}}class rn extends _r{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Wf(e){return pe(e)&&e.name==="AuthSessionMissingError"}class Us extends _r{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class pc extends _r{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class mc extends _r{constructor(n,a=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function OD(e){return pe(e)&&e.name==="AuthImplicitGrantRedirectError"}class Qb extends _r{constructor(n,a=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class ND extends _r{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 _r{constructor(n,a){super(n,"AuthRetryableFetchError",a,void 0)}}function Jf(e){return pe(e)&&e.name==="AuthRetryableFetchError"}class Wb extends _r{constructor(n,a,s){super(n,"AuthWeakPasswordError",a,"weak_password"),this.reasons=s}}class Dh extends _r{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const Bc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Jb=`
81
- \r=`.split(""),kD=(()=>{const e=new Array(128);for(let n=0;n<e.length;n+=1)e[n]=-1;for(let n=0;n<Jb.length;n+=1)e[Jb[n].charCodeAt(0)]=-2;for(let n=0;n<Bc.length;n+=1)e[Bc[n].charCodeAt(0)]=n;return e})();function Zb(e,n,a){if(e!==null)for(n.queue=n.queue<<8|e,n.queuedBits+=8;n.queuedBits>=6;){const s=n.queue>>n.queuedBits-6&63;a(Bc[s]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const s=n.queue>>n.queuedBits-6&63;a(Bc[s]),n.queuedBits-=6}}function yS(e,n,a){const s=kD[e];if(s>-1)for(n.queue=n.queue<<6|s,n.queuedBits+=6;n.queuedBits>=8;)a(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function e0(e){const n=[],a=u=>{n.push(String.fromCodePoint(u))},s={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},c=u=>{MD(u,s,a)};for(let u=0;u<e.length;u+=1)yS(e.charCodeAt(u),o,c);return n.join("")}function jD(e,n){if(e<=127){n(e);return}else if(e<=2047){n(192|e>>6),n(128|e&63);return}else if(e<=65535){n(224|e>>12),n(128|e>>6&63),n(128|e&63);return}else if(e<=1114111){n(240|e>>18),n(128|e>>12&63),n(128|e>>6&63),n(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function DD(e,n){for(let a=0;a<e.length;a+=1){let s=e.charCodeAt(a);if(s>55295&&s<=56319){const o=(s-55296)*1024&65535;s=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}jD(s,n)}}function MD(e,n,a){if(n.utf8seq===0){if(e<=127){a(e);return}for(let s=1;s<6;s+=1)if((e>>7-s&1)===0){n.utf8seq=s;break}if(n.utf8seq===2)n.codepoint=e&31;else if(n.utf8seq===3)n.codepoint=e&15;else if(n.utf8seq===4)n.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|e&63,n.utf8seq-=1,n.utf8seq===0&&a(n.codepoint)}}function Gs(e){const n=[],a={queue:0,queuedBits:0},s=o=>{n.push(o)};for(let o=0;o<e.length;o+=1)yS(e.charCodeAt(o),a,s);return new Uint8Array(n)}function LD(e){const n=[];return DD(e,a=>n.push(a)),new Uint8Array(n)}function za(e){const n=[],a={queue:0,queuedBits:0},s=o=>{n.push(o)};return e.forEach(o=>Zb(o,a,s)),Zb(null,a,s),n.join("")}function UD(e){return Math.round(Date.now()/1e3)+e}function PD(){return Symbol("auth-callback")}const At=()=>typeof window<"u"&&typeof document<"u",Da={tested:!1,writable:!1},vS=()=>{if(!At())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Da.tested)return Da.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Da.tested=!0,Da.writable=!0}catch{Da.tested=!0,Da.writable=!1}return Da.writable};function zD(e){const n={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,c)=>{n[c]=o})}catch{}return a.searchParams.forEach((s,o)=>{n[o]=s}),n}const bS=e=>e?(...n)=>e(...n):(...n)=>fetch(...n),ID=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Hs=async(e,n,a)=>{await e.setItem(n,JSON.stringify(a))},Ma=async(e,n)=>{const a=await e.getItem(n);if(!a)return null;try{return JSON.parse(a)}catch{return a}},Rt=async(e,n)=>{await e.removeItem(n)};class cu{constructor(){this.promise=new cu.promiseConstructor((n,a)=>{this.resolve=n,this.reject=a})}}cu.promiseConstructor=Promise;function gc(e){const n=e.split(".");if(n.length!==3)throw new Dh("Invalid JWT structure");for(let s=0;s<n.length;s++)if(!TD.test(n[s]))throw new Dh("JWT not in base64url format");return{header:JSON.parse(e0(n[0])),payload:JSON.parse(e0(n[1])),signature:Gs(n[2]),raw:{header:n[0],payload:n[1]}}}async function BD(e){return await new Promise(n=>{setTimeout(()=>n(null),e)})}function $D(e,n){return new Promise((s,o)=>{(async()=>{for(let c=0;c<1/0;c++)try{const u=await e(c);if(!n(c,null,u)){s(u);return}}catch(u){if(!n(c,u)){o(u);return}}})()})}function HD(e){return("0"+e.toString(16)).substr(-2)}function qD(){const n=new Uint32Array(56);if(typeof crypto>"u"){const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=a.length;let o="";for(let c=0;c<56;c++)o+=a.charAt(Math.floor(Math.random()*s));return o}return crypto.getRandomValues(n),Array.from(n,HD).join("")}async function FD(e){const a=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(s);return Array.from(o).map(c=>String.fromCharCode(c)).join("")}async function VD(e){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."),e;const a=await FD(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ps(e,n,a=!1){const s=qD();let o=s;a&&(o+="/PASSWORD_RECOVERY"),await Hs(e,`${n}-code-verifier`,o);const c=await VD(s);return[c,s===c?"plain":"s256"]}const GD=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function YD(e){const n=e.headers.get(kh);if(!n||!n.match(GD))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function KD(e){if(!e)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(e<=n)throw new Error("JWT has expired")}function XD(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const QD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function zs(e){if(!QD.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Zf(){const e={};return new Proxy(e,{get:(n,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){const s=a.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="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 "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function WD(e,n){return new Proxy(e,{get:(a,s,o)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const c=s.toString();if(c==="Symbol(Symbol.toPrimitive)"||c==="Symbol(Symbol.toStringTag)"||c==="Symbol(util.inspect.custom)"||c==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(a,s,o)}return!n.value&&typeof s=="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."),n.value=!0),Reflect.get(a,s,o)}})}function t0(e){return JSON.parse(JSON.stringify(e))}const La=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),JD=[502,503,504];async function n0(e){var n;if(!ID(e))throw new jh(La(e),0);if(JD.includes(e.status))throw new jh(La(e),e.status);let a;try{a=await e.json()}catch(c){throw new Pa(La(c),c)}let s;const o=YD(e);if(o&&o.getTime()>=gS["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?s=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(s=a.error_code),s){if(s==="weak_password")throw new Wb(La(a),e.status,((n=a.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(s==="session_not_found")throw new rn}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((c,u)=>c&&typeof u=="string",!0))throw new Wb(La(a),e.status,a.weak_password.reasons);throw new RD(La(a),e.status||500,s)}const ZD=(e,n,a,s)=>{const o={method:e,headers:n?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),o.body=JSON.stringify(s),Object.assign(Object.assign({},o),a))};async function Ee(e,n,a,s){var o;const c=Object.assign({},s?.headers);c[kh]||(c[kh]=gS["2024-01-01"].name),s?.jwt&&(c.Authorization=`Bearer ${s.jwt}`);const u=(o=s?.query)!==null&&o!==void 0?o:{};s?.redirectTo&&(u.redirect_to=s.redirectTo);const f=Object.keys(u).length?"?"+new URLSearchParams(u).toString():"",p=await eM(e,n,a+f,{headers:c,noResolveJson:s?.noResolveJson},{},s?.body);return s?.xform?s?.xform(p):{data:Object.assign({},p),error:null}}async function eM(e,n,a,s,o,c){const u=ZD(n,s,o,c);let f;try{f=await e(a,Object.assign({},u))}catch(p){throw console.error(p),new jh(La(p),0)}if(f.ok||await n0(f),s?.noResolveJson)return f;try{return await f.json()}catch(p){await n0(p)}}function _n(e){var n;let a=null;rM(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=UD(e.expires_in)));const s=(n=e.user)!==null&&n!==void 0?n:e;return{data:{session:a,user:s},error:null}}function r0(e){const n=_n(e);return!n.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,s)=>a&&typeof s=="string",!0)&&(n.data.weak_password=e.weak_password),n}function ra(e){var n;return{data:{user:(n=e.user)!==null&&n!==void 0?n:e},error:null}}function tM(e){return{data:e,error:null}}function nM(e){const{action_link:n,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c}=e,u=ni(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),f={action_link:n,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c},p=Object.assign({},u);return{data:{properties:f,user:p},error:null}}function a0(e){return e}function rM(e){return e.access_token&&e.refresh_token&&e.expires_in}const eh=["global","local","others"];class aM{constructor({url:n="",headers:a={},fetch:s}){this.url=n,this.headers=a,this.fetch=bS(s),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)}}async signOut(n,a=eh[0]){if(eh.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${eh.join(", ")}`);try{return await Ee(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(s){if(pe(s))return{data:null,error:s};throw s}}async inviteUserByEmail(n,a={}){try{return await Ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:ra})}catch(s){if(pe(s))return{data:{user:null},error:s};throw s}}async generateLink(n){try{const{options:a}=n,s=ni(n,["options"]),o=Object.assign(Object.assign({},s),a);return"newEmail"in s&&(o.new_email=s?.newEmail,delete o.newEmail),await Ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:nM,redirectTo:a?.redirectTo})}catch(a){if(pe(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(n){try{return await Ee(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:ra})}catch(a){if(pe(a))return{data:{user:null},error:a};throw a}}async listUsers(n){var a,s,o,c,u,f,p;try{const m={nextPage:null,lastPage:0,total:0},y=await Ee(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=n?.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=n?.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:a0});if(y.error)throw y.error;const g=await y.json(),x=(u=y.headers.get("x-total-count"))!==null&&u!==void 0?u:0,S=(p=(f=y.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&p!==void 0?p:[];return S.length>0&&(S.forEach(_=>{const E=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),T=JSON.parse(_.split(";")[1].split("=")[1]);m[`${T}Page`]=E}),m.total=parseInt(x)),{data:Object.assign(Object.assign({},g),m),error:null}}catch(m){if(pe(m))return{data:{users:[]},error:m};throw m}}async getUserById(n){zs(n);try{return await Ee(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:ra})}catch(a){if(pe(a))return{data:{user:null},error:a};throw a}}async updateUserById(n,a){zs(n);try{return await Ee(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:a,headers:this.headers,xform:ra})}catch(s){if(pe(s))return{data:{user:null},error:s};throw s}}async deleteUser(n,a=!1){zs(n);try{return await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:a},xform:ra})}catch(s){if(pe(s))return{data:{user:null},error:s};throw s}}async _listFactors(n){zs(n.userId);try{const{data:a,error:s}=await Ee(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:s}}catch(a){if(pe(a))return{data:null,error:a};throw a}}async _deleteFactor(n){zs(n.userId),zs(n.id);try{return{data:await Ee(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(a){if(pe(a))return{data:null,error:a};throw a}}async _listOAuthClients(n){var a,s,o,c,u,f,p;try{const m={nextPage:null,lastPage:0,total:0},y=await Ee(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=n?.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=n?.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:a0});if(y.error)throw y.error;const g=await y.json(),x=(u=y.headers.get("x-total-count"))!==null&&u!==void 0?u:0,S=(p=(f=y.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&p!==void 0?p:[];return S.length>0&&(S.forEach(_=>{const E=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),T=JSON.parse(_.split(";")[1].split("=")[1]);m[`${T}Page`]=E}),m.total=parseInt(x)),{data:Object.assign(Object.assign({},g),m),error:null}}catch(m){if(pe(m))return{data:{clients:[]},error:m};throw m}}async _createOAuthClient(n){try{return await Ee(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(pe(a))return{data:null,error:a};throw a}}async _getOAuthClient(n){try{return await Ee(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(pe(a))return{data:null,error:a};throw a}}async _updateOAuthClient(n,a){try{return await Ee(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:a,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(pe(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(n){try{return await Ee(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(pe(a))return{data:null,error:a};throw a}}async _regenerateOAuthClientSecret(n){try{return await Ee(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(pe(a))return{data:null,error:a};throw a}}}function s0(e={}){return{getItem:n=>e[n]||null,setItem:(n,a)=>{e[n]=a},removeItem:n=>{delete e[n]}}}const pr={debug:!!(globalThis&&vS()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class wS extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}class sM extends wS{}async function iM(e,n,a){pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,n);const s=new globalThis.AbortController;n>0&&setTimeout(()=>{s.abort(),pr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},n),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,n===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async o=>{if(o){pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(n===0)throw pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new sM(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(pr.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"),await a()}})}catch(o){if(o?.name==="AbortError"&&n>0)return pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${n}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async c=>{if(c){pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,c.name);try{return await a()}finally{pr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,c.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await a()}));throw o}}function oM(){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 xS(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function lM(e){return parseInt(e,16)}function cM(e){const n=new TextEncoder().encode(e);return"0x"+Array.from(n,s=>s.toString(16).padStart(2,"0")).join("")}function uM(e){var n;const{chainId:a,domain:s,expirationTime:o,issuedAt:c=new Date,nonce:u,notBefore:f,requestId:p,resources:m,scheme:y,uri:g,version:x}=e;{if(!Number.isInteger(a))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${a}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(u&&u.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${u}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(x!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${x}`);if(!((n=e.statement)===null||n===void 0)&&n.includes(`
82
- `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const S=xS(e.address),_=y?`${y}://${s}`:s,E=e.statement?`${e.statement}
83
- `:"",T=`${_} wants you to sign in with your Ethereum account:
84
- ${S}
85
-
86
- ${E}`;let R=`URI: ${g}
87
- Version: ${x}
88
- Chain ID: ${a}${u?`
89
- Nonce: ${u}`:""}
90
- Issued At: ${c.toISOString()}`;if(o&&(R+=`
91
- Expiration Time: ${o.toISOString()}`),f&&(R+=`
92
- Not Before: ${f.toISOString()}`),p&&(R+=`
93
- Request ID: ${p}`),m){let O=`
94
- Resources:`;for(const A of m){if(!A||typeof A!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${A}`);O+=`
95
- - ${A}`}R+=O}return`${T}
96
- ${R}`}class ft extends Error{constructor({message:n,code:a,cause:s,name:o}){var c;super(n,{cause:s}),this.__isWebAuthnError=!0,this.name=(c=o??(s instanceof Error?s.name:void 0))!==null&&c!==void 0?c:"Unknown Error",this.code=a}}class $c extends ft{constructor(n,a){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a,message:n}),this.name="WebAuthnUnknownError",this.originalError=a}}function dM({error:e,options:n}){var a,s,o;const{publicKey:c}=n;if(!c)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(n.signal instanceof AbortSignal)return new ft({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((a=c.authenticatorSelection)===null||a===void 0?void 0:a.requireResidentKey)===!0)return new ft({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(n.mediation==="conditional"&&((s=c.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ft({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=c.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new ft({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ft({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ft({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return c.pubKeyCredParams.filter(f=>f.type==="public-key").length===0?new ft({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ft({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const u=window.location.hostname;if(SS(u)){if(c.rp.id!==u)return new ft({message:`The RP ID "${c.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ft({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(c.user.id.byteLength<1||c.user.id.byteLength>64)return new ft({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ft({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ft({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function fM({error:e,options:n}){const{publicKey:a}=n;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(n.signal instanceof AbortSignal)return new ft({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ft({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(SS(s)){if(a.rpId!==s)return new ft({message:`The RP ID "${a.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ft({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ft({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ft({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class hM{createNewAbortSignal(){if(this.controller){const a=new Error("Cancelling existing WebAuthn API call for new one");a.name="AbortError",this.controller.abort(a)}const n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){const n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0}}}const pM=new hM;function mM(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:n,user:a,excludeCredentials:s}=e,o=ni(e,["challenge","user","excludeCredentials"]),c=Gs(n).buffer,u=Object.assign(Object.assign({},a),{id:Gs(a.id).buffer}),f=Object.assign(Object.assign({},o),{challenge:c,user:u});if(s&&s.length>0){f.excludeCredentials=new Array(s.length);for(let p=0;p<s.length;p++){const m=s[p];f.excludeCredentials[p]=Object.assign(Object.assign({},m),{id:Gs(m.id).buffer,type:m.type||"public-key",transports:m.transports})}}return f}function gM(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:n,allowCredentials:a}=e,s=ni(e,["challenge","allowCredentials"]),o=Gs(n).buffer,c=Object.assign(Object.assign({},s),{challenge:o});if(a&&a.length>0){c.allowCredentials=new Array(a.length);for(let u=0;u<a.length;u++){const f=a[u];c.allowCredentials[u]=Object.assign(Object.assign({},f),{id:Gs(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return c}function yM(e){var n;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e;return{id:e.id,rawId:e.id,response:{attestationObject:za(new Uint8Array(e.response.attestationObject)),clientDataJSON:za(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(n=a.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function vM(e){var n;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e,s=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:za(new Uint8Array(o.authenticatorData)),clientDataJSON:za(new Uint8Array(o.clientDataJSON)),signature:za(new Uint8Array(o.signature)),userHandle:o.userHandle?za(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(n=a.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function SS(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function i0(){var e,n;return!!(At()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function bM(e){try{const n=await navigator.credentials.create(e);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new $c("Browser returned unexpected credential type",n)}:{data:null,error:new $c("Empty credential response",n)}}catch(n){return{data:null,error:dM({error:n,options:e})}}}async function wM(e){try{const n=await navigator.credentials.get(e);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new $c("Browser returned unexpected credential type",n)}:{data:null,error:new $c("Empty credential response",n)}}catch(n){return{data:null,error:fM({error:n,options:e})}}}const xM={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},SM={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Hc(...e){const n=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),a=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),s={};for(const o of e)if(o)for(const c in o){const u=o[c];if(u!==void 0)if(Array.isArray(u))s[c]=u;else if(a(u))s[c]=u;else if(n(u)){const f=s[c];n(f)?s[c]=Hc(f,u):s[c]=Hc(u)}else s[c]=u}return s}function EM(e,n){return Hc(xM,e,n||{})}function _M(e,n){return Hc(SM,e,n||{})}class TM{constructor(n){this.client=n,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(n){return this.client.mfa.enroll(Object.assign(Object.assign({},n),{factorType:"webauthn"}))}async _challenge({factorId:n,webauthn:a,friendlyName:s,signal:o},c){var u;try{const{data:f,error:p}=await this.client.mfa.challenge({factorId:n,webauthn:a});if(!f)return{data:null,error:p};const m=o??pM.createNewAbortSignal();if(f.webauthn.type==="create"){const{user:y}=f.webauthn.credential_options.publicKey;if(!y.name){const g=s;if(g)y.name=`${y.id}:${g}`;else{const S=(await this.client.getUser()).data.user,_=((u=S?.user_metadata)===null||u===void 0?void 0:u.name)||S?.email||S?.id||"User";y.name=`${y.id}:${_}`}}y.displayName||(y.displayName=y.name)}switch(f.webauthn.type){case"create":{const y=EM(f.webauthn.credential_options.publicKey,c?.create),{data:g,error:x}=await bM({publicKey:y,signal:m});return g?{data:{factorId:n,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:x}}case"request":{const y=_M(f.webauthn.credential_options.publicKey,c?.request),{data:g,error:x}=await wM(Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:y,signal:m}));return g?{data:{factorId:n,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:x}}}}catch(f){return pe(f)?{data:null,error:f}:{data:null,error:new Pa("Unexpected error in challenge",f)}}}async _verify({challengeId:n,factorId:a,webauthn:s}){return this.client.mfa.verify({factorId:a,challengeId:n,webauthn:s})}async _authenticate({factorId:n,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new To("rpId is required for WebAuthn authentication")};try{if(!i0())return{data:null,error:new Pa("Browser does not support WebAuthn",null)};const{data:u,error:f}=await this.challenge({factorId:n,webauthn:{rpId:a,rpOrigins:s},signal:o},{request:c});if(!u)return{data:null,error:f};const{webauthn:p}=u;return this._verify({factorId:n,challengeId:u.challengeId,webauthn:{type:p.type,rpId:a,rpOrigins:s,credential_response:p.credential_response}})}catch(u){return pe(u)?{data:null,error:u}:{data:null,error:new Pa("Unexpected error in authenticate",u)}}}async _register({friendlyName:n,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new To("rpId is required for WebAuthn registration")};try{if(!i0())return{data:null,error:new Pa("Browser does not support WebAuthn",null)};const{data:u,error:f}=await this._enroll({friendlyName:n});if(!u)return await this.client.mfa.listFactors().then(y=>{var g;return(g=y.data)===null||g===void 0?void 0:g.all.find(x=>x.factor_type==="webauthn"&&x.friendly_name===n&&x.status!=="unverified")}).then(y=>y?this.client.mfa.unenroll({factorId:y?.id}):void 0),{data:null,error:f};const{data:p,error:m}=await this._challenge({factorId:u.id,friendlyName:u.friendly_name,webauthn:{rpId:a,rpOrigins:s},signal:o},{create:c});return p?this._verify({factorId:u.id,challengeId:p.challengeId,webauthn:{rpId:a,rpOrigins:s,type:p.webauthn.type,credential_response:p.webauthn.credential_response}}):{data:null,error:m}}catch(u){return pe(u)?{data:null,error:u}:{data:null,error:new Pa("Unexpected error in register",u)}}}}oM();const CM={url:SD,storageKey:ED,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:_D,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function o0(e,n,a){return await a()}const Is={};class Co{get jwks(){var n,a;return(a=(n=Is[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(n){Is[this.storageKey]=Object.assign(Object.assign({},Is[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,a;return(a=(n=Is[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){Is[this.storageKey]=Object.assign(Object.assign({},Is[this.storageKey]),{cachedAt:n})}constructor(n){var a,s,o;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({},CM),n);if(this.storageKey=c.storageKey,this.instanceID=(a=Co.nextInstanceID[this.storageKey])!==null&&a!==void 0?a:0,Co.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&At()){const u=`${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(u),this.logDebugMessages&&console.trace(u)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.admin=new aM({url:c.url,headers:c.headers,fetch:c.fetch}),this.url=c.url,this.headers=c.headers,this.fetch=bS(c.fetch),this.lock=c.lock||o0,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&&At()&&(!((s=globalThis?.navigator)===null||s===void 0)&&s.locks)?this.lock=iM:this.lock=o0,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 TM(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.persistSession?(c.storage?this.storage=c.storage:vS()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=s0(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=s0(this.memoryStorage)),At()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(u){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",u)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async u=>{this._debug("received broadcast notification from other tab or client",u);try{await this._notifyAllSubscribers(u.data.event,u.data.session,!1)}catch(f){this._debug("#broadcastChannel","error",f)}})}c.skipAutoInitialize||this.initialize().catch(u=>{this._debug("#initialize()","error",u)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${mS}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),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 n;try{let a={},s="none";if(At()&&(a=zD(window.location.href),this._isImplicitGrantCallback(a)?s="implicit":await this._isPKCECallback(a)&&(s="pkce")),At()&&this.detectSessionInUrl&&s!=="none"){const{data:o,error:c}=await this._getSessionFromURL(a,s);if(c){if(this._debug("#_initialize()","error detecting session from URL",c),OD(c)){const p=(n=c.details)===null||n===void 0?void 0:n.code;if(p==="identity_already_exists"||p==="identity_not_found"||p==="single_identity_not_deletable")return{error:c}}return{error:c}}const{session:u,redirectType:f}=o;return this._debug("#_initialize()","detected session in URL",u,"redirect type",f),await this._saveSession(u),setTimeout(async()=>{f==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",u):await this._notifyAllSubscribers("SIGNED_IN",u)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return pe(a)?this._returnResult({error:a}):this._returnResult({error:new Pa("Unexpected error during initialization",a)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var a,s,o;try{const c=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(a=n?.options)===null||a===void 0?void 0:a.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(o=n?.options)===null||o===void 0?void 0:o.captchaToken}},xform:_n}),{data:u,error:f}=c;if(f||!u)return this._returnResult({data:{user:null,session:null},error:f});const p=u.session,m=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:m,session:p},error:null})}catch(c){if(pe(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signUp(n){var a,s,o;try{let c;if("email"in n){const{email:y,password:g,options:x}=n;let S=null,_=null;this.flowType==="pkce"&&([S,_]=await Ps(this.storage,this.storageKey)),c=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x?.emailRedirectTo,body:{email:y,password:g,data:(a=x?.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:x?.captchaToken},code_challenge:S,code_challenge_method:_},xform:_n})}else if("phone"in n){const{phone:y,password:g,options:x}=n;c=await Ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:y,password:g,data:(s=x?.data)!==null&&s!==void 0?s:{},channel:(o=x?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:x?.captchaToken}},xform:_n})}else throw new pc("You must provide either an email or phone number and a password");const{data:u,error:f}=c;if(f||!u)return await Rt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:f});const p=u.session,m=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",p)),this._returnResult({data:{user:m,session:p},error:null})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithPassword(n){try{let a;if("email"in n){const{email:c,password:u,options:f}=n;a=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:u,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:r0})}else if("phone"in n){const{phone:c,password:u,options:f}=n;a=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:u,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:r0})}else throw new pc("You must provide either an email or phone number and a password");const{data:s,error:o}=a;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!s||!s.session||!s.user){const c=new Us;return this._returnResult({data:{user:null,session:null},error:c})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:o})}catch(a){if(pe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOAuth(n){var a,s,o,c;return await this._handleProviderSignIn(n.provider,{redirectTo:(a=n.options)===null||a===void 0?void 0:a.redirectTo,scopes:(s=n.options)===null||s===void 0?void 0:s.scopes,queryParams:(o=n.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(c=n.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n))}async signInWithWeb3(n){const{chain:a}=n;switch(a){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}}async signInWithEthereum(n){var a,s,o,c,u,f,p,m,y,g,x;let S,_;if("message"in n)S=n.message,_=n.signature;else{const{chain:E,wallet:T,statement:R,options:O}=n;let A;if(At())if(typeof T=="object")A=T;else{const ne=window;if("ethereum"in ne&&typeof ne.ethereum=="object"&&"request"in ne.ethereum&&typeof ne.ethereum.request=="function")A=ne.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 T!="object"||!O?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=T}const k=new URL((a=O?.url)!==null&&a!==void 0?a:window.location.href),I=await A.request({method:"eth_requestAccounts"}).then(ne=>ne).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!I||I.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const B=xS(I[0]);let $=(s=O?.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!$){const ne=await A.request({method:"eth_chainId"});$=lM(ne)}const q={domain:k.host,address:B,statement:R,uri:k.href,version:"1",chainId:$,nonce:(o=O?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(u=(c=O?.signInWithEthereum)===null||c===void 0?void 0:c.issuedAt)!==null&&u!==void 0?u:new Date,expirationTime:(f=O?.signInWithEthereum)===null||f===void 0?void 0:f.expirationTime,notBefore:(p=O?.signInWithEthereum)===null||p===void 0?void 0:p.notBefore,requestId:(m=O?.signInWithEthereum)===null||m===void 0?void 0:m.requestId,resources:(y=O?.signInWithEthereum)===null||y===void 0?void 0:y.resources};S=uM(q),_=await A.request({method:"personal_sign",params:[cM(S),B]})}try{const{data:E,error:T}=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:S,signature:_},!((g=n.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(x=n.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:_n});if(T)throw T;if(!E||!E.session||!E.user){const R=new Us;return this._returnResult({data:{user:null,session:null},error:R})}return E.session&&(await this._saveSession(E.session),await this._notifyAllSubscribers("SIGNED_IN",E.session)),this._returnResult({data:Object.assign({},E),error:T})}catch(E){if(pe(E))return this._returnResult({data:{user:null,session:null},error:E});throw E}}async signInWithSolana(n){var a,s,o,c,u,f,p,m,y,g,x,S;let _,E;if("message"in n)_=n.message,E=n.signature;else{const{chain:T,wallet:R,statement:O,options:A}=n;let k;if(At())if(typeof R=="object")k=R;else{const B=window;if("solana"in B&&typeof B.solana=="object"&&("signIn"in B.solana&&typeof B.solana.signIn=="function"||"signMessage"in B.solana&&typeof B.solana.signMessage=="function"))k=B.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 R!="object"||!A?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=R}const I=new URL((a=A?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in k&&k.signIn){const B=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},A?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),O?{statement:O}:null));let $;if(Array.isArray(B)&&B[0]&&typeof B[0]=="object")$=B[0];else if(B&&typeof B=="object"&&"signedMessage"in B&&"signature"in B)$=B;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in $&&"signature"in $&&(typeof $.signedMessage=="string"||$.signedMessage instanceof Uint8Array)&&$.signature instanceof Uint8Array)_=typeof $.signedMessage=="string"?$.signedMessage:new TextDecoder().decode($.signedMessage),E=$.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");_=[`${I.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...O?["",O,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(s=A?.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((c=A?.signInWithSolana)===null||c===void 0)&&c.notBefore?[`Not Before: ${A.signInWithSolana.notBefore}`]:[],...!((u=A?.signInWithSolana)===null||u===void 0)&&u.expirationTime?[`Expiration Time: ${A.signInWithSolana.expirationTime}`]:[],...!((f=A?.signInWithSolana)===null||f===void 0)&&f.chainId?[`Chain ID: ${A.signInWithSolana.chainId}`]:[],...!((p=A?.signInWithSolana)===null||p===void 0)&&p.nonce?[`Nonce: ${A.signInWithSolana.nonce}`]:[],...!((m=A?.signInWithSolana)===null||m===void 0)&&m.requestId?[`Request ID: ${A.signInWithSolana.requestId}`]:[],...!((g=(y=A?.signInWithSolana)===null||y===void 0?void 0:y.resources)===null||g===void 0)&&g.length?["Resources",...A.signInWithSolana.resources.map($=>`- ${$}`)]:[]].join(`
97
- `);const B=await k.signMessage(new TextEncoder().encode(_),"utf8");if(!B||!(B instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");E=B}}try{const{data:T,error:R}=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:_,signature:za(E)},!((x=n.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(S=n.options)===null||S===void 0?void 0:S.captchaToken}}:null),xform:_n});if(R)throw R;if(!T||!T.session||!T.user){const O=new Us;return this._returnResult({data:{user:null,session:null},error:O})}return T.session&&(await this._saveSession(T.session),await this._notifyAllSubscribers("SIGNED_IN",T.session)),this._returnResult({data:Object.assign({},T),error:R})}catch(T){if(pe(T))return this._returnResult({data:{user:null,session:null},error:T});throw T}}async _exchangeCodeForSession(n){const a=await Ma(this.storage,`${this.storageKey}-code-verifier`),[s,o]=(a??"").split("/");try{if(!s&&this.flowType==="pkce")throw new ND;const{data:c,error:u}=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:s},xform:_n});if(await Rt(this.storage,`${this.storageKey}-code-verifier`),u)throw u;if(!c||!c.session||!c.user){const f=new Us;return this._returnResult({data:{user:null,session:null,redirectType:null},error:f})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:Object.assign(Object.assign({},c),{redirectType:o??null}),error:u})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(c))return this._returnResult({data:{user:null,session:null,redirectType:null},error:c});throw c}}async signInWithIdToken(n){try{const{options:a,provider:s,token:o,access_token:c,nonce:u}=n,f=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:o,access_token:c,nonce:u,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:_n}),{data:p,error:m}=f;if(m)return this._returnResult({data:{user:null,session:null},error:m});if(!p||!p.session||!p.user){const y=new Us;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:m})}catch(a){if(pe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOtp(n){var a,s,o,c,u;try{if("email"in n){const{email:f,options:p}=n;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await Ps(this.storage,this.storageKey));const{error:g}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:f,data:(a=p?.data)!==null&&a!==void 0?a:{},create_user:(s=p?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},code_challenge:m,code_challenge_method:y},redirectTo:p?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in n){const{phone:f,options:p}=n,{data:m,error:y}=await Ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:f,data:(o=p?.data)!==null&&o!==void 0?o:{},create_user:(c=p?.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:p?.captchaToken},channel:(u=p?.channel)!==null&&u!==void 0?u:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:m?.message_id},error:y})}throw new pc("You must provide either an email or phone number.")}catch(f){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(f))return this._returnResult({data:{user:null,session:null},error:f});throw f}}async verifyOtp(n){var a,s;try{let o,c;"options"in n&&(o=(a=n.options)===null||a===void 0?void 0:a.redirectTo,c=(s=n.options)===null||s===void 0?void 0:s.captchaToken);const{data:u,error:f}=await Ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:c}}),redirectTo:o,xform:_n});if(f)throw f;if(!u)throw new Error("An error occurred on token verification.");const p=u.session,m=u.user;return p?.access_token&&(await this._saveSession(p),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",p)),this._returnResult({data:{user:m,session:p},error:null})}catch(o){if(pe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(n){var a,s,o,c,u;try{let f=null,p=null;this.flowType==="pkce"&&([f,p]=await Ps(this.storage,this.storageKey));const m=await Ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in n?{provider_id:n.providerId}:null),"domain"in n?{domain:n.domain}:null),{redirect_to:(s=(a=n.options)===null||a===void 0?void 0:a.redirectTo)!==null&&s!==void 0?s:void 0}),!((o=n?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:f,code_challenge_method:p}),headers:this.headers,xform:tM});return!((c=m.data)===null||c===void 0)&&c.url&&At()&&!(!((u=n.options)===null||u===void 0)&&u.skipBrowserRedirect)&&window.location.assign(m.data.url),this._returnResult(m)}catch(f){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(f))return this._returnResult({data:null,error:f});throw f}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async n=>{const{data:{session:a},error:s}=n;if(s)throw s;if(!a)throw new rn;const{error:o}=await Ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(n){if(pe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const a=`${this.url}/resend`;if("email"in n){const{email:s,type:o,options:c}=n,{error:u}=await Ee(this.fetch,"POST",a,{headers:this.headers,body:{email:s,type:o,gotrue_meta_security:{captcha_token:c?.captchaToken}},redirectTo:c?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}else if("phone"in n){const{phone:s,type:o,options:c}=n,{data:u,error:f}=await Ee(this.fetch,"POST",a,{headers:this.headers,body:{phone:s,type:o,gotrue_meta_security:{captcha_token:c?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:u?.message_id},error:f})}throw new pc("You must provide either an email or phone number and a type")}catch(a){if(pe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async a=>a))}async _acquireLock(n,a){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await s,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=a();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(n){this._debug("#_useSession","begin");try{const a=await this.__loadSession();return await n(a)}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 n=null;const a=await Ma(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?n=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!n)return{data:{session:null},error:null};const s=n.expires_at?n.expires_at*1e3-Date.now()<Qf:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",n.expires_at),!s){if(this.userStorage){const u=await Ma(this.userStorage,this.storageKey+"-user");u?.user?n.user=u.user:n.user=Zf()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const u={value:this.suppressGetSessionWarning};n.user=WD(n.user,u),u.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:o,error:c}=await this._callRefreshToken(n.refresh_token);return c?this._returnResult({data:{session:null},error:c}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;const a=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return a.data.user&&(this.suppressGetSessionWarning=!0),a}async _getUser(n){try{return n?await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:ra}):await this._useSession(async a=>{var s,o,c;const{data:u,error:f}=a;if(f)throw f;return!(!((s=u.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new rn}:await Ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(o=u.session)===null||o===void 0?void 0:o.access_token)!==null&&c!==void 0?c:void 0,xform:ra})})}catch(a){if(pe(a))return Wf(a)&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:a});throw a}}async updateUser(n,a={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,a))}async _updateUser(n,a={}){try{return await this._useSession(async s=>{const{data:o,error:c}=s;if(c)throw c;if(!o.session)throw new rn;const u=o.session;let f=null,p=null;this.flowType==="pkce"&&n.email!=null&&([f,p]=await Ps(this.storage,this.storageKey));const{data:m,error:y}=await Ee(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:f,code_challenge_method:p}),jwt:u.access_token,xform:ra});if(y)throw y;return u.user=m.user,await this._saveSession(u),await this._notifyAllSubscribers("USER_UPDATED",u),this._returnResult({data:{user:u.user},error:null})})}catch(s){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(n){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(n))}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new rn;const a=Date.now()/1e3;let s=a,o=!0,c=null;const{payload:u}=gc(n.access_token);if(u.exp&&(s=u.exp,o=s<=a),o){const{data:f,error:p}=await this._callRefreshToken(n.refresh_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!f)return{data:{user:null,session:null},error:null};c=f}else{const{data:f,error:p}=await this._getUser(n.access_token);if(p)return this._returnResult({data:{user:null,session:null},error:p});c={access_token:n.access_token,refresh_token:n.refresh_token,user:f.user,token_type:"bearer",expires_in:s-a,expires_at:s},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return this._returnResult({data:{user:c.user,session:c},error:null})}catch(a){if(pe(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}}async refreshSession(n){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(n))}async _refreshSession(n){try{return await this._useSession(async a=>{var s;if(!n){const{data:u,error:f}=a;if(f)throw f;n=(s=u.session)!==null&&s!==void 0?s:void 0}if(!n?.refresh_token)throw new rn;const{data:o,error:c}=await this._callRefreshToken(n.refresh_token);return c?this._returnResult({data:{user:null,session:null},error:c}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(a){if(pe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async _getSessionFromURL(n,a){try{if(!At())throw new mc("No browser detected.");if(n.error||n.error_description||n.error_code)throw new mc(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new Qb("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new mc("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new Qb("No code detected.");const{data:O,error:A}=await this._exchangeCodeForSession(n.code);if(A)throw A;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:O.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:c,refresh_token:u,expires_in:f,expires_at:p,token_type:m}=n;if(!c||!f||!u||!m)throw new mc("No session defined in URL");const y=Math.round(Date.now()/1e3),g=parseInt(f);let x=y+g;p&&(x=parseInt(p));const S=x-y;S*1e3<=$s&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${S}s, should have been closer to ${g}s`);const _=x-g;y-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,x,y):y-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,x,y);const{data:E,error:T}=await this._getUser(c);if(T)throw T;const R={provider_token:s,provider_refresh_token:o,access_token:c,expires_in:g,expires_at:x,refresh_token:u,token_type:m,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:R,redirectType:n.type},error:null})}catch(s){if(pe(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(n){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),n):!!(n.access_token||n.error_description)}async _isPKCECallback(n){const a=await Ma(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&a)}async signOut(n={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(n))}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c&&!Wf(c))return this._returnResult({error:c});const u=(s=o.session)===null||s===void 0?void 0:s.access_token;if(u){const{error:f}=await this.admin.signOut(u,n);if(f&&!(AD(f)&&(f.status===404||f.status===401||f.status===403)||Wf(f)))return this._returnResult({error:f})}return n!=="others"&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const a=PD(),s={id:a,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,s),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:s}}}async _emitInitialSession(n){return await this._useSession(async a=>{var s,o;try{const{data:{session:c},error:u}=a;if(u)throw u;await((s=this.stateChangeEmitters.get(n))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",n,"session",c)}catch(c){await((o=this.stateChangeEmitters.get(n))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",c),console.error(c)}})}async resetPasswordForEmail(n,a={}){let s=null,o=null;this.flowType==="pkce"&&([s,o]=await Ps(this.storage,this.storageKey,!0));try{return await Ee(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:s,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(c))return this._returnResult({data:null,error:c});throw c}}async getUserIdentities(){var n;try{const{data:a,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(n=a.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var a;try{const{data:s,error:o}=await this._useSession(async c=>{var u,f,p,m,y;const{data:g,error:x}=c;if(x)throw x;const S=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(u=n.options)===null||u===void 0?void 0:u.redirectTo,scopes:(f=n.options)===null||f===void 0?void 0:f.scopes,queryParams:(p=n.options)===null||p===void 0?void 0:p.queryParams,skipBrowserRedirect:!0});return await Ee(this.fetch,"GET",S,{headers:this.headers,jwt:(y=(m=g.session)===null||m===void 0?void 0:m.access_token)!==null&&y!==void 0?y:void 0})});if(o)throw o;return At()&&!(!((a=n.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(s?.url),this._returnResult({data:{provider:n.provider,url:s?.url},error:null})}catch(s){if(pe(s))return this._returnResult({data:{provider:n.provider,url:null},error:s});throw s}}async linkIdentityIdToken(n){return await this._useSession(async a=>{var s;try{const{error:o,data:{session:c}}=a;if(o)throw o;const{options:u,provider:f,token:p,access_token:m,nonce:y}=n,g=await Ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=c?.access_token)!==null&&s!==void 0?s:void 0,body:{provider:f,id_token:p,access_token:m,nonce:y,link_identity:!0,gotrue_meta_security:{captcha_token:u?.captchaToken}},xform:_n}),{data:x,error:S}=g;return S?this._returnResult({data:{user:null,session:null},error:S}):!x||!x.session||!x.user?this._returnResult({data:{user:null,session:null},error:new Us}):(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("USER_UPDATED",x.session)),this._returnResult({data:x,error:S}))}catch(o){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),pe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(n){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)throw u;return await Ee(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(o=(s=c.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async _refreshAccessToken(n){const a=`#_refreshAccessToken(${n.substring(0,5)}...)`;this._debug(a,"begin");try{const s=Date.now();return await $D(async o=>(o>0&&await BD(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await Ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:_n})),(o,c)=>{const u=200*Math.pow(2,o);return c&&Jf(c)&&Date.now()+u-s<$s})}catch(s){if(this._debug(a,"error",s),pe(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(a,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,a){const s=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",a,"url",s),At()&&!a.skipBrowserRedirect&&window.location.assign(s),{data:{provider:n,url:s},error:null}}async _recoverAndRefresh(){var n,a;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await Ma(this.storage,this.storageKey);if(o&&this.userStorage){let u=await Ma(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!u&&(u={user:o.user},await Hs(this.userStorage,this.storageKey+"-user",u)),o.user=(n=u?.user)!==null&&n!==void 0?n:Zf()}else if(o&&!o.user&&!o.user){const u=await Ma(this.storage,this.storageKey+"-user");u&&u?.user?(o.user=u.user,await Rt(this.storage,this.storageKey+"-user"),await Hs(this.storage,this.storageKey,o)):o.user=Zf()}if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const c=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<Qf;if(this._debug(s,`session has${c?"":" not"} expired with margin of ${Qf}s`),c){if(this.autoRefreshToken&&o.refresh_token){const{error:u}=await this._callRefreshToken(o.refresh_token);u&&(console.error(u),Jf(u)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",u),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:u,error:f}=await this._getUser(o.access_token);!f&&u?.user?(o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(u){console.error("Error getting user data:",u),this._debug(s,"error getting user data, skipping SIGNED_IN notification",u)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(n){var a,s;if(!n)throw new rn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${n.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new cu;const{data:c,error:u}=await this._refreshAccessToken(n);if(u)throw u;if(!c.session)throw new rn;await this._saveSession(c.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",c.session);const f={data:c.session,error:null};return this.refreshingDeferred.resolve(f),f}catch(c){if(this._debug(o,"error",c),pe(c)){const u={data:null,error:c};return Jf(c)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(u),u}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(c),c}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(n,a,s=!0){const o=`#_notifyAllSubscribers(${n})`;this._debug(o,"begin",a,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:n,session:a});const c=[],u=Array.from(this.stateChangeEmitters.values()).map(async f=>{try{await f.callback(n,a)}catch(p){c.push(p)}});if(await Promise.all(u),c.length>0){for(let f=0;f<c.length;f+=1)console.error(c[f]);throw c[0]}}finally{this._debug(o,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0,await Rt(this.storage,`${this.storageKey}-code-verifier`);const a=Object.assign({},n),s=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&a.user&&await Hs(this.userStorage,this.storageKey+"-user",{user:a.user});const o=Object.assign({},a);delete o.user;const c=t0(o);await Hs(this.storage,this.storageKey,c)}else{const o=t0(a);await Hs(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Rt(this.storage,this.storageKey),await Rt(this.storage,this.storageKey+"-code-verifier"),await Rt(this.storage,this.storageKey+"-user"),this.userStorage&&await Rt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&At()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",n)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),$s);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);const a=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=a,a&&typeof a=="object"&&typeof a.unref=="function"?a.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(a)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);const a=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,a&&clearTimeout(a)}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 n=Date.now();try{return await this._useSession(async a=>{const{data:{session:s}}=a;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((s.expires_at*1e3-n)/$s);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${$s}ms, refresh threshold is ${Nh} ticks`),o<=Nh&&await this._callRefreshToken(s.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n.isAcquireTimeout||n instanceof wS)this._debug("auto refresh token tick lock not available");else throw n}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!At()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(n){this._debug("#visibilityChangedCallback","error",n)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const a=`#_onVisibilityChanged(${n})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),n||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"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(n,a,s){const o=[`provider=${encodeURIComponent(a)}`];if(s?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s?.scopes&&o.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[c,u]=await Ps(this.storage,this.storageKey),f=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(u)}`});o.push(f.toString())}if(s?.queryParams){const c=new URLSearchParams(s.queryParams);o.push(c.toString())}return s?.skipBrowserRedirect&&o.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${n}?${o.join("&")}`}async _unenroll(n){try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;return c?this._returnResult({data:null,error:c}):await Ee(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token})})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async _enroll(n){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)return this._returnResult({data:null,error:u});const f=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:p,error:m}=await Ee(this.fetch,"POST",`${this.url}/factors`,{body:f,headers:this.headers,jwt:(s=c?.session)===null||s===void 0?void 0:s.access_token});return m?this._returnResult({data:null,error:m}):(n.factorType==="totp"&&p.type==="totp"&&(!((o=p?.totp)===null||o===void 0)&&o.qr_code)&&(p.totp.qr_code=`data:image/svg+xml;utf-8,${p.totp.qr_code}`),this._returnResult({data:p,error:null}))})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async _verify(n){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?yM(n.webauthn.credential_response):vM(n.webauthn.credential_response)})}:{code:n.code}),{data:f,error:p}=await Ee(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:u,headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+f.expires_in},f)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",f),this._returnResult({data:f,error:p}))})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}})}async _challenge(n){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=await Ee(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token});if(u.error)return u;const{data:f}=u;if(f.type!=="webauthn")return{data:f,error:null};switch(f.webauthn.type){case"create":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:mM(f.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:gM(f.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}})}async _challengeAndVerify(n){const{data:a,error:s}=await this._challenge({factorId:n.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:n.factorId,challengeId:a.id,code:n.code})}async _listFactors(){var n;const{data:{user:a},error:s}=await this.getUser();if(s)return{data:null,error:s};const o={all:[],phone:[],totp:[],webauthn:[]};for(const c of(n=a?.factors)!==null&&n!==void 0?n:[])o.all.push(c),c.status==="verified"&&o[c.factor_type].push(c);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(n){var a,s,o,c;if(n)try{const{payload:S}=gc(n);let _=null;S.aal&&(_=S.aal);let E=_;const{data:{user:T},error:R}=await this.getUser(n);if(R)return this._returnResult({data:null,error:R});((s=(a=T?.factors)===null||a===void 0?void 0:a.filter(k=>k.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(E="aal2");const A=S.amr||[];return{data:{currentLevel:_,nextLevel:E,currentAuthenticationMethods:A},error:null}}catch(S){if(pe(S))return this._returnResult({data:null,error:S});throw S}const{data:{session:u},error:f}=await this.getSession();if(f)return this._returnResult({data:null,error:f});if(!u)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:p}=gc(u.access_token);let m=null;p.aal&&(m=p.aal);let y=m;((c=(o=u.user.factors)===null||o===void 0?void 0:o.filter(S=>S.status==="verified"))!==null&&c!==void 0?c:[]).length>0&&(y="aal2");const x=p.amr||[];return{data:{currentLevel:m,nextLevel:y,currentAuthenticationMethods:x},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?await Ee(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new rn})})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async _approveAuthorization(n,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new rn});const u=await Ee(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:f=>({data:f,error:null})});return u.data&&u.data.redirect_url&&At()&&!a?.skipBrowserRedirect&&window.location.assign(u.data.redirect_url),u})}catch(s){if(pe(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(n,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new rn});const u=await Ee(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:f=>({data:f,error:null})});return u.data&&u.data.redirect_url&&At()&&!a?.skipBrowserRedirect&&window.location.assign(u.data.redirect_url),u})}catch(s){if(pe(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:a},error:s}=n;return s?this._returnResult({data:null,error:s}):a?await Ee(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new rn})})}catch(n){if(pe(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?(await Ee(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new rn})})}catch(a){if(pe(a))return this._returnResult({data:null,error:a});throw a}}async fetchJwk(n,a={keys:[]}){let s=a.keys.find(f=>f.kid===n);if(s)return s;const o=Date.now();if(s=this.jwks.keys.find(f=>f.kid===n),s&&this.jwks_cached_at+CD>o)return s;const{data:c,error:u}=await Ee(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(u)throw u;return!c.keys||c.keys.length===0||(this.jwks=c,this.jwks_cached_at=o,s=c.keys.find(f=>f.kid===n),!s)?null:s}async getClaims(n,a={}){try{let s=n;if(!s){const{data:S,error:_}=await this.getSession();if(_||!S.session)return this._returnResult({data:null,error:_});s=S.session.access_token}const{header:o,payload:c,signature:u,raw:{header:f,payload:p}}=gc(s);a?.allowExpired||KD(c.exp);const m=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a?.keys?{keys:a.keys}:a?.jwks);if(!m){const{error:S}=await this.getUser(s);if(S)throw S;return{data:{claims:c,header:o,signature:u},error:null}}const y=XD(o.alg),g=await crypto.subtle.importKey("jwk",m,y,!0,["verify"]);if(!await crypto.subtle.verify(y,g,u,LD(`${f}.${p}`)))throw new Dh("Invalid JWT signature");return{data:{claims:c,header:o,signature:u},error:null}}catch(s){if(pe(s))return this._returnResult({data:null,error:s});throw s}}}Co.nextInstanceID={};const RM=Co,AM="2.98.0";let oo="";typeof Deno<"u"?oo="deno":typeof document<"u"?oo="web":typeof navigator<"u"&&navigator.product==="ReactNative"?oo="react-native":oo="node";const OM={"X-Client-Info":`supabase-js-${oo}/${AM}`},NM={headers:OM},kM={schema:"public"},jM={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},DM={};function Ro(e){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ro(e)}function MM(e,n){if(Ro(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,n);if(Ro(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function LM(e){var n=MM(e,"string");return Ro(n)=="symbol"?n:n+""}function UM(e,n,a){return(n=LM(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function st(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?l0(Object(a),!0).forEach(function(s){UM(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l0(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}const PM=e=>e?(...n)=>e(...n):(...n)=>fetch(...n),zM=()=>Headers,IM=(e,n,a)=>{const s=PM(a),o=zM();return async(c,u)=>{var f;const p=(f=await n())!==null&&f!==void 0?f:e;let m=new o(u?.headers);return m.has("apikey")||m.set("apikey",e),m.has("Authorization")||m.set("Authorization",`Bearer ${p}`),s(c,st(st({},u),{},{headers:m}))}};function BM(e){return e.endsWith("/")?e:e+"/"}function $M(e,n){var a,s;const{db:o,auth:c,realtime:u,global:f}=e,{db:p,auth:m,realtime:y,global:g}=n,x={db:st(st({},p),o),auth:st(st({},m),c),realtime:st(st({},y),u),storage:{},global:st(st(st({},g),f),{},{headers:st(st({},(a=g?.headers)!==null&&a!==void 0?a:{}),(s=f?.headers)!==null&&s!==void 0?s:{})}),accessToken:async()=>""};return e.accessToken?x.accessToken=e.accessToken:delete x.accessToken,x}function HM(e){const n=e?.trim();if(!n)throw new Error("supabaseUrl is required.");if(!n.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(BM(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var qM=class extends RM{constructor(e){super(e)}},FM=class{constructor(e,n,a){var s,o;this.supabaseUrl=e,this.supabaseKey=n;const c=HM(e);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const u=`sb-${c.hostname.split(".")[0]}-auth-token`,f={db:kM,realtime:DM,auth:st(st({},jM),{},{storageKey:u}),global:NM},p=$M(a??{},f);if(this.storageKey=(s=p.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=p.global.headers)!==null&&o!==void 0?o:{},p.accessToken)this.accessToken=p.accessToken,this.auth=new Proxy({},{get:(y,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var m;this.auth=this._initSupabaseAuthClient((m=p.auth)!==null&&m!==void 0?m:{},this.headers,p.global.fetch)}this.fetch=IM(n,this._getAccessToken.bind(this),p.global.fetch),this.realtime=this._initRealtimeClient(st({headers:this.headers,accessToken:this._getAccessToken.bind(this)},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 Aj(new URL("rest/v1",c).href,{headers:this.headers,schema:p.db.schema,fetch:this.fetch,timeout:p.db.timeout,urlLengthLimit:p.db.urlLengthLimit}),this.storage=new xD(this.storageUrl.href,this.headers,this.fetch,a?.storage),p.accessToken||this._listenForAuthEvents()}get functions(){return new wj(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},a={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,n,a)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,n,a;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(n=(a=s.session)===null||a===void 0?void 0:a.access_token)!==null&&n!==void 0?n:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:a,storage:s,userStorage:o,storageKey:c,flowType:u,lock:f,debug:p,throwOnError:m},y,g){const x={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new qM({url:this.authUrl.href,headers:st(st({},x),y),storageKey:c,autoRefreshToken:e,persistSession:n,detectSessionInUrl:a,storage:s,userStorage:o,flowType:u,lock:f,debug:p,throwOnError:m,fetch:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(S=>S.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Vj(this.realtimeUrl.href,st(st({},e),{},{params:st(st({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,n)=>{this._handleTokenChanged(e,"CLIENT",n?.access_token)})}_handleTokenChanged(e,n,a){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==a?(this.changedAccessToken=a,this.realtime.setAuth(a)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const ai=(e,n,a)=>new FM(e,n,a);function VM(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const n=e.version;if(n==null)return!1;const a=n.match(/^v(\d+)\./);return a?parseInt(a[1],10)<=18:!1}VM()&&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");const c0="https://hxxaymvjwvzmmjekoxsk.supabase.co",u0="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imh4eGF5bXZqd3Z6bW1qZWtveHNrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDcxOTY1NjksImV4cCI6MjA2Mjc3MjU2OX0.VyrQ5l6j5DPG6kn6FwpChXbn13lEbCEDrovbGTFkEkw",Tp="custom-supabase-url",Cp="custom-supabase-key",Ha=()=>{try{const e=localStorage.getItem(Tp),n=localStorage.getItem(Cp);return{supabaseUrl:e||c0,supabaseKey:n||u0}}catch(e){return console.error("Error retrieving Supabase credentials from localStorage:",e),{supabaseUrl:c0,supabaseKey:u0}}},GM=()=>{try{return localStorage.removeItem(Tp),localStorage.removeItem(Cp),console.log("Supabase credentials cleared, reverting to defaults"),!0}catch(e){return console.error("Error clearing Supabase credentials:",e),!1}},th=(e,n)=>{try{return localStorage.setItem(Tp,e),localStorage.setItem(Cp,n),console.log("Supabase credentials saved to localStorage"),!0}catch(a){return console.error("Error saving Supabase credentials:",a),!1}};let d0;const YM=()=>{const{supabaseUrl:e,supabaseKey:n}=Ha();return d0=ai(e,n,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0}}),d0};YM();const Mh=()=>{const{supabaseUrl:e,supabaseKey:n}=Ha();return ai(e,n,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0}})},KM=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,f0=`
98
- -- Create the prompts table with exact column names expected by the code
99
- CREATE TABLE IF NOT EXISTS prompts (
100
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
101
- content TEXT NOT NULL,
102
- tags TEXT[] DEFAULT '{}',
103
- createdat TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
104
- title TEXT,
105
- category TEXT DEFAULT 'task',
106
- description TEXT DEFAULT '',
107
- user_id TEXT NOT NULL,
108
- ispublic BOOLEAN DEFAULT false,
109
- likes INTEGER DEFAULT 0,
110
- views INTEGER DEFAULT 0,
111
- comments INTEGER DEFAULT 0
112
- );
113
-
114
- -- Create indexes for better performance
115
- CREATE INDEX IF NOT EXISTS idx_prompts_user_id ON prompts(user_id);
116
- CREATE INDEX IF NOT EXISTS idx_prompts_createdat ON prompts(createdat);
117
- CREATE INDEX IF NOT EXISTS idx_prompts_tags ON prompts USING GIN(tags);
118
-
119
- -- Enable Row Level Security
120
- ALTER TABLE prompts ENABLE ROW LEVEL SECURITY;
121
-
122
- -- Drop any existing policies to start fresh
123
- DROP POLICY IF EXISTS "Users can view their own prompts" ON prompts;
124
- DROP POLICY IF EXISTS "Users can insert their own prompts" ON prompts;
125
- DROP POLICY IF EXISTS "Users can update their own prompts" ON prompts;
126
- DROP POLICY IF EXISTS "Users can delete their own prompts" ON prompts;
127
- DROP POLICY IF EXISTS "Allow all access" ON prompts;
128
- DROP POLICY IF EXISTS "Temporary allow all" ON prompts;
129
-
130
- -- Create permissive policy for all operations (you can restrict this later)
131
- CREATE POLICY "Allow all operations for now" ON prompts FOR ALL USING (true);
132
- `,h0=`-- 🚀 Promptzy - Supabase Setup Script
133
- -- Run this in your Supabase SQL Editor to set up the database
134
-
135
- -- ============================================================================
136
- -- 1. CREATE THE PROMPTS TABLE (if it doesn't exist)
137
- -- ============================================================================
138
-
139
- CREATE TABLE IF NOT EXISTS prompts (
140
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
141
- content TEXT NOT NULL,
142
- tags TEXT[] DEFAULT '{}',
143
- createdat TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
144
- title TEXT,
145
- category TEXT DEFAULT 'task',
146
- description TEXT DEFAULT '',
147
- user_id TEXT NOT NULL,
148
- ispublic BOOLEAN DEFAULT false,
149
- likes INTEGER DEFAULT 0,
150
- views INTEGER DEFAULT 0,
151
- comments INTEGER DEFAULT 0
152
- );
153
-
154
- -- ============================================================================
155
- -- 2. ADD MISSING COLUMNS (if your table already exists)
156
- -- ============================================================================
157
-
158
- DO $$
159
- BEGIN
160
- IF NOT EXISTS (SELECT 1 FROM information_schema.columns
161
- WHERE table_name = 'prompts' AND column_name = 'user_id') THEN
162
- ALTER TABLE prompts ADD COLUMN user_id TEXT;
163
- UPDATE prompts SET user_id = 'legacy-user' WHERE user_id IS NULL;
164
- ALTER TABLE prompts ALTER COLUMN user_id SET NOT NULL;
165
- END IF;
166
- END $$;
167
-
168
- -- ============================================================================
169
- -- 3. CREATE INDEXES FOR BETTER PERFORMANCE
170
- -- ============================================================================
171
-
172
- CREATE INDEX IF NOT EXISTS idx_prompts_user_id ON prompts(user_id);
173
- CREATE INDEX IF NOT EXISTS idx_prompts_createdat ON prompts(createdat);
174
- CREATE INDEX IF NOT EXISTS idx_prompts_tags ON prompts USING GIN(tags);
175
-
176
- -- ============================================================================
177
- -- 4. ENABLE ROW LEVEL SECURITY (RLS)
178
- -- ============================================================================
179
-
180
- ALTER TABLE prompts ENABLE ROW LEVEL SECURITY;
181
-
182
- -- ============================================================================
183
- -- 5. DROP ANY EXISTING POLICIES (clean slate)
184
- -- ============================================================================
185
-
186
- DROP POLICY IF EXISTS "Users can view their own prompts" ON prompts;
187
- DROP POLICY IF EXISTS "Users can insert their own prompts" ON prompts;
188
- DROP POLICY IF EXISTS "Users can update their own prompts" ON prompts;
189
- DROP POLICY IF EXISTS "Users can delete their own prompts" ON prompts;
190
- DROP POLICY IF EXISTS "Allow all access" ON prompts;
191
- DROP POLICY IF EXISTS "Temporary allow all" ON prompts;
192
-
193
- -- ============================================================================
194
- -- 6. CREATE PERMISSIVE RLS POLICIES
195
- -- ============================================================================
196
-
197
- CREATE POLICY "Allow all operations for now" ON prompts FOR ALL USING (true);
198
- `;let lo=null,co=null;const Rp=()=>{const{supabaseUrl:e,supabaseKey:n}=Ha();return lo&&co&&co.url===e&&co.key===n||(lo=ai(e,n),co={url:e,key:n}),lo},nh=()=>{lo=null,co=null},Ao=async e=>{try{console.log("Checking if prompts table exists...");const{error:n}=await e.from("prompts").select("id").limit(1);return!n||n.code!=="42P01"?(console.log("Table exists or accessible"),!0):(console.log("Table does not exist (42P01 error)"),!1)}catch(n){return console.error("Error checking if table exists:",n),!1}},Ap=async e=>{try{return await Ao(e)?!0:(console.log("Prompts table doesn't exist. Manual creation required using Supabase SQL Editor."),!1)}catch(n){return console.error("Error checking prompts table:",n),!1}},Op=async e=>{try{const{data:n}=await e.auth.getSession();if(n?.session?.user?.id)return console.log("Using authenticated user ID:",n.session.user.id),n.session.user.id;const a=localStorage.getItem("custom-user-id");if(a&&a.trim())return console.log("Using custom user ID:",a),a.trim();let s=localStorage.getItem("supabase-anonymous-id");return s?console.log("Using existing anonymous ID:",s):(s=`anon-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,localStorage.setItem("supabase-anonymous-id",s),console.log("Generated new anonymous ID:",s)),s}catch(n){console.error("Error getting user ID:",n);const a=`anon-${Date.now()}`;return console.log("Using fallback ID:",a),a}},XM=e=>{try{if(!e||!e.trim())return localStorage.removeItem("custom-user-id"),console.log("Custom user ID cleared"),!0;const n=e.trim();return localStorage.setItem("custom-user-id",n),console.log("Custom user ID set:",n),!0}catch(n){return console.error("Error setting custom user ID:",n),!1}},p0=async()=>{const e=Rp();return await Op(e)},QM=async()=>{const e=ai(Ha().supabaseUrl,Ha().supabaseKey);try{if(console.log("Fetching prompts from Supabase with fresh client..."),!await Ap(e))return console.error("Prompts table is not available"),[];const a=await Op(e);console.log("Current user ID:",a);const{data:s,error:o}=await e.from("prompts").select("*").eq("user_id",a);return o?(console.error("Error fetching prompts from Supabase:",o),[]):!s||!Array.isArray(s)?(console.log("No prompts found in Supabase for this user"),[]):(console.log(`Found ${s.length} prompts in Supabase for user ${a}`),s.map(c=>({id:c.id||"",text:c.content||"",tags:Array.isArray(c.tags)?c.tags.map(u=>({id:u,name:u})):[],createdAt:c.createdat||new Date().toISOString(),type:c.category||"task"})))}catch(n){return console.error("Exception while fetching prompts:",n),[]}},WM=async e=>{const n=Rp();try{let a=e.id;if(!KM.test(a)){const f=crypto.randomUUID();console.log(`Invalid UUID "${e.id}" detected, regenerating to "${f}"`),a=f}if(console.log("Saving prompt to Supabase:",a),!await Ap(n))return console.error("Prompts table is not available"),!1;const o=await Op(n);console.log("Current user ID for saving:",o);const c={id:a,content:e.text,tags:e.tags.map(f=>f.name),createdat:e.createdAt,title:e.text.substring(0,50),category:e.type||"task",description:"",user_id:o,ispublic:!1,likes:0,views:0,comments:0};console.log("Saving prompt data:",c);const{error:u}=await n.from("prompts").upsert(c,{onConflict:"id"});return u?(console.error("Error saving prompt to Supabase:",u),!1):(console.log("Successfully saved prompt to Supabase:",e.id),!0)}catch(a){return console.error("Exception while saving prompt:",a),!1}},JM=async e=>{const n=Rp();try{if(!await Ap(n))return console.error("Prompts table is not available"),!1;const{error:s}=await n.from("prompts").delete().eq("id",e);return s?(console.error("Error deleting prompt from Supabase:",s),!1):!0}catch(a){return console.error("Exception while deleting prompt:",a),!1}},ZM=async()=>{const{supabaseUrl:e,supabaseKey:n}=Ha(),a={url:e.substring(0,15)+"...",keyLength:n.length,networkConnectivity:!1,corsIssue:!1,authConnection:!1,dataConnection:!1,tableExists:!1,error:void 0};try{const s=await fetch("https://www.google.com",{method:"HEAD",mode:"no-cors",cache:"no-cache"}).then(()=>!0).catch(()=>!1);if(a.networkConnectivity=s,!s)return a.error="Network connectivity issue detected. Please check your internet connection.",a;const o=ai(e,n);try{const{data:c,error:u}=await o.auth.getSession();a.authConnection=!u}catch(c){a.authConnection=!1,c instanceof Error&&(c.message.includes("CORS")||c.message.includes("cross-origin"))&&(a.corsIssue=!0,a.error="CORS issue detected. Your browser is blocking cross-origin requests to Supabase.")}try{const{error:c}=await o.from("prompts").select("id").limit(1).maybeSingle();a.dataConnection=!c||c.code==="42P01"||c.message&&c.message.includes("permission denied"),a.tableExists=await Ao(o)}catch(c){a.dataConnection=!1,!a.error&&c instanceof Error&&(a.error=c.message)}return a}catch(s){return s instanceof Error?a.error=s.message:a.error="Unknown error occurred during diagnostics",a}},Lh=async()=>{const{supabaseUrl:e,supabaseKey:n}=Ha();if(console.log("Testing Supabase connection with URL:",e.substring(0,15)+"..."),!e.startsWith("https://")||!e.includes(".supabase.co"))return console.error("Invalid Supabase URL format. URL must be in the format https://your-project.supabase.co"),!1;if(!n||n.length<20)return console.error("Invalid Supabase key format. Key appears to be too short or empty."),!1;const a=ai(e,n);try{console.log("Testing Supabase connection...");const{data:s,error:o}=await a.auth.getSession();o?console.warn("Supabase auth check warning (continuing anyway):",o):console.log("Auth connection successful, user:",s?.session?.user?.id||"anonymous");const c=new Promise((y,g)=>setTimeout(()=>g(new Error("Connection timeout after 5 seconds")),5e3)),u=a.from("prompts").select("id").limit(1).maybeSingle(),{data:f,error:p}=await Promise.race([u,c.then(()=>{throw new Error("Connection timeout")})]);if(p)return p.code==="42P01"||p.message&&p.message.includes("permission denied")?(console.log("Connected to API but table doesn't exist or no permission"),!0):(console.error("Supabase data check failed:",p),!1);const m=await Ao(a);return console.log("Supabase connection successful, table exists:",m),!0}catch(s){return console.error("Supabase connection test exception:",s),s instanceof Error&&(console.error("Error name:",s.name),console.error("Error message:",s.message),console.error("Error stack:",s.stack),s.name==="TypeError"&&s.message.includes("fetch")&&console.error("This appears to be a network error. Check your internet connection and Supabase URL."),(s.message.includes("CORS")||s.message.includes("cross-origin"))&&console.error("This appears to be a CORS error. Ensure your Supabase project allows requests from this origin.")),!1}};var uu="Collapsible",[e3]=kn(uu),[t3,Np]=e3(uu),ES=b.forwardRef((e,n)=>{const{__scopeCollapsible:a,open:s,defaultOpen:o,disabled:c,onOpenChange:u,...f}=e,[p,m]=Ws({prop:s,defaultProp:o??!1,onChange:u,caller:uu});return v.jsx(t3,{scope:a,disabled:c,contentId:ho(),open:p,onOpenToggle:b.useCallback(()=>m(y=>!y),[m]),children:v.jsx(Ie.div,{"data-state":jp(p),"data-disabled":c?"":void 0,...f,ref:n})})});ES.displayName=uu;var _S="CollapsibleTrigger",TS=b.forwardRef((e,n)=>{const{__scopeCollapsible:a,...s}=e,o=Np(_S,a);return v.jsx(Ie.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":jp(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:n,onClick:je(e.onClick,o.onOpenToggle)})});TS.displayName=_S;var kp="CollapsibleContent",CS=b.forwardRef((e,n)=>{const{forceMount:a,...s}=e,o=Np(kp,e.__scopeCollapsible);return v.jsx(xr,{present:a||o.open,children:({present:c})=>v.jsx(n3,{...s,ref:n,present:c})})});CS.displayName=kp;var n3=b.forwardRef((e,n)=>{const{__scopeCollapsible:a,present:s,children:o,...c}=e,u=Np(kp,a),[f,p]=b.useState(s),m=b.useRef(null),y=Ze(n,m),g=b.useRef(0),x=g.current,S=b.useRef(0),_=S.current,E=u.open||f,T=b.useRef(E),R=b.useRef(void 0);return b.useEffect(()=>{const O=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(O)},[]),Fn(()=>{const O=m.current;if(O){R.current=R.current||{transitionDuration:O.style.transitionDuration,animationName:O.style.animationName},O.style.transitionDuration="0s",O.style.animationName="none";const A=O.getBoundingClientRect();g.current=A.height,S.current=A.width,T.current||(O.style.transitionDuration=R.current.transitionDuration,O.style.animationName=R.current.animationName),p(s)}},[u.open,s]),v.jsx(Ie.div,{"data-state":jp(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!E,...c,ref:y,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:E&&o})});function jp(e){return e?"open":"closed"}var r3=ES;const a3=r3,s3=TS,i3=CS;var o3=b.createContext(void 0);function RS(e){const n=b.useContext(o3);return e||n||"ltr"}var rh="rovingFocusGroup.onEntryFocus",l3={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[Uh,AS,c3]=S0(Uo),[u3,OS]=kn(Uo,[c3]),[d3,f3]=u3(Uo),NS=b.forwardRef((e,n)=>v.jsx(Uh.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Uh.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(h3,{...e,ref:n})})}));NS.displayName=Uo;var h3=b.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:o=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,x=b.useRef(null),S=Ze(n,x),_=RS(c),[E,T]=Ws({prop:u,defaultProp:f??null,onChange:p,caller:Uo}),[R,O]=b.useState(!1),A=An(m),k=AS(a),I=b.useRef(!1),[B,$]=b.useState(0);return b.useEffect(()=>{const q=x.current;if(q)return q.addEventListener(rh,A),()=>q.removeEventListener(rh,A)},[A]),v.jsx(d3,{scope:a,orientation:s,dir:_,loop:o,currentTabStopId:E,onItemFocus:b.useCallback(q=>T(q),[T]),onItemShiftTab:b.useCallback(()=>O(!0),[]),onFocusableItemAdd:b.useCallback(()=>$(q=>q+1),[]),onFocusableItemRemove:b.useCallback(()=>$(q=>q-1),[]),children:v.jsx(Ie.div,{tabIndex:R||B===0?-1:0,"data-orientation":s,...g,ref:S,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{I.current=!0}),onFocus:je(e.onFocus,q=>{const ne=!I.current;if(q.target===q.currentTarget&&ne&&!R){const de=new CustomEvent(rh,l3);if(q.currentTarget.dispatchEvent(de),!de.defaultPrevented){const he=k().filter(D=>D.focusable),le=he.find(D=>D.active),me=he.find(D=>D.id===E),ae=[le,me,...he].filter(Boolean).map(D=>D.ref.current);DS(ae,y)}}I.current=!1}),onBlur:je(e.onBlur,()=>O(!1))})})}),kS="RovingFocusGroupItem",jS=b.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:o=!1,tabStopId:c,children:u,...f}=e,p=ho(),m=c||p,y=f3(kS,a),g=y.currentTabStopId===m,x=AS(a),{onFocusableItemAdd:S,onFocusableItemRemove:_,currentTabStopId:E}=y;return b.useEffect(()=>{if(s)return S(),()=>_()},[s,S,_]),v.jsx(Uh.ItemSlot,{scope:a,id:m,focusable:s,active:o,children:v.jsx(Ie.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...f,ref:n,onMouseDown:je(e.onMouseDown,T=>{s?y.onItemFocus(m):T.preventDefault()}),onFocus:je(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:je(e.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){y.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const R=g3(T,y.orientation,y.dir);if(R!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let A=x().filter(k=>k.focusable).map(k=>k.ref.current);if(R==="last")A.reverse();else if(R==="prev"||R==="next"){R==="prev"&&A.reverse();const k=A.indexOf(T.currentTarget);A=y.loop?y3(A,k+1):A.slice(k+1)}setTimeout(()=>DS(A))}}),children:typeof u=="function"?u({isCurrentTabStop:g,hasTabStop:E!=null}):u})})});jS.displayName=kS;var p3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function m3(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function g3(e,n,a){const s=m3(e.key,a);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return p3[s]}function DS(e,n=!1){const a=document.activeElement;for(const s of e)if(s===a||(s.focus({preventScroll:n}),document.activeElement!==a))return}function y3(e,n){return e.map((a,s)=>e[(n+s)%e.length])}var v3=NS,b3=jS,Dp="Radio",[w3,MS]=kn(Dp),[x3,S3]=w3(Dp),LS=b.forwardRef((e,n)=>{const{__scopeRadio:a,name:s,checked:o=!1,required:c,disabled:u,value:f="on",onCheck:p,form:m,...y}=e,[g,x]=b.useState(null),S=Ze(n,T=>x(T)),_=b.useRef(!1),E=g?m||!!g.closest("form"):!0;return v.jsxs(x3,{scope:a,checked:o,disabled:u,children:[v.jsx(Ie.button,{type:"button",role:"radio","aria-checked":o,"data-state":IS(o),"data-disabled":u?"":void 0,disabled:u,value:f,...y,ref:S,onClick:je(e.onClick,T=>{o||p?.(),E&&(_.current=T.isPropagationStopped(),_.current||T.stopPropagation())})}),E&&v.jsx(zS,{control:g,bubbles:!_.current,name:s,value:f,checked:o,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});LS.displayName=Dp;var US="RadioIndicator",PS=b.forwardRef((e,n)=>{const{__scopeRadio:a,forceMount:s,...o}=e,c=S3(US,a);return v.jsx(xr,{present:s||c.checked,children:v.jsx(Ie.span,{"data-state":IS(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:n})})});PS.displayName=US;var E3="RadioBubbleInput",zS=b.forwardRef(({__scopeRadio:e,control:n,checked:a,bubbles:s=!0,...o},c)=>{const u=b.useRef(null),f=Ze(u,c),p=Zx(a),m=ep(n);return b.useEffect(()=>{const y=u.current;if(!y)return;const g=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(g,"checked").set;if(p!==a&&S){const _=new Event("click",{bubbles:s});S.call(y,a),y.dispatchEvent(_)}},[p,a,s]),v.jsx(Ie.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...o,tabIndex:-1,ref:f,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});zS.displayName=E3;function IS(e){return e?"checked":"unchecked"}var _3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],du="RadioGroup",[T3]=kn(du,[OS,MS]),BS=OS(),$S=MS(),[C3,R3]=T3(du),HS=b.forwardRef((e,n)=>{const{__scopeRadioGroup:a,name:s,defaultValue:o,value:c,required:u=!1,disabled:f=!1,orientation:p,dir:m,loop:y=!0,onValueChange:g,...x}=e,S=BS(a),_=RS(m),[E,T]=Ws({prop:c,defaultProp:o??null,onChange:g,caller:du});return v.jsx(C3,{scope:a,name:s,required:u,disabled:f,value:E,onValueChange:T,children:v.jsx(v3,{asChild:!0,...S,orientation:p,dir:_,loop:y,children:v.jsx(Ie.div,{role:"radiogroup","aria-required":u,"aria-orientation":p,"data-disabled":f?"":void 0,dir:_,...x,ref:n})})})});HS.displayName=du;var qS="RadioGroupItem",FS=b.forwardRef((e,n)=>{const{__scopeRadioGroup:a,disabled:s,...o}=e,c=R3(qS,a),u=c.disabled||s,f=BS(a),p=$S(a),m=b.useRef(null),y=Ze(n,m),g=c.value===o.value,x=b.useRef(!1);return b.useEffect(()=>{const S=E=>{_3.includes(E.key)&&(x.current=!0)},_=()=>x.current=!1;return document.addEventListener("keydown",S),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",S),document.removeEventListener("keyup",_)}},[]),v.jsx(b3,{asChild:!0,...f,focusable:!u,active:g,children:v.jsx(LS,{disabled:u,required:c.required,checked:g,...p,...o,name:c.name,ref:y,onCheck:()=>c.onValueChange(o.value),onKeyDown:je(S=>{S.key==="Enter"&&S.preventDefault()}),onFocus:je(o.onFocus,()=>{x.current&&m.current?.click()})})})});FS.displayName=qS;var A3="RadioGroupIndicator",VS=b.forwardRef((e,n)=>{const{__scopeRadioGroup:a,...s}=e,o=$S(a);return v.jsx(PS,{...o,...s,ref:n})});VS.displayName=A3;var GS=HS,YS=FS,O3=VS;const Mp=b.forwardRef(({className:e,...n},a)=>v.jsx(GS,{className:qe("grid gap-2",e),...n,ref:a}));Mp.displayName=GS.displayName;const gr=b.forwardRef(({className:e,...n},a)=>v.jsx(YS,{ref:a,className:qe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:v.jsx(O3,{className:"flex items-center justify-center",children:v.jsx(iC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));gr.displayName=YS.displayName;const N3={sm:"py-2 px-4 text-sm rounded-[14px]",default:"py-3 px-6 text-base rounded-[18px]",lg:"py-4 px-8 text-lg rounded-[20px]"},k3={sm:"rounded-[12.5px]",default:"rounded-[16.5px]",lg:"rounded-[18.5px]"},yr=te.forwardRef(({children:e,hex:n,className:a="",size:s="default",style:o,onPointerMove:c,onMouseEnter:u,onPointerLeave:f,...p},m)=>{const y=b.useRef(null),[g,x]=b.useState(.5),[S,_]=b.useState(.5),[E,T]=b.useState(!1),R=b.useCallback(A=>{y.current=A,typeof m=="function"?m(A):m&&(m.current=A)},[m]),O=A=>{if(!y.current)return;const k=y.current.getBoundingClientRect();x((A.clientX-k.left)/k.width),_((A.clientY-k.top)/k.height)};return v.jsxs("button",{ref:R,...p,onPointerMove:A=>{O(A),c?.(A)},onMouseEnter:A=>{T(!0),u?.(A)},onPointerLeave:A=>{T(!1),x(.5),_(.5),f?.(A)},className:`group relative ${N3[s]} bg-zinc-800 overflow-hidden transition-transform duration-300 ease-out hover:scale-[1.02] active:scale-95 shadow-xl disabled:opacity-50 disabled:pointer-events-none ${a}`,style:{boxShadow:E?`0 10px 40px -10px ${n}66`:"0 10px 30px -10px rgba(0,0,0,0.5)",...o},children:[v.jsxs("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500",style:{"--mx":`${g*100}%`,"--my":`${S*100}%`},children:[v.jsx("div",{className:"absolute inset-0 transition-opacity duration-300",style:{backgroundImage:`
199
- radial-gradient(100% 50% at calc(50% - var(--mx)) 0%, ${n}66 0%, transparent 80%),
200
- radial-gradient(100% 50% at calc(var(--mx) + 50%) 100%, ${n}66 0%, transparent 80%)
201
- `}}),v.jsx("div",{className:"absolute inset-0 mix-blend-screen transition-opacity duration-300",style:{backgroundImage:`repeating-linear-gradient(125deg, transparent 0%, transparent 15%, ${n}40 25%, transparent 35%, transparent 50%)`,backgroundSize:"200%",backgroundPosition:"calc(var(--mx) + 20%) var(--my)"}})]}),v.jsx("div",{className:`absolute inset-[1.5px] ${k3[s]} bg-zinc-900/95 backdrop-blur-xl transition-colors duration-300 group-hover:bg-zinc-900/80`}),v.jsx("div",{className:"relative flex items-center justify-center gap-2 font-semibold tracking-wide transition-colors duration-300",style:{color:E?n:"#e4e4e7"},children:e})]})});yr.displayName="ShinyButton";const Ia=`You are a prompt generator. Your ONLY job is to output the requested prompt text. Nothing else.
202
-
203
- STRICT OUTPUT RULES - FOLLOW EXACTLY:
204
- - Output ONLY the prompt text itself
205
- - NO greetings ("Certainly!", "Here's", "Sure!", etc.)
206
- - NO explanatory text ("Here's a prompt for...", "This prompt will...")
207
- - NO offers to help ("Would you like me to...", "Let me know if...")
208
- - NO labels ("TASK PROMPT:", "Here's your prompt:", etc.)
209
- - NO separators (dashes, lines, formatting)
210
- - NO conversational elements whatsoever
211
- - NO questions back to the user
212
-
213
- PROMPT TYPES:
214
- System Prompts: Define AI identity, behavior, tone, constraints, and purpose. Shape how the AI should act.
215
- Task Prompts: Provide specific instructions for the AI to perform an action or generate content.
216
- Image Prompts: Describe visual scenes with composition, style, lighting, mood, and medium details.
217
- Video Prompts: Describe visual sequences with scene layout, actions, transitions, and cinematography.
218
-
219
- CRITICAL: Your response must be ONLY the prompt text that can be directly copied and used. Start writing the prompt immediately. No introduction, no conclusion, no extra words.`,j3=({onUsePrompt:e})=>{const[n,a]=b.useState(!1),[s,o]=b.useState(""),[c,u]=b.useState("task"),[f,p]=b.useState({text:"",loading:!1,error:null}),[m,y]=b.useState(Ia),{toast:g}=Qs(),x=b.useRef(null),S=b.useRef(null);b.useEffect(()=>{y(D3())},[]),b.useEffect(()=>()=>{S.current&&(S.current.close(),S.current=null)},[]);const _=async()=>{if(!s.trim()){g({title:"Error",description:"Please enter a prompt to generate content",variant:"destructive"});return}S.current&&(S.current.close(),S.current=null),p({text:"",loading:!0,error:null});try{let R="";c==="system"?R=`Create a system prompt: ${s}. Define the AI's role, personality, and constraints. and style. Output ONLY the prompt text with no greetings, explanations, offers to generate other content, or extra commentary.`:c==="task"?R=`Create a task prompt: ${s}. Provide specific instructions for the AI. and style. Output ONLY the prompt text with no greetings, explanations, offers to generate other content, or extra commentary.`:c==="image"?R=`Create an image prompt: ${s}. Describe visual elements, style, composition, colors, and subjects. and style. Output ONLY the prompt text with no greetings, explanations, offers to generate other content, or extra commentary.`:R=`Create a video prompt: ${s}. Outline content, scenes, transitions, and style. Output ONLY the prompt text with no greetings, explanations, offers to generate other content, or extra commentary.`;const A=`https://text.pollinations.ai/${new URLSearchParams({model:"openai",system:m,prompt:R,temperature:"0.4",top_p:"0.8",private:"true",stream:"true"}).toString()}`;console.log("Sending GET request to:",A.substring(0,100)+"...");const k=await fetch(A,{method:"GET",headers:{Accept:"text/event-stream",Referrer:"promptzy","X-Referrer":"promptzy"}});if(console.log("Response status:",k.status),console.log("Response headers:",Object.fromEntries(k.headers.entries())),!k.ok){const B=await k.text();throw console.error("API Error Response:",B),new Error(`HTTP error! status: ${k.status} - ${B}`)}if(!k.body)throw new Error("No response body received");const I=k.headers.get("content-type")||"";if(console.log("Content-Type:",I),I.includes("text/event-stream")){const B=k.body.getReader(),$=new TextDecoder;let q="",ne=!1;S.current={close:()=>B.cancel()};try{for(;;){const{done:de,value:he}=await B.read();if(de)break;const me=$.decode(he,{stream:!0}).split(`
220
- `);for(const W of me)if(W.trim()!==""&&W.startsWith("data: ")){const ae=W.slice(6);if(ae==="[DONE]")break;try{const D=JSON.parse(ae);if(D.choices&&D.choices[0]&&D.choices[0].delta){const V=D.choices[0].delta.content;V&&(q+=V,ne=!0,p({text:q,loading:!0,error:null}))}}catch{q+=ae,ne=!0,p({text:q,loading:!0,error:null})}}}p({text:q,loading:!1,error:null})}catch(de){!ne||!q.trim()?(p({text:q||"",loading:!1,error:de instanceof Error?de.message:"Failed to generate content"}),g({title:"Error",description:"Failed to generate content. Please try again.",variant:"destructive"})):p({text:q,loading:!1,error:null})}finally{S.current=null}}else{const B=await k.text();console.log("Plain text response:",B),p({text:B,loading:!1,error:null})}}catch(R){p({text:"",loading:!1,error:R instanceof Error?R.message:"Failed to generate content"}),g({title:"Error",description:"Failed to generate content. Please try again.",variant:"destructive"})}},E=()=>{f.text&&(navigator.clipboard.writeText(f.text),g({title:"Copied",description:"Response copied to clipboard"}))},T=()=>{f.text&&(e(f.text,c),g({title:"Success",description:"AI response added as a new prompt"}),a(!1))};return v.jsx("div",{className:"fixed bottom-4 sm:bottom-8 right-4 sm:right-8 left-4 sm:left-auto z-50 w-auto sm:w-full sm:max-w-md",children:v.jsxs(a3,{open:n,onOpenChange:a,className:"rounded-2xl shadow-2xl overflow-hidden",style:{background:"rgba(9,9,11,0.97)",backdropFilter:"saturate(180%) blur(24px)",WebkitBackdropFilter:"saturate(180%) blur(24px)",border:"1px solid rgba(63,63,70,0.50)",boxShadow:"0 12px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06)"},children:[v.jsx(s3,{asChild:!0,children:v.jsxs(yr,{hex:"#22d3ee",className:"w-full rounded-t-2xl rounded-b-none",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(WT,{className:"h-5 w-5"}),v.jsx("span",{children:"AI Prompt Assistant"})]}),n?v.jsx(X0,{className:"h-4 w-4"}):v.jsx(Q0,{className:"h-4 w-4"})]})}),v.jsxs(i3,{className:"p-3 sm:p-4 space-y-3 sm:space-y-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{htmlFor:"promptType",className:"text-xs sm:text-sm font-medium text-muted-foreground",children:"What type of prompt do you want to generate?"}),v.jsxs(Mp,{value:c,onValueChange:R=>u(R),className:"flex flex-wrap gap-2 sm:space-x-4 sm:gap-0",children:[v.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[v.jsx(gr,{value:"system",id:"system"}),v.jsx(xt,{htmlFor:"system",className:"text-xs sm:text-sm",children:"System"})]}),v.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[v.jsx(gr,{value:"task",id:"task"}),v.jsx(xt,{htmlFor:"task",className:"text-xs sm:text-sm",children:"Task"})]}),v.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[v.jsx(gr,{value:"image",id:"image"}),v.jsx(xt,{htmlFor:"image",className:"text-xs sm:text-sm",children:"Image"})]}),v.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[v.jsx(gr,{value:"video",id:"video"}),v.jsx(xt,{htmlFor:"video",className:"text-xs sm:text-sm",children:"Video"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{htmlFor:"prompt",className:"text-xs sm:text-sm font-medium text-muted-foreground",children:c==="system"?"Describe the AI assistant's role and personality":c==="task"?"What kind of task prompt would you like to create?":c==="image"?"Describe the desired visual elements, style, composition, colors, and subjects":"Outline the content, scenes, transitions, and style guidelines"}),v.jsx(su,{id:"prompt",placeholder:c==="system"?"E.g., A friendly customer service assistant that helps with product inquiries":c==="task"?"E.g., Create a prompt for writing a persuasive email":c==="image"?"E.g., Describe a sunset in a surreal style":"E.g., Outline a 30-second video clip",value:s,onChange:R=>o(R.target.value),className:"min-h-[140px] sm:min-h-[160px] text-xs sm:text-sm",style:{background:"rgba(0,0,0,0.25)",border:"1px solid rgba(255,255,255,0.09)",color:"var(--text-strong)",borderRadius:"12px"}})]}),v.jsx(yr,{onClick:_,disabled:f.loading||!s.trim(),hex:"#fbbf24",className:"w-full",children:f.loading?"Generating...":"Generate Prompt"}),f.text&&v.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[v.jsx("div",{ref:x,className:"p-2 sm:p-3 rounded-xl max-h-[150px] sm:max-h-[200px] overflow-y-auto whitespace-pre-wrap text-xs sm:text-sm font-mono",style:{background:"rgba(0,0,0,0.30)",border:"1px solid rgba(255,255,255,0.08)",color:"var(--text-strong)"},children:f.text}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs(ht,{variant:"outline",className:"flex-1 text-xs sm:text-sm transition-all duration-200",onClick:E,style:{background:"rgba(34,211,238,0.10)",border:"1px solid rgba(34,211,238,0.30)",color:"#22d3ee"},onMouseEnter:R=>{R.currentTarget.style.background="rgba(34,211,238,0.20)",R.currentTarget.style.boxShadow="0 0 16px rgba(34,211,238,0.30)"},onMouseLeave:R=>{R.currentTarget.style.background="rgba(34,211,238,0.10)",R.currentTarget.style.boxShadow="none"},children:[v.jsx(fo,{className:"mr-1 sm:mr-2 h-3 w-3 sm:h-4 sm:w-4"})," Copy"]}),v.jsx(yr,{onClick:T,hex:"#f43f8e",size:"sm",className:"flex-1",children:"Use as Prompt"})]})]}),f.error&&!f.text&&v.jsx("div",{className:"p-3 bg-destructive/20 border border-destructive/40 rounded-md text-sm text-destructive",children:f.error})]})]})})},KS="ai-system-prompt",Lp="ai-use-default-prompt",D3=()=>localStorage.getItem(Lp)==="true"?Ia:localStorage.getItem(KS)||Ia,M3=e=>{localStorage.setItem(KS,e)},m0=e=>{localStorage.setItem(Lp,e.toString())},L3=()=>localStorage.getItem(Lp)==="true",U3=({isOpen:e,onClose:n})=>{const[a,s]=b.useState(()=>localStorage.getItem("custom-supabase-url")||""),[o,c]=b.useState(()=>localStorage.getItem("custom-supabase-key")||""),[u,f]=b.useState(()=>localStorage.getItem("custom-user-id")||""),[p,m]=b.useState(""),[y,g]=b.useState(!1),[x,S]=b.useState("untested"),[_,E]=b.useState("unknown"),[T,R]=b.useState(!1),[O,A]=b.useState(!1),[k,I]=b.useState(null),[B,$]=b.useState(!1),[q,ne]=b.useState(!1),[de,he]=b.useState(()=>localStorage.getItem("ai-system-prompt")||Ia),[le,me]=b.useState(()=>L3()),{toast:W}=Qs();b.useEffect(()=>{if(e){p0().then(m);const U=localStorage.getItem("ai-system-prompt");U&&U!==Ia&&U.includes("You are a helpful AI prompt generator")&&U.includes("Always provide clear, actionable prompts")&&(he(Ia),W({title:"AI Prompt Updated",description:"Your AI system prompt has been updated to the latest version. Click 'Save Changes' to apply."}))}},[e]);const ae=U=>{f(U),XM(U),p0().then(m)},D=U=>{const re=U.match(/https?:\/\/([a-z0-9-]+)\.supabase\.co/);return re?re[1]:""},V=()=>{const U=D(a);return U?`https://app.supabase.com/project/${U}/sql/new`:"https://app.supabase.com/"},Z=async()=>{if(!a||!o){W({title:"Missing Information",description:"Please enter both Supabase URL and API Key",variant:"destructive"});return}if(!a.startsWith("https://")||!a.includes(".supabase.co")){W({title:"Invalid URL Format",description:"Supabase URL should be in the format: https://your-project.supabase.co",variant:"destructive"});return}if(o.length<20){W({title:"Invalid Key Format",description:"The Supabase key appears to be too short. Please check your anon key.",variant:"destructive"});return}g(!0),S("untested"),E("unknown"),R(!1);const U=th(a,o);if(nh(),!U){W({title:"Storage Error",description:"Could not save credentials to browser storage. Please check your browser settings.",variant:"destructive"}),g(!1);return}try{const re=Lh(),ge=new Promise((be,Ce)=>setTimeout(()=>Ce(new Error("Connection timeout after 10 seconds")),1e4));if(!await Promise.race([re,ge.then(()=>(W({title:"Connection Timeout",description:"The connection to Supabase timed out. Please check your URL and internet connection.",variant:"destructive"}),!1))])){g(!1),S("failed"),W({title:"Connection Failed",description:"Could not connect to Supabase. Please check your credentials and try again.",variant:"destructive"});return}const ve=Mh();if(await Ao(ve)){E("exists"),S("success"),g(!1),W({title:"Connection Successful",description:"Successfully connected to your Supabase instance with table access."});return}E("missing"),S("failed"),R(!0),W({title:"Table Setup Required",description:"Connected to Supabase, but the prompts table doesn't exist. Please create it manually.",variant:"destructive"})}catch(re){console.error("Error during connection test:",re),S("failed"),W({title:"Connection Error",description:re instanceof Error?re.message:"An unexpected error occurred",variant:"destructive"})}finally{g(!1)}},se=async()=>{if(!a||!o){W({title:"Missing Information",description:"Please enter both Supabase URL and API Key",variant:"destructive"});return}$(!0),A(!0);try{th(a,o),nh();const U=await ZM();I(U),console.log("Supabase connection diagnostics:",U),W({title:"Diagnostics Complete",description:"Connection diagnostics have been collected."})}catch(U){console.error("Error running diagnostics:",U),W({title:"Diagnostics Failed",description:"Could not complete diagnostics. Please try again.",variant:"destructive"})}finally{$(!1)}},J=()=>{navigator.clipboard.writeText(f0.trim()),W({title:"SQL Copied",description:"Table creation SQL copied to clipboard."})},j=()=>{navigator.clipboard.writeText(h0.trim()),W({title:"Setup SQL Copied",description:"Full database setup SQL copied to clipboard."})},G=()=>{window.open(V(),"_blank")},K=()=>{he(Ia),W({title:"System Prompt Reset",description:"The system prompt has been reset to default."})},ee=async()=>{if(a&&o){if(!a.startsWith("https://")||!a.includes(".supabase.co")){W({title:"Invalid URL Format",description:"Supabase URL should be in the format: https://your-project.supabase.co",variant:"destructive"});return}if(o.length<20){W({title:"Invalid Key Format",description:"The Supabase key appears to be too short. Please check your anon key.",variant:"destructive"});return}const U=th(a,o);if(nh(),!U){W({title:"Storage Error",description:"Could not save credentials to browser storage. Please check your browser settings.",variant:"destructive"});return}g(!0);const re=await Lh();g(!1),re||W({title:"Supabase Connection Failed",description:"Could not connect to Supabase with the provided credentials. Your settings have been saved, but you may need to fix your connection details.",variant:"destructive"});const ge=Mh();await Ao(ge)||(W({title:"Supabase Table Required",description:"Your Supabase connection works, but the prompts table doesn't exist. Please create it for full functionality.",variant:"destructive"}),R(!0))}else{W({title:"Supabase Configuration Required",description:"Please enter your Supabase URL and API Key for cloud storage.",variant:"destructive"});return}le?m0(!0):(m0(!1),M3(de)),W({title:"Settings Saved",description:"Your Supabase settings have been updated."}),n()};return v.jsxs(v.Fragment,{children:[v.jsx(Eh,{open:e,onOpenChange:U=>!U&&n(),children:v.jsxs(Lc,{className:"sm:max-w-6xl w-[95vw] max-h-[85vh] overflow-y-auto",children:[v.jsxs(Uc,{children:[v.jsxs(zc,{className:"flex items-center gap-2",children:[v.jsx(W0,{className:"h-5 w-5"}),"Dashboard Settings"]}),v.jsx(Ic,{children:"Configure how you want to store and access your prompts."})]}),v.jsx("div",{className:"py-4",children:v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{className:"space-y-4 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.09)"},children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Zl,{className:"h-4 w-4",style:{color:"var(--accent-cyan)"}}),v.jsx("h3",{className:"text-sm font-medium",style:{color:"var(--text-strong)"},children:"Supabase Configuration"})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your Supabase project URL and anon key to connect to your own Supabase instance"}),v.jsx("div",{className:"p-3 rounded-xl",style:{background:"rgba(34,211,238,0.07)",border:"1px solid rgba(34,211,238,0.20)"},children:v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("div",{className:"text-blue-500 mt-0.5",children:"ℹ️"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-medium mb-1",style:{color:"var(--accent-cyan)"},children:"Important: Browser Refresh Required"}),v.jsxs("p",{className:"text-xs",style:{color:"var(--text-soft)"},children:["After connecting to Supabase, ",v.jsx("strong",{children:"refresh the page"})," to see your prompts appear. This is especially important when switching browsers or using a new device."]})]})]})}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsx(xt,{htmlFor:"supabase-url",children:"Supabase Project URL"}),v.jsx(po,{id:"supabase-url",placeholder:"https://your-project.supabase.co",value:a,onChange:U=>s(U.target.value)})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx(xt,{htmlFor:"supabase-key",children:"Supabase Anon Key"}),v.jsx(po,{id:"supabase-key",type:"password",placeholder:"your-anon-key",value:o,onChange:U=>c(U.target.value)})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx(xt,{htmlFor:"custom-user-id",children:"Custom User ID (Optional)"}),v.jsx(po,{id:"custom-user-id",placeholder:"Enter a custom user ID to sync across browsers",value:u,onChange:U=>ae(U.target.value)}),v.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current User ID: ",v.jsx("span",{className:"font-mono",style:{color:"var(--accent-cyan)"},children:p||"Loading..."})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"💡 Set a custom user ID to access your prompts from any browser. Leave empty for device-specific storage."})]})]}),v.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[v.jsx(ht,{variant:"outline",size:"sm",onClick:Z,disabled:y||!a||!o,className:"flex gap-2 items-center transition-all duration-200",style:{background:"rgba(34,211,238,0.12)",border:"1px solid rgba(34,211,238,0.35)",color:"#22d3ee",boxShadow:"0 0 10px rgba(34,211,238,0.12)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(34,211,238,0.22)",U.currentTarget.style.boxShadow="0 0 18px rgba(34,211,238,0.32)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(34,211,238,0.12)",U.currentTarget.style.boxShadow="0 0 10px rgba(34,211,238,0.12)"},children:y?v.jsxs(v.Fragment,{children:[v.jsx(io,{className:"h-4 w-4 animate-spin"}),"Connecting..."]}):v.jsxs(v.Fragment,{children:[v.jsx(Zl,{className:"h-4 w-4"}),"Connect"]})}),v.jsxs(ht,{type:"button",variant:"outline",size:"sm",onClick:()=>{GM(),s(""),c(""),S("untested"),E("unknown"),R(!1),A(!1),W({title:"Connection Reset",description:"Supabase credentials have been cleared. You can now enter new credentials."})},className:"flex gap-2 items-center transition-all duration-200",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.35)",color:"#fbbf24",boxShadow:"0 0 10px rgba(251,191,36,0.12)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(251,191,36,0.22)",U.currentTarget.style.boxShadow="0 0 18px rgba(251,191,36,0.32)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(251,191,36,0.12)",U.currentTarget.style.boxShadow="0 0 10px rgba(251,191,36,0.12)"},children:[v.jsx(io,{className:"h-4 w-4"}),"Reset"]}),v.jsx(ht,{type:"button",variant:"outline",size:"sm",onClick:se,disabled:B||!a||!o,className:"flex gap-2 items-center transition-all duration-200",style:{background:"rgba(244,63,142,0.12)",border:"1px solid rgba(244,63,142,0.35)",color:"#f43f8e",boxShadow:"0 0 10px rgba(244,63,142,0.12)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(244,63,142,0.22)",U.currentTarget.style.boxShadow="0 0 18px rgba(244,63,142,0.32)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(244,63,142,0.12)",U.currentTarget.style.boxShadow="0 0 10px rgba(244,63,142,0.12)"},children:B?v.jsxs(v.Fragment,{children:[v.jsx(io,{className:"h-4 w-4 animate-spin"}),"Diagnosing..."]}):v.jsxs(v.Fragment,{children:[v.jsx(Mf,{className:"h-4 w-4"}),"Diagnose"]})}),x==="success"&&v.jsxs("div",{className:"flex items-center text-sm text-green-600 gap-1 ml-auto",children:[v.jsx(aC,{className:"h-4 w-4"}),v.jsx("span",{children:"Connected"})]}),x==="failed"&&v.jsxs("div",{className:"flex items-center text-sm text-red-600 gap-1 ml-auto",children:[v.jsx(Mf,{className:"h-4 w-4"}),v.jsx("span",{children:"Failed"})]})]}),O&&k&&v.jsxs("div",{className:"mt-4 p-3 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)"},children:[v.jsx("div",{className:"flex items-start gap-2 mb-2",children:v.jsxs("div",{className:"flex-1",children:[v.jsx("h4",{className:"text-sm font-medium mb-2",children:"Connection Diagnostics"}),v.jsxs("div",{className:"text-xs space-y-1",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[v.jsx("span",{className:"text-muted-foreground",children:"Network Connectivity:"}),v.jsx("span",{className:k.networkConnectivity?"text-green-600":"text-red-600",children:k.networkConnectivity?"OK":"Failed"}),v.jsx("span",{className:"text-muted-foreground",children:"CORS Issues:"}),v.jsx("span",{className:k.corsIssue?"text-red-600":"text-green-600",children:k.corsIssue?"Detected":"None"}),v.jsx("span",{className:"text-muted-foreground",children:"Auth Connection:"}),v.jsx("span",{className:k.authConnection?"text-green-600":"text-red-600",children:k.authConnection?"OK":"Failed"}),v.jsx("span",{className:"text-muted-foreground",children:"Data Connection:"}),v.jsx("span",{className:k.dataConnection?"text-green-600":"text-red-600",children:k.dataConnection?"OK":"Failed"}),v.jsx("span",{className:"text-muted-foreground",children:"Table Exists:"}),v.jsx("span",{className:k.tableExists?"text-green-600":"text-amber-600",children:k.tableExists?"Yes":"No"})]}),k.error&&v.jsxs("div",{className:"mt-2 text-red-600",children:[v.jsx("span",{className:"font-medium",children:"Error:"})," ",String(k.error)]}),v.jsxs("div",{className:"mt-2",children:[v.jsx("span",{className:"font-medium",children:"Recommendation:"})," ",k.corsIssue?v.jsx("span",{children:"Check your browser's CORS settings or try a different browser."}):k.networkConnectivity?k.authConnection?k.dataConnection?k.tableExists?v.jsx("span",{children:"Your connection appears to be working correctly."}):v.jsx("span",{children:"Create the prompts table using the SQL below."}):v.jsx("span",{children:"Verify your database permissions."}):v.jsx("span",{children:"Verify your Supabase URL and API key."}):v.jsx("span",{children:"Check your internet connection."})]})]})]})}),v.jsx(ht,{variant:"outline",size:"sm",className:"w-full mt-2 text-xs transition-all duration-200",onClick:()=>A(!1),style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.65)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(255,255,255,0.10)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(255,255,255,0.05)"},children:"Hide Diagnostics"})]}),T&&v.jsxs("div",{className:"mt-4 p-3 rounded-xl",style:{background:"rgba(250,204,21,0.06)",border:"1px solid rgba(250,204,21,0.20)"},children:[v.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[v.jsx(Mf,{className:"h-4 w-4 text-amber-600 mt-0.5"}),v.jsxs("div",{children:[v.jsx("h4",{className:"text-sm font-medium",style:{color:"var(--accent-yellow)"},children:"Table Setup Required"}),v.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-soft)"},children:"Your Supabase connection works, but you need to create the 'prompts' table manually in your Supabase SQL editor:"})]})]}),v.jsxs("div",{className:"relative mt-2",children:[v.jsx("pre",{className:"text-xs p-2 bg-gray-800 text-gray-100 rounded-md overflow-x-auto",children:f0.trim()}),v.jsx(ht,{variant:"ghost",size:"sm",className:"absolute top-1 right-1 h-6 w-6 p-0",onClick:J,children:v.jsx(fo,{className:"h-3 w-3"})})]}),v.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[v.jsx("p",{className:"text-xs font-medium",style:{color:"var(--accent-yellow)"},children:"📋 Quick Setup Steps:"}),v.jsxs("ol",{className:"text-xs list-decimal pl-4 space-y-1",style:{color:"var(--text-soft)"},children:[v.jsx("li",{children:'Click the "Open SQL Editor" button below'}),v.jsx("li",{children:"Create a new query in the SQL Editor"}),v.jsx("li",{children:"Copy the SQL code above (click the copy button)"}),v.jsx("li",{children:"Paste it into the SQL Editor"}),v.jsx("li",{children:'Click "Run" to execute the SQL'}),v.jsx("li",{children:'Return here and click "Connect" to verify'})]}),v.jsxs("div",{className:"flex gap-2 mt-2",children:[v.jsxs(ht,{variant:"outline",size:"sm",className:"flex-1 h-8 text-xs flex items-center gap-1 transition-all duration-200",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.35)",color:"#fbbf24",boxShadow:"0 0 10px rgba(251,191,36,0.12)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(251,191,36,0.22)",U.currentTarget.style.boxShadow="0 0 18px rgba(251,191,36,0.32)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(251,191,36,0.12)",U.currentTarget.style.boxShadow="0 0 10px rgba(251,191,36,0.12)"},onClick:G,children:[v.jsx(uC,{className:"h-3 w-3"}),"Open SQL Editor"]}),v.jsxs(ht,{variant:"outline",size:"sm",className:"h-8 text-xs flex items-center gap-1 transition-all duration-200",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.35)",color:"#fbbf24",boxShadow:"0 0 10px rgba(251,191,36,0.12)"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(251,191,36,0.22)",U.currentTarget.style.boxShadow="0 0 18px rgba(251,191,36,0.32)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(251,191,36,0.12)",U.currentTarget.style.boxShadow="0 0 10px rgba(251,191,36,0.12)"},onClick:J,children:[v.jsx(fo,{className:"h-3 w-3"}),"Copy SQL"]})]}),v.jsxs("div",{className:"mt-2 p-2 rounded-lg text-xs",style:{background:"rgba(34,211,238,0.06)",border:"1px solid rgba(34,211,238,0.15)"},children:[v.jsx("p",{className:"font-medium mb-1",style:{color:"var(--accent-cyan)"},children:"💡 Why manual setup?"}),v.jsx("p",{style:{color:"var(--text-soft)"},children:"Supabase doesn't allow automatic table creation through the API for security reasons. This one-time manual setup ensures your database is properly configured."})]})]})]}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:[v.jsx("p",{className:"mb-2",children:"To find your Supabase details:"}),v.jsxs("ol",{className:"list-decimal pl-4 space-y-1",children:[v.jsx("li",{children:"Go to your Supabase project dashboard"}),v.jsx("li",{children:"Navigate to Project Settings → API"}),v.jsx("li",{children:'Copy the "Project URL" and "anon" public API key'})]})]})]})}),v.jsx("div",{className:"space-y-6",children:v.jsxs("div",{className:"space-y-4 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.09)"},children:[v.jsxs("div",{className:"p-3 rounded-xl flex items-start gap-3",style:{background:"rgba(244,63,142,0.07)",border:"1px solid rgba(244,63,142,0.20)"},children:[v.jsx("div",{className:"mt-0.5 shrink-0",style:{color:"var(--accent-rose)"},children:v.jsx(Zl,{className:"h-4 w-4"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-xs font-medium mb-1",style:{color:"var(--accent-rose)"},children:"Supabase Database Required"}),v.jsx("p",{className:"text-xs mb-2",style:{color:"var(--text-soft)"},children:"Promptzy requires a Supabase database to store your prompts. You'll need to create a free project and run the setup SQL before the app will work. No database = no prompts saved!"}),v.jsxs("button",{type:"button",onClick:()=>ne(!0),className:"inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg transition-all duration-200",style:{background:"rgba(244,63,142,0.15)",border:"1px solid rgba(244,63,142,0.40)",color:"#f43f8e",cursor:"pointer"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(244,63,142,0.28)",U.currentTarget.style.boxShadow="0 0 14px rgba(244,63,142,0.28)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(244,63,142,0.15)",U.currentTarget.style.boxShadow="none"},children:[v.jsx(XT,{className:"h-3.5 w-3.5"}),"Database Setup Guide"]})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(J0,{className:"h-4 w-4",style:{color:"var(--accent-rose)"}}),v.jsx("h3",{className:"text-sm font-medium",style:{color:"var(--text-strong)"},children:"AI Assistant Configuration"})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Customize the system prompt used by the AI Assistant to generate prompts"}),v.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[v.jsx(Sp,{id:"use-default-prompt",checked:le,onCheckedChange:U=>{me(U)}}),v.jsx(xt,{htmlFor:"use-default-prompt",className:"text-sm",children:"Use default system prompt"})]}),v.jsxs("div",{className:le?"opacity-50":"",children:[v.jsxs("div",{className:"flex justify-between mb-2",children:[v.jsx(xt,{htmlFor:"system-prompt",className:"text-sm",children:"System Prompt"}),v.jsxs(ht,{variant:"ghost",size:"sm",onClick:K,className:"h-6 text-xs flex items-center gap-1 text-muted-foreground",children:[v.jsx(io,{className:"h-3 w-3"}),"Reset to default"]})]}),v.jsx(su,{id:"system-prompt",value:de,onChange:U=>he(U.target.value),className:"min-h-[200px] resize-y",placeholder:"Enter a system prompt for the AI Assistant",disabled:le}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"This prompt defines how the AI Assistant generates prompts based on your requests."})]})]})})]})}),v.jsxs(Pc,{children:[v.jsx(ht,{variant:"outline",onClick:n,className:"transition-all duration-200",style:{background:"rgba(244,63,142,0.10)",border:"1px solid rgba(244,63,142,0.30)",color:"#f43f8e"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(244,63,142,0.20)",U.currentTarget.style.boxShadow="0 0 16px rgba(244,63,142,0.30)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(244,63,142,0.10)",U.currentTarget.style.boxShadow="none"},children:"Cancel"}),v.jsx(yr,{onClick:ee,hex:"#22d3ee",children:"Save Changes"})]})]})}),v.jsx(Eh,{open:q,onOpenChange:U=>!U&&ne(!1),children:v.jsxs(Lc,{className:"sm:max-w-2xl w-[95vw] max-h-[90vh] overflow-y-auto",children:[v.jsxs(Uc,{children:[v.jsxs(zc,{className:"flex items-center gap-2",children:[v.jsx(Zl,{className:"h-5 w-5",style:{color:"var(--accent-cyan)"}}),"Database Setup Guide"]}),v.jsx(Ic,{children:"Follow these steps to set up your Supabase database so Promptzy can store your prompts."})]}),v.jsxs("div",{className:"space-y-5 py-2",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2",style:{color:"var(--accent-cyan)"},children:[v.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold",style:{background:"rgba(34,211,238,0.18)",color:"#22d3ee",border:"1px solid rgba(34,211,238,0.40)"},children:"1"}),"Create a free Supabase project"]}),v.jsxs("p",{className:"text-xs pl-7",style:{color:"var(--text-soft)"},children:["Head to"," ",v.jsx("button",{type:"button",className:"underline font-medium",style:{color:"var(--accent-cyan)",background:"none",border:"none",cursor:"pointer",padding:0},onClick:()=>window.open("https://supabase.com","_blank"),children:"supabase.com"})," ","and sign up for free. Create a new project and wait for it to initialize (usually under a minute)."]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2",style:{color:"var(--accent-cyan)"},children:[v.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold",style:{background:"rgba(34,211,238,0.18)",color:"#22d3ee",border:"1px solid rgba(34,211,238,0.40)"},children:"2"}),"Get your project credentials"]}),v.jsxs("ol",{className:"text-xs pl-7 space-y-1 list-decimal list-inside",style:{color:"var(--text-soft)"},children:[v.jsxs("li",{children:["In your Supabase project dashboard, go to ",v.jsx("strong",{children:"Project Settings → API"})]}),v.jsxs("li",{children:["Copy the ",v.jsx("strong",{children:"Project URL"})," (e.g. ",v.jsx("code",{className:"text-xs px-1 rounded",style:{background:"rgba(255,255,255,0.08)"},children:"https://xyz.supabase.co"}),")"]}),v.jsxs("li",{children:["Copy the ",v.jsx("strong",{children:"anon / public"})," API key (not the service role key)"]}),v.jsx("li",{children:"Paste both into the Supabase Configuration fields on the left"})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2",style:{color:"var(--accent-cyan)"},children:[v.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold",style:{background:"rgba(34,211,238,0.18)",color:"#22d3ee",border:"1px solid rgba(34,211,238,0.40)"},children:"3"}),"Run the setup SQL"]}),v.jsxs("p",{className:"text-xs pl-7",style:{color:"var(--text-soft)"},children:["In your Supabase dashboard, go to the ",v.jsx("strong",{children:"SQL Editor"}),", create a new query, paste the SQL below, and click ",v.jsx("strong",{children:"Run"}),"."]}),v.jsxs("div",{className:"relative rounded-lg overflow-hidden",style:{border:"1px solid rgba(255,255,255,0.12)"},children:[v.jsxs("div",{className:"flex items-center justify-between px-3 py-2",style:{background:"rgba(255,255,255,0.06)",borderBottom:"1px solid rgba(255,255,255,0.08)"},children:[v.jsx("span",{className:"text-xs font-mono",style:{color:"var(--text-soft)"},children:"setup.sql"}),v.jsxs("button",{type:"button",onClick:j,className:"inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1 rounded-md transition-all duration-200",style:{background:"rgba(34,211,238,0.14)",border:"1px solid rgba(34,211,238,0.35)",color:"#22d3ee",cursor:"pointer"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(34,211,238,0.26)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(34,211,238,0.14)"},children:[v.jsx(fo,{className:"h-3 w-3"}),"Copy SQL"]})]}),v.jsx("pre",{className:"text-xs p-3 overflow-x-auto",style:{background:"rgba(0,0,0,0.35)",color:"#a5f3fc",maxHeight:"300px",overflowY:"auto"},children:h0.trim()})]})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2",style:{color:"var(--accent-cyan)"},children:[v.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold",style:{background:"rgba(34,211,238,0.18)",color:"#22d3ee",border:"1px solid rgba(34,211,238,0.40)"},children:"4"}),"Connect and save"]}),v.jsxs("p",{className:"text-xs pl-7",style:{color:"var(--text-soft)"},children:["Back in this settings panel, enter your URL and anon key, click ",v.jsx("strong",{children:"Connect"})," to verify, then click ",v.jsx("strong",{children:"Save Changes"}),". Refresh the page and you're all set!"]})]}),v.jsxs("div",{className:"p-3 rounded-xl text-xs",style:{background:"rgba(34,211,238,0.06)",border:"1px solid rgba(34,211,238,0.18)"},children:[v.jsx("p",{className:"font-medium mb-1",style:{color:"var(--accent-cyan)"},children:"💡 Pro tip — sync across devices"}),v.jsxs("p",{style:{color:"var(--text-soft)"},children:["Set a ",v.jsx("strong",{children:"Custom User ID"})," in the Supabase Configuration section. Any device that uses the same User ID (and the same Supabase project) will see all the same prompts."]})]})]}),v.jsx(Pc,{children:v.jsx(ht,{variant:"outline",onClick:()=>ne(!1),className:"transition-all duration-200",style:{background:"rgba(34,211,238,0.10)",border:"1px solid rgba(34,211,238,0.30)",color:"#22d3ee"},onMouseEnter:U=>{U.currentTarget.style.background="rgba(34,211,238,0.20)",U.currentTarget.style.boxShadow="0 0 14px rgba(34,211,238,0.25)"},onMouseLeave:U=>{U.currentTarget.style.background="rgba(34,211,238,0.10)",U.currentTarget.style.boxShadow="none"},children:"Got it!"})})]})})]})},P3=({className:e=""})=>{const n=b.useRef(null),[a,s]=b.useState(!1),o=async()=>{if(!a)try{const c=new Audio("/robot-sound.mp3");n.current=c,c.volume=.3,s(!0),await c.play(),c.addEventListener("ended",()=>{s(!1)})}catch(c){console.log("Could not play robot sound:",c),s(!1)}};return v.jsx("div",{className:`robot-logo-container ${e}`,onMouseEnter:o,children:v.jsx("img",{src:"/icon.png",alt:"Promptzy Robot Logo",className:"robot-logo w-20 h-20 sm:w-20 sm:h-20 cursor-pointer select-none",draggable:!1})})},z3=({onAddPrompt:e,onRefreshPrompts:n,isRefreshing:a})=>{const[s,o]=b.useState(!1);return v.jsxs("header",{className:"glass glass__bar rounded-1xl px-5 py-4 mt-2 flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8 gap-4 sm:gap-0",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(P3,{}),v.jsxs("div",{className:"flex flex-col leading-tight",children:[v.jsx("h1",{className:"text-2xl sm:text-3xl font-bold tracking-tight",style:{background:"linear-gradient(90deg, #22d3ee 0%, #fbbf24 55%, #f43f8e 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",filter:"drop-shadow(0 0 12px rgba(34,211,238,0.35))"},children:"Promptzy"}),v.jsx("span",{className:"text-xs",style:{color:"var(--text-soft)"},children:"Your AI prompt library"})]})]}),v.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[v.jsxs(ht,{variant:"outline",size:"sm",onClick:n,disabled:a,className:"flex items-center gap-1.5 flex-1 sm:flex-none transition-all duration-200",style:{background:"rgba(34,211,238,0.12)",border:"1px solid rgba(34,211,238,0.35)",color:"#22d3ee",boxShadow:"0 0 12px rgba(34,211,238,0.15)"},onMouseEnter:c=>{c.currentTarget.style.background="rgba(34,211,238,0.22)",c.currentTarget.style.boxShadow="0 0 20px rgba(34,211,238,0.35)"},onMouseLeave:c=>{c.currentTarget.style.background="rgba(34,211,238,0.12)",c.currentTarget.style.boxShadow="0 0 12px rgba(34,211,238,0.15)"},children:[v.jsx(io,{className:`h-4 w-4 ${a?"animate-spin":""}`}),v.jsx("span",{className:"hidden xs:inline",children:a?"Refreshing…":"Refresh"})]}),v.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>o(!0),className:"flex items-center gap-1.5 flex-1 sm:flex-none transition-all duration-200",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.35)",color:"#fbbf24",boxShadow:"0 0 12px rgba(251,191,36,0.15)"},onMouseEnter:c=>{c.currentTarget.style.background="rgba(251,191,36,0.22)",c.currentTarget.style.boxShadow="0 0 20px rgba(251,191,36,0.35)"},onMouseLeave:c=>{c.currentTarget.style.background="rgba(251,191,36,0.12)",c.currentTarget.style.boxShadow="0 0 12px rgba(251,191,36,0.15)"},children:[v.jsx(W0,{className:"h-4 w-4"}),v.jsx("span",{className:"hidden xs:inline",children:"Settings"})]}),v.jsxs(yr,{onClick:e,hex:"#22d3ee",size:"sm",className:"flex-1 sm:flex-none",children:[v.jsx(Fh,{className:"h-4 w-4"}),"Add Prompt"]})]}),v.jsx(U3,{isOpen:s,onClose:()=>o(!1)})]})},I3=({searchTerm:e,onSearchChange:n})=>{const[a,s]=b.useState(!1),o="#22d3ee";return v.jsxs("div",{className:"relative group w-full",children:[v.jsx("div",{className:"absolute -inset-0.5 rounded-xl blur transition duration-500",style:{backgroundColor:o,opacity:a?.3:0}}),v.jsxs("div",{className:"relative flex items-center",children:[v.jsx(pC,{size:18,className:"absolute left-4 transition-colors duration-300 pointer-events-none",style:{color:a?o:"#71717a"}}),v.jsx("input",{type:"text",placeholder:"Search prompts…",value:e,onChange:c=>n(c.target.value),onFocus:()=>s(!0),onBlur:()=>s(!1),className:"w-full bg-zinc-900 border border-zinc-800 text-zinc-100 placeholder-zinc-500 text-sm rounded-xl focus:outline-none py-3 pl-11 pr-4 transition-all duration-300",style:{borderColor:a?o:void 0,boxShadow:a?`0 0 0 1px ${o}`:"none"}})]})]})},B3=({allTags:e,selectedTags:n,onToggleTag:a})=>e.length===0?null:v.jsxs("div",{className:"mb-6",children:[v.jsx("p",{className:"text-xs font-semibold tracking-widest uppercase mb-2.5",style:{color:"var(--accent-yellow)",opacity:.85},children:"Filter by tag"}),v.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(s=>v.jsx("button",{onClick:()=>a(s.id),className:`tag cursor-pointer ${n.includes(s.id)?"tag-active":""}`,children:s.name},s.id))})]}),yc=43200,g0=1440,y0=Symbol.for("constructDateFrom");function Up(e,n){return typeof e=="function"?e(n):e&&typeof e=="object"&&y0 in e?e[y0](n):e instanceof Date?new e.constructor(n):new Date(n)}function oa(e,n){return Up(e,e)}let $3={};function H3(){return $3}function v0(e){const n=oa(e),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+e-+a}function Pp(e,...n){const a=Up.bind(null,e||n.find(s=>typeof s=="object"));return n.map(a)}function Tc(e,n){const a=+oa(e)-+oa(n);return a<0?-1:a>0?1:a}function q3(e){return Up(e,Date.now())}function F3(e,n,a){const[s,o]=Pp(a?.in,e,n),c=s.getFullYear()-o.getFullYear(),u=s.getMonth()-o.getMonth();return c*12+u}function V3(e){return n=>{const s=(e?Math[e]:Math.trunc)(n);return s===0?0:s}}function G3(e,n){return+oa(e)-+oa(n)}function Y3(e,n){const a=oa(e);return a.setHours(23,59,59,999),a}function K3(e,n){const a=oa(e),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function X3(e,n){const a=oa(e);return+Y3(a)==+K3(a)}function Q3(e,n,a){const[s,o,c]=Pp(a?.in,e,e,n),u=Tc(o,c),f=Math.abs(F3(o,c));if(f<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-u*f);let p=Tc(o,c)===-u;X3(s)&&f===1&&Tc(s,c)===1&&(p=!1);const m=u*(f-+p);return m===0?0:m}function W3(e,n,a){const s=G3(e,n)/1e3;return V3(a?.roundingMethod)(s)}const J3={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Z3=(e,n,a)=>{let s;const o=J3[e];return typeof o=="string"?s=o:n===1?s=o.one:s=o.other.replace("{{count}}",n.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+s:s+" ago":s};function ah(e){return(n={})=>{const a=n.width?String(n.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}const e4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},t4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},n4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},r4={date:ah({formats:e4,defaultWidth:"full"}),time:ah({formats:t4,defaultWidth:"full"}),dateTime:ah({formats:n4,defaultWidth:"full"})},a4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},s4=(e,n,a,s)=>a4[e];function ao(e){return(n,a)=>{const s=a?.context?String(a.context):"standalone";let o;if(s==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,f=a?.width?String(a.width):u;o=e.formattingValues[f]||e.formattingValues[u]}else{const u=e.defaultWidth,f=a?.width?String(a.width):e.defaultWidth;o=e.values[f]||e.values[u]}const c=e.argumentCallback?e.argumentCallback(n):n;return o[c]}}const i4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},o4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},l4={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},c4={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},d4={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},f4=(e,n)=>{const a=Number(e),s=a%100;if(s>20||s<10)switch(s%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},h4={ordinalNumber:f4,era:ao({values:i4,defaultWidth:"wide"}),quarter:ao({values:o4,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ao({values:l4,defaultWidth:"wide"}),day:ao({values:c4,defaultWidth:"wide"}),dayPeriod:ao({values:u4,defaultWidth:"wide",formattingValues:d4,defaultFormattingWidth:"wide"})};function so(e){return(n,a={})=>{const s=a.width,o=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],c=n.match(o);if(!c)return null;const u=c[0],f=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],p=Array.isArray(f)?m4(f,g=>g.test(u)):p4(f,g=>g.test(u));let m;m=e.valueCallback?e.valueCallback(p):p,m=a.valueCallback?a.valueCallback(m):m;const y=n.slice(u.length);return{value:m,rest:y}}}function p4(e,n){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&n(e[a]))return a}function m4(e,n){for(let a=0;a<e.length;a++)if(n(e[a]))return a}function g4(e){return(n,a={})=>{const s=n.match(e.matchPattern);if(!s)return null;const o=s[0],c=n.match(e.parsePattern);if(!c)return null;let u=e.valueCallback?e.valueCallback(c[0]):c[0];u=a.valueCallback?a.valueCallback(u):u;const f=n.slice(o.length);return{value:u,rest:f}}}const y4=/^(\d+)(th|st|nd|rd)?/i,v4=/\d+/i,b4={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},w4={any:[/^b/i,/^(a|c)/i]},x4={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},S4={any:[/1/i,/2/i,/3/i,/4/i]},E4={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_4={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},T4={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},C4={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},R4={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},A4={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},O4={ordinalNumber:g4({matchPattern:y4,parsePattern:v4,valueCallback:e=>parseInt(e,10)}),era:so({matchPatterns:b4,defaultMatchWidth:"wide",parsePatterns:w4,defaultParseWidth:"any"}),quarter:so({matchPatterns:x4,defaultMatchWidth:"wide",parsePatterns:S4,defaultParseWidth:"any",valueCallback:e=>e+1}),month:so({matchPatterns:E4,defaultMatchWidth:"wide",parsePatterns:_4,defaultParseWidth:"any"}),day:so({matchPatterns:T4,defaultMatchWidth:"wide",parsePatterns:C4,defaultParseWidth:"any"}),dayPeriod:so({matchPatterns:R4,defaultMatchWidth:"any",parsePatterns:A4,defaultParseWidth:"any"})},N4={code:"en-US",formatDistance:Z3,formatLong:r4,formatRelative:s4,localize:h4,match:O4,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k4(e,n,a){const s=H3(),o=a?.locale??s.locale??N4,c=2520,u=Tc(e,n);if(isNaN(u))throw new RangeError("Invalid time value");const f=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:u}),[p,m]=Pp(a?.in,...u>0?[n,e]:[e,n]),y=W3(m,p),g=(v0(m)-v0(p))/1e3,x=Math.round((y-g)/60);let S;if(x<2)return a?.includeSeconds?y<5?o.formatDistance("lessThanXSeconds",5,f):y<10?o.formatDistance("lessThanXSeconds",10,f):y<20?o.formatDistance("lessThanXSeconds",20,f):y<40?o.formatDistance("halfAMinute",0,f):y<60?o.formatDistance("lessThanXMinutes",1,f):o.formatDistance("xMinutes",1,f):x===0?o.formatDistance("lessThanXMinutes",1,f):o.formatDistance("xMinutes",x,f);if(x<45)return o.formatDistance("xMinutes",x,f);if(x<90)return o.formatDistance("aboutXHours",1,f);if(x<g0){const _=Math.round(x/60);return o.formatDistance("aboutXHours",_,f)}else{if(x<c)return o.formatDistance("xDays",1,f);if(x<yc){const _=Math.round(x/g0);return o.formatDistance("xDays",_,f)}else if(x<yc*2)return S=Math.round(x/yc),o.formatDistance("aboutXMonths",S,f)}if(S=Q3(m,p),S<12){const _=Math.round(x/yc);return o.formatDistance("xMonths",_,f)}else{const _=S%12,E=Math.trunc(S/12);return _<3?o.formatDistance("aboutXYears",E,f):_<9?o.formatDistance("overXYears",E,f):o.formatDistance("almostXYears",E+1,f)}}function j4(e,n){return k4(e,q3(e),n)}function D4({prompt:e,onEdit:n,onDelete:a}){const[s,o]=b.useState(!1),{toast:c}=Qs(),u=e.type||"task",f={system:"#22d3ee",task:"#fbbf24",image:"#f43f8e",video:"#e4e4e7"},p=f[u]||f.task,m=()=>o(!s),y=R=>{R.stopPropagation(),n(e)},g=R=>{R.stopPropagation(),a(e.id)},x=async R=>{R.stopPropagation();try{await navigator.clipboard.writeText(e.text),c({title:"Copied!",description:"Prompt copied to clipboard."})}catch{c({title:"Copy failed",variant:"destructive"})}},S=e.text.split(`
221
- `)[0],_=S.length>90?S.substring(0,90)+"…":S,E=u==="system"?"badge-system":u==="task"?"badge-task":u==="image"?"badge-image":"badge-video",T=u==="system"?"SYSTEM":u==="task"?"TASK":u==="image"?"IMAGE":"VIDEO";return v.jsx("div",{className:"prompt-card animate-fade-in",style:{"--card-hex":`${p}80`,boxShadow:`0 0 0 0 ${p}00`},onMouseEnter:R=>{R.currentTarget.style.boxShadow=`0 10px 40px -10px ${p}40`},onMouseLeave:R=>{R.currentTarget.style.boxShadow=`0 0 0 0 ${p}00`},children:v.jsxs("div",{className:"prompt-card-inner",children:[v.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:`${E} text-[10px] font-bold tracking-widest px-2.5 py-0.5 rounded-full uppercase`,children:T}),v.jsx("span",{className:"text-[11px]",style:{color:"var(--text-soft)"},children:j4(new Date(e.createdAt),{addSuffix:!0})})]}),v.jsxs("div",{className:"flex justify-between items-start gap-2",children:[v.jsx("div",{className:"flex-1 overflow-hidden text-sm cursor-pointer",onClick:m,children:v.jsx("p",{className:"font-medium leading-snug line-clamp-2",style:{color:"var(--text-strong)"},children:_})}),v.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v.jsx(ht,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-cyan-300 hover:bg-cyan-400/10 transition-colors",onClick:x,title:"Copy prompt",children:v.jsx(fo,{className:"h-3.5 w-3.5"})}),v.jsx(ht,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-yellow-300 hover:bg-yellow-400/10 transition-colors",onClick:y,title:"Edit prompt",children:v.jsx(vC,{className:"h-3.5 w-3.5"})}),v.jsx(ht,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-rose-400 hover:bg-rose-400/10 transition-colors",onClick:g,title:"Delete prompt",children:v.jsx(wC,{className:"h-3.5 w-3.5"})}),v.jsx(ht,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10 transition-colors",onClick:R=>{R.stopPropagation(),m()},title:s?"Collapse":"Expand",children:s?v.jsx(Q0,{className:"h-3.5 w-3.5"}):v.jsx(X0,{className:"h-3.5 w-3.5"})})]})]}),e.tags.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:e.tags.map(R=>v.jsx("span",{className:"tag",children:R.name},R.id))})]}),s&&v.jsx("div",{className:"px-4 pb-4 animate-accordion-down",children:v.jsx("div",{className:"p-3 rounded-xl whitespace-pre-wrap text-sm font-mono leading-relaxed",style:{background:"rgba(0,0,0,0.25)",border:"1px solid rgba(255,255,255,0.07)",color:"var(--text-strong)"},children:e.text})})]})})}const M4=({onAddPrompt:e,isFiltered:n})=>v.jsxs("div",{className:"glass flex flex-col items-center justify-center py-20 px-6 text-center animate-fade-in",style:{borderStyle:"dashed"},children:[v.jsx("div",{className:"mb-5 flex items-center justify-center w-16 h-16 rounded-2xl",style:{background:"rgba(34,211,238,0.10)",border:"1px solid rgba(34,211,238,0.22)",boxShadow:"0 0 20px rgba(34,211,238,0.15)"},children:v.jsx(J0,{className:"w-8 h-8",style:{color:"var(--accent-cyan)"}})}),v.jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:"var(--text-strong)"},children:n?"No matching prompts":"No prompts yet"}),v.jsx("p",{className:"mb-7 max-w-xs text-sm leading-relaxed",style:{color:"var(--text-soft)"},children:n?"Try adjusting your search term or clearing some tag filters.":"Add your first AI prompt and start building your personal library."}),!n&&v.jsxs(yr,{onClick:e,hex:"#f43f8e",children:[v.jsx(Fh,{className:"mr-2 h-4 w-4"}),"Add your first prompt"]})]}),L4=({tags:e,onAddTag:n,onRemoveTag:a})=>{const[s,o]=b.useState(""),c=()=>{if(s.trim()){const f={id:Date.now().toString(),name:s.trim()};n(f),o("")}},u=f=>{f.key==="Enter"&&(f.preventDefault(),c())};return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx(po,{type:"text",placeholder:"Add tags...",value:s,onChange:f=>o(f.target.value),onKeyDown:u,className:"bg-secondary/50 border-secondary"}),v.jsx(ht,{type:"button",onClick:c,className:"px-2 transition-all duration-200",style:{background:"rgba(34,211,238,0.12)",border:"1px solid rgba(34,211,238,0.35)",color:"#22d3ee",boxShadow:"0 0 10px rgba(34,211,238,0.12)"},onMouseEnter:f=>{f.currentTarget.style.background="rgba(34,211,238,0.22)",f.currentTarget.style.boxShadow="0 0 18px rgba(34,211,238,0.32)"},onMouseLeave:f=>{f.currentTarget.style.background="rgba(34,211,238,0.12)",f.currentTarget.style.boxShadow="0 0 10px rgba(34,211,238,0.12)"},children:v.jsx(Fh,{className:"w-4 h-4"})})]}),e.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(f=>v.jsxs("div",{className:"tag flex items-center gap-1",children:[v.jsx("span",{children:f.name}),v.jsx("button",{type:"button",onClick:()=>a(f.id),className:"text-cyan-300 hover:text-white transition-colors",children:v.jsx(Vh,{className:"w-3 h-3"})})]},f.id))})]})},U4=({isOpen:e,onClose:n,onSave:a,editingPrompt:s})=>{const[o,c]=b.useState(""),[u,f]=b.useState([]),[p,m]=b.useState("task"),{toast:y}=Qs();b.useEffect(()=>{s?(c(s.text),f(s.tags?[...s.tags]:[]),m(s.type||"task")):(c(""),f([]),m("task"))},[s,e]);const g=_=>{u.some(E=>E.name.toLowerCase()===_.name.toLowerCase())||f([...u,_])},x=_=>{f(u.filter(E=>E.id!==_))},S=()=>{if(!o.trim()){y({title:"Error",description:"Prompt text cannot be empty",variant:"destructive"});return}const _={id:s?.id&&s.id!==""?s.id:crypto.randomUUID(),text:o.trim(),tags:u||[],type:p,createdAt:s?.createdAt&&s.id!==""?s.createdAt:new Date().toISOString()};console.log("Saving prompt:",_),a(_),y({title:s?.id?"Prompt updated":"Prompt added",description:s?.id?"Your prompt has been successfully updated":"Your prompt has been successfully added"}),n()};return v.jsx(Eh,{open:e,onOpenChange:n,children:v.jsxs(Lc,{className:"sm:max-w-lg",children:[v.jsxs(Uc,{children:[v.jsx(zc,{children:s?.id?"Edit Prompt":"Add New Prompt"}),v.jsx(Ic,{children:s?.id?"Modify your existing prompt and update its tags and type.":"Create a new prompt by entering the text, selecting a type, and adding relevant tags."})]}),v.jsxs("div",{className:"space-y-6 py-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(xt,{children:"Prompt Type"}),v.jsxs(Mp,{value:p,onValueChange:_=>m(_),className:"flex space-x-4",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(gr,{value:"system",id:"prompt-system"}),v.jsx(xt,{htmlFor:"prompt-system",children:"System Prompt"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(gr,{value:"task",id:"prompt-task"}),v.jsx(xt,{htmlFor:"prompt-task",children:"Task Prompt"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(gr,{value:"image",id:"prompt-image"}),v.jsx(xt,{htmlFor:"prompt-image",children:"Image Prompt"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(gr,{value:"video",id:"prompt-video"}),v.jsx(xt,{htmlFor:"prompt-video",children:"Video Prompt"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(xt,{htmlFor:"prompt",children:"Prompt Text"}),v.jsx(su,{id:"prompt",value:o,onChange:_=>c(_.target.value),placeholder:"Enter your prompt text here…",className:"min-h-[150px] font-mono text-sm",style:{background:"rgba(0,0,0,0.25)",border:"1px solid rgba(255,255,255,0.10)",color:"var(--text-strong)",borderRadius:"12px"}})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(xt,{children:"Tags"}),v.jsx(L4,{tags:u,onAddTag:g,onRemoveTag:x})]})]}),v.jsxs(Pc,{children:[v.jsx(ht,{variant:"outline",onClick:n,style:{background:"rgba(244,63,142,0.10)",border:"1px solid rgba(244,63,142,0.30)",color:"#f43f8e"},onMouseEnter:_=>{_.currentTarget.style.background="rgba(244,63,142,0.20)",_.currentTarget.style.boxShadow="0 0 16px rgba(244,63,142,0.30)"},onMouseLeave:_=>{_.currentTarget.style.background="rgba(244,63,142,0.10)",_.currentTarget.style.boxShadow="none"},children:"Cancel"}),v.jsx(yr,{onClick:S,hex:"#fbbf24",children:s?.id?"Update Prompt":"Save Prompt"})]})]})})};var P4=Symbol("radix.slottable");function z4(e){const n=({children:a})=>v.jsx(v.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=P4,n}var XS="AlertDialog",[I4]=kn(XS,[jx]),Tr=jx(),QS=e=>{const{__scopeAlertDialog:n,...a}=e,s=Tr(n);return v.jsx(Kx,{...s,...a,modal:!0})};QS.displayName=XS;var B4="AlertDialogTrigger",$4=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,o=Tr(a);return v.jsx(lj,{...o,...s,ref:n})});$4.displayName=B4;var H4="AlertDialogPortal",WS=e=>{const{__scopeAlertDialog:n,...a}=e,s=Tr(n);return v.jsx(Xx,{...s,...a})};WS.displayName=H4;var q4="AlertDialogOverlay",JS=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,o=Tr(a);return v.jsx(mp,{...o,...s,ref:n})});JS.displayName=q4;var Ys="AlertDialogContent",[F4,V4]=I4(Ys),G4=z4("AlertDialogContent"),ZS=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,children:s,...o}=e,c=Tr(a),u=b.useRef(null),f=Ze(n,u),p=b.useRef(null);return v.jsx(aj,{contentName:Ys,titleName:eE,docsSlug:"alert-dialog",children:v.jsx(F4,{scope:a,cancelRef:p,children:v.jsxs(gp,{role:"alertdialog",...c,...o,ref:f,onOpenAutoFocus:je(o.onOpenAutoFocus,m=>{m.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[v.jsx(G4,{children:s}),v.jsx(K4,{contentRef:u})]})})})});ZS.displayName=Ys;var eE="AlertDialogTitle",tE=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,o=Tr(a);return v.jsx(yp,{...o,...s,ref:n})});tE.displayName=eE;var nE="AlertDialogDescription",rE=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,o=Tr(a);return v.jsx(vp,{...o,...s,ref:n})});rE.displayName=nE;var Y4="AlertDialogAction",aE=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,o=Tr(a);return v.jsx(bp,{...o,...s,ref:n})});aE.displayName=Y4;var sE="AlertDialogCancel",iE=b.forwardRef((e,n)=>{const{__scopeAlertDialog:a,...s}=e,{cancelRef:o}=V4(sE,a),c=Tr(a),u=Ze(n,o);return v.jsx(bp,{...c,...s,ref:u})});iE.displayName=sE;var K4=({contentRef:e})=>{const n=`\`${Ys}\` requires a description for the component to be accessible for screen reader users.
222
-
223
- You can add a description to the \`${Ys}\` by passing a \`${nE}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
224
-
225
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ys}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
226
-
227
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(n)},[n,e]),null},X4=QS,Q4=WS,oE=JS,lE=ZS,cE=aE,uE=iE,dE=tE,fE=rE;const W4=X4,J4=Q4,hE=b.forwardRef(({className:e,...n},a)=>v.jsx(oE,{className:qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));hE.displayName=oE.displayName;const pE=b.forwardRef(({className:e,...n},a)=>v.jsxs(J4,{children:[v.jsx(hE,{}),v.jsx(lE,{ref:a,className:qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n})]}));pE.displayName=lE.displayName;const mE=({className:e,...n})=>v.jsx("div",{className:qe("flex flex-col space-y-2 text-center sm:text-left",e),...n});mE.displayName="AlertDialogHeader";const gE=({className:e,...n})=>v.jsx("div",{className:qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});gE.displayName="AlertDialogFooter";const yE=b.forwardRef(({className:e,...n},a)=>v.jsx(dE,{ref:a,className:qe("text-lg font-semibold",e),...n}));yE.displayName=dE.displayName;const vE=b.forwardRef(({className:e,...n},a)=>v.jsx(fE,{ref:a,className:qe("text-sm text-muted-foreground",e),...n}));vE.displayName=fE.displayName;const Z4=b.forwardRef(({className:e,...n},a)=>v.jsx(cE,{ref:a,className:qe(dp(),e),...n}));Z4.displayName=cE.displayName;const bE=b.forwardRef(({className:e,...n},a)=>v.jsx(uE,{ref:a,className:qe(dp({variant:"outline"}),"mt-2 sm:mt-0",e),...n}));bE.displayName=uE.displayName;const e5=()=>{const e=b.useMemo(()=>Mh(),[]),[n,a]=b.useState([]),[s,o]=b.useState([]),[c,u]=b.useState(""),[f,p]=b.useState([]),[m,y]=b.useState(!1),[g,x]=b.useState(null),[S,_]=b.useState(!1),[E,T]=b.useState(!1),[R,O]=b.useState(!1),[A,k]=b.useState(0),{toast:I}=Qs(),[B,$]=b.useState(!1),[q,ne]=b.useState(null),[de,he]=b.useState(!1),[le,me]=b.useState(()=>typeof window>"u"?1:window.matchMedia("(min-width: 1024px)").matches?3:window.matchMedia("(min-width: 768px)").matches?2:1);b.useEffect(()=>{const ce=()=>{window.matchMedia("(min-width: 1024px)").matches?me(3):window.matchMedia("(min-width: 768px)").matches?me(2):me(1)};return window.addEventListener("resize",ce),()=>window.removeEventListener("resize",ce)},[]);const W=b.useCallback(async()=>{try{const ce=await Lh();return T(ce),ce}catch(ce){return console.error("Error checking Supabase connection:",ce),T(!1),!1}},[]);b.useEffect(()=>{(async()=>{const{data:Ce}=await e.auth.getSession();_(!!Ce.session),W()})();const{data:{subscription:be}}=e.auth.onAuthStateChange((Ce,et)=>{_(!!et),W()});return()=>{be.unsubscribe()}},[W,e.auth]);const ae=b.useCallback(async(ce=!1)=>{if(console.log("Loading prompts from Supabase, connected:",E,"forceRefresh:",ce),!E&&!ce){console.log("Supabase not connected, skipping prompt load");return}try{const be=await QM();console.log(`Retrieved ${be.length} prompts from Supabase`),a(be);const Ce=be.flatMap(Ue=>Ue.tags),et=Array.from(new Map(Ce.map(Ue=>[Ue.id,Ue])).values());o(et),console.log("Prompts state updated with",be.length,"prompts")}catch(be){console.error("Error loading prompts from Supabase:",be),I({title:"Error loading prompts",description:"Could not load prompts from Supabase. Please check your connection.",variant:"destructive"})}},[E,I]);b.useEffect(()=>{ae()},[ae]);const D=b.useCallback(async()=>{O(!0),console.log("Manual refresh triggered");try{if(a([]),o([]),console.log("Checking Supabase connection..."),!await W()){console.log("Connection check failed"),I({title:"Connection Failed",description:"Could not connect to Supabase. Please check your settings.",variant:"destructive"});return}console.log("Connection successful, loading prompts..."),await ae(!0),await new Promise(be=>setTimeout(be,100)),k(be=>be+1),I({title:"Prompts Refreshed",description:"Successfully refreshed prompts from Supabase."})}catch(ce){console.error("Error refreshing prompts:",ce),I({title:"Refresh Failed",description:"Could not refresh prompts. Please try again.",variant:"destructive"})}finally{O(!1)}},[W,ae,I]),V=()=>{x(null),y(!0)},Z=ce=>{x(ce),y(!0)},se=async ce=>{const be={id:ce.id||crypto.randomUUID(),text:ce.text,tags:ce.tags||[],type:ce.type||"task",createdAt:ce.createdAt||new Date().toISOString()};if(!E){I({title:"Supabase not connected",description:"Please check your Supabase connection in settings",variant:"destructive"});return}try{await WM(be);const Ce=g?.id?n.map(Kt=>Kt.id===be.id?be:Kt):[be,...n];a(Ce);const et=Ce.flatMap(Kt=>Kt.tags),Ue=Array.from(new Map(et.map(Kt=>[Kt.id,Kt])).values());o(Ue),I({title:"Prompt saved",description:"Your prompt has been saved to Supabase"})}catch(Ce){console.error("Error saving to Supabase:",Ce),I({title:"Error saving prompt",description:"Could not save prompt to Supabase. Please try again.",variant:"destructive"})}},J=async ce=>{if(!E){I({title:"Supabase not connected",description:"Please check your Supabase connection in settings",variant:"destructive"});return}try{await JM(ce);const be=n.filter(Ue=>Ue.id!==ce);a(be);const Ce=be.flatMap(Ue=>Ue.tags),et=Array.from(new Map(Ce.map(Ue=>[Ue.id,Ue])).values());o(et),I({title:"Prompt deleted",description:"Your prompt has been successfully deleted"})}catch(be){console.error("Error deleting from Supabase:",be),I({title:"Error deleting prompt",description:"Could not delete prompt from Supabase. Please try again.",variant:"destructive"})}},j=ce=>{de?J(ce):(ne(ce),$(!0))},G=()=>{q&&J(q),ne(null),$(!1)},K=()=>{ne(null),$(!1)},ee=ce=>{he(ce)},U=ce=>{p(be=>be.includes(ce)?be.filter(Ce=>Ce!==ce):[...be,ce])},re=(ce,be)=>{const Ce={id:"",text:ce,tags:[],type:be,createdAt:""};x(Ce),y(!0),console.log("Using AI prompt:",Ce)},ge=n.filter(ce=>{const be=c?ce.text.toLowerCase().includes(c.toLowerCase()):!0,Ce=f.length>0?f.every(et=>ce.tags.some(Ue=>Ue.id===et)):!0;return be&&Ce}),Se=c!==""||f.length>0,ve=b.useMemo(()=>{const ce=Array.from({length:le},()=>[]);return ge.forEach((be,Ce)=>{ce[Ce%le].push(be)}),ce},[ge,le]);return v.jsx("div",{className:"min-h-screen px-4 py-8",children:v.jsxs("div",{className:"mx-auto max-w-5xl",children:[v.jsx(z3,{onAddPrompt:V,onRefreshPrompts:D,isRefreshing:R}),v.jsxs("div",{className:"glass mb-8 p-5 space-y-4",children:[v.jsx(I3,{searchTerm:c,onSearchChange:u}),v.jsx(B3,{allTags:s,selectedTags:f,onToggleTag:U})]}),ge.length>0?v.jsx("div",{className:"flex gap-4 items-start",children:ve.map((ce,be)=>v.jsx("div",{className:"flex-1 flex flex-col gap-4",children:ce.map(Ce=>v.jsx(D4,{prompt:Ce,onEdit:Z,onDelete:j},Ce.id))},be))}):v.jsx(M4,{onAddPrompt:V,isFiltered:Se}),v.jsx(U4,{isOpen:m,onClose:()=>y(!1),onSave:se,editingPrompt:g}),v.jsx(j3,{onUsePrompt:re}),v.jsx(W4,{open:B,onOpenChange:$,children:v.jsxs(pE,{style:{background:"hsl(215,25%,12%)",border:"1px solid rgba(255,255,255,0.10)"},children:[v.jsx(mE,{children:v.jsx(yE,{children:"Confirm Delete"})}),v.jsx(vE,{children:"Are you sure you want to delete this prompt?"}),v.jsxs("div",{className:"flex items-center space-x-2 mt-4",children:[v.jsx(Sp,{id:"suppress-delete-confirm",checked:de,onCheckedChange:ce=>ee(!!ce)}),v.jsx(xt,{htmlFor:"suppress-delete-confirm",children:"Don't show this again"})]}),v.jsxs(gE,{children:[v.jsx(bE,{onClick:K,children:"Cancel"}),v.jsx(yr,{onClick:G,hex:"#f43f8e",size:"sm",children:"Delete"})]})]})})]})},A)},t5=()=>{const e=Er();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),v.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:v.jsxs("div",{className:"text-center",children:[v.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),v.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),v.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},n5=new cO,r5=()=>v.jsx(dO,{client:n5,children:v.jsxs(L2,{children:[v.jsx(pR,{}),v.jsx(GR,{}),v.jsx(DN,{children:v.jsxs(cN,{children:[v.jsx(wh,{path:"/",element:v.jsx(e5,{})}),v.jsx(wh,{path:"*",element:v.jsx(t5,{})})]})})]})});B1.createRoot(document.getElementById("root")).render(v.jsx(r5,{}));