livedesk 0.1.23 → 0.1.25
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,38 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function r(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=r(u);fetch(u.href,d)}})();var Vc={exports:{}},ks={};var cg;function qv(){if(cg)return ks;cg=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var m in u)m!=="key"&&(d[m]=u[m])}else d=u;return u=d.ref,{$$typeof:i,type:l,key:h,ref:u!==void 0?u:null,props:d}}return ks.Fragment=n,ks.jsx=r,ks.jsxs=r,ks}var dg;function Pv(){return dg||(dg=1,Vc.exports=qv()),Vc.exports}var y=Pv(),Kc={exports:{}},ce={};var hg;function Iv(){if(hg)return ce;hg=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),T=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=T&&E[T]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,I={};function $(E,U,V){this.props=E,this.context=U,this.refs=I,this.updater=V||x}$.prototype.isReactComponent={},$.prototype.setState=function(E,U){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,U,"setState")},$.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function H(){}H.prototype=$.prototype;function q(E,U,V){this.props=E,this.context=U,this.refs=I,this.updater=V||x}var X=q.prototype=new H;X.constructor=q,O(X,$.prototype),X.isPureReactComponent=!0;var me=Array.isArray;function ie(){}var J={H:null,A:null,T:null,S:null},xe=Object.prototype.hasOwnProperty;function Te(E,U,V){var Q=V.ref;return{$$typeof:i,type:E,key:U,ref:Q!==void 0?Q:null,props:V}}function sn(E,U){return Te(E.type,U,E.props)}function ot(E){return typeof E=="object"&&E!==null&&E.$$typeof===i}function Ne(E){var U={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(V){return U[V]})}var ut=/\/+/g;function ht(E,U){return typeof E=="object"&&E!==null&&E.key!=null?Ne(""+E.key):U.toString(36)}function Pe(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ie,ie):(E.status="pending",E.then(function(U){E.status==="pending"&&(E.status="fulfilled",E.value=U)},function(U){E.status==="pending"&&(E.status="rejected",E.reason=U)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function D(E,U,V,Q,ue){var de=typeof E;(de==="undefined"||de==="boolean")&&(E=null);var ke=!1;if(E===null)ke=!0;else switch(de){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(E.$$typeof){case i:case n:ke=!0;break;case w:return ke=E._init,D(ke(E._payload),U,V,Q,ue)}}if(ke)return ue=ue(E),ke=Q===""?"."+ht(E,0):Q,me(ue)?(V="",ke!=null&&(V=ke.replace(ut,"$&/")+"/"),D(ue,U,V,"",function(vn){return vn})):ue!=null&&(ot(ue)&&(ue=sn(ue,V+(ue.key==null||E&&E.key===ue.key?"":(""+ue.key).replace(ut,"$&/")+"/")+ke)),U.push(ue)),1;ke=0;var Ge=Q===""?".":Q+":";if(me(E))for(var Ve=0;Ve<E.length;Ve++)Q=E[Ve],de=Ge+ht(Q,Ve),ke+=D(Q,U,V,de,ue);else if(Ve=S(E),typeof Ve=="function")for(E=Ve.call(E),Ve=0;!(Q=E.next()).done;)Q=Q.value,de=Ge+ht(Q,Ve++),ke+=D(Q,U,V,de,ue);else if(de==="object"){if(typeof E.then=="function")return D(Pe(E),U,V,Q,ue);throw U=String(E),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ke}function G(E,U,V){if(E==null)return E;var Q=[],ue=0;return D(E,Q,"","",function(de){return U.call(V,de,ue++)}),Q}function ne(E){if(E._status===-1){var U=E._result;U=U(),U.then(function(V){(E._status===0||E._status===-1)&&(E._status=1,E._result=V)},function(V){(E._status===0||E._status===-1)&&(E._status=2,E._result=V)}),E._status===-1&&(E._status=0,E._result=U)}if(E._status===1)return E._result.default;throw E._result}var F=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},_e={map:G,forEach:function(E,U,V){G(E,function(){U.apply(this,arguments)},V)},count:function(E){var U=0;return G(E,function(){U++}),U},toArray:function(E){return G(E,function(U){return U})||[]},only:function(E){if(!ot(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return ce.Activity=b,ce.Children=_e,ce.Component=$,ce.Fragment=r,ce.Profiler=u,ce.PureComponent=q,ce.StrictMode=l,ce.Suspense=g,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ce.__COMPILER_RUNTIME={__proto__:null,c:function(E){return J.H.useMemoCache(E)}},ce.cache=function(E){return function(){return E.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(E,U,V){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var Q=O({},E.props),ue=E.key;if(U!=null)for(de in U.key!==void 0&&(ue=""+U.key),U)!xe.call(U,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&U.ref===void 0||(Q[de]=U[de]);var de=arguments.length-2;if(de===1)Q.children=V;else if(1<de){for(var ke=Array(de),Ge=0;Ge<de;Ge++)ke[Ge]=arguments[Ge+2];Q.children=ke}return Te(E.type,ue,Q)},ce.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},ce.createElement=function(E,U,V){var Q,ue={},de=null;if(U!=null)for(Q in U.key!==void 0&&(de=""+U.key),U)xe.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(ue[Q]=U[Q]);var ke=arguments.length-2;if(ke===1)ue.children=V;else if(1<ke){for(var Ge=Array(ke),Ve=0;Ve<ke;Ve++)Ge[Ve]=arguments[Ve+2];ue.children=Ge}if(E&&E.defaultProps)for(Q in ke=E.defaultProps,ke)ue[Q]===void 0&&(ue[Q]=ke[Q]);return Te(E,de,ue)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(E){return{$$typeof:m,render:E}},ce.isValidElement=ot,ce.lazy=function(E){return{$$typeof:w,_payload:{_status:-1,_result:E},_init:ne}},ce.memo=function(E,U){return{$$typeof:p,type:E,compare:U===void 0?null:U}},ce.startTransition=function(E){var U=J.T,V={};J.T=V;try{var Q=E(),ue=J.S;ue!==null&&ue(V,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(ie,F)}catch(de){F(de)}finally{U!==null&&V.types!==null&&(U.types=V.types),J.T=U}},ce.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ce.use=function(E){return J.H.use(E)},ce.useActionState=function(E,U,V){return J.H.useActionState(E,U,V)},ce.useCallback=function(E,U){return J.H.useCallback(E,U)},ce.useContext=function(E){return J.H.useContext(E)},ce.useDebugValue=function(){},ce.useDeferredValue=function(E,U){return J.H.useDeferredValue(E,U)},ce.useEffect=function(E,U){return J.H.useEffect(E,U)},ce.useEffectEvent=function(E){return J.H.useEffectEvent(E)},ce.useId=function(){return J.H.useId()},ce.useImperativeHandle=function(E,U,V){return J.H.useImperativeHandle(E,U,V)},ce.useInsertionEffect=function(E,U){return J.H.useInsertionEffect(E,U)},ce.useLayoutEffect=function(E,U){return J.H.useLayoutEffect(E,U)},ce.useMemo=function(E,U){return J.H.useMemo(E,U)},ce.useOptimistic=function(E,U){return J.H.useOptimistic(E,U)},ce.useReducer=function(E,U,V){return J.H.useReducer(E,U,V)},ce.useRef=function(E){return J.H.useRef(E)},ce.useState=function(E){return J.H.useState(E)},ce.useSyncExternalStore=function(E,U,V){return J.H.useSyncExternalStore(E,U,V)},ce.useTransition=function(){return J.H.useTransition()},ce.version="19.2.7",ce}var fg;function xd(){return fg||(fg=1,Kc.exports=Iv()),Kc.exports}var P=xd(),Yc={exports:{}},Es={},Jc={exports:{}},Xc={};var mg;function Gv(){return mg||(mg=1,(function(i){function n(D,G){var ne=D.length;D.push(G);e:for(;0<ne;){var F=ne-1>>>1,_e=D[F];if(0<u(_e,G))D[F]=G,D[ne]=_e,ne=F;else break e}}function r(D){return D.length===0?null:D[0]}function l(D){if(D.length===0)return null;var G=D[0],ne=D.pop();if(ne!==G){D[0]=ne;e:for(var F=0,_e=D.length,E=_e>>>1;F<E;){var U=2*(F+1)-1,V=D[U],Q=U+1,ue=D[Q];if(0>u(V,ne))Q<_e&&0>u(ue,V)?(D[F]=ue,D[Q]=ne,F=Q):(D[F]=V,D[U]=ne,F=U);else if(Q<_e&&0>u(ue,ne))D[F]=ue,D[Q]=ne,F=Q;else break e}}return G}function u(D,G){var ne=D.sortIndex-G.sortIndex;return ne!==0?ne:D.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();i.unstable_now=function(){return h.now()-m}}var g=[],p=[],w=1,b=null,T=3,S=!1,x=!1,O=!1,I=!1,$=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function X(D){for(var G=r(p);G!==null;){if(G.callback===null)l(p);else if(G.startTime<=D)l(p),G.sortIndex=G.expirationTime,n(g,G);else break;G=r(p)}}function me(D){if(O=!1,X(D),!x)if(r(g)!==null)x=!0,ie||(ie=!0,Ne());else{var G=r(p);G!==null&&Pe(me,G.startTime-D)}}var ie=!1,J=-1,xe=5,Te=-1;function sn(){return I?!0:!(i.unstable_now()-Te<xe)}function ot(){if(I=!1,ie){var D=i.unstable_now();Te=D;var G=!0;try{e:{x=!1,O&&(O=!1,H(J),J=-1),S=!0;var ne=T;try{t:{for(X(D),b=r(g);b!==null&&!(b.expirationTime>D&&sn());){var F=b.callback;if(typeof F=="function"){b.callback=null,T=b.priorityLevel;var _e=F(b.expirationTime<=D);if(D=i.unstable_now(),typeof _e=="function"){b.callback=_e,X(D),G=!0;break t}b===r(g)&&l(g),X(D)}else l(g);b=r(g)}if(b!==null)G=!0;else{var E=r(p);E!==null&&Pe(me,E.startTime-D),G=!1}}break e}finally{b=null,T=ne,S=!1}G=void 0}}finally{G?Ne():ie=!1}}}var Ne;if(typeof q=="function")Ne=function(){q(ot)};else if(typeof MessageChannel<"u"){var ut=new MessageChannel,ht=ut.port2;ut.port1.onmessage=ot,Ne=function(){ht.postMessage(null)}}else Ne=function(){$(ot,0)};function Pe(D,G){J=$(function(){D(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(D){D.callback=null},i.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"):xe=0<D?Math.floor(1e3/D):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(D){switch(T){case 1:case 2:case 3:var G=3;break;default:G=T}var ne=T;T=G;try{return D()}finally{T=ne}},i.unstable_requestPaint=function(){I=!0},i.unstable_runWithPriority=function(D,G){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ne=T;T=D;try{return G()}finally{T=ne}},i.unstable_scheduleCallback=function(D,G,ne){var F=i.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?F+ne:F):ne=F,D){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=ne+_e,D={id:w++,callback:G,priorityLevel:D,startTime:ne,expirationTime:_e,sortIndex:-1},ne>F?(D.sortIndex=ne,n(p,D),r(g)===null&&D===r(p)&&(O?(H(J),J=-1):O=!0,Pe(me,ne-F))):(D.sortIndex=_e,n(g,D),x||S||(x=!0,ie||(ie=!0,Ne()))),D},i.unstable_shouldYield=sn,i.unstable_wrapCallback=function(D){var G=T;return function(){var ne=T;T=G;try{return D.apply(this,arguments)}finally{T=ne}}}})(Xc)),Xc}var gg;function Vv(){return gg||(gg=1,Jc.exports=Gv()),Jc.exports}var Qc={exports:{}},kt={};var pg;function Kv(){if(pg)return kt;pg=1;var i=xd();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)p+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,p,w){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:g,containerInfo:p,implementation:w}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,kt.createPortal=function(g,p){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return d(g,p,null,w)},kt.flushSync=function(g){var p=h.T,w=l.p;try{if(h.T=null,l.p=2,g)return g()}finally{h.T=p,l.p=w,l.d.f()}},kt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},kt.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},kt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var w=p.as,b=m(w,p.crossOrigin),T=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;w==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:T,fetchPriority:S}):w==="script"&&l.d.X(g,{crossOrigin:b,integrity:T,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var w=m(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},kt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var w=p.as,b=m(w,p.crossOrigin);l.d.L(g,w,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kt.preloadModule=function(g,p){if(typeof g=="string")if(p){var w=m(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:w,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},kt.requestFormReset=function(g){l.d.r(g)},kt.unstable_batchedUpdates=function(g,p){return g(p)},kt.useFormState=function(g,p,w){return h.H.useFormState(g,p,w)},kt.useFormStatus=function(){return h.H.useHostTransitionStatus()},kt.version="19.2.7",kt}var yg;function Yv(){if(yg)return Qc.exports;yg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),Qc.exports=Kv(),Qc.exports}var vg;function Jv(){if(vg)return Es;vg=1;var i=Vv(),n=xd(),r=Yv();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(l(188))}function p(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var a=e,s=t;;){var o=a.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){a=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===a)return g(o),e;if(c===s)return g(o),t;c=c.sibling}throw Error(l(188))}if(a.return!==s.return)a=o,s=c;else{for(var f=!1,v=o.child;v;){if(v===a){f=!0,a=o,s=c;break}if(v===s){f=!0,s=o,a=c;break}v=v.sibling}if(!f){for(v=c.child;v;){if(v===a){f=!0,a=c,s=o;break}if(v===s){f=!0,s=c,a=o;break}v=v.sibling}if(!f)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,T=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),xe=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),sn=Symbol.for("react.memo_cache_sentinel"),ot=Symbol.iterator;function Ne(e){return e===null||typeof e!="object"?null:(e=ot&&e[ot]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Symbol.for("react.client.reference");function ht(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ut?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case $:return"Profiler";case I:return"StrictMode";case me:return"Suspense";case ie:return"SuspenseList";case Te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case q:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:ht(e.type)||"Memo";case xe:t=e._payload,e=e._init;try{return ht(e(t))}catch{}}return null}var Pe=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},F=[],_e=-1;function E(e){return{current:e}}function U(e){0>_e||(e.current=F[_e],F[_e]=null,_e--)}function V(e,t){_e++,F[_e]=e.current,e.current=t}var Q=E(null),ue=E(null),de=E(null),ke=E(null);function Ge(e,t){switch(V(de,t),V(ue,e),V(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lm(t),e=Dm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(Q),V(Q,e)}function Ve(){U(Q),U(ue),U(de)}function vn(e){e.memoizedState!==null&&V(ke,e);var t=Q.current,a=Dm(t,e.type);t!==a&&(V(ue,e),V(Q,a))}function bn(e){ue.current===e&&(U(Q),U(ue)),ke.current===e&&(U(ke),ws._currentValue=ne)}var kr,Qs;function Yt(e){if(kr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);kr=t&&t[1]||"",Qs=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+kr+e+Qs}var Er=!1;function ra(e,t){if(!e||Er)return"";Er=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(L){var N=L}Reflect.construct(e,[],B)}else{try{B.call()}catch(L){N=L}e.call(B.prototype)}}else{try{throw Error()}catch(L){N=L}(B=e())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(L){if(L&&N&&typeof L.stack=="string")return[L.stack,N.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),f=c[0],v=c[1];if(f&&v){var _=f.split(`
|
|
4
|
-
`),j=v.split(`
|
|
5
|
-
`);for(o=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;o<j.length&&!j[o].includes("DetermineComponentFrameRoot");)o++;if(s===_.length||o===j.length)for(s=_.length-1,o=j.length-1;1<=s&&0<=o&&_[s]!==j[o];)o--;for(;1<=s&&0<=o;s--,o--)if(_[s]!==j[o]){if(s!==1||o!==1)do if(s--,o--,0>o||_[s]!==j[o]){var M=`
|
|
6
|
-
`+_[s].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=s&&0<=o);break}}}finally{Er=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Yt(a):""}function xn(e,t){switch(e.tag){case 26:case 27:case 5:return Yt(e.type);case 16:return Yt("Lazy");case 13:return e.child!==t&&t!==null?Yt("Suspense Fallback"):Yt("Suspense");case 19:return Yt("SuspenseList");case 0:case 15:return ra(e.type,!1);case 11:return ra(e.type.render,!1);case 1:return ra(e.type,!0);case 31:return Yt("Activity");default:return""}}function Zs(e){try{var t="",a=null;do t+=xn(e,a),a=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
-
Error generating stack: `+s.message+`
|
|
8
|
-
`+s.stack}}var qa=Object.prototype.hasOwnProperty,Ti=i.unstable_scheduleCallback,Pa=i.unstable_cancelCallback,Ws=i.unstable_shouldYield,Ye=i.unstable_requestPaint,Ct=i.unstable_now,Jt=i.unstable_getCurrentPriorityLevel,Fs=i.unstable_ImmediatePriority,Ar=i.unstable_UserBlockingPriority,sa=i.unstable_NormalPriority,Ia=i.unstable_LowPriority,On=i.unstable_IdlePriority,le=i.log,Xt=i.unstable_setDisableYieldValue,Ga=null,pt=null;function ln(e){if(typeof le=="function"&&Xt(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Ga,e)}catch{}}var Oe=Math.clz32?Math.clz32:ki,la=Math.log,Cr=Math.LN2;function ki(e){return e>>>=0,e===0?32:31-(la(e)/Cr|0)|0}var Va=256,Ka=262144,oa=4194304;function Rn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ya(e,t,a){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var v=s&134217727;return v!==0?(s=v&~c,s!==0?o=Rn(s):(f&=v,f!==0?o=Rn(f):a||(a=v&~e,a!==0&&(o=Rn(a))))):(v=s&~c,v!==0?o=Rn(v):f!==0?o=Rn(f):a||(a=s&~e,a!==0&&(o=Rn(a)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:o}function ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function el(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xr(){var e=oa;return oa<<=1,(oa&62914560)===0&&(oa=4194304),e}function Ja(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ho(e,t,a,s,o,c){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,_=e.expirationTimes,j=e.hiddenUpdates;for(a=f&~a;0<a;){var M=31-Oe(a),B=1<<M;v[M]=0,_[M]=-1;var N=j[M];if(N!==null)for(j[M]=null,M=0;M<N.length;M++){var L=N[M];L!==null&&(L.lane&=-536870913)}a&=~B}s!==0&&Xa(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Xa(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Oe(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Qa(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var s=31-Oe(a),o=1<<s;o&t|e[s]&t&&(e[s]|=t),a&=~o}}function Or(e,t){var a=t&-t;return a=(a&42)!==0?1:Ei(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ei(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function jn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rr(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:ag(e.type))}function da(e,t){var a=G.p;try{return G.p=e,t()}finally{G.p=a}}var on=Math.random().toString(36).slice(2),ct="__reactFiber$"+on,yt="__reactProps$"+on,ha="__reactContainer$"+on,jr="__reactEvents$"+on,tl="__reactListeners$"+on,Nn="__reactHandles$"+on,Nr="__reactResources$"+on,Za="__reactMarker$"+on;function Lr(e){delete e[ct],delete e[yt],delete e[jr],delete e[tl],delete e[Nn]}function Ln(e){var t=e[ct];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ha]||a[ct]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=qm(e);e!==null;){if(a=e[ct])return a;e=qm(e)}return t}e=a,a=e.parentNode}return null}function Dn(e){if(e=e[ct]||e[ha]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function fa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Un(e){var t=e[Nr];return t||(t=e[Nr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[Za]=!0}var nl=new Set,Wa={};function Mn(e,t){ma(e,t),ma(e+"Capture",t)}function ma(e,t){for(Wa[e]=t,e=0;e<t.length;e++)nl.add(t[e])}var vt=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]*$"),Fa={},Ai={};function $o(e){return qa.call(Ai,e)?!0:qa.call(Fa,e)?!1:vt.test(e)?Ai[e]=!0:(Fa[e]=!0,!1)}function Dr(e,t,a){if($o(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ci(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function un(e,t,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ei(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ti(e,t,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){a=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xi(e){if(!e._valueTracker){var t=ei(e)?"checked":"value";e._valueTracker=ti(e,t,""+e[t])}}function al(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),s="";return e&&(s=ei(e)?e.checked?"true":"false":e.value),e=s,e!==a?(t.setValue(e),!0):!1}function Oi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var qo=/[\n"\\]/g;function A(e){return e.replace(qo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function K(e,t,a,s,o,c,f,v){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?oe(e,f,xt(t)):a!=null?oe(e,f,xt(a)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+xt(v):e.removeAttribute("name")}function te(e,t,a,s,o,c,f,v){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){xi(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=v?e.checked:!!s,e.defaultChecked=!!s,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),xi(e)}function oe(e,t,a){t==="number"&&Oi(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ve(e,t,a,s){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&s&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ge(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function ze(e,t,a,s){if(t==null){if(s!=null){if(a!=null)throw Error(l(92));if(Pe(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),xi(e)}function ft(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var nt=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 bt(e,t,a){var s=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,a):typeof a!="number"||a===0||nt.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function il(e,t,a){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&a[o]!==s&&bt(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&bt(e,c,t[c])}function Ur(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Mr=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"]]),rl=/^[\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 ga(e){return rl.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function zn(){}var Po=null;function Io(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,ji=null;function jd(e){var t=Dn(e);if(t&&(e=t.stateNode)){var a=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(K(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+A(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var s=a[t];if(s!==e&&s.form===e.form){var o=s[yt]||null;if(!o)throw Error(l(90));K(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<a.length;t++)s=a[t],s.form===e.form&&al(s)}break e;case"textarea":ge(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&ve(e,!!a.multiple,t,!1)}}}var Go=!1;function Nd(e,t,a){if(Go)return e(t,a);Go=!0;try{var s=e(t);return s}finally{if(Go=!1,(Ri!==null||ji!==null)&&(Kl(),Ri&&(t=Ri,e=ji,ji=Ri=null,jd(t),e)))for(t=0;t<e.length;t++)jd(e[t])}}function zr(e,t){var a=e.stateNode;if(a===null)return null;var s=a[yt]||null;if(s===null)return null;a=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,t,typeof a));return a}var Bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vo=!1;if(Bn)try{var Br={};Object.defineProperty(Br,"passive",{get:function(){Vo=!0}}),window.addEventListener("test",Br,Br),window.removeEventListener("test",Br,Br)}catch{Vo=!1}var pa=null,Ko=null,sl=null;function Ld(){if(sl)return sl;var e,t=Ko,a=t.length,s,o="value"in pa?pa.value:pa.textContent,c=o.length;for(e=0;e<a&&t[e]===o[e];e++);var f=a-e;for(s=1;s<=f&&t[a-s]===o[c-s];s++);return sl=o.slice(e,1<s?1-s:void 0)}function ll(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ol(){return!0}function Dd(){return!1}function jt(e){function t(a,s,o,c,f){this._reactName=a,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(c):c[v]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ol:Dd,this.isPropagationStopped=Dd,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ol)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ol)},persist:function(){},isPersistent:ol}),t}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ul=jt(ni),Hr=b({},ni,{view:0,detail:0}),Hp=jt(Hr),Yo,Jo,$r,cl=b({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$r&&($r&&e.type==="mousemove"?(Yo=e.screenX-$r.screenX,Jo=e.screenY-$r.screenY):Jo=Yo=0,$r=e),Yo)},movementY:function(e){return"movementY"in e?e.movementY:Jo}}),Ud=jt(cl),$p=b({},cl,{dataTransfer:0}),qp=jt($p),Pp=b({},Hr,{relatedTarget:0}),Xo=jt(Pp),Ip=b({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Gp=jt(Ip),Vp=b({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kp=jt(Vp),Yp=b({},ni,{data:0}),Md=jt(Yp),Jp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xp={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"},Qp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qp[e])?!!t[e]:!1}function Qo(){return Zp}var Wp=b({},Hr,{key:function(e){if(e.key){var t=Jp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ll(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qo,charCode:function(e){return e.type==="keypress"?ll(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ll(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fp=jt(Wp),ey=b({},cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zd=jt(ey),ty=b({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qo}),ny=jt(ty),ay=b({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),iy=jt(ay),ry=b({},cl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),sy=jt(ry),ly=b({},ni,{newState:0,oldState:0}),oy=jt(ly),uy=[9,13,27,32],Zo=Bn&&"CompositionEvent"in window,qr=null;Bn&&"documentMode"in document&&(qr=document.documentMode);var cy=Bn&&"TextEvent"in window&&!qr,Bd=Bn&&(!Zo||qr&&8<qr&&11>=qr),Hd=" ",$d=!1;function qd(e,t){switch(e){case"keyup":return uy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ni=!1;function dy(e,t){switch(e){case"compositionend":return Pd(t);case"keypress":return t.which!==32?null:($d=!0,Hd);case"textInput":return e=t.data,e===Hd&&$d?null:e;default:return null}}function hy(e,t){if(Ni)return e==="compositionend"||!Zo&&qd(e,t)?(e=Ld(),sl=Ko=pa=null,Ni=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bd&&t.locale!=="ko"?null:t.data;default:return null}}var fy={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 Id(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fy[e.type]:t==="textarea"}function Gd(e,t,a,s){Ri?ji?ji.push(s):ji=[s]:Ri=s,t=Fl(t,"onChange"),0<t.length&&(a=new ul("onChange","change",null,a,s),e.push({event:a,listeners:t}))}var Pr=null,Ir=null;function my(e){Cm(e,0)}function dl(e){var t=fa(e);if(al(t))return e}function Vd(e,t){if(e==="change")return t}var Kd=!1;if(Bn){var Wo;if(Bn){var Fo="oninput"in document;if(!Fo){var Yd=document.createElement("div");Yd.setAttribute("oninput","return;"),Fo=typeof Yd.oninput=="function"}Wo=Fo}else Wo=!1;Kd=Wo&&(!document.documentMode||9<document.documentMode)}function Jd(){Pr&&(Pr.detachEvent("onpropertychange",Xd),Ir=Pr=null)}function Xd(e){if(e.propertyName==="value"&&dl(Ir)){var t=[];Gd(t,Ir,e,Io(e)),Nd(my,t)}}function gy(e,t,a){e==="focusin"?(Jd(),Pr=t,Ir=a,Pr.attachEvent("onpropertychange",Xd)):e==="focusout"&&Jd()}function py(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return dl(Ir)}function yy(e,t){if(e==="click")return dl(t)}function vy(e,t){if(e==="input"||e==="change")return dl(t)}function by(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ht=typeof Object.is=="function"?Object.is:by;function Gr(e,t){if(Ht(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var o=a[s];if(!qa.call(t,o)||!Ht(e[o],t[o]))return!1}return!0}function Qd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zd(e,t){var a=Qd(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=t&&s>=t)return{node:a,offset:t-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Qd(a)}}function Wd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Oi(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Oi(e.document)}return t}function eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var wy=Bn&&"documentMode"in document&&11>=document.documentMode,Li=null,tu=null,Vr=null,nu=!1;function eh(e,t,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;nu||Li==null||Li!==Oi(s)||(s=Li,"selectionStart"in s&&eu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Vr&&Gr(Vr,s)||(Vr=s,s=Fl(tu,"onSelect"),0<s.length&&(t=new ul("onSelect","select",null,t,a),e.push({event:t,listeners:s}),t.target=Li)))}function ai(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Di={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},au={},th={};Bn&&(th=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);function ii(e){if(au[e])return au[e];if(!Di[e])return e;var t=Di[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in th)return au[e]=t[a];return e}var nh=ii("animationend"),ah=ii("animationiteration"),ih=ii("animationstart"),Sy=ii("transitionrun"),_y=ii("transitionstart"),Ty=ii("transitioncancel"),rh=ii("transitionend"),sh=new Map,iu="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(" ");iu.push("scrollEnd");function cn(e,t){sh.set(e,t),Mn(t,[e])}var hl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qt=[],Ui=0,ru=0;function fl(){for(var e=Ui,t=ru=Ui=0;t<e;){var a=Qt[t];Qt[t++]=null;var s=Qt[t];Qt[t++]=null;var o=Qt[t];Qt[t++]=null;var c=Qt[t];if(Qt[t++]=null,s!==null&&o!==null){var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}c!==0&&lh(a,o,c)}}function ml(e,t,a,s){Qt[Ui++]=e,Qt[Ui++]=t,Qt[Ui++]=a,Qt[Ui++]=s,ru|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function su(e,t,a,s){return ml(e,t,a,s),gl(e)}function ri(e,t){return ml(e,null,null,t),gl(e)}function lh(e,t,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var o=!1,c=e.return;c!==null;)c.childLanes|=a,s=c.alternate,s!==null&&(s.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-Oe(a),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=a|536870912),c):null}function gl(e){if(50<fs)throw fs=0,gc=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Mi={};function ky(e,t,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,a,s){return new ky(e,t,a,s)}function lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hn(e,t){var a=e.alternate;return a===null?(a=$t(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function oh(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pl(e,t,a,s,o,c){var f=0;if(s=e,typeof e=="function")lu(e)&&(f=1);else if(typeof e=="string")f=Ov(e,a,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Te:return e=$t(31,a,t,o),e.elementType=Te,e.lanes=c,e;case O:return si(a.children,o,c,t);case I:f=8,o|=24;break;case $:return e=$t(12,a,t,o|2),e.elementType=$,e.lanes=c,e;case me:return e=$t(13,a,t,o),e.elementType=me,e.lanes=c,e;case ie:return e=$t(19,a,t,o),e.elementType=ie,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:f=10;break e;case H:f=9;break e;case X:f=11;break e;case J:f=14;break e;case xe:f=16,s=null;break e}f=29,a=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=$t(f,a,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function si(e,t,a,s){return e=$t(7,e,s,t),e.lanes=a,e}function ou(e,t,a){return e=$t(6,e,null,t),e.lanes=a,e}function uh(e){var t=$t(18,null,null,0);return t.stateNode=e,t}function uu(e,t,a){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ch=new WeakMap;function Zt(e,t){if(typeof e=="object"&&e!==null){var a=ch.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Zs(t)},ch.set(e,t),t)}return{value:e,source:t,stack:Zs(t)}}var zi=[],Bi=0,yl=null,Kr=0,Wt=[],Ft=0,ya=null,wn=1,Sn="";function $n(e,t){zi[Bi++]=Kr,zi[Bi++]=yl,yl=e,Kr=t}function dh(e,t,a){Wt[Ft++]=wn,Wt[Ft++]=Sn,Wt[Ft++]=ya,ya=e;var s=wn;e=Sn;var o=32-Oe(s)-1;s&=~(1<<o),a+=1;var c=32-Oe(t)+o;if(30<c){var f=o-o%5;c=(s&(1<<f)-1).toString(32),s>>=f,o-=f,wn=1<<32-Oe(t)+o|a<<o|s,Sn=c+e}else wn=1<<c|a<<o|s,Sn=e}function cu(e){e.return!==null&&($n(e,1),dh(e,1,0))}function du(e){for(;e===yl;)yl=zi[--Bi],zi[Bi]=null,Kr=zi[--Bi],zi[Bi]=null;for(;e===ya;)ya=Wt[--Ft],Wt[Ft]=null,Sn=Wt[--Ft],Wt[Ft]=null,wn=Wt[--Ft],Wt[Ft]=null}function hh(e,t){Wt[Ft++]=wn,Wt[Ft++]=Sn,Wt[Ft++]=ya,wn=t.id,Sn=t.overflow,ya=e}var wt=null,$e=null,Se=!1,va=null,en=!1,hu=Error(l(519));function ba(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yr(Zt(t,e)),hu}function fh(e){var t=e.stateNode,a=e.type,s=e.memoizedProps;switch(t[ct]=e,t[yt]=s,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<gs.length;a++)ye(gs[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),te(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),ze(t,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||s.suppressHydrationWarning===!0||jm(t.textContent,a)?(s.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),s.onScroll!=null&&ye("scroll",t),s.onScrollEnd!=null&&ye("scrollend",t),s.onClick!=null&&(t.onclick=zn),t=!0):t=!1,t||ba(e,!0)}function mh(e){for(wt=e.return;wt;)switch(wt.tag){case 5:case 31:case 13:en=!1;return;case 27:case 3:en=!0;return;default:wt=wt.return}}function Hi(e){if(e!==wt)return!1;if(!Se)return mh(e),Se=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Rc(e.type,e.memoizedProps)),a=!a),a&&$e&&ba(e),mh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$e=$m(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$e=$m(e)}else t===27?(t=$e,La(e.type)?(e=Uc,Uc=null,$e=e):$e=t):$e=wt?nn(e.stateNode.nextSibling):null;return!0}function li(){$e=wt=null,Se=!1}function fu(){var e=va;return e!==null&&(Ut===null?Ut=e:Ut.push.apply(Ut,e),va=null),e}function Yr(e){va===null?va=[e]:va.push(e)}var mu=E(null),oi=null,qn=null;function wa(e,t,a){V(mu,t._currentValue),t._currentValue=a}function Pn(e){e._currentValue=mu.current,U(mu)}function gu(e,t,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===a)break;e=e.return}}function pu(e,t,a,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var v=c;c=o;for(var _=0;_<t.length;_++)if(v.context===t[_]){c.lanes|=a,v=c.alternate,v!==null&&(v.lanes|=a),gu(c.return,a,e),s||(f=null);break e}c=v.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(l(341));f.lanes|=a,c=f.alternate,c!==null&&(c.lanes|=a),gu(f,a,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function $i(e,t,a,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(l(387));if(f=f.memoizedProps,f!==null){var v=o.type;Ht(o.pendingProps.value,f.value)||(e!==null?e.push(v):e=[v])}}else if(o===ke.current){if(f=o.alternate,f===null)throw Error(l(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ws):e=[ws])}o=o.return}e!==null&&pu(t,e,a,s),t.flags|=262144}function vl(e){for(e=e.firstContext;e!==null;){if(!Ht(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ui(e){oi=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return gh(oi,e)}function bl(e,t){return oi===null&&ui(e),gh(e,t)}function gh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},qn===null){if(e===null)throw Error(l(308));qn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qn=qn.next=t;return a}var Ey=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ay=i.unstable_scheduleCallback,Cy=i.unstable_NormalPriority,at={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yu(){return{controller:new Ey,data:new Map,refCount:0}}function Jr(e){e.refCount--,e.refCount===0&&Ay(Cy,function(){e.controller.abort()})}var Xr=null,vu=0,qi=0,Pi=null;function xy(e,t){if(Xr===null){var a=Xr=[];vu=0,qi=Sc(),Pi={status:"pending",value:void 0,then:function(s){a.push(s)}}}return vu++,t.then(ph,ph),t}function ph(){if(--vu===0&&Xr!==null){Pi!==null&&(Pi.status="fulfilled");var e=Xr;Xr=null,qi=0,Pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Oy(e,t){var a=[],s={status:"pending",value:null,reason:null,then:function(o){a.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<a.length;o++)(0,a[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<a.length;o++)(0,a[o])(void 0)}),s}var yh=D.S;D.S=function(e,t){tm=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xy(e,t),yh!==null&&yh(e,t)};var ci=E(null);function bu(){var e=ci.current;return e!==null?e:Be.pooledCache}function wl(e,t){t===null?V(ci,ci.current):V(ci,t.pool)}function vh(){var e=bu();return e===null?null:{parent:at._currentValue,pool:e}}var Ii=Error(l(460)),wu=Error(l(474)),Sl=Error(l(542)),_l={then:function(){}};function bh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(zn,zn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_h(e),e;default:if(typeof t.status=="string")t.then(zn,zn);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_h(e),e}throw hi=t,Ii}}function di(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(hi=a,Ii):a}}var hi=null;function Sh(){if(hi===null)throw Error(l(459));var e=hi;return hi=null,e}function _h(e){if(e===Ii||e===Sl)throw Error(l(483))}var Gi=null,Qr=0;function Tl(e){var t=Qr;return Qr+=1,Gi===null&&(Gi=[]),wh(Gi,e,t)}function Zr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function kl(e,t){throw t.$$typeof===T?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Th(e){function t(C,k){if(e){var R=C.deletions;R===null?(C.deletions=[k],C.flags|=16):R.push(k)}}function a(C,k){if(!e)return null;for(;k!==null;)t(C,k),k=k.sibling;return null}function s(C){for(var k=new Map;C!==null;)C.key!==null?k.set(C.key,C):k.set(C.index,C),C=C.sibling;return k}function o(C,k){return C=Hn(C,k),C.index=0,C.sibling=null,C}function c(C,k,R){return C.index=R,e?(R=C.alternate,R!==null?(R=R.index,R<k?(C.flags|=67108866,k):R):(C.flags|=67108866,k)):(C.flags|=1048576,k)}function f(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function v(C,k,R,z){return k===null||k.tag!==6?(k=ou(R,C.mode,z),k.return=C,k):(k=o(k,R),k.return=C,k)}function _(C,k,R,z){var ae=R.type;return ae===O?M(C,k,R.props.children,z,R.key):k!==null&&(k.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===xe&&di(ae)===k.type)?(k=o(k,R.props),Zr(k,R),k.return=C,k):(k=pl(R.type,R.key,R.props,null,C.mode,z),Zr(k,R),k.return=C,k)}function j(C,k,R,z){return k===null||k.tag!==4||k.stateNode.containerInfo!==R.containerInfo||k.stateNode.implementation!==R.implementation?(k=uu(R,C.mode,z),k.return=C,k):(k=o(k,R.children||[]),k.return=C,k)}function M(C,k,R,z,ae){return k===null||k.tag!==7?(k=si(R,C.mode,z,ae),k.return=C,k):(k=o(k,R),k.return=C,k)}function B(C,k,R){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ou(""+k,C.mode,R),k.return=C,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case S:return R=pl(k.type,k.key,k.props,null,C.mode,R),Zr(R,k),R.return=C,R;case x:return k=uu(k,C.mode,R),k.return=C,k;case xe:return k=di(k),B(C,k,R)}if(Pe(k)||Ne(k))return k=si(k,C.mode,R,null),k.return=C,k;if(typeof k.then=="function")return B(C,Tl(k),R);if(k.$$typeof===q)return B(C,bl(C,k),R);kl(C,k)}return null}function N(C,k,R,z){var ae=k!==null?k.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ae!==null?null:v(C,k,""+R,z);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return R.key===ae?_(C,k,R,z):null;case x:return R.key===ae?j(C,k,R,z):null;case xe:return R=di(R),N(C,k,R,z)}if(Pe(R)||Ne(R))return ae!==null?null:M(C,k,R,z,null);if(typeof R.then=="function")return N(C,k,Tl(R),z);if(R.$$typeof===q)return N(C,k,bl(C,R),z);kl(C,R)}return null}function L(C,k,R,z,ae){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return C=C.get(R)||null,v(k,C,""+z,ae);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return C=C.get(z.key===null?R:z.key)||null,_(k,C,z,ae);case x:return C=C.get(z.key===null?R:z.key)||null,j(k,C,z,ae);case xe:return z=di(z),L(C,k,R,z,ae)}if(Pe(z)||Ne(z))return C=C.get(R)||null,M(k,C,z,ae,null);if(typeof z.then=="function")return L(C,k,R,Tl(z),ae);if(z.$$typeof===q)return L(C,k,R,bl(k,z),ae);kl(k,z)}return null}function Z(C,k,R,z){for(var ae=null,Ee=null,ee=k,fe=k=0,we=null;ee!==null&&fe<R.length;fe++){ee.index>fe?(we=ee,ee=null):we=ee.sibling;var Ae=N(C,ee,R[fe],z);if(Ae===null){ee===null&&(ee=we);break}e&&ee&&Ae.alternate===null&&t(C,ee),k=c(Ae,k,fe),Ee===null?ae=Ae:Ee.sibling=Ae,Ee=Ae,ee=we}if(fe===R.length)return a(C,ee),Se&&$n(C,fe),ae;if(ee===null){for(;fe<R.length;fe++)ee=B(C,R[fe],z),ee!==null&&(k=c(ee,k,fe),Ee===null?ae=ee:Ee.sibling=ee,Ee=ee);return Se&&$n(C,fe),ae}for(ee=s(ee);fe<R.length;fe++)we=L(ee,C,fe,R[fe],z),we!==null&&(e&&we.alternate!==null&&ee.delete(we.key===null?fe:we.key),k=c(we,k,fe),Ee===null?ae=we:Ee.sibling=we,Ee=we);return e&&ee.forEach(function(Ba){return t(C,Ba)}),Se&&$n(C,fe),ae}function se(C,k,R,z){if(R==null)throw Error(l(151));for(var ae=null,Ee=null,ee=k,fe=k=0,we=null,Ae=R.next();ee!==null&&!Ae.done;fe++,Ae=R.next()){ee.index>fe?(we=ee,ee=null):we=ee.sibling;var Ba=N(C,ee,Ae.value,z);if(Ba===null){ee===null&&(ee=we);break}e&&ee&&Ba.alternate===null&&t(C,ee),k=c(Ba,k,fe),Ee===null?ae=Ba:Ee.sibling=Ba,Ee=Ba,ee=we}if(Ae.done)return a(C,ee),Se&&$n(C,fe),ae;if(ee===null){for(;!Ae.done;fe++,Ae=R.next())Ae=B(C,Ae.value,z),Ae!==null&&(k=c(Ae,k,fe),Ee===null?ae=Ae:Ee.sibling=Ae,Ee=Ae);return Se&&$n(C,fe),ae}for(ee=s(ee);!Ae.done;fe++,Ae=R.next())Ae=L(ee,C,fe,Ae.value,z),Ae!==null&&(e&&Ae.alternate!==null&&ee.delete(Ae.key===null?fe:Ae.key),k=c(Ae,k,fe),Ee===null?ae=Ae:Ee.sibling=Ae,Ee=Ae);return e&&ee.forEach(function($v){return t(C,$v)}),Se&&$n(C,fe),ae}function Ue(C,k,R,z){if(typeof R=="object"&&R!==null&&R.type===O&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case S:e:{for(var ae=R.key;k!==null;){if(k.key===ae){if(ae=R.type,ae===O){if(k.tag===7){a(C,k.sibling),z=o(k,R.props.children),z.return=C,C=z;break e}}else if(k.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===xe&&di(ae)===k.type){a(C,k.sibling),z=o(k,R.props),Zr(z,R),z.return=C,C=z;break e}a(C,k);break}else t(C,k);k=k.sibling}R.type===O?(z=si(R.props.children,C.mode,z,R.key),z.return=C,C=z):(z=pl(R.type,R.key,R.props,null,C.mode,z),Zr(z,R),z.return=C,C=z)}return f(C);case x:e:{for(ae=R.key;k!==null;){if(k.key===ae)if(k.tag===4&&k.stateNode.containerInfo===R.containerInfo&&k.stateNode.implementation===R.implementation){a(C,k.sibling),z=o(k,R.children||[]),z.return=C,C=z;break e}else{a(C,k);break}else t(C,k);k=k.sibling}z=uu(R,C.mode,z),z.return=C,C=z}return f(C);case xe:return R=di(R),Ue(C,k,R,z)}if(Pe(R))return Z(C,k,R,z);if(Ne(R)){if(ae=Ne(R),typeof ae!="function")throw Error(l(150));return R=ae.call(R),se(C,k,R,z)}if(typeof R.then=="function")return Ue(C,k,Tl(R),z);if(R.$$typeof===q)return Ue(C,k,bl(C,R),z);kl(C,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,k!==null&&k.tag===6?(a(C,k.sibling),z=o(k,R),z.return=C,C=z):(a(C,k),z=ou(R,C.mode,z),z.return=C,C=z),f(C)):a(C,k)}return function(C,k,R,z){try{Qr=0;var ae=Ue(C,k,R,z);return Gi=null,ae}catch(ee){if(ee===Ii||ee===Sl)throw ee;var Ee=$t(29,ee,null,C.mode);return Ee.lanes=z,Ee.return=C,Ee}}}var fi=Th(!0),kh=Th(!1),Sa=!1;function Su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ta(e,t,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ce&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=gl(e),lh(e,null,a),t}return ml(e,s,t,a),gl(e)}function Wr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Qa(e,a)}}function Tu(e,t){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var o=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,a=a.next}while(a!==null);c===null?o=c=t:c=c.next=t}else o=c=t;a={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ku=!1;function Fr(){if(ku){var e=Pi;if(e!==null)throw e}}function es(e,t,a,s){ku=!1;var o=e.updateQueue;Sa=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,v=o.shared.pending;if(v!==null){o.shared.pending=null;var _=v,j=_.next;_.next=null,f===null?c=j:f.next=j,f=_;var M=e.alternate;M!==null&&(M=M.updateQueue,v=M.lastBaseUpdate,v!==f&&(v===null?M.firstBaseUpdate=j:v.next=j,M.lastBaseUpdate=_))}if(c!==null){var B=o.baseState;f=0,M=j=_=null,v=c;do{var N=v.lane&-536870913,L=N!==v.lane;if(L?(be&N)===N:(s&N)===N){N!==0&&N===qi&&(ku=!0),M!==null&&(M=M.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var Z=e,se=v;N=t;var Ue=a;switch(se.tag){case 1:if(Z=se.payload,typeof Z=="function"){B=Z.call(Ue,B,N);break e}B=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=se.payload,N=typeof Z=="function"?Z.call(Ue,B,N):Z,N==null)break e;B=b({},B,N);break e;case 2:Sa=!0}}N=v.callback,N!==null&&(e.flags|=64,L&&(e.flags|=8192),L=o.callbacks,L===null?o.callbacks=[N]:L.push(N))}else L={lane:N,tag:v.tag,payload:v.payload,callback:v.callback,next:null},M===null?(j=M=L,_=B):M=M.next=L,f|=N;if(v=v.next,v===null){if(v=o.shared.pending,v===null)break;L=v,v=L.next,L.next=null,o.lastBaseUpdate=L,o.shared.pending=null}}while(!0);M===null&&(_=B),o.baseState=_,o.firstBaseUpdate=j,o.lastBaseUpdate=M,c===null&&(o.shared.lanes=0),xa|=f,e.lanes=f,e.memoizedState=B}}function Eh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ah(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Eh(a[e],t)}var Vi=E(null),El=E(0);function Ch(e,t){e=Zn,V(El,e),V(Vi,t),Zn=e|t.baseLanes}function Eu(){V(El,Zn),V(Vi,Vi.current)}function Au(){Zn=El.current,U(Vi),U(El)}var qt=E(null),tn=null;function ka(e){var t=e.alternate;V(We,We.current&1),V(qt,e),tn===null&&(t===null||Vi.current!==null||t.memoizedState!==null)&&(tn=e)}function Cu(e){V(We,We.current),V(qt,e),tn===null&&(tn=e)}function xh(e){e.tag===22?(V(We,We.current),V(qt,e),tn===null&&(tn=e)):Ea()}function Ea(){V(We,We.current),V(qt,qt.current)}function Pt(e){U(qt),tn===e&&(tn=null),U(We)}var We=E(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lc(a)||Dc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var In=0,he=null,Le=null,it=null,Cl=!1,Ki=!1,mi=!1,xl=0,ts=0,Yi=null,Ry=0;function Je(){throw Error(l(321))}function xu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Ht(e[a],t[a]))return!1;return!0}function Ou(e,t,a,s,o,c){return In=c,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?hf:Gu,mi=!1,c=a(s,o),mi=!1,Ki&&(c=Rh(t,a,s,o)),Oh(e),c}function Oh(e){D.H=is;var t=Le!==null&&Le.next!==null;if(In=0,it=Le=he=null,Cl=!1,ts=0,Yi=null,t)throw Error(l(300));e===null||rt||(e=e.dependencies,e!==null&&vl(e)&&(rt=!0))}function Rh(e,t,a,s){he=e;var o=0;do{if(Ki&&(Yi=null),ts=0,Ki=!1,25<=o)throw Error(l(301));if(o+=1,it=Le=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}D.H=ff,c=t(a,s)}while(Ki);return c}function jy(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?ns(t):t,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(he.flags|=1024),t}function Ru(){var e=xl!==0;return xl=0,e}function ju(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Nu(e){if(Cl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cl=!1}In=0,it=Le=he=null,Ki=!1,ts=xl=0,Yi=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?he.memoizedState=it=e:it=it.next=e,it}function Fe(){if(Le===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=it===null?he.memoizedState:it.next;if(t!==null)it=t,Le=e;else{if(e===null)throw he.alternate===null?Error(l(467)):Error(l(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},it===null?he.memoizedState=it=e:it=it.next=e}return it}function Ol(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=ts;return ts+=1,Yi===null&&(Yi=[]),e=wh(Yi,e,t),t=he,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?hf:Gu),e}function Rl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ns(e);if(e.$$typeof===q)return St(e)}throw Error(l(438,String(e)))}function Lu(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var s=he.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ol(),he.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),s=0;s<e;s++)a[s]=sn;return t.index++,a}function Gn(e,t){return typeof t=="function"?t(e):t}function jl(e){var t=Fe();return Du(t,Le,e)}function Du(e,t,a){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var v=f=null,_=null,j=t,M=!1;do{var B=j.lane&-536870913;if(B!==j.lane?(be&B)===B:(In&B)===B){var N=j.revertLane;if(N===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),B===qi&&(M=!0);else if((In&N)===N){j=j.next,N===qi&&(M=!0);continue}else B={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},_===null?(v=_=B,f=c):_=_.next=B,he.lanes|=N,xa|=N;B=j.action,mi&&a(c,B),c=j.hasEagerState?j.eagerState:a(c,B)}else N={lane:B,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},_===null?(v=_=N,f=c):_=_.next=N,he.lanes|=B,xa|=B;j=j.next}while(j!==null&&j!==t);if(_===null?f=c:_.next=v,!Ht(c,e.memoizedState)&&(rt=!0,M&&(a=Pi,a!==null)))throw a;e.memoizedState=c,e.baseState=f,e.baseQueue=_,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Uu(e){var t=Fe(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var s=a.dispatch,o=a.pending,c=t.memoizedState;if(o!==null){a.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);Ht(c,t.memoizedState)||(rt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,s]}function jh(e,t,a){var s=he,o=Fe(),c=Se;if(c){if(a===void 0)throw Error(l(407));a=a()}else a=t();var f=!Ht((Le||o).memoizedState,a);if(f&&(o.memoizedState=a,rt=!0),o=o.queue,Bu(Dh.bind(null,s,o,e),[e]),o.getSnapshot!==t||f||it!==null&&it.memoizedState.tag&1){if(s.flags|=2048,Ji(9,{destroy:void 0},Lh.bind(null,s,o,a,t),null),Be===null)throw Error(l(349));c||(In&127)!==0||Nh(s,t,a)}return a}function Nh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=Ol(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Lh(e,t,a,s){t.value=a,t.getSnapshot=s,Uh(t)&&Mh(e)}function Dh(e,t,a){return a(function(){Uh(t)&&Mh(e)})}function Uh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Ht(e,a)}catch{return!0}}function Mh(e){var t=ri(e,2);t!==null&&Mt(t,e,2)}function Mu(e){var t=Ot();if(typeof e=="function"){var a=e;if(e=a(),mi){ln(!0);try{a()}finally{ln(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:e},t}function zh(e,t,a,s){return e.baseState=a,Du(e,Le,typeof s=="function"?s:Gn)}function Ny(e,t,a,s,o){if(Dl(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};D.T!==null?a(!0):c.isTransition=!1,s(c),a=t.pending,a===null?(c.next=t.pending=c,Bh(t,c)):(c.next=a.next,t.pending=a.next=c)}}function Bh(e,t){var a=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=D.T,f={};D.T=f;try{var v=a(o,s),_=D.S;_!==null&&_(f,v),Hh(e,t,v)}catch(j){zu(e,t,j)}finally{c!==null&&f.types!==null&&(c.types=f.types),D.T=c}}else try{c=a(o,s),Hh(e,t,c)}catch(j){zu(e,t,j)}}function Hh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){$h(e,t,s)},function(s){return zu(e,t,s)}):$h(e,t,a)}function $h(e,t,a){t.status="fulfilled",t.value=a,qh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Bh(e,a)))}function zu(e,t,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=a,qh(t),t=t.next;while(t!==s)}e.action=null}function qh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ph(e,t){return t}function Ih(e,t){if(Se){var a=Be.formState;if(a!==null){e:{var s=he;if(Se){if($e){t:{for(var o=$e,c=en;o.nodeType!==8;){if(!c){o=null;break t}if(o=nn(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){$e=nn(o.nextSibling),s=o.data==="F!";break e}}ba(s)}s=!1}s&&(t=a[0])}}return a=Ot(),a.memoizedState=a.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ph,lastRenderedState:t},a.queue=s,a=uf.bind(null,he,s),s.dispatch=a,s=Mu(!1),c=Iu.bind(null,he,!1,s.queue),s=Ot(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,a=Ny.bind(null,he,o,c,a),o.dispatch=a,s.memoizedState=e,[t,a,!1]}function Gh(e){var t=Fe();return Vh(t,Le,e)}function Vh(e,t,a){if(t=Du(e,t,Ph)[0],e=jl(Gn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ns(t)}catch(f){throw f===Ii?Sl:f}else s=t;t=Fe();var o=t.queue,c=o.dispatch;return a!==t.memoizedState&&(he.flags|=2048,Ji(9,{destroy:void 0},Ly.bind(null,o,a),null)),[s,c,e]}function Ly(e,t){e.action=t}function Kh(e){var t=Fe(),a=Le;if(a!==null)return Vh(t,a,e);Fe(),t=t.memoizedState,a=Fe();var s=a.queue.dispatch;return a.memoizedState=e,[t,s,!1]}function Ji(e,t,a,s){return e={tag:e,create:a,deps:s,inst:t,next:null},t=he.updateQueue,t===null&&(t=Ol(),he.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,t.lastEffect=e),e}function Yh(){return Fe().memoizedState}function Nl(e,t,a,s){var o=Ot();he.flags|=e,o.memoizedState=Ji(1|t,{destroy:void 0},a,s===void 0?null:s)}function Ll(e,t,a,s){var o=Fe();s=s===void 0?null:s;var c=o.memoizedState.inst;Le!==null&&s!==null&&xu(s,Le.memoizedState.deps)?o.memoizedState=Ji(t,c,a,s):(he.flags|=e,o.memoizedState=Ji(1|t,c,a,s))}function Jh(e,t){Nl(8390656,8,e,t)}function Bu(e,t){Ll(2048,8,e,t)}function Dy(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=Ol(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Xh(e){var t=Fe().memoizedState;return Dy({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Qh(e,t){return Ll(4,2,e,t)}function Zh(e,t){return Ll(4,4,e,t)}function Wh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Fh(e,t,a){a=a!=null?a.concat([e]):null,Ll(4,4,Wh.bind(null,t,e),a)}function Hu(){}function ef(e,t){var a=Fe();t=t===void 0?null:t;var s=a.memoizedState;return t!==null&&xu(t,s[1])?s[0]:(a.memoizedState=[e,t],e)}function tf(e,t){var a=Fe();t=t===void 0?null:t;var s=a.memoizedState;if(t!==null&&xu(t,s[1]))return s[0];if(s=e(),mi){ln(!0);try{e()}finally{ln(!1)}}return a.memoizedState=[s,t],s}function $u(e,t,a){return a===void 0||(In&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=am(),he.lanes|=e,xa|=e,a)}function nf(e,t,a,s){return Ht(a,t)?a:Vi.current!==null?(e=$u(e,a,s),Ht(e,t)||(rt=!0),e):(In&42)===0||(In&1073741824)!==0&&(be&261930)===0?(rt=!0,e.memoizedState=a):(e=am(),he.lanes|=e,xa|=e,t)}function af(e,t,a,s,o){var c=G.p;G.p=c!==0&&8>c?c:8;var f=D.T,v={};D.T=v,Iu(e,!1,t,a);try{var _=o(),j=D.S;if(j!==null&&j(v,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var M=Oy(_,s);as(e,t,M,Vt(e))}else as(e,t,s,Vt(e))}catch(B){as(e,t,{then:function(){},status:"rejected",reason:B},Vt())}finally{G.p=c,f!==null&&v.types!==null&&(f.types=v.types),D.T=f}}function Uy(){}function qu(e,t,a,s){if(e.tag!==5)throw Error(l(476));var o=rf(e).queue;af(e,o,t,ne,a===null?Uy:function(){return sf(e),a(s)})}function rf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sf(e){var t=rf(e);t.next===null&&(t=e.alternate.memoizedState),as(e,t.next.queue,{},Vt())}function Pu(){return St(ws)}function lf(){return Fe().memoizedState}function of(){return Fe().memoizedState}function My(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Vt();e=_a(a);var s=Ta(t,e,a);s!==null&&(Mt(s,t,a),Wr(s,t,a)),t={cache:yu()},e.payload=t;return}t=t.return}}function zy(e,t,a){var s=Vt();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Dl(e)?cf(t,a):(a=su(e,t,a,s),a!==null&&(Mt(a,e,s),df(a,t,s)))}function uf(e,t,a){var s=Vt();as(e,t,a,s)}function as(e,t,a,s){var o={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Dl(e))cf(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,v=c(f,a);if(o.hasEagerState=!0,o.eagerState=v,Ht(v,f))return ml(e,t,o,0),Be===null&&fl(),!1}catch{}if(a=su(e,t,o,s),a!==null)return Mt(a,e,s),df(a,t,s),!0}return!1}function Iu(e,t,a,s){if(s={lane:2,revertLane:Sc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dl(e)){if(t)throw Error(l(479))}else t=su(e,a,s,2),t!==null&&Mt(t,e,2)}function Dl(e){var t=e.alternate;return e===he||t!==null&&t===he}function cf(e,t){Ki=Cl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function df(e,t,a){if((a&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,a|=s,t.lanes=a,Qa(e,a)}}var is={readContext:St,use:Rl,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je};is.useEffectEvent=Je;var hf={readContext:St,use:Rl,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Jh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Nl(4194308,4,Wh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){Nl(4,2,e,t)},useMemo:function(e,t){var a=Ot();t=t===void 0?null:t;var s=e();if(mi){ln(!0);try{e()}finally{ln(!1)}}return a.memoizedState=[s,t],s},useReducer:function(e,t,a){var s=Ot();if(a!==void 0){var o=a(t);if(mi){ln(!0);try{a(t)}finally{ln(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=zy.bind(null,he,e),[s.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Mu(e);var t=e.queue,a=uf.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Hu,useDeferredValue:function(e,t){var a=Ot();return $u(a,e,t)},useTransition:function(){var e=Mu(!1);return e=af.bind(null,he,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var s=he,o=Ot();if(Se){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),Be===null)throw Error(l(349));(be&127)!==0||Nh(s,t,a)}o.memoizedState=a;var c={value:a,getSnapshot:t};return o.queue=c,Jh(Dh.bind(null,s,c,e),[e]),s.flags|=2048,Ji(9,{destroy:void 0},Lh.bind(null,s,c,a,t),null),a},useId:function(){var e=Ot(),t=Be.identifierPrefix;if(Se){var a=Sn,s=wn;a=(s&~(1<<32-Oe(s)-1)).toString(32)+a,t="_"+t+"R_"+a,a=xl++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Ry++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Pu,useFormState:Ih,useActionState:Ih,useOptimistic:function(e){var t=Ot();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Iu.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lu,useCacheRefresh:function(){return Ot().memoizedState=My.bind(null,he)},useEffectEvent:function(e){var t=Ot(),a={impl:e};return t.memoizedState=a,function(){if((Ce&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Gu={readContext:St,use:Rl,useCallback:ef,useContext:St,useEffect:Bu,useImperativeHandle:Fh,useInsertionEffect:Qh,useLayoutEffect:Zh,useMemo:tf,useReducer:jl,useRef:Yh,useState:function(){return jl(Gn)},useDebugValue:Hu,useDeferredValue:function(e,t){var a=Fe();return nf(a,Le.memoizedState,e,t)},useTransition:function(){var e=jl(Gn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:ns(e),t]},useSyncExternalStore:jh,useId:lf,useHostTransitionStatus:Pu,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var a=Fe();return zh(a,Le,e,t)},useMemoCache:Lu,useCacheRefresh:of};Gu.useEffectEvent=Xh;var ff={readContext:St,use:Rl,useCallback:ef,useContext:St,useEffect:Bu,useImperativeHandle:Fh,useInsertionEffect:Qh,useLayoutEffect:Zh,useMemo:tf,useReducer:Uu,useRef:Yh,useState:function(){return Uu(Gn)},useDebugValue:Hu,useDeferredValue:function(e,t){var a=Fe();return Le===null?$u(a,e,t):nf(a,Le.memoizedState,e,t)},useTransition:function(){var e=Uu(Gn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:ns(e),t]},useSyncExternalStore:jh,useId:lf,useHostTransitionStatus:Pu,useFormState:Kh,useActionState:Kh,useOptimistic:function(e,t){var a=Fe();return Le!==null?zh(a,Le,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lu,useCacheRefresh:of};ff.useEffectEvent=Xh;function Vu(e,t,a,s){t=e.memoizedState,a=a(s,t),a=a==null?t:b({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ku={enqueueSetState:function(e,t,a){e=e._reactInternals;var s=Vt(),o=_a(s);o.payload=t,a!=null&&(o.callback=a),t=Ta(e,o,s),t!==null&&(Mt(t,e,s),Wr(t,e,s))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var s=Vt(),o=_a(s);o.tag=1,o.payload=t,a!=null&&(o.callback=a),t=Ta(e,o,s),t!==null&&(Mt(t,e,s),Wr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Vt(),s=_a(a);s.tag=2,t!=null&&(s.callback=t),t=Ta(e,s,a),t!==null&&(Mt(t,e,a),Wr(t,e,a))}};function mf(e,t,a,s,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,f):t.prototype&&t.prototype.isPureReactComponent?!Gr(a,s)||!Gr(o,c):!0}function gf(e,t,a,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,s),t.state!==e&&Ku.enqueueReplaceState(t,t.state,null)}function gi(e,t){var a=t;if("ref"in t){a={};for(var s in t)s!=="ref"&&(a[s]=t[s])}if(e=e.defaultProps){a===t&&(a=b({},a));for(var o in e)a[o]===void 0&&(a[o]=e[o])}return a}function pf(e){hl(e)}function yf(e){console.error(e)}function vf(e){hl(e)}function Ul(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function bf(e,t,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Yu(e,t,a){return a=_a(a),a.tag=3,a.payload={element:null},a.callback=function(){Ul(e,t)},a}function wf(e){return e=_a(e),e.tag=3,e}function Sf(e,t,a,s){var o=a.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){bf(t,a,s)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){bf(t,a,s),typeof o!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var v=s.stack;this.componentDidCatch(s.value,{componentStack:v!==null?v:""})})}function By(e,t,a,s,o){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=a.alternate,t!==null&&$i(t,a,o,!0),a=qt.current,a!==null){switch(a.tag){case 31:case 13:return tn===null?Yl():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=o,s===_l?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([s]):t.add(s),vc(e,s,o)),!1;case 22:return a.flags|=65536,s===_l?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([s]):a.add(s)),vc(e,s,o)),!1}throw Error(l(435,a.tag))}return vc(e,s,o),Yl(),!1}if(Se)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==hu&&(e=Error(l(422),{cause:s}),Yr(Zt(e,a)))):(s!==hu&&(t=Error(l(423),{cause:s}),Yr(Zt(t,a))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Zt(s,a),o=Yu(e.stateNode,s,o),Tu(e,o),Xe!==4&&(Xe=2)),!1;var c=Error(l(520),{cause:s});if(c=Zt(c,a),hs===null?hs=[c]:hs.push(c),Xe!==4&&(Xe=2),t===null)return!0;s=Zt(s,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=o&-o,a.lanes|=e,e=Yu(a.stateNode,s,e),Tu(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Oa===null||!Oa.has(c))))return a.flags|=65536,o&=-o,a.lanes|=o,o=wf(o),Sf(o,e,a,s),Tu(a,o),!1}a=a.return}while(a!==null);return!1}var Ju=Error(l(461)),rt=!1;function _t(e,t,a,s){t.child=e===null?kh(t,null,a,s):fi(t,e.child,a,s)}function _f(e,t,a,s,o){a=a.render;var c=t.ref;if("ref"in s){var f={};for(var v in s)v!=="ref"&&(f[v]=s[v])}else f=s;return ui(t),s=Ou(e,t,a,f,c,o),v=Ru(),e!==null&&!rt?(ju(e,t,o),Vn(e,t,o)):(Se&&v&&cu(t),t.flags|=1,_t(e,t,s,o),t.child)}function Tf(e,t,a,s,o){if(e===null){var c=a.type;return typeof c=="function"&&!lu(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,kf(e,t,c,s,o)):(e=pl(a.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!nc(e,o)){var f=c.memoizedProps;if(a=a.compare,a=a!==null?a:Gr,a(f,s)&&e.ref===t.ref)return Vn(e,t,o)}return t.flags|=1,e=Hn(c,s),e.ref=t.ref,e.return=t,t.child=e}function kf(e,t,a,s,o){if(e!==null){var c=e.memoizedProps;if(Gr(c,s)&&e.ref===t.ref)if(rt=!1,t.pendingProps=s=c,nc(e,o))(e.flags&131072)!==0&&(rt=!0);else return t.lanes=e.lanes,Vn(e,t,o)}return Xu(e,t,a,s,o)}function Ef(e,t,a,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return Af(e,t,c,a,s)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wl(t,c!==null?c.cachePool:null),c!==null?Ch(t,c):Eu(),xh(t);else return s=t.lanes=536870912,Af(e,t,c!==null?c.baseLanes|a:a,a,s)}else c!==null?(wl(t,c.cachePool),Ch(t,c),Ea(),t.memoizedState=null):(e!==null&&wl(t,null),Eu(),Ea());return _t(e,t,o,a),t.child}function rs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Af(e,t,a,s,o){var c=bu();return c=c===null?null:{parent:at._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&wl(t,null),Eu(),xh(t),e!==null&&$i(e,t,s,!0),t.childLanes=o,null}function Ml(e,t){return t=Bl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Cf(e,t,a){return fi(t,e.child,null,a),e=Ml(t,t.pendingProps),e.flags|=2,Pt(t),t.memoizedState=null,e}function Hy(e,t,a){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(s.mode==="hidden")return e=Ml(t,s),t.lanes=536870912,rs(null,e);if(Cu(t),(e=$e)?(e=Hm(e,en),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:wn,overflow:Sn}:null,retryLane:536870912,hydrationErrors:null},a=uh(e),a.return=t,t.child=a,wt=t,$e=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Ml(t,s)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Cu(t),o)if(t.flags&256)t.flags&=-257,t=Cf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(rt||$i(e,t,a,!1),o=(a&e.childLanes)!==0,rt||o){if(s=Be,s!==null&&(f=Or(s,a),f!==0&&f!==c.retryLane))throw c.retryLane=f,ri(e,f),Mt(s,e,f),Ju;Yl(),t=Cf(e,t,a)}else e=c.treeContext,$e=nn(f.nextSibling),wt=t,Se=!0,va=null,en=!1,e!==null&&hh(t,e),t=Ml(t,s),t.flags|=4096;return t}return e=Hn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Xu(e,t,a,s,o){return ui(t),a=Ou(e,t,a,s,void 0,o),s=Ru(),e!==null&&!rt?(ju(e,t,o),Vn(e,t,o)):(Se&&s&&cu(t),t.flags|=1,_t(e,t,a,o),t.child)}function xf(e,t,a,s,o,c){return ui(t),t.updateQueue=null,a=Rh(t,s,a,o),Oh(e),s=Ru(),e!==null&&!rt?(ju(e,t,c),Vn(e,t,c)):(Se&&s&&cu(t),t.flags|=1,_t(e,t,a,c),t.child)}function Of(e,t,a,s,o){if(ui(t),t.stateNode===null){var c=Mi,f=a.contextType;typeof f=="object"&&f!==null&&(c=St(f)),c=new a(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ku,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Su(t),f=a.contextType,c.context=typeof f=="object"&&f!==null?St(f):Mi,c.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Vu(t,a,f,s),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&Ku.enqueueReplaceState(c,c.state,null),es(t,s,c,o),Fr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var v=t.memoizedProps,_=gi(a,v);c.props=_;var j=c.context,M=a.contextType;f=Mi,typeof M=="object"&&M!==null&&(f=St(M));var B=a.getDerivedStateFromProps;M=typeof B=="function"||typeof c.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,M||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(v||j!==f)&&gf(t,c,s,f),Sa=!1;var N=t.memoizedState;c.state=N,es(t,s,c,o),Fr(),j=t.memoizedState,v||N!==j||Sa?(typeof B=="function"&&(Vu(t,a,B,s),j=t.memoizedState),(_=Sa||mf(t,a,_,s,N,j,f))?(M||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=j),c.props=s,c.state=j,c.context=f,s=_):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,_u(e,t),f=t.memoizedProps,M=gi(a,f),c.props=M,B=t.pendingProps,N=c.context,j=a.contextType,_=Mi,typeof j=="object"&&j!==null&&(_=St(j)),v=a.getDerivedStateFromProps,(j=typeof v=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==B||N!==_)&&gf(t,c,s,_),Sa=!1,N=t.memoizedState,c.state=N,es(t,s,c,o),Fr();var L=t.memoizedState;f!==B||N!==L||Sa||e!==null&&e.dependencies!==null&&vl(e.dependencies)?(typeof v=="function"&&(Vu(t,a,v,s),L=t.memoizedState),(M=Sa||mf(t,a,M,s,N,L,_)||e!==null&&e.dependencies!==null&&vl(e.dependencies))?(j||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,L,_),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,L,_)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=L),c.props=s,c.state=L,c.context=_,s=M):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,zl(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=fi(t,e.child,null,o),t.child=fi(t,null,a,o)):_t(e,t,a,o),t.memoizedState=c.state,e=t.child):e=Vn(e,t,o),e}function Rf(e,t,a,s){return li(),t.flags|=256,_t(e,t,a,s),t.child}var Qu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:vh()}}function Wu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Gt),e}function jf(e,t,a){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(We.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(o?ka(t):Ea(),(e=$e)?(e=Hm(e,en),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:wn,overflow:Sn}:null,retryLane:536870912,hydrationErrors:null},a=uh(e),a.return=t,t.child=a,wt=t,$e=null)):e=null,e===null)throw ba(t);return Dc(e)?t.lanes=32:t.lanes=536870912,null}var v=s.children;return s=s.fallback,o?(Ea(),o=t.mode,v=Bl({mode:"hidden",children:v},o),s=si(s,o,a,null),v.return=t,s.return=t,v.sibling=s,t.child=v,s=t.child,s.memoizedState=Zu(a),s.childLanes=Wu(e,f,a),t.memoizedState=Qu,rs(null,s)):(ka(t),Fu(t,v))}var _=e.memoizedState;if(_!==null&&(v=_.dehydrated,v!==null)){if(c)t.flags&256?(ka(t),t.flags&=-257,t=ec(e,t,a)):t.memoizedState!==null?(Ea(),t.child=e.child,t.flags|=128,t=null):(Ea(),v=s.fallback,o=t.mode,s=Bl({mode:"visible",children:s.children},o),v=si(v,o,a,null),v.flags|=2,s.return=t,v.return=t,s.sibling=v,t.child=s,fi(t,e.child,null,a),s=t.child,s.memoizedState=Zu(a),s.childLanes=Wu(e,f,a),t.memoizedState=Qu,t=rs(null,s));else if(ka(t),Dc(v)){if(f=v.nextSibling&&v.nextSibling.dataset,f)var j=f.dgst;f=j,s=Error(l(419)),s.stack="",s.digest=f,Yr({value:s,source:null,stack:null}),t=ec(e,t,a)}else if(rt||$i(e,t,a,!1),f=(a&e.childLanes)!==0,rt||f){if(f=Be,f!==null&&(s=Or(f,a),s!==0&&s!==_.retryLane))throw _.retryLane=s,ri(e,s),Mt(f,e,s),Ju;Lc(v)||Yl(),t=ec(e,t,a)}else Lc(v)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,$e=nn(v.nextSibling),wt=t,Se=!0,va=null,en=!1,e!==null&&hh(t,e),t=Fu(t,s.children),t.flags|=4096);return t}return o?(Ea(),v=s.fallback,o=t.mode,_=e.child,j=_.sibling,s=Hn(_,{mode:"hidden",children:s.children}),s.subtreeFlags=_.subtreeFlags&65011712,j!==null?v=Hn(j,v):(v=si(v,o,a,null),v.flags|=2),v.return=t,s.return=t,s.sibling=v,t.child=s,rs(null,s),s=t.child,v=e.child.memoizedState,v===null?v=Zu(a):(o=v.cachePool,o!==null?(_=at._currentValue,o=o.parent!==_?{parent:_,pool:_}:o):o=vh(),v={baseLanes:v.baseLanes|a,cachePool:o}),s.memoizedState=v,s.childLanes=Wu(e,f,a),t.memoizedState=Qu,rs(e.child,s)):(ka(t),a=e.child,e=a.sibling,a=Hn(a,{mode:"visible",children:s.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function Fu(e,t){return t=Bl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bl(e,t){return e=$t(22,e,null,t),e.lanes=0,e}function ec(e,t,a){return fi(t,e.child,null,a),e=Fu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nf(e,t,a){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),gu(e.return,t,a)}function tc(e,t,a,s,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=s,f.tail=a,f.tailMode=o,f.treeForkCount=c)}function Lf(e,t,a){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var f=We.current,v=(f&2)!==0;if(v?(f=f&1|2,t.flags|=128):f&=1,V(We,f),_t(e,t,s,a),s=Se?Kr:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nf(e,a,t);else if(e.tag===19)Nf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Al(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),tc(t,!1,o,a,c,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Al(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}tc(t,!0,a,null,c,s);break;case"together":tc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Vn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),xa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if($i(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,a=Hn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Hn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function nc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vl(e)))}function $y(e,t,a){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),wa(t,at,e.memoizedState.cache),li();break;case 27:case 5:vn(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cu(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ka(t),t.flags|=128,null):(a&t.child.childLanes)!==0?jf(e,t,a):(ka(t),e=Vn(e,t,a),e!==null?e.sibling:null);ka(t);break;case 19:var o=(e.flags&128)!==0;if(s=(a&t.childLanes)!==0,s||($i(e,t,a,!1),s=(a&t.childLanes)!==0),o){if(s)return Lf(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),V(We,We.current),s)break;return null;case 22:return t.lanes=0,Ef(e,t,a,t.pendingProps);case 24:wa(t,at,e.memoizedState.cache)}return Vn(e,t,a)}function Df(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)rt=!0;else{if(!nc(e,a)&&(t.flags&128)===0)return rt=!1,$y(e,t,a);rt=(e.flags&131072)!==0}else rt=!1,Se&&(t.flags&1048576)!==0&&dh(t,Kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=di(t.elementType),t.type=e,typeof e=="function")lu(e)?(s=gi(e,s),t.tag=1,t=Of(null,t,e,s,a)):(t.tag=0,t=Xu(null,t,e,s,a));else{if(e!=null){var o=e.$$typeof;if(o===X){t.tag=11,t=_f(null,t,e,s,a);break e}else if(o===J){t.tag=14,t=Tf(null,t,e,s,a);break e}}throw t=ht(e)||e,Error(l(306,t,""))}}return t;case 0:return Xu(e,t,t.type,t.pendingProps,a);case 1:return s=t.type,o=gi(s,t.pendingProps),Of(e,t,s,o,a);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,_u(e,t),es(t,s,null,a);var f=t.memoizedState;if(s=f.cache,wa(t,at,s),s!==c.cache&&pu(t,[at],a,!0),Fr(),s=f.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Rf(e,t,s,a);break e}else if(s!==o){o=Zt(Error(l(424)),t),Yr(o),t=Rf(e,t,s,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,$e=nn(e.firstChild),wt=t,Se=!0,va=null,en=!0,a=kh(t,null,s,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),s===o){t=Vn(e,t,a);break e}_t(e,t,s,a)}t=t.child}return t;case 26:return zl(e,t),e===null?(a=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Se||(a=t.type,e=t.pendingProps,s=eo(de.current).createElement(a),s[ct]=t,s[yt]=e,Tt(s,a,e),Ze(s),t.stateNode=s):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return vn(t),e===null&&Se&&(s=t.stateNode=Pm(t.type,t.pendingProps,de.current),wt=t,en=!0,o=$e,La(t.type)?(Uc=o,$e=nn(s.firstChild)):$e=o),_t(e,t,t.pendingProps.children,a),zl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((o=s=$e)&&(s=pv(s,t.type,t.pendingProps,en),s!==null?(t.stateNode=s,wt=t,$e=nn(s.firstChild),en=!1,o=!0):o=!1),o||ba(t)),vn(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,s=c.children,Rc(o,c)?s=null:f!==null&&Rc(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Ou(e,t,jy,null,null,a),ws._currentValue=o),zl(e,t),_t(e,t,s,a),t.child;case 6:return e===null&&Se&&((e=a=$e)&&(a=yv(a,t.pendingProps,en),a!==null?(t.stateNode=a,wt=t,$e=null,e=!0):e=!1),e||ba(t)),null;case 13:return jf(e,t,a);case 4:return Ge(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=fi(t,null,s,a):_t(e,t,s,a),t.child;case 11:return _f(e,t,t.type,t.pendingProps,a);case 7:return _t(e,t,t.pendingProps,a),t.child;case 8:return _t(e,t,t.pendingProps.children,a),t.child;case 12:return _t(e,t,t.pendingProps.children,a),t.child;case 10:return s=t.pendingProps,wa(t,t.type,s.value),_t(e,t,s.children,a),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,ui(t),o=St(o),s=s(o),t.flags|=1,_t(e,t,s,a),t.child;case 14:return Tf(e,t,t.type,t.pendingProps,a);case 15:return kf(e,t,t.type,t.pendingProps,a);case 19:return Lf(e,t,a);case 31:return Hy(e,t,a);case 22:return Ef(e,t,a,t.pendingProps);case 24:return ui(t),s=St(at),e===null?(o=bu(),o===null&&(o=Be,c=yu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=a),o=c),t.memoizedState={parent:s,cache:o},Su(t),wa(t,at,o)):((e.lanes&a)!==0&&(_u(e,t),es(t,null,null,a),Fr()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),wa(t,at,s)):(s=c.cache,wa(t,at,s),s!==o.cache&&pu(t,[at],a,!0))),_t(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Kn(e){e.flags|=4}function ac(e,t,a,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(lm())e.flags|=8192;else throw hi=_l,wu}else e.flags&=-16777217}function Uf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Qm(t))if(lm())e.flags|=8192;else throw hi=_l,wu}function Hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?xr():536870912,e.lanes|=t,Wi|=t)}function ss(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=a,t}function qy(e,t,a){var s=t.pendingProps;switch(du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return a=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Pn(at),Ve(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Kn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fu())),qe(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(Kn(t),c!==null?(qe(t),Uf(t,c)):(qe(t),ac(t,o,null,s,a))):c?c!==e.memoizedState?(Kn(t),qe(t),Uf(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Kn(t),qe(t),ac(t,o,e,s,a)),null;case 27:if(bn(t),a=de.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Kn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}e=Q.current,Hi(t)?fh(t):(e=Pm(o,s,a),t.stateNode=e,Kn(t))}return qe(t),null;case 5:if(bn(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Kn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}if(c=Q.current,Hi(t))fh(t);else{var f=eo(de.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?f.createElement("select",{is:s.is}):f.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?f.createElement(o,{is:s.is}):f.createElement(o)}}c[ct]=t,c[yt]=s;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(Tt(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Kn(t)}}return qe(t),ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Kn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=de.current,Hi(t)){if(e=t.stateNode,a=t.memoizedProps,s=null,o=wt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[ct]=t,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||jm(e.nodeValue,a)),e||ba(t,!0)}else e=eo(e).createTextNode(s),e[ct]=t,t.stateNode=e}return qe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(s=Hi(t),a!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[ct]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else a=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Pt(t),t):(Pt(t),null);if((t.flags&128)!==0)throw Error(l(558))}return qe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Hi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[ct]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else o=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Pt(t),t):(Pt(t),null)}return Pt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Hl(t,t.updateQueue),qe(t),null);case 4:return Ve(),e===null&&Ec(t.stateNode.containerInfo),qe(t),null;case 10:return Pn(t.type),qe(t),null;case 19:if(U(We),s=t.memoizedState,s===null)return qe(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)ss(s,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Al(e),c!==null){for(t.flags|=128,ss(s,!1),e=c.updateQueue,t.updateQueue=e,Hl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)oh(a,e),a=a.sibling;return V(We,We.current&1|2),Se&&$n(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ct()>Gl&&(t.flags|=128,o=!0,ss(s,!1),t.lanes=4194304)}else{if(!o)if(e=Al(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Hl(t,e),ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Se)return qe(t),null}else 2*Ct()-s.renderingStartTime>Gl&&a!==536870912&&(t.flags|=128,o=!0,ss(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ct(),e.sibling=null,a=We.current,V(We,o?a&1|2:a&1),Se&&$n(t,s.treeForkCount),e):(qe(t),null);case 22:case 23:return Pt(t),Au(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(a&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),a=t.updateQueue,a!==null&&Hl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==a&&(t.flags|=2048),e!==null&&U(ci),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pn(at),qe(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Py(e,t){switch(du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(at),Ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return bn(t),null;case 31:if(t.memoizedState!==null){if(Pt(t),t.alternate===null)throw Error(l(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(We),null;case 4:return Ve(),null;case 10:return Pn(t.type),null;case 22:case 23:return Pt(t),Au(),e!==null&&U(ci),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pn(at),null;case 25:return null;default:return null}}function Mf(e,t){switch(du(t),t.tag){case 3:Pn(at),Ve();break;case 26:case 27:case 5:bn(t);break;case 4:Ve();break;case 31:t.memoizedState!==null&&Pt(t);break;case 13:Pt(t);break;case 19:U(We);break;case 10:Pn(t.type);break;case 22:case 23:Pt(t),Au(),e!==null&&U(ci);break;case 24:Pn(at)}}function ls(e,t){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var o=s.next;a=o;do{if((a.tag&e)===e){s=void 0;var c=a.create,f=a.inst;s=c(),f.destroy=s}a=a.next}while(a!==o)}}catch(v){je(t,t.return,v)}}function Aa(e,t,a){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var f=s.inst,v=f.destroy;if(v!==void 0){f.destroy=void 0,o=t;var _=a,j=v;try{j()}catch(M){je(o,_,M)}}}s=s.next}while(s!==c)}}catch(M){je(t,t.return,M)}}function zf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Ah(t,a)}catch(s){je(e,e.return,s)}}}function Bf(e,t,a){a.props=gi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){je(e,t,s)}}function os(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(o){je(e,t,o)}}function _n(e,t){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(o){je(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(o){je(e,t,o)}else a.current=null}function Hf(e){var t=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(o){je(e,e.return,o)}}function ic(e,t,a){try{var s=e.stateNode;cv(s,e.type,a,t),s[yt]=t}catch(o){je(e,e.return,o)}}function $f(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$f(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&La(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sc(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=zn));else if(s!==4&&(s===27&&La(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(sc(e,t,a),e=e.sibling;e!==null;)sc(e,t,a),e=e.sibling}function $l(e,t,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(s!==4&&(s===27&&La(e.type)&&(a=e.stateNode),e=e.child,e!==null))for($l(e,t,a),e=e.sibling;e!==null;)$l(e,t,a),e=e.sibling}function qf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Tt(t,s,a),t[ct]=e,t[yt]=a}catch(c){je(e,e.return,c)}}var Yn=!1,st=!1,lc=!1,Pf=typeof WeakSet=="function"?WeakSet:Set,mt=null;function Iy(e,t){if(e=e.containerInfo,xc=lo,e=Fd(e),eu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var f=0,v=-1,_=-1,j=0,M=0,B=e,N=null;t:for(;;){for(var L;B!==a||o!==0&&B.nodeType!==3||(v=f+o),B!==c||s!==0&&B.nodeType!==3||(_=f+s),B.nodeType===3&&(f+=B.nodeValue.length),(L=B.firstChild)!==null;)N=B,B=L;for(;;){if(B===e)break t;if(N===a&&++j===o&&(v=f),N===c&&++M===s&&(_=f),(L=B.nextSibling)!==null)break;B=N,N=B.parentNode}B=L}a=v===-1||_===-1?null:{start:v,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(Oc={focusedElem:e,selectionRange:a},lo=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)o=e[a],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,o=c.memoizedProps,c=c.memoizedState,s=a.stateNode;try{var Z=gi(a.type,o);e=s.getSnapshotBeforeUpdate(Z,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(se){je(a,a.return,se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Nc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function If(e,t,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Xn(e,a),s&4&&ls(5,a);break;case 1:if(Xn(e,a),s&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){je(a,a.return,f)}else{var o=gi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){je(a,a.return,f)}}s&64&&zf(a),s&512&&os(a,a.return);break;case 3:if(Xn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Ah(e,t)}catch(f){je(a,a.return,f)}}break;case 27:t===null&&s&4&&qf(a);case 26:case 5:Xn(e,a),t===null&&s&4&&Hf(a),s&512&&os(a,a.return);break;case 12:Xn(e,a);break;case 31:Xn(e,a),s&4&&Kf(e,a);break;case 13:Xn(e,a),s&4&&Yf(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Wy.bind(null,a),vv(e,a))));break;case 22:if(s=a.memoizedState!==null||Yn,!s){t=t!==null&&t.memoizedState!==null||st,o=Yn;var c=st;Yn=s,(st=t)&&!c?Qn(e,a,(a.subtreeFlags&8772)!==0):Xn(e,a),Yn=o,st=c}break;case 30:break;default:Xn(e,a)}}function Gf(e){var t=e.alternate;t!==null&&(e.alternate=null,Gf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Lr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ie=null,Nt=!1;function Jn(e,t,a){for(a=a.child;a!==null;)Vf(e,t,a),a=a.sibling}function Vf(e,t,a){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Ga,a)}catch{}switch(a.tag){case 26:st||_n(a,t),Jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:st||_n(a,t);var s=Ie,o=Nt;La(a.type)&&(Ie=a.stateNode,Nt=!1),Jn(e,t,a),ys(a.stateNode),Ie=s,Nt=o;break;case 5:st||_n(a,t);case 6:if(s=Ie,o=Nt,Ie=null,Jn(e,t,a),Ie=s,Nt=o,Ie!==null)if(Nt)try{(Ie.nodeType===9?Ie.body:Ie.nodeName==="HTML"?Ie.ownerDocument.body:Ie).removeChild(a.stateNode)}catch(c){je(a,t,c)}else try{Ie.removeChild(a.stateNode)}catch(c){je(a,t,c)}break;case 18:Ie!==null&&(Nt?(e=Ie,zm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),sr(e)):zm(Ie,a.stateNode));break;case 4:s=Ie,o=Nt,Ie=a.stateNode.containerInfo,Nt=!0,Jn(e,t,a),Ie=s,Nt=o;break;case 0:case 11:case 14:case 15:Aa(2,a,t),st||Aa(4,a,t),Jn(e,t,a);break;case 1:st||(_n(a,t),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Bf(a,t,s)),Jn(e,t,a);break;case 21:Jn(e,t,a);break;case 22:st=(s=st)||a.memoizedState!==null,Jn(e,t,a),st=s;break;default:Jn(e,t,a)}}function Kf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{sr(e)}catch(a){je(t,t.return,a)}}}function Yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{sr(e)}catch(a){je(t,t.return,a)}}function Gy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Pf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pf),t;default:throw Error(l(435,e.tag))}}function ql(e,t){var a=Gy(e);t.forEach(function(s){if(!a.has(s)){a.add(s);var o=Fy.bind(null,e,s);s.then(o,o)}})}function Lt(e,t){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var o=a[s],c=e,f=t,v=f;e:for(;v!==null;){switch(v.tag){case 27:if(La(v.type)){Ie=v.stateNode,Nt=!1;break e}break;case 5:Ie=v.stateNode,Nt=!1;break e;case 3:case 4:Ie=v.stateNode.containerInfo,Nt=!0;break e}v=v.return}if(Ie===null)throw Error(l(160));Vf(c,f,o),Ie=null,Nt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Jf(t,e),t=t.sibling}var dn=null;function Jf(e,t){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),Dt(e),s&4&&(Aa(3,e,e.return),ls(3,e),Aa(5,e,e.return));break;case 1:Lt(t,e),Dt(e),s&512&&(st||a===null||_n(a,a.return)),s&64&&Yn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var o=dn;if(Lt(t,e),Dt(e),s&512&&(st||a===null||_n(a,a.return)),s&4){var c=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Za]||c[ct]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),Tt(c,s,a),c[ct]=e,Ze(c),s=c;break e;case"link":var f=Jm("link","href",o).get(s+(a.href||""));if(f){for(var v=0;v<f.length;v++)if(c=f[v],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(v,1);break t}}c=o.createElement(s),Tt(c,s,a),o.head.appendChild(c);break;case"meta":if(f=Jm("meta","content",o).get(s+(a.content||""))){for(v=0;v<f.length;v++)if(c=f[v],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(v,1);break t}}c=o.createElement(s),Tt(c,s,a),o.head.appendChild(c);break;default:throw Error(l(468,s))}c[ct]=e,Ze(c),s=c}e.stateNode=s}else Xm(o,e.type,e.stateNode);else e.stateNode=Ym(o,s,e.memoizedProps);else c!==s?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,s===null?Xm(o,e.type,e.stateNode):Ym(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ic(e,e.memoizedProps,a.memoizedProps)}break;case 27:Lt(t,e),Dt(e),s&512&&(st||a===null||_n(a,a.return)),a!==null&&s&4&&ic(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Lt(t,e),Dt(e),s&512&&(st||a===null||_n(a,a.return)),e.flags&32){o=e.stateNode;try{ft(o,"")}catch(Z){je(e,e.return,Z)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,ic(e,o,a!==null?a.memoizedProps:o)),s&1024&&(lc=!0);break;case 6:if(Lt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(Z){je(e,e.return,Z)}}break;case 3:if(ao=null,o=dn,dn=to(t.containerInfo),Lt(t,e),dn=o,Dt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{sr(t.containerInfo)}catch(Z){je(e,e.return,Z)}lc&&(lc=!1,Xf(e));break;case 4:s=dn,dn=to(e.stateNode.containerInfo),Lt(t,e),Dt(e),dn=s;break;case 12:Lt(t,e),Dt(e);break;case 31:Lt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ql(e,s)));break;case 13:Lt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Il=Ct()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ql(e,s)));break;case 22:o=e.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,j=Yn,M=st;if(Yn=j||o,st=M||_,Lt(t,e),st=M,Yn=j,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(a===null||_||Yn||st||pi(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){_=a=t;try{if(c=_.stateNode,o)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{v=_.stateNode;var B=_.memoizedProps.style,N=B!=null&&B.hasOwnProperty("display")?B.display:null;v.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(Z){je(_,_.return,Z)}}}else if(t.tag===6){if(a===null){_=t;try{_.stateNode.nodeValue=o?"":_.memoizedProps}catch(Z){je(_,_.return,Z)}}}else if(t.tag===18){if(a===null){_=t;try{var L=_.stateNode;o?Bm(L,!0):Bm(_.stateNode,!1)}catch(Z){je(_,_.return,Z)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,ql(e,a))));break;case 19:Lt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ql(e,s)));break;case 30:break;case 21:break;default:Lt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var a,s=e.return;s!==null;){if($f(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var o=a.stateNode,c=rc(e);$l(e,c,o);break;case 5:var f=a.stateNode;a.flags&32&&(ft(f,""),a.flags&=-33);var v=rc(e);$l(e,v,f);break;case 3:case 4:var _=a.stateNode.containerInfo,j=rc(e);sc(e,j,_);break;default:throw Error(l(161))}}catch(M){je(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Xf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)If(e,t.alternate,t),t=t.sibling}function pi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Aa(4,t,t.return),pi(t);break;case 1:_n(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Bf(t,t.return,a),pi(t);break;case 27:ys(t.stateNode);case 26:case 5:_n(t,t.return),pi(t);break;case 22:t.memoizedState===null&&pi(t);break;case 30:pi(t);break;default:pi(t)}e=e.sibling}}function Qn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:Qn(o,c,a),ls(4,c);break;case 1:if(Qn(o,c,a),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(j){je(s,s.return,j)}if(s=c,o=s.updateQueue,o!==null){var v=s.stateNode;try{var _=o.shared.hiddenCallbacks;if(_!==null)for(o.shared.hiddenCallbacks=null,o=0;o<_.length;o++)Eh(_[o],v)}catch(j){je(s,s.return,j)}}a&&f&64&&zf(c),os(c,c.return);break;case 27:qf(c);case 26:case 5:Qn(o,c,a),a&&s===null&&f&4&&Hf(c),os(c,c.return);break;case 12:Qn(o,c,a);break;case 31:Qn(o,c,a),a&&f&4&&Kf(o,c);break;case 13:Qn(o,c,a),a&&f&4&&Yf(o,c);break;case 22:c.memoizedState===null&&Qn(o,c,a),os(c,c.return);break;case 30:break;default:Qn(o,c,a)}t=t.sibling}}function oc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Jr(a))}function uc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jr(e))}function hn(e,t,a,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qf(e,t,a,s),t=t.sibling}function Qf(e,t,a,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:hn(e,t,a,s),o&2048&&ls(9,t);break;case 1:hn(e,t,a,s);break;case 3:hn(e,t,a,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Jr(e)));break;case 12:if(o&2048){hn(e,t,a,s),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,v=c.onPostCommit;typeof v=="function"&&v(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){je(t,t.return,_)}}else hn(e,t,a,s);break;case 31:hn(e,t,a,s);break;case 13:hn(e,t,a,s);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?hn(e,t,a,s):us(e,t):c._visibility&2?hn(e,t,a,s):(c._visibility|=2,Xi(e,t,a,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&oc(f,t);break;case 24:hn(e,t,a,s),o&2048&&uc(t.alternate,t);break;default:hn(e,t,a,s)}}function Xi(e,t,a,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,v=a,_=s,j=f.flags;switch(f.tag){case 0:case 11:case 15:Xi(c,f,v,_,o),ls(8,f);break;case 23:break;case 22:var M=f.stateNode;f.memoizedState!==null?M._visibility&2?Xi(c,f,v,_,o):us(c,f):(M._visibility|=2,Xi(c,f,v,_,o)),o&&j&2048&&oc(f.alternate,f);break;case 24:Xi(c,f,v,_,o),o&&j&2048&&uc(f.alternate,f);break;default:Xi(c,f,v,_,o)}t=t.sibling}}function us(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,s=t,o=s.flags;switch(s.tag){case 22:us(a,s),o&2048&&oc(s.alternate,s);break;case 24:us(a,s),o&2048&&uc(s.alternate,s);break;default:us(a,s)}t=t.sibling}}var cs=8192;function Qi(e,t,a){if(e.subtreeFlags&cs)for(e=e.child;e!==null;)Zf(e,t,a),e=e.sibling}function Zf(e,t,a){switch(e.tag){case 26:Qi(e,t,a),e.flags&cs&&e.memoizedState!==null&&Rv(a,dn,e.memoizedState,e.memoizedProps);break;case 5:Qi(e,t,a);break;case 3:case 4:var s=dn;dn=to(e.stateNode.containerInfo),Qi(e,t,a),dn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cs,cs=16777216,Qi(e,t,a),cs=s):Qi(e,t,a));break;default:Qi(e,t,a)}}function Wf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ds(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];mt=s,em(s,e)}Wf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ff(e),e=e.sibling}function Ff(e){switch(e.tag){case 0:case 11:case 15:ds(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:ds(e);break;case 12:ds(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):ds(e);break;default:ds(e)}}function Pl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var s=t[a];mt=s,em(s,e)}Wf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),Pl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function em(e,t){for(;mt!==null;){var a=mt;switch(a.tag){case 0:case 11:case 15:Aa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Jr(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,mt=s;else e:for(a=e;mt!==null;){s=mt;var o=s.sibling,c=s.return;if(Gf(s),s===a){mt=null;break e}if(o!==null){o.return=c,mt=o;break e}mt=c}}}var Vy={getCacheForType:function(e){var t=St(at),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return St(at).controller.signal}},Ky=typeof WeakMap=="function"?WeakMap:Map,Ce=0,Be=null,pe=null,be=0,Re=0,It=null,Ca=!1,Zi=!1,cc=!1,Zn=0,Xe=0,xa=0,yi=0,dc=0,Gt=0,Wi=0,hs=null,Ut=null,hc=!1,Il=0,tm=0,Gl=1/0,Vl=null,Oa=null,dt=0,Ra=null,Fi=null,Wn=0,fc=0,mc=null,nm=null,fs=0,gc=null;function Vt(){return(Ce&2)!==0&&be!==0?be&-be:D.T!==null?Sc():Rr()}function am(){if(Gt===0)if((be&536870912)===0||Se){var e=Ka;Ka<<=1,(Ka&3932160)===0&&(Ka=262144),Gt=e}else Gt=536870912;return e=qt.current,e!==null&&(e.flags|=32),Gt}function Mt(e,t,a){(e===Be&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(er(e,0),ja(e,be,Gt,!1)),ca(e,a),((Ce&2)===0||e!==Be)&&(e===Be&&((Ce&2)===0&&(yi|=a),Xe===4&&ja(e,be,Gt,!1)),Tn(e))}function im(e,t,a){if((Ce&6)!==0)throw Error(l(327));var s=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ua(e,t),o=s?Xy(e,t):yc(e,t,!0),c=s;do{if(o===0){Zi&&!s&&ja(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!Yy(a)){o=yc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var v=e;o=hs;var _=v.current.memoizedState.isDehydrated;if(_&&(er(v,f).flags|=256),f=yc(v,f,!1),f!==2){if(cc&&!_){v.errorRecoveryDisabledLanes|=c,yi|=c,o=4;break e}c=Ut,Ut=o,c!==null&&(Ut===null?Ut=c:Ut.push.apply(Ut,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){er(e,0),ja(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:ja(s,t,Gt,!Ca);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=Il+300-Ct(),10<o)){if(ja(s,t,Gt,!Ca),Ya(s,0,!0)!==0)break e;Wn=t,s.timeoutHandle=Um(rm.bind(null,s,a,Ut,Vl,hc,t,Gt,yi,Wi,Ca,c,"Throttled",-0,0),o);break e}rm(s,a,Ut,Vl,hc,t,Gt,yi,Wi,Ca,c,null,-0,0)}}break}while(!0);Tn(e)}function rm(e,t,a,s,o,c,f,v,_,j,M,B,N,L){if(e.timeoutHandle=-1,B=t.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zn},Zf(t,c,B);var Z=(c&62914560)===c?Il-Ct():(c&4194048)===c?tm-Ct():0;if(Z=jv(B,Z),Z!==null){Wn=c,e.cancelPendingCommit=Z(fm.bind(null,e,t,c,a,s,o,f,v,_,M,B,null,N,L)),ja(e,c,f,!j);return}}fm(e,t,c,a,s,o,f,v,_)}function Yy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var o=a[s],c=o.getSnapshot;o=o.value;try{if(!Ht(c(),o))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ja(e,t,a,s){t&=~dc,t&=~yi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-Oe(o),f=1<<c;s[c]=-1,o&=~f}a!==0&&Xa(e,a,t)}function Kl(){return(Ce&6)===0?(ms(0),!1):!0}function pc(){if(pe!==null){if(Re===0)var e=pe.return;else e=pe,qn=oi=null,Nu(e),Gi=null,Qr=0,e=pe;for(;e!==null;)Mf(e.alternate,e),e=e.return;pe=null}}function er(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,fv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Wn=0,pc(),Be=e,pe=a=Hn(e.current,null),be=t,Re=0,It=null,Ca=!1,Zi=ua(e,t),cc=!1,Wi=Gt=dc=yi=xa=Xe=0,Ut=hs=null,hc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-Oe(s),c=1<<o;t|=e[o],s&=~c}return Zn=t,fl(),a}function sm(e,t){he=null,D.H=is,t===Ii||t===Sl?(t=Sh(),Re=3):t===wu?(t=Sh(),Re=4):Re=t===Ju?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,pe===null&&(Xe=1,Ul(e,Zt(t,e.current)))}function lm(){var e=qt.current;return e===null?!0:(be&4194048)===be?tn===null:(be&62914560)===be||(be&536870912)!==0?e===tn:!1}function om(){var e=D.H;return D.H=is,e===null?is:e}function um(){var e=D.A;return D.A=Vy,e}function Yl(){Xe=4,Ca||(be&4194048)!==be&&qt.current!==null||(Zi=!0),(xa&134217727)===0&&(yi&134217727)===0||Be===null||ja(Be,be,Gt,!1)}function yc(e,t,a){var s=Ce;Ce|=2;var o=om(),c=um();(Be!==e||be!==t)&&(Vl=null,er(e,t)),t=!1;var f=Xe;e:do try{if(Re!==0&&pe!==null){var v=pe,_=It;switch(Re){case 8:pc(),f=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var j=Re;if(Re=0,It=null,tr(e,v,_,j),a&&Zi){f=0;break e}break;default:j=Re,Re=0,It=null,tr(e,v,_,j)}}Jy(),f=Xe;break}catch(M){sm(e,M)}while(!0);return t&&e.shellSuspendCounter++,qn=oi=null,Ce=s,D.H=o,D.A=c,pe===null&&(Be=null,be=0,fl()),f}function Jy(){for(;pe!==null;)cm(pe)}function Xy(e,t){var a=Ce;Ce|=2;var s=om(),o=um();Be!==e||be!==t?(Vl=null,Gl=Ct()+500,er(e,t)):Zi=ua(e,t);e:do try{if(Re!==0&&pe!==null){t=pe;var c=It;t:switch(Re){case 1:Re=0,It=null,tr(e,t,c,1);break;case 2:case 9:if(bh(c)){Re=0,It=null,dm(t);break}t=function(){Re!==2&&Re!==9||Be!==e||(Re=7),Tn(e)},c.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:bh(c)?(Re=0,It=null,dm(t)):(Re=0,It=null,tr(e,t,c,7));break;case 5:var f=null;switch(pe.tag){case 26:f=pe.memoizedState;case 5:case 27:var v=pe;if(f?Qm(f):v.stateNode.complete){Re=0,It=null;var _=v.sibling;if(_!==null)pe=_;else{var j=v.return;j!==null?(pe=j,Jl(j)):pe=null}break t}}Re=0,It=null,tr(e,t,c,5);break;case 6:Re=0,It=null,tr(e,t,c,6);break;case 8:pc(),Xe=6;break e;default:throw Error(l(462))}}Qy();break}catch(M){sm(e,M)}while(!0);return qn=oi=null,D.H=s,D.A=o,Ce=a,pe!==null?0:(Be=null,be=0,fl(),Xe)}function Qy(){for(;pe!==null&&!Ws();)cm(pe)}function cm(e){var t=Df(e.alternate,e,Zn);e.memoizedProps=e.pendingProps,t===null?Jl(e):pe=t}function dm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=xf(a,t,t.pendingProps,t.type,void 0,be);break;case 11:t=xf(a,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:Nu(t);default:Mf(a,t),t=pe=oh(t,Zn),t=Df(a,t,Zn)}e.memoizedProps=e.pendingProps,t===null?Jl(e):pe=t}function tr(e,t,a,s){qn=oi=null,Nu(t),Gi=null,Qr=0;var o=t.return;try{if(By(e,o,t,a,be)){Xe=1,Ul(e,Zt(a,e.current)),pe=null;return}}catch(c){if(o!==null)throw pe=o,c;Xe=1,Ul(e,Zt(a,e.current)),pe=null;return}t.flags&32768?(Se||s===1?e=!0:Zi||(be&536870912)!==0?e=!1:(Ca=e=!0,(s===2||s===9||s===3||s===6)&&(s=qt.current,s!==null&&s.tag===13&&(s.flags|=16384))),hm(t,e)):Jl(t)}function Jl(e){var t=e;do{if((t.flags&32768)!==0){hm(t,Ca);return}e=t.return;var a=qy(t.alternate,t,Zn);if(a!==null){pe=a;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);Xe===0&&(Xe=5)}function hm(e,t){do{var a=Py(e.alternate,e);if(a!==null){a.flags&=32767,pe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=a}while(e!==null);Xe=6,pe=null}function fm(e,t,a,s,o,c,f,v,_){e.cancelPendingCommit=null;do Xl();while(dt!==0);if((Ce&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(c=t.lanes|t.childLanes,c|=ru,Ho(e,a,c,f,v,_),e===Be&&(pe=Be=null,be=0),Fi=t,Ra=e,Wn=a,fc=c,mc=o,nm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ev(sa,function(){return vm(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=D.T,D.T=null,o=G.p,G.p=2,f=Ce,Ce|=4;try{Iy(e,t,a)}finally{Ce=f,G.p=o,D.T=s}}dt=1,mm(),gm(),pm()}}function mm(){if(dt===1){dt=0;var e=Ra,t=Fi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var s=G.p;G.p=2;var o=Ce;Ce|=4;try{Jf(t,e);var c=Oc,f=Fd(e.containerInfo),v=c.focusedElem,_=c.selectionRange;if(f!==v&&v&&v.ownerDocument&&Wd(v.ownerDocument.documentElement,v)){if(_!==null&&eu(v)){var j=_.start,M=_.end;if(M===void 0&&(M=j),"selectionStart"in v)v.selectionStart=j,v.selectionEnd=Math.min(M,v.value.length);else{var B=v.ownerDocument||document,N=B&&B.defaultView||window;if(N.getSelection){var L=N.getSelection(),Z=v.textContent.length,se=Math.min(_.start,Z),Ue=_.end===void 0?se:Math.min(_.end,Z);!L.extend&&se>Ue&&(f=Ue,Ue=se,se=f);var C=Zd(v,se),k=Zd(v,Ue);if(C&&k&&(L.rangeCount!==1||L.anchorNode!==C.node||L.anchorOffset!==C.offset||L.focusNode!==k.node||L.focusOffset!==k.offset)){var R=B.createRange();R.setStart(C.node,C.offset),L.removeAllRanges(),se>Ue?(L.addRange(R),L.extend(k.node,k.offset)):(R.setEnd(k.node,k.offset),L.addRange(R))}}}}for(B=[],L=v;L=L.parentNode;)L.nodeType===1&&B.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<B.length;v++){var z=B[v];z.element.scrollLeft=z.left,z.element.scrollTop=z.top}}lo=!!xc,Oc=xc=null}finally{Ce=o,G.p=s,D.T=a}}e.current=t,dt=2}}function gm(){if(dt===2){dt=0;var e=Ra,t=Fi,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var s=G.p;G.p=2;var o=Ce;Ce|=4;try{If(e,t.alternate,t)}finally{Ce=o,G.p=s,D.T=a}}dt=3}}function pm(){if(dt===4||dt===3){dt=0,Ye();var e=Ra,t=Fi,a=Wn,s=nm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Fi=Ra=null,ym(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Oa=null),jn(a),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Ga,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=D.T,o=G.p,G.p=2,D.T=null;try{for(var c=e.onRecoverableError,f=0;f<s.length;f++){var v=s[f];c(v.value,{componentStack:v.stack})}}finally{D.T=t,G.p=o}}(Wn&3)!==0&&Xl(),Tn(e),o=e.pendingLanes,(a&261930)!==0&&(o&42)!==0?e===gc?fs++:(fs=0,gc=e):fs=0,ms(0)}}function ym(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Jr(t)))}function Xl(){return mm(),gm(),pm(),vm()}function vm(){if(dt!==5)return!1;var e=Ra,t=fc;fc=0;var a=jn(Wn),s=D.T,o=G.p;try{G.p=32>a?32:a,D.T=null,a=mc,mc=null;var c=Ra,f=Wn;if(dt=0,Fi=Ra=null,Wn=0,(Ce&6)!==0)throw Error(l(331));var v=Ce;if(Ce|=4,Ff(c.current),Qf(c,c.current,f,a),Ce=v,ms(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Ga,c)}catch{}return!0}finally{G.p=o,D.T=s,ym(e,t)}}function bm(e,t,a){t=Zt(a,t),t=Yu(e.stateNode,t,2),e=Ta(e,t,2),e!==null&&(ca(e,2),Tn(e))}function je(e,t,a){if(e.tag===3)bm(e,e,a);else for(;t!==null;){if(t.tag===3){bm(t,e,a);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Oa===null||!Oa.has(s))){e=Zt(a,e),a=wf(2),s=Ta(t,a,2),s!==null&&(Sf(a,s,t,e),ca(s,2),Tn(s));break}}t=t.return}}function vc(e,t,a){var s=e.pingCache;if(s===null){s=e.pingCache=new Ky;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(a)||(cc=!0,o.add(a),e=Zy.bind(null,e,t,a),t.then(e,e))}function Zy(e,t,a){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Be===e&&(be&a)===a&&(Xe===4||Xe===3&&(be&62914560)===be&&300>Ct()-Il?(Ce&2)===0&&er(e,0):dc|=a,Wi===be&&(Wi=0)),Tn(e)}function wm(e,t){t===0&&(t=xr()),e=ri(e,t),e!==null&&(ca(e,t),Tn(e))}function Wy(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),wm(e,a)}function Fy(e,t){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),wm(e,a)}function ev(e,t){return Ti(e,t)}var Ql=null,nr=null,bc=!1,Zl=!1,wc=!1,Na=0;function Tn(e){e!==nr&&e.next===null&&(nr===null?Ql=nr=e:nr=nr.next=e),Zl=!0,bc||(bc=!0,nv())}function ms(e,t){if(!wc&&Zl){wc=!0;do for(var a=!1,s=Ql;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var f=s.suspendedLanes,v=s.pingedLanes;c=(1<<31-Oe(42|e)+1)-1,c&=o&~(f&~v),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,km(s,c))}else c=be,c=Ya(s,s===Be?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ua(s,c)||(a=!0,km(s,c));s=s.next}while(a);wc=!1}}function tv(){Sm()}function Sm(){Zl=bc=!1;var e=0;Na!==0&&hv()&&(e=Na);for(var t=Ct(),a=null,s=Ql;s!==null;){var o=s.next,c=_m(s,t);c===0?(s.next=null,a===null?Ql=o:a.next=o,o===null&&(nr=a)):(a=s,(e!==0||(c&3)!==0)&&(Zl=!0)),s=o}dt!==0&&dt!==5||ms(e),Na!==0&&(Na=0)}function _m(e,t){for(var a=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-Oe(c),v=1<<f,_=o[f];_===-1?((v&a)===0||(v&s)!==0)&&(o[f]=el(v,t)):_<=t&&(e.expiredLanes|=v),c&=~v}if(t=Be,a=be,a=Ya(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Pa(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ua(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(s!==null&&Pa(s),jn(a)){case 2:case 8:a=Ar;break;case 32:a=sa;break;case 268435456:a=On;break;default:a=sa}return s=Tm.bind(null,e),a=Ti(a,s),e.callbackPriority=t,e.callbackNode=a,t}return s!==null&&s!==null&&Pa(s),e.callbackPriority=2,e.callbackNode=null,2}function Tm(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xl()&&e.callbackNode!==a)return null;var s=be;return s=Ya(e,e===Be?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(im(e,s,t),_m(e,Ct()),e.callbackNode!=null&&e.callbackNode===a?Tm.bind(null,e):null)}function km(e,t){if(Xl())return null;im(e,t,!0)}function nv(){mv(function(){(Ce&6)!==0?Ti(Fs,tv):Sm()})}function Sc(){if(Na===0){var e=qi;e===0&&(e=Va,Va<<=1,(Va&261888)===0&&(Va=256)),Na=e}return Na}function Em(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ga(""+e)}function Am(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function av(e,t,a,s,o){if(t==="submit"&&a&&a.stateNode===o){var c=Em((o[yt]||null).action),f=s.submitter;f&&(t=(t=f[yt]||null)?Em(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var v=new ul("action","action",null,s,o);e.push({event:v,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Na!==0){var _=f?Am(o,f):new FormData(o);qu(a,{pending:!0,data:_,method:o.method,action:c},null,_)}}else typeof c=="function"&&(v.preventDefault(),_=f?Am(o,f):new FormData(o),qu(a,{pending:!0,data:_,method:o.method,action:c},c,_))},currentTarget:o}]})}}for(var _c=0;_c<iu.length;_c++){var Tc=iu[_c],iv=Tc.toLowerCase(),rv=Tc[0].toUpperCase()+Tc.slice(1);cn(iv,"on"+rv)}cn(nh,"onAnimationEnd"),cn(ah,"onAnimationIteration"),cn(ih,"onAnimationStart"),cn("dblclick","onDoubleClick"),cn("focusin","onFocus"),cn("focusout","onBlur"),cn(Sy,"onTransitionRun"),cn(_y,"onTransitionStart"),cn(Ty,"onTransitionCancel"),cn(rh,"onTransitionEnd"),ma("onMouseEnter",["mouseout","mouseover"]),ma("onMouseLeave",["mouseout","mouseover"]),ma("onPointerEnter",["pointerout","pointerover"]),ma("onPointerLeave",["pointerout","pointerover"]),Mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gs="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(" "),sv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gs));function Cm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var f=s.length-1;0<=f;f--){var v=s[f],_=v.instance,j=v.currentTarget;if(v=v.listener,_!==c&&o.isPropagationStopped())break e;c=v,o.currentTarget=j;try{c(o)}catch(M){hl(M)}o.currentTarget=null,c=_}else for(f=0;f<s.length;f++){if(v=s[f],_=v.instance,j=v.currentTarget,v=v.listener,_!==c&&o.isPropagationStopped())break e;c=v,o.currentTarget=j;try{c(o)}catch(M){hl(M)}o.currentTarget=null,c=_}}}}function ye(e,t){var a=t[jr];a===void 0&&(a=t[jr]=new Set);var s=e+"__bubble";a.has(s)||(xm(t,e,2,!1),a.add(s))}function kc(e,t,a){var s=0;t&&(s|=4),xm(a,e,s,t)}var Wl="_reactListening"+Math.random().toString(36).slice(2);function Ec(e){if(!e[Wl]){e[Wl]=!0,nl.forEach(function(a){a!=="selectionchange"&&(sv.has(a)||kc(a,!1,e),kc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wl]||(t[Wl]=!0,kc("selectionchange",!1,t))}}function xm(e,t,a,s){switch(ag(t)){case 2:var o=Dv;break;case 8:o=Uv;break;default:o=$c}a=o.bind(null,t,a,e),o=void 0,!Vo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Ac(e,t,a,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var f=s.tag;if(f===3||f===4){var v=s.stateNode.containerInfo;if(v===o)break;if(f===4)for(f=s.return;f!==null;){var _=f.tag;if((_===3||_===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;v!==null;){if(f=Ln(v),f===null)return;if(_=f.tag,_===5||_===6||_===26||_===27){s=c=f;continue e}v=v.parentNode}}s=s.return}Nd(function(){var j=c,M=Io(a),B=[];e:{var N=sh.get(e);if(N!==void 0){var L=ul,Z=e;switch(e){case"keypress":if(ll(a)===0)break e;case"keydown":case"keyup":L=Fp;break;case"focusin":Z="focus",L=Xo;break;case"focusout":Z="blur",L=Xo;break;case"beforeblur":case"afterblur":L=Xo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=qp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=ny;break;case nh:case ah:case ih:L=Gp;break;case rh:L=iy;break;case"scroll":case"scrollend":L=Hp;break;case"wheel":L=sy;break;case"copy":case"cut":case"paste":L=Kp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=zd;break;case"toggle":case"beforetoggle":L=oy}var se=(t&4)!==0,Ue=!se&&(e==="scroll"||e==="scrollend"),C=se?N!==null?N+"Capture":null:N;se=[];for(var k=j,R;k!==null;){var z=k;if(R=z.stateNode,z=z.tag,z!==5&&z!==26&&z!==27||R===null||C===null||(z=zr(k,C),z!=null&&se.push(ps(k,z,R))),Ue)break;k=k.return}0<se.length&&(N=new L(N,Z,null,a,M),B.push({event:N,listeners:se}))}}if((t&7)===0){e:{if(N=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",N&&a!==Po&&(Z=a.relatedTarget||a.fromElement)&&(Ln(Z)||Z[ha]))break e;if((L||N)&&(N=M.window===M?M:(N=M.ownerDocument)?N.defaultView||N.parentWindow:window,L?(Z=a.relatedTarget||a.toElement,L=j,Z=Z?Ln(Z):null,Z!==null&&(Ue=d(Z),se=Z.tag,Z!==Ue||se!==5&&se!==27&&se!==6)&&(Z=null)):(L=null,Z=j),L!==Z)){if(se=Ud,z="onMouseLeave",C="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(se=zd,z="onPointerLeave",C="onPointerEnter",k="pointer"),Ue=L==null?N:fa(L),R=Z==null?N:fa(Z),N=new se(z,k+"leave",L,a,M),N.target=Ue,N.relatedTarget=R,z=null,Ln(M)===j&&(se=new se(C,k+"enter",Z,a,M),se.target=R,se.relatedTarget=Ue,z=se),Ue=z,L&&Z)t:{for(se=lv,C=L,k=Z,R=0,z=C;z;z=se(z))R++;z=0;for(var ae=k;ae;ae=se(ae))z++;for(;0<R-z;)C=se(C),R--;for(;0<z-R;)k=se(k),z--;for(;R--;){if(C===k||k!==null&&C===k.alternate){se=C;break t}C=se(C),k=se(k)}se=null}else se=null;L!==null&&Om(B,N,L,se,!1),Z!==null&&Ue!==null&&Om(B,Ue,Z,se,!0)}}e:{if(N=j?fa(j):window,L=N.nodeName&&N.nodeName.toLowerCase(),L==="select"||L==="input"&&N.type==="file")var Ee=Vd;else if(Id(N))if(Kd)Ee=vy;else{Ee=py;var ee=gy}else L=N.nodeName,!L||L.toLowerCase()!=="input"||N.type!=="checkbox"&&N.type!=="radio"?j&&Ur(j.elementType)&&(Ee=Vd):Ee=yy;if(Ee&&(Ee=Ee(e,j))){Gd(B,Ee,a,M);break e}ee&&ee(e,N,j),e==="focusout"&&j&&N.type==="number"&&j.memoizedProps.value!=null&&oe(N,"number",N.value)}switch(ee=j?fa(j):window,e){case"focusin":(Id(ee)||ee.contentEditable==="true")&&(Li=ee,tu=j,Vr=null);break;case"focusout":Vr=tu=Li=null;break;case"mousedown":nu=!0;break;case"contextmenu":case"mouseup":case"dragend":nu=!1,eh(B,a,M);break;case"selectionchange":if(wy)break;case"keydown":case"keyup":eh(B,a,M)}var fe;if(Zo)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Ni?qd(e,a)&&(we="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(we="onCompositionStart");we&&(Bd&&a.locale!=="ko"&&(Ni||we!=="onCompositionStart"?we==="onCompositionEnd"&&Ni&&(fe=Ld()):(pa=M,Ko="value"in pa?pa.value:pa.textContent,Ni=!0)),ee=Fl(j,we),0<ee.length&&(we=new Md(we,e,null,a,M),B.push({event:we,listeners:ee}),fe?we.data=fe:(fe=Pd(a),fe!==null&&(we.data=fe)))),(fe=cy?dy(e,a):hy(e,a))&&(we=Fl(j,"onBeforeInput"),0<we.length&&(ee=new Md("onBeforeInput","beforeinput",null,a,M),B.push({event:ee,listeners:we}),ee.data=fe)),av(B,e,j,a,M)}Cm(B,t)})}function ps(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Fl(e,t){for(var a=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=zr(e,a),o!=null&&s.unshift(ps(e,o,c)),o=zr(e,t),o!=null&&s.push(ps(e,o,c))),e.tag===3)return s;e=e.return}return[]}function lv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Om(e,t,a,s,o){for(var c=t._reactName,f=[];a!==null&&a!==s;){var v=a,_=v.alternate,j=v.stateNode;if(v=v.tag,_!==null&&_===s)break;v!==5&&v!==26&&v!==27||j===null||(_=j,o?(j=zr(a,c),j!=null&&f.unshift(ps(a,j,_))):o||(j=zr(a,c),j!=null&&f.push(ps(a,j,_)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var ov=/\r\n?/g,uv=/\u0000|\uFFFD/g;function Rm(e){return(typeof e=="string"?e:""+e).replace(ov,`
|
|
9
|
-
`).replace(uv,"")}function jm(e,t){return t=Rm(t),Rm(e)===t}function De(e,t,a,s,o,c){switch(a){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ft(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ft(e,""+s);break;case"className":Ci(e,"class",s);break;case"tabIndex":Ci(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ci(e,a,s);break;case"style":il(e,s,c);break;case"data":if(t!=="object"){Ci(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=ga(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 c=="function"&&(a==="formAction"?(t!=="input"&&De(e,t,"name",o.name,o,null),De(e,t,"formEncType",o.formEncType,o,null),De(e,t,"formMethod",o.formMethod,o,null),De(e,t,"formTarget",o.formTarget,o,null)):(De(e,t,"encType",o.encType,o,null),De(e,t,"method",o.method,o,null),De(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=ga(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=zn);break;case"onScroll":s!=null&&ye("scroll",e);break;case"onScrollEnd":s!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=ga(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":ye("beforetoggle",e),ye("toggle",e),Dr(e,"popover",s);break;case"xlinkActuate":un(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":un(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":un(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":un(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":un(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":un(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":un(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Dr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mr.get(a)||a,Dr(e,a,s))}}function Cc(e,t,a,s,o,c){switch(a){case"style":il(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof s=="string"?ft(e,s):(typeof s=="number"||typeof s=="bigint")&&ft(e,""+s);break;case"onScroll":s!=null&&ye("scroll",e);break;case"onScrollEnd":s!=null&&ye("scrollend",e);break;case"onClick":s!=null&&(e.onclick=zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wa.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(o=a.endsWith("Capture"),t=a.slice(2,o?a.length-7:void 0),c=e[yt]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,s,o);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):Dr(e,a,s)}}}function Tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("load",e);var s=!1,o=!1,c;for(c in a)if(a.hasOwnProperty(c)){var f=a[c];if(f!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:De(e,t,c,f,a,null)}}o&&De(e,t,"srcSet",a.srcSet,a,null),s&&De(e,t,"src",a.src,a,null);return;case"input":ye("invalid",e);var v=c=f=o=null,_=null,j=null;for(s in a)if(a.hasOwnProperty(s)){var M=a[s];if(M!=null)switch(s){case"name":o=M;break;case"type":f=M;break;case"checked":_=M;break;case"defaultChecked":j=M;break;case"value":c=M;break;case"defaultValue":v=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:De(e,t,s,M,a,null)}}te(e,c,v,_,j,f,o,!1);return;case"select":ye("invalid",e),s=f=c=null;for(o in a)if(a.hasOwnProperty(o)&&(v=a[o],v!=null))switch(o){case"value":c=v;break;case"defaultValue":f=v;break;case"multiple":s=v;default:De(e,t,o,v,a,null)}t=c,a=f,e.multiple=!!s,t!=null?ve(e,!!s,t,!1):a!=null&&ve(e,!!s,a,!0);return;case"textarea":ye("invalid",e),c=o=s=null;for(f in a)if(a.hasOwnProperty(f)&&(v=a[f],v!=null))switch(f){case"value":s=v;break;case"defaultValue":o=v;break;case"children":c=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:De(e,t,f,v,a,null)}ze(e,s,o,c);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(s=a[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":De(e,t,_,s,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(s=0;s<gs.length;s++)ye(gs[s],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in a)if(a.hasOwnProperty(j)&&(s=a[j],s!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:De(e,t,j,s,a,null)}return;default:if(Ur(t)){for(M in a)a.hasOwnProperty(M)&&(s=a[M],s!==void 0&&Cc(e,t,M,s,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(s=a[v],s!=null&&De(e,t,v,s,a,null))}function cv(e,t,a,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,v=null,_=null,j=null,M=null;for(L in a){var B=a[L];if(a.hasOwnProperty(L)&&B!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":_=B;default:s.hasOwnProperty(L)||De(e,t,L,null,s,B)}}for(var N in s){var L=s[N];if(B=a[N],s.hasOwnProperty(N)&&(L!=null||B!=null))switch(N){case"type":c=L;break;case"name":o=L;break;case"checked":j=L;break;case"defaultChecked":M=L;break;case"value":f=L;break;case"defaultValue":v=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(l(137,t));break;default:L!==B&&De(e,t,N,L,s,B)}}K(e,f,v,_,j,M,c,o);return;case"select":L=f=v=N=null;for(c in a)if(_=a[c],a.hasOwnProperty(c)&&_!=null)switch(c){case"value":break;case"multiple":L=_;default:s.hasOwnProperty(c)||De(e,t,c,null,s,_)}for(o in s)if(c=s[o],_=a[o],s.hasOwnProperty(o)&&(c!=null||_!=null))switch(o){case"value":N=c;break;case"defaultValue":v=c;break;case"multiple":f=c;default:c!==_&&De(e,t,o,c,s,_)}t=v,a=f,s=L,N!=null?ve(e,!!a,N,!1):!!s!=!!a&&(t!=null?ve(e,!!a,t,!0):ve(e,!!a,a?[]:"",!1));return;case"textarea":L=N=null;for(v in a)if(o=a[v],a.hasOwnProperty(v)&&o!=null&&!s.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:De(e,t,v,null,s,o)}for(f in s)if(o=s[f],c=a[f],s.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":N=o;break;case"defaultValue":L=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==c&&De(e,t,f,o,s,c)}ge(e,N,L);return;case"option":for(var Z in a)N=a[Z],a.hasOwnProperty(Z)&&N!=null&&!s.hasOwnProperty(Z)&&(Z==="selected"?e.selected=!1:De(e,t,Z,null,s,N));for(_ in s)N=s[_],L=a[_],s.hasOwnProperty(_)&&N!==L&&(N!=null||L!=null)&&(_==="selected"?e.selected=N&&typeof N!="function"&&typeof N!="symbol":De(e,t,_,N,s,L));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 se in a)N=a[se],a.hasOwnProperty(se)&&N!=null&&!s.hasOwnProperty(se)&&De(e,t,se,null,s,N);for(j in s)if(N=s[j],L=a[j],s.hasOwnProperty(j)&&N!==L&&(N!=null||L!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,t));break;default:De(e,t,j,N,s,L)}return;default:if(Ur(t)){for(var Ue in a)N=a[Ue],a.hasOwnProperty(Ue)&&N!==void 0&&!s.hasOwnProperty(Ue)&&Cc(e,t,Ue,void 0,s,N);for(M in s)N=s[M],L=a[M],!s.hasOwnProperty(M)||N===L||N===void 0&&L===void 0||Cc(e,t,M,N,s,L);return}}for(var C in a)N=a[C],a.hasOwnProperty(C)&&N!=null&&!s.hasOwnProperty(C)&&De(e,t,C,null,s,N);for(B in s)N=s[B],L=a[B],!s.hasOwnProperty(B)||N===L||N==null&&L==null||De(e,t,B,N,s,L)}function Nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var o=a[s],c=o.transferSize,f=o.initiatorType,v=o.duration;if(c&&v&&Nm(f)){for(f=0,v=o.responseEnd,s+=1;s<a.length;s++){var _=a[s],j=_.startTime;if(j>v)break;var M=_.transferSize,B=_.initiatorType;M&&Nm(B)&&(_=_.responseEnd,f+=M*(_<v?1:(v-j)/(_-j)))}if(--s,t+=8*(c+f)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xc=null,Oc=null;function eo(e){return e.nodeType===9?e:e.ownerDocument}function Lm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Rc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jc=null;function hv(){var e=window.event;return e&&e.type==="popstate"?e===jc?!1:(jc=e,!0):(jc=null,!1)}var Um=typeof setTimeout=="function"?setTimeout:void 0,fv=typeof clearTimeout=="function"?clearTimeout:void 0,Mm=typeof Promise=="function"?Promise:void 0,mv=typeof queueMicrotask=="function"?queueMicrotask:typeof Mm<"u"?function(e){return Mm.resolve(null).then(e).catch(gv)}:Um;function gv(e){setTimeout(function(){throw e})}function La(e){return e==="head"}function zm(e,t){var a=t,s=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(o),sr(t);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")ys(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ys(a);for(var c=a.firstChild;c;){var f=c.nextSibling,v=c.nodeName;c[Za]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=f}}else a==="body"&&ys(e.ownerDocument.body);a=o}while(a);sr(t)}function Bm(e,t){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function Nc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Nc(a),Lr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function pv(e,t,a,s){for(;e.nodeType===1;){var o=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Za])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=nn(e.nextSibling),e===null)break}return null}function yv(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=nn(e.nextSibling),e===null))return null;return e}function Hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=nn(e.nextSibling),e===null))return null;return e}function Lc(e){return e.data==="$?"||e.data==="$~"}function Dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vv(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var s=function(){t(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Uc=null;function $m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return nn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function qm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Pm(e,t,a){switch(t=eo(a),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ys(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Lr(e)}var an=new Map,Im=new Set;function to(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Fn=G.d;G.d={f:bv,r:wv,D:Sv,C:_v,L:Tv,m:kv,X:Av,S:Ev,M:Cv};function bv(){var e=Fn.f(),t=Kl();return e||t}function wv(e){var t=Dn(e);t!==null&&t.tag===5&&t.type==="form"?sf(t):Fn.r(e)}var ar=typeof document>"u"?null:document;function Gm(e,t,a){var s=ar;if(s&&typeof t=="string"&&t){var o=A(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof a=="string"&&(o+='[crossorigin="'+a+'"]'),Im.has(o)||(Im.add(o),e={rel:e,crossOrigin:a,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Tt(t,"link",e),Ze(t),s.head.appendChild(t)))}}function Sv(e){Fn.D(e),Gm("dns-prefetch",e,null)}function _v(e,t){Fn.C(e,t),Gm("preconnect",e,t)}function Tv(e,t,a){Fn.L(e,t,a);var s=ar;if(s&&e&&t){var o='link[rel="preload"][as="'+A(t)+'"]';t==="image"&&a&&a.imageSrcSet?(o+='[imagesrcset="'+A(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(o+='[imagesizes="'+A(a.imageSizes)+'"]')):o+='[href="'+A(e)+'"]';var c=o;switch(t){case"style":c=ir(e);break;case"script":c=rr(e)}an.has(c)||(e=b({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),an.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(vs(c))||t==="script"&&s.querySelector(bs(c))||(t=s.createElement("link"),Tt(t,"link",e),Ze(t),s.head.appendChild(t)))}}function kv(e,t){Fn.m(e,t);var a=ar;if(a&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+A(s)+'"][href="'+A(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=rr(e)}if(!an.has(c)&&(e=b({rel:"modulepreload",href:e},t),an.set(c,e),a.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bs(c)))return}s=a.createElement("link"),Tt(s,"link",e),Ze(s),a.head.appendChild(s)}}}function Ev(e,t,a){Fn.S(e,t,a);var s=ar;if(s&&e){var o=Un(s).hoistableStyles,c=ir(e);t=t||"default";var f=o.get(c);if(!f){var v={loading:0,preload:null};if(f=s.querySelector(vs(c)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},a),(a=an.get(c))&&Mc(e,a);var _=f=s.createElement("link");Ze(_),Tt(_,"link",e),_._p=new Promise(function(j,M){_.onload=j,_.onerror=M}),_.addEventListener("load",function(){v.loading|=1}),_.addEventListener("error",function(){v.loading|=2}),v.loading|=4,no(f,t,s)}f={type:"stylesheet",instance:f,count:1,state:v},o.set(c,f)}}}function Av(e,t){Fn.X(e,t);var a=ar;if(a&&e){var s=Un(a).hoistableScripts,o=rr(e),c=s.get(o);c||(c=a.querySelector(bs(o)),c||(e=b({src:e,async:!0},t),(t=an.get(o))&&zc(e,t),c=a.createElement("script"),Ze(c),Tt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Cv(e,t){Fn.M(e,t);var a=ar;if(a&&e){var s=Un(a).hoistableScripts,o=rr(e),c=s.get(o);c||(c=a.querySelector(bs(o)),c||(e=b({src:e,async:!0,type:"module"},t),(t=an.get(o))&&zc(e,t),c=a.createElement("script"),Ze(c),Tt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Vm(e,t,a,s){var o=(o=de.current)?to(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ir(a.href),a=Un(o).hoistableStyles,s=a.get(t),s||(s={type:"style",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ir(a.href);var c=Un(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(vs(e)))&&!c._p&&(f.instance=c,f.state.loading=5),an.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},an.set(e,a),c||xv(o,e,a,f.state))),t&&s===null)throw Error(l(528,""));return f}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rr(a),a=Un(o).hoistableScripts,s=a.get(t),s||(s={type:"script",instance:null,count:0,state:null},a.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function ir(e){return'href="'+A(e)+'"'}function vs(e){return'link[rel="stylesheet"]['+e+"]"}function Km(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function xv(e,t,a,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Tt(t,"link",a),Ze(t),e.head.appendChild(t))}function rr(e){return'[src="'+A(e)+'"]'}function bs(e){return"script[async]"+e}function Ym(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+A(a.href)+'"]');if(s)return t.instance=s,Ze(s),s;var o=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ze(s),Tt(s,"style",o),no(s,a.precedence,e),t.instance=s;case"stylesheet":o=ir(a.href);var c=e.querySelector(vs(o));if(c)return t.state.loading|=4,t.instance=c,Ze(c),c;s=Km(a),(o=an.get(o))&&Mc(s,o),c=(e.ownerDocument||e).createElement("link"),Ze(c);var f=c;return f._p=new Promise(function(v,_){f.onload=v,f.onerror=_}),Tt(c,"link",s),t.state.loading|=4,no(c,a.precedence,e),t.instance=c;case"script":return c=rr(a.src),(o=e.querySelector(bs(c)))?(t.instance=o,Ze(o),o):(s=a,(o=an.get(c))&&(s=b({},a),zc(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Ze(o),Tt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,no(s,a.precedence,e));return t.instance}function no(e,t,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,f=0;f<s.length;f++){var v=s[f];if(v.dataset.precedence===t)c=v;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ao=null;function Jm(e,t,a){if(ao===null){var s=new Map,o=ao=new Map;o.set(a,s)}else o=ao,s=o.get(a),s||(s=new Map,o.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),o=0;o<a.length;o++){var c=a[o];if(!(c[Za]||c[ct]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var v=s.get(f);v?v.push(c):s.set(f,[c])}}return s}function Xm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Ov(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Qm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Rv(e,t,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var o=ir(s.href),c=t.querySelector(vs(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=io.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,Ze(c);return}c=t.ownerDocument||t,s=Km(s),(o=an.get(o))&&Mc(s,o),c=c.createElement("link"),Ze(c);var f=c;f._p=new Promise(function(v,_){f.onload=v,f.onerror=_}),Tt(c,"link",s),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=io.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Bc=0;function jv(e,t){return e.stylesheets&&e.count===0&&so(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&so(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Bc===0&&(Bc=62500*dv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&so(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Bc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function io(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)so(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ro=null;function so(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ro=new Map,t.forEach(Nv,e),ro=null,io.call(e))}function Nv(e,t){if(!(t.state.loading&4)){var a=ro.get(e);if(a)var s=a.get(null);else{a=new Map,ro.set(e,a);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),s=f)}s&&a.set(null,s)}o=t.instance,f=o.getAttribute("data-precedence"),c=a.get(f)||s,c===s&&a.set(null,o),a.set(f,o),this.count++,s=io.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ws={$$typeof:q,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Lv(e,t,a,s,o,c,f,v,_){this.tag=1,this.containerInfo=e,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=Ja(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ja(0),this.hiddenUpdates=Ja(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function Zm(e,t,a,s,o,c,f,v,_,j,M,B){return e=new Lv(e,t,a,f,_,j,M,B,v),t=1,c===!0&&(t|=24),c=$t(3,null,null,t),e.current=c,c.stateNode=e,t=yu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:a,cache:t},Su(c),e}function Wm(e){return e?(e=Mi,e):Mi}function Fm(e,t,a,s,o,c){o=Wm(o),s.context===null?s.context=o:s.pendingContext=o,s=_a(t),s.payload={element:a},c=c===void 0?null:c,c!==null&&(s.callback=c),a=Ta(e,s,t),a!==null&&(Mt(a,e,t),Wr(a,e,t))}function eg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Hc(e,t){eg(e,t),(e=e.alternate)&&eg(e,t)}function tg(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Mt(t,e,67108864),Hc(e,67108864)}}function ng(e){if(e.tag===13||e.tag===31){var t=Vt();t=Ei(t);var a=ri(e,t);a!==null&&Mt(a,e,t),Hc(e,t)}}var lo=!0;function Dv(e,t,a,s){var o=D.T;D.T=null;var c=G.p;try{G.p=2,$c(e,t,a,s)}finally{G.p=c,D.T=o}}function Uv(e,t,a,s){var o=D.T;D.T=null;var c=G.p;try{G.p=8,$c(e,t,a,s)}finally{G.p=c,D.T=o}}function $c(e,t,a,s){if(lo){var o=qc(s);if(o===null)Ac(e,t,s,oo,a),ig(e,s);else if(zv(o,e,t,a,s))s.stopPropagation();else if(ig(e,s),t&4&&-1<Mv.indexOf(e)){for(;o!==null;){var c=Dn(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=Rn(c.pendingLanes);if(f!==0){var v=c;for(v.pendingLanes|=2,v.entangledLanes|=2;f;){var _=1<<31-Oe(f);v.entanglements[1]|=_,f&=~_}Tn(c),(Ce&6)===0&&(Gl=Ct()+500,ms(0))}}break;case 31:case 13:v=ri(c,2),v!==null&&Mt(v,c,2),Kl(),Hc(c,2)}if(c=qc(s),c===null&&Ac(e,t,s,oo,a),c===o)break;o=c}o!==null&&s.stopPropagation()}else Ac(e,t,s,null,a)}}function qc(e){return e=Io(e),Pc(e)}var oo=null;function Pc(e){if(oo=null,e=Ln(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return oo=e,null}function ag(e){switch(e){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(Jt()){case Fs:return 2;case Ar:return 8;case sa:case Ia:return 32;case On:return 268435456;default:return 32}default:return 32}}var Ic=!1,Da=null,Ua=null,Ma=null,Ss=new Map,_s=new Map,za=[],Mv="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 ig(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Ss.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_s.delete(t.pointerId)}}function Ts(e,t,a,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Dn(t),t!==null&&tg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function zv(e,t,a,s,o){switch(t){case"focusin":return Da=Ts(Da,e,t,a,s,o),!0;case"dragenter":return Ua=Ts(Ua,e,t,a,s,o),!0;case"mouseover":return Ma=Ts(Ma,e,t,a,s,o),!0;case"pointerover":var c=o.pointerId;return Ss.set(c,Ts(Ss.get(c)||null,e,t,a,s,o)),!0;case"gotpointercapture":return c=o.pointerId,_s.set(c,Ts(_s.get(c)||null,e,t,a,s,o)),!0}return!1}function rg(e){var t=Ln(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,da(e.priority,function(){ng(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,da(e.priority,function(){ng(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=qc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);Po=s,a.target.dispatchEvent(s),Po=null}else return t=Dn(a),t!==null&&tg(t),e.blockedOn=a,!1;t.shift()}return!0}function sg(e,t,a){uo(e)&&a.delete(t)}function Bv(){Ic=!1,Da!==null&&uo(Da)&&(Da=null),Ua!==null&&uo(Ua)&&(Ua=null),Ma!==null&&uo(Ma)&&(Ma=null),Ss.forEach(sg),_s.forEach(sg)}function co(e,t){e.blockedOn===t&&(e.blockedOn=null,Ic||(Ic=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Bv)))}var ho=null;function lg(e){ho!==e&&(ho=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ho===e&&(ho=null);for(var t=0;t<e.length;t+=3){var a=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Pc(s||a)===null)continue;break}var c=Dn(a);c!==null&&(e.splice(t,3),t-=3,qu(c,{pending:!0,data:o,method:a.method,action:s},s,o))}}))}function sr(e){function t(_){return co(_,e)}Da!==null&&co(Da,e),Ua!==null&&co(Ua,e),Ma!==null&&co(Ma,e),Ss.forEach(t),_s.forEach(t);for(var a=0;a<za.length;a++){var s=za[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<za.length&&(a=za[0],a.blockedOn===null);)rg(a),a.blockedOn===null&&za.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var o=a[s],c=a[s+1],f=o[yt]||null;if(typeof c=="function")f||lg(a);else if(f){var v=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[yt]||null)v=f.formAction;else if(Pc(o)!==null)continue}else v=f.action;typeof v=="function"?a[s+1]=v:(a.splice(s,3),s-=3),lg(a)}}}function og(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Gc(e){this._internalRoot=e}fo.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var a=t.current,s=Vt();Fm(a,s,e,t,null,null)},fo.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fm(e.current,2,null,e,null,null),Kl(),t[ha]=null}};function fo(e){this._internalRoot=e}fo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rr();e={blockedOn:null,target:e,priority:t};for(var a=0;a<za.length&&t!==0&&t<za[a].priority;a++);za.splice(a,0,e),a===0&&rg(e)}};var ug=n.version;if(ug!=="19.2.7")throw Error(l(527,ug,"19.2.7"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var Hv={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mo.isDisabled&&mo.supportsFiber)try{Ga=mo.inject(Hv),pt=mo}catch{}}return Es.createRoot=function(e,t){if(!u(e))throw Error(l(299));var a=!1,s="",o=pf,c=yf,f=vf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Zm(e,1,!1,null,null,a,s,null,o,c,f,og),e[ha]=t.current,Ec(e),new Gc(t)},Es.hydrateRoot=function(e,t,a){if(!u(e))throw Error(l(299));var s=!1,o="",c=pf,f=yf,v=vf,_=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),t=Zm(e,1,!0,t,a??null,s,o,_,c,f,v,og),t.context=Wm(null),a=t.current,s=Vt(),s=Ei(s),o=_a(s),o.callback=null,Ta(a,o,s),a=s,t.current.lanes=a,ca(t,a),Tn(t),e[ha]=t.current,Ec(e),new fo(t)},Es.version="19.2.7",Es}var bg;function Xv(){if(bg)return Yc.exports;bg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(n){console.error(n)}}return i(),Yc.exports=Jv(),Yc.exports}var Qv=Xv();const Zv=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wv=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,l)=>l?l.toUpperCase():r.toLowerCase()),wg=i=>{const n=Wv(i);return n.charAt(0).toUpperCase()+n.slice(1)},hp=(...i)=>i.filter((n,r,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===r).join(" ").trim(),Fv=i=>{for(const n in i)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var e0={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 t0=P.forwardRef(({color:i="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:u="",children:d,iconNode:h,...m},g)=>P.createElement("svg",{ref:g,...e0,width:n,height:n,stroke:i,strokeWidth:l?Number(r)*24/Number(n):r,className:hp("lucide",u),...!d&&!Fv(m)&&{"aria-hidden":"true"},...m},[...h.map(([p,w])=>P.createElement(p,w)),...Array.isArray(d)?d:[d]]));const Me=(i,n)=>{const r=P.forwardRef(({className:l,...u},d)=>P.createElement(t0,{ref:d,iconNode:n,className:hp(`lucide-${Zv(wg(i))}`,`lucide-${i}`,l),...u}));return r.displayName=wg(i),r};const n0=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Sg=Me("activity",n0);const a0=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],i0=Me("badge-check",a0);const r0=[["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"}]],fd=Me("book-open",r0);const s0=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],l0=Me("chevron-left",s0);const o0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],u0=Me("chevron-right",o0);const c0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],d0=Me("circle-check",c0);const h0=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],As=Me("clipboard",h0);const f0=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],md=Me("credit-card",f0);const m0=[["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"}]],Zc=Me("database",m0);const g0=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],p0=Me("earth",g0);const y0=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Wc=Me("folder-open",y0);const v0=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],fp=Me("layout-grid",v0);const b0=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],Fc=Me("log-in",b0);const w0=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],S0=Me("log-out",w0);const _0=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],br=Me("monitor",_0);const T0=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],gd=Me("mouse-pointer-2",T0);const k0=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],ed=Me("play",k0);const E0=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],A0=Me("power",E0);const C0=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],x0=Me("rotate-ccw",C0);const O0=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],td=Me("send",O0);const R0=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],nd=Me("server",R0);const j0=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N0=Me("settings",j0);const L0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_g=Me("shield-check",L0);const D0=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],U0=Me("star",D0);const M0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],gr=Me("terminal",M0);const z0=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Tg=Me("volume-2",z0);const B0=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],kg=Me("wifi",B0);const H0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$0=Me("x",H0);function Do(i,n){var r={};for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&n.indexOf(l)<0&&(r[l]=i[l]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,l=Object.getOwnPropertySymbols(i);u<l.length;u++)n.indexOf(l[u])<0&&Object.prototype.propertyIsEnumerable.call(i,l[u])&&(r[l[u]]=i[l[u]]);return r}function q0(i,n,r,l){function u(d){return d instanceof r?d:new r(function(h){h(d)})}return new(r||(r=Promise))(function(d,h){function m(w){try{p(l.next(w))}catch(b){h(b)}}function g(w){try{p(l.throw(w))}catch(b){h(b)}}function p(w){w.done?d(w.value):u(w.value).then(m,g)}p((l=l.apply(i,n||[])).next())})}const P0=i=>i?(...n)=>i(...n):(...n)=>fetch(...n);class Od extends Error{constructor(n,r="FunctionsError",l){super(n),this.name=r,this.context=l}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class I0 extends Od{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class Eg extends Od{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class Ag extends Od{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var pd;(function(i){i.Any="any",i.ApNortheast1="ap-northeast-1",i.ApNortheast2="ap-northeast-2",i.ApSouth1="ap-south-1",i.ApSoutheast1="ap-southeast-1",i.ApSoutheast2="ap-southeast-2",i.CaCentral1="ca-central-1",i.EuCentral1="eu-central-1",i.EuWest1="eu-west-1",i.EuWest2="eu-west-2",i.EuWest3="eu-west-3",i.SaEast1="sa-east-1",i.UsEast1="us-east-1",i.UsWest1="us-west-1",i.UsWest2="us-west-2"})(pd||(pd={}));class G0{constructor(n,{headers:r={},customFetch:l,region:u=pd.Any}={}){this.url=n,this.headers=r,this.region=u,this.fetch=P0(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return q0(this,arguments,void 0,function*(r,l={}){var u;let d,h;try{const{headers:m,method:g,body:p,signal:w,timeout:b}=l;let T={},{region:S}=l;S||(S=this.region);const x=new URL(`${this.url}/${r}`);S&&S!=="any"&&(T["x-region"]=S,x.searchParams.set("forceFunctionRegion",S));let O;const I=!!m&&Object.keys(m).some(ie=>ie.toLowerCase()==="content-type");p&&!I?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(T["Content-Type"]="application/octet-stream",O=p):typeof p=="string"?(T["Content-Type"]="text/plain",O=p):typeof FormData<"u"&&p instanceof FormData?O=p:(T["Content-Type"]="application/json",O=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?O=JSON.stringify(p):O=p;let $=w;b&&(h=new AbortController,d=setTimeout(()=>h.abort(),b),w?($=h.signal,w.addEventListener("abort",()=>h.abort())):$=h.signal);const H=yield this.fetch(x.toString(),{method:g||"POST",headers:Object.assign(Object.assign(Object.assign({},T),this.headers),m),body:O,signal:$}).catch(ie=>{throw new I0(ie)}),q=H.headers.get("x-relay-error");if(q&&q==="true")throw new Eg(H);if(!H.ok)throw new Ag(H);let X=((u=H.headers.get("Content-Type"))!==null&&u!==void 0?u:"text/plain").split(";")[0].trim(),me;return X==="application/json"?me=yield H.json():X==="application/octet-stream"||X==="application/pdf"?me=yield H.blob():X==="text/event-stream"?me=H:X==="multipart/form-data"?me=yield H.formData():me=yield H.text(),{data:me,error:null,response:H}}catch(m){return{data:null,error:m,response:m instanceof Ag||m instanceof Eg?m.context:void 0}}finally{d&&clearTimeout(d)}})}}const mp=3,Cg=i=>Math.min(1e3*2**i,3e4),V0=[520,503],gp=["GET","HEAD","OPTIONS"];var xg=class extends Error{constructor(i){super(i.message),this.name="PostgrestError",this.details=i.details,this.hint=i.hint,this.code=i.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Og(i,n){return new Promise(r=>{if(n?.aborted){r();return}const l=setTimeout(()=>{n?.removeEventListener("abort",u),r()},i);function u(){clearTimeout(l),r()}n?.addEventListener("abort",u)})}function K0(i,n,r,l){return!(!l||r>=mp||!gp.includes(i)||!V0.includes(n))}var Y0=class{constructor(i){var n,r,l,u,d;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(n=i.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=i.signal,this.isMaybeSingle=(r=i.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(l=i.shouldStripNulls)!==null&&l!==void 0?l:!1,this.urlLengthLimit=(u=i.urlLengthLimit)!==null&&u!==void 0?u:8e3,this.retryEnabled=(d=i.retry)!==null&&d!==void 0?d:!0,i.fetch?this.fetch=i.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(i,n){return this.headers=new Headers(this.headers),this.headers.set(i,n),this}retry(i){return this.retryEnabled=i,this}then(i,n){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const h=this.headers.get("Accept");h==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!h||h==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const l=this.fetch;let d=(async()=>{let h=0;for(;;){const p={};r.headers.forEach((b,T)=>{p[T]=b}),h>0&&(p["X-Retry-Count"]=String(h));let w;try{w=await l(r.url.toString(),{method:r.method,headers:p,body:JSON.stringify(r.body,(b,T)=>typeof T=="bigint"?T.toString():T),signal:r.signal})}catch(b){if(b?.name==="AbortError"||b?.code==="ABORT_ERR"||!gp.includes(r.method))throw b;if(r.retryEnabled&&h<mp){const T=Cg(h);h++,await Og(T,r.signal);continue}throw b}if(K0(r.method,w.status,h,r.retryEnabled)){var m,g;const b=(m=(g=w.headers)===null||g===void 0?void 0:g.get("Retry-After"))!==null&&m!==void 0?m:null,T=b!==null?Math.max(0,parseInt(b,10)||0)*1e3:Cg(h);await w.text(),h++,await Og(T,r.signal);continue}return await r.processResponse(w)}})();return this.shouldThrowOnError||(d=d.catch(h=>{var m;let g="",p="",w="";const b=h?.cause;if(b){var T,S,x,O;const H=(T=b?.message)!==null&&T!==void 0?T:"",q=(S=b?.code)!==null&&S!==void 0?S:"";g=`${(x=h?.name)!==null&&x!==void 0?x:"FetchError"}: ${h?.message}`,g+=`
|
|
10
|
-
|
|
11
|
-
Caused by: ${(O=b?.name)!==null&&O!==void 0?O:"Error"}: ${H}`,q&&(g+=` (${q})`),b?.stack&&(g+=`
|
|
12
|
-
${b.stack}`)}else{var I;g=(I=h?.stack)!==null&&I!==void 0?I:""}const $=this.url.toString().length;return h?.name==="AbortError"||h?.code==="ABORT_ERR"?(w="",p="Request was aborted (timeout or manual cancellation)",$>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${$} 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.`)):(b?.name==="HeadersOverflowError"||b?.code==="UND_ERR_HEADERS_OVERFLOW")&&(w="",p="HTTP headers exceeded server limits (typically 16KB)",$>this.urlLengthLimit&&(p+=`. Your request URL is ${$} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(m=h?.name)!==null&&m!==void 0?m:"FetchError"}: ${h?.message}`,details:g,hint:p,code:w},data:null,count:null,status:0,statusText:""}})),d.then(i,n)}async processResponse(i){var n=this;let r=null,l=null,u=null,d=i.status,h=i.statusText;if(i.ok){var m,g;if(n.method!=="HEAD"){var p;const T=await i.text();if(T!=="")if(n.headers.get("Accept")==="text/csv")l=T;else if(n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text")))l=T;else try{l=JSON.parse(T)}catch{if(r={message:T},l=null,n.shouldThrowOnError)throw new xg({message:T,details:"",hint:"",code:""})}}const w=(m=n.headers.get("Prefer"))===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),b=(g=i.headers.get("content-range"))===null||g===void 0?void 0:g.split("/");w&&b&&b.length>1&&(u=parseInt(b[1])),n.isMaybeSingle&&Array.isArray(l)&&(l.length>1?(r={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,u=null,d=406,h="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{const w=await i.text();try{r=JSON.parse(w),Array.isArray(r)&&i.status===404&&(l=[],r=null,d=200,h="OK")}catch{i.status===404&&w===""?(d=204,h="No Content"):r={message:w}}if(r&&n.shouldThrowOnError)throw new xg(r)}return{success:r===null,error:r,data:l,count:u,status:d,statusText:h}}returns(){return this}overrideTypes(){return this}},J0=class extends Y0{throwOnError(){return super.throwOnError()}select(i){let n=!1;const r=(i??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:n=!0,nullsFirst:r,foreignTable:l,referencedTable:u=l}={}){const d=u?`${u}.order`:"order",h=this.url.searchParams.get(d);return this.url.searchParams.set(d,`${h?`${h},`:""}${i}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:n,referencedTable:r=n}={}){const l=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(l,`${i}`),this}range(i,n,{foreignTable:r,referencedTable:l=r}={}){const u=typeof l>"u"?"offset":`${l}.offset`,d=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(u,`${i}`),this.url.searchParams.set(d,`${n-i+1}`),this}abortSignal(i){return this.signal=i,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:i=!1,verbose:n=!1,settings:r=!1,buffers:l=!1,wal:u=!1,format:d="text"}={}){var h;const m=[i?"analyze":null,n?"verbose":null,r?"settings":null,l?"buffers":null,u?"wal":null].filter(Boolean).join("|"),g=(h=this.headers.get("Accept"))!==null&&h!==void 0?h:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${d}; for="${g}"; options=${m};`),d==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}};const Rg=new RegExp("[,()]");var pr=class extends J0{throwOnError(){return super.throwOnError()}eq(i,n){return this.url.searchParams.append(i,`eq.${n}`),this}neq(i,n){return this.url.searchParams.append(i,`neq.${n}`),this}gt(i,n){return this.url.searchParams.append(i,`gt.${n}`),this}gte(i,n){return this.url.searchParams.append(i,`gte.${n}`),this}lt(i,n){return this.url.searchParams.append(i,`lt.${n}`),this}lte(i,n){return this.url.searchParams.append(i,`lte.${n}`),this}like(i,n){return this.url.searchParams.append(i,`like.${n}`),this}likeAllOf(i,n){return this.url.searchParams.append(i,`like(all).{${n.join(",")}}`),this}likeAnyOf(i,n){return this.url.searchParams.append(i,`like(any).{${n.join(",")}}`),this}ilike(i,n){return this.url.searchParams.append(i,`ilike.${n}`),this}ilikeAllOf(i,n){return this.url.searchParams.append(i,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(i,n){return this.url.searchParams.append(i,`ilike(any).{${n.join(",")}}`),this}regexMatch(i,n){return this.url.searchParams.append(i,`match.${n}`),this}regexIMatch(i,n){return this.url.searchParams.append(i,`imatch.${n}`),this}is(i,n){return this.url.searchParams.append(i,`is.${n}`),this}isDistinct(i,n){return this.url.searchParams.append(i,`isdistinct.${n}`),this}in(i,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Rg.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${r})`),this}notIn(i,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Rg.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`not.in.(${r})`),this}contains(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cs.{${n.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(n)}`),this}containedBy(i,n){return typeof n=="string"?this.url.searchParams.append(i,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(i,`cd.{${n.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(n)}`),this}rangeGt(i,n){return this.url.searchParams.append(i,`sr.${n}`),this}rangeGte(i,n){return this.url.searchParams.append(i,`nxl.${n}`),this}rangeLt(i,n){return this.url.searchParams.append(i,`sl.${n}`),this}rangeLte(i,n){return this.url.searchParams.append(i,`nxr.${n}`),this}rangeAdjacent(i,n){return this.url.searchParams.append(i,`adj.${n}`),this}overlaps(i,n){return typeof n=="string"?this.url.searchParams.append(i,`ov.${n}`):this.url.searchParams.append(i,`ov.{${n.join(",")}}`),this}textSearch(i,n,{config:r,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const d=r===void 0?"":`(${r})`;return this.url.searchParams.append(i,`${u}fts${d}.${n}`),this}match(i){return Object.entries(i).filter(([n,r])=>r!==void 0).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(i,n,r){return this.url.searchParams.append(i,`not.${n}.${r}`),this}or(i,{foreignTable:n,referencedTable:r=n}={}){const l=r?`${r}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,n,r){return this.url.searchParams.append(i,`${n}.${r}`),this}},X0=class{constructor(i,{headers:n={},schema:r,fetch:l,urlLengthLimit:u=8e3,retry:d}){this.url=i,this.headers=new Headers(n),this.schema=r,this.fetch=l,this.urlLengthLimit=u,this.retry=d}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(i,n){const{head:r=!1,count:l}=n??{},u=r?"HEAD":"GET";let d=!1;const h=(i??"*").split("").map(p=>/\s/.test(p)&&!d?"":(p==='"'&&(d=!d),p)).join(""),{url:m,headers:g}=this.cloneRequestState();return m.searchParams.set("select",h),l&&g.append("Prefer",`count=${l}`),new pr({method:u,url:m,headers:g,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(i,{count:n,defaultToNull:r=!0}={}){var l;const u="POST",{url:d,headers:h}=this.cloneRequestState();if(n&&h.append("Prefer",`count=${n}`),r||h.append("Prefer","missing=default"),Array.isArray(i)){const m=i.reduce((g,p)=>g.concat(Object.keys(p)),[]);if(m.length>0){const g=[...new Set(m)].map(p=>`"${p}"`);d.searchParams.set("columns",g.join(","))}}return new pr({method:u,url:d,headers:h,schema:this.schema,body:i,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(i,{onConflict:n,ignoreDuplicates:r=!1,count:l,defaultToNull:u=!0}={}){var d;const h="POST",{url:m,headers:g}=this.cloneRequestState();if(g.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&m.searchParams.set("on_conflict",n),l&&g.append("Prefer",`count=${l}`),u||g.append("Prefer","missing=default"),Array.isArray(i)){const p=i.reduce((w,b)=>w.concat(Object.keys(b)),[]);if(p.length>0){const w=[...new Set(p)].map(b=>`"${b}"`);m.searchParams.set("columns",w.join(","))}}return new pr({method:h,url:m,headers:g,schema:this.schema,body:i,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(i,{count:n}={}){var r;const l="PATCH",{url:u,headers:d}=this.cloneRequestState();return n&&d.append("Prefer",`count=${n}`),new pr({method:l,url:u,headers:d,schema:this.schema,body:i,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:i}={}){var n;const r="DELETE",{url:l,headers:u}=this.cloneRequestState();return i&&u.append("Prefer",`count=${i}`),new pr({method:r,url:l,headers:u,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function $s(i){"@babel/helpers - typeof";return $s=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},$s(i)}function Q0(i,n){if($s(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if($s(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function Z0(i){var n=Q0(i,"string");return $s(n)=="symbol"?n:n+""}function W0(i,n,r){return(n=Z0(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function jg(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function go(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?jg(Object(r),!0).forEach(function(l){W0(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):jg(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}var F0=class pp{constructor(n,{headers:r={},schema:l,fetch:u,timeout:d,urlLengthLimit:h=8e3,retry:m}={}){this.url=n,this.headers=new Headers(r),this.schemaName=l,this.urlLengthLimit=h;const g=u??globalThis.fetch;d!==void 0&&d>0?this.fetch=(p,w)=>{const b=new AbortController,T=setTimeout(()=>b.abort(),d),S=w?.signal;if(S){if(S.aborted)return clearTimeout(T),g(p,w);const x=()=>{clearTimeout(T),b.abort()};return S.addEventListener("abort",x,{once:!0}),g(p,go(go({},w),{},{signal:b.signal})).finally(()=>{clearTimeout(T),S.removeEventListener("abort",x)})}return g(p,go(go({},w),{},{signal:b.signal})).finally(()=>clearTimeout(T))}:this.fetch=g,this.retry=m}from(n){if(!n||typeof n!="string"||n.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new X0(new URL(`${this.url}/${n}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(n){return new pp(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(n,r={},{head:l=!1,get:u=!1,count:d}={}){var h;let m;const g=new URL(`${this.url}/rpc/${n}`);let p;const w=S=>S!==null&&typeof S=="object"&&(!Array.isArray(S)||S.some(w)),b=l&&Object.values(r).some(w);b?(m="POST",p=r):l||u?(m=l?"HEAD":"GET",Object.entries(r).filter(([S,x])=>x!==void 0).map(([S,x])=>[S,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([S,x])=>{g.searchParams.append(S,x)})):(m="POST",p=r);const T=new Headers(this.headers);return b?T.set("Prefer",d?`count=${d},return=minimal`:"return=minimal"):d&&T.set("Prefer",`count=${d}`),new pr({method:m,url:g,headers:T,schema:this.schemaName,body:p,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class eb{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const l=typeof global<"u"?global:void 0;if(l&&typeof l.WebSocket<"u")return{type:"native",wsConstructor:l.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((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 u=globalThis.process;if(u){const d=u.versions;if(d&&d.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}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.wsConstructor)return n.wsConstructor;let r=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(r+=`
|
|
13
|
-
|
|
14
|
-
Suggested solution: ${n.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const tb="2.110.0",nb=`realtime-js/${tb}`,ab="1.0.0",yp="2.0.0",ib=yp,rb=1e4,sb=100,Ha={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},vp={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},yd={connecting:"connecting",closing:"closing",closed:"closed"};class lb{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,r){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return r(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var r;return this._isArrayBuffer((r=n.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var r,l;const u=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,u)}_encodeJsonUserBroadcastPush(n){var r,l;const u=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:{},h=new TextEncoder().encode(JSON.stringify(u)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,h)}_encodeUserBroadcastPush(n,r,l){var u,d;const h=n.topic,m=(u=n.ref)!==null&&u!==void 0?u:"",g=(d=n.join_ref)!==null&&d!==void 0?d:"",p=n.payload.event,w=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},b=Object.keys(w).length===0?"":JSON.stringify(w);if(g.length>255)throw new Error(`joinRef length ${g.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`ref length ${m.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`topic length ${h.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(b.length>255)throw new Error(`metadata length ${b.length} exceeds maximum of 255`);const T=this.USER_BROADCAST_PUSH_META_LENGTH+g.length+m.length+h.length+p.length+b.length,S=new ArrayBuffer(this.HEADER_LENGTH+T);let x=new DataView(S),O=0;x.setUint8(O++,this.KINDS.userBroadcastPush),x.setUint8(O++,g.length),x.setUint8(O++,m.length),x.setUint8(O++,h.length),x.setUint8(O++,p.length),x.setUint8(O++,b.length),x.setUint8(O++,r),Array.from(g,$=>x.setUint8(O++,$.charCodeAt(0))),Array.from(m,$=>x.setUint8(O++,$.charCodeAt(0))),Array.from(h,$=>x.setUint8(O++,$.charCodeAt(0))),Array.from(p,$=>x.setUint8(O++,$.charCodeAt(0))),Array.from(b,$=>x.setUint8(O++,$.charCodeAt(0)));var I=new Uint8Array(S.byteLength+l.byteLength);return I.set(new Uint8Array(S),0),I.set(new Uint8Array(l),S.byteLength),I.buffer}decode(n,r){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return r(l)}if(typeof n=="string"){const l=JSON.parse(n),[u,d,h,m,g]=l;return r({join_ref:u,ref:d,topic:h,event:m,payload:g})}return r({})}_binaryDecode(n){const r=new DataView(n),l=r.getUint8(0),u=new TextDecoder;if(l===this.KINDS.userBroadcast)return this._decodeUserBroadcast(n,r,u)}_decodeUserBroadcast(n,r,l){const u=r.getUint8(1),d=r.getUint8(2),h=r.getUint8(3),m=r.getUint8(4);let g=this.HEADER_LENGTH+4;const p=l.decode(n.slice(g,g+u));g=g+u;const w=l.decode(n.slice(g,g+d));g=g+d;const b=l.decode(n.slice(g,g+h));g=g+h;const T=n.slice(g,n.byteLength),S=m===this.JSON_ENCODING?JSON.parse(l.decode(T)):T,x={type:this.BROADCAST_EVENT,event:w,payload:S};return h>0&&(x.meta=JSON.parse(b)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(n){var r;return n instanceof ArrayBuffer||((r=n?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(n,r){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>r.includes(l)))}}var He;(function(i){i.abstime="abstime",i.bool="bool",i.date="date",i.daterange="daterange",i.float4="float4",i.float8="float8",i.int2="int2",i.int4="int4",i.int4range="int4range",i.int8="int8",i.int8range="int8range",i.json="json",i.jsonb="jsonb",i.money="money",i.numeric="numeric",i.oid="oid",i.reltime="reltime",i.text="text",i.time="time",i.timestamp="timestamp",i.timestamptz="timestamptz",i.timetz="timetz",i.tsrange="tsrange",i.tstzrange="tstzrange"})(He||(He={}));const Ng=(i,n,r={})=>{var l;const u=(l=r.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((d,h)=>(d[h]=ob(h,i,n,u),d),{}):{}},ob=(i,n,r,l)=>{const u=n.find(m=>m.name===i),d=u?.type,h=r[i];return d&&!l.includes(d)?bp(d,h):vd(h)},bp=(i,n)=>{if(i.charAt(0)==="_"){const r=i.slice(1,i.length);return hb(n,r)}switch(i){case He.bool:return ub(n);case He.float4:case He.float8:case He.int2:case He.int4:case He.int8:case He.numeric:case He.oid:return cb(n);case He.json:case He.jsonb:return db(n);case He.timestamp:return fb(n);case He.abstime:case He.date:case He.daterange:case He.int4range:case He.int8range:case He.money:case He.reltime:case He.text:case He.time:case He.timestamptz:case He.timetz:case He.tsrange:case He.tstzrange:return vd(n);default:return vd(n)}},vd=i=>i,ub=i=>{switch(i){case"t":return!0;case"f":return!1;default:return i}},cb=i=>{if(typeof i=="string"){const n=parseFloat(i);if(!Number.isNaN(n))return n}return i},db=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch{return i}return i},hb=(i,n)=>{if(typeof i!="string")return i;const r=i.length-1,l=i[r];if(i[0]==="{"&&l==="}"){let d;const h=i.slice(1,r);try{d=JSON.parse("["+h+"]")}catch{d=h?h.split(","):[]}return d.map(m=>bp(n,m))}return i},fb=i=>typeof i=="string"?i.replace(" ","T"):i,wp=i=>{const n=new URL(i);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};var Ds=i=>typeof i=="function"?i:function(){return i},mb=typeof self<"u"?self:null,yr=typeof window<"u"?window:null,kn=mb||yr||globalThis,gb="2.0.0",pb=1e4,yb=1e3,En={connecting:0,open:1,closing:2,closed:3},zt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},na={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},bd={longpoll:"longpoll",websocket:"websocket"},vb={complete:4},wd="base64url.bearer.phx.",po=class{constructor(i,n,r,l){this.channel=i,this.event=n,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=l,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(i){this.timeout=i,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(i,n){return this.hasReceived(i)&&n(this.receivedResp.response),this.recHooks.push({status:i,callback:n}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:i,response:n,_ref:r}){this.recHooks.filter(l=>l.status===i).forEach(l=>l.callback(n))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,i=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=i,this.matchReceive(i)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(i){return this.receivedResp&&this.receivedResp.status===i}trigger(i,n){this.channel.trigger(this.refEvent,{status:i,response:n})}},Sp=class{constructor(i,n){this.callback=i,this.timerCalc=n,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},bb=class{constructor(i,n,r){this.state=zt.closed,this.topic=i,this.params=Ds(n||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new po(this,na.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Sp(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=zt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this.joinPush.receive("error",l=>{this.state=zt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=zt.closed,this.socket.remove(this)}),this.onError(l=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,l),this.isJoining()&&this.joinPush.reset(),this.state=zt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new po(this,na.leave,Ds({}),this.timeout).send(),this.state=zt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(na.reply,(l,u)=>{this.trigger(this.replyEventName(u),l)})}join(i=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=i,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(i=>i.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=zt.closed,this.bindings=[]}onClose(i){this.on(na.close,i)}onError(i){return this.on(na.error,n=>i(n))}on(i,n){let r=this.bindingRef++;return this.bindings.push({event:i,ref:r,callback:n}),r}off(i,n){this.bindings=this.bindings.filter(r=>!(r.event===i&&(typeof n>"u"||n===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(i,n,r=this.timeout){if(n=n||{},!this.joinedOnce)throw new Error(`tried to push '${i}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let l=new po(this,i,function(){return n},r);return this.canPush()?l.send():(l.startTimeout(),this.pushBuffer.push(l)),l}leave(i=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=zt.leaving;let n=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(na.close,"leave")},r=new po(this,na.leave,Ds({}),i);return r.receive("ok",()=>n()).receive("timeout",()=>n()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(i,n,r){return n}filterBindings(i,n,r){return!0}isMember(i,n,r,l){return this.topic!==i?!1:l&&l!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:i,event:n,payload:r,joinRef:l}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(i=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=zt.joining,this.joinPush.resend(i))}trigger(i,n,r,l){let u=this.onMessage(i,n,r,l);if(n&&!u)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let d=this.bindings.filter(h=>h.event===i&&this.filterBindings(h,n,r));for(let h=0;h<d.length;h++)d[h].callback(u,r,l||this.joinRef())}replyEventName(i){return`chan_reply_${i}`}isClosed(){return this.state===zt.closed}isErrored(){return this.state===zt.errored}isJoined(){return this.state===zt.joined}isJoining(){return this.state===zt.joining}isLeaving(){return this.state===zt.leaving}},Ao=class{static request(i,n,r,l,u,d,h){if(kn.XDomainRequest){let m=new kn.XDomainRequest;return this.xdomainRequest(m,i,n,l,u,d,h)}else if(kn.XMLHttpRequest){let m=new kn.XMLHttpRequest;return this.xhrRequest(m,i,n,r,l,u,d,h)}else{if(kn.fetch&&kn.AbortController)return this.fetchRequest(i,n,r,l,u,d,h);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(i,n,r,l,u,d,h){let m={method:i,headers:r,body:l},g=null;return u&&(g=new AbortController,setTimeout(()=>g.abort(),u),m.signal=g.signal),kn.fetch(n,m).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>h&&h(p)).catch(p=>{p.name==="AbortError"&&d?d():h&&h(null)}),g}static xdomainRequest(i,n,r,l,u,d,h){return i.timeout=u,i.open(n,r),i.onload=()=>{let m=this.parseJSON(i.responseText);h&&h(m)},d&&(i.ontimeout=d),i.onprogress=()=>{},i.send(l),i}static xhrRequest(i,n,r,l,u,d,h,m){i.open(n,r,!0),i.timeout=d;for(let[g,p]of Object.entries(l))i.setRequestHeader(g,p);return i.onerror=()=>m&&m(null),i.onreadystatechange=()=>{if(i.readyState===vb.complete&&m){let g=this.parseJSON(i.responseText);m(g)}},h&&(i.ontimeout=h),i.send(u),i}static parseJSON(i){if(!i||i==="")return null;try{return JSON.parse(i)}catch{return console&&console.log("failed to parse JSON response",i),null}}static serialize(i,n){let r=[];for(var l in i){if(!Object.prototype.hasOwnProperty.call(i,l))continue;let u=n?`${n}[${l}]`:l,d=i[l];typeof d=="object"?r.push(this.serialize(d,u)):r.push(encodeURIComponent(u)+"="+encodeURIComponent(d))}return r.join("&")}static appendParams(i,n){if(Object.keys(n).length===0)return i;let r=i.match(/\?/)?"&":"?";return`${i}${r}${this.serialize(n)}`}},wb=i=>{let n="",r=new Uint8Array(i),l=r.byteLength;for(let u=0;u<l;u++)n+=String.fromCharCode(r[u]);return btoa(n)},lr=class{constructor(i,n){n&&n.length===2&&n[1].startsWith(wd)&&(this.authToken=atob(n[1].slice(wd.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(i),this.readyState=En.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(i){return i.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+bd.websocket),"$1/"+bd.longpoll)}endpointURL(){return Ao.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(i,n,r){this.close(i,n,r),this.readyState=En.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===En.open||this.readyState===En.connecting}poll(){const i={Accept:"application/json"};this.authToken&&(i["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",i,null,()=>this.ontimeout(),n=>{if(n){var{status:r,token:l,messages:u}=n;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=l}else r=0;switch(r){case 200:u.forEach(d=>{setTimeout(()=>this.onmessage({data:d}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=En.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(i){typeof i!="string"&&(i=wb(i)),this.currentBatch?this.currentBatch.push(i):this.awaitingBatchAck?this.batchBuffer.push(i):(this.currentBatch=[i],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(i){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},i.join(`
|
|
15
|
-
`),()=>this.onerror("timeout"),n=>{this.awaitingBatchAck=!1,!n||n.status!==200?(this.onerror(n&&n.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(i,n,r){for(let u of this.reqs)u.abort();this.readyState=En.closed;let l=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:i,reason:n,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",l)):this.onclose(l)}ajax(i,n,r,l,u){let d,h=()=>{this.reqs.delete(d),l()};d=Ao.request(i,this.endpointURL(),n,r,this.timeout,h,m=>{this.reqs.delete(d),this.isActive()&&u(m)}),this.reqs.add(d)}},Sb=class js{constructor(n,r={}){let l=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=n,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(l.state,u=>{let{onJoin:d,onLeave:h,onSync:m}=this.caller;this.joinRef=this.channel.joinRef(),this.state=js.syncState(this.state,u,d,h),this.pendingDiffs.forEach(g=>{this.state=js.syncDiff(this.state,g,d,h)}),this.pendingDiffs=[],m()}),this.channel.on(l.diff,u=>{let{onJoin:d,onLeave:h,onSync:m}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(u):(this.state=js.syncDiff(this.state,u,d,h),m())})}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}list(n){return js.list(this.state,n)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(n,r,l,u){let d=this.clone(n),h={},m={};return this.map(d,(g,p)=>{r[g]||(m[g]=p)}),this.map(r,(g,p)=>{let w=d[g];if(w){let b=p.metas.map(O=>O.phx_ref),T=w.metas.map(O=>O.phx_ref),S=p.metas.filter(O=>T.indexOf(O.phx_ref)<0),x=w.metas.filter(O=>b.indexOf(O.phx_ref)<0);S.length>0&&(h[g]=p,h[g].metas=S),x.length>0&&(m[g]=this.clone(w),m[g].metas=x)}else h[g]=p}),this.syncDiff(d,{joins:h,leaves:m},l,u)}static syncDiff(n,r,l,u){let{joins:d,leaves:h}=this.clone(r);return l||(l=function(){}),u||(u=function(){}),this.map(d,(m,g)=>{let p=n[m];if(n[m]=this.clone(g),p){let w=n[m].metas.map(T=>T.phx_ref),b=p.metas.filter(T=>w.indexOf(T.phx_ref)<0);n[m].metas.unshift(...b)}l(m,p,g)}),this.map(h,(m,g)=>{let p=n[m];if(!p)return;let w=g.metas.map(b=>b.phx_ref);p.metas=p.metas.filter(b=>w.indexOf(b.phx_ref)<0),u(m,p,g),p.metas.length===0&&delete n[m]}),n}static list(n,r){return r||(r=function(l,u){return u}),this.map(n,(l,u)=>r(l,u))}static map(n,r){return Object.getOwnPropertyNames(n).map(l=>r(l,n[l]))}static clone(n){return JSON.parse(JSON.stringify(n))}},yo={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(i,n){if(i.payload.constructor===ArrayBuffer)return n(this.binaryEncode(i));{let r=[i.join_ref,i.ref,i.topic,i.event,i.payload];return n(JSON.stringify(r))}},decode(i,n){if(i.constructor===ArrayBuffer)return n(this.binaryDecode(i));{let[r,l,u,d,h]=JSON.parse(i);return n({join_ref:r,ref:l,topic:u,event:d,payload:h})}},binaryEncode(i){let{join_ref:n,ref:r,event:l,topic:u,payload:d}=i,h=this.META_LENGTH+n.length+r.length+u.length+l.length,m=new ArrayBuffer(this.HEADER_LENGTH+h),g=new DataView(m),p=0;g.setUint8(p++,this.KINDS.push),g.setUint8(p++,n.length),g.setUint8(p++,r.length),g.setUint8(p++,u.length),g.setUint8(p++,l.length),Array.from(n,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(r,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(u,b=>g.setUint8(p++,b.charCodeAt(0))),Array.from(l,b=>g.setUint8(p++,b.charCodeAt(0)));var w=new Uint8Array(m.byteLength+d.byteLength);return w.set(new Uint8Array(m),0),w.set(new Uint8Array(d),m.byteLength),w.buffer},binaryDecode(i){let n=new DataView(i),r=n.getUint8(0),l=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(i,n,l);case this.KINDS.reply:return this.decodeReply(i,n,l);case this.KINDS.broadcast:return this.decodeBroadcast(i,n,l)}},decodePush(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=n.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,m=r.decode(i.slice(h,h+l));h=h+l;let g=r.decode(i.slice(h,h+u));h=h+u;let p=r.decode(i.slice(h,h+d));h=h+d;let w=i.slice(h,i.byteLength);return{join_ref:m,ref:null,topic:g,event:p,payload:w}},decodeReply(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=n.getUint8(3),h=n.getUint8(4),m=this.HEADER_LENGTH+this.META_LENGTH,g=r.decode(i.slice(m,m+l));m=m+l;let p=r.decode(i.slice(m,m+u));m=m+u;let w=r.decode(i.slice(m,m+d));m=m+d;let b=r.decode(i.slice(m,m+h));m=m+h;let T=i.slice(m,i.byteLength),S={status:b,response:T};return{join_ref:g,ref:p,topic:w,event:na.reply,payload:S}},decodeBroadcast(i,n,r){let l=n.getUint8(1),u=n.getUint8(2),d=this.HEADER_LENGTH+2,h=r.decode(i.slice(d,d+l));d=d+l;let m=r.decode(i.slice(d,d+u));d=d+u;let g=i.slice(d,i.byteLength);return{join_ref:null,ref:null,topic:h,event:m,payload:g}}},_b=class{constructor(i,n={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=n.timeout||pb,this.transport=n.transport||kn.WebSocket||lr,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=n.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=kn&&kn.sessionStorage}catch{}this.sessionStore=n.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=yo.encode.bind(yo),this.defaultDecoder=yo.decode.bind(yo),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=n.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==lr?(this.encode=n.encode||this.defaultEncoder,this.decode=n.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let l=null;yr&&yr.addEventListener&&(yr.addEventListener("pagehide",u=>{this.conn&&(this.disconnect(),l=this.connectClock)}),yr.addEventListener("pageshow",u=>{l===this.connectClock&&(l=null,this.connect())}),yr.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=n.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=n.autoSendHeartbeat??!0,this.heartbeatCallback=n.heartbeatCallback??(()=>{}),this.rejoinAfterMs=u=>n.rejoinAfterMs?n.rejoinAfterMs(u):[1e3,2e3,5e3][u-1]||1e4,this.reconnectAfterMs=u=>n.reconnectAfterMs?n.reconnectAfterMs(u):[10,50,100,150,200,250,500,1e3,2e3][u-1]||5e3,this.logger=n.logger||null,!this.logger&&n.debug&&(this.logger=(u,d,h)=>{console.log(`${u}: ${d}`,h)}),this.longpollerTimeout=n.longpollerTimeout||2e4,this.params=Ds(n.params||{}),this.endPoint=`${i}/${bd.websocket}`,this.vsn=n.vsn||gb,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Sp(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{n.beforeReconnect&&await n.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=n.authToken}getLongPollTransport(){return lr}replaceTransport(i){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=i}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let i=Ao.appendParams(Ao.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return i.charAt(0)!=="/"?i:i.charAt(1)==="/"?`${this.protocol()}:${i}`:`${this.protocol()}://${location.host}${i}`}disconnect(i,n,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,i&&i()},n,r)}connect(i){i&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ds(i)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==lr?this.connectWithFallback(lr,this.longPollFallbackMs):this.transportConnect())}log(i,n,r){this.logger&&this.logger(i,n,r)}hasLogger(){return this.logger!==null}onOpen(i){let n=this.makeRef();return this.stateChangeCallbacks.open.push([n,i]),n}onClose(i){let n=this.makeRef();return this.stateChangeCallbacks.close.push([n,i]),n}onError(i){let n=this.makeRef();return this.stateChangeCallbacks.error.push([n,i]),n}onMessage(i){let n=this.makeRef();return this.stateChangeCallbacks.message.push([n,i]),n}onHeartbeat(i){this.heartbeatCallback=i}ping(i){if(!this.isConnected())return!1;let n=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:n});let l=this.onMessage(u=>{u.ref===n&&(this.off([l]),i(Date.now()-r))});return!0}transportName(i){return i===lr?"LongPoll":i.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let i;this.authToken&&(i=["phoenix",`${wd}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),i),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,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)}getSession(i){return this.sessionStore&&this.sessionStore.getItem(i)}storeSession(i,n){this.sessionStore&&this.sessionStore.setItem(i,n)}connectWithFallback(i,n=2500){clearTimeout(this.fallbackTimer);let r=!1,l=!0,u,d,h=this.transportName(i),m=g=>{this.log("transport",`falling back to ${h}...`,g),this.off([u,d]),l=!1,this.replaceTransport(i),this.transportConnect()};if(this.getSession(`phx:fallback:${h}`))return m("memorized");this.fallbackTimer=setTimeout(m,n),d=this.onError(g=>{this.log("transport","error",g),l&&!r&&(clearTimeout(this.fallbackTimer),m(g))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!l){let g=this.transportName(i);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${g}`,"true"),this.log("transport",`established ${g} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(m,n),this.ping(g=>{this.log("transport","connected to primary after",g),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(i){this.log("error","error in heartbeat callback",i)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),yb,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(i,n,r){if(!this.conn)return i&&i();const l=this.conn;this.waitForBufferDone(l,()=>{n?l.close(n,r||""):l.close(),this.waitForSocketClosed(l,()=>{this.conn===l&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),i&&i()})})}waitForBufferDone(i,n,r=1){if(r===5||!i.bufferedAmount){n();return}setTimeout(()=>{this.waitForBufferDone(i,n,r+1)},150*r)}waitForSocketClosed(i,n,r=1){if(r===5||i.readyState===En.closed){n();return}setTimeout(()=>{this.waitForSocketClosed(i,n,r+1)},150*r)}onConnClose(i){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",i),this.triggerChanError(i),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",i)}onConnError(i){this.hasLogger()&&this.log("transport","error",i);let n=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",i,n,r),(n===this.transport||r>0)&&this.triggerChanError(i)}triggerChanError(i){this.channels.forEach(n=>{n.isErrored()||n.isLeaving()||n.isClosed()||n.trigger(na.error,i)})}connectionState(){switch(this.conn&&this.conn.readyState){case En.connecting:return"connecting";case En.open:return"open";case En.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(i){this.off(i.stateChangeRefs),this.channels=this.channels.filter(n=>n!==i)}off(i){for(let n in this.stateChangeCallbacks)this.stateChangeCallbacks[n]=this.stateChangeCallbacks[n].filter(([r])=>i.indexOf(r)===-1)}channel(i,n={}){let r=new bb(i,n,this);return this.channels.push(r),r}push(i){if(this.hasLogger()){let{topic:n,event:r,payload:l,ref:u,join_ref:d}=i;this.log("push",`${n} ${r} (${d}, ${u})`,l)}this.isConnected()?this.encode(i,n=>this.conn.send(n)):this.sendBuffer.push(()=>this.encode(i,n=>this.conn.send(n)))}makeRef(){let i=this.ref+1;return i===this.ref?this.ref=0:this.ref=i,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(i){this.log("error","error in heartbeat callback",i)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(i){this.log("error","error in heartbeat callback",i)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(i=>i()),this.sendBuffer=[])}onConnMessage(i){this.decode(i.data,n=>{let{topic:r,event:l,payload:u,ref:d,join_ref:h}=n;if(d&&d===this.pendingHeartbeatRef){const m=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(u.status==="ok"?"ok":"error",m)}catch(g){this.log("error","error in heartbeat callback",g)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${u.status||""} ${r} ${l} ${d&&"("+d+")"||""}`.trim(),u);for(let m=0;m<this.channels.length;m++){const g=this.channels[m];g.isMember(r,l,u,h)&&g.trigger(l,u,d,h)}this.triggerStateCallbacks("message",n)})}triggerStateCallbacks(i,...n){try{this.stateChangeCallbacks[i].forEach(([r,l])=>{try{l(...n)}catch(u){this.log("error",`error in ${i} callback`,u)}})}catch(r){this.log("error",`error triggering ${i} callbacks`,r)}}leaveOpenTopic(i){let n=this.channels.find(r=>r.topic===i&&(r.isJoined()||r.isJoining()));n&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${i}"`),n.leave())}};class Us{constructor(n,r){const l=kb(r);this.presence=new Sb(n.getChannel(),l),this.presence.onJoin((u,d,h)=>{const m=Us.onJoinPayload(u,d,h);n.getChannel().trigger("presence",m)}),this.presence.onLeave((u,d,h)=>{const m=Us.onLeavePayload(u,d,h);n.getChannel().trigger("presence",m)}),this.presence.onSync(()=>{n.getChannel().trigger("presence",{event:"sync"})})}get state(){return Us.transformState(this.presence.state)}static transformState(n){return n=Tb(n),Object.getOwnPropertyNames(n).reduce((r,l)=>{const u=n[l];return r[l]=ko(u),r},{})}static onJoinPayload(n,r,l){const u=Lg(r),d=ko(l);return{event:"join",key:n,currentPresences:u,newPresences:d}}static onLeavePayload(n,r,l){const u=Lg(r),d=ko(l);return{event:"leave",key:n,currentPresences:u,leftPresences:d}}}function ko(i){return i.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n))}function Tb(i){return JSON.parse(JSON.stringify(i))}function kb(i){return i?.events&&{events:i.events}}function Lg(i){return i?.metas?ko(i):[]}var Dg;(function(i){i.SYNC="sync",i.JOIN="join",i.LEAVE="leave"})(Dg||(Dg={}));class Eb{get state(){return this.presenceAdapter.state}constructor(n,r){this.channel=n,this.presenceAdapter=new Us(this.channel.channelAdapter,r)}}function Ab(i){if(i instanceof Error)return i;if(typeof i=="string")return new Error(i);if(i&&typeof i=="object"){const n=i;if(typeof n.code=="number"){const r=typeof n.reason=="string"&&n.reason?` (${n.reason})`:"";return new Error(`socket closed: ${n.code}${r}`,{cause:i})}return new Error("channel error: transport failure",{cause:i})}return new Error("channel error: connection lost")}class Cb{constructor(n,r,l){const u=xb(l);this.channel=n.getSocket().channel(r,u),this.socket=n}get state(){return this.channel.state}set state(n){this.channel.state=n}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(n,r){return this.channel.on(n,r)}off(n,r){this.channel.off(n,r)}subscribe(n){return this.channel.join(n)}unsubscribe(n){return this.channel.leave(n)}teardown(){this.channel.teardown()}onClose(n){this.channel.onClose(n)}onError(n){return this.channel.onError(n)}push(n,r,l){let u;try{u=this.channel.push(n,r,l)}catch{throw new Error(`tried to push '${n}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>sb){const d=this.channel.pushBuffer.shift();d.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${d.event}`,d.payload())}return u}updateJoinPayload(n){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),n)}canPush(){return this.socket.isConnected()&&this.state===Ha.joined}isJoined(){return this.state===Ha.joined}isJoining(){return this.state===Ha.joining}isClosed(){return this.state===Ha.closed}isLeaving(){return this.state===Ha.leaving}updateFilterBindings(n){this.channel.filterBindings=n}updatePayloadTransform(n){this.channel.onMessage=n}getChannel(){return this.channel}}function xb(i){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config)}}const Ob=/[,()"\\]/,Rb=i=>Ob.test(i)||i!==i.trim(),jb=i=>`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Ug=i=>{const n=i===null?"null":String(i);return Rb(n)?jb(n):n},Nb=i=>i===null?"null":String(i),Lb=(i,n)=>{if(i==="in"){const r=Array.isArray(n)?n:[n];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(u=>Ug(u)).join(",")})`}return i==="is"?`is.${Nb(n)}`:`${i}.${Ug(n)}`};class Db{constructor(){this.filters=[]}add(n,r,l,u=!1){const d=u?"not.":"";return this.filters.push(`${n}=${d}${Lb(r,l)}`),this}eq(n,r){return this.add(n,"eq",r)}neq(n,r){return this.add(n,"neq",r)}gt(n,r){return this.add(n,"gt",r)}gte(n,r){return this.add(n,"gte",r)}lt(n,r){return this.add(n,"lt",r)}lte(n,r){return this.add(n,"lte",r)}in(n,r){return this.add(n,"in",r)}like(n,r){return this.add(n,"like",r)}ilike(n,r){return this.add(n,"ilike",r)}match(n,r){return this.add(n,"match",r)}imatch(n,r){return this.add(n,"imatch",r)}is(n,r){return this.add(n,"is",r)}isDistinct(n,r){return this.add(n,"isdistinct",r)}not(n,r,l){return this.add(n,r,l,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var Mg;(function(i){i.ALL="*",i.INSERT="INSERT",i.UPDATE="UPDATE",i.DELETE="DELETE"})(Mg||(Mg={}));var wr;(function(i){i.BROADCAST="broadcast",i.PRESENCE="presence",i.POSTGRES_CHANGES="postgres_changes",i.SYSTEM="system"})(wr||(wr={}));var aa;(function(i){i.SUBSCRIBED="SUBSCRIBED",i.TIMED_OUT="TIMED_OUT",i.CLOSED="CLOSED",i.CHANNEL_ERROR="CHANNEL_ERROR"})(aa||(aa={}));class Ms{get state(){return this.channelAdapter.state}set state(n){this.channelAdapter.state=n}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(n,r={config:{}},l){var u,d;if(this.topic=n,this.params=r,this.socket=l,this.bindings={},this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new Cb(this.socket.socketAdapter,n,this.params),this.presence=new Eb(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=wp(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((d=(u=this.params.config)===null||u===void 0?void 0:u.broadcast)===null||d===void 0)&&d.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(n,r=this.timeout){var l,u,d;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:h,presence:m,private:g}}=this.params,p=(u=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(S=>S.filter))!==null&&u!==void 0?u:[],w=!!this.bindings[wr.PRESENCE]&&this.bindings[wr.PRESENCE].length>0||((d=this.params.config.presence)===null||d===void 0?void 0:d.enabled)===!0,b={},T={broadcast:h,presence:Object.assign(Object.assign({},m),{enabled:w}),postgres_changes:p,private:g};this.socket.accessTokenValue&&(b.access_token=this.socket.accessTokenValue),this._onError(S=>{n?.(aa.CHANNEL_ERROR,Ab(S))}),this._onClose(()=>n?.(aa.CLOSED)),this.updateJoinPayload(Object.assign({config:T},b)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:S})=>{if(this.socket._isManualToken()||this.socket.setAuth(),S===void 0){n?.(aa.SUBSCRIBED);return}this._updatePostgresBindings(S,n)}).receive("error",S=>{this.state=Ha.errored;const x=Object.values(S).join(", ")||"error";n?.(aa.CHANNEL_ERROR,new Error(x,{cause:S}))}).receive("timeout",()=>{n?.(aa.TIMED_OUT)})}return this}_updatePostgresBindings(n,r){var l;const u=this.bindings.postgres_changes,d=(l=u?.length)!==null&&l!==void 0?l:0,h=[];for(let m=0;m<d;m++){const g=u[m],{filter:{event:p,schema:w,table:b,filter:T}}=g,S=n&&n[m];if(S&&S.event===p&&Ms.isFilterValueEqual(S.schema,w)&&Ms.isFilterValueEqual(S.table,b)&&Ms.isFilterValueEqual(S.filter,T))h.push(Object.assign(Object.assign({},g),{id:S.id}));else{this.unsubscribe(),this.state=Ha.errored,r?.(aa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=h,this.state!=Ha.errored&&r&&r(aa.SUBSCRIBED)}presenceState(){return this.presence.state}async track(n,r={}){return await this.send({type:"presence",event:"track",payload:n},r.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,r,l){const u=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),d=n===wr.PRESENCE||n===wr.POSTGRES_CHANGES;if(u&&d)throw this.socket.log("channel",`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${n}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(n,r,l)}async httpSend(n,r,l={}){var u;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const d=r instanceof ArrayBuffer||ArrayBuffer.isView(r),h={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":d?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(h.Authorization=`Bearer ${this.socket.accessTokenValue}`);const m=new URL(this.broadcastEndpointURL);m.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(n)}`,this.private&&m.searchParams.set("private","true");const g={method:"POST",headers:h,body:d?r:JSON.stringify(r)},p=await this._fetchWithTimeout(m.toString(),g,(u=l.timeout)!==null&&u!==void 0?u:this.timeout);if(p.status===202)return{success:!0};if(p.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let w=p.statusText;try{const b=await p.json();w=b.error||b.message||w}catch{}return Promise.reject(new Error(w))}async send(n,r={}){var l,u;if(!this.channelAdapter.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:d,payload:h}=n,m={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(m.Authorization=`Bearer ${this.socket.accessTokenValue}`);const g={method:"POST",headers:m,body:JSON.stringify({messages:[{topic:this.subTopic,event:d,payload:h,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,g,(l=r.timeout)!==null&&l!==void 0?l:this.timeout);return await((u=p.body)===null||u===void 0?void 0:u.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(d=>{var h,m,g;const p=this.channelAdapter.push(n.type,n,r.timeout||this.timeout);n.type==="broadcast"&&!(!((g=(m=(h=this.params)===null||h===void 0?void 0:h.config)===null||m===void 0?void 0:m.broadcast)===null||g===void 0)&&g.ack)&&d("ok"),p.receive("ok",()=>d("ok")),p.receive("error",()=>d("error")),p.receive("timeout",()=>d("timed out"))})}updateJoinPayload(n){this.channelAdapter.updateJoinPayload(n)}async unsubscribe(n=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(n).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(n,r,l){const u=new AbortController,d=setTimeout(()=>u.abort(),l),h=await this.socket.fetch(n,Object.assign(Object.assign({},r),{signal:u.signal}));return clearTimeout(d),h}_on(n,r,l){const u=n.toLocaleLowerCase(),d=r?.filter;(d instanceof Db||typeof d=="object"&&d!==null&&typeof d.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:d.build()}));const h=this.channelAdapter.on(n,l),m={type:u,filter:r,callback:l,ref:h};return this.bindings[u]?this.bindings[u].push(m):this.bindings[u]=[m],this._updateFilterMessage(),this}_onClose(n){this.channelAdapter.onClose(n)}_onError(n){this.channelAdapter.onError(n)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((n,r,l)=>{var u,d,h,m,g,p,w;const b=n.event.toLocaleLowerCase();if(this._notThisChannelEvent(b,l))return!1;const T=(u=this.bindings[b])===null||u===void 0?void 0:u.find(S=>S.ref===n.ref);if(!T)return!0;if(["broadcast","presence","postgres_changes"].includes(b))if("id"in T){const S=T.id,x=(d=T.filter)===null||d===void 0?void 0:d.event;return S&&((h=r.ids)===null||h===void 0?void 0:h.includes(S))&&(x==="*"||x?.toLocaleLowerCase()===((m=r.data)===null||m===void 0?void 0:m.type.toLocaleLowerCase()))}else{const S=(p=(g=T?.filter)===null||g===void 0?void 0:g.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return S==="*"||S===((w=r?.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return T.type.toLocaleLowerCase()===b})}_notThisChannelEvent(n,r){const{close:l,error:u,leave:d,join:h}=vp;return r&&[l,u,d,h].includes(n)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((n,r,l)=>{if(typeof r=="object"&&"ids"in r){const u=r.data,{schema:d,table:h,commit_timestamp:m,type:g,errors:p}=u;return Object.assign(Object.assign({},{schema:d,table:h,commit_timestamp:m,eventType:g,new:{},old:{},errors:p}),this._getPayloadRecords(u))}return r})}copyBindings(n){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in n.bindings)for(const l of n.bindings[r])this._on(l.type,l.filter,l.callback)}static isFilterValueEqual(n,r){return(n??void 0)===(r??void 0)}_getPayloadRecords(n){const r={new:{},old:{}};return(n.type==="INSERT"||n.type==="UPDATE")&&(r.new=Ng(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(r.old=Ng(n.columns,n.old_record)),r}}class Ub{constructor(n,r){this.socket=new _b(n,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(n){this.socket.heartbeatCallback=n}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(n,r,l,u=1e4){return new Promise(d=>{setTimeout(()=>d("timeout"),u),this.socket.disconnect(()=>{n(),d("ok")},r,l)})}push(n){this.socket.push(n)}log(n,r,l){this.socket.log(n,r,l)}makeRef(){return this.socket.makeRef()}onOpen(n){this.socket.onOpen(n)}onClose(n){this.socket.onClose(n)}onError(n){this.socket.onError(n)}onMessage(n){this.socket.onMessage(n)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==yd.connecting}isDisconnecting(){return this.socket.connectionState()==yd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const zg={HEARTBEAT_INTERVAL:25e3},Mb=[1e3,2e3,5e3,1e4],zb=1e4;function Bb(){const i=new Map;return{get length(){return i.size},clear(){i.clear()},getItem(n){return i.has(n)?i.get(n):null},key(n){var r;return(r=Array.from(i.keys())[n])!==null&&r!==void 0?r:null},removeItem(n){i.delete(n)},setItem(n,r){i.set(n,String(r))}}}function Hb(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Bb()}const $b=`
|
|
16
|
-
addEventListener("message", (e) => {
|
|
17
|
-
if (e.data.event === "start") {
|
|
18
|
-
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
19
|
-
}
|
|
20
|
-
});`;class qb{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(n,r){var l;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new lb,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=d=>d?(...h)=>d(...h):(...h)=>fetch(...h),!(!((l=r?.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const u=this._initializeOptions(r);this.socketAdapter=new Ub(n,u),this.httpEndpoint=wp(n),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(n){const r=n.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(n,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},n,r)}getChannels(){return this.channels}async removeChannel(n){const r=await n.unsubscribe();return r==="ok"&&n.teardown(),r}async removeAllChannels(){const n=this.channels.map(async l=>{const u=await l.unsubscribe();return l.teardown(),u}),r=await Promise.all(n);return await this.disconnect(),r}log(n,r,l){this.socketAdapter.log(n,r,l)}connectionState(){return this.socketAdapter.connectionState()||yd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(n,r={config:{}}){const l=`realtime:${n}`,u=this.getChannels().find(d=>d.topic===l);if(u)return u;{const d=new Ms(`realtime:${n}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(d),d}}push(n){this.socketAdapter.push(n)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(n){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(n)}_makeRef(){return this.socketAdapter.makeRef()}_remove(n){this.channels=this.channels.filter(r=>r.topic!==n.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(n=null){let r,l=!1;if(n)r=n,l=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(u){this.log("error","Error fetching access token from callback",u),r=this.accessTokenValue}else r=this.accessTokenValue;l?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(u=>{const d={access_token:r,version:nb};r&&u.updateJoinPayload(d),u.joinedOnce&&u.channelAdapter.isJoined()&&u.channelAdapter.push(vp.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${n}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(n=>{n.ref&&n.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(n){return(r,l)=>{r=="sent"&&this._setAuthSafely(),n&&n(r,l)}}_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=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(n){let r;if(n)r=n;else{const l=new Blob([$b],{type:"application/javascript"});r=URL.createObjectURL(l)}return r}_initializeOptions(n){var r,l,u,d,h,m,g,p,w,b,T,S;this.worker=(r=n?.worker)!==null&&r!==void 0?r:!1,this.accessToken=(l=n?.accessToken)!==null&&l!==void 0?l:null;const x={};x.timeout=(u=n?.timeout)!==null&&u!==void 0?u:rb,x.heartbeatIntervalMs=(d=n?.heartbeatIntervalMs)!==null&&d!==void 0?d:zg.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(h=n?.disconnectOnEmptyChannelsAfterMs)!==null&&h!==void 0?h:2*((m=n?.heartbeatIntervalMs)!==null&&m!==void 0?m:zg.HEARTBEAT_INTERVAL),x.transport=(g=n?.transport)!==null&&g!==void 0?g:eb.getWebSocketConstructor(),x.params=n?.params,x.logger=n?.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(n?.heartbeatCallback),x.sessionStorage=(p=n?.sessionStorage)!==null&&p!==void 0?p:Hb(),x.reconnectAfterMs=(w=n?.reconnectAfterMs)!==null&&w!==void 0?w:(H=>Mb[H-1]||zb);let O,I;const $=(b=n?.vsn)!==null&&b!==void 0?b:ib;switch($){case ab:O=(H,q)=>q(JSON.stringify(H)),I=(H,q)=>q(JSON.parse(H));break;case yp:O=this.serializer.encode.bind(this.serializer),I=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=$,x.encode=(T=n?.encode)!==null&&T!==void 0?T:O,x.decode=(S=n?.decode)!==null&&S!==void 0?S:I,x.beforeReconnect=this._reconnectAuth.bind(this),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var qs=class extends Error{constructor(i,n){super(i),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 Pb(i,n,r){const l=new URL(n,i);if(r)for(const[u,d]of Object.entries(r))d!==void 0&&l.searchParams.set(u,d);return l.toString()}async function Ib(i){return!i||i.type==="none"?{}:i.type==="bearer"?{Authorization:`Bearer ${i.token}`}:i.type==="header"?{[i.name]:i.value}:i.type==="custom"?await i.getHeaders():{}}function Gb(i){const n=i.fetchImpl??globalThis.fetch;return{async request({method:r,path:l,query:u,body:d,headers:h}){const m=Pb(i.baseUrl,l,u),g=await Ib(i.auth),p=await n(m,{method:r,headers:{...d?{"Content-Type":"application/json"}:{},...g,...h},body:d?JSON.stringify(d):void 0}),w=await p.text(),b=(p.headers.get("content-type")||"").includes("application/json"),T=b&&w?JSON.parse(w):w;if(!p.ok){const S=b?T:void 0,x=S?.error;throw new qs(x?.message??`Request failed with status ${p.status}`,{status:p.status,icebergType:x?.type,icebergCode:x?.code,details:S})}return{status:p.status,headers:p.headers,data:T}}}}function vo(i){return i.join("")}var Vb=class{constructor(i,n=""){this.client=i,this.prefix=n}async listNamespaces(i){const n=i?{parent:vo(i.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(i,n){const r={namespace:i.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(i){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${vo(i.namespace)}`})}async loadNamespaceMetadata(i){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${vo(i.namespace)}`})).data.properties}}async namespaceExists(i){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${vo(i.namespace)}`}),!0}catch(n){if(n instanceof qs&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(i,n){try{return await this.createNamespace(i,n)}catch(r){if(r instanceof qs&&r.status===409)return;throw r}}};function or(i){return i.join("")}var Kb=class{constructor(i,n="",r){this.client=i,this.prefix=n,this.accessDelegation=r}async listTables(i){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables`})).data.identifiers}async createTable(i,n){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables`,body:n,headers:r})).data.metadata}async updateTable(i,n){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables/${i.name}`,body:n});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(i,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables/${i.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(i){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables/${i.name}`,headers:n})).data.metadata}async tableExists(i){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${or(i.namespace)}/tables/${i.name}`,headers:n}),!0}catch(r){if(r instanceof qs&&r.status===404)return!1;throw r}}async createTableIfNotExists(i,n){try{return await this.createTable(i,n)}catch(r){if(r instanceof qs&&r.status===409)return await this.loadTable({namespace:i.namespace,name:n.name});throw r}}},Yb=class{constructor(i){let n="v1";i.catalogName&&(n+=`/${i.catalogName}`);const r=i.baseUrl.endsWith("/")?i.baseUrl:`${i.baseUrl}/`;this.client=Gb({baseUrl:r,auth:i.auth,fetchImpl:i.fetch}),this.accessDelegation=i.accessDelegation?.join(","),this.namespaceOps=new Vb(this.client,n),this.tableOps=new Kb(this.client,n,this.accessDelegation)}async listNamespaces(i){return this.namespaceOps.listNamespaces(i)}async createNamespace(i,n){return this.namespaceOps.createNamespace(i,n)}async dropNamespace(i){await this.namespaceOps.dropNamespace(i)}async loadNamespaceMetadata(i){return this.namespaceOps.loadNamespaceMetadata(i)}async listTables(i){return this.tableOps.listTables(i)}async createTable(i,n){return this.tableOps.createTable(i,n)}async updateTable(i,n){return this.tableOps.updateTable(i,n)}async dropTable(i,n){await this.tableOps.dropTable(i,n)}async loadTable(i){return this.tableOps.loadTable(i)}async namespaceExists(i){return this.namespaceOps.namespaceExists(i)}async tableExists(i){return this.tableOps.tableExists(i)}async createNamespaceIfNotExists(i,n){return this.namespaceOps.createNamespaceIfNotExists(i,n)}async createTableIfNotExists(i,n){return this.tableOps.createTableIfNotExists(i,n)}};function Ps(i){"@babel/helpers - typeof";return Ps=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},Ps(i)}function Jb(i,n){if(Ps(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if(Ps(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function Xb(i){var n=Jb(i,"string");return Ps(n)=="symbol"?n:n+""}function Qb(i,n,r){return(n=Xb(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function Bg(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function re(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Bg(Object(r),!0).forEach(function(l){Qb(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Bg(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}var Uo=class extends Error{constructor(i,n="storage",r,l){super(i),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=l}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Mo(i){return typeof i=="object"&&i!==null&&"__isStorageError"in i}var Sd=class extends Uo{constructor(i,n,r,l="storage"){super(i,l,n,r),this.name=l==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=r}toJSON(){return re({},super.toJSON())}},_p=class extends Uo{constructor(i,n,r="storage"){super(i,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};function Co(i,n,r){const l=re({},i),u=n.toLowerCase();for(const d of Object.keys(l))d.toLowerCase()===u&&delete l[d];return l[u]=r,l}function Zb(i){const n={};for(const[r,l]of Object.entries(i))n[r.toLowerCase()]=l;return n}const Wb=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),Fb=i=>{if(typeof i!="object"||i===null)return!1;const n=Object.getPrototypeOf(i);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},_d=i=>{if(Array.isArray(i))return i.map(r=>_d(r));if(typeof i=="function"||i!==Object(i))return i;const n={};return Object.entries(i).forEach(([r,l])=>{const u=r.replace(/([-_][a-z])/gi,d=>d.toUpperCase().replace(/[-_]/g,""));n[u]=_d(l)}),n},ew=i=>!i||typeof i!="string"||i.length===0||i.length>100||i.trim()!==i||i.includes("/")||i.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(i),Hg=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error;if(typeof n.error=="object"&&n.error!==null){const r=n.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(i)},tw=async(i,n,r,l)=>{if(i!==null&&typeof i=="object"&&"json"in i&&typeof i.json=="function"){const u=i;let d=parseInt(String(u.status),10);Number.isFinite(d)||(d=500),u.json().then(h=>{const m=h?.statusCode||h?.code||d+"";n(new Sd(Hg(h),d,m,l))}).catch(()=>{const h=d+"";n(new Sd(u.statusText||`HTTP ${d} error`,d,h,l))})}else n(new _p(Hg(i),i,l))},nw=(i,n,r,l)=>{const u={method:i,headers:n?.headers||{}};if(i==="GET"||i==="HEAD"||!l)return re(re({},u),r);if(Fb(l)){var d;const h=n?.headers||{};let m;for(const[g,p]of Object.entries(h))g.toLowerCase()==="content-type"&&(m=p);u.headers=Co(h,"Content-Type",(d=m)!==null&&d!==void 0?d:"application/json"),u.body=JSON.stringify(l)}else u.body=l;return n?.duplex&&(u.duplex=n.duplex),re(re({},u),r)};async function Cs(i,n,r,l,u,d,h){return new Promise((m,g)=>{i(r,nw(n,l,u,d)).then(p=>{if(!p.ok)throw p;if(l?.noResolveJson)return p;if(h==="vectors"){const w=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!w||!w.includes("application/json"))return{}}return p.json()}).then(p=>m(p)).catch(p=>tw(p,g,l,h))})}function Tp(i="storage"){return{get:async(n,r,l,u)=>Cs(n,"GET",r,l,u,void 0,i),post:async(n,r,l,u,d)=>Cs(n,"POST",r,u,d,l,i),put:async(n,r,l,u,d)=>Cs(n,"PUT",r,u,d,l,i),head:async(n,r,l,u)=>Cs(n,"HEAD",r,re(re({},l),{},{noResolveJson:!0}),u,void 0,i),remove:async(n,r,l,u,d)=>Cs(n,"DELETE",r,u,d,l,i)}}const aw=Tp("storage"),{get:Is,post:pn,put:Td,head:iw,remove:Gs}=aw,Kt=Tp("vectors");var Tr=class{constructor(i,n={},r,l="storage"){this.shouldThrowOnError=!1,this.url=i,this.headers=Zb(n),this.fetch=Wb(r),this.namespace=l}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,n){return this.headers=Co(this.headers,i,n),this}async handleOperation(i){var n=this;try{return{data:await i(),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Mo(r))return{data:null,error:r};throw r}}};let kp;kp=Symbol.toStringTag;var rw=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[kp]="StreamDownloadBuilder",this.promise=null}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:(await i.downloadFn()).body,error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(Mo(n))return{data:null,error:n};throw n}}};let Ep;Ep=Symbol.toStringTag;var sw=class{constructor(i,n){this.downloadFn=i,this.shouldThrowOnError=n,this[Ep]="BlobDownloadBuilder",this.promise=null}asStream(){return new rw(this.downloadFn,this.shouldThrowOnError)}then(i,n){return this.getPromise().then(i,n)}catch(i){return this.getPromise().catch(i)}finally(i){return this.getPromise().finally(i)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var i=this;try{return{data:await(await i.downloadFn()).blob(),error:null}}catch(n){if(i.shouldThrowOnError)throw n;if(Mo(n))return{data:null,error:n};throw n}}};const ad={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},$g={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var lw=class extends Tr{constructor(i,n={},r,l){super(i,n,l,"storage"),this.bucketId=r}async uploadOrUpdate(i,n,r,l){var u=this;return u.handleOperation(async()=>{let d;const h=re(re({},$g),l);let m=re(re({},u.headers),i==="POST"&&{"x-upsert":String(h.upsert)});const g=h.metadata;if(typeof Blob<"u"&&r instanceof Blob?(d=new FormData,d.append("cacheControl",h.cacheControl),g&&d.append("metadata",u.encodeMetadata(g)),d.append("",r)):typeof FormData<"u"&&r instanceof FormData?(d=r,d.has("cacheControl")||d.append("cacheControl",h.cacheControl),g&&!d.has("metadata")&&d.append("metadata",u.encodeMetadata(g))):(d=r,m["cache-control"]=`max-age=${h.cacheControl}`,m["content-type"]=h.contentType,g&&(m["x-metadata"]=u.toBase64(u.encodeMetadata(g))),(typeof ReadableStream<"u"&&d instanceof ReadableStream||d&&typeof d=="object"&&"pipe"in d&&typeof d.pipe=="function")&&!h.duplex&&(h.duplex="half")),l?.headers)for(const[T,S]of Object.entries(l.headers))m=Co(m,T,S);const p=u._removeEmptyFolders(n),w=u._getFinalPath(p),b=await(i=="PUT"?Td:pn)(u.fetch,`${u.url}/object/${w}`,d,re({headers:m},h?.duplex?{duplex:h.duplex}:{}));return{path:p,id:b.Id,fullPath:b.Key}})}async upload(i,n,r){return this.uploadOrUpdate("POST",i,n,r)}async uploadToSignedUrl(i,n,r,l){var u=this;const d=u._removeEmptyFolders(i),h=u._getFinalPath(d),m=new URL(u.url+`/object/upload/sign/${h}`);return m.searchParams.set("token",n),u.handleOperation(async()=>{let g;const p=re(re({},$g),l);let w=re(re({},u.headers),{"x-upsert":String(p.upsert)});const b=p.metadata;if(typeof Blob<"u"&&r instanceof Blob?(g=new FormData,g.append("cacheControl",p.cacheControl),b&&g.append("metadata",u.encodeMetadata(b)),g.append("",r)):typeof FormData<"u"&&r instanceof FormData?(g=r,g.has("cacheControl")||g.append("cacheControl",p.cacheControl),b&&!g.has("metadata")&&g.append("metadata",u.encodeMetadata(b))):(g=r,w["cache-control"]=`max-age=${p.cacheControl}`,w["content-type"]=p.contentType,b&&(w["x-metadata"]=u.toBase64(u.encodeMetadata(b))),(typeof ReadableStream<"u"&&g instanceof ReadableStream||g&&typeof g=="object"&&"pipe"in g&&typeof g.pipe=="function")&&!p.duplex&&(p.duplex="half")),l?.headers)for(const[T,S]of Object.entries(l.headers))w=Co(w,T,S);return{path:d,fullPath:(await Td(u.fetch,m.toString(),g,re({headers:w},p?.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(i,n){var r=this;return r.handleOperation(async()=>{let l=r._getFinalPath(i);const u=re({},r.headers);n?.upsert&&(u["x-upsert"]="true");const d=await pn(r.fetch,`${r.url}/object/upload/sign/${l}`,{},{headers:u}),h=new URL(r.url+d.url),m=h.searchParams.get("token");if(!m)throw new Uo("No token returned by API");return{signedUrl:h.toString(),path:i,token:m}})}async update(i,n,r){return this.uploadOrUpdate("PUT",i,n,r)}async move(i,n,r){var l=this;return l.handleOperation(async()=>await pn(l.fetch,`${l.url}/object/move`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers}))}async copy(i,n,r){var l=this;return l.handleOperation(async()=>({path:(await pn(l.fetch,`${l.url}/object/copy`,{bucketId:l.bucketId,sourceKey:i,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers})).Key}))}async createSignedUrl(i,n,r){var l=this;return l.handleOperation(async()=>{let u=l._getFinalPath(i);const d=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let h=await pn(l.fetch,`${l.url}/object/sign/${u}`,re({expiresIn:n},d?{transform:r.transform}:{}),{headers:l.headers});const m=new URLSearchParams;r?.download&&m.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&m.set("cacheNonce",String(r.cacheNonce));const g=m.toString();return{signedUrl:encodeURI(`${l.url}${h.signedURL}${g?`&${g}`:""}`)}})}async createSignedUrls(i,n,r){var l=this;return l.handleOperation(async()=>{const u=await pn(l.fetch,`${l.url}/object/sign/${l.bucketId}`,{expiresIn:n,paths:i},{headers:l.headers}),d=new URLSearchParams;r?.download&&d.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&d.set("cacheNonce",String(r.cacheNonce));const h=d.toString();return u.map(m=>re(re({},m),{},{signedUrl:m.signedURL?encodeURI(`${l.url}${m.signedURL}${h?`&${h}`:""}`):null}))})}download(i,n,r){const l=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image/authenticated":"object",u=new URLSearchParams;n?.transform&&this.applyTransformOptsToQuery(u,n.transform),n?.cacheNonce!=null&&u.set("cacheNonce",String(n.cacheNonce));const d=u.toString(),h=this._getFinalPath(i),m=()=>Is(this.fetch,`${this.url}/${l}/${h}${d?`?${d}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new sw(m,this.shouldThrowOnError)}async info(i){var n=this;const r=n._getFinalPath(i);return n.handleOperation(async()=>_d(await Is(n.fetch,`${n.url}/object/info/${r}`,{headers:n.headers})))}async exists(i){var n=this;const r=n._getFinalPath(i);try{return await iw(n.fetch,`${n.url}/object/${r}`,{headers:n.headers}),{data:!0,error:null}}catch(u){if(n.shouldThrowOnError)throw u;if(Mo(u)){var l;const d=u instanceof Sd?u.status:u instanceof _p?(l=u.originalError)===null||l===void 0?void 0:l.status:void 0;if(d!==void 0&&[400,404].includes(d))return{data:!1,error:u}}throw u}}getPublicUrl(i,n){const r=this._getFinalPath(i),l=new URLSearchParams;n?.download&&l.set("download",n.download===!0?"":n.download),n?.transform&&this.applyTransformOptsToQuery(l,n.transform),n?.cacheNonce!=null&&l.set("cacheNonce",String(n.cacheNonce));const u=l.toString(),d=typeof n?.transform=="object"&&n.transform!==null&&Object.keys(n.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${d}/public/${r}`)+(u?`?${u}`:"")}}}async remove(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:i},{headers:n.headers}))}async purgeCache(i,n,r){var l=this;return l.handleOperation(async()=>{const u=l._getFinalPath(i),d=new URLSearchParams;n?.transformations&&d.set("transformations","true");const h=d.toString();return await Gs(l.fetch,`${l.url}/cdn/${u}${h?`?${h}`:""}`,{},{headers:l.headers},r)})}async list(i,n,r){var l=this;return l.handleOperation(async()=>{const u=n?.sortBy?re(re({},ad.sortBy),n.sortBy):ad.sortBy,d=re(re(re({},ad),n),{},{sortBy:u,prefix:i||""});return await pn(l.fetch,`${l.url}/object/list/${l.bucketId}`,d,{headers:l.headers},r)})}async listV2(i,n){var r=this;return r.handleOperation(async()=>{const l=re({},i);return await pn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,l,{headers:r.headers},n)})}encodeMetadata(i){return JSON.stringify(i)}toBase64(i){return typeof Buffer<"u"?Buffer.from(i).toString("base64"):btoa(i)}_getFinalPath(i){return`${this.bucketId}/${i.replace(/^\/+/,"")}`}_removeEmptyFolders(i){return i.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(i,n){return n.width&&i.set("width",n.width.toString()),n.height&&i.set("height",n.height.toString()),n.resize&&i.set("resize",n.resize),n.format&&i.set("format",n.format),n.quality&&i.set("quality",n.quality.toString()),i}};const ow="2.110.0",Js={"X-Client-Info":`storage-js/${ow}`};var uw=class extends Tr{constructor(i,n={},r,l){const u=new URL(i);l?.useNewHostname&&/supabase\.(co|in|red)$/.test(u.hostname)&&!u.hostname.includes("storage.supabase.")&&(u.hostname=u.hostname.replace("supabase.","storage.supabase."));const d=u.href.replace(/\/$/,""),h=re(re({},Js),n);super(d,h,r,"storage")}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const r=n.listBucketOptionsToQueryString(i);return await Is(n.fetch,`${n.url}/bucket${r}`,{headers:n.headers})})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Is(n.fetch,`${n.url}/bucket/${i}`,{headers:n.headers}))}async createBucket(i,n={public:!1}){var r=this;return r.handleOperation(async()=>await pn(r.fetch,`${r.url}/bucket`,{id:i,name:i,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async updateBucket(i,n){var r=this;return r.handleOperation(async()=>await Td(r.fetch,`${r.url}/bucket/${i}`,{id:i,name:i,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(i){var n=this;return n.handleOperation(async()=>await pn(n.fetch,`${n.url}/bucket/${i}/empty`,{},{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}async purgeBucketCache(i,n,r){var l=this;return l.handleOperation(async()=>{const u=new URLSearchParams;n?.transformations&&u.set("transformations","true");const d=u.toString();return await Gs(l.fetch,`${l.url}/cdn/${i}${d?`?${d}`:""}`,{},{headers:l.headers},r)})}listBucketOptionsToQueryString(i){const n={};return i&&("limit"in i&&(n.limit=String(i.limit)),"offset"in i&&(n.offset=String(i.offset)),i.search&&(n.search=i.search),i.sortColumn&&(n.sortColumn=i.sortColumn),i.sortOrder&&(n.sortOrder=i.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},cw=class extends Tr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=re(re({},Js),n);super(l,u,r,"storage")}async createBucket(i){var n=this;return n.handleOperation(async()=>await pn(n.fetch,`${n.url}/bucket`,{name:i},{headers:n.headers}))}async listBuckets(i){var n=this;return n.handleOperation(async()=>{const r=new URLSearchParams;i?.limit!==void 0&&r.set("limit",i.limit.toString()),i?.offset!==void 0&&r.set("offset",i.offset.toString()),i?.sortColumn&&r.set("sortColumn",i.sortColumn),i?.sortOrder&&r.set("sortOrder",i.sortOrder),i?.search&&r.set("search",i.search);const l=r.toString(),u=l?`${n.url}/bucket?${l}`:`${n.url}/bucket`;return await Is(n.fetch,u,{headers:n.headers})})}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Gs(n.fetch,`${n.url}/bucket/${i}`,{},{headers:n.headers}))}from(i){var n=this;if(!ew(i))throw new Uo("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new Yb({baseUrl:this.url,catalogName:i,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),l=this.shouldThrowOnError;return new Proxy(r,{get(u,d){const h=u[d];return typeof h!="function"?h:async(...m)=>{try{return{data:await h.apply(u,m),error:null}}catch(g){if(l)throw g;return{data:null,error:g}}}}})}},dw=class extends Tr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=re(re({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async createIndex(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/CreateIndex`,i,{headers:n.headers})||{})}async getIndex(i,n){var r=this;return r.handleOperation(async()=>await Kt.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:i,indexName:n},{headers:r.headers}))}async listIndexes(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/ListIndexes`,i,{headers:n.headers}))}async deleteIndex(i,n){var r=this;return r.handleOperation(async()=>await Kt.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:i,indexName:n},{headers:r.headers})||{})}},hw=class extends Tr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=re(re({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async putVectors(i){var n=this;if(i.vectors.length<1||i.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/PutVectors`,i,{headers:n.headers})||{})}async getVectors(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/GetVectors`,i,{headers:n.headers}))}async listVectors(i){var n=this;if(i.segmentCount!==void 0){if(i.segmentCount<1||i.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(i.segmentIndex!==void 0&&(i.segmentIndex<0||i.segmentIndex>=i.segmentCount))throw new Error(`segmentIndex must be between 0 and ${i.segmentCount-1}`)}return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/ListVectors`,i,{headers:n.headers}))}async queryVectors(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/QueryVectors`,i,{headers:n.headers}))}async deleteVectors(i){var n=this;if(i.keys.length<1||i.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/DeleteVectors`,i,{headers:n.headers})||{})}},fw=class extends Tr{constructor(i,n={},r){const l=i.replace(/\/$/,""),u=re(re({},Js),{},{"Content-Type":"application/json"},n);super(l,u,r,"vectors")}async createBucket(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}async getBucket(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:i},{headers:n.headers}))}async listBuckets(i={}){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/ListVectorBuckets`,i,{headers:n.headers}))}async deleteBucket(i){var n=this;return n.handleOperation(async()=>await Kt.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:i},{headers:n.headers})||{})}},mw=class extends fw{constructor(i,n={}){super(i,n.headers||{},n.fetch)}from(i){return new gw(this.url,this.headers,i,this.fetch)}async createBucket(i){var n=()=>super.createBucket,r=this;return n().call(r,i)}async getBucket(i){var n=()=>super.getBucket,r=this;return n().call(r,i)}async listBuckets(i={}){var n=()=>super.listBuckets,r=this;return n().call(r,i)}async deleteBucket(i){var n=()=>super.deleteBucket,r=this;return n().call(r,i)}},gw=class extends dw{constructor(i,n,r,l){super(i,n,l),this.vectorBucketName=r}async createIndex(i){var n=()=>super.createIndex,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(i={}){var n=()=>super.listIndexes,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(i){var n=()=>super.getIndex,r=this;return n().call(r,r.vectorBucketName,i)}async deleteIndex(i){var n=()=>super.deleteIndex,r=this;return n().call(r,r.vectorBucketName,i)}index(i){return new pw(this.url,this.headers,this.vectorBucketName,i,this.fetch)}},pw=class extends hw{constructor(i,n,r,l,u){super(i,n,u),this.vectorBucketName=r,this.indexName=l}async putVectors(i){var n=()=>super.putVectors,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(i){var n=()=>super.getVectors,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(i={}){var n=()=>super.listVectors,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(i){var n=()=>super.queryVectors,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(i){var n=()=>super.deleteVectors,r=this;return n().call(r,re(re({},i),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},yw=class extends uw{constructor(i,n={},r,l){super(i,n,r,l)}from(i){return new lw(this.url,this.headers,i,this.fetch)}get vectors(){return new mw(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new cw(this.url+"/iceberg",this.headers,this.fetch)}};const Ap="2.110.0",ia=30*1e3,Ns=3,id=Ns*ia,vw=2*ia,bw="http://localhost:9999",ww="supabase.auth.token",Sw={"X-Client-Info":`gotrue-js/${Ap}`},kd="X-Supabase-Api-Version",Cp={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},_w=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Tw=600*1e3;class Vs extends Error{constructor(n,r,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=l}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Y(i){return typeof i=="object"&&i!==null&&"__isAuthError"in i}class kw extends Vs{constructor(n,r,l){super(n,r,l),this.name="AuthApiError",this.status=r,this.code=l}}function Ew(i){return Y(i)&&i.name==="AuthApiError"}class yn extends Vs{constructor(n,r){super(n),this.name="AuthUnknownError",this.originalError=r}}class Cn extends Vs{constructor(n,r,l,u){super(n,l,u),this.name=r,this.status=l}}class gt extends Cn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function bo(i){return Y(i)&&i.name==="AuthSessionMissingError"}class ur extends Cn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class wo extends Cn{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class So extends Cn{constructor(n,r=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Aw(i){return Y(i)&&i.name==="AuthImplicitGrantRedirectError"}class qg extends Cn{constructor(n,r=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Cw extends Cn{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 Ed extends Cn{constructor(n,r){super(n,"AuthRetryableFetchError",r,void 0)}}function Pg(i){return Y(i)&&i.name==="AuthRetryableFetchError"}class Ig extends Cn{constructor(n="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(n,"AuthRefreshDiscardedError",409,void 0)}}function xw(i){return Y(i)&&i.name==="AuthRefreshDiscardedError"}class Gg extends Cn{constructor(n,r,l){super(n,"AuthWeakPasswordError",r,"weak_password"),this.reasons=l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class xo extends Cn{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const Oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Vg=`
|
|
21
|
-
\r=`.split(""),Ow=(()=>{const i=new Array(128);for(let n=0;n<i.length;n+=1)i[n]=-1;for(let n=0;n<Vg.length;n+=1)i[Vg[n].charCodeAt(0)]=-2;for(let n=0;n<Oo.length;n+=1)i[Oo[n].charCodeAt(0)]=n;return i})();function Kg(i,n,r){if(i!==null)for(n.queue=n.queue<<8|i,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(Oo[l]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(Oo[l]),n.queuedBits-=6}}function xp(i,n,r){const l=Ow[i];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)r(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(i)}"`)}}function Yg(i){const n=[],r=h=>{n.push(String.fromCodePoint(h))},l={utf8seq:0,codepoint:0},u={queue:0,queuedBits:0},d=h=>{Nw(h,l,r)};for(let h=0;h<i.length;h+=1)xp(i.charCodeAt(h),u,d);return n.join("")}function Rw(i,n){if(i<=127){n(i);return}else if(i<=2047){n(192|i>>6),n(128|i&63);return}else if(i<=65535){n(224|i>>12),n(128|i>>6&63),n(128|i&63);return}else if(i<=1114111){n(240|i>>18),n(128|i>>12&63),n(128|i>>6&63),n(128|i&63);return}throw new Error(`Unrecognized Unicode codepoint: ${i.toString(16)}`)}function jw(i,n){for(let r=0;r<i.length;r+=1){let l=i.charCodeAt(r);if(l>55295&&l<=56319){const u=(l-55296)*1024&65535;l=(i.charCodeAt(r+1)-56320&65535|u)+65536,r+=1}Rw(l,n)}}function Nw(i,n,r){if(n.utf8seq===0){if(i<=127){r(i);return}for(let l=1;l<6;l+=1)if((i>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=i&31;else if(n.utf8seq===3)n.codepoint=i&15;else if(n.utf8seq===4)n.codepoint=i&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(i<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|i&63,n.utf8seq-=1,n.utf8seq===0&&r(n.codepoint)}}function Sr(i){const n=[],r={queue:0,queuedBits:0},l=u=>{n.push(u)};for(let u=0;u<i.length;u+=1)xp(i.charCodeAt(u),r,l);return new Uint8Array(n)}function Lw(i){const n=[];return jw(i,r=>n.push(r)),new Uint8Array(n)}function Si(i){const n=[],r={queue:0,queuedBits:0},l=u=>{n.push(u)};return i.forEach(u=>Kg(u,r,l)),Kg(null,r,l),n.join("")}function Dw(i){return Math.round(Date.now()/1e3)+i}function Uw(){return Symbol("auth-callback")}const At=()=>typeof window<"u"&&typeof document<"u",vi={tested:!1,writable:!1},Op=()=>{if(!At())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(vi.tested)return vi.writable;const i=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(i,i),globalThis.localStorage.removeItem(i),vi.tested=!0,vi.writable=!0}catch{vi.tested=!0,vi.writable=!1}return vi.writable};function Mw(i){const n={},r=new URL(i);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((u,d)=>{n[d]=u})}catch{}return r.searchParams.forEach((l,u)=>{n[u]=l}),n}const Rp=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),zw=i=>typeof i=="object"&&i!==null&&"status"in i&&"ok"in i&&"json"in i&&typeof i.json=="function",vr=async(i,n,r)=>{await i.setItem(n,JSON.stringify(r))},fn=async(i,n)=>{const r=await i.getItem(n);if(!r)return null;try{return JSON.parse(r)}catch{return null}},et=async(i,n)=>{await i.removeItem(n)};class zo{constructor(){this.promise=new zo.promiseConstructor((n,r)=>{this.resolve=n,this.reject=r})}}zo.promiseConstructor=Promise;function _o(i){const n=i.split(".");if(n.length!==3)throw new xo("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!_w.test(n[l]))throw new xo("JWT not in base64url format");return{header:JSON.parse(Yg(n[0])),payload:JSON.parse(Yg(n[1])),signature:Sr(n[2]),raw:{header:n[0],payload:n[1]}}}async function Bw(i){return await new Promise(n=>{setTimeout(()=>n(null),i)})}function Hw(i,n){return new Promise((l,u)=>{(async()=>{for(let d=0;d<1/0;d++)try{const h=await i(d);if(!n(d,null,h)){l(h);return}}catch(h){if(!n(d,h)){u(h);return}}})()})}function $w(i){return("0"+i.toString(16)).substr(-2)}function qw(){const n=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=r.length;let u="";for(let d=0;d<56;d++)u+=r.charAt(Math.floor(Math.random()*l));return u}return crypto.getRandomValues(n),Array.from(n,$w).join("")}async function Pw(i){const r=new TextEncoder().encode(i),l=await crypto.subtle.digest("SHA-256",r),u=new Uint8Array(l);return Array.from(u).map(d=>String.fromCharCode(d)).join("")}async function Iw(i){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."),i;const r=await Pw(i);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function bi(i,n,r=!1){const l=qw();let u=l;r&&(u+="/recovery"),await vr(i,`${n}-code-verifier`,u);const d=await Iw(l);return[d,l===d?"plain":"s256"]}const Gw=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Vw(i){const n=i.headers.get(kd);if(!n||!n.match(Gw))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function Kw(i){if(!i)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(i<=n)throw new Error("JWT has expired")}function Yw(i){switch(i){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 Jw=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ea(i){if(!Jw.test(i))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function mn(i){if(!i.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function rd(){const i={};return new Proxy(i,{get:(n,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const l=r.toString();if(l==="Symbol(Symbol.toPrimitive)"||l==="Symbol(Symbol.toStringTag)"||l==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Xw(i,n){return new Proxy(i,{get:(r,l,u)=>{if(l==="__isInsecureUserWarningProxy")return!0;if(typeof l=="symbol"){const d=l.toString();if(d==="Symbol(Symbol.toPrimitive)"||d==="Symbol(Symbol.toStringTag)"||d==="Symbol(util.inspect.custom)"||d==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,l,u)}return!n.value&&typeof l=="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(r,l,u)}})}function Jg(i){return JSON.parse(JSON.stringify(i))}const wi=i=>{if(typeof i=="object"&&i!==null){const n=i;if(typeof n.msg=="string")return n.msg;if(typeof n.message=="string")return n.message;if(typeof n.error_description=="string")return n.error_description;if(typeof n.error=="string")return n.error}return JSON.stringify(i)},Qw=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Xg(i){var n;if(!zw(i))throw new Ed(wi(i),0);if(Qw.includes(i.status))throw new Ed(wi(i),i.status);let r;try{r=await i.json()}catch(d){throw new yn(wi(d),d)}let l;const u=Vw(i);if(u&&u.getTime()>=Cp["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?l=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(l=r.error_code),l){if(l==="weak_password")throw new Gg(wi(r),i.status,((n=r.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="session_not_found")throw new gt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((d,h)=>d&&typeof h=="string",!0))throw new Gg(wi(r),i.status,r.weak_password.reasons);throw new kw(wi(r),i.status||500,l)}const Zw=(i,n,r,l)=>{const u={method:i,headers:n?.headers||{}};return i==="GET"?u:(u.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),u.body=JSON.stringify(l),Object.assign(Object.assign({},u),r))};async function W(i,n,r,l){var u;const d=Object.assign({},l?.headers);d[kd]||(d[kd]=Cp["2024-01-01"].name),l?.jwt&&(d.Authorization=`Bearer ${l.jwt}`);const h=(u=l?.query)!==null&&u!==void 0?u:{};l?.redirectTo&&(h.redirect_to=l.redirectTo);const m=Object.keys(h).length?"?"+new URLSearchParams(h).toString():"",g=await Ww(i,n,r+m,{headers:d,noResolveJson:l?.noResolveJson},{},l?.body);return l?.xform?l?.xform(g):{data:Object.assign({},g),error:null}}async function Ww(i,n,r,l,u,d){const h=Zw(n,l,u,d);let m;try{m=await i(r,Object.assign({},h))}catch(g){throw console.error(g),new Ed(wi(g),0)}if(m.ok||await Xg(m),l?.noResolveJson)return m;try{return await m.json()}catch(g){await Xg(g)}}function rn(i){var n;let r=null;tS(i)&&(r=Object.assign({},i),i.expires_at||(r.expires_at=Dw(i.expires_in)));const l=(n=i.user)!==null&&n!==void 0?n:typeof i?.id=="string"?i:null;return{data:{session:r,user:l},error:null}}function Qg(i){const n=rn(i);return!n.error&&i.weak_password&&typeof i.weak_password=="object"&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.message&&typeof i.weak_password.message=="string"&&i.weak_password.reasons.reduce((r,l)=>r&&typeof l=="string",!0)&&(n.data.weak_password=i.weak_password),n}function $a(i){var n;return{data:{user:(n=i.user)!==null&&n!==void 0?n:i},error:null}}function Fw(i){return{data:i,error:null}}function eS(i){const{action_link:n,email_otp:r,hashed_token:l,redirect_to:u,verification_type:d}=i,h=Do(i,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),m={action_link:n,email_otp:r,hashed_token:l,redirect_to:u,verification_type:d},g=Object.assign({},h);return{data:{properties:m,user:g},error:null}}function Zg(i){return i}function tS(i){return!!i.access_token&&!!i.refresh_token&&!!i.expires_in}const sd=["global","local","others"];class nS{constructor({url:n="",headers:r={},fetch:l,experimental:u}){this.url=n,this.headers=r,this.fetch=Rp(l),this.experimental=u??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(n,r=sd[0]){if(sd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${sd.join(", ")}`);try{return await W(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(l){if(Y(l))return{data:null,error:l};throw l}}async inviteUserByEmail(n,r={}){try{return await W(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:r}=n,l=Do(n,["options"]),u=Object.assign(Object.assign({},l),r);return"newEmail"in l&&(u.new_email=l?.newEmail,delete u.newEmail),await W(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:u,headers:this.headers,xform:eS,redirectTo:r?.redirectTo})}catch(r){if(Y(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(n){try{return await W(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:$a})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async listUsers(n){var r,l,u,d,h,m,g;try{const p={nextPage:null,lastPage:0,total:0},w=await W(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(u=n?.perPage)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""},xform:Zg});if(w.error)throw w.error;const b=await w.json(),T=(h=w.headers.get("x-total-count"))!==null&&h!==void 0?h:0,S=(g=(m=w.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return S.length>0&&(S.forEach(x=>{const O=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),I=JSON.parse(x.split(";")[1].split("=")[1]);p[`${I}Page`]=O}),p.total=parseInt(T)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(Y(p))return{data:{users:[]},error:p};throw p}}async getUserById(n){ea(n);try{return await W(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:$a})}catch(r){if(Y(r))return{data:{user:null},error:r};throw r}}async updateUserById(n,r){ea(n);try{return await W(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:r,headers:this.headers,xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,r=!1){ea(n);try{return await W(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:r},xform:$a})}catch(l){if(Y(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){ea(n.userId);try{const{data:r,error:l}=await W(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:u=>({data:{factors:u},error:null})});return{data:r,error:l}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _deleteFactor(n){ea(n.userId),ea(n.id);try{return{data:await W(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listOAuthClients(n){var r,l,u,d,h,m,g;try{const p={nextPage:null,lastPage:0,total:0},w=await W(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(u=n?.perPage)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""},xform:Zg});if(w.error)throw w.error;const b=await w.json(),T=(h=w.headers.get("x-total-count"))!==null&&h!==void 0?h:0,S=(g=(m=w.headers.get("link"))===null||m===void 0?void 0:m.split(","))!==null&&g!==void 0?g:[];return S.length>0&&(S.forEach(x=>{const O=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),I=JSON.parse(x.split(";")[1].split("=")[1]);p[`${I}Page`]=O}),p.total=parseInt(T)),{data:Object.assign(Object.assign({},b),p),error:null}}catch(p){if(Y(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(n){try{return await W(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getOAuthClient(n){try{return await W(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateOAuthClient(n,r){try{return await W(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(Y(l))return{data:null,error:l};throw l}}async _deleteOAuthClient(n){try{return await W(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(n){try{return await W(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _listCustomProviders(n){try{const r={};return n?.type&&(r.type=n.type),await W(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:l=>{var u;return{data:{providers:(u=l?.providers)!==null&&u!==void 0?u:[]},error:null}}})}catch(r){if(Y(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(n){try{return await W(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _getCustomProvider(n){try{return await W(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _updateCustomProvider(n,r){try{return await W(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(Y(l))return{data:null,error:l};throw l}}async _deleteCustomProvider(n){try{return await W(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminListPasskeys(n){mn(this.experimental),ea(n.userId);try{return await W(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Y(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(n){mn(this.experimental),ea(n.userId),ea(n.passkeyId);try{return await W(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/passkeys/${n.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Y(r))return{data:null,error:r};throw r}}}function Wg(i={}){return{getItem:n=>i[n]||null,setItem:(n,r)=>{i[n]=r},removeItem:n=>{delete i[n]}}}globalThis&&Op()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class aS extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}function iS(){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 jp(i){if(!/^0x[a-fA-F0-9]{40}$/.test(i))throw new Error(`@supabase/auth-js: Address "${i}" is invalid.`);return i.toLowerCase()}function rS(i){return parseInt(i,16)}function sS(i){const n=new TextEncoder().encode(i);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function lS(i){var n;const{chainId:r,domain:l,expirationTime:u,issuedAt:d=new Date,nonce:h,notBefore:m,requestId:g,resources:p,scheme:w,uri:b,version:T}=i;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(h&&h.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${h}`);if(!b)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(T!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${T}`);if(!((n=i.statement)===null||n===void 0)&&n.includes(`
|
|
22
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${i.statement}`)}const S=jp(i.address),x=w?`${w}://${l}`:l,O=i.statement?`${i.statement}
|
|
23
|
-
`:"",I=`${x} wants you to sign in with your Ethereum account:
|
|
24
|
-
${S}
|
|
25
|
-
|
|
26
|
-
${O}`;let $=`URI: ${b}
|
|
27
|
-
Version: ${T}
|
|
28
|
-
Chain ID: ${r}${h?`
|
|
29
|
-
Nonce: ${h}`:""}
|
|
30
|
-
Issued At: ${d.toISOString()}`;if(u&&($+=`
|
|
31
|
-
Expiration Time: ${u.toISOString()}`),m&&($+=`
|
|
32
|
-
Not Before: ${m.toISOString()}`),g&&($+=`
|
|
33
|
-
Request ID: ${g}`),p){let H=`
|
|
34
|
-
Resources:`;for(const q of p){if(!q||typeof q!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${q}`);H+=`
|
|
35
|
-
- ${q}`}$+=H}return`${I}
|
|
36
|
-
${$}`}class lt extends Error{constructor({message:n,code:r,cause:l,name:u}){var d;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(d=u??(l instanceof Error?l.name:void 0))!==null&&d!==void 0?d:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ro extends lt{constructor(n,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:n}),this.name="WebAuthnUnknownError",this.originalError=r}}function oS({error:i,options:n}){var r,l,u;const{publicKey:d}=n;if(!d)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new lt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else if(i.name==="ConstraintError"){if(((r=d.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new lt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:i});if(n.mediation==="conditional"&&((l=d.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new lt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:i});if(((u=d.authenticatorSelection)===null||u===void 0?void 0:u.userVerification)==="required")return new lt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:i})}else{if(i.name==="InvalidStateError")return new lt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:i});if(i.name==="NotAllowedError")return new lt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="NotSupportedError")return d.pubKeyCredParams.filter(m=>m.type==="public-key").length===0?new lt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:i}):new lt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:i});if(i.name==="SecurityError"){const h=window.location.hostname;if(Np(h)){if(d.rp.id!==h)return new lt({message:`The RP ID "${d.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="TypeError"){if(d.user.id.byteLength<1||d.user.id.byteLength>64)return new lt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:i})}else if(i.name==="UnknownError")return new lt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}function uS({error:i,options:n}){const{publicKey:r}=n;if(!r)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(n.signal instanceof AbortSignal)return new lt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else{if(i.name==="NotAllowedError")return new lt({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="SecurityError"){const l=window.location.hostname;if(Np(l)){if(r.rpId!==l)return new lt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="UnknownError")return new lt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return new lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i})}class cS{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}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 Ad=new cS;function Fg(i){if(!i)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(i);const{challenge:n,user:r,excludeCredentials:l}=i,u=Do(i,["challenge","user","excludeCredentials"]),d=Sr(n).buffer,h=Object.assign(Object.assign({},r),{id:Sr(r.id).buffer}),m=Object.assign(Object.assign({},u),{challenge:d,user:h});if(l&&l.length>0){m.excludeCredentials=new Array(l.length);for(let g=0;g<l.length;g++){const p=l[g];m.excludeCredentials[g]=Object.assign(Object.assign({},p),{id:Sr(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return m}function ep(i){if(!i)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(i);const{challenge:n,allowCredentials:r}=i,l=Do(i,["challenge","allowCredentials"]),u=Sr(n).buffer,d=Object.assign(Object.assign({},l),{challenge:u});if(r&&r.length>0){d.allowCredentials=new Array(r.length);for(let h=0;h<r.length;h++){const m=r[h];d.allowCredentials[h]=Object.assign(Object.assign({},m),{id:Sr(m.id).buffer,type:m.type||"public-key",transports:m.transports})}}return d}function tp(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const r=i;return{id:i.id,rawId:i.id,response:{attestationObject:Si(new Uint8Array(i.response.attestationObject)),clientDataJSON:Si(new Uint8Array(i.response.clientDataJSON))},type:"public-key",clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function np(i){var n;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();const r=i,l=i.getClientExtensionResults(),u=i.response;return{id:i.id,rawId:i.id,response:{authenticatorData:Si(new Uint8Array(u.authenticatorData)),clientDataJSON:Si(new Uint8Array(u.clientDataJSON)),signature:Si(new Uint8Array(u.signature)),userHandle:u.userHandle?Si(new Uint8Array(u.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Np(i){return i==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(i)}function jo(){var i,n;return!!(At()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((i=navigator?.credentials)===null||i===void 0?void 0:i.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function Lp(i){try{const n=await navigator.credentials.create(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Ro("Browser returned unexpected credential type",n)}:{data:null,error:new Ro("Empty credential response",n)}}catch(n){return{data:null,error:oS({error:n,options:i})}}}async function Dp(i){try{const n=await navigator.credentials.get(i);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new Ro("Browser returned unexpected credential type",n)}:{data:null,error:new Ro("Empty credential response",n)}}catch(n){return{data:null,error:uS({error:n,options:i})}}}const dS={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},hS={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function No(...i){const n=u=>u!==null&&typeof u=="object"&&!Array.isArray(u),r=u=>u instanceof ArrayBuffer||ArrayBuffer.isView(u),l={};for(const u of i)if(u)for(const d in u){const h=u[d];if(h!==void 0)if(Array.isArray(h))l[d]=h;else if(r(h))l[d]=h;else if(n(h)){const m=l[d];n(m)?l[d]=No(m,h):l[d]=No(h)}else l[d]=h}return l}function fS(i,n){return No(dS,i,n||{})}function mS(i,n){return No(hS,i,n||{})}class gS{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:r,friendlyName:l,signal:u},d){var h;try{const{data:m,error:g}=await this.client.mfa.challenge({factorId:n,webauthn:r});if(!m)return{data:null,error:g};const p=u??Ad.createNewAbortSignal();if(m.webauthn.type==="create"){const{user:w}=m.webauthn.credential_options.publicKey;if(!w.name){const b=l;if(b)w.name=`${w.id}:${b}`;else{const S=(await this.client.getUser()).data.user,x=((h=S?.user_metadata)===null||h===void 0?void 0:h.name)||S?.email||S?.id||"User";w.name=`${w.id}:${x}`}}w.displayName||(w.displayName=w.name)}switch(m.webauthn.type){case"create":{const w=fS(m.webauthn.credential_options.publicKey,d?.create),{data:b,error:T}=await Lp({publicKey:w,signal:p});return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:T}}case"request":{const w=mS(m.webauthn.credential_options.publicKey,d?.request),{data:b,error:T}=await Dp(Object.assign(Object.assign({},m.webauthn.credential_options),{publicKey:w,signal:p}));return b?{data:{factorId:n,challengeId:m.id,webauthn:{type:m.webauthn.type,credential_response:b}},error:null}:{data:null,error:T}}}}catch(m){return Y(m)?{data:null,error:m}:{data:null,error:new yn("Unexpected error in challenge",m)}}}async _verify({challengeId:n,factorId:r,webauthn:l}){return this.client.mfa.verify({factorId:r,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:u}={}},d){if(!r)return{data:null,error:new Vs("rpId is required for WebAuthn authentication")};try{if(!jo())return{data:null,error:new yn("Browser does not support WebAuthn",null)};const{data:h,error:m}=await this.challenge({factorId:n,webauthn:{rpId:r,rpOrigins:l},signal:u},{request:d});if(!h)return{data:null,error:m};const{webauthn:g}=h;return this._verify({factorId:n,challengeId:h.challengeId,webauthn:{type:g.type,rpId:r,rpOrigins:l,credential_response:g.credential_response}})}catch(h){return Y(h)?{data:null,error:h}:{data:null,error:new yn("Unexpected error in authenticate",h)}}}async _register({friendlyName:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:u}={}},d){if(!r)return{data:null,error:new Vs("rpId is required for WebAuthn registration")};try{if(!jo())return{data:null,error:new yn("Browser does not support WebAuthn",null)};const{data:h,error:m}=await this._enroll({friendlyName:n});if(!h)return await this.client.mfa.listFactors().then(w=>{var b;return(b=w.data)===null||b===void 0?void 0:b.all.find(T=>T.factor_type==="webauthn"&&T.friendly_name===n&&T.status!=="unverified")}).then(w=>w?this.client.mfa.unenroll({factorId:w?.id}):void 0),{data:null,error:m};const{data:g,error:p}=await this._challenge({factorId:h.id,friendlyName:h.friendly_name,webauthn:{rpId:r,rpOrigins:l},signal:u},{create:d});return g?this._verify({factorId:h.id,challengeId:g.challengeId,webauthn:{rpId:r,rpOrigins:l,type:g.webauthn.type,credential_response:g.webauthn.credential_response}}):{data:null,error:p}}catch(h){return Y(h)?{data:null,error:h}:{data:null,error:new yn("Unexpected error in register",h)}}}}iS();const pS={url:bw,storageKey:ww,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Sw,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},cr={};class Ks{get jwks(){var n,r;return(r=(n=cr[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(n){cr[this.storageKey]=Object.assign(Object.assign({},cr[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,r;return(r=(n=cr[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){cr[this.storageKey]=Object.assign(Object.assign({},cr[this.storageKey]),{cachedAt:n})}constructor(n){var r,l,u;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const d=Object.assign(Object.assign({},pS),n);if(this.storageKey=d.storageKey,this.instanceID=(r=Ks.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Ks.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!d.debug,typeof d.debug=="function"&&(this.logger=d.debug),this.instanceID>0&&At()){const h=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(h),this.logDebugMessages&&console.trace(h)}if(this.persistSession=d.persistSession,this.autoRefreshToken=d.autoRefreshToken,this.experimental=(l=d.experimental)!==null&&l!==void 0?l:{},this.admin=new nS({url:d.url,headers:d.headers,fetch:d.fetch,experimental:this.experimental}),this.url=d.url,this.headers=d.headers,this.fetch=Rp(d.fetch),this.detectSessionInUrl=d.detectSessionInUrl,this.flowType=d.flowType,this.hasCustomAuthorizationHeader=d.hasCustomAuthorizationHeader,this.throwOnError=d.throwOnError,this.lockAcquireTimeout=d.lockAcquireTimeout,d.lock!=null&&(this.lock=d.lock),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 gS(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(d.storage?this.storage=d.storage:Op()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Wg(this.memoryStorage)),d.userStorage&&(this.userStorage=d.userStorage)):(this.memoryStorage={},this.storage=Wg(this.memoryStorage)),At()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(h){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",h)}(u=this.broadcastChannel)===null||u===void 0||u.addEventListener("message",async h=>{this._debug("received broadcast notification from other tab or client",h),(h.data.event==="TOKEN_REFRESHED"||h.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(h.data.event,h.data.session,!1)}catch(m){this._debug("#broadcastChannel","error",m)}})}d.skipAutoInitialize||this.initialize().catch(h=>{this._debug("#initialize()","error",h)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Ap}) ${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()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var n;try{let r={},l="none";if(At()&&(r=Mw(window.location.href),this._isImplicitGrantCallback(r)?l="implicit":await this._isPKCECallback(r)&&(l="pkce")),At()&&this.detectSessionInUrl&&l!=="none"){const{data:u,error:d}=await this._getSessionFromURL(r,l);if(d){if(this._debug("#_initialize()","error detecting session from URL",d),Aw(d)){const g=(n=d.details)===null||n===void 0?void 0:n.code;if(g==="identity_already_exists"||g==="identity_not_found"||g==="single_identity_not_deletable")return{error:d}}return{error:d}}const{session:h,redirectType:m}=u;return this._debug("#_initialize()","detected session in URL",h,"redirect type",m),await this._saveSession(h),setTimeout(async()=>{m==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",h):await this._notifyAllSubscribers("SIGNED_IN",h)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Y(r)?this._returnResult({error:r}):this._returnResult({error:new yn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var r,l,u;try{const d=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(r=n?.options)===null||r===void 0?void 0:r.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(u=n?.options)===null||u===void 0?void 0:u.captchaToken}},xform:rn}),{data:h,error:m}=d;if(m||!h)return this._returnResult({data:{user:null,session:null},error:m});const g=h.session,p=h.user;return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(d){if(Y(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signUp(n){var r,l,u;try{let d;if("email"in n){const{email:w,password:b,options:T}=n;let S=null,x=null;this.flowType==="pkce"&&([S,x]=await bi(this.storage,this.storageKey)),d=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:T?.emailRedirectTo,body:{email:w,password:b,data:(r=T?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:T?.captchaToken},code_challenge:S,code_challenge_method:x},xform:rn})}else if("phone"in n){const{phone:w,password:b,options:T}=n;d=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:w,password:b,data:(l=T?.data)!==null&&l!==void 0?l:{},channel:(u=T?.channel)!==null&&u!==void 0?u:"sms",gotrue_meta_security:{captcha_token:T?.captchaToken}},xform:rn})}else throw new wo("You must provide either an email or phone number and a password");const{data:h,error:m}=d;if(m||!h)return await et(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:m});const g=h.session,p=h.user;return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(d){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signInWithPassword(n){try{let r;if("email"in n){const{email:d,password:h,options:m}=n;r=await W(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:d,password:h,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:Qg})}else if("phone"in n){const{phone:d,password:h,options:m}=n;r=await W(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:d,password:h,gotrue_meta_security:{captcha_token:m?.captchaToken}},xform:Qg})}else throw new wo("You must provide either an email or phone number and a password");const{data:l,error:u}=r;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new ur;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:Object.assign({user:l.user,session:l.session},l.weak_password?{weakPassword:l.weak_password}:null),error:u})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(n){var r,l,u,d;return await this._handleProviderSignIn(n.provider,{redirectTo:(r=n.options)===null||r===void 0?void 0:r.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=n.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:(d=n.options)===null||d===void 0?void 0:d.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n)):this._exchangeCodeForSession(n)}async signInWithWeb3(n){const{chain:r}=n;switch(r){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(n){var r,l,u,d,h,m,g,p,w,b,T;let S,x;if("message"in n)S=n.message,x=n.signature;else{const{chain:O,wallet:I,statement:$,options:H}=n;let q;if(At())if(typeof I=="object")q=I;else{const Te=window;if("ethereum"in Te&&typeof Te.ethereum=="object"&&"request"in Te.ethereum&&typeof Te.ethereum.request=="function")q=Te.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 I!="object"||!H?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");q=I}const X=new URL((r=H?.url)!==null&&r!==void 0?r:window.location.href),me=await q.request({method:"eth_requestAccounts"}).then(Te=>Te).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!me||me.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const ie=jp(me[0]);let J=(l=H?.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!J){const Te=await q.request({method:"eth_chainId"});J=rS(Te)}const xe={domain:X.host,address:ie,statement:$,uri:X.href,version:"1",chainId:J,nonce:(u=H?.signInWithEthereum)===null||u===void 0?void 0:u.nonce,issuedAt:(h=(d=H?.signInWithEthereum)===null||d===void 0?void 0:d.issuedAt)!==null&&h!==void 0?h:new Date,expirationTime:(m=H?.signInWithEthereum)===null||m===void 0?void 0:m.expirationTime,notBefore:(g=H?.signInWithEthereum)===null||g===void 0?void 0:g.notBefore,requestId:(p=H?.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(w=H?.signInWithEthereum)===null||w===void 0?void 0:w.resources};S=lS(xe),x=await q.request({method:"personal_sign",params:[sS(S),ie]})}try{const{data:O,error:I}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:S,signature:x},!((b=n.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(T=n.options)===null||T===void 0?void 0:T.captchaToken}}:null),xform:rn});if(I)throw I;if(!O||!O.session||!O.user){const $=new ur;return this._returnResult({data:{user:null,session:null},error:$})}return O.session&&(await this._saveSession(O.session),await this._notifyAllSubscribers("SIGNED_IN",O.session)),this._returnResult({data:Object.assign({},O),error:I})}catch(O){if(Y(O))return this._returnResult({data:{user:null,session:null},error:O});throw O}}async signInWithSolana(n){var r,l,u,d,h,m,g,p,w,b,T,S;let x,O;if("message"in n)x=n.message,O=n.signature;else{const{chain:I,wallet:$,statement:H,options:q}=n;let X;if(At())if(typeof $=="object")X=$;else{const ie=window;if("solana"in ie&&typeof ie.solana=="object"&&("signIn"in ie.solana&&typeof ie.solana.signIn=="function"||"signMessage"in ie.solana&&typeof ie.solana.signMessage=="function"))X=ie.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 $!="object"||!q?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");X=$}const me=new URL((r=q?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in X&&X.signIn){const ie=await X.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},q?.signInWithSolana),{version:"1",domain:me.host,uri:me.href}),H?{statement:H}:null));let J;if(Array.isArray(ie)&&ie[0]&&typeof ie[0]=="object")J=ie[0];else if(ie&&typeof ie=="object"&&"signedMessage"in ie&&"signature"in ie)J=ie;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in J&&"signature"in J&&(typeof J.signedMessage=="string"||J.signedMessage instanceof Uint8Array)&&J.signature instanceof Uint8Array)x=typeof J.signedMessage=="string"?J.signedMessage:new TextDecoder().decode(J.signedMessage),O=J.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in X)||typeof X.signMessage!="function"||!("publicKey"in X)||typeof X!="object"||!X.publicKey||!("toBase58"in X.publicKey)||typeof X.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${me.host} wants you to sign in with your Solana account:`,X.publicKey.toBase58(),...H?["",H,""]:[""],"Version: 1",`URI: ${me.href}`,`Issued At: ${(u=(l=q?.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&u!==void 0?u:new Date().toISOString()}`,...!((d=q?.signInWithSolana)===null||d===void 0)&&d.notBefore?[`Not Before: ${q.signInWithSolana.notBefore}`]:[],...!((h=q?.signInWithSolana)===null||h===void 0)&&h.expirationTime?[`Expiration Time: ${q.signInWithSolana.expirationTime}`]:[],...!((m=q?.signInWithSolana)===null||m===void 0)&&m.chainId?[`Chain ID: ${q.signInWithSolana.chainId}`]:[],...!((g=q?.signInWithSolana)===null||g===void 0)&&g.nonce?[`Nonce: ${q.signInWithSolana.nonce}`]:[],...!((p=q?.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${q.signInWithSolana.requestId}`]:[],...!((b=(w=q?.signInWithSolana)===null||w===void 0?void 0:w.resources)===null||b===void 0)&&b.length?["Resources",...q.signInWithSolana.resources.map(J=>`- ${J}`)]:[]].join(`
|
|
37
|
-
`);const ie=await X.signMessage(new TextEncoder().encode(x),"utf8");if(!ie||!(ie instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");O=ie}}try{const{data:I,error:$}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:Si(O)},!((T=n.options)===null||T===void 0)&&T.captchaToken?{gotrue_meta_security:{captcha_token:(S=n.options)===null||S===void 0?void 0:S.captchaToken}}:null),xform:rn});if($)throw $;if(!I||!I.session||!I.user){const H=new ur;return this._returnResult({data:{user:null,session:null},error:H})}return I.session&&(await this._saveSession(I.session),await this._notifyAllSubscribers("SIGNED_IN",I.session)),this._returnResult({data:Object.assign({},I),error:$})}catch(I){if(Y(I))return this._returnResult({data:{user:null,session:null},error:I});throw I}}async _exchangeCodeForSession(n){const r=await fn(this.storage,`${this.storageKey}-code-verifier`),[l,u]=(r??"").split("/");try{if(!l&&this.flowType==="pkce")throw new Cw;const{data:d,error:h}=await W(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:l},xform:rn});if(await et(this.storage,`${this.storageKey}-code-verifier`),h)throw h;if(!d||!d.session||!d.user){const m=new ur;return this._returnResult({data:{user:null,session:null,redirectType:null},error:m})}return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers(u==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",d.session)),this._returnResult({data:Object.assign(Object.assign({},d),{redirectType:u??null}),error:h})}catch(d){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(d))return this._returnResult({data:{user:null,session:null,redirectType:null},error:d});throw d}}async signInWithIdToken(n){try{const{options:r,provider:l,token:u,access_token:d,nonce:h}=n,m=await W(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:u,access_token:d,nonce:h,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:rn}),{data:g,error:p}=m;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!g||!g.session||!g.user){const w=new ur;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:g,error:p})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(n){var r,l,u,d,h;try{if("email"in n){const{email:m,options:g}=n;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await bi(this.storage,this.storageKey));const{error:b}=await W(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:m,data:(r=g?.data)!==null&&r!==void 0?r:{},create_user:(l=g?.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},code_challenge:p,code_challenge_method:w},redirectTo:g?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:b})}if("phone"in n){const{phone:m,options:g}=n,{data:p,error:w}=await W(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:m,data:(u=g?.data)!==null&&u!==void 0?u:{},create_user:(d=g?.shouldCreateUser)!==null&&d!==void 0?d:!0,gotrue_meta_security:{captcha_token:g?.captchaToken},channel:(h=g?.channel)!==null&&h!==void 0?h:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p?.message_id},error:w})}throw new wo("You must provide either an email or phone number.")}catch(m){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async verifyOtp(n){var r,l;try{let u,d;"options"in n&&(u=(r=n.options)===null||r===void 0?void 0:r.redirectTo,d=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:h,error:m}=await W(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:d}}),redirectTo:u,xform:rn});if(m)throw m;if(!h)throw new Error("An error occurred on token verification.");const g=h.session,p=h.user;return g?.access_token&&(await this._saveSession(g),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",g)),this._returnResult({data:{user:p,session:g},error:null})}catch(u){if(Y(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithSSO(n){var r,l,u,d,h;try{let m=null,g=null;this.flowType==="pkce"&&([m,g]=await bi(this.storage,this.storageKey));const p=await W(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:(l=(r=n.options)===null||r===void 0?void 0:r.redirectTo)!==null&&l!==void 0?l:void 0}),!((u=n?.options)===null||u===void 0)&&u.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:m,code_challenge_method:g}),headers:this.headers,xform:Fw});return!((d=p.data)===null||d===void 0)&&d.url&&At()&&!(!((h=n.options)===null||h===void 0)&&h.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(m){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(m))return this._returnResult({data:null,error:m});throw m}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)throw l;if(!r)throw new gt;const{error:u}=await W(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:u})})}catch(n){if(Y(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const r=`${this.url}/resend`;if("email"in n){const{email:l,type:u,options:d}=n;let h=null,m=null;this.flowType==="pkce"&&([h,m]=await bi(this.storage,this.storageKey));const{error:g}=await W(this.fetch,"POST",r,{headers:this.headers,body:{email:l,type:u,gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:h,code_challenge_method:m},redirectTo:d?.emailRedirectTo});return g&&await et(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:g})}else if("phone"in n){const{phone:l,type:u,options:d}=n,{data:h,error:m}=await W(this.fetch,"POST",r,{headers:this.headers,body:{phone:l,type:u,gotrue_meta_security:{captcha_token:d?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:h?.message_id},error:m})}throw new wo("You must provide either an email or phone number and a type")}catch(r){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n)):await this._useSession(async n=>n)}async _acquireLock(n,r){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),u=(async()=>(await l,await r()))();return this.pendingInLock.push((async()=>{try{await u}catch{}})()),u}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const l=r();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const u=[...this.pendingInLock];await Promise.all(u),this.pendingInLock.splice(0,u.length)}return await l}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 r=await this.__loadSession();return await n(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let n=null;const r=await fn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?n=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!n)return{data:{session:null},error:null};const l=n.expires_at?n.expires_at*1e3-Date.now()<id:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l){if(this.userStorage){const h=await fn(this.userStorage,this.storageKey+"-user");h?.user?n.user=h.user:n.user=rd()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const h={value:this.suppressGetSessionWarning};n.user=Xw(n.user,h),h.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:u,error:d}=await this._callRefreshToken(n.refresh_token);if(d){if(!!(n.expires_at&&n.expires_at*1e3>Date.now())){const m=await fn(this.storage,this.storageKey);if(m&&m.refresh_token===n.refresh_token)return this._returnResult({data:{session:n},error:null})}return this._returnResult({data:{session:null},error:d})}return this._returnResult({data:{session:u},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(n){try{return n?await W(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:$a}):await this._useSession(async r=>{var l,u,d;const{data:h,error:m}=r;if(m)throw m;return!(!((l=h.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new gt}:await W(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0,xform:$a})})}catch(r){if(Y(r))return bo(r)&&(await this._removeSession(),await et(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(n,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,r)):await this._updateUser(n,r)}async _updateUser(n,r={}){try{return await this._useSession(async l=>{const{data:u,error:d}=l;if(d)throw d;if(!u.session)throw new gt;const h=u.session;let m=null,g=null;this.flowType==="pkce"&&n.email!=null&&([m,g]=await bi(this.storage,this.storageKey));const{data:p,error:w}=await W(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:m,code_challenge_method:g}),jwt:h.access_token,xform:$a});if(w)throw w;return h.user=p.user,await this._saveSession(h),await this._notifyAllSubscribers("USER_UPDATED",h),this._returnResult({data:{user:h.user},error:null})})}catch(l){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(l))return this._returnResult({data:{user:null},error:l});throw l}}async setSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(n)):await this._setSession(n)}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new gt;const r=Date.now()/1e3;let l=r,u=!0,d=null;const{payload:h}=_o(n.access_token);if(h.exp&&(l=h.exp,u=l<=r),u){const{data:m,error:g}=await this._callRefreshToken(n.refresh_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!m)return{data:{user:null,session:null},error:null};d=m}else{const{data:m,error:g}=await this._getUser(n.access_token);if(g)return this._returnResult({data:{user:null,session:null},error:g});d={access_token:n.access_token,refresh_token:n.refresh_token,user:m.user,token_type:"bearer",expires_in:l-r,expires_at:l},await this._saveSession(d),await this._notifyAllSubscribers("SIGNED_IN",d)}return this._returnResult({data:{user:d.user,session:d},error:null})}catch(r){if(Y(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(n){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(n)):await this._refreshSession(n)}async _refreshSession(n){try{return await this._useSession(async r=>{var l;if(!n){const{data:h,error:m}=r;if(m)throw m;n=(l=h.session)!==null&&l!==void 0?l:void 0}if(!n?.refresh_token)throw new gt;const{data:u,error:d}=await this._callRefreshToken(n.refresh_token);return d?this._returnResult({data:{user:null,session:null},error:d}):u?this._returnResult({data:{user:u.user,session:u},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Y(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(n,r){var l;try{if(!At())throw new So("No browser detected.");if(n.error||n.error_description||n.error_code)throw new So(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new qg("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new So("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new qg("No code detected.");const{data:q,error:X}=await this._exchangeCodeForSession(n.code);if(X)throw X;const me=new URL(window.location.href);return me.searchParams.delete("code"),window.history.replaceState(window.history.state,"",me.toString()),{data:{session:q.session,redirectType:(l=q.redirectType)!==null&&l!==void 0?l:null},error:null}}const{provider_token:u,provider_refresh_token:d,access_token:h,refresh_token:m,expires_in:g,expires_at:p,token_type:w}=n;if(!h||!g||!m||!w)throw new So("No session defined in URL");const b=Math.round(Date.now()/1e3),T=parseInt(g);let S=b+T;p&&(S=parseInt(p));const x=S-b;x*1e3<=ia&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${T}s`);const O=S-T;b-O>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",O,S,b):b-O<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",O,S,b);const{data:I,error:$}=await this._getUser(h);if($)throw $;const H={provider_token:u,provider_refresh_token:d,access_token:h,expires_in:T,expires_at:S,refresh_token:m,token_type:w,user:I.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:H,redirectType:n.type},error:null})}catch(u){if(Y(u))return this._returnResult({data:{session:null,redirectType:null},error:u});throw u}}_isImplicitGrantCallback(n){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),n):!!(n.access_token||n.error||n.error_description||n.error_code)}async _isPKCECallback(n){const r=await fn(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&r)}async signOut(n={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(n)):await this._signOut(n)}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async r=>{var l;const{data:u,error:d}=r;if(d&&!bo(d))return this._returnResult({error:d});const h=(l=u.session)===null||l===void 0?void 0:l.access_token;if(h){const{error:m}=await this.admin.signOut(h,n);if(m&&!(Ew(m)&&(m.status===404||m.status===401||m.status===403)||bo(m)))return this._returnResult({error:m})}return n!=="others"&&(await this._removeSession(),await et(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const r=Uw(),l={id:r,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,l),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async r=>{var l,u;try{const{data:{session:d},error:h}=r;if(h)throw h;await((l=this.stateChangeEmitters.get(n))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",d)),this._debug("INITIAL_SESSION","callback id",n,"session",d)}catch(d){await((u=this.stateChangeEmitters.get(n))===null||u===void 0?void 0:u.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",d),bo(d)?console.warn(d):console.error(d)}})}async resetPasswordForEmail(n,r={}){let l=null,u=null;this.flowType==="pkce"&&([l,u]=await bi(this.storage,this.storageKey,!0));try{return await W(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:u,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(d){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(d))return this._returnResult({data:null,error:d});throw d}}async getUserIdentities(){var n;try{const{data:r,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=r.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var r;try{const{data:l,error:u}=await this._useSession(async d=>{var h,m,g,p,w;const{data:b,error:T}=d;if(T)throw T;const S=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(h=n.options)===null||h===void 0?void 0:h.redirectTo,scopes:(m=n.options)===null||m===void 0?void 0:m.scopes,queryParams:(g=n.options)===null||g===void 0?void 0:g.queryParams,skipBrowserRedirect:!0});return await W(this.fetch,"GET",S,{headers:this.headers,jwt:(w=(p=b.session)===null||p===void 0?void 0:p.access_token)!==null&&w!==void 0?w:void 0})});if(u)throw u;return At()&&!(!((r=n.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(l?.url),this._returnResult({data:{provider:n.provider,url:l?.url},error:null})}catch(l){if(Y(l))return this._returnResult({data:{provider:n.provider,url:null},error:l});throw l}}async linkIdentityIdToken(n){return await this._useSession(async r=>{var l;try{const{error:u,data:{session:d}}=r;if(u)throw u;const{options:h,provider:m,token:g,access_token:p,nonce:w}=n,b=await W(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=d?.access_token)!==null&&l!==void 0?l:void 0,body:{provider:m,id_token:g,access_token:p,nonce:w,link_identity:!0,gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:rn}),{data:T,error:S}=b;return S?this._returnResult({data:{user:null,session:null},error:S}):!T||!T.session||!T.user?this._returnResult({data:{user:null,session:null},error:new ur}):(T.session&&(await this._saveSession(T.session),await this._notifyAllSubscribers("USER_UPDATED",T.session)),this._returnResult({data:T,error:S}))}catch(u){if(await et(this.storage,`${this.storageKey}-code-verifier`),Y(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}})}async unlinkIdentity(n){try{return await this._useSession(async r=>{var l,u;const{data:d,error:h}=r;if(h)throw h;return await W(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(u=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(n){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const l=Date.now();return await Hw(async u=>(u>0&&await Bw(200*Math.pow(2,u-1)),this._debug(r,"refreshing attempt",u),await W(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:rn})),(u,d)=>{const h=200*Math.pow(2,u);return d&&Pg(d)&&Date.now()+h-l<ia})}catch(l){if(this._debug(r,"error",l),Y(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(r,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,r){const l=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",r,"url",l),At()&&!r.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l},error:null}}async _recoverAndRefresh(){var n,r;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const u=await fn(this.storage,this.storageKey);if(u&&this.userStorage){let h=await fn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!h&&(h={user:u.user},await vr(this.userStorage,this.storageKey+"-user",h)),u.user=(n=h?.user)!==null&&n!==void 0?n:rd()}else if(u&&!u.user&&!u.user){const h=await fn(this.storage,this.storageKey+"-user");h&&h?.user?(u.user=h.user,await et(this.storage,this.storageKey+"-user"),await vr(this.storage,this.storageKey,u)):u.user=rd()}if(this._debug(l,"session from storage",u),!this._isValidSession(u)){this._debug(l,"session is not valid"),u!==null&&await this._removeSession();return}const d=((r=u.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<id;if(this._debug(l,`session has${d?"":" not"} expired with margin of ${id}s`),d){if(this.autoRefreshToken&&u.refresh_token){const{error:h}=await this._callRefreshToken(u.refresh_token);h&&(xw(h)?this._debug(l,"refresh discarded by commit guard",h):this._debug(l,"refresh failed",h))}}else if(u.user&&u.user.__isUserNotAvailableProxy===!0)try{const{data:h,error:m}=await this._getUser(u.access_token);!m&&h?.user?(u.user=h.user,await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(h){console.error("Error getting user data:",h),this._debug(l,"error getting user data, skipping SIGNED_IN notification",h)}else await this._notifyAllSubscribers("SIGNED_IN",u)}catch(u){this._debug(l,"error",u),console.error(u);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var r,l;if(!n)throw new gt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===n&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const u="#_callRefreshToken()";this._debug(u,"begin");try{this.refreshingDeferred=new zo;const d=await fn(this.storage,this.storageKey),{data:h,error:m}=await this._refreshAccessToken(n);if(m)throw m;if(!h.session)throw new gt;const g=await fn(this.storage,this.storageKey);if(d!==null&&(g===null||g.refresh_token!==d.refresh_token)){this._debug(u,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:g?"replaced":"cleared"});const T={data:null,error:new Ig};return this.refreshingDeferred.resolve(T),T}const w=this._sessionRemovalEpoch;if(await this._saveSession(h.session),this._sessionRemovalEpoch!==w){this._debug(u,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await et(this.storage,this.storageKey),this.userStorage&&await et(this.userStorage,this.storageKey+"-user");const T={data:null,error:new Ig};return this.refreshingDeferred.resolve(T),T}await this._notifyAllSubscribers("TOKEN_REFRESHED",h.session);const b={data:h.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(b),b}catch(d){if(this._debug(u,"error",d),Y(d)){const h={data:null,error:d};if(!Pg(d)){const m=await fn(this.storage,this.storageKey);!!(m?.expires_at&&m.expires_at*1e3>Date.now())?this._debug(u,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:n,result:h,expiresAt:Date.now()+vw},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(h),h}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(d),d}finally{this.refreshingDeferred=null,this._debug(u,"end")}}async _notifyAllSubscribers(n,r,l=!0){const u=`#_notifyAllSubscribers(${n})`;this._debug(u,"begin",r,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:r});const d=[],h=Array.from(this.stateChangeEmitters.values()).map(async m=>{try{await m.callback(n,r)}catch(g){d.push(g)}});if(await Promise.all(h),d.length>0){for(let m=0;m<d.length;m+=1)console.error(d[m]);throw d[0]}}finally{this._debug(u,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0,await et(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},n),l=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&r.user&&await vr(this.userStorage,this.storageKey+"-user",{user:r.user});const u=Object.assign({},r);delete u.user;const d=Jg(u);await vr(this.storage,this.storageKey,d)}else{const u=Jg(r);await vr(this.storage,this.storageKey,u)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await et(this.storage,this.storageKey),await et(this.storage,this.storageKey+"-code-verifier"),await et(this.storage,this.storageKey+"-user"),this.userStorage&&await et(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(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),ia);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var n;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(n=this.broadcastChannel)===null||n===void 0||n.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const n=Date.now();try{return await this._useSession(async r=>{const{data:{session:l}}=r;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const u=Math.floor((l.expires_at*1e3-n)/ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${u} ticks, a tick lasts ${ia}ms, refresh threshold is ${Ns} ticks`),u<=Ns&&await this._callRefreshToken(l.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n instanceof aS)this._debug("auto refresh token tick lock not available");else throw n}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const n=Date.now();try{await this._useSession(async r=>{const{data:{session:l}}=r;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const u=Math.floor((l.expires_at*1e3-n)/ia);this._debug("#_autoRefreshTokenTick()",`access token expires in ${u} ticks, a tick lasts ${ia}ms, refresh threshold is ${Ns} ticks`),u<=Ns&&await this._callRefreshToken(l.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}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 r=`#_onVisibilityChanged(${n})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!n)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,r,l){const u=[`provider=${encodeURIComponent(r)}`];if(l?.redirectTo&&u.push(`redirect_to=${encodeURIComponent(l.redirectTo)}`),l?.scopes&&u.push(`scopes=${encodeURIComponent(l.scopes)}`),this.flowType==="pkce"){const[d,h]=await bi(this.storage,this.storageKey),m=new URLSearchParams({code_challenge:`${encodeURIComponent(d)}`,code_challenge_method:`${encodeURIComponent(h)}`});u.push(m.toString())}if(l?.queryParams){const d=new URLSearchParams(l.queryParams);u.push(d.toString())}return l?.skipBrowserRedirect&&u.push(`skip_http_redirect=${l.skipBrowserRedirect}`),`${n}?${u.join("&")}`}async _unenroll(n){try{return await this._useSession(async r=>{var l;const{data:u,error:d}=r;return d?this._returnResult({data:null,error:d}):await W(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=u?.session)===null||l===void 0?void 0:l.access_token})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(n){try{return await this._useSession(async r=>{var l,u;const{data:d,error:h}=r;if(h)return this._returnResult({data:null,error:h});const m=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:g,error:p}=await W(this.fetch,"POST",`${this.url}/factors`,{body:m,headers:this.headers,jwt:(l=d?.session)===null||l===void 0?void 0:l.access_token});return p?this._returnResult({data:null,error:p}):(n.factorType==="totp"&&g.type==="totp"&&(!((u=g?.totp)===null||u===void 0)&&u.qr_code)&&(g.totp.qr_code=`data:image/svg+xml;utf-8,${g.totp.qr_code}`),this._returnResult({data:g,error:null}))})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _verify(n){const r=async()=>{try{return await this._useSession(async l=>{var u;const{data:d,error:h}=l;if(h)return this._returnResult({data:null,error:h});const m=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?tp(n.webauthn.credential_response):np(n.webauthn.credential_response)})}:{code:n.code}),{data:g,error:p}=await W(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:m,headers:this.headers,jwt:(u=d?.session)===null||u===void 0?void 0:u.access_token});return p?this._returnResult({data:null,error:p}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+g.expires_in},g)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",g),this._returnResult({data:g,error:p}))})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(n){const r=async()=>{try{return await this._useSession(async l=>{var u;const{data:d,error:h}=l;if(h)return this._returnResult({data:null,error:h});const m=await W(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(u=d?.session)===null||u===void 0?void 0:u.access_token});if(m.error)return m;const{data:g}=m;if(g.type!=="webauthn")return{data:g,error:null};switch(g.webauthn.type){case"create":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:Fg(g.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},g),{webauthn:Object.assign(Object.assign({},g.webauthn),{credential_options:Object.assign(Object.assign({},g.webauthn.credential_options),{publicKey:ep(g.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(n){const{data:r,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:r.id,code:n.code})}async _listFactors(){var n;const{data:{user:r},error:l}=await this.getUser();if(l)return{data:null,error:l};const u={all:[],phone:[],totp:[],webauthn:[]};for(const d of(n=r?.factors)!==null&&n!==void 0?n:[])u.all.push(d),d.status==="verified"&&u[d.factor_type].push(d);return{data:u,error:null}}async _getAuthenticatorAssuranceLevel(n){var r,l,u,d;if(n)try{const{payload:S}=_o(n);let x=null;S.aal&&(x=S.aal);let O=x;const{data:{user:I},error:$}=await this.getUser(n);if($)return this._returnResult({data:null,error:$});((l=(r=I?.factors)===null||r===void 0?void 0:r.filter(X=>X.status==="verified"))!==null&&l!==void 0?l:[]).length>0&&(O="aal2");const q=S.amr||[];return{data:{currentLevel:x,nextLevel:O,currentAuthenticationMethods:q},error:null}}catch(S){if(Y(S))return this._returnResult({data:null,error:S});throw S}const{data:{session:h},error:m}=await this.getSession();if(m)return this._returnResult({data:null,error:m});if(!h)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:g}=_o(h.access_token);let p=null;g.aal&&(p=g.aal);let w=p;((d=(u=h.user.factors)===null||u===void 0?void 0:u.filter(S=>S.status==="verified"))!==null&&d!==void 0?d:[]).length>0&&(w="aal2");const T=g.amr||[];return{data:{currentLevel:p,nextLevel:w,currentAuthenticationMethods:T},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;return u?this._returnResult({data:null,error:u}):l?await W(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:l.access_token,xform:d=>({data:d,error:null})}):this._returnResult({data:null,error:new gt})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:u},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!u)return this._returnResult({data:null,error:new gt});const h=await W(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:u.access_token,body:{action:"approve"},xform:m=>({data:m,error:null})});return h.data&&h.data.redirect_url&&At()&&!r?.skipBrowserRedirect&&window.location.assign(h.data.redirect_url),h})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:u},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!u)return this._returnResult({data:null,error:new gt});const h=await W(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:u.access_token,body:{action:"deny"},xform:m=>({data:m,error:null})});return h.data&&h.data.redirect_url&&At()&&!r?.skipBrowserRedirect&&window.location.assign(h.data.redirect_url),h})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;return l?this._returnResult({data:null,error:l}):r?await W(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new gt})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;return u?this._returnResult({data:null,error:u}):l?(await W(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:l.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new gt})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(n,r={keys:[]}){let l=r.keys.find(m=>m.kid===n);if(l)return l;const u=Date.now();if(l=this.jwks.keys.find(m=>m.kid===n),l&&this.jwks_cached_at+Tw>u)return l;const{data:d,error:h}=await W(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(h)throw h;return!d.keys||d.keys.length===0||(this.jwks=d,this.jwks_cached_at=u,l=d.keys.find(m=>m.kid===n),!l)?null:l}async getClaims(n,r={}){try{let l=n;if(!l){const{data:S,error:x}=await this.getSession();if(x||!S.session)return this._returnResult({data:null,error:x});l=S.session.access_token}const{header:u,payload:d,signature:h,raw:{header:m,payload:g}}=_o(l);if(!r?.allowExpired)try{Kw(d.exp)}catch(S){throw new xo(S instanceof Error?S.message:"JWT validation failed")}const p=!u.alg||u.alg.startsWith("HS")||!u.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(u.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!p){const{error:S}=await this.getUser(l);if(S)throw S;return{data:{claims:d,header:u,signature:h},error:null}}const w=Yw(u.alg),b=await crypto.subtle.importKey("jwk",p,w,!0,["verify"]);if(!await crypto.subtle.verify(w,b,h,Lw(`${m}.${g}`)))throw new xo("Invalid JWT signature");return{data:{claims:d,header:u,signature:h},error:null}}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async signInWithPasskey(n){var r,l,u;mn(this.experimental);try{if(!jo())return this._returnResult({data:null,error:new yn("Browser does not support WebAuthn",null)});const{data:d,error:h}=await this._startPasskeyAuthentication({options:{captchaToken:(r=n?.options)===null||r===void 0?void 0:r.captchaToken}});if(h||!d)return this._returnResult({data:null,error:h});const m=ep(d.options),g=(u=(l=n?.options)===null||l===void 0?void 0:l.signal)!==null&&u!==void 0?u:Ad.createNewAbortSignal(),{data:p,error:w}=await Dp({publicKey:m,signal:g});if(w||!p)return this._returnResult({data:null,error:w??new yn("WebAuthn ceremony failed",null)});const b=np(p);return this._verifyPasskeyAuthentication({challengeId:d.challenge_id,credential:b})}catch(d){if(Y(d))return this._returnResult({data:null,error:d});throw d}}async registerPasskey(n){var r,l;mn(this.experimental);try{if(!jo())return this._returnResult({data:null,error:new yn("Browser does not support WebAuthn",null)});const{data:u,error:d}=await this._startPasskeyRegistration();if(d||!u)return this._returnResult({data:null,error:d});const h=Fg(u.options),m=(l=(r=n?.options)===null||r===void 0?void 0:r.signal)!==null&&l!==void 0?l:Ad.createNewAbortSignal(),{data:g,error:p}=await Lp({publicKey:h,signal:m});if(p||!g)return this._returnResult({data:null,error:p??new yn("WebAuthn ceremony failed",null)});const w=tp(g);return this._verifyPasskeyRegistration({challengeId:u.challenge_id,credential:w})}catch(u){if(Y(u))return this._returnResult({data:null,error:u});throw u}}async _startPasskeyRegistration(){mn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!r)return this._returnResult({data:null,error:new gt});const{data:u,error:d}=await W(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return d?this._returnResult({data:null,error:d}):this._returnResult({data:u,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyRegistration(n){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new gt});const{data:d,error:h}=await W(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:l.access_token,body:{challenge_id:n.challengeId,credential:n.credential}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:d,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(n){var r;mn(this.experimental);try{const{data:l,error:u}=await W(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=n?.options)===null||r===void 0?void 0:r.captchaToken}}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})}catch(l){if(Y(l))return this._returnResult({data:null,error:l});throw l}}async _verifyPasskeyAuthentication(n){mn(this.experimental);try{const{data:r,error:l}=await W(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:n.challengeId,credential:n.credential},xform:rn});return l?this._returnResult({data:null,error:l}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){mn(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;if(l)return this._returnResult({data:null,error:l});if(!r)return this._returnResult({data:null,error:new gt});const{data:u,error:d}=await W(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:h=>({data:h,error:null})});return d?this._returnResult({data:null,error:d}):this._returnResult({data:u,error:null})})}catch(n){if(Y(n))return this._returnResult({data:null,error:n});throw n}}async _updatePasskey(n){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new gt});const{data:d,error:h}=await W(this.fetch,"PATCH",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,body:{friendly_name:n.friendlyName}});return h?this._returnResult({data:null,error:h}):this._returnResult({data:d,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(n){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:l},error:u}=r;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new gt});const{error:d}=await W(this.fetch,"DELETE",`${this.url}/passkeys/${n.passkeyId}`,{headers:this.headers,jwt:l.access_token,noResolveJson:!0});return d?this._returnResult({data:null,error:d}):this._returnResult({data:null,error:null})})}catch(r){if(Y(r))return this._returnResult({data:null,error:r});throw r}}}Ks.nextInstanceID={};const yS=Ks,vS="2.110.0";let Ls="",Lo;if(typeof Deno<"u"){var ld;Ls="deno",Lo=(ld=Deno.version)===null||ld===void 0?void 0:ld.deno}else if(typeof document<"u")Ls="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Ls="react-native";else{var od;Ls="node",Lo=typeof process<"u"?(od=process.version)===null||od===void 0?void 0:od.replace(/^v/,""):void 0}const Up=[`runtime=${Ls}`];Lo&&Up.push(`runtime-version=${Lo}`);const bS={"X-Client-Info":`supabase-js/${vS}; ${Up.join("; ")}`},wS={headers:bS},SS={schema:"public"},_S={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},TS={},kS={enabled:!1,respectSamplingDecision:!0};function ES(i,n,r,l){function u(d){return d instanceof r?d:new r(function(h){h(d)})}return new(r||(r=Promise))(function(d,h){function m(w){try{p(l.next(w))}catch(b){h(b)}}function g(w){try{p(l.throw(w))}catch(b){h(b)}}function p(w){w.done?d(w.value):u(w.value).then(m,g)}p((l=l.apply(i,[])).next())})}let ud=null;const AS="@opentelemetry/api";function CS(){return ud===null&&(ud=import(AS).catch(()=>null)),ud}function xS(){return ES(this,void 0,void 0,function*(){try{const i=yield CS();if(!i||!i.propagation||!i.context)return null;const n={};i.propagation.inject(i.context.active(),n);const r=n.traceparent;return r?{traceparent:r,tracestate:n.tracestate,baggage:n.baggage}:null}catch{return null}})}function OS(i){if(!i||typeof i!="string")return null;const n=i.split("-");if(n.length!==4)return null;const[r,l,u,d]=n;if(r.length!==2||l.length!==32||u.length!==16||d.length!==2)return null;const h=/^[0-9a-f]+$/i;return!h.test(r)||!h.test(l)||!h.test(u)||!h.test(d)||l==="00000000000000000000000000000000"||u==="0000000000000000"?null:{version:r,traceId:l,parentId:u,traceFlags:d,isSampled:(parseInt(d,16)&1)===1}}function RS(i,n){if(!i||!n||n.length===0)return!1;let r;if(i instanceof URL)r=i;else try{r=new URL(i)}catch{return!1}for(const l of n)try{if(typeof l=="string"){if(jS(r.hostname,l))return!0}else if(l instanceof RegExp){if(l.test(r.hostname))return!0}else if(typeof l=="function"&&l(r))return!0}catch{continue}return!1}function jS(i,n){if(n===i)return!0;if(n.startsWith("*.")){const r=n.slice(2);if(i.endsWith(r)&&(i===r||i.endsWith("."+r)))return!0}return!1}function NS(i){const n=[];try{const r=new URL(i);n.push(r.hostname)}catch{}return n.push("*.supabase.co","*.supabase.in"),n.push("localhost","127.0.0.1","[::1]"),n}function Ys(i){"@babel/helpers - typeof";return Ys=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},Ys(i)}function LS(i,n){if(Ys(i)!="object"||!i)return i;var r=i[Symbol.toPrimitive];if(r!==void 0){var l=r.call(i,n);if(Ys(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(i)}function DS(i){var n=LS(i,"string");return Ys(n)=="symbol"?n:n+""}function US(i,n,r){return(n=DS(n))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,i}function ap(i,n){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);n&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),r.push.apply(r,l)}return r}function Qe(i){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ap(Object(r),!0).forEach(function(l){US(i,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):ap(Object(r)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(r,l))})}return i}const MS=i=>i?(...n)=>i(...n):(...n)=>fetch(...n),zS=()=>Headers,BS=(i,n,r,l,u)=>{const d=MS(l),h=zS(),m=u?.enabled===!0,g=u?.respectSamplingDecision!==!1,p=m?NS(n):null;return async(w,b)=>{var T;const S=(T=await r())!==null&&T!==void 0?T:i;let x=new h(b?.headers);if(x.has("apikey")||x.set("apikey",i),x.has("Authorization")||x.set("Authorization",`Bearer ${S}`),p){const O=await HS(w,p,g);O&&(O.traceparent&&!x.has("traceparent")&&x.set("traceparent",O.traceparent),O.tracestate&&!x.has("tracestate")&&x.set("tracestate",O.tracestate),O.baggage&&!x.has("baggage")&&x.set("baggage",O.baggage))}return d(w,Qe(Qe({},b),{},{headers:x}))}};async function HS(i,n,r){if(!RS(typeof i=="string"||i instanceof URL?i:i.url,n))return null;const l=await xS();if(!l||!l.traceparent)return null;if(r){const u=OS(l.traceparent);if(u&&!u.isSampled)return null}return l}function ip(i){return typeof i=="boolean"?{enabled:i}:i}function $S(i){return i.endsWith("/")?i:i+"/"}function qS(i,n){var r,l,u,d,h,m;const{db:g,auth:p,realtime:w,global:b}=i,{db:T,auth:S,realtime:x,global:O}=n,I=ip(i.tracePropagation),$=ip(n.tracePropagation),H={db:Qe(Qe({},T),g),auth:Qe(Qe({},S),p),realtime:Qe(Qe({},x),w),storage:{},global:Qe(Qe(Qe({},O),b),{},{headers:Qe(Qe({},(r=O?.headers)!==null&&r!==void 0?r:{}),(l=b?.headers)!==null&&l!==void 0?l:{})}),tracePropagation:{enabled:(u=(d=I?.enabled)!==null&&d!==void 0?d:$?.enabled)!==null&&u!==void 0?u:!1,respectSamplingDecision:(h=(m=I?.respectSamplingDecision)!==null&&m!==void 0?m:$?.respectSamplingDecision)!==null&&h!==void 0?h:!0},accessToken:async()=>""};return i.accessToken?H.accessToken=i.accessToken:delete H.accessToken,H}function PS(i){const n=i?.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($S(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var IS=class extends yS{constructor(i){super(i)}},GS=class{constructor(i,n,r){var l,u;this.supabaseUrl=i,this.supabaseKey=n;const d=PS(i);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",d),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",d),this.storageUrl=new URL("storage/v1",d),this.functionsUrl=new URL("functions/v1",d);const h=`sb-${d.hostname.split(".")[0]}-auth-token`,m={db:SS,realtime:TS,auth:Qe(Qe({},_S),{},{storageKey:h}),global:wS,tracePropagation:kS},g=qS(r??{},m);if(this.settings=g,this.storageKey=(l=g.auth.storageKey)!==null&&l!==void 0?l:"",this.headers=(u=g.global.headers)!==null&&u!==void 0?u:{},g.accessToken)this.accessToken=g.accessToken,this.auth=new Proxy({},{get:(w,b)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(b)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=g.auth)!==null&&p!==void 0?p:{},this.headers,g.global.fetch)}this.fetch=BS(n,i,this._getAccessToken.bind(this),g.global.fetch,g.tracePropagation),this.realtime=this._initRealtimeClient(Qe({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},g.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(w=>this.realtime.setAuth(w)).catch(w=>console.warn("Failed to set initial Realtime auth token:",w)),this.rest=new F0(new URL("rest/v1",d).href,{headers:this.headers,schema:g.db.schema,fetch:this.fetch,timeout:g.db.timeout,urlLengthLimit:g.db.urlLengthLimit}),this.storage=new yw(this.storageUrl.href,this.headers,this.fetch,r?.storage),g.accessToken||this._listenForAuthEvents()}get functions(){return new G0(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(i){return this.rest.from(i)}schema(i){return this.rest.schema(i)}rpc(i,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(i,n,r)}channel(i,n={config:{}}){return this.realtime.channel(i,n)}getChannels(){return this.realtime.getChannels()}removeChannel(i){return this.realtime.removeChannel(i)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var i=this,n,r;if(i.accessToken)return await i.accessToken();const{data:l}=await i.auth.getSession();return(n=(r=l.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:i.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:i,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:u,storageKey:d,flowType:h,lock:m,debug:g,throwOnError:p,experimental:w,lockAcquireTimeout:b,skipAutoInitialize:T},S,x){const O={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new IS({url:this.authUrl.href,headers:Qe(Qe({},O),S),storageKey:d,autoRefreshToken:i,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:u,flowType:h,lock:m,debug:g,throwOnError:p,experimental:w,fetch:x,lockAcquireTimeout:b,skipAutoInitialize:T,hasCustomAuthorizationHeader:Object.keys(this.headers).some(I=>I.toLowerCase()==="authorization")})}_initRealtimeClient(i){return new qb(this.realtimeUrl.href,Qe(Qe({},i),{},{params:Qe(Qe({},{apikey:this.supabaseKey}),i?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((i,n)=>{this._handleTokenChanged(i,"CLIENT",n?.access_token)})}_handleTokenChanged(i,n,r){(i==="TOKEN_REFRESHED"||i==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):i==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const VS=(i,n,r)=>new GS(i,n,r);function KS(){if(typeof window<"u")return!1;const i=globalThis.process;if(!i)return!1;const n=i.version;if(n==null)return!1;const r=n.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}KS()&&console.warn("⚠️ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const YS="https://otbyfkjxrkngvjziawki.supabase.co",JS="sb_publishable_NpUs0RDJH2YnllsqTKO6TQ_1jTdSsNQ",An=VS(YS,JS,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"pkce",storageKey:"livedesk.mindexec.supabase.auth"}}),cd=new WeakMap;function XS(i){return String(i.frameMode||i.mode||"").toLowerCase()==="mode2-lz4"||String(i.compression||"").toLowerCase()==="lz4"||String(i.mimeType||"").toLowerCase()==="application/vnd.livedesk.lz4-raw"}function QS(i){return String(i.frameMode||i.mode||"").toLowerCase()==="mode3-h264-hw"||String(i.codec||"").toLowerCase()==="h264"||String(i.mimeType||"").toLowerCase()==="video/h264"}function rp(i,n,r){let l=r,u=n;if(l===15){let d=255;for(;d===255;){if(u>=i.length)throw new Error("Invalid LZ4 block: length overrun.");d=i[u],u+=1,l+=d}}return{length:l,cursor:u}}function ZS(i,n){const r=new Uint8Array(n);let l=0,u=0;for(;l<i.length;){const d=i[l];l+=1;const h=rp(i,l,d>>4);l=h.cursor;const m=h.length;if(l+m>i.length||u+m>r.length)throw new Error("Invalid LZ4 block: literal overrun.");if(r.set(i.subarray(l,l+m),u),l+=m,u+=m,l>=i.length)break;if(l+2>i.length)throw new Error("Invalid LZ4 block: missing offset.");const g=i[l]|i[l+1]<<8;if(l+=2,g<=0||g>u)throw new Error("Invalid LZ4 block: bad match offset.");const p=rp(i,l,d&15);l=p.cursor;const w=p.length+4;if(u+w>r.length)throw new Error("Invalid LZ4 block: match overrun.");let b=u-g;for(let T=0;T<w;T+=1)r[u]=r[b],u+=1,b+=1}if(u!==r.length)throw new Error("Invalid LZ4 block: incomplete output.");return r}function WS(i){const n=Math.max(1,Math.floor(i.width||0)),r=Math.max(1,Math.floor(i.height||0)),l=Math.max(1,Math.floor(i.bytesPerPixel||4)),u=Math.max(n*r*l,Math.floor(i.uncompressedByteLength||0)),d=ZS(new Uint8Array(i.payload),u),h=String(i.pixelFormat||i.codec||"").toLowerCase();if(l!==4)throw new Error(`Unsupported mode2 pixel size: ${l}`);const m=new Uint8ClampedArray(n*r*4);if(h==="rgba32"||h==="rgba")m.set(d.subarray(0,m.length));else for(let g=0,p=0;p<m.length;g+=4,p+=4)m[p]=d[g+2],m[p+1]=d[g+1],m[p+2]=d[g],m[p+3]=d[g+3];return new ImageData(m,n,r)}function FS(i){const n=window.VideoDecoder;if(!n||!window.EncodedVideoChunk)throw new Error("WebCodecs H.264 decode is not supported in this browser.");const r=cd.get(i);if(r&&r.decoder.state!=="closed")return r;const u={decoder:new n({output:d=>{try{const h=d.displayWidth||d.codedWidth||i.width||960,m=d.displayHeight||d.codedHeight||i.height||540;(i.width!==h||i.height!==m)&&(i.width=h,i.height=m),i.getContext("2d")?.drawImage(d,0,0,h,m)}finally{d.close()}},error:()=>{cd.delete(i)}}),configured:!1,keyFrameSeen:!1};return cd.set(i,u),u}function e_(i,n){const r=FS(i);if(!r.configured){const d={codec:"avc1.42E01E",codedWidth:Math.max(1,Math.floor(n.width||960)),codedHeight:Math.max(1,Math.floor(n.height||540)),hardwareAcceleration:"prefer-hardware",optimizeForLatency:!0,avc:{format:String(n.h264Format||"").toLowerCase()==="avc"?"avc":"annexb"}};r.decoder.configure(d),r.configured=!0}const l=n.isKeyFrame===!0||String(n.chunkType||"").toLowerCase()==="key";if(!l&&!r.keyFrameSeen)return;l&&(r.keyFrameSeen=!0);const u=new EncodedVideoChunk({type:l?"key":"delta",timestamp:Math.max(0,Math.floor(n.timestampUs||n.frameSeq*1e3)),duration:Math.max(0,Math.floor(n.durationUs||0))||void 0,data:n.payload});r.decoder.decode(u)}async function t_(i,n,r){if(QS(n)){r()||e_(i,n);return}if(XS(n)){const g=WS(n);if(r())return;(i.width!==g.width||i.height!==g.height)&&(i.width=g.width,i.height=g.height),i.getContext("2d")?.putImageData(g,0,0);return}const l=new Blob([n.payload],{type:n.mimeType}),u=await createImageBitmap(l);if(r()){u.close();return}const d=n.width||u.width||960,h=n.height||u.height||540;(i.width!==d||i.height!==h)&&(i.width=d,i.height=h);const m=i.getContext("2d");m&&(m.clearRect(0,0,d,h),m.drawImage(u,0,0,d,h)),u.close()}const zs=5179,Rt=Xs(`http://127.0.0.1:${zs}`);function n_(i){const n=i.split(".").map(r=>Number(r));return n.length===4&&n.every(r=>Number.isInteger(r)&&r>=0&&r<=255)?n:[]}function a_(i){const n=i.trim().toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="[::1]"}function i_(i){const n=i.trim().toLowerCase();return!n||n==="0.0.0.0"||n==="::"||n==="[::]"}function r_(i){const n=n_(i);return n.length===0?!1:n[0]===10||n[0]===172&&n[1]>=16&&n[1]<=31||n[0]===192&&n[1]===168}function s_(i){return i.includes(":")&&!i.startsWith("[")?`[${i}]`:i}function l_(i){const n=String(i||"").trim();if(!n)return null;const r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`tcp://${n}`;try{const l=new URL(r),u=l.hostname.replace(/^\[|\]$/g,""),d=Number(l.port);return!u||!Number.isInteger(d)||d<1||d>65535||i_(u)?null:{host:u,port:d}}catch{return null}}function Xs(i){const n=String(i||"").trim()||`http://127.0.0.1:${zs}`,r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`http://${n}`;try{const l=new URL(r);return l.port||(l.port=String(zs)),l.hash="",l.search="",l.toString().replace(/\/+$/,"")}catch{return`http://127.0.0.1:${zs}`}}function o_(i){const n=l_(i);return n?Xs(`http://${s_(n.host)}:${zs}`):""}function sp(i){const r=[i?.endpoint,...Array.isArray(i?.endpoint_candidates)?i.endpoint_candidates:[]].map(l=>o_(String(l||""))).filter(Boolean);return[...new Set(r)]}function Bs(i=Rt){if(!(typeof window>"u"||window.location.protocol!=="https:"))try{const n=new URL(i);if(n.protocol!=="http:")return;if(a_(n.hostname))return"loopback";if(r_(n.hostname))return"local"}catch{return}}function Rd(i,n=Rt){const r=new URL(i,Xs(n));return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}async function gn(i,n,r=Rt){const l=Xs(r),u={...n,headers:{"Content-Type":"application/json",...n?.headers||{}},cache:"no-store"},d=Bs(l);d&&(u.targetAddressSpace=d);let h;try{h=await fetch(`${l}${i}`,u)}catch(m){throw d?new Error("LiveDesk Hub is not reachable at this local network address. If Chrome shows a local network prompt, allow it; otherwise restart the Hub so port 5179 is open on the network."):m}if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return await h.json()}function u_(i){if(!i)return"-";const n=Date.now()-Date.parse(i);return Number.isFinite(n)?n<1e3?"now":n<6e4?`${Math.round(n/1e3)}s`:n<36e5?`${Math.round(n/6e4)}m`:`${Math.round(n/36e5)}h`:"-"}async function xs(i){await navigator.clipboard.writeText(i)}const lp="livedesk_remote_host_targets",c_="livedesk_entitlements";function d_(i){const r=(Array.isArray(i)?i:[i||Rt]).map(l=>Xs(l||Rt));return[...new Set(r.filter(Boolean))]}function h_(){const[i,n]=P.useState(null),[r,l]=P.useState(!0);return P.useEffect(()=>{let u=!0;An.auth.getSession().then(({data:h})=>{u&&(n(h.session??null),l(!1))});const{data:{subscription:d}}=An.auth.onAuthStateChange((h,m)=>{n(m),l(!1)});return()=>{u=!1,d.unsubscribe()}},[]),{session:i,loading:r}}function f_(i,n=!0){const[r,l]=P.useState(null),[u,d]=P.useState([]),[h,m]=P.useState(""),[g,p]=P.useState(""),[w,b]=P.useState(0),T=Array.isArray(i)?i.join(`
|
|
38
|
-
`):String(i||""),S=P.useMemo(()=>d_(i),[T]),x=P.useMemo(()=>S.find($=>Bs($)==="loopback")||S[0]||Rt,[S]),O=P.useCallback(async()=>{if(!n){l(null),d([]),p(""),m("");return}let $=null;for(const H of S)try{const[q,X]=await Promise.all([gn("/api/remote/status",void 0,H),gn("/api/remote/devices",void 0,H)]);l(q),d(X.devices||[]),p(H),m("");return}catch(q){$=q}throw p(""),$||new Error("No LiveDesk Hub endpoint is reachable.")},[n,S]),I=P.useCallback(()=>{O().catch($=>{m($ instanceof Error?$.message:String($))}),b($=>$+1)},[O]);return P.useEffect(()=>{if(!n){l(null),d([]),p(""),m("");return}let $=!0;const H=async()=>{try{await O()}catch(X){$&&m(X instanceof Error?X.message:String(X))}};H();const q=window.setInterval(H,2500);return()=>{$=!1,window.clearInterval(q)}},[n,O,w]),{status:r,devices:u,error:h,refresh:I,hubBaseUrl:g||x,hubCandidates:S}}function m_(i){const[n,r]=P.useState(null),[l,u]=P.useState(""),d=i?.user?.id||"",h=P.useCallback(async()=>{if(!d){r(null);return}const{data:m,error:g}=await An.from(lp).select("*").eq("user_id",d).maybeSingle();if(g){u(g.message);return}r(m),u("")},[d]);return P.useEffect(()=>{h()},[h]),P.useEffect(()=>{if(!d)return;const m=An.channel(`livedesk-remote-host-targets-${d.replace(/[^a-zA-Z0-9]/g,"")}`).on("postgres_changes",{event:"*",schema:"public",table:lp,filter:`user_id=eq.${d}`},g=>r(g.new)).subscribe();return()=>{An.removeChannel(m)}},[d]),{target:n,error:l,refresh:h}}function g_(i){const[n,r]=P.useState(null),[l,u]=P.useState(!1),[d,h]=P.useState(""),m=i?.user?.id||"",g=P.useCallback(async()=>{if(!m){r(null),h(""),u(!1);return}u(!0);const{data:w,error:b}=await An.from(c_).select("*").eq("user_id",m).eq("product_key","livedesk").maybeSingle();if(b){h(b.message),u(!1);return}r(w),h(""),u(!1)},[m]);P.useEffect(()=>{g()},[g]);const p=P.useMemo(()=>!n||n.status!=="active"?!1:n.expires_at?new Date(n.expires_at).getTime()>Date.now():!0,[n]);return{entitlement:n,licensed:p,loading:l,error:d,refresh:g}}function p_(i,n,r=Rt){const[l,u]=P.useState(new Map),[d,h]=P.useState("idle"),m=P.useMemo(()=>[...i].sort().join(","),[i]);return P.useEffect(()=>{const g=m?m.split(",").filter(Boolean):[];if(g.length===0){h("idle"),u(new Map);return}const p=new WebSocket(Rd(`/api/remote/frames/ws?devices=${encodeURIComponent(g.join(","))}`,r));return p.binaryType="arraybuffer",h("connecting"),p.addEventListener("open",()=>{h("open"),p.send(JSON.stringify({type:"subscribe",deviceIds:g,autoStartLive:n,fps:2,maxWidth:640,maxHeight:360,quality:45,mode:"mode3-h264-hw"}))}),p.addEventListener("message",w=>{if(typeof w.data=="string")return;const b=w.data instanceof ArrayBuffer?w.data:null;if(!b||b.byteLength<5)return;const S=new DataView(b).getUint32(0,!1);if(S<=0||S+4>b.byteLength)return;const x=new Uint8Array(b.slice(4,4+S)),O=JSON.parse(new TextDecoder().decode(x)),I=b.slice(4+S),$={deviceId:String(O.deviceId||""),kind:O.kind==="thumbnail"?"thumbnail":"live",frameSeq:Number(O.frameSeq||0),streamId:String(O.streamId||""),width:Number(O.width||0),height:Number(O.height||0),mimeType:String(O.mimeType||"image/jpeg"),mode:O.mode?String(O.mode):void 0,frameMode:O.frameMode?String(O.frameMode):void 0,frameProfile:O.frameProfile?String(O.frameProfile):void 0,encoding:O.encoding?String(O.encoding):void 0,codec:O.codec?String(O.codec):void 0,compression:O.compression?String(O.compression):void 0,pixelFormat:O.pixelFormat?String(O.pixelFormat):void 0,bytesPerPixel:Number(O.bytesPerPixel||0)||0,uncompressedByteLength:Number(O.uncompressedByteLength||0)||0,h264Format:O.h264Format?String(O.h264Format):void 0,isKeyFrame:O.isKeyFrame===!0,chunkType:O.chunkType?String(O.chunkType):void 0,timestampUs:Number(O.timestampUs||0)||0,durationUs:Number(O.durationUs||0)||0,hardwareEncoder:O.hardwareEncoder?String(O.hardwareEncoder):void 0,platformProfile:O.platformProfile?String(O.platformProfile):void 0,capturedAt:String(O.capturedAt||""),receivedAt:String(O.receivedAt||""),byteLength:Number(O.byteLength||I.byteLength),contentHash:O.contentHash?String(O.contentHash):void 0,payload:I};$.deviceId&&u(H=>{const q=H.get($.deviceId);if(q&&q.frameSeq>$.frameSeq)return H;const X=new Map(H);return X.set($.deviceId,$),X})}),p.addEventListener("error",()=>h("error")),p.addEventListener("close",()=>h("closed")),()=>{p.close()}},[n,m,r]),{frames:l,state:d}}function y_(i,n=Rt){const r=P.useRef(null),[l,u]=P.useState("idle");P.useEffect(()=>{if(!i){r.current?.close(),r.current=null,u("idle");return}const h=new WebSocket(Rd("/api/remote/input/ws",n));return r.current=h,u("connecting"),h.addEventListener("open",()=>u("open")),h.addEventListener("close",()=>u("closed")),h.addEventListener("error",()=>u("error")),()=>{h.close(),r.current===h&&(r.current=null)}},[i,n]);const d=P.useCallback((h,m)=>{const g=r.current;return!g||g.readyState!==WebSocket.OPEN||!h?!1:(g.send(JSON.stringify({type:"input",requestId:crypto.randomUUID(),deviceId:h,input:{...m,issuedAt:new Date().toISOString()}})),!0)},[]);return{state:l,sendInput:d}}function v_(i){const n=String(i||"").toLowerCase();return n.includes("audio/pcm")||n.includes("audio/l16")||n.includes("f32le")||n.includes("s16le")}function b_(i,n,r){const l=Math.max(1,Math.min(8,Math.floor(n.channels||2))),u=Math.max(8e3,Math.min(192e3,Math.floor(n.sampleRate||48e3))),d=String(n.mimeType||"").toLowerCase(),h=d.includes("s16le")||d.includes("audio/l16"),m=h?2:4,g=Math.floor(r.byteLength/m),p=Math.floor(g/l),w=i.createBuffer(l,p,u),b=new DataView(r);for(let T=0;T<l;T+=1){const S=w.getChannelData(T);for(let x=0;x<p;x+=1){const I=(x*l+T)*m;S[x]=h?Math.max(-1,Math.min(1,b.getInt16(I,!0)/32768)):Math.max(-1,Math.min(1,b.getFloat32(I,!0)))}}return w}function w_(i,n,r=Rt){const l=P.useRef(null),u=P.useRef(0),[d,h]=P.useState("idle"),[m,g]=P.useState(null),[p,w]=P.useState("");return P.useEffect(()=>{if(!n||!i){h("idle"),g(null),w("");return}const b=window.AudioContext||window.webkitAudioContext;if(!b){h("unsupported"),w("Audio playback is not supported in this browser.");return}const T=new b;l.current=T,u.current=T.currentTime;const S=new WebSocket(Rd(`/api/remote/audio/ws?devices=${encodeURIComponent(i)}`,r));S.binaryType="arraybuffer";let x=!1;return h("connecting"),w(""),S.addEventListener("open",()=>{x||(h("open"),S.send(JSON.stringify({type:"subscribe",deviceIds:[i]})),T.resume())}),S.addEventListener("message",O=>{if(typeof O.data=="string")return;const I=O.data instanceof ArrayBuffer?O.data:null;!I||I.byteLength<5||(async()=>{try{const H=new DataView(I).getUint32(0,!1);if(H<=0||H+4>I.byteLength)return;const q=new Uint8Array(I.slice(4,4+H)),X=JSON.parse(new TextDecoder().decode(q)),me=I.slice(4+H),ie={deviceId:String(X.deviceId||""),frameSeq:Number(X.frameSeq||0),streamId:String(X.streamId||""),mimeType:String(X.mimeType||"audio/webm;codecs=opus"),sampleRate:Number(X.sampleRate||48e3),channels:Number(X.channels||2),capturedAt:String(X.capturedAt||""),receivedAt:String(X.receivedAt||""),byteLength:Number(X.byteLength||me.byteLength),payload:me};if(!ie.deviceId||x)return;const J=v_(ie.mimeType)?b_(T,ie,me):await T.decodeAudioData(me.slice(0));if(x)return;const xe=T.createBufferSource();xe.buffer=J,xe.connect(T.destination);const Te=Math.max(T.currentTime+.02,u.current);xe.start(Te),u.current=Te+J.duration,g(ie),h("playing")}catch($){x||(h("error"),w($ instanceof Error?$.message:String($)))}})()}),S.addEventListener("error",()=>{x||h("error")}),S.addEventListener("close",()=>{x||h("closed")}),()=>{x=!0,S.close(),T.close().catch(()=>{}),l.current===T&&(l.current=null)}},[i,n,r]),{state:d,lastFrame:m,error:p}}const S_=120,__=999,dr=4,Mp="livedesk.remoteDirectory",Cd="livedesk.localHubAccessEnabled",T_=24*1024*1024;function Hs(i,n){const r=i.capabilities?.[n];return typeof r=="boolean"?r:/^(1|true|yes|on)$/i.test(String(r||"").trim())}function Eo(i){return i.deviceName||i.hostname||i.deviceId}function k_(){return"npx -y livedesk client"}function E_(){return"npx -y livedesk"}function A_(){try{return localStorage.getItem(Mp)||""}catch{return""}}function C_(){try{return localStorage.getItem(Cd)==="1"}catch{return!1}}function hr(i){try{i?localStorage.setItem(Cd,"1"):localStorage.removeItem(Cd)}catch{}}function op(i,n){return i.length!==n.length?!1:i.every((r,l)=>r===n[l])}function _i(i){if(!Number.isFinite(i)||i<=0)return"0 B";const n=["B","KB","MB","GB","TB"];let r=i,l=0;for(;r>=1024&&l<n.length-1;)r/=1024,l+=1;const u=l===0||r>=100?0:1;return`${r.toFixed(u)} ${n[l]}`}function x_(i){const n=new Uint8Array(i),r=32768;let l="";for(let u=0;u<n.length;u+=r){const d=n.subarray(u,u+r);l+=String.fromCharCode(...d)}return btoa(l)}function O_(i){return i===1?"middle":i===2?"right":"left"}function up(i,...n){for(const r of n){const l=i?.[r];if(typeof l=="string"&&l.trim())return l.trim()}return""}function Os(i){const n=Number(i);return Number.isInteger(n)&&n>=1&&n<=__?n:0}const R_={cpu:"CPU",memory:"MEM",disk:"Disk",gpu:"GPU",npu:"NPU",temp:"Temp",network:"Net"};function j_(i,n,r){if(i==="online")return"Online";if(i==="busy")return"Busy";if(i==="stale")return"Stale";if(i==="offline")return"Offline";if(r==="failed")return"Task failed";const l=i==="critical"?"critical":"warn",u=n.find(h=>h.state===l)||n.find(h=>h.state==="critical"||h.state==="warn");if(!u)return i==="critical"?"Issue":"Check";const d=R_[u.id]||u.label;return u.value&&u.value!=="-"?`${d} ${u.value}`:d}function Bo(i,n){const r=n.split(".");let l=i;for(const u of r){if(l==null)return;if(Array.isArray(l)){const d=Number(u);l=Number.isInteger(d)?l[d]:void 0;continue}if(typeof l=="object"){l=l[u];continue}return}return l}function Ke(i,...n){for(const r of n){const l=Bo(i,r),u=Number(l);if(Number.isFinite(u))return u}}function Bt(i,...n){for(const r of n){const l=Bo(i,r);if(typeof l=="string"&&l.trim())return l.trim();if(typeof l=="number"&&Number.isFinite(l))return String(l)}return""}function N_(i,...n){for(const r of n){const l=Bo(i,r);if(typeof l=="boolean")return l;if(/^(1|true|yes|on|online|running|ready)$/i.test(String(l||"").trim()))return!0;if(/^(0|false|no|off|offline|stopped|missing)$/i.test(String(l||"").trim()))return!1}}function ta(i){const n=Number(i);if(Number.isFinite(n))return Math.max(0,Math.min(1,n>1?n/100:n))}function dd(i,n){if(!(typeof i!="number"||typeof n!="number"||!Number.isFinite(i)||!Number.isFinite(n)||i<=0))return ta((i-Math.max(0,n))/i)}function Rs(i){return i===void 0?"-":`${Math.round(i*100)}%`}function hd(i){return i===void 0||!Number.isFinite(i)?"":i>=1e3?`${(i/1e3).toFixed(i>=1e4?0:1)}Gb/s`:`${Math.round(i)}Mb/s`}function fr(i,n=.92,r=.78){return i===void 0?"unknown":i>=n?"critical":i>=r?"warn":"good"}function zp(i){return!Number.isFinite(i)||!i||i<=0?"-":i<3600?`${Math.round(i/60)}m`:i<86400?`${Math.round(i/3600)}h`:`${Math.round(i/86400)}d`}function To(i,n,r){const l=Bo(i,`tools.${n}`),u=Bt(i,`tools.${n}.status`,`tooling.${n}.status`,`${n}.status`).toLowerCase(),d=N_(i,`tools.${n}.running`,`tooling.${n}.running`,`${n}.running`),h=Bt(i,`tools.${n}.version`,`tooling.${n}.version`,`${n}.version`),m=Bt(i,`tools.${n}.port`,`tooling.${n}.port`,`${n}.port`);let g="unknown";return u==="busy"?g="busy":["online","running","ready","active"].includes(u)||d===!0?g="online":(["offline","stopped","missing","not-found"].includes(u)||d===!1||l===!1)&&(g="offline"),{id:n,label:r,status:g,detail:g==="offline"?"offline":h||(m?`:${m}`:g==="unknown"?"not reported":g)}}function Bp(i){const n=i.status||{},r=Ke(n,"cpu.cores","cpuCores","processorCount"),l=Ke(n,"loadavg.0","cpu.load1"),u=ta(Ke(n,"cpu.usedRatio","cpu.usageRatio","cpu.ratio","cpu.usedPct","cpu.usagePct","cpu.percent")??(r&&l!==void 0?l/Math.max(1,r):void 0)),d=Ke(n,"memory.totalBytes","totalMem"),h=Ke(n,"memory.freeBytes","freeMem"),m=ta(Ke(n,"memory.usedRatio","memory.usedPct","usedMemRatio"))??dd(d,h),g=Ke(n,"disk.totalBytes","rootDisk.totalBytes","storage.totalBytes"),p=Ke(n,"disk.freeBytes","rootDisk.freeBytes","storage.freeBytes"),w=ta(Ke(n,"disk.usedRatio","disk.usedPct","rootDisk.usedRatio","storage.usedRatio"))??dd(g,p),b=Ke(n,"thermal.cpuC","temperatureC","cpu.temperatureC","gpu.temperatureC"),T=ta(Ke(n,"gpu.usedRatio","gpu.usageRatio","gpu.usedPct","gpu.usagePct","gpu.percent","accelerators.gpu.usageRatio")),S=Bt(n,"gpu.name","gpu.model","accelerators.gpu.name"),x=Ke(n,"gpu.memory.totalBytes","gpu.totalMemoryBytes","gpu.vramTotalBytes"),O=Ke(n,"gpu.memory.freeBytes","gpu.freeMemoryBytes","gpu.vramFreeBytes"),I=ta(Ke(n,"gpu.memory.usedRatio","gpu.vramUsedRatio"))??dd(x,O),$=Ke(n,"gpu.temperatureC","thermal.gpuC"),H=ta(Ke(n,"npu.usedRatio","npu.usageRatio","npu.usedPct","npu.usagePct","npu.percent","accelerators.npu.usageRatio")),q=Bt(n,"npu.name","npu.model","accelerators.npu.name"),X=Ke(n,"npu.tops","npu.topsInt8","accelerators.npu.tops"),me=Ke(n,"network.rxMbps","network.receiveMbps","network.downMbps"),ie=Ke(n,"network.txMbps","network.transmitMbps","network.upMbps"),J=Ke(n,"network.latencyMs","network.rttMs"),xe=ta(Ke(n,"network.usedRatio","network.usageRatio","network.saturationRatio")),Te=Bt(n,"network.link","network.interface","network.name"),sn=b===void 0?void 0:ta((b-35)/60),ot=Bt(n,"workload.role","role","lane")||(Hs(i,"aiAssist")?"Agent worker":Hs(i,"taskDispatch")?"Task worker":"Local machine"),Ne=Bt(i.latestTask,"status")||Bt(n,"workload.status")||"idle",ut=Bt(i.latestTask,"title","instructionPreview")||Bt(n,"workload.title"),ht=Bt(i.latestTask,"resultSummary","error","instructionPreview")||Bt(n,"workload.summary"),Pe=[To(n,"ollama","Ollama"),To(n,"lmStudio","LM Studio"),To(n,"comfyui","ComfyUI"),To(n,"stableDiffusion","Stable Diffusion")],D=Pe.some(U=>U.status!=="unknown"),G=Date.parse(i.lastSeenAt||i.connectedAt||""),ne=Number.isFinite(G)?Date.now()-G:0;let F="online";i.connected?ne>5*6e4?F="stale":(b??0)>=86||($??0)>=88||(u??0)>=.94||(T??0)>=.96||(H??0)>=.96||(m??0)>=.94||(w??0)>=.94||(J??0)>=200||Ne==="failed"?F="critical":(b??0)>=78||($??0)>=80||(u??0)>=.82||(T??0)>=.86||(H??0)>=.86||(m??0)>=.82||(w??0)>=.86||(J??0)>=80?F="warn":(["queued","running","targeted"].includes(Ne)||Pe.some(U=>U.status==="busy"))&&(F="busy"):F="offline";const _e=Pe.filter(U=>U.status==="online"||U.status==="busy").length,E=[{id:"cpu",label:"CPU",value:Rs(u),detail:r?`${r} cores`:l!==void 0?`load ${l.toFixed(1)}`:"not reported",ratio:u,state:fr(u,.92,.78)},{id:"memory",label:"MEM",value:Rs(m),detail:d?`${_i(d-(h||0))} / ${_i(d)}`:"not reported",ratio:m,state:fr(m,.92,.78)},{id:"disk",label:"DISK",value:Rs(w),detail:g&&p!==void 0?`${_i(p)} free`:"not reported",ratio:w,state:fr(w,.92,.82)},{id:"gpu",label:"GPU",value:Rs(T??I),detail:S||(x&&O!==void 0?`${_i(O)} VRAM free`:$!==void 0?`${Math.round($)}C`:"not reported"),ratio:T??I,state:$!==void 0&&$>=88?"critical":$!==void 0&&$>=80?"warn":fr(T??I,.96,.86)},{id:"npu",label:"NPU",value:H!==void 0?Rs(H):X!==void 0?`${Math.round(X)} TOPS`:"-",detail:q||(X!==void 0?"neural engine":"not reported"),ratio:H,state:fr(H,.96,.86)},{id:"temp",label:"TEMP",value:b===void 0?"-":`${Math.round(b)}C`,detail:_e>0?`${_e} local tools`:`uptime ${zp(Ke(n,"uptimeSec"))}`,ratio:sn,state:b===void 0?"unknown":b>=86?"critical":b>=78?"warn":"good"},{id:"network",label:"NET",value:hd(me)||(J!==void 0?`${Math.round(J)}ms`:Te||"-"),detail:hd(ie)?`${hd(ie)} up`:Te||"not reported",ratio:xe,state:J!==void 0&&J>=200?"critical":J!==void 0&&J>=80?"warn":fr(xe,.9,.75)}];return{state:F,label:j_(F,E,Ne),role:ot,taskLabel:ut||(Ne==="idle"?"idle":Ne),taskStatus:Ne,taskSummary:ht,tools:D?Pe:Pe.map(U=>({...U,detail:"not reported"})),metrics:E}}const L_=[{id:"small",label:"Small"},{id:"medium",label:"Medium"},{id:"large",label:"Large"}],D_=[{id:"wall",label:"Wall",icon:fp,accent:"blue"},{id:"control",label:"Control",icon:gd,accent:"red"},{id:"agents",label:"Agents",icon:gr,accent:"violet"},{id:"doc",label:"Doc",icon:fd,accent:"amber"},{id:"pricing",label:"Pricing",icon:md,accent:"green"},{id:"settings",label:"Settings",icon:N0,accent:"gray"}];function tt(i){return i.replace(/\bRemoteHub\b/g,"Hub client endpoint").replace(/\bManagers\b/g,"Hubs").replace(/\bManager\b/g,"Hub").replace(/\bmanager\b/g,"Hub").replace(/\bMANAGER\b/g,"HUB").replace(/매니저/g,"Hub")}function mr(i){return i.map(n=>tt(n))}function Et(i){return{languageName:i.languageName,languageLabel:i.languageLabel,eyebrow:i.eyebrow,title:tt(i.title),intro:tt(i.intro),sections:[{title:tt(i.managerTitle),body:tt(i.managerBody),points:mr(i.managerPoints)},{title:tt(i.clientTitle),body:tt(i.clientBody),points:mr(i.clientPoints)},{title:tt(i.syncTitle),body:tt(i.syncBody),points:mr(i.syncPoints)},{title:tt(i.platformTitle),body:tt(i.platformBody),points:mr(i.platformPoints)}],sync:{title:tt(i.syncTitle),body:tt(i.syncBody),points:mr(i.syncPoints)},firewall:{title:tt(i.firewallTitle),body:tt(i.firewallBody),points:mr(i.firewallPoints)},commands:{title:tt(i.commandsTitle),body:tt(i.commandsBody),manager:tt(i.managerCommandLabel),primary:tt(i.clientCommandLabel),slot:tt(i.slotCommandLabel),manual:tt(i.manualCommandLabel)}}}const _r={ko:Et({languageName:"한국어",languageLabel:"문서 언어",eyebrow:"LiveDesk Manual",title:"한 줄로 여는 로컬 Screen Wall",intro:"LiveDesk는 매니저 PC 한 대에서 여러 작업 PC, AI 박스, 맥미니, 개발 장비를 한 화면에 모니터링하고 필요한 제어를 실행하는 npm-first 원격 작업 데크입니다.",managerTitle:"1. 매니저 실행",managerBody:"화면을 모아 볼 컴퓨터에서 LiveDesk 매니저를 실행합니다. 매니저는 UI와 로컬 서버를 같이 열고 브라우저를 http://127.0.0.1:5179 로 띄웁니다.",managerPoints:["명령은 npx -y livedesk 입니다.","매니저는 Screen Wall/API 포트 5179와 클라이언트 접속 포트 5197을 사용합니다.","기존 LiveDesk 포트가 남아 있으면 기본적으로 정리하고 새로 시작합니다. 필요하면 --no-clean 을 붙입니다."],clientTitle:"2. 워크스테이션 연결",clientBody:"모니터링할 PC에서는 같은 Google 계정으로 로그인합니다. 매니저가 켜져 있지 않아도 클라이언트는 종료하지 않고 5초마다 계속 찾습니다.",clientPoints:["빈 자리에 자동 배치하려면 npx -y livedesk client 를 실행합니다.","자리 번호를 고정하려면 npx -y livedesk client 3 처럼 번호를 붙입니다.","컴퓨터가 많을 때도 다시 로그인하지 않도록 집요하게 재접속을 시도합니다."],syncTitle:"3. Sync Server와 자동 발견",syncBody:"Sync Server는 이 매니저를 현재 계정의 활성 Screen Wall로 Supabase에 등록합니다. 클라이언트는 같은 Google 계정으로 로그인한 뒤 그 기록을 읽고 접속 후보들을 순서대로 시도합니다.",syncPoints:["등록 정보에는 host instance, LAN/private 주소, public 후보 주소, pair token, 짧은 lease가 포함됩니다.","같은 LAN 후보를 먼저 쓰고, 필요하면 외부 주소 후보를 시도합니다.","매니저 위치, VPN, 방화벽, 공유기 설정이 바뀌었거나 개발 중 활성 매니저를 바꿀 때 Sync Server를 누릅니다.","이제 livedesk.pages.dev의 Chrome Local Network Access 허용은 기본 실행 경로가 아닙니다. npm 매니저 앱이 실제 서버입니다."],platformTitle:"4. 현재 플랫폼 상태",platformBody:"Windows는 실제 화면 전송까지 확인되었습니다. macOS와 Linux도 npm 구조로 같은 명령을 목표로 지원을 넓히고 있습니다.",platformPoints:["Windows: 현재 작동 확인.","macOS: manager/client 경로는 준비되어 있으며 화면 캡처와 제어에는 Screen Recording/Accessibility 권한이 필요합니다.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot 캡처, xdotool 입력 백엔드가 추가되었습니다. 오디오는 아직 비활성입니다."],firewallTitle:"방화벽과 외부 장소 연결",firewallBody:"같은 LAN 안에서는 보통 공유기 포트포워딩이 필요 없습니다. 다른 장소의 PC를 붙이려면 클라이언트가 매니저의 클라이언트 접속 포트에 도달할 수 있어야 합니다.",firewallPoints:["클라이언트 접속 포트는 TCP 5197입니다.","클라이언트 쪽은 나가는 연결이므로 보통 인바운드 포트 개방이 필요 없습니다.","다른 네트워크에서 붙일 때는 매니저 PC 방화벽에서 TCP 5197 인바운드를 허용하고, 공유기에서는 TCP 5197을 매니저 PC로 전달합니다.","Screen Wall/API 포트 5179는 매니저 UI용입니다. 외부 브라우저에서 Wall을 직접 열 필요가 있을 때만 별도로 노출을 검토합니다.","공개 인터넷에 바로 열기보다 VPN, Tailscale, ZeroTier, 고정 IP allowlist를 우선합니다."],commandsTitle:"현재 사용 명령",commandsBody:"웹사이트를 찾아가 설치 파일을 받는 방식보다 터미널 한 줄로 모든 운영체제에서 거의 같은 흐름을 쓰는 것이 LiveDesk의 기본 방향입니다.",managerCommandLabel:"매니저 시작",clientCommandLabel:"워크스테이션 연결",slotCommandLabel:"3번 슬롯에 고정",manualCommandLabel:"고급 수동 연결"}),en:Et({languageName:"English",languageLabel:"Document language",eyebrow:"LiveDesk Manual",title:"Open a local Screen Wall with one command",intro:"LiveDesk is an npm-first remote work deck for monitoring many workstations, AI boxes, Mac minis, and dev machines from one manager PC.",managerTitle:"1. Run the manager",managerBody:"Run LiveDesk on the computer that will watch the screens. The manager starts the UI and local server together, then opens http://127.0.0.1:5179.",managerPoints:["The command is npx -y livedesk.","The manager uses port 5179 for the Screen Wall/API and port 5197 for client connections.","If an old LiveDesk process still owns those ports, startup cleans it by default. Add --no-clean when you want to keep it."],clientTitle:"2. Connect a workstation",clientBody:"On each monitored computer, sign in with the same Google account. If no manager is online yet, the client keeps running and retries every 5 seconds.",clientPoints:["Run npx -y livedesk client for first available placement.","Run npx -y livedesk client 3 to pin the machine to slot 3.","Clients keep trying so large workstation stacks do not need repeated sign-in."],syncTitle:"3. Sync Server and discovery",syncBody:"Sync Server publishes this manager as the active Screen Wall for the signed-in account. Clients read that Supabase record after Google sign-in and try the endpoint candidates in order.",syncPoints:["The record includes host instance, LAN/private addresses, public endpoint candidates, pair token, and a short lease.","LAN candidates are preferred first, then public candidates if needed.","Press Sync Server after manager moves, VPN/firewall/router changes, or when this development machine should take over as active manager.","Chrome Local Network Access on livedesk.pages.dev is no longer the default runtime path. The npm manager app is the real server."],platformTitle:"4. Current platform state",platformBody:"Windows has been verified with live screen transfer. macOS and Linux follow the same npm command path as support expands.",platformPoints:["Windows: verified working.","macOS: manager/client paths are prepared; screen capture and control require Screen Recording/Accessibility permissions.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture, and xdotool input backend are added. Audio is still disabled."],firewallTitle:"Firewall and remote locations",firewallBody:"On the same LAN, router forwarding is usually unnecessary. For another office, building, or country, clients must be able to reach the manager client port.",firewallPoints:["Client connection port: TCP 5197.","Client machines normally only need outbound access.","For remote networks, allow inbound TCP 5197 on the manager firewall and forward TCP 5197 from the router to the manager PC.","Screen Wall/API port 5179 is for the manager UI. Expose it only if a remote browser must open the Wall directly.","Prefer VPN, Tailscale, ZeroTier, or fixed-IP allowlists over public internet exposure."],commandsTitle:"Current commands",commandsBody:"The product direction is one terminal command across operating systems instead of finding a website, downloading, and installing manually.",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),ja:Et({languageName:"日本語",languageLabel:"ドキュメント言語",eyebrow:"LiveDesk Manual",title:"1行でローカル Screen Wall を開く",intro:"LiveDesk は、複数の作業 PC、AI マシン、Mac mini、開発機を1台の manager PC から監視する npm-first のリモート作業デッキです。",managerTitle:"1. manager を実行",managerBody:"画面を集めて見るコンピューターで LiveDesk manager を実行します。UI とローカルサーバーが同時に起動し、http://127.0.0.1:5179 が開きます。",managerPoints:["コマンドは npx -y livedesk です。","Screen Wall/API は 5179、client 接続は 5197 を使います。","古い LiveDesk プロセスがポートを使っている場合は、基本的に自動で整理して起動します。"],clientTitle:"2. workstation を接続",clientBody:"監視される PC で同じ Google アカウントにログインします。manager がまだ無くても client は終了せず、5秒ごとに再試行します。",clientPoints:["空きスロットに入れるには npx -y livedesk client を実行します。","スロットを固定するには npx -y livedesk client 3 のように番号を付けます。","大量の PC でも再ログインなしで待ち続けます。"],syncTitle:"3. Sync Server と自動検出",syncBody:"Sync Server はこの manager を現在の Google アカウントの active Screen Wall として Supabase に登録します。",syncPoints:["host instance、LAN/private アドレス、public 候補、pair token、短い lease を登録します。","client は LAN 候補を優先し、必要なら public 候補も試します。","VPN、firewall、router、manager の場所が変わったら Sync Server を押します。","livedesk.pages.dev の Chrome Local Network Access は標準実行経路ではありません。npm manager アプリが実際のサーバーです。"],platformTitle:"4. 現在のプラットフォーム状態",platformBody:"Windows は live screen transfer まで確認済みです。macOS と Linux も同じ npm コマンド経路を目標に対応を広げています。",platformPoints:["Windows: 動作確認済み。","macOS: 画面取得と制御には Screen Recording/Accessibility 権限が必要です。","Linux: linux-x64 runtime、grim/gnome-screenshot/import/scrot capture、xdotool input backend を追加済み。audio は未対応です。"],firewallTitle:"Firewall と外部拠点",firewallBody:"同じ LAN なら通常 router forwarding は不要です。外部拠点では client が manager の接続ポートへ到達できる必要があります。",firewallPoints:["client 接続ポートは TCP 5197 です。","client 側は通常 outbound だけで足ります。","外部 network では manager PC の firewall で TCP 5197 inbound を許可し、router から manager PC へ forward します。","5179 は manager UI 用なので、外部ブラウザで Wall を開く必要がある時だけ公開を検討します。","公開 internet より VPN、Tailscale、ZeroTier、IP allowlist を優先してください。"],commandsTitle:"現在のコマンド",commandsBody:"Web サイトから installer を探すより、OS をまたいで terminal 1行で動かす方向です。",managerCommandLabel:"manager 起動",clientCommandLabel:"workstation 接続",slotCommandLabel:"slot 3 に固定",manualCommandLabel:"高度な手動接続"}),"zh-CN":Et({languageName:"简体中文",languageLabel:"文档语言",eyebrow:"LiveDesk Manual",title:"用一条命令打开本地 Screen Wall",intro:"LiveDesk 是 npm-first 的远程工作台,用一台 manager PC 监控多台工作站、AI 主机、Mac mini 和开发机器。",managerTitle:"1. 运行 manager",managerBody:"在负责查看屏幕的电脑上运行 LiveDesk manager。它会同时启动 UI 和本地服务器,并打开 http://127.0.0.1:5179。",managerPoints:["命令是 npx -y livedesk。","Screen Wall/API 使用 5179,client 连接使用 5197。","如果旧的 LiveDesk 进程占用端口,默认会清理后重新启动。"],clientTitle:"2. 连接 workstation",clientBody:"在被监控的电脑上使用同一个 Google 账号登录。即使 manager 还没在线,client 也会继续运行并每 5 秒重试。",clientPoints:["自动放入空位: npx -y livedesk client。","固定到 3 号位置: npx -y livedesk client 3。","大量电脑也可以持续等待,不需要反复登录。"],syncTitle:"3. Sync Server 和自动发现",syncBody:"Sync Server 会把当前 manager 作为该账号的 active Screen Wall 写入 Supabase。client 登录后读取记录并依次尝试连接候选地址。",syncPoints:["记录包括 host instance、LAN/private 地址、public 候选、pair token 和短 lease。","优先尝试同一 LAN 地址,需要时再尝试外部地址。","manager 位置、VPN、防火墙或路由变化后请点击 Sync Server。","livedesk.pages.dev 的 Chrome Local Network Access 不再是默认运行方式。npm manager app 才是真正服务器。"],platformTitle:"4. 当前平台状态",platformBody:"Windows 已确认可传输实时画面。macOS 和 Linux 正按同一 npm 命令路径扩展支持。",platformPoints:["Windows: 已确认可用。","macOS: 画面捕获和控制需要 Screen Recording/Accessibility 权限。","Linux: 已加入 linux-x64 runtime、grim/gnome-screenshot/import/scrot 捕获、xdotool 输入后端。音频尚未启用。"],firewallTitle:"防火墙和外部地点",firewallBody:"同一 LAN 通常不需要路由端口转发。不同地点连接时,client 必须能访问 manager 的 client 连接端口。",firewallPoints:["client 连接端口是 TCP 5197。","client 机器通常只需要出站访问。","跨网络时,在 manager 防火墙放行 TCP 5197 入站,并在路由器转发到 manager PC。","5179 是 manager UI 端口,仅在需要远程浏览器直接打开 Wall 时考虑暴露。","优先使用 VPN、Tailscale、ZeroTier 或固定 IP allowlist。"],commandsTitle:"当前命令",commandsBody:"产品方向是跨操作系统使用一条终端命令,而不是先找网站、下载、安装。",managerCommandLabel:"启动 manager",clientCommandLabel:"连接 workstation",slotCommandLabel:"固定到 slot 3",manualCommandLabel:"高级手动连接"}),"zh-TW":Et({languageName:"繁體中文",languageLabel:"文件語言",eyebrow:"LiveDesk Manual",title:"用一行指令開啟本機 Screen Wall",intro:"LiveDesk 是 npm-first 的遠端工作台,用一台 manager PC 監看多台工作站、AI 主機、Mac mini 與開發機。",managerTitle:"1. 執行 manager",managerBody:"在負責看畫面的電腦上執行 LiveDesk manager。它會同時啟動 UI 與本機伺服器,並開啟 http://127.0.0.1:5179。",managerPoints:["指令是 npx -y livedesk。","Screen Wall/API 使用 5179,client 連線使用 5197。","若舊的 LiveDesk 程序占用連接埠,預設會清理後重新啟動。"],clientTitle:"2. 連接 workstation",clientBody:"在被監看的電腦上使用同一個 Google 帳號登入。即使 manager 尚未上線,client 也會持續執行並每 5 秒重試。",clientPoints:["自動放入空位: npx -y livedesk client。","固定到 3 號位置: npx -y livedesk client 3。","大量電腦也能持續等待,不需要反覆登入。"],syncTitle:"3. Sync Server 與自動探索",syncBody:"Sync Server 會把目前 manager 登錄為此帳號的 active Screen Wall。client 登入後讀取 Supabase 記錄並依序嘗試連線候選地址。",syncPoints:["記錄包含 host instance、LAN/private 位址、public 候選、pair token 與短 lease。","優先嘗試 LAN 位址,需要時再嘗試外部位址。","manager 位置、VPN、防火牆或路由設定改變後請按 Sync Server。","livedesk.pages.dev 的 Chrome Local Network Access 不再是預設執行路徑。npm manager app 才是真正伺服器。"],platformTitle:"4. 目前平台狀態",platformBody:"Windows 已確認可傳輸即時畫面。macOS 與 Linux 也沿用相同 npm 指令路徑擴充支援。",platformPoints:["Windows: 已確認可用。","macOS: 畫面擷取與控制需要 Screen Recording/Accessibility 權限。","Linux: 已加入 linux-x64 runtime、grim/gnome-screenshot/import/scrot capture、xdotool input backend。音訊尚未啟用。"],firewallTitle:"防火牆與外部地點",firewallBody:"同一 LAN 通常不需要路由器轉發。不同地點連線時,client 必須能到達 manager 的 client 連線埠。",firewallPoints:["client 連線埠是 TCP 5197。","client 電腦通常只需要對外連線。","跨網路時,請在 manager 防火牆允許 TCP 5197 inbound,並從路由器轉發到 manager PC。","5179 是 manager UI 連接埠,只在需要遠端瀏覽器直接打開 Wall 時才考慮公開。","優先使用 VPN、Tailscale、ZeroTier 或固定 IP allowlist。"],commandsTitle:"目前指令",commandsBody:"產品方向是跨作業系統用一行 terminal 指令,而不是先找網站、下載、安裝。",managerCommandLabel:"啟動 manager",clientCommandLabel:"連接 workstation",slotCommandLabel:"固定到 slot 3",manualCommandLabel:"進階手動連線"}),es:Et({languageName:"Español",languageLabel:"Idioma del documento",eyebrow:"LiveDesk Manual",title:"Abre un Screen Wall local con un comando",intro:"LiveDesk es una consola npm-first para vigilar muchas estaciones, cajas de IA, Mac mini y equipos de desarrollo desde un PC manager.",managerTitle:"1. Ejecuta el manager",managerBody:"Ejecuta LiveDesk en el equipo que verá las pantallas. El manager inicia la UI y el servidor local juntos y abre http://127.0.0.1:5179.",managerPoints:["El comando es npx -y livedesk.","El manager usa 5179 para Screen Wall/API y 5197 para conexiones client.","Si un proceso antiguo ocupa los puertos, el arranque lo limpia por defecto."],clientTitle:"2. Conecta una workstation",clientBody:"En cada equipo monitoreado, inicia sesión con la misma cuenta Google. Si el manager aún no está activo, el client sigue intentando cada 5 segundos.",clientPoints:["Usa npx -y livedesk client para el primer slot libre.","Usa npx -y livedesk client 3 para fijar el equipo al slot 3.","Los clients siguen esperando para no repetir login en muchas máquinas."],syncTitle:"3. Sync Server y descubrimiento",syncBody:"Sync Server publica este manager como Screen Wall activo para la cuenta. Los clients leen el registro en Supabase y prueban los endpoints.",syncPoints:["Incluye host instance, direcciones LAN/private, candidatos public, pair token y lease corto.","Primero se prueban candidatos LAN, luego públicos si hace falta.","Pulsa Sync Server después de cambios de manager, VPN, firewall o router.","Chrome Local Network Access en livedesk.pages.dev ya no es el flujo principal. La app npm manager es el servidor real."],platformTitle:"4. Estado de plataformas",platformBody:"Windows ya fue verificado con transferencia de pantalla. macOS y Linux siguen el mismo camino npm.",platformPoints:["Windows: verificado.","macOS: captura y control requieren permisos Screen Recording/Accessibility.","Linux: agregado linux-x64 runtime, captura grim/gnome-screenshot/import/scrot y entrada xdotool. Audio aún desactivado."],firewallTitle:"Firewall y sedes remotas",firewallBody:"En la misma LAN normalmente no hace falta port forwarding. Para otra red, los clients deben llegar al puerto client del manager.",firewallPoints:["Puerto de conexión client: TCP 5197.","Los equipos client normalmente solo necesitan salida.","Para redes remotas, permite TCP 5197 inbound en el manager y reenvía TCP 5197 al PC manager.","El puerto 5179 es para la UI del manager; expónlo solo si un navegador remoto debe abrir el Wall.","Prefiere VPN, Tailscale, ZeroTier o allowlist de IP fijas."],commandsTitle:"Comandos actuales",commandsBody:"La dirección del producto es un comando de terminal común entre sistemas, no descargar e instalar desde una web.",managerCommandLabel:"Iniciar manager",clientCommandLabel:"Conectar workstation",slotCommandLabel:"Fijar al slot 3",manualCommandLabel:"Conexión manual avanzada"}),fr:Et({languageName:"Français",languageLabel:"Langue du document",eyebrow:"LiveDesk Manual",title:"Ouvrir un Screen Wall local en une commande",intro:"LiveDesk est un deck npm-first pour surveiller plusieurs postes, machines IA, Mac mini et machines dev depuis un PC manager.",managerTitle:"1. Lancer le manager",managerBody:"Lancez LiveDesk sur l’ordinateur qui observe les écrans. Le manager démarre l’UI et le serveur local, puis ouvre http://127.0.0.1:5179.",managerPoints:["La commande est npx -y livedesk.","Le manager utilise 5179 pour Screen Wall/API et 5197 pour les connexions client.","Si un ancien processus utilise les ports, le démarrage le nettoie par défaut."],clientTitle:"2. Connecter une workstation",clientBody:"Sur chaque ordinateur surveillé, connectez-vous avec le même compte Google. Si le manager n’est pas encore actif, le client réessaie toutes les 5 secondes.",clientPoints:["Utilisez npx -y livedesk client pour le premier slot libre.","Utilisez npx -y livedesk client 3 pour fixer la machine au slot 3.","Les clients continuent d’attendre pour éviter les reconnexions répétées."],syncTitle:"3. Sync Server et découverte",syncBody:"Sync Server publie ce manager comme Screen Wall actif du compte. Les clients lisent l’enregistrement Supabase et testent les endpoints.",syncPoints:["Il contient host instance, adresses LAN/private, candidats public, pair token et lease court.","Les candidats LAN sont essayés en premier, puis les candidats publics si besoin.","Cliquez Sync Server après un changement de manager, VPN, firewall ou routeur.","Chrome Local Network Access sur livedesk.pages.dev n’est plus le chemin par défaut. L’app npm manager est le vrai serveur."],platformTitle:"4. État des plateformes",platformBody:"Windows est vérifié avec transfert d’écran live. macOS et Linux suivent le même chemin npm.",platformPoints:["Windows: vérifié.","macOS: capture et contrôle nécessitent Screen Recording/Accessibility.","Linux: runtime linux-x64, capture grim/gnome-screenshot/import/scrot et entrée xdotool ajoutés. Audio désactivé."],firewallTitle:"Firewall et sites distants",firewallBody:"Sur le même LAN, le port forwarding est rarement nécessaire. Depuis un autre réseau, les clients doivent atteindre le port client du manager.",firewallPoints:["Port de connexion client: TCP 5197.","Les machines client ont normalement seulement besoin de sortie réseau.","Pour un réseau distant, autorisez TCP 5197 entrant sur le manager et redirigez TCP 5197 vers le PC manager.","Le port 5179 sert à l’UI manager; exposez-le seulement si un navigateur distant doit ouvrir le Wall.","Préférez VPN, Tailscale, ZeroTier ou allowlist IP fixes."],commandsTitle:"Commandes actuelles",commandsBody:"La direction produit est une commande terminal commune aux OS, plutôt qu’un téléchargement manuel depuis un site.",managerCommandLabel:"Démarrer manager",clientCommandLabel:"Connecter workstation",slotCommandLabel:"Fixer au slot 3",manualCommandLabel:"Connexion manuelle avancée"}),de:Et({languageName:"Deutsch",languageLabel:"Dokumentsprache",eyebrow:"LiveDesk Manual",title:"Lokale Screen Wall mit einem Befehl öffnen",intro:"LiveDesk ist ein npm-first Arbeitsdeck, um viele Workstations, AI-Boxen, Mac minis und Dev-Rechner von einem Manager-PC zu überwachen.",managerTitle:"1. Manager starten",managerBody:"Starte LiveDesk auf dem Computer, der die Screens sieht. Der Manager startet UI und lokalen Server zusammen und öffnet http://127.0.0.1:5179.",managerPoints:["Der Befehl ist npx -y livedesk.","Der Manager nutzt 5179 für Screen Wall/API und 5197 für Client-Verbindungen.","Wenn alte LiveDesk-Prozesse Ports belegen, werden sie beim Start standardmäßig bereinigt."],clientTitle:"2. Workstation verbinden",clientBody:"Melde dich auf jedem überwachten Computer mit demselben Google-Konto an. Wenn kein Manager online ist, versucht der Client alle 5 Sekunden weiter.",clientPoints:["npx -y livedesk client nutzt den ersten freien Slot.","npx -y livedesk client 3 fixiert den Rechner auf Slot 3.","Clients warten weiter, damit große Setups kein wiederholtes Login brauchen."],syncTitle:"3. Sync Server und Discovery",syncBody:"Sync Server veröffentlicht diesen Manager als aktive Screen Wall des Kontos. Clients lesen den Supabase-Eintrag und testen Endpoints der Reihe nach.",syncPoints:["Enthält host instance, LAN/private Adressen, public Kandidaten, pair token und kurze lease.","LAN-Kandidaten werden zuerst versucht, danach public Kandidaten.","Nach Änderungen an Manager, VPN, Firewall oder Router Sync Server drücken.","Chrome Local Network Access auf livedesk.pages.dev ist nicht mehr der Standardpfad. Die npm Manager App ist der echte Server."],platformTitle:"4. Plattformstatus",platformBody:"Windows wurde mit Live-Screen-Transfer geprüft. macOS und Linux folgen demselben npm-Pfad.",platformPoints:["Windows: verifiziert.","macOS: Capture und Control brauchen Screen Recording/Accessibility Rechte.","Linux: linux-x64 Runtime, grim/gnome-screenshot/import/scrot Capture und xdotool Input Backend sind ergänzt. Audio ist deaktiviert."],firewallTitle:"Firewall und entfernte Standorte",firewallBody:"Im gleichen LAN ist Router-Forwarding meist unnötig. Aus anderen Netzwerken müssen Clients den Client-Port des Managers erreichen.",firewallPoints:["Client-Verbindungsport: TCP 5197.","Client-Rechner brauchen normalerweise nur ausgehenden Zugriff.","Für entfernte Netzwerke TCP 5197 inbound am Manager erlauben und vom Router zum Manager-PC forwarden.","Port 5179 ist für die Manager-UI; nur öffnen, wenn ein Remote-Browser die Wall direkt öffnen muss.","VPN, Tailscale, ZeroTier oder feste IP-Allowlists bevorzugen."],commandsTitle:"Aktuelle Befehle",commandsBody:"Die Produktlinie ist ein Terminalbefehl über Betriebssysteme hinweg, statt Website suchen, herunterladen und installieren.",managerCommandLabel:"Manager starten",clientCommandLabel:"Workstation verbinden",slotCommandLabel:"An Slot 3 fixieren",manualCommandLabel:"Erweiterte manuelle Verbindung"}),"pt-BR":Et({languageName:"Português",languageLabel:"Idioma do documento",eyebrow:"LiveDesk Manual",title:"Abra um Screen Wall local com um comando",intro:"LiveDesk é um deck npm-first para monitorar várias estações, caixas de IA, Mac minis e máquinas dev a partir de um PC manager.",managerTitle:"1. Execute o manager",managerBody:"Rode LiveDesk no computador que verá as telas. O manager inicia a UI e o servidor local juntos e abre http://127.0.0.1:5179.",managerPoints:["O comando é npx -y livedesk.","O manager usa 5179 para Screen Wall/API e 5197 para conexões client.","Se um processo antigo ocupa as portas, a inicialização limpa por padrão."],clientTitle:"2. Conecte uma workstation",clientBody:"Em cada computador monitorado, entre com a mesma conta Google. Se o manager ainda não estiver online, o client tenta a cada 5 segundos.",clientPoints:["Use npx -y livedesk client para o primeiro slot livre.","Use npx -y livedesk client 3 para fixar no slot 3.","Clients continuam tentando para evitar login repetido em muitos PCs."],syncTitle:"3. Sync Server e descoberta",syncBody:"Sync Server publica este manager como Screen Wall ativo da conta. Clients leem o registro no Supabase e testam endpoints.",syncPoints:["Inclui host instance, endereços LAN/private, candidatos public, pair token e lease curto.","Candidatos LAN vêm primeiro; public depois se necessário.","Clique Sync Server após mudanças de manager, VPN, firewall ou roteador.","Chrome Local Network Access em livedesk.pages.dev não é mais o caminho padrão. O app npm manager é o servidor real."],platformTitle:"4. Estado das plataformas",platformBody:"Windows foi verificado com transferência de tela. macOS e Linux seguem o mesmo caminho npm.",platformPoints:["Windows: verificado.","macOS: captura e controle precisam de permissões Screen Recording/Accessibility.","Linux: runtime linux-x64, captura grim/gnome-screenshot/import/scrot e entrada xdotool adicionados. Áudio ainda desativado."],firewallTitle:"Firewall e locais remotos",firewallBody:"Na mesma LAN normalmente não é preciso port forwarding. Em outra rede, clients precisam alcançar a porta client do manager.",firewallPoints:["Porta client: TCP 5197.","Máquinas client normalmente só precisam de saída.","Para redes remotas, permita TCP 5197 inbound no manager e encaminhe TCP 5197 para o PC manager.","A porta 5179 é para a UI do manager; exponha apenas se um navegador remoto precisar abrir o Wall.","Prefira VPN, Tailscale, ZeroTier ou allowlist de IP fixo."],commandsTitle:"Comandos atuais",commandsBody:"A direção do produto é um comando de terminal comum entre sistemas, não baixar e instalar manualmente.",managerCommandLabel:"Iniciar manager",clientCommandLabel:"Conectar workstation",slotCommandLabel:"Fixar no slot 3",manualCommandLabel:"Conexão manual avançada"}),it:Et({languageName:"Italiano",languageLabel:"Lingua documento",eyebrow:"LiveDesk Manual",title:"Apri uno Screen Wall locale con un comando",intro:"LiveDesk è un deck npm-first per monitorare workstation, box AI, Mac mini e macchine dev da un solo PC manager.",managerTitle:"1. Avvia il manager",managerBody:"Esegui LiveDesk sul computer che guarderà gli schermi. Il manager avvia UI e server locale e apre http://127.0.0.1:5179.",managerPoints:["Il comando è npx -y livedesk.","Il manager usa 5179 per Screen Wall/API e 5197 per connessioni client.","Se vecchi processi occupano le porte, l’avvio le pulisce di default."],clientTitle:"2. Connetti una workstation",clientBody:"Su ogni computer monitorato, accedi con lo stesso account Google. Se il manager non è online, il client riprova ogni 5 secondi.",clientPoints:["npx -y livedesk client usa il primo slot libero.","npx -y livedesk client 3 fissa la macchina allo slot 3.","I client continuano a provare per evitare login ripetuti."],syncTitle:"3. Sync Server e discovery",syncBody:"Sync Server pubblica questo manager come Screen Wall attivo dell’account. I client leggono Supabase e provano gli endpoint.",syncPoints:["Include host instance, indirizzi LAN/private, candidati public, pair token e lease breve.","Prima LAN, poi public se necessario.","Premi Sync Server dopo cambi di manager, VPN, firewall o router.","Chrome Local Network Access su livedesk.pages.dev non è più il percorso principale. L’app npm manager è il server reale."],platformTitle:"4. Stato piattaforme",platformBody:"Windows è verificato con trasferimento schermo live. macOS e Linux seguono lo stesso percorso npm.",platformPoints:["Windows: verificato.","macOS: capture e control richiedono permessi Screen Recording/Accessibility.","Linux: aggiunti runtime linux-x64, capture grim/gnome-screenshot/import/scrot e input xdotool. Audio disattivato."],firewallTitle:"Firewall e sedi remote",firewallBody:"Nella stessa LAN di solito non serve port forwarding. Da altre reti, i client devono raggiungere la porta client del manager.",firewallPoints:["Porta client: TCP 5197.","I client normalmente richiedono solo uscita.","Per reti remote, abilita TCP 5197 inbound sul manager e inoltra TCP 5197 al PC manager.","La porta 5179 è per la UI manager; esponila solo se un browser remoto deve aprire il Wall.","Preferisci VPN, Tailscale, ZeroTier o IP allowlist."],commandsTitle:"Comandi attuali",commandsBody:"La direzione è un comando terminale comune tra sistemi operativi, invece di download e install manuale.",managerCommandLabel:"Avvia manager",clientCommandLabel:"Connetti workstation",slotCommandLabel:"Fissa allo slot 3",manualCommandLabel:"Connessione manuale avanzata"}),id:Et({languageName:"Bahasa Indonesia",languageLabel:"Bahasa dokumen",eyebrow:"LiveDesk Manual",title:"Buka Screen Wall lokal dengan satu perintah",intro:"LiveDesk adalah deck npm-first untuk memantau banyak workstation, AI box, Mac mini, dan mesin dev dari satu PC manager.",managerTitle:"1. Jalankan manager",managerBody:"Jalankan LiveDesk di komputer yang melihat layar. Manager membuka UI dan server lokal bersama, lalu membuka http://127.0.0.1:5179.",managerPoints:["Perintahnya npx -y livedesk.","Manager memakai 5179 untuk Screen Wall/API dan 5197 untuk koneksi client.","Jika proses lama memakai port itu, startup membersihkannya secara default."],clientTitle:"2. Hubungkan workstation",clientBody:"Di komputer yang dipantau, masuk dengan akun Google yang sama. Jika manager belum online, client tetap mencoba tiap 5 detik.",clientPoints:["npx -y livedesk client memakai slot kosong pertama.","npx -y livedesk client 3 mengunci mesin ke slot 3.","Client terus mencoba agar banyak PC tidak perlu login berulang."],syncTitle:"3. Sync Server dan discovery",syncBody:"Sync Server menerbitkan manager ini sebagai Screen Wall aktif untuk akun. Client membaca Supabase dan mencoba endpoint.",syncPoints:["Berisi host instance, alamat LAN/private, kandidat public, pair token, dan lease pendek.","Kandidat LAN dicoba lebih dulu, lalu public jika perlu.","Tekan Sync Server setelah perubahan manager, VPN, firewall, atau router.","Chrome Local Network Access di livedesk.pages.dev bukan jalur utama lagi. App npm manager adalah server sebenarnya."],platformTitle:"4. Status platform",platformBody:"Windows sudah diverifikasi dengan live screen transfer. macOS dan Linux mengikuti jalur npm yang sama.",platformPoints:["Windows: terverifikasi.","macOS: capture dan control perlu izin Screen Recording/Accessibility.","Linux: runtime linux-x64, capture grim/gnome-screenshot/import/scrot, dan input xdotool sudah ditambahkan. Audio belum aktif."],firewallTitle:"Firewall dan lokasi luar",firewallBody:"Di LAN yang sama biasanya tidak perlu port forwarding. Dari jaringan lain, client harus mencapai port client manager.",firewallPoints:["Port client: TCP 5197.","Mesin client biasanya hanya perlu akses keluar.","Untuk jaringan luar, izinkan TCP 5197 inbound di manager dan forward TCP 5197 ke PC manager.","Port 5179 untuk UI manager; buka hanya jika browser luar harus membuka Wall.","Utamakan VPN, Tailscale, ZeroTier, atau IP allowlist."],commandsTitle:"Perintah saat ini",commandsBody:"Arah produk adalah satu perintah terminal lintas OS, bukan download dan instal manual.",managerCommandLabel:"Mulai manager",clientCommandLabel:"Hubungkan workstation",slotCommandLabel:"Kunci ke slot 3",manualCommandLabel:"Koneksi manual lanjutan"}),vi:Et({languageName:"Tiếng Việt",languageLabel:"Ngôn ngữ tài liệu",eyebrow:"LiveDesk Manual",title:"Mở Screen Wall cục bộ bằng một lệnh",intro:"LiveDesk là deck npm-first để giám sát nhiều workstation, máy AI, Mac mini và máy dev từ một PC manager.",managerTitle:"1. Chạy manager",managerBody:"Chạy LiveDesk trên máy dùng để xem màn hình. Manager khởi động UI và server cục bộ cùng lúc, rồi mở http://127.0.0.1:5179.",managerPoints:["Lệnh là npx -y livedesk.","Manager dùng 5179 cho Screen Wall/API và 5197 cho kết nối client.","Nếu tiến trình cũ giữ port, startup mặc định sẽ dọn và khởi động lại."],clientTitle:"2. Kết nối workstation",clientBody:"Trên mỗi máy được giám sát, đăng nhập cùng tài khoản Google. Nếu manager chưa online, client tiếp tục thử mỗi 5 giây.",clientPoints:["npx -y livedesk client dùng slot trống đầu tiên.","npx -y livedesk client 3 ghim máy vào slot 3.","Client tiếp tục chờ để nhiều máy không cần đăng nhập lại."],syncTitle:"3. Sync Server và tự phát hiện",syncBody:"Sync Server đăng manager này là Screen Wall đang hoạt động của tài khoản. Client đọc Supabase và thử các endpoint.",syncPoints:["Bao gồm host instance, địa chỉ LAN/private, public candidate, pair token và lease ngắn.","Ưu tiên LAN trước, sau đó thử public nếu cần.","Bấm Sync Server sau thay đổi manager, VPN, firewall hoặc router.","Chrome Local Network Access trên livedesk.pages.dev không còn là đường chạy chính. App npm manager mới là server thật."],platformTitle:"4. Trạng thái nền tảng",platformBody:"Windows đã được kiểm chứng với truyền màn hình live. macOS và Linux đi theo cùng đường npm.",platformPoints:["Windows: đã kiểm chứng.","macOS: capture và control cần quyền Screen Recording/Accessibility.","Linux: đã thêm runtime linux-x64, capture grim/gnome-screenshot/import/scrot và input xdotool. Audio chưa bật."],firewallTitle:"Firewall và địa điểm ngoài",firewallBody:"Trong cùng LAN thường không cần port forwarding. Từ mạng khác, client phải truy cập được port client của manager.",firewallPoints:["Port client: TCP 5197.","Máy client thường chỉ cần kết nối outbound.","Với mạng ngoài, cho phép TCP 5197 inbound trên manager và forward TCP 5197 tới PC manager.","Port 5179 dành cho UI manager; chỉ mở nếu trình duyệt từ xa cần mở Wall trực tiếp.","Ưu tiên VPN, Tailscale, ZeroTier hoặc allowlist IP cố định."],commandsTitle:"Lệnh hiện tại",commandsBody:"Hướng sản phẩm là một lệnh terminal dùng chung giữa các OS, thay vì tải và cài thủ công.",managerCommandLabel:"Khởi động manager",clientCommandLabel:"Kết nối workstation",slotCommandLabel:"Ghim vào slot 3",manualCommandLabel:"Kết nối thủ công nâng cao"}),th:Et({languageName:"ไทย",languageLabel:"ภาษาของเอกสาร",eyebrow:"LiveDesk Manual",title:"เปิด Screen Wall ภายในด้วยคำสั่งเดียว",intro:"LiveDesk คือ deck แบบ npm-first สำหรับดู workstation, กล่อง AI, Mac mini และเครื่อง dev หลายเครื่องจาก manager PC เครื่องเดียว",managerTitle:"1. รัน manager",managerBody:"รัน LiveDesk บนเครื่องที่ใช้ดูหน้าจอ Manager จะเปิด UI และ local server พร้อมกัน แล้วเปิด http://127.0.0.1:5179",managerPoints:["คำสั่งคือ npx -y livedesk","Manager ใช้ 5179 สำหรับ Screen Wall/API และ 5197 สำหรับ client connection","ถ้า process เก่ายังใช้ port อยู่ startup จะล้างให้โดย default"],clientTitle:"2. เชื่อม workstation",clientBody:"บนเครื่องที่ต้อง monitor ให้ login ด้วย Google account เดียวกัน ถ้า manager ยังไม่ออนไลน์ client จะลองใหม่ทุก 5 วินาที",clientPoints:["npx -y livedesk client จะใช้ slot ว่างแรก","npx -y livedesk client 3 จะตรึงเครื่องไว้ที่ slot 3","Client จะรอต่อเนื่องเพื่อไม่ต้อง login ซ้ำเมื่อมีหลายเครื่อง"],syncTitle:"3. Sync Server และ discovery",syncBody:"Sync Server จะ publish manager นี้เป็น active Screen Wall ของ account แล้ว client อ่านข้อมูลจาก Supabase และลอง endpoint ต่างๆ",syncPoints:["มี host instance, LAN/private address, public candidate, pair token และ short lease","ลอง LAN ก่อน แล้วค่อยลอง public ถ้าจำเป็น","กด Sync Server หลังเปลี่ยน manager, VPN, firewall หรือ router","Chrome Local Network Access บน livedesk.pages.dev ไม่ใช่ runtime หลักแล้ว app npm manager คือ server จริง"],platformTitle:"4. สถานะ platform",platformBody:"Windows ตรวจสอบแล้วว่าส่งภาพ live ได้ macOS และ Linux ใช้เส้นทาง npm เดียวกัน",platformPoints:["Windows: verified","macOS: capture/control ต้องใช้สิทธิ์ Screen Recording/Accessibility","Linux: เพิ่ม linux-x64 runtime, grim/gnome-screenshot/import/scrot capture และ xdotool input แล้ว audio ยังปิดอยู่"],firewallTitle:"Firewall และเครื่องต่างสถานที่",firewallBody:"ใน LAN เดียวกันปกติไม่ต้อง port forwarding ถ้าอยู่คนละ network client ต้องเข้าถึง client port ของ manager ได้",firewallPoints:["Client port คือ TCP 5197","เครื่อง client ปกติต้องการ outbound เท่านั้น","ถ้าอยู่นอก network ให้เปิด TCP 5197 inbound ที่ manager และ forward TCP 5197 ไปยัง manager PC","Port 5179 เป็น UI ของ manager เปิดเฉพาะเมื่อ browser ระยะไกลต้องเปิด Wall โดยตรง","ควรใช้ VPN, Tailscale, ZeroTier หรือ IP allowlist ก่อนเปิดสู่ public internet"],commandsTitle:"คำสั่งปัจจุบัน",commandsBody:"ทิศทาง product คือคำสั่ง terminal เดียวข้าม OS ไม่ใช่ download/install จากเว็บไซต์",managerCommandLabel:"เริ่ม manager",clientCommandLabel:"เชื่อม workstation",slotCommandLabel:"ตรึง slot 3",manualCommandLabel:"manual connection ขั้นสูง"}),hi:Et({languageName:"हिन्दी",languageLabel:"दस्तावेज़ भाषा",eyebrow:"LiveDesk Manual",title:"एक कमांड से local Screen Wall खोलें",intro:"LiveDesk एक npm-first remote work deck है जिससे एक manager PC से कई workstation, AI box, Mac mini और dev machines देखे जा सकते हैं।",managerTitle:"1. manager चलाएं",managerBody:"जिस computer से screens देखनी हैं उस पर LiveDesk manager चलाएं। यह UI और local server साथ में शुरू करता है और http://127.0.0.1:5179 खोलता है।",managerPoints:["कमांड है npx -y livedesk।","Manager Screen Wall/API के लिए 5179 और client connections के लिए 5197 इस्तेमाल करता है।","अगर पुराने LiveDesk ports बचे हों तो startup default रूप से साफ करता है।"],clientTitle:"2. workstation जोड़ें",clientBody:"हर monitored computer पर उसी Google account से sign in करें। Manager online न हो तब भी client बंद नहीं होता और हर 5 सेकंड retry करता है।",clientPoints:["npx -y livedesk client पहला खाली slot लेता है।","npx -y livedesk client 3 machine को slot 3 पर pin करता है।","बहुत सी machines हों तब भी बार-बार login की जरूरत नहीं रहती।"],syncTitle:"3. Sync Server और discovery",syncBody:"Sync Server इस manager को account का active Screen Wall बनाकर Supabase में publish करता है। Clients record पढ़कर endpoints try करते हैं।",syncPoints:["इसमें host instance, LAN/private addresses, public candidates, pair token और short lease होता है।","LAN candidates पहले try होते हैं, जरूरत हो तो public candidates।","Manager, VPN, firewall या router बदलने के बाद Sync Server दबाएं।","livedesk.pages.dev का Chrome Local Network Access अब default runtime नहीं है। npm manager app ही real server है।"],platformTitle:"4. Platform status",platformBody:"Windows live screen transfer के साथ verified है। macOS और Linux भी इसी npm path पर आगे बढ़ रहे हैं।",platformPoints:["Windows: verified.","macOS: capture/control के लिए Screen Recording/Accessibility permissions चाहिए।","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture और xdotool input backend जोड़े गए हैं। Audio अभी disabled है।"],firewallTitle:"Firewall और remote locations",firewallBody:"Same LAN में आम तौर पर router forwarding जरूरी नहीं। दूसरे network से clients को manager client port तक पहुंचना होगा।",firewallPoints:["Client connection port: TCP 5197.","Client machines को आम तौर पर सिर्फ outbound access चाहिए।","Remote network के लिए manager firewall में TCP 5197 inbound allow करें और router से TCP 5197 manager PC पर forward करें।","5179 manager UI port है; इसे तभी expose करें जब remote browser को Wall खोलना हो।","Public internet से पहले VPN, Tailscale, ZeroTier या fixed IP allowlist बेहतर है।"],commandsTitle:"Current commands",commandsBody:"Product direction है OS के बीच एक terminal command, website से download/install नहीं।",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),ar:Et({languageName:"العربية",languageLabel:"لغة المستند",eyebrow:"LiveDesk Manual",title:"افتح Screen Wall محلي بأمر واحد",intro:"LiveDesk هو deck بنمط npm-first لمراقبة عدة workstations وأجهزة AI وMac mini وأجهزة تطوير من كمبيوتر manager واحد.",managerTitle:"1. شغل manager",managerBody:"شغل LiveDesk على الكمبيوتر الذي سيعرض الشاشات. يبدأ manager الواجهة والخادم المحلي معا ويفتح http://127.0.0.1:5179.",managerPoints:["الأمر هو npx -y livedesk.","يستخدم manager المنفذ 5179 للواجهة/API والمنفذ 5197 لاتصالات client.","إذا بقيت عملية LiveDesk قديمة على المنافذ، يتم تنظيفها افتراضيا عند التشغيل."],clientTitle:"2. وصل workstation",clientBody:"على كل كمبيوتر تتم مراقبته، سجل الدخول بنفس حساب Google. إذا لم يكن manager متاحا، يبقى client يعمل ويحاول كل 5 ثوان.",clientPoints:["npx -y livedesk client يختار أول slot فارغ.","npx -y livedesk client 3 يثبت الجهاز في slot 3.","clients تستمر بالمحاولة لتجنب تكرار تسجيل الدخول عند كثرة الأجهزة."],syncTitle:"3. Sync Server والاكتشاف",syncBody:"Sync Server ينشر هذا manager كـ active Screen Wall للحساب. يقرأ clients سجل Supabase ويجربون endpoints بالترتيب.",syncPoints:["السجل يتضمن host instance وعناوين LAN/private وpublic candidates وpair token وlease قصير.","يتم تفضيل LAN أولا، ثم public عند الحاجة.","اضغط Sync Server بعد تغيير manager أو VPN أو firewall أو router.","Chrome Local Network Access على livedesk.pages.dev لم يعد مسار التشغيل الافتراضي. تطبيق npm manager هو الخادم الحقيقي."],platformTitle:"4. حالة المنصات",platformBody:"Windows تم التحقق منه مع نقل شاشة live. macOS وLinux يتبعان نفس مسار npm.",platformPoints:["Windows: تم التحقق.","macOS: capture/control يحتاجان أذونات Screen Recording/Accessibility.","Linux: تمت إضافة linux-x64 runtime وgrim/gnome-screenshot/import/scrot capture وxdotool input. الصوت ما زال معطلا."],firewallTitle:"Firewall والمواقع البعيدة",firewallBody:"داخل نفس LAN غالبا لا تحتاج port forwarding. من شبكة أخرى يجب أن يصل client إلى منفذ manager client.",firewallPoints:["منفذ client: TCP 5197.","أجهزة client تحتاج عادة اتصال outbound فقط.","للشبكات البعيدة، اسمح TCP 5197 inbound على manager ووجه TCP 5197 من router إلى manager PC.","المنفذ 5179 مخصص لواجهة manager؛ اكشفه فقط إذا كان متصفح بعيد يحتاج فتح Wall مباشرة.","يفضل VPN أو Tailscale أو ZeroTier أو fixed IP allowlist بدل التعريض العام."],commandsTitle:"الأوامر الحالية",commandsBody:"اتجاه المنتج هو أمر terminal واحد عبر الأنظمة، وليس تحميل وتثبيت يدوي من موقع.",managerCommandLabel:"Start manager",clientCommandLabel:"Connect workstation",slotCommandLabel:"Pin to slot 3",manualCommandLabel:"Advanced manual connection"}),tr:Et({languageName:"Türkçe",languageLabel:"Belge dili",eyebrow:"LiveDesk Manual",title:"Yerel Screen Wall tek komutla açılsın",intro:"LiveDesk, tek bir manager PC üzerinden birçok workstation, AI box, Mac mini ve dev machine izlemek için npm-first bir çalışma deckidir.",managerTitle:"1. Manager çalıştır",managerBody:"Ekranları izleyecek bilgisayarda LiveDesk manager çalıştır. Manager UI ve local server birlikte başlar ve http://127.0.0.1:5179 açılır.",managerPoints:["Komut: npx -y livedesk.","Manager Screen Wall/API için 5179, client bağlantıları için 5197 kullanır.","Eski LiveDesk process portları tutuyorsa başlangıç varsayılan olarak temizler."],clientTitle:"2. Workstation bağla",clientBody:"İzlenecek bilgisayarda aynı Google hesabıyla giriş yap. Manager henüz online değilse client kapanmaz ve her 5 saniyede tekrar dener.",clientPoints:["npx -y livedesk client ilk boş slota yerleşir.","npx -y livedesk client 3 makineyi slot 3’e sabitler.","Çok makinede tekrar tekrar login gerekmesin diye client beklemeye devam eder."],syncTitle:"3. Sync Server ve discovery",syncBody:"Sync Server bu managerı hesabın active Screen Wall kaydı olarak Supabase’e yazar. Clients bu kaydı okuyup endpoint adaylarını dener.",syncPoints:["Host instance, LAN/private adresler, public adaylar, pair token ve kısa lease içerir.","Önce LAN adayları, gerekirse public adaylar denenir.","Manager, VPN, firewall veya router değişince Sync Server’a bas.","livedesk.pages.dev üzerindeki Chrome Local Network Access artık default runtime yolu değil. Gerçek server npm manager app."],platformTitle:"4. Platform durumu",platformBody:"Windows live screen transfer ile doğrulandı. macOS ve Linux aynı npm yolunu takip ediyor.",platformPoints:["Windows: doğrulandı.","macOS: capture/control için Screen Recording/Accessibility izinleri gerekir.","Linux: linux-x64 runtime, grim/gnome-screenshot/import/scrot capture ve xdotool input backend eklendi. Audio kapalı."],firewallTitle:"Firewall ve uzak konumlar",firewallBody:"Aynı LAN içinde genelde router forwarding gerekmez. Başka ağdan clients manager client portuna ulaşabilmelidir.",firewallPoints:["Client port: TCP 5197.","Client makineler normalde sadece outbound erişim ister.","Uzak ağ için manager firewall üzerinde TCP 5197 inbound aç ve routerdan TCP 5197yi manager PCye forward et.","5179 manager UI portudur; sadece uzak browser Wall açacaksa expose et.","Public internet yerine VPN, Tailscale, ZeroTier veya sabit IP allowlist tercih et."],commandsTitle:"Güncel komutlar",commandsBody:"Ürün yönü, webden indirip kurmak yerine işletim sistemleri arasında ortak tek terminal komutu.",managerCommandLabel:"Manager başlat",clientCommandLabel:"Workstation bağla",slotCommandLabel:"Slot 3’e sabitle",manualCommandLabel:"Gelişmiş manuel bağlantı"})},U_=Object.entries(_r).map(([i,n])=>({id:i,label:n.languageName}));function M_(){if(typeof navigator>"u")return"en";const i=navigator.languages?.length?navigator.languages:[navigator.language];for(const n of i){const r=n.toLowerCase();if(_r[n])return n;if(r.startsWith("zh-tw")||r.startsWith("zh-hk"))return"zh-TW";if(r.startsWith("pt"))return"pt-BR";const l=r.split("-")[0];if(_r[l])return l}return"en"}function cp({index:i,selected:n,onSelect:r}){const l=i+1;return y.jsx("article",{className:`device-tile placeholder-tile ${n?"selected":""}`,children:y.jsxs("button",{className:"tile-screen",onClick:r,"aria-pressed":n,title:`Select slot ${l}`,type:"button",children:[y.jsx("span",{className:"slot-grid","aria-hidden":"true"}),y.jsxs("span",{className:"empty-screen",children:[y.jsx(br,{size:24}),y.jsxs("strong",{children:["Slot ",String(l).padStart(3,"0")]})]})]})})}function dp({device:i,frame:n,selected:r,controlEnabled:l,onSelect:u,onFocusDevice:d,onOpenControl:h,sendInput:m}){const g=P.useRef(null),p=P.useRef(0),w=Bp(i);P.useEffect(()=>{const S=g.current;if(!S||!n)return;let x=!1;return t_(S,n,()=>x).catch(()=>{}),()=>{x=!0}},[n]);const b=S=>{const x=S.currentTarget.getBoundingClientRect();return{normalizedX:Math.max(0,Math.min(1,(S.clientX-x.left)/Math.max(1,x.width))),normalizedY:Math.max(0,Math.min(1,(S.clientY-x.top)/Math.max(1,x.height)))}},T=(S,x)=>{if(l){if(x==="pointermove"){const O=performance.now();if(O-p.current<24)return;p.current=O}m(i.deviceId,{type:x,...b(S),button:O_(S.button)})}};return y.jsx("article",{className:`device-tile ${r?"selected":""} ${i.connected?"online":"offline"}`,children:y.jsxs("button",{className:"tile-screen","aria-pressed":r,onClick:()=>{l||u()},onDoubleClick:S=>{S.preventDefault(),h()},type:"button",children:[y.jsx("canvas",{ref:g,className:"remote-canvas",tabIndex:l?0:-1,onPointerDown:S=>{l&&(d(),S.currentTarget.focus(),S.currentTarget.setPointerCapture(S.pointerId),T(S,"pointerdown"))},onPointerMove:S=>T(S,"pointermove"),onPointerUp:S=>T(S,"pointerup"),onWheel:S=>{l&&(S.preventDefault(),m(i.deviceId,{type:"wheel",deltaX:S.deltaX,deltaY:S.deltaY}))},onKeyDown:S=>{l&&m(i.deviceId,{type:"keydown",key:S.key,code:S.code,text:S.key.length===1?S.key:"",repeat:S.repeat})},onKeyUp:S=>{l&&m(i.deviceId,{type:"keyup",key:S.key,code:S.code,text:S.key.length===1?S.key:"",repeat:!1})},onContextMenu:S=>l&&S.preventDefault()}),!n&&y.jsx("span",{className:"empty-screen",children:y.jsx(br,{size:26})}),y.jsx("span",{className:`tile-health-pill state-${w.state}`,children:w.label}),y.jsx("span",{className:"tile-metrics","aria-label":`${Eo(i)} status`,children:w.metrics.slice(0,3).map(S=>y.jsxs("span",{className:`tile-metric state-${S.state}`,children:[y.jsx("b",{children:S.label}),y.jsx("em",{children:S.value}),S.ratio!==void 0&&y.jsx("i",{style:{width:`${Math.round(S.ratio*100)}%`}})]},S.id))})]})})}function z_(){const{session:i,loading:n}=h_(),{target:r,error:l,refresh:u}=m_(i),d=P.useMemo(()=>{if(!r?.active)return null;const A=r.expires_at?Date.parse(r.expires_at):Number.POSITIVE_INFINITY;return Number.isFinite(A)&&A<=Date.now()?null:r},[r]),h=P.useMemo(()=>sp(d),[d]),m=P.useMemo(()=>h.length>0?[...new Set([...h,Rt])]:[Rt],[h]),[g,p]=P.useState(C_),w=P.useMemo(()=>m.some(A=>!!Bs(A)),[m]),b=!w||g,{status:T,devices:S,error:x,refresh:O,hubBaseUrl:I}=f_(m,b),{entitlement:$,licensed:H,loading:q,error:X,refresh:me}=g_(i),[ie,J]=P.useState([]),[xe,Te]=P.useState([]),[sn,ot]=P.useState(""),[Ne,ut]=P.useState(!1),[ht,Pe]=P.useState(!1),[D,G]=P.useState(""),[ne,F]=P.useState(""),[_e,E]=P.useState(""),[U,V]=P.useState("wall"),[Q,ue]=P.useState("large"),[de,ke]=P.useState(M_),[Ge,Ve]=P.useState(!1),[vn,bn]=P.useState(!1),[kr,Qs]=P.useState(!1),[Yt,Er]=P.useState(A_),[ra,xn]=P.useState(null),[Zs,qa]=P.useState(!1),Ti=P.useRef(null),Pa=P.useRef(!1),Ws=P.useRef(0),Ye=P.useMemo(()=>S.filter(A=>A.connected),[S]),Ct=P.useMemo(()=>Ye.reduce((A,K)=>Math.max(A,Os(K.slotNumber)),0),[Ye]),Jt=Math.max(S_,Ye.length,Ct),Fs=P.useMemo(()=>{const A=Array(Jt).fill(null),K=[];for(const te of Ye){const oe=Os(te.slotNumber);oe>0&&oe<=Jt&&!A[oe-1]?A[oe-1]=te:K.push(te)}for(const te of K){const oe=A.findIndex(ve=>!ve);oe<0?A.push(te):A[oe]=te}return A},[Ye,Jt]),Ar=P.useMemo(()=>Ye.map(A=>A.deviceId),[Ye]),sa=P.useMemo(()=>new Set(ie),[ie]),Ia=P.useMemo(()=>new Set(xe),[xe]),On=P.useMemo(()=>Ye.filter(A=>sa.has(A.deviceId)||Ia.has(Os(A.slotNumber))),[Ye,sa,Ia]),le=P.useMemo(()=>S.find(A=>A.deviceId===sn)||On[0]||null,[S,sn,On]),Xt=P.useMemo(()=>le?Bp(le):null,[le]),Ga=le?Hs(le,"control"):!1,pt=le?Hs(le,"audio")||Hs(le,"remoteAudio"):!1,ln=Ye.length<=dr,Oe=H||ln,la=`Free plan includes up to ${dr} workstations. Upgrade to LTD for ${Ye.length} workstations.`,Cr=Oe&&!!le,ki=Oe&&!!le&&Ga,Va=Oe&&!!le&&pt,Ka=Oe?Ar:[],{frames:oa,state:Rn}=p_(Ka,Ka.length>0,I),{state:Ya,sendInput:ua}=y_(ki&&Ne,I),{state:el,error:xr}=w_(le?.deviceId||"",Va&&ht,I);P.useEffect(()=>{const A=new URLSearchParams(window.location.search).get("checkout");if(A==="success"){F("Checkout returned. Waiting for Dodo confirmation."),me();const K=window.setInterval(()=>{me()},4e3),te=window.setTimeout(()=>{window.clearInterval(K)},45e3);return()=>{window.clearInterval(K),window.clearTimeout(te)}}A==="cancelled"&&F("Checkout cancelled.")},[me]),P.useEffect(()=>{!Oe&&Ne&&ut(!1),!Oe&&ht&&Pe(!1)},[ht,Ne,Oe]),P.useEffect(()=>{Pe(!1)},[le?.deviceId]),P.useEffect(()=>{const A=Ye.map(te=>te.deviceId),K=new Set(A);J(te=>{const oe=te.filter(ve=>K.has(ve));return op(te,oe)?te:oe}),ot(te=>te&&K.has(te)?te:""),Te(te=>{const oe=te.filter(ve=>ve>=1&&ve<=Jt);return op(te.map(String),oe.map(String))?te:oe})},[Ye,Jt]),P.useEffect(()=>{try{localStorage.setItem(Mp,Yt)}catch{}},[Yt]);const Ja=P.useCallback(async()=>{const A=new Set(m);A.add(Rt);try{const ge=await gn("/api/remote/status",void 0,Rt);sp({endpoint:ge.agentEndpoint,endpoint_candidates:[...ge.agentEndpointCandidates||[],...ge.hostTargetEndpointCandidates||[]]}).forEach(ze=>A.add(ze))}catch{}const K=[...A].sort((ge,ze)=>{const ft=nt=>{const bt=Bs(nt);return bt==="local"?0:bt==="loopback"?1:2};return ft(ge)-ft(ze)||ge.localeCompare(ze)});let te=!1,oe="",ve=!1;try{for(const ge of K){const ze=Bs(ge);try{if(await gn("/api/health",void 0,ge),ze==="local")return p(!0),hr(!0),ge;ze==="loopback"&&(te=!0,oe=ge)}catch{ze==="local"&&(ve=!0)}}return te?(ve&&F("LiveDesk Hub is reachable on this PC, but not through the LAN address yet. Restart LiveDesk Hub to bind 5179 on the network."),p(!0),hr(!0),oe||Rt):(p(!1),hr(!1),"")}catch{return p(!1),hr(!1),""}},[m]),ca=async()=>{G("auth"),bn(!1),await Ja();const{error:A}=await An.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin}});A&&(F(A.message),G(""))},Ho=async()=>{G("auth"),bn(!1),await An.auth.signOut(),G("")};P.useEffect(()=>{if(!vn)return;const A=te=>{te.target instanceof Element&&(te.target.closest(".account-popover, .rail-account")||bn(!1))},K=te=>{te.key==="Escape"&&bn(!1)};return window.addEventListener("pointerdown",A),window.addEventListener("keydown",K),()=>{window.removeEventListener("pointerdown",A),window.removeEventListener("keydown",K)}},[vn]);const Xa=P.useCallback(async(A={})=>{const K=A.silent===!0,te=A.takeover===!0,oe=A.requestLocalAccess===!0,ve=oe?await Ja():"";if(!i?.user){K||F("Sign in before publishing this host.");return}if(!Pa.current){Pa.current=!0,K||G("host");try{const ge=ve||I||Rt,ze=T||await gn("/api/remote/status",void 0,ge);if(!ze.started)throw new Error("Start LiveDesk on this computer before syncing the server.");const ft=`livedesk-${i.user.id}`,nt=await gn("/api/remote/host-target",{method:"POST",body:JSON.stringify({nodeId:ft,leaseMs:6e4,takeover:te})},ge);if(!nt.ok)throw new Error(nt.error||"host-target-failed");const bt=await gn("/api/remote/status",void 0,ge),il=nt.hostTarget||{},Ur=bt.hostTargetEndpointCandidates||bt.agentEndpointCandidates||ze.agentEndpointCandidates||[bt.agentEndpoint||ze.agentEndpoint].filter(Boolean),{data:Mr,error:rl}=await An.rpc("set_livedesk_remote_host_target",{p_node_id:ft,p_lease_id:String(il.leaseId||bt.hostTargetLeaseId||crypto.randomUUID()),p_host_instance_id:bt.hostInstanceId||ft,p_endpoint:bt.hostTargetEndpoint||bt.agentEndpoint||ze.agentEndpoint,p_pair_token:bt.pairToken||"",p_manager_package:"@livedesk/hub",p_manager_version:bt.managerVersion||"0.1.0",p_agent_package:"@livedesk/client",p_activated_at:new Date().toISOString(),p_expires_at:new Date(Date.now()+6e4).toISOString(),p_takeover:te,p_endpoint_candidates:Ur});if(rl)throw rl;const ga=Array.isArray(Mr)?Mr[0]:Mr;if(ga&&ga.ok===!1)throw new Error(ga.reason||"registry-rejected");K||(F("Host published."),(oe||w)&&(p(!0),hr(!0)),O()),u()}catch(ge){if(!K){const ze=ge instanceof Error?ge.message:String(ge);ze.includes("local network access")&&(p(!1),hr(!1)),F(ze)}}finally{Pa.current=!1,K||G("")}}},[I,w,O,u,Ja,i,T]);P.useEffect(()=>{if(!i?.user||!T?.started||x)return;const A=r?.expires_at?Date.parse(r.expires_at):Number.POSITIVE_INFINITY,K=r?.active===!0&&(!r.expires_at||!Number.isFinite(A)||A>Date.now()),te=!!r?.host_instance_id&&!!T.hostInstanceId&&r.host_instance_id===T.hostInstanceId;if(K&&!te)return;let oe=!1;const ve=()=>{if(oe)return;const ze=Date.now();ze-Ws.current<25e3||(Ws.current=ze,Xa({silent:!0}))};ve();const ge=window.setInterval(ve,3e4);return()=>{oe=!0,window.clearInterval(ge)}},[x,Xa,i?.user?.id,T?.agentEndpoint,T?.hostInstanceId,T?.started,r?.active,r?.expires_at,r?.host_instance_id]);const Qa=P.useCallback(A=>{A&&(ot(A),J(K=>K.includes(A)?K:[...K,A]))},[]),Or=P.useCallback(A=>{if(!A)return;const K=Ye.find(oe=>oe.deviceId===A),te=Os(K?.slotNumber);ot(A),te>0&&Te(oe=>oe.filter(ve=>ve!==te)),J(oe=>oe.includes(A)?oe:[...oe,A])},[Ye]),Ei=P.useCallback(A=>{!Number.isInteger(A)||A<1||A>Jt||(ot(""),Te(K=>K.includes(A)?K.filter(te=>te!==A):[...K,A].sort((te,oe)=>te-oe)))},[Jt]),jn=P.useCallback(()=>{J([]),Te([]),ot(""),ut(!1),Pe(!1)},[]),Rr=P.useCallback(()=>{J([]),ot(""),ut(!1),Pe(!1),Te(Array.from({length:Jt},(A,K)=>K+1))},[Jt]);P.useEffect(()=>{const A=K=>{const te=K.target,oe=te?.tagName?.toLowerCase();te?.isContentEditable||oe==="input"||oe==="textarea"||oe==="select"||((K.ctrlKey||K.metaKey)&&K.key.toLowerCase()==="a"&&(K.preventDefault(),Rr()),K.key==="Escape"&&jn())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[jn,Rr]);const da=async A=>{if(!Oe){F(la);return}Qa(A);try{await gn(`/api/remote/devices/${encodeURIComponent(A)}/live/start`,{method:"POST",body:JSON.stringify({fps:12,maxWidth:960,maxHeight:540,quality:60,mode:"mode3-h264-hw"})},I),F("Live stream requested."),O()}catch(K){F(K instanceof Error?K.message:String(K))}},on=async A=>{if(Qa(A),V("control"),!Oe){ut(!1),F(la);return}ut(!0),await da(A)},ct=async()=>{if(!le){F("Select a workstation before playing audio.");return}if(!Oe){F(la);return}if(!pt){F("Selected workstation does not report remote audio support yet.");return}const A=!ht;Pe(A);try{await gn(`/api/remote/devices/${encodeURIComponent(le.deviceId)}/audio/${A?"start":"stop"}`,{method:"POST",body:JSON.stringify({mimeType:"audio/webm;codecs=opus",sampleRate:48e3,channels:2})},I),F(A?"Remote audio requested.":"Remote audio stopped.")}catch(K){Pe(!1),F(K instanceof Error?K.message:String(K))}},yt=async A=>{const K=Array.from(A).filter(ge=>ge.size>=0);if(K.length===0)return;if(!Oe){F(la);return}const te=On.length>0?On.map(ge=>ge.deviceId):le?[le.deviceId]:[];if(te.length===0){F("Select at least one workstation before dropping files.");return}const oe=K.reduce((ge,ze)=>ge+ze.size,0),ve=crypto.randomUUID();if(oe>T_){xn({id:ve,status:"failed",progress:100,message:`Transfer is too large (${_i(oe)}).`});return}xn({id:ve,status:"reading",progress:2,message:`Preparing ${K.length} file${K.length===1?"":"s"}`});try{let ge=0;const ze=[];for(const nt of K){const bt=await nt.arrayBuffer();ge+=nt.size,xn({id:ve,status:"reading",progress:Math.max(4,Math.round(ge/Math.max(1,oe)*58)),message:`Preparing ${_i(ge)} / ${_i(oe)}`}),ze.push({name:nt.name,relativePath:nt.webkitRelativePath||nt.name,size:nt.size,type:nt.type,lastModified:nt.lastModified,dataBase64:x_(bt)})}xn({id:ve,status:"sending",progress:72,message:`Sending to ${te.length} workstation${te.length===1?"":"s"}`});const ft=await gn("/api/remote/files/transfer",{method:"POST",body:JSON.stringify({transferId:ve,deviceIds:te,remoteDirectory:Yt.trim(),files:ze})},I);if(!ft.ok)throw new Error(ft.error||"file-transfer-not-queued");xn({id:ve,status:"queued",progress:100,message:`Queued ${K.length} file${K.length===1?"":"s"} to ${ft.queued}/${ft.total}`}),window.setTimeout(()=>{xn(nt=>nt?.id===ve&&nt.status==="queued"?null:nt)},4500)}catch(ge){xn({id:ve,status:"failed",progress:100,message:ge instanceof Error?ge.message:String(ge)})}},ha=A=>{A.preventDefault(),A.stopPropagation(),qa(!1),yt(A.dataTransfer.files)},jr=async()=>{const A=_e.trim();if(A){if(!Oe){F(la);return}G("task");try{await gn("/api/remote/tasks",{method:"POST",body:JSON.stringify({instruction:A,allConnected:!0,approvalLevel:"task-only"})},I),E(""),F("Task queued."),O()}catch(K){F(K instanceof Error?K.message:String(K))}finally{G("")}}},tl=async()=>{if(!i){F("Sign in with Google before checkout.");return}if(H){F("LiveDesk license is already active.");return}G("checkout");try{const{data:A,error:K}=await An.functions.invoke("dodo-checkout",{body:{plan:"ltd"}});if(K)throw K;if(!A?.checkout_url)throw new Error("Checkout function did not return a checkout URL.");window.location.assign(A.checkout_url)}catch(A){F(A instanceof Error?A.message:String(A)),G("")}},Nn=k_(),Nr=E_(),Za=Ye.length,Lr=Ar.filter(A=>oa.has(A)).length,Ln=x?"offline":T?.started?"online":"starting",Dn=U==="settings",fa=U==="pricing",Un=U==="doc",Ze=!fa&&!Un,nl=U==="control",Wa=On.length+xe.filter(A=>!Ye.some(K=>Os(K.slotNumber)===A)).length,Mn=xe.length===1?`Slot ${String(xe[0]).padStart(3,"0")}`:`${xe.length} slots selected`,ma=Wa===0?"No workstation":Wa>1?`${Wa} selected`:le?Eo(le):Mn,vt=_r[de]||_r.en,Fa=vt.sync||_r.en.sync,Ai=n||q?"checking":H?`${($?.plan||"ltd").toUpperCase()} active`:ln?`Free ${Ye.length}/${dr}`:`Upgrade ${Ye.length}/${dr}`,$o=H?"Licensed":D==="checkout"?"Opening":"$30 LTD",Ci=H?"License active":i?H?"Licensed":D==="checkout"?"Opening checkout":"Buy with Dodo":D==="auth"?"Opening Google":"Sign in to buy",un=H||D==="checkout"||D==="auth"||n||q,xt=i?.user.user_metadata,ei=up(xt,"avatar_url","picture"),ti=up(xt,"full_name","name")||i?.user.email||"Google",xi=ti.slice(0,1).toUpperCase(),al=T?.started?"Local app ready":"Start LiveDesk",Oi=r?.active?"Published":i?"Not published":"Sign in required",qo=A=>{if(A==="control"){if(V(A),!Oe){ut(!1),F(la);return}ut(!0),le&&da(le.deviceId);return}V(A),ut(!1)};return y.jsxs("main",{className:"app-shell",children:[y.jsxs("aside",{className:"tool-rail","aria-label":"LiveDesk tools",children:[y.jsx("div",{className:"rail-brand",title:"LiveDesk",children:y.jsx(br,{size:22})}),y.jsx("nav",{className:"rail-tools",children:D_.map(A=>{const K=A.icon;return y.jsxs("button",{className:`rail-tool ${U===A.id?"active":""} accent-${A.accent}`,onClick:()=>qo(A.id),title:A.label,type:"button",children:[y.jsx(K,{size:19}),y.jsx("span",{children:A.label})]},A.id)})}),y.jsxs("div",{className:"rail-footer",children:[y.jsxs("button",{className:"rail-tool compact sync-server",onClick:()=>Xa({takeover:!0,requestLocalAccess:!0}),title:"Sync Server",type:"button",children:[y.jsx(Zc,{size:18}),y.jsx("span",{children:"Sync Server"})]}),y.jsxs("button",{className:`rail-account ${i?"signed-in":""}`,onClick:()=>bn(A=>!A),disabled:n||D==="auth","aria-expanded":vn,title:i?`Account: ${i.user.email||ti}`:"Sign in with Google",type:"button",children:[i?ei?y.jsx("img",{src:ei,alt:ti,referrerPolicy:"no-referrer"}):y.jsx("span",{className:"avatar-fallback",children:xi}):y.jsx(Fc,{size:18}),y.jsx("span",{children:i?"Account":"Google"})]}),vn&&y.jsxs("section",{className:"account-popover",role:"dialog","aria-label":"LiveDesk account",children:[y.jsxs("div",{className:"account-popover-head",children:[y.jsx("div",{className:"account-popover-avatar",children:i&&ei?y.jsx("img",{src:ei,alt:ti,referrerPolicy:"no-referrer"}):i?y.jsx("span",{children:xi}):y.jsx(Fc,{size:18})}),y.jsxs("div",{children:[y.jsx("strong",{children:i?ti:"Account"}),y.jsx("p",{children:i?.user.email||"Not signed in"})]})]}),y.jsxs("dl",{className:"account-popover-facts",children:[y.jsx("dt",{children:"User"}),y.jsx("dd",{children:i?.user.email||"Not signed in"}),y.jsx("dt",{children:"Network"}),y.jsx("dd",{children:al}),y.jsx("dt",{children:"Access"}),y.jsx("dd",{children:Oi}),y.jsx("dt",{children:"Plan"}),y.jsx("dd",{children:Ai})]}),i?y.jsxs("button",{className:"account-popover-action",onClick:Ho,disabled:D==="auth",type:"button",children:[y.jsx(S0,{size:16}),"Logout"]}):y.jsxs("button",{className:"account-popover-action primary",onClick:ca,disabled:D==="auth",type:"button",children:[y.jsx(Fc,{size:16}),"Sign in with Google"]})]})]})]}),y.jsxs("section",{className:`desk-stage ${Ze&&!Ge?"dock-open":""}`,children:[y.jsxs("header",{className:"topbar",children:[y.jsxs("div",{className:"brand",children:[y.jsx("span",{className:"brand-mark",children:y.jsx(Sg,{size:18})}),y.jsxs("div",{children:[y.jsx("h1",{children:"LiveDesk"}),y.jsx("p",{children:"Control wall for local machines"})]})]}),Ze&&y.jsx("div",{className:"top-actions",children:y.jsx("div",{className:"segmented-control","aria-label":"Screen size",children:L_.map(A=>y.jsx("button",{className:Q===A.id?"active":"",onClick:()=>ue(A.id),type:"button",children:A.label},A.id))})})]}),Un?y.jsxs("section",{className:"doc-page",lang:de,dir:de==="ar"?"rtl":"ltr",children:[y.jsxs("section",{className:"doc-hero",children:[y.jsxs("div",{className:"doc-hero-copy",children:[y.jsxs("span",{className:"pricing-eyebrow",children:[y.jsx(fd,{size:16}),vt.eyebrow]}),y.jsx("h2",{children:vt.title}),y.jsx("p",{children:vt.intro})]}),y.jsxs("label",{className:"doc-language-picker",children:[y.jsxs("span",{children:[y.jsx(p0,{size:17}),vt.languageLabel]}),y.jsx("select",{value:de,onChange:A=>ke(A.target.value),children:U_.map(A=>y.jsx("option",{value:A.id,children:A.label},A.id))})]})]}),y.jsx("section",{className:"doc-grid",children:vt.sections.map((A,K)=>{const oe=[nd,gr,fp,kg][K]||fd;return y.jsxs("article",{className:"doc-card",children:[y.jsx("div",{className:"doc-card-icon",children:y.jsx(oe,{size:19})}),y.jsxs("div",{children:[y.jsx("h3",{children:A.title}),y.jsx("p",{children:A.body}),y.jsx("ul",{children:A.points.map(ve=>y.jsx("li",{children:ve},ve))})]})]},A.title)})}),Fa&&y.jsxs("section",{className:"doc-sync",children:[y.jsxs("div",{className:"doc-sync-head",children:[y.jsx(Zc,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:Fa.title}),y.jsx("p",{children:Fa.body})]})]}),y.jsx("ul",{children:Fa.points.map(A=>y.jsx("li",{children:A},A))})]}),y.jsxs("section",{className:"doc-firewall",children:[y.jsxs("div",{className:"doc-firewall-head",children:[y.jsx(_g,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:vt.firewall.title}),y.jsx("p",{children:vt.firewall.body})]})]}),y.jsx("ul",{children:vt.firewall.points.map(A=>y.jsx("li",{children:A},A))})]}),y.jsxs("section",{className:"doc-command-panel",children:[y.jsxs("div",{className:"doc-command-head",children:[y.jsx(gr,{size:20}),y.jsxs("div",{children:[y.jsx("h3",{children:vt.commands.title}),y.jsx("p",{children:vt.commands.body})]})]}),y.jsxs("div",{className:"doc-command-list",children:[vt.commands.manager&&y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:vt.commands.manager}),y.jsx("code",{children:Nr}),y.jsx("button",{className:"icon-button",onClick:()=>xs(Nr),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]}),y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:vt.commands.primary}),y.jsx("code",{children:Nn}),y.jsx("button",{className:"icon-button",onClick:()=>xs(Nn),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]}),y.jsxs("div",{className:"doc-command-row",children:[y.jsx("span",{children:vt.commands.slot}),y.jsx("code",{children:`${Nn} 3`}),y.jsx("button",{className:"icon-button",onClick:()=>xs(`${Nn} 3`),title:"Copy command",type:"button",children:y.jsx(As,{size:16})})]})]})]})]}):fa?y.jsxs("section",{className:"pricing-page",children:[(X||ne)&&y.jsx("section",{className:"notice-band",children:X||ne}),y.jsxs("section",{className:"pricing-offer",children:[y.jsx("button",{className:"pricing-close",onClick:()=>V("wall"),title:"Close pricing",type:"button",children:y.jsx($0,{size:18})}),y.jsxs("div",{className:"pricing-offer-head",children:[y.jsxs("span",{className:"pricing-eyebrow",children:[y.jsx(U0,{size:15}),"Founder launch"]}),y.jsxs("div",{className:"deal-price-line",children:[y.jsx("span",{className:"deal-original",children:"$59"}),y.jsx("span",{className:"deal-arrow",children:"→"}),y.jsx("strong",{children:"$30"}),y.jsxs("span",{className:"deal-badge",children:[y.jsx(i0,{size:15}),"Lifetime deal"]})]}),y.jsx("p",{children:"Monitor and control your local workstation wall. Free for 4 PCs, then unlock larger local setups with one payment."})]}),y.jsxs("div",{className:"deal-table",role:"table","aria-label":"LiveDesk launch pricing",children:[y.jsxs("div",{className:"deal-row deal-row-head",role:"row",children:[y.jsx("span",{role:"columnheader",children:"Plan"}),y.jsx("span",{role:"columnheader",children:"Launch benefit"}),y.jsx("span",{role:"columnheader",children:"Now"})]}),y.jsxs("div",{className:"deal-row deal-row-highlight",role:"row",children:[y.jsx("strong",{role:"cell",children:"Founder LTD"}),y.jsxs("span",{role:"cell",children:[y.jsx("s",{children:"$59"})," local lifetime unlock"]}),y.jsx("strong",{role:"cell",children:"$30"})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Free"}),y.jsx("span",{role:"cell",children:"Live, control, audio, files, tasks"}),y.jsx("strong",{role:"cell",children:"$0"})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Workstations"}),y.jsx("span",{role:"cell",children:"4 free, larger walls with LTD"}),y.jsxs("strong",{role:"cell",children:[Ye.length,"/",dr]})]}),y.jsxs("div",{className:"deal-row",role:"row",children:[y.jsx("strong",{role:"cell",children:"Future monthly"}),y.jsx("span",{role:"cell",children:"Cloud relay and team features later"}),y.jsx("strong",{role:"cell",children:"separate"})]})]}),y.jsxs("section",{className:"deal-module",children:[y.jsxs("div",{className:"deal-module-title",children:[y.jsx("strong",{children:"LiveDesk includes"}),y.jsx("span",{children:Ai})]}),y.jsxs("ul",{className:"deal-feature-list",children:[y.jsxs("li",{children:[y.jsx(br,{size:16}),y.jsx("span",{children:"Screen wall slots"}),y.jsx("b",{children:"120+"})]}),y.jsxs("li",{children:[y.jsx(gd,{size:16}),y.jsx("span",{children:"Focused control"}),y.jsx("b",{children:"Local"})]}),y.jsxs("li",{children:[y.jsx(Tg,{size:16}),y.jsx("span",{children:"Remote PC audio"}),y.jsx("b",{children:"PCM"})]}),y.jsxs("li",{children:[y.jsx(Wc,{size:16}),y.jsx("span",{children:"File transfer"}),y.jsx("b",{children:"24MB"})]})]})]}),y.jsxs("section",{className:"deal-open-price",children:[y.jsx("span",{children:"Opening special price"}),y.jsx("strong",{children:"$30 LTD"}),y.jsx("small",{children:"Early buyers keep this local lifetime license after monthly plans arrive."})]}),y.jsxs("p",{className:"deal-note",children:[y.jsx(d0,{size:15}),"Free plan stays available for up to ",dr," local workstations."]}),y.jsxs("button",{className:"deal-cta",onClick:i?tl:ca,disabled:un,type:"button",children:[y.jsx(md,{size:18}),Ci]}),y.jsx("button",{className:"deal-later",onClick:()=>V("wall"),type:"button",children:"Later"})]})]}):y.jsx(y.Fragment,{children:y.jsxs("section",{className:`monitor-layout ${Ge?"dock-collapsed":""}`,children:[y.jsx("section",{className:`screen-wall-panel ${Zs?"drop-active":""}`,onClick:A=>{A.currentTarget===A.target&&jn()},onDragEnter:A=>{A.preventDefault(),qa(!0)},onDragOver:A=>{A.preventDefault(),A.dataTransfer.dropEffect="copy"},onDragLeave:A=>{A.currentTarget===A.target&&qa(!1)},onDrop:ha,children:nl?y.jsxs("section",{className:"control-focus",children:[y.jsxs("div",{className:"control-focus-head",children:[y.jsxs("div",{children:[y.jsx("span",{children:"Focused control"}),y.jsx("strong",{children:le?Eo(le):"No workstation"})]}),y.jsxs("button",{className:"text-button",onClick:()=>le&&da(le.deviceId),disabled:!Cr,type:"button",children:[y.jsx(ed,{size:16}),"Start live"]})]}),y.jsx("div",{className:"screen-wall control-wall",onClick:A=>{A.currentTarget===A.target&&jn()},children:le?y.jsx(dp,{device:le,frame:oa.get(le.deviceId),selected:!0,controlEnabled:ki&&Ne,onSelect:()=>Or(le.deviceId),onFocusDevice:()=>Qa(le.deviceId),onOpenControl:()=>on(le.deviceId),sendInput:ua},le.deviceId):y.jsx(cp,{index:0,selected:Ia.has(1),onSelect:()=>Ei(1)})})]}):y.jsx("div",{className:`screen-wall size-${Q}`,onClick:A=>{A.currentTarget===A.target&&jn()},children:Fs.map((A,K)=>{const te=K+1;return A?y.jsx(dp,{device:A,frame:oa.get(A.deviceId),selected:sa.has(A.deviceId)||Ia.has(te),controlEnabled:ki&&Ne&&le?.deviceId===A.deviceId,onSelect:()=>Or(A.deviceId),onFocusDevice:()=>Qa(A.deviceId),onOpenControl:()=>on(A.deviceId),sendInput:ua},A.deviceId):y.jsx(cp,{index:K,selected:Ia.has(te),onSelect:()=>Ei(te)},`slot-${K}`)})})}),y.jsxs("aside",{className:`right-dock ${Dn?"settings-mode":"actions-mode"} ${Ge?"collapsed":""}`,"aria-label":"LiveDesk tools",children:[y.jsx("button",{className:"dock-toggle",onClick:()=>Ve(A=>!A),"aria-label":Ge?"Show control panel":"Hide control panel",title:Ge?"Show control panel":"Hide control panel",type:"button",children:Ge?y.jsx(l0,{size:18}):y.jsx(u0,{size:18})}),!Ge&&(Dn?y.jsxs(y.Fragment,{children:[(x||l||X||ne)&&y.jsx("section",{className:"notice-band",children:x||l||X||ne}),y.jsxs("section",{className:"command-deck",children:[y.jsxs("div",{className:"setup-card",children:[y.jsxs("div",{className:"setup-head",children:[y.jsx("span",{className:"setup-icon",children:y.jsx(br,{size:18})}),y.jsxs("div",{children:[y.jsx("strong",{children:"Add workstation"}),y.jsx("span",{children:"Connect another local PC to this wall."})]})]}),y.jsxs("button",{className:"text-button primary full",onClick:()=>xs(Nn),type:"button",children:[y.jsx(As,{size:16}),"Copy setup"]}),y.jsxs("button",{className:"setup-disclosure",onClick:()=>Qs(A=>!A),type:"button",children:[y.jsx(gr,{size:15}),"Advanced setup"]}),kr&&y.jsxs("div",{className:"setup-code-row",children:[y.jsx("code",{children:Nn}),y.jsx("button",{className:"icon-button",onClick:()=>xs(Nn),title:"Copy setup command",type:"button",children:y.jsx(As,{size:16})})]})]}),y.jsxs("div",{className:"settings-card",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(Wc,{size:17}),y.jsx("h2",{children:"Files"})]}),y.jsxs("label",{className:"field-row",children:[y.jsx("span",{children:"Remote folder"}),y.jsx("input",{value:Yt,onChange:A=>Er(A.target.value),placeholder:"Desktop/LiveDeskFiles"})]}),y.jsx("p",{className:"muted",children:"Blank uses Desktop/LiveDeskFiles on each workstation."})]}),y.jsxs("div",{className:"deck-actions",children:[y.jsxs("button",{className:"text-button primary",onClick:()=>Xa({takeover:!0,requestLocalAccess:!0}),disabled:!i||D==="host",type:"button",children:[y.jsx(Zc,{size:16}),"Sync access"]}),y.jsxs("button",{className:"text-button buy",onClick:tl,disabled:D==="checkout"||H,type:"button",children:[y.jsx(md,{size:16}),$o]})]})]}),y.jsxs("section",{className:"status-strip",children:[y.jsxs("div",{className:`status-item state-${Ln}`,children:[y.jsx(nd,{size:18}),y.jsx("span",{children:"Local app"}),y.jsx("strong",{children:Ln})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(kg,{size:18}),y.jsx("span",{children:"Slots"}),y.jsxs("strong",{children:[Za,"/",Jt]})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(Sg,{size:18}),y.jsx("span",{children:"Frames"}),y.jsxs("strong",{children:[Lr," ",Rn]})]}),y.jsxs("div",{className:"status-item",children:[y.jsx(_g,{size:18}),y.jsx("span",{children:"Plan"}),y.jsx("strong",{children:Ai})]})]})]}):y.jsxs(y.Fragment,{children:[y.jsxs("section",{className:"action-dock",children:[y.jsxs("div",{className:"action-context",children:[y.jsx("span",{children:Wa>0?"Selection":"No selection"}),y.jsx("strong",{children:ma})]}),y.jsx("input",{ref:Ti,className:"hidden-file-input",type:"file",multiple:!0,onChange:A=>{A.currentTarget.files&&yt(A.currentTarget.files),A.currentTarget.value=""}}),(x||ne)&&y.jsx("div",{className:"notice-band compact",children:y.jsx("span",{children:x||ne})}),y.jsxs("div",{className:"action-grid",children:[y.jsxs("button",{className:"action-tile primary",onClick:()=>le&&da(le.deviceId),disabled:!Cr,type:"button",children:[y.jsx(ed,{size:21}),y.jsx("span",{children:"Live"})]}),y.jsxs("button",{className:`action-tile ${Ne?"active":""}`,onClick:()=>ut(A=>!A),disabled:!ki,type:"button",children:[y.jsx(gd,{size:21}),y.jsx("span",{children:Ya!=="idle"?Ya:"Control"})]}),y.jsxs("button",{className:`action-tile ${ht?"active":""}`,onClick:ct,disabled:!Va,type:"button",title:pt?"Remote PC audio":"Remote audio is not supported by this workstation yet",children:[y.jsx(Tg,{size:21}),y.jsx("span",{children:ht&&el!=="idle"?el:"Audio"})]}),y.jsxs("button",{className:"action-tile",onClick:()=>Ti.current?.click(),disabled:!Oe||On.length===0,type:"button",title:"File transfer",children:[y.jsx(Wc,{size:21}),y.jsx("span",{children:"Files"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Reboot",children:[y.jsx(x0,{size:21}),y.jsx("span",{children:"Reboot"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Power",children:[y.jsx(A0,{size:21}),y.jsx("span",{children:"Power"})]}),y.jsxs("button",{className:"action-tile",disabled:!0,type:"button",title:"Terminal",children:[y.jsx(gr,{size:21}),y.jsx("span",{children:"Shell"})]})]})]}),le&&Xt&&y.jsxs("section",{className:"side-panel selected-panel",children:[y.jsxs("div",{className:"machine-detail-head",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(br,{size:17}),y.jsx("h2",{children:"Machine detail"})]}),y.jsx("span",{className:`machine-health state-${Xt.state}`,children:Xt.label})]}),y.jsxs("div",{className:"machine-title",children:[y.jsx("strong",{children:Eo(le)}),y.jsx("span",{children:Xt.role})]}),y.jsx("div",{className:"machine-metric-grid",children:Xt.metrics.map(A=>y.jsxs("article",{className:`machine-metric state-${A.state}`,children:[y.jsx("span",{children:A.label}),y.jsx("strong",{children:A.value}),y.jsx("small",{children:A.detail}),A.ratio!==void 0&&y.jsx("i",{children:y.jsx("b",{style:{width:`${Math.round(A.ratio*100)}%`}})})]},A.id))}),y.jsxs("section",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(gr,{size:15}),y.jsx("span",{children:"Local services"})]}),y.jsx("div",{className:"tool-probe-list",children:Xt.tools.map(A=>y.jsxs("span",{className:`tool-probe state-${A.status}`,children:[y.jsx("b",{children:A.label}),y.jsx("em",{children:A.detail})]},A.id))})]}),y.jsxs("section",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(td,{size:15}),y.jsx("span",{children:"Workload"})]}),y.jsxs("div",{className:"workload-card",children:[y.jsx("strong",{children:Xt.taskLabel}),y.jsx("span",{children:Xt.taskStatus}),Xt.taskSummary&&y.jsx("p",{children:Xt.taskSummary})]})]}),y.jsxs("div",{className:"machine-section",children:[y.jsxs("div",{className:"machine-section-title",children:[y.jsx(nd,{size:15}),y.jsx("span",{children:"System"})]}),y.jsxs("dl",{className:"facts compact",children:[y.jsx("dt",{children:"Platform"}),y.jsxs("dd",{children:[le.platform||"-"," ",le.arch||""]}),y.jsx("dt",{children:"Release"}),y.jsx("dd",{children:Bt(le.status,"release")||"-"}),y.jsx("dt",{children:"Uptime"}),y.jsx("dd",{children:zp(Ke(le.status,"uptimeSec"))}),y.jsx("dt",{children:"Last seen"}),y.jsx("dd",{children:u_(le.lastSeenAt||le.connectedAt)}),y.jsx("dt",{children:"Agent"}),y.jsx("dd",{children:le.agentVersion||"-"}),y.jsx("dt",{children:"Address"}),y.jsx("dd",{children:le.remoteAddress||"-"})]})]}),xr&&y.jsx("p",{className:"panel-warning",children:xr}),y.jsxs("button",{className:"text-button full",onClick:()=>le&&da(le.deviceId),disabled:!Cr,type:"button",children:[y.jsx(ed,{size:16}),"Start live"]})]}),y.jsxs("section",{className:"side-panel task-panel",children:[y.jsxs("div",{className:"panel-title",children:[y.jsx(td,{size:17}),y.jsx("h2",{children:"Task"})]}),y.jsx("textarea",{value:_e,onChange:A=>E(A.target.value),placeholder:"Prepare a short status report.",rows:4}),y.jsxs("button",{className:"text-button full primary",onClick:jr,disabled:D==="task"||!_e.trim()||!Oe,type:"button",children:[y.jsx(td,{size:16}),"Send to connected"]})]})]}))]})]})})]}),ra&&y.jsxs("aside",{className:`transfer-bar state-${ra.status}`,"aria-live":"polite",children:[y.jsx("div",{className:"transfer-bar-track",children:y.jsx("span",{style:{width:`${Math.max(0,Math.min(100,ra.progress))}%`}})}),y.jsx("p",{children:ra.message})]})]})}Qv.createRoot(document.getElementById("root")).render(y.jsx(P.StrictMode,{children:y.jsx(z_,{})}));
|