function iM(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const oM="modulepreload",lM=function(t){return"/static/"+t},CS={},tu=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let h=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};var c=h;document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");i=h(n.map(m=>{if(m=lM(m),m in CS)return;CS[m]=!0;const v=m.endsWith(".css"),x=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":oM,v||(w.as="script"),w.crossOrigin="",w.href=m,f&&w.setAttribute("nonce",f),document.head.appendChild(w),v)return new Promise((S,E)=>{w.addEventListener("load",S),w.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})};function Kv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cM(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var $m={exports:{}},hc={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var RS;function uM(){if(RS)return hc;RS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:t,type:r,key:c,ref:i!==void 0?i:null,props:o}}return hc.Fragment=e,hc.jsx=n,hc.jsxs=n,hc}var OS;function dM(){return OS||(OS=1,$m.exports=uM()),$m.exports}var g=dM(),Bm={exports:{}},pc={},Hm={exports:{}},Fm={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var AS;function fM(){return AS||(AS=1,function(t){function e(M,W){var X=M.length;M.push(W);e:for(;0<X;){var H=X-1>>>1,j=M[H];if(0<i(j,W))M[H]=W,M[X]=j,X=H;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var W=M[0],X=M.pop();if(X!==W){M[0]=X;e:for(var H=0,j=M.length,V=j>>>1;H<V;){var re=2*(H+1)-1,U=M[re],ee=re+1,de=M[ee];if(0>i(U,X))ee<j&&0>i(de,U)?(M[H]=de,M[ee]=X,H=ee):(M[H]=U,M[re]=X,H=re);else if(ee<j&&0>i(de,X))M[H]=de,M[ee]=X,H=ee;else break e}}return W}function i(M,W){var X=M.sortIndex-W.sortIndex;return X!==0?X:M.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();t.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,v=null,x=3,w=!1,S=!1,E=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function k(M){for(var W=n(h);W!==null;){if(W.callback===null)r(h);else if(W.startTime<=M)r(h),W.sortIndex=W.expirationTime,e(f,W);else break;W=n(h)}}function D(M){if(E=!1,k(M),!S)if(n(f)!==null)S=!0,N||(N=!0,se());else{var W=n(h);W!==null&&ve(D,W.startTime-M)}}var N=!1,L=-1,Z=5,Q=-1;function te(){return _?!0:!(t.unstable_now()-Q<Z)}function ce(){if(_=!1,N){var M=t.unstable_now();Q=M;var W=!0;try{e:{S=!1,E&&(E=!1,R(L),L=-1),w=!0;var X=x;try{t:{for(k(M),v=n(f);v!==null&&!(v.expirationTime>M&&te());){var H=v.callback;if(typeof H=="function"){v.callback=null,x=v.priorityLevel;var j=H(v.expirationTime<=M);if(M=t.unstable_now(),typeof j=="function"){v.callback=j,k(M),W=!0;break t}v===n(f)&&r(f),k(M)}else r(f);v=n(f)}if(v!==null)W=!0;else{var V=n(h);V!==null&&ve(D,V.startTime-M),W=!1}}break e}finally{v=null,x=X,w=!1}W=void 0}}finally{W?se():N=!1}}}var se;if(typeof A=="function")se=function(){A(ce)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,pe=ge.port2;ge.port1.onmessage=ce,se=function(){pe.postMessage(null)}}else se=function(){C(ce,0)};function ve(M,W){L=C(function(){M(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(M){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var X=x;x=W;try{return M()}finally{x=X}},t.unstable_requestPaint=function(){_=!0},t.unstable_runWithPriority=function(M,W){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var X=x;x=M;try{return W()}finally{x=X}},t.unstable_scheduleCallback=function(M,W,X){var H=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?H+X:H):X=H,M){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=X+j,M={id:m++,callback:W,priorityLevel:M,startTime:X,expirationTime:j,sortIndex:-1},X>H?(M.sortIndex=X,e(h,M),n(f)===null&&M===n(h)&&(E?(R(L),L=-1):E=!0,ve(D,X-H))):(M.sortIndex=j,e(f,M),S||w||(S=!0,N||(N=!0,se()))),M},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(M){var W=x;return function(){var X=x;x=W;try{return M.apply(this,arguments)}finally{x=X}}}}(Fm)),Fm}var NS;function hM(){return NS||(NS=1,Hm.exports=fM()),Hm.exports}var qm={exports:{}},Ve={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var jS;function pM(){if(jS)return Ve;jS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function _(j,V,re){this.props=j,this.context=V,this.refs=E,this.updater=re||w}_.prototype.isReactComponent={},_.prototype.setState=function(j,V){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,V,"setState")},_.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function C(){}C.prototype=_.prototype;function R(j,V,re){this.props=j,this.context=V,this.refs=E,this.updater=re||w}var A=R.prototype=new C;A.constructor=R,S(A,_.prototype),A.isPureReactComponent=!0;var k=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},N=Object.prototype.hasOwnProperty;function L(j,V,re,U,ee,de){return re=de.ref,{$$typeof:t,type:j,key:V,ref:re!==void 0?re:null,props:de}}function Z(j,V){return L(j.type,V,void 0,void 0,void 0,j.props)}function Q(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function te(j){var V={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(re){return V[re]})}var ce=/\/+/g;function se(j,V){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):V.toString(36)}function ge(){}function pe(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(ge,ge):(j.status="pending",j.then(function(V){j.status==="pending"&&(j.status="fulfilled",j.value=V)},function(V){j.status==="pending"&&(j.status="rejected",j.reason=V)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function ve(j,V,re,U,ee){var de=typeof j;(de==="undefined"||de==="boolean")&&(j=null);var ie=!1;if(j===null)ie=!0;else switch(de){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(j.$$typeof){case t:case e:ie=!0;break;case m:return ie=j._init,ve(ie(j._payload),V,re,U,ee)}}if(ie)return ee=ee(j),ie=U===""?"."+se(j,0):U,k(ee)?(re="",ie!=null&&(re=ie.replace(ce,"$&/")+"/"),ve(ee,V,re,"",function(Ce){return Ce})):ee!=null&&(Q(ee)&&(ee=Z(ee,re+(ee.key==null||j&&j.key===ee.key?"":(""+ee.key).replace(ce,"$&/")+"/")+ie)),V.push(ee)),1;ie=0;var G=U===""?".":U+":";if(k(j))for(var me=0;me<j.length;me++)U=j[me],de=G+se(U,me),ie+=ve(U,V,re,de,ee);else if(me=x(j),typeof me=="function")for(j=me.call(j),me=0;!(U=j.next()).done;)U=U.value,de=G+se(U,me++),ie+=ve(U,V,re,de,ee);else if(de==="object"){if(typeof j.then=="function")return ve(pe(j),V,re,U,ee);throw V=String(j),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ie}function M(j,V,re){if(j==null)return j;var U=[],ee=0;return ve(j,U,"","",function(de){return V.call(re,de,ee++)}),U}function W(j){if(j._status===-1){var V=j._result;V=V(),V.then(function(re){(j._status===0||j._status===-1)&&(j._status=1,j._result=re)},function(re){(j._status===0||j._status===-1)&&(j._status=2,j._result=re)}),j._status===-1&&(j._status=0,j._result=V)}if(j._status===1)return j._result.default;throw j._result}var X=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)};function H(){}return Ve.Children={map:M,forEach:function(j,V,re){M(j,function(){V.apply(this,arguments)},re)},count:function(j){var V=0;return M(j,function(){V++}),V},toArray:function(j){return M(j,function(V){return V})||[]},only:function(j){if(!Q(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Ve.Component=_,Ve.Fragment=n,Ve.Profiler=i,Ve.PureComponent=R,Ve.StrictMode=r,Ve.Suspense=f,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(j){return D.H.useMemoCache(j)}},Ve.cache=function(j){return function(){return j.apply(null,arguments)}},Ve.cloneElement=function(j,V,re){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var U=S({},j.props),ee=j.key,de=void 0;if(V!=null)for(ie in V.ref!==void 0&&(de=void 0),V.key!==void 0&&(ee=""+V.key),V)!N.call(V,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&V.ref===void 0||(U[ie]=V[ie]);var ie=arguments.length-2;if(ie===1)U.children=re;else if(1<ie){for(var G=Array(ie),me=0;me<ie;me++)G[me]=arguments[me+2];U.children=G}return L(j.type,ee,void 0,void 0,de,U)},Ve.createContext=function(j){return j={$$typeof:c,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:o,_context:j},j},Ve.createElement=function(j,V,re){var U,ee={},de=null;if(V!=null)for(U in V.key!==void 0&&(de=""+V.key),V)N.call(V,U)&&U!=="key"&&U!=="__self"&&U!=="__source"&&(ee[U]=V[U]);var ie=arguments.length-2;if(ie===1)ee.children=re;else if(1<ie){for(var G=Array(ie),me=0;me<ie;me++)G[me]=arguments[me+2];ee.children=G}if(j&&j.defaultProps)for(U in ie=j.defaultProps,ie)ee[U]===void 0&&(ee[U]=ie[U]);return L(j,de,void 0,void 0,null,ee)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(j){return{$$typeof:u,render:j}},Ve.isValidElement=Q,Ve.lazy=function(j){return{$$typeof:m,_payload:{_status:-1,_result:j},_init:W}},Ve.memo=function(j,V){return{$$typeof:h,type:j,compare:V===void 0?null:V}},Ve.startTransition=function(j){var V=D.T,re={};D.T=re;try{var U=j(),ee=D.S;ee!==null&&ee(re,U),typeof U=="object"&&U!==null&&typeof U.then=="function"&&U.then(H,X)}catch(de){X(de)}finally{D.T=V}},Ve.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ve.use=function(j){return D.H.use(j)},Ve.useActionState=function(j,V,re){return D.H.useActionState(j,V,re)},Ve.useCallback=function(j,V){return D.H.useCallback(j,V)},Ve.useContext=function(j){return D.H.useContext(j)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(j,V){return D.H.useDeferredValue(j,V)},Ve.useEffect=function(j,V,re){var U=D.H;if(typeof re=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return U.useEffect(j,V)},Ve.useId=function(){return D.H.useId()},Ve.useImperativeHandle=function(j,V,re){return D.H.useImperativeHandle(j,V,re)},Ve.useInsertionEffect=function(j,V){return D.H.useInsertionEffect(j,V)},Ve.useLayoutEffect=function(j,V){return D.H.useLayoutEffect(j,V)},Ve.useMemo=function(j,V){return D.H.useMemo(j,V)},Ve.useOptimistic=function(j,V){return D.H.useOptimistic(j,V)},Ve.useReducer=function(j,V,re){return D.H.useReducer(j,V,re)},Ve.useRef=function(j){return D.H.useRef(j)},Ve.useState=function(j){return D.H.useState(j)},Ve.useSyncExternalStore=function(j,V,re){return D.H.useSyncExternalStore(j,V,re)},Ve.useTransition=function(){return D.H.useTransition()},Ve.version="19.1.0",Ve}var kS;function Zv(){return kS||(kS=1,qm.exports=pM()),qm.exports}var Vm={exports:{}},pn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var MS;function mM(){if(MS)return pn;MS=1;var t=Zv();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,h,m){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:f,containerInfo:h,implementation:m}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return o(f,h,null,m)},pn.flushSync=function(f){var h=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=m,r.d.f()}},pn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},pn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},pn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,v=u(m,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:w}):m==="script"&&r.d.X(f,{crossOrigin:v,integrity:x,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},pn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},pn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,v=u(m,h.crossOrigin);r.d.L(f,m,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},pn.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},pn.requestFormReset=function(f){r.d.r(f)},pn.unstable_batchedUpdates=function(f,h){return f(h)},pn.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},pn.useFormStatus=function(){return c.H.useHostTransitionStatus()},pn.version="19.1.0",pn}var DS;function N_(){if(DS)return Vm.exports;DS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Vm.exports=mM(),Vm.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var PS;function gM(){if(PS)return pc;PS=1;var t=hM(),e=Zv(),n=N_();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var s=a,l=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(l=s.return),a=s.return;while(a)}return s.tag===3?l:null}function c(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function u(a){if(o(a)!==a)throw Error(r(188))}function f(a){var s=a.alternate;if(!s){if(s=o(a),s===null)throw Error(r(188));return s!==a?null:a}for(var l=a,d=s;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return u(p),a;if(y===d)return u(p),s;y=y.sibling}throw Error(r(188))}if(l.return!==d.return)l=p,d=y;else{for(var T=!1,O=p.child;O;){if(O===l){T=!0,l=p,d=y;break}if(O===d){T=!0,d=p,l=y;break}O=O.sibling}if(!T){for(O=y.child;O;){if(O===l){T=!0,l=y,d=p;break}if(O===d){T=!0,d=y,l=p;break}O=O.sibling}if(!T)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?a:s}function h(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=h(a),s!==null)return s;a=a.sibling}return null}var m=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),R=Symbol.for("react.consumer"),A=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function se(a){return a===null||typeof a!="object"?null:(a=ce&&a[ce]||a["@@iterator"],typeof a=="function"?a:null)}var ge=Symbol.for("react.client.reference");function pe(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ge?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case _:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case N:return"SuspenseList";case Q:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case A:return(a.displayName||"Context")+".Provider";case R:return(a._context.displayName||"Context")+".Consumer";case k:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return s=a.displayName||null,s!==null?s:pe(a.type)||"Memo";case Z:s=a._payload,a=a._init;try{return pe(a(s))}catch{}}return null}var ve=Array.isArray,M=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},H=[],j=-1;function V(a){return{current:a}}function re(a){0>j||(a.current=H[j],H[j]=null,j--)}function U(a,s){j++,H[j]=a.current,a.current=s}var ee=V(null),de=V(null),ie=V(null),G=V(null);function me(a,s){switch(U(ie,s),U(de,a),U(ee,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?eS(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=eS(s),a=tS(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}re(ee),U(ee,a)}function Ce(){re(ee),re(de),re(ie)}function xe(a){a.memoizedState!==null&&U(G,a);var s=ee.current,l=tS(s,a.type);s!==l&&(U(de,a),U(ee,l))}function Ne(a){de.current===a&&(re(ee),re(de)),G.current===a&&(re(G),lc._currentValue=X)}var He=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,st=t.unstable_cancelCallback,bn=t.unstable_shouldYield,wn=t.unstable_requestPaint,Nt=t.unstable_now,Mt=t.unstable_getCurrentPriorityLevel,pa=t.unstable_ImmediatePriority,ma=t.unstable_UserBlockingPriority,en=t.unstable_NormalPriority,xn=t.unstable_LowPriority,tn=t.unstable_IdlePriority,zi=t.log,qs=t.unstable_setDisableYieldValue,wt=null,ft=null;function Bn(a){if(typeof zi=="function"&&qs(a),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(wt,a)}catch{}}var Yt=Math.clz32?Math.clz32:Vs,Ga=Math.log,sr=Math.LN2;function Vs(a){return a>>>=0,a===0?32:31-(Ga(a)/sr|0)|0}var Cr=256,An=4194304;function ir(a){var s=a&42;if(s!==0)return s;switch(a&-a){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:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Nn(a,s,l){var d=a.pendingLanes;if(d===0)return 0;var p=0,y=a.suspendedLanes,T=a.pingedLanes;a=a.warmLanes;var O=d&134217727;return O!==0?(d=O&~y,d!==0?p=ir(d):(T&=O,T!==0?p=ir(T):l||(l=O&~a,l!==0&&(p=ir(l))))):(O=d&~y,O!==0?p=ir(O):T!==0?p=ir(T):l||(l=d&~a,l!==0&&(p=ir(l)))),p===0?0:s!==0&&s!==p&&(s&y)===0&&(y=p&-p,l=s&-s,y>=l||y===32&&(l&4194048)!==0)?s:p}function or(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function Ui(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ga(){var a=Cr;return Cr<<=1,(Cr&4194048)===0&&(Cr=256),a}function Gs(){var a=An;return An<<=1,(An&62914560)===0&&(An=4194304),a}function Ya(a){for(var s=[],l=0;31>l;l++)s.push(a);return s}function Rr(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Hn(a,s,l,d,p,y){var T=a.pendingLanes;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=l,a.entangledLanes&=l,a.errorRecoveryDisabledLanes&=l,a.shellSuspendCounter=0;var O=a.entanglements,P=a.expirationTimes,q=a.hiddenUpdates;for(l=T&~l;0<l;){var ae=31-Yt(l),ue=1<<ae;O[ae]=0,P[ae]=-1;var K=q[ae];if(K!==null)for(q[ae]=null,ae=0;ae<K.length;ae++){var J=K[ae];J!==null&&(J.lane&=-536870913)}l&=~ue}d!==0&&va(a,d,0),y!==0&&p===0&&a.tag!==0&&(a.suspendedLanes|=y&~(T&~s))}function va(a,s,l){a.pendingLanes|=s,a.suspendedLanes&=~s;var d=31-Yt(s);a.entangledLanes|=s,a.entanglements[d]=a.entanglements[d]|1073741824|l&4194090}function je(a,s){var l=a.entangledLanes|=s;for(a=a.entanglements;l;){var d=31-Yt(l),p=1<<d;p&s|a[d]&s&&(a[d]|=s),l&=~p}}function rt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ht(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function I(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:wS(a.type))}function B(a,s){var l=W.p;try{return W.p=a,s()}finally{W.p=l}}var Y=Math.random().toString(36).slice(2),le="__reactFiber$"+Y,he="__reactProps$"+Y,Se="__reactContainer$"+Y,ke="__reactEvents$"+Y,Ee="__reactListeners$"+Y,Ae="__reactHandles$"+Y,Te="__reactResources$"+Y,Pe="__reactMarker$"+Y;function Le(a){delete a[le],delete a[he],delete a[ke],delete a[Ee],delete a[Ae]}function $e(a){var s=a[le];if(s)return s;for(var l=a.parentNode;l;){if(s=l[Se]||l[le]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(a=sS(a);a!==null;){if(l=a[le])return l;a=sS(a)}return s}a=l,l=a.parentNode}return null}function it(a){if(a=a[le]||a[Se]){var s=a.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return a}return null}function _t(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function jt(a){var s=a[Te];return s||(s=a[Te]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function lt(a){a[Pe]=!0}var nt=new Set,Wa={};function Sn(a,s){lr(a,s),lr(a+"Capture",s)}function lr(a,s){for(Wa[a]=s,a=0;a<s.length;a++)nt.add(s[a])}var jn=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]*$"),Ka={},Za={};function bl(a){return He.call(Za,a)?!0:He.call(Ka,a)?!1:jn.test(a)?Za[a]=!0:(Ka[a]=!0,!1)}function cr(a,s,l){if(bl(s))if(l===null)a.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+l)}}function ya(a,s,l){if(l===null)a.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+l)}}function Ze(a,s,l,d){if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttributeNS(s,l,""+d)}}var fn,Or;function Ar(a){if(fn===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);fn=s&&s[1]||"",Or=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+fn+a+Or}var Ys=!1;function Ct(a,s){if(!a||Ys)return"";Ys=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(J){var K=J}Reflect.construct(a,[],ue)}else{try{ue.call()}catch(J){K=J}a.call(ue.prototype)}}else{try{throw Error()}catch(J){K=J}(ue=a())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),T=y[0],O=y[1];if(T&&O){var P=T.split(`
`),q=O.split(`
`);for(p=d=0;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;for(;p<q.length&&!q[p].includes("DetermineComponentFrameRoot");)p++;if(d===P.length||p===q.length)for(d=P.length-1,p=q.length-1;1<=d&&0<=p&&P[d]!==q[p];)p--;for(;1<=d&&0<=p;d--,p--)if(P[d]!==q[p]){if(d!==1||p!==1)do if(d--,p--,0>p||P[d]!==q[p]){var ae=`
`+P[d].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),ae}while(1<=d&&0<=p);break}}}finally{Ys=!1,Error.prepareStackTrace=l}return(l=a?a.displayName||a.name:"")?Ar(l):""}function Qa(a){switch(a.tag){case 26:case 27:case 5:return Ar(a.type);case 16:return Ar("Lazy");case 13:return Ar("Suspense");case 19:return Ar("SuspenseList");case 0:case 15:return Ct(a.type,!1);case 11:return Ct(a.type.render,!1);case 1:return Ct(a.type,!0);case 31:return Ar("Activity");default:return""}}function wl(a){try{var s="";do s+=Qa(a),a=a.return;while(a);return s}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}function kn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function K0(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function tj(a){var s=K0(a)?"checked":"value",l=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),d=""+a[s];if(!a.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,y=l.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return p.call(this)},set:function(T){d=""+T,y.call(this,T)}}),Object.defineProperty(a,s,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(T){d=""+T},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function xu(a){a._valueTracker||(a._valueTracker=tj(a))}function Z0(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var l=s.getValue(),d="";return a&&(d=K0(a)?a.checked?"true":"false":a.value),a=d,a!==l?(s.setValue(a),!0):!1}function Su(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var nj=/[\n"\\]/g;function ur(a){return a.replace(nj,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ih(a,s,l,d,p,y,T,O){a.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?a.type=T:a.removeAttribute("type"),s!=null?T==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+kn(s)):a.value!==""+kn(s)&&(a.value=""+kn(s)):T!=="submit"&&T!=="reset"||a.removeAttribute("value"),s!=null?zh(a,T,kn(s)):l!=null?zh(a,T,kn(l)):d!=null&&a.removeAttribute("value"),p==null&&y!=null&&(a.defaultChecked=!!y),p!=null&&(a.checked=p&&typeof p!="function"&&typeof p!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?a.name=""+kn(O):a.removeAttribute("name")}function Q0(a,s,l,d,p,y,T,O){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),s!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||s!=null))return;l=l!=null?""+kn(l):"",s=s!=null?""+kn(s):l,O||s===a.value||(a.value=s),a.defaultValue=s}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,a.checked=O?a.checked:!!d,a.defaultChecked=!!d,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(a.name=T)}function zh(a,s,l){s==="number"&&Su(a.ownerDocument)===a||a.defaultValue===""+l||(a.defaultValue=""+l)}function $i(a,s,l,d){if(a=a.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<a.length;l++)p=s.hasOwnProperty("$"+a[l].value),a[l].selected!==p&&(a[l].selected=p),p&&d&&(a[l].defaultSelected=!0)}else{for(l=""+kn(l),s=null,p=0;p<a.length;p++){if(a[p].value===l){a[p].selected=!0,d&&(a[p].defaultSelected=!0);return}s!==null||a[p].disabled||(s=a[p])}s!==null&&(s.selected=!0)}}function X0(a,s,l){if(s!=null&&(s=""+kn(s),s!==a.value&&(a.value=s),l==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=l!=null?""+kn(l):""}function J0(a,s,l,d){if(s==null){if(d!=null){if(l!=null)throw Error(r(92));if(ve(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),s=l}l=kn(s),a.defaultValue=l,d=a.textContent,d===l&&d!==""&&d!==null&&(a.value=d)}function Bi(a,s){if(s){var l=a.firstChild;if(l&&l===a.lastChild&&l.nodeType===3){l.nodeValue=s;return}}a.textContent=s}var rj=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 eb(a,s,l){var d=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":d?a.setProperty(s,l):typeof l!="number"||l===0||rj.has(s)?s==="float"?a.cssFloat=l:a[s]=(""+l).trim():a[s]=l+"px"}function tb(a,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?a.setProperty(d,""):d==="float"?a.cssFloat="":a[d]="");for(var p in s)d=s[p],s.hasOwnProperty(p)&&l[p]!==d&&eb(a,p,d)}else for(var y in s)s.hasOwnProperty(y)&&eb(a,y,s[y])}function Uh(a){if(a.indexOf("-")===-1)return!1;switch(a){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 aj=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"]]),sj=/^[\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 Eu(a){return sj.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var $h=null;function Bh(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Hi=null,Fi=null;function nb(a){var s=it(a);if(s&&(a=s.stateNode)){var l=a[he]||null;e:switch(a=s.stateNode,s.type){case"input":if(Ih(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=a;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ur(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var d=l[s];if(d!==a&&d.form===a.form){var p=d[he]||null;if(!p)throw Error(r(90));Ih(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)d=l[s],d.form===a.form&&Z0(d)}break e;case"textarea":X0(a,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&$i(a,!!l.multiple,s,!1)}}}var Hh=!1;function rb(a,s,l){if(Hh)return a(s,l);Hh=!0;try{var d=a(s);return d}finally{if(Hh=!1,(Hi!==null||Fi!==null)&&(ld(),Hi&&(s=Hi,a=Fi,Fi=Hi=null,nb(s),a)))for(s=0;s<a.length;s++)nb(a[s])}}function xl(a,s){var l=a.stateNode;if(l===null)return null;var d=l[he]||null;if(d===null)return null;l=d[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(a=a.type,d=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!d;break e;default:a=!1}if(a)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=!1;if(ba)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){Fh=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Fh=!1}var Xa=null,qh=null,_u=null;function ab(){if(_u)return _u;var a,s=qh,l=s.length,d,p="value"in Xa?Xa.value:Xa.textContent,y=p.length;for(a=0;a<l&&s[a]===p[a];a++);var T=l-a;for(d=1;d<=T&&s[l-d]===p[y-d];d++);return _u=p.slice(a,1<d?1-d:void 0)}function Tu(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function Cu(){return!0}function sb(){return!1}function Mn(a){function s(l,d,p,y,T){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=T,this.currentTarget=null;for(var O in a)a.hasOwnProperty(O)&&(l=a[O],this[O]=l?l(y):y[O]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Cu:sb,this.isPropagationStopped=sb,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Cu)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Cu)},persist:function(){},isPersistent:Cu}),s}var Ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ru=Mn(Ws),El=m({},Ws,{view:0,detail:0}),ij=Mn(El),Vh,Gh,_l,Ou=m({},El,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wh,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==_l&&(_l&&a.type==="mousemove"?(Vh=a.screenX-_l.screenX,Gh=a.screenY-_l.screenY):Gh=Vh=0,_l=a),Vh)},movementY:function(a){return"movementY"in a?a.movementY:Gh}}),ib=Mn(Ou),oj=m({},Ou,{dataTransfer:0}),lj=Mn(oj),cj=m({},El,{relatedTarget:0}),Yh=Mn(cj),uj=m({},Ws,{animationName:0,elapsedTime:0,pseudoElement:0}),dj=Mn(uj),fj=m({},Ws,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),hj=Mn(fj),pj=m({},Ws,{data:0}),ob=Mn(pj),mj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gj={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"},vj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yj(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=vj[a])?!!s[a]:!1}function Wh(){return yj}var bj=m({},El,{key:function(a){if(a.key){var s=mj[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=Tu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?gj[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wh,charCode:function(a){return a.type==="keypress"?Tu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Tu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wj=Mn(bj),xj=m({},Ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lb=Mn(xj),Sj=m({},El,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wh}),Ej=Mn(Sj),_j=m({},Ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tj=Mn(_j),Cj=m({},Ou,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Rj=Mn(Cj),Oj=m({},Ws,{newState:0,oldState:0}),Aj=Mn(Oj),Nj=[9,13,27,32],Kh=ba&&"CompositionEvent"in window,Tl=null;ba&&"documentMode"in document&&(Tl=document.documentMode);var jj=ba&&"TextEvent"in window&&!Tl,cb=ba&&(!Kh||Tl&&8<Tl&&11>=Tl),ub=" ",db=!1;function fb(a,s){switch(a){case"keyup":return Nj.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var qi=!1;function kj(a,s){switch(a){case"compositionend":return hb(s);case"keypress":return s.which!==32?null:(db=!0,ub);case"textInput":return a=s.data,a===ub&&db?null:a;default:return null}}function Mj(a,s){if(qi)return a==="compositionend"||!Kh&&fb(a,s)?(a=ab(),_u=qh=Xa=null,qi=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return cb&&s.locale!=="ko"?null:s.data;default:return null}}var Dj={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 pb(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!Dj[a.type]:s==="textarea"}function mb(a,s,l,d){Hi?Fi?Fi.push(d):Fi=[d]:Hi=d,s=pd(s,"onChange"),0<s.length&&(l=new Ru("onChange","change",null,l,d),a.push({event:l,listeners:s}))}var Cl=null,Rl=null;function Pj(a){Kx(a,0)}function Au(a){var s=_t(a);if(Z0(s))return a}function gb(a,s){if(a==="change")return s}var vb=!1;if(ba){var Zh;if(ba){var Qh="oninput"in document;if(!Qh){var yb=document.createElement("div");yb.setAttribute("oninput","return;"),Qh=typeof yb.oninput=="function"}Zh=Qh}else Zh=!1;vb=Zh&&(!document.documentMode||9<document.documentMode)}function bb(){Cl&&(Cl.detachEvent("onpropertychange",wb),Rl=Cl=null)}function wb(a){if(a.propertyName==="value"&&Au(Rl)){var s=[];mb(s,Rl,a,Bh(a)),rb(Pj,s)}}function Lj(a,s,l){a==="focusin"?(bb(),Cl=s,Rl=l,Cl.attachEvent("onpropertychange",wb)):a==="focusout"&&bb()}function Ij(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Au(Rl)}function zj(a,s){if(a==="click")return Au(s)}function Uj(a,s){if(a==="input"||a==="change")return Au(s)}function $j(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var Fn=typeof Object.is=="function"?Object.is:$j;function Ol(a,s){if(Fn(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var l=Object.keys(a),d=Object.keys(s);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!He.call(s,p)||!Fn(a[p],s[p]))return!1}return!0}function xb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Sb(a,s){var l=xb(a);a=0;for(var d;l;){if(l.nodeType===3){if(d=a+l.textContent.length,a<=s&&d>=s)return{node:l,offset:s-a};a=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=xb(l)}}function Eb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Eb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function _b(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=Su(a.document);s instanceof a.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)a=s.contentWindow;else break;s=Su(a.document)}return s}function Xh(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var Bj=ba&&"documentMode"in document&&11>=document.documentMode,Vi=null,Jh=null,Al=null,ep=!1;function Tb(a,s,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ep||Vi==null||Vi!==Su(d)||(d=Vi,"selectionStart"in d&&Xh(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Al&&Ol(Al,d)||(Al=d,d=pd(Jh,"onSelect"),0<d.length&&(s=new Ru("onSelect","select",null,s,l),a.push({event:s,listeners:d}),s.target=Vi)))}function Ks(a,s){var l={};return l[a.toLowerCase()]=s.toLowerCase(),l["Webkit"+a]="webkit"+s,l["Moz"+a]="moz"+s,l}var Gi={animationend:Ks("Animation","AnimationEnd"),animationiteration:Ks("Animation","AnimationIteration"),animationstart:Ks("Animation","AnimationStart"),transitionrun:Ks("Transition","TransitionRun"),transitionstart:Ks("Transition","TransitionStart"),transitioncancel:Ks("Transition","TransitionCancel"),transitionend:Ks("Transition","TransitionEnd")},tp={},Cb={};ba&&(Cb=document.createElement("div").style,"AnimationEvent"in window||(delete Gi.animationend.animation,delete Gi.animationiteration.animation,delete Gi.animationstart.animation),"TransitionEvent"in window||delete Gi.transitionend.transition);function Zs(a){if(tp[a])return tp[a];if(!Gi[a])return a;var s=Gi[a],l;for(l in s)if(s.hasOwnProperty(l)&&l in Cb)return tp[a]=s[l];return a}var Rb=Zs("animationend"),Ob=Zs("animationiteration"),Ab=Zs("animationstart"),Hj=Zs("transitionrun"),Fj=Zs("transitionstart"),qj=Zs("transitioncancel"),Nb=Zs("transitionend"),jb=new Map,np="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(" ");np.push("scrollEnd");function Nr(a,s){jb.set(a,s),Sn(s,[a])}var kb=new WeakMap;function dr(a,s){if(typeof a=="object"&&a!==null){var l=kb.get(a);return l!==void 0?l:(s={value:a,source:s,stack:wl(s)},kb.set(a,s),s)}return{value:a,source:s,stack:wl(s)}}var fr=[],Yi=0,rp=0;function Nu(){for(var a=Yi,s=rp=Yi=0;s<a;){var l=fr[s];fr[s++]=null;var d=fr[s];fr[s++]=null;var p=fr[s];fr[s++]=null;var y=fr[s];if(fr[s++]=null,d!==null&&p!==null){var T=d.pending;T===null?p.next=p:(p.next=T.next,T.next=p),d.pending=p}y!==0&&Mb(l,p,y)}}function ju(a,s,l,d){fr[Yi++]=a,fr[Yi++]=s,fr[Yi++]=l,fr[Yi++]=d,rp|=d,a.lanes|=d,a=a.alternate,a!==null&&(a.lanes|=d)}function ap(a,s,l,d){return ju(a,s,l,d),ku(a)}function Wi(a,s){return ju(a,null,null,s),ku(a)}function Mb(a,s,l){a.lanes|=l;var d=a.alternate;d!==null&&(d.lanes|=l);for(var p=!1,y=a.return;y!==null;)y.childLanes|=l,d=y.alternate,d!==null&&(d.childLanes|=l),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(p=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,p&&s!==null&&(p=31-Yt(l),a=y.hiddenUpdates,d=a[p],d===null?a[p]=[s]:d.push(s),s.lane=l|536870912),y):null}function ku(a){if(50<ec)throw ec=0,um=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Ki={};function Vj(a,s,l,d){this.tag=a,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(a,s,l,d){return new Vj(a,s,l,d)}function sp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wa(a,s){var l=a.alternate;return l===null?(l=qn(a.tag,s,a.key,a.mode),l.elementType=a.elementType,l.type=a.type,l.stateNode=a.stateNode,l.alternate=a,a.alternate=l):(l.pendingProps=s,l.type=a.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=a.flags&65011712,l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,s=a.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=a.sibling,l.index=a.index,l.ref=a.ref,l.refCleanup=a.refCleanup,l}function Db(a,s){a.flags&=65011714;var l=a.alternate;return l===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,s=l.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function Mu(a,s,l,d,p,y){var T=0;if(d=a,typeof a=="function")sp(a)&&(T=1);else if(typeof a=="string")T=Yk(a,l,ee.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case Q:return a=qn(31,l,s,p),a.elementType=Q,a.lanes=y,a;case S:return Qs(l.children,p,y,s);case E:T=8,p|=24;break;case _:return a=qn(12,l,s,p|2),a.elementType=_,a.lanes=y,a;case D:return a=qn(13,l,s,p),a.elementType=D,a.lanes=y,a;case N:return a=qn(19,l,s,p),a.elementType=N,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case C:case A:T=10;break e;case R:T=9;break e;case k:T=11;break e;case L:T=14;break e;case Z:T=16,d=null;break e}T=29,l=Error(r(130,a===null?"null":typeof a,"")),d=null}return s=qn(T,l,s,p),s.elementType=a,s.type=d,s.lanes=y,s}function Qs(a,s,l,d){return a=qn(7,a,d,s),a.lanes=l,a}function ip(a,s,l){return a=qn(6,a,null,s),a.lanes=l,a}function op(a,s,l){return s=qn(4,a.children!==null?a.children:[],a.key,s),s.lanes=l,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var Zi=[],Qi=0,Du=null,Pu=0,hr=[],pr=0,Xs=null,xa=1,Sa="";function Js(a,s){Zi[Qi++]=Pu,Zi[Qi++]=Du,Du=a,Pu=s}function Pb(a,s,l){hr[pr++]=xa,hr[pr++]=Sa,hr[pr++]=Xs,Xs=a;var d=xa;a=Sa;var p=32-Yt(d)-1;d&=~(1<<p),l+=1;var y=32-Yt(s)+p;if(30<y){var T=p-p%5;y=(d&(1<<T)-1).toString(32),d>>=T,p-=T,xa=1<<32-Yt(s)+p|l<<p|d,Sa=y+a}else xa=1<<y|l<<p|d,Sa=a}function lp(a){a.return!==null&&(Js(a,1),Pb(a,1,0))}function cp(a){for(;a===Du;)Du=Zi[--Qi],Zi[Qi]=null,Pu=Zi[--Qi],Zi[Qi]=null;for(;a===Xs;)Xs=hr[--pr],hr[pr]=null,Sa=hr[--pr],hr[pr]=null,xa=hr[--pr],hr[pr]=null}var En=null,Dt=null,ut=!1,ei=null,Xr=!1,up=Error(r(519));function ti(a){var s=Error(r(418,""));throw kl(dr(s,a)),up}function Lb(a){var s=a.stateNode,l=a.type,d=a.memoizedProps;switch(s[le]=a,s[he]=d,l){case"dialog":Je("cancel",s),Je("close",s);break;case"iframe":case"object":case"embed":Je("load",s);break;case"video":case"audio":for(l=0;l<nc.length;l++)Je(nc[l],s);break;case"source":Je("error",s);break;case"img":case"image":case"link":Je("error",s),Je("load",s);break;case"details":Je("toggle",s);break;case"input":Je("invalid",s),Q0(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0),xu(s);break;case"select":Je("invalid",s);break;case"textarea":Je("invalid",s),J0(s,d.value,d.defaultValue,d.children),xu(s)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||d.suppressHydrationWarning===!0||Jx(s.textContent,l)?(d.popover!=null&&(Je("beforetoggle",s),Je("toggle",s)),d.onScroll!=null&&Je("scroll",s),d.onScrollEnd!=null&&Je("scrollend",s),d.onClick!=null&&(s.onclick=md),s=!0):s=!1,s||ti(a)}function Ib(a){for(En=a.return;En;)switch(En.tag){case 5:case 13:Xr=!1;return;case 27:case 3:Xr=!0;return;default:En=En.return}}function Nl(a){if(a!==En)return!1;if(!ut)return Ib(a),ut=!0,!1;var s=a.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=a.type,l=!(l!=="form"&&l!=="button")||Cm(a.type,a.memoizedProps)),l=!l),l&&Dt&&ti(a),Ib(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,s=0;a;){if(a.nodeType===8)if(l=a.data,l==="/$"){if(s===0){Dt=kr(a.nextSibling);break e}s--}else l!=="$"&&l!=="$!"&&l!=="$?"||s++;a=a.nextSibling}Dt=null}}else s===27?(s=Dt,ps(a.type)?(a=Nm,Nm=null,Dt=a):Dt=s):Dt=En?kr(a.stateNode.nextSibling):null;return!0}function jl(){Dt=En=null,ut=!1}function zb(){var a=ei;return a!==null&&(Ln===null?Ln=a:Ln.push.apply(Ln,a),ei=null),a}function kl(a){ei===null?ei=[a]:ei.push(a)}var dp=V(null),ni=null,Ea=null;function Ja(a,s,l){U(dp,s._currentValue),s._currentValue=l}function _a(a){a._currentValue=dp.current,re(dp)}function fp(a,s,l){for(;a!==null;){var d=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),a===l)break;a=a.return}}function hp(a,s,l,d){var p=a.child;for(p!==null&&(p.return=a);p!==null;){var y=p.dependencies;if(y!==null){var T=p.child;y=y.firstContext;e:for(;y!==null;){var O=y;y=p;for(var P=0;P<s.length;P++)if(O.context===s[P]){y.lanes|=l,O=y.alternate,O!==null&&(O.lanes|=l),fp(y.return,l,a),d||(T=null);break e}y=O.next}}else if(p.tag===18){if(T=p.return,T===null)throw Error(r(341));T.lanes|=l,y=T.alternate,y!==null&&(y.lanes|=l),fp(T,l,a),T=null}else T=p.child;if(T!==null)T.return=p;else for(T=p;T!==null;){if(T===a){T=null;break}if(p=T.sibling,p!==null){p.return=T.return,T=p;break}T=T.return}p=T}}function Ml(a,s,l,d){a=null;for(var p=s,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var T=p.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var O=p.type;Fn(p.pendingProps.value,T.value)||(a!==null?a.push(O):a=[O])}}else if(p===G.current){if(T=p.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(a!==null?a.push(lc):a=[lc])}p=p.return}a!==null&&hp(s,a,l,d),s.flags|=262144}function Lu(a){for(a=a.firstContext;a!==null;){if(!Fn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ri(a){ni=a,Ea=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function hn(a){return Ub(ni,a)}function Iu(a,s){return ni===null&&ri(a),Ub(a,s)}function Ub(a,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},Ea===null){if(a===null)throw Error(r(308));Ea=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ea=Ea.next=s;return l}var Gj=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(l,d){a.push(d)}};this.abort=function(){s.aborted=!0,a.forEach(function(l){return l()})}},Yj=t.unstable_scheduleCallback,Wj=t.unstable_NormalPriority,Wt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pp(){return{controller:new Gj,data:new Map,refCount:0}}function Dl(a){a.refCount--,a.refCount===0&&Yj(Wj,function(){a.controller.abort()})}var Pl=null,mp=0,Xi=0,Ji=null;function Kj(a,s){if(Pl===null){var l=Pl=[];mp=0,Xi=vm(),Ji={status:"pending",value:void 0,then:function(d){l.push(d)}}}return mp++,s.then($b,$b),s}function $b(){if(--mp===0&&Pl!==null){Ji!==null&&(Ji.status="fulfilled");var a=Pl;Pl=null,Xi=0,Ji=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function Zj(a,s){var l=[],d={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return a.then(function(){d.status="fulfilled",d.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(d.status="rejected",d.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),d}var Bb=M.S;M.S=function(a,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&Kj(a,s),Bb!==null&&Bb(a,s)};var ai=V(null);function gp(){var a=ai.current;return a!==null?a:St.pooledCache}function zu(a,s){s===null?U(ai,ai.current):U(ai,s.pool)}function Hb(){var a=gp();return a===null?null:{parent:Wt._currentValue,pool:a}}var Ll=Error(r(460)),Fb=Error(r(474)),Uu=Error(r(542)),vp={then:function(){}};function qb(a){return a=a.status,a==="fulfilled"||a==="rejected"}function $u(){}function Vb(a,s,l){switch(l=a[l],l===void 0?a.push(s):l!==s&&(s.then($u,$u),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Yb(a),a;default:if(typeof s.status=="string")s.then($u,$u);else{if(a=St,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(d){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=d}},function(d){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,Yb(a),a}throw Il=s,Ll}}var Il=null;function Gb(){if(Il===null)throw Error(r(459));var a=Il;return Il=null,a}function Yb(a){if(a===Ll||a===Uu)throw Error(r(483))}var es=!1;function yp(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bp(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ts(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ns(a,s,l){var d=a.updateQueue;if(d===null)return null;if(d=d.shared,(mt&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,s=ku(a),Mb(a,null,l),s}return ju(a,d,s,l),ku(a)}function zl(a,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var d=s.lanes;d&=a.pendingLanes,l|=d,s.lanes=l,je(a,l)}}function wp(a,s){var l=a.updateQueue,d=a.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=T:y=y.next=T,l=l.next}while(l!==null);y===null?p=y=s:y=y.next=s}else p=y=s;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},a.updateQueue=l;return}a=l.lastBaseUpdate,a===null?l.firstBaseUpdate=s:a.next=s,l.lastBaseUpdate=s}var xp=!1;function Ul(){if(xp){var a=Ji;if(a!==null)throw a}}function $l(a,s,l,d){xp=!1;var p=a.updateQueue;es=!1;var y=p.firstBaseUpdate,T=p.lastBaseUpdate,O=p.shared.pending;if(O!==null){p.shared.pending=null;var P=O,q=P.next;P.next=null,T===null?y=q:T.next=q,T=P;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,O=ae.lastBaseUpdate,O!==T&&(O===null?ae.firstBaseUpdate=q:O.next=q,ae.lastBaseUpdate=P))}if(y!==null){var ue=p.baseState;T=0,ae=q=P=null,O=y;do{var K=O.lane&-536870913,J=K!==O.lane;if(J?(at&K)===K:(d&K)===K){K!==0&&K===Xi&&(xp=!0),ae!==null&&(ae=ae.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ie=a,Me=O;K=s;var bt=l;switch(Me.tag){case 1:if(Ie=Me.payload,typeof Ie=="function"){ue=Ie.call(bt,ue,K);break e}ue=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Me.payload,K=typeof Ie=="function"?Ie.call(bt,ue,K):Ie,K==null)break e;ue=m({},ue,K);break e;case 2:es=!0}}K=O.callback,K!==null&&(a.flags|=64,J&&(a.flags|=8192),J=p.callbacks,J===null?p.callbacks=[K]:J.push(K))}else J={lane:K,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ae===null?(q=ae=J,P=ue):ae=ae.next=J,T|=K;if(O=O.next,O===null){if(O=p.shared.pending,O===null)break;J=O,O=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ae===null&&(P=ue),p.baseState=P,p.firstBaseUpdate=q,p.lastBaseUpdate=ae,y===null&&(p.shared.lanes=0),us|=T,a.lanes=T,a.memoizedState=ue}}function Wb(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function Kb(a,s){var l=a.callbacks;if(l!==null)for(a.callbacks=null,a=0;a<l.length;a++)Wb(l[a],s)}var eo=V(null),Bu=V(0);function Zb(a,s){a=ja,U(Bu,a),U(eo,s),ja=a|s.baseLanes}function Sp(){U(Bu,ja),U(eo,eo.current)}function Ep(){ja=Bu.current,re(eo),re(Bu)}var rs=0,We=null,vt=null,qt=null,Hu=!1,to=!1,si=!1,Fu=0,Bl=0,no=null,Qj=0;function Ut(){throw Error(r(321))}function _p(a,s){if(s===null)return!1;for(var l=0;l<s.length&&l<a.length;l++)if(!Fn(a[l],s[l]))return!1;return!0}function Tp(a,s,l,d,p,y){return rs=y,We=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,M.H=a===null||a.memoizedState===null?Mw:Dw,si=!1,y=l(d,p),si=!1,to&&(y=Xb(s,l,d,p)),Qb(a),y}function Qb(a){M.H=Ku;var s=vt!==null&&vt.next!==null;if(rs=0,qt=vt=We=null,Hu=!1,Bl=0,no=null,s)throw Error(r(300));a===null||nn||(a=a.dependencies,a!==null&&Lu(a)&&(nn=!0))}function Xb(a,s,l,d){We=a;var p=0;do{if(to&&(no=null),Bl=0,to=!1,25<=p)throw Error(r(301));if(p+=1,qt=vt=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}M.H=ak,y=s(l,d)}while(to);return y}function Xj(){var a=M.H,s=a.useState()[0];return s=typeof s.then=="function"?Hl(s):s,a=a.useState()[0],(vt!==null?vt.memoizedState:null)!==a&&(We.flags|=1024),s}function Cp(){var a=Fu!==0;return Fu=0,a}function Rp(a,s,l){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~l}function Op(a){if(Hu){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Hu=!1}rs=0,qt=vt=We=null,to=!1,Bl=Fu=0,no=null}function Dn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?We.memoizedState=qt=a:qt=qt.next=a,qt}function Vt(){if(vt===null){var a=We.alternate;a=a!==null?a.memoizedState:null}else a=vt.next;var s=qt===null?We.memoizedState:qt.next;if(s!==null)qt=s,vt=a;else{if(a===null)throw We.alternate===null?Error(r(467)):Error(r(310));vt=a,a={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},qt===null?We.memoizedState=qt=a:qt=qt.next=a}return qt}function Ap(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hl(a){var s=Bl;return Bl+=1,no===null&&(no=[]),a=Vb(no,a,s),s=We,(qt===null?s.memoizedState:qt.next)===null&&(s=s.alternate,M.H=s===null||s.memoizedState===null?Mw:Dw),a}function qu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Hl(a);if(a.$$typeof===A)return hn(a)}throw Error(r(438,String(a)))}function Np(a){var s=null,l=We.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var d=We.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Ap(),We.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(a),d=0;d<a;d++)l[d]=te;return s.index++,l}function Ta(a,s){return typeof s=="function"?s(a):s}function Vu(a){var s=Vt();return jp(s,vt,a)}function jp(a,s,l){var d=a.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var p=a.baseQueue,y=d.pending;if(y!==null){if(p!==null){var T=p.next;p.next=y.next,y.next=T}s.baseQueue=p=y,d.pending=null}if(y=a.baseState,p===null)a.memoizedState=y;else{s=p.next;var O=T=null,P=null,q=s,ae=!1;do{var ue=q.lane&-536870913;if(ue!==q.lane?(at&ue)===ue:(rs&ue)===ue){var K=q.revertLane;if(K===0)P!==null&&(P=P.next={lane:0,revertLane:0,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ue===Xi&&(ae=!0);else if((rs&K)===K){q=q.next,K===Xi&&(ae=!0);continue}else ue={lane:0,revertLane:q.revertLane,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},P===null?(O=P=ue,T=y):P=P.next=ue,We.lanes|=K,us|=K;ue=q.action,si&&l(y,ue),y=q.hasEagerState?q.eagerState:l(y,ue)}else K={lane:ue,revertLane:q.revertLane,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},P===null?(O=P=K,T=y):P=P.next=K,We.lanes|=ue,us|=ue;q=q.next}while(q!==null&&q!==s);if(P===null?T=y:P.next=O,!Fn(y,a.memoizedState)&&(nn=!0,ae&&(l=Ji,l!==null)))throw l;a.memoizedState=y,a.baseState=T,a.baseQueue=P,d.lastRenderedState=y}return p===null&&(d.lanes=0),[a.memoizedState,d.dispatch]}function kp(a){var s=Vt(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var d=l.dispatch,p=l.pending,y=s.memoizedState;if(p!==null){l.pending=null;var T=p=p.next;do y=a(y,T.action),T=T.next;while(T!==p);Fn(y,s.memoizedState)||(nn=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),l.lastRenderedState=y}return[y,d]}function Jb(a,s,l){var d=We,p=Vt(),y=ut;if(y){if(l===void 0)throw Error(r(407));l=l()}else l=s();var T=!Fn((vt||p).memoizedState,l);T&&(p.memoizedState=l,nn=!0),p=p.queue;var O=nw.bind(null,d,p,a);if(Fl(2048,8,O,[a]),p.getSnapshot!==s||T||qt!==null&&qt.memoizedState.tag&1){if(d.flags|=2048,ro(9,Gu(),tw.bind(null,d,p,l,s),null),St===null)throw Error(r(349));y||(rs&124)!==0||ew(d,s,l)}return l}function ew(a,s,l){a.flags|=16384,a={getSnapshot:s,value:l},s=We.updateQueue,s===null?(s=Ap(),We.updateQueue=s,s.stores=[a]):(l=s.stores,l===null?s.stores=[a]:l.push(a))}function tw(a,s,l,d){s.value=l,s.getSnapshot=d,rw(s)&&aw(a)}function nw(a,s,l){return l(function(){rw(s)&&aw(a)})}function rw(a){var s=a.getSnapshot;a=a.value;try{var l=s();return!Fn(a,l)}catch{return!0}}function aw(a){var s=Wi(a,2);s!==null&&Kn(s,a,2)}function Mp(a){var s=Dn();if(typeof a=="function"){var l=a;if(a=l(),si){Bn(!0);try{l()}finally{Bn(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:a},s}function sw(a,s,l,d){return a.baseState=l,jp(a,vt,typeof d=="function"?d:Ta)}function Jj(a,s,l,d,p){if(Wu(a))throw Error(r(485));if(a=s.action,a!==null){var y={payload:p,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){y.listeners.push(T)}};M.T!==null?l(!0):y.isTransition=!1,d(y),l=s.pending,l===null?(y.next=s.pending=y,iw(s,y)):(y.next=l.next,s.pending=l.next=y)}}function iw(a,s){var l=s.action,d=s.payload,p=a.state;if(s.isTransition){var y=M.T,T={};M.T=T;try{var O=l(p,d),P=M.S;P!==null&&P(T,O),ow(a,s,O)}catch(q){Dp(a,s,q)}finally{M.T=y}}else try{y=l(p,d),ow(a,s,y)}catch(q){Dp(a,s,q)}}function ow(a,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){lw(a,s,d)},function(d){return Dp(a,s,d)}):lw(a,s,l)}function lw(a,s,l){s.status="fulfilled",s.value=l,cw(s),a.state=l,s=a.pending,s!==null&&(l=s.next,l===s?a.pending=null:(l=l.next,s.next=l,iw(a,l)))}function Dp(a,s,l){var d=a.pending;if(a.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=l,cw(s),s=s.next;while(s!==d)}a.action=null}function cw(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function uw(a,s){return s}function dw(a,s){if(ut){var l=St.formState;if(l!==null){e:{var d=We;if(ut){if(Dt){t:{for(var p=Dt,y=Xr;p.nodeType!==8;){if(!y){p=null;break t}if(p=kr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Dt=kr(p.nextSibling),d=p.data==="F!";break e}}ti(d)}d=!1}d&&(s=l[0])}}return l=Dn(),l.memoizedState=l.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uw,lastRenderedState:s},l.queue=d,l=Nw.bind(null,We,d),d.dispatch=l,d=Mp(!1),y=Up.bind(null,We,!1,d.queue),d=Dn(),p={state:s,dispatch:null,action:a,pending:null},d.queue=p,l=Jj.bind(null,We,p,y,l),p.dispatch=l,d.memoizedState=a,[s,l,!1]}function fw(a){var s=Vt();return hw(s,vt,a)}function hw(a,s,l){if(s=jp(a,s,uw)[0],a=Vu(Ta)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=Hl(s)}catch(T){throw T===Ll?Uu:T}else d=s;s=Vt();var p=s.queue,y=p.dispatch;return l!==s.memoizedState&&(We.flags|=2048,ro(9,Gu(),ek.bind(null,p,l),null)),[d,y,a]}function ek(a,s){a.action=s}function pw(a){var s=Vt(),l=vt;if(l!==null)return hw(s,l,a);Vt(),s=s.memoizedState,l=Vt();var d=l.queue.dispatch;return l.memoizedState=a,[s,d,!1]}function ro(a,s,l,d){return a={tag:a,create:l,deps:d,inst:s,next:null},s=We.updateQueue,s===null&&(s=Ap(),We.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=a.next=a:(d=l.next,l.next=a,a.next=d,s.lastEffect=a),a}function Gu(){return{destroy:void 0,resource:void 0}}function mw(){return Vt().memoizedState}function Yu(a,s,l,d){var p=Dn();d=d===void 0?null:d,We.flags|=a,p.memoizedState=ro(1|s,Gu(),l,d)}function Fl(a,s,l,d){var p=Vt();d=d===void 0?null:d;var y=p.memoizedState.inst;vt!==null&&d!==null&&_p(d,vt.memoizedState.deps)?p.memoizedState=ro(s,y,l,d):(We.flags|=a,p.memoizedState=ro(1|s,y,l,d))}function gw(a,s){Yu(8390656,8,a,s)}function vw(a,s){Fl(2048,8,a,s)}function yw(a,s){return Fl(4,2,a,s)}function bw(a,s){return Fl(4,4,a,s)}function ww(a,s){if(typeof s=="function"){a=a();var l=s(a);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function xw(a,s,l){l=l!=null?l.concat([a]):null,Fl(4,4,ww.bind(null,s,a),l)}function Pp(){}function Sw(a,s){var l=Vt();s=s===void 0?null:s;var d=l.memoizedState;return s!==null&&_p(s,d[1])?d[0]:(l.memoizedState=[a,s],a)}function Ew(a,s){var l=Vt();s=s===void 0?null:s;var d=l.memoizedState;if(s!==null&&_p(s,d[1]))return d[0];if(d=a(),si){Bn(!0);try{a()}finally{Bn(!1)}}return l.memoizedState=[d,s],d}function Lp(a,s,l){return l===void 0||(rs&1073741824)!==0?a.memoizedState=s:(a.memoizedState=l,a=Cx(),We.lanes|=a,us|=a,l)}function _w(a,s,l,d){return Fn(l,s)?l:eo.current!==null?(a=Lp(a,l,d),Fn(a,s)||(nn=!0),a):(rs&42)===0?(nn=!0,a.memoizedState=l):(a=Cx(),We.lanes|=a,us|=a,s)}function Tw(a,s,l,d,p){var y=W.p;W.p=y!==0&&8>y?y:8;var T=M.T,O={};M.T=O,Up(a,!1,s,l);try{var P=p(),q=M.S;if(q!==null&&q(O,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ae=Zj(P,d);ql(a,s,ae,Wn(a))}else ql(a,s,d,Wn(a))}catch(ue){ql(a,s,{then:function(){},status:"rejected",reason:ue},Wn())}finally{W.p=y,M.T=T}}function tk(){}function Ip(a,s,l,d){if(a.tag!==5)throw Error(r(476));var p=Cw(a).queue;Tw(a,p,s,X,l===null?tk:function(){return Rw(a),l(d)})}function Cw(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:X},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:l},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function Rw(a){var s=Cw(a).next.queue;ql(a,s,{},Wn())}function zp(){return hn(lc)}function Ow(){return Vt().memoizedState}function Aw(){return Vt().memoizedState}function nk(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var l=Wn();a=ts(l);var d=ns(s,a,l);d!==null&&(Kn(d,s,l),zl(d,s,l)),s={cache:pp()},a.payload=s;return}s=s.return}}function rk(a,s,l){var d=Wn();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},Wu(a)?jw(s,l):(l=ap(a,s,l,d),l!==null&&(Kn(l,a,d),kw(l,s,d)))}function Nw(a,s,l){var d=Wn();ql(a,s,l,d)}function ql(a,s,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(Wu(a))jw(s,p);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var T=s.lastRenderedState,O=y(T,l);if(p.hasEagerState=!0,p.eagerState=O,Fn(O,T))return ju(a,s,p,0),St===null&&Nu(),!1}catch{}finally{}if(l=ap(a,s,p,d),l!==null)return Kn(l,a,d),kw(l,s,d),!0}return!1}function Up(a,s,l,d){if(d={lane:2,revertLane:vm(),action:d,hasEagerState:!1,eagerState:null,next:null},Wu(a)){if(s)throw Error(r(479))}else s=ap(a,l,d,2),s!==null&&Kn(s,a,2)}function Wu(a){var s=a.alternate;return a===We||s!==null&&s===We}function jw(a,s){to=Hu=!0;var l=a.pending;l===null?s.next=s:(s.next=l.next,l.next=s),a.pending=s}function kw(a,s,l){if((l&4194048)!==0){var d=s.lanes;d&=a.pendingLanes,l|=d,s.lanes=l,je(a,l)}}var Ku={readContext:hn,use:qu,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut},Mw={readContext:hn,use:qu,useCallback:function(a,s){return Dn().memoizedState=[a,s===void 0?null:s],a},useContext:hn,useEffect:gw,useImperativeHandle:function(a,s,l){l=l!=null?l.concat([a]):null,Yu(4194308,4,ww.bind(null,s,a),l)},useLayoutEffect:function(a,s){return Yu(4194308,4,a,s)},useInsertionEffect:function(a,s){Yu(4,2,a,s)},useMemo:function(a,s){var l=Dn();s=s===void 0?null:s;var d=a();if(si){Bn(!0);try{a()}finally{Bn(!1)}}return l.memoizedState=[d,s],d},useReducer:function(a,s,l){var d=Dn();if(l!==void 0){var p=l(s);if(si){Bn(!0);try{l(s)}finally{Bn(!1)}}}else p=s;return d.memoizedState=d.baseState=p,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:p},d.queue=a,a=a.dispatch=rk.bind(null,We,a),[d.memoizedState,a]},useRef:function(a){var s=Dn();return a={current:a},s.memoizedState=a},useState:function(a){a=Mp(a);var s=a.queue,l=Nw.bind(null,We,s);return s.dispatch=l,[a.memoizedState,l]},useDebugValue:Pp,useDeferredValue:function(a,s){var l=Dn();return Lp(l,a,s)},useTransition:function(){var a=Mp(!1);return a=Tw.bind(null,We,a.queue,!0,!1),Dn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,l){var d=We,p=Dn();if(ut){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),St===null)throw Error(r(349));(at&124)!==0||ew(d,s,l)}p.memoizedState=l;var y={value:l,getSnapshot:s};return p.queue=y,gw(nw.bind(null,d,y,a),[a]),d.flags|=2048,ro(9,Gu(),tw.bind(null,d,y,l,s),null),l},useId:function(){var a=Dn(),s=St.identifierPrefix;if(ut){var l=Sa,d=xa;l=(d&~(1<<32-Yt(d)-1)).toString(32)+l,s="«"+s+"R"+l,l=Fu++,0<l&&(s+="H"+l.toString(32)),s+="»"}else l=Qj++,s="«"+s+"r"+l.toString(32)+"»";return a.memoizedState=s},useHostTransitionStatus:zp,useFormState:dw,useActionState:dw,useOptimistic:function(a){var s=Dn();s.memoizedState=s.baseState=a;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=Up.bind(null,We,!0,l),l.dispatch=s,[a,s]},useMemoCache:Np,useCacheRefresh:function(){return Dn().memoizedState=nk.bind(null,We)}},Dw={readContext:hn,use:qu,useCallback:Sw,useContext:hn,useEffect:vw,useImperativeHandle:xw,useInsertionEffect:yw,useLayoutEffect:bw,useMemo:Ew,useReducer:Vu,useRef:mw,useState:function(){return Vu(Ta)},useDebugValue:Pp,useDeferredValue:function(a,s){var l=Vt();return _w(l,vt.memoizedState,a,s)},useTransition:function(){var a=Vu(Ta)[0],s=Vt().memoizedState;return[typeof a=="boolean"?a:Hl(a),s]},useSyncExternalStore:Jb,useId:Ow,useHostTransitionStatus:zp,useFormState:fw,useActionState:fw,useOptimistic:function(a,s){var l=Vt();return sw(l,vt,a,s)},useMemoCache:Np,useCacheRefresh:Aw},ak={readContext:hn,use:qu,useCallback:Sw,useContext:hn,useEffect:vw,useImperativeHandle:xw,useInsertionEffect:yw,useLayoutEffect:bw,useMemo:Ew,useReducer:kp,useRef:mw,useState:function(){return kp(Ta)},useDebugValue:Pp,useDeferredValue:function(a,s){var l=Vt();return vt===null?Lp(l,a,s):_w(l,vt.memoizedState,a,s)},useTransition:function(){var a=kp(Ta)[0],s=Vt().memoizedState;return[typeof a=="boolean"?a:Hl(a),s]},useSyncExternalStore:Jb,useId:Ow,useHostTransitionStatus:zp,useFormState:pw,useActionState:pw,useOptimistic:function(a,s){var l=Vt();return vt!==null?sw(l,vt,a,s):(l.baseState=a,[a,l.queue.dispatch])},useMemoCache:Np,useCacheRefresh:Aw},ao=null,Vl=0;function Zu(a){var s=Vl;return Vl+=1,ao===null&&(ao=[]),Vb(ao,a,s)}function Gl(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Qu(a,s){throw s.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function Pw(a){var s=a._init;return s(a._payload)}function Lw(a){function s($,z){if(a){var F=$.deletions;F===null?($.deletions=[z],$.flags|=16):F.push(z)}}function l($,z){if(!a)return null;for(;z!==null;)s($,z),z=z.sibling;return null}function d($){for(var z=new Map;$!==null;)$.key!==null?z.set($.key,$):z.set($.index,$),$=$.sibling;return z}function p($,z){return $=wa($,z),$.index=0,$.sibling=null,$}function y($,z,F){return $.index=F,a?(F=$.alternate,F!==null?(F=F.index,F<z?($.flags|=67108866,z):F):($.flags|=67108866,z)):($.flags|=1048576,z)}function T($){return a&&$.alternate===null&&($.flags|=67108866),$}function O($,z,F,oe){return z===null||z.tag!==6?(z=ip(F,$.mode,oe),z.return=$,z):(z=p(z,F),z.return=$,z)}function P($,z,F,oe){var _e=F.type;return _e===S?ae($,z,F.props.children,oe,F.key):z!==null&&(z.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===Z&&Pw(_e)===z.type)?(z=p(z,F.props),Gl(z,F),z.return=$,z):(z=Mu(F.type,F.key,F.props,null,$.mode,oe),Gl(z,F),z.return=$,z)}function q($,z,F,oe){return z===null||z.tag!==4||z.stateNode.containerInfo!==F.containerInfo||z.stateNode.implementation!==F.implementation?(z=op(F,$.mode,oe),z.return=$,z):(z=p(z,F.children||[]),z.return=$,z)}function ae($,z,F,oe,_e){return z===null||z.tag!==7?(z=Qs(F,$.mode,oe,_e),z.return=$,z):(z=p(z,F),z.return=$,z)}function ue($,z,F){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=ip(""+z,$.mode,F),z.return=$,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case x:return F=Mu(z.type,z.key,z.props,null,$.mode,F),Gl(F,z),F.return=$,F;case w:return z=op(z,$.mode,F),z.return=$,z;case Z:var oe=z._init;return z=oe(z._payload),ue($,z,F)}if(ve(z)||se(z))return z=Qs(z,$.mode,F,null),z.return=$,z;if(typeof z.then=="function")return ue($,Zu(z),F);if(z.$$typeof===A)return ue($,Iu($,z),F);Qu($,z)}return null}function K($,z,F,oe){var _e=z!==null?z.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return _e!==null?null:O($,z,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case x:return F.key===_e?P($,z,F,oe):null;case w:return F.key===_e?q($,z,F,oe):null;case Z:return _e=F._init,F=_e(F._payload),K($,z,F,oe)}if(ve(F)||se(F))return _e!==null?null:ae($,z,F,oe,null);if(typeof F.then=="function")return K($,z,Zu(F),oe);if(F.$$typeof===A)return K($,z,Iu($,F),oe);Qu($,F)}return null}function J($,z,F,oe,_e){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return $=$.get(F)||null,O(z,$,""+oe,_e);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return $=$.get(oe.key===null?F:oe.key)||null,P(z,$,oe,_e);case w:return $=$.get(oe.key===null?F:oe.key)||null,q(z,$,oe,_e);case Z:var Qe=oe._init;return oe=Qe(oe._payload),J($,z,F,oe,_e)}if(ve(oe)||se(oe))return $=$.get(F)||null,ae(z,$,oe,_e,null);if(typeof oe.then=="function")return J($,z,F,Zu(oe),_e);if(oe.$$typeof===A)return J($,z,F,Iu(z,oe),_e);Qu(z,oe)}return null}function Ie($,z,F,oe){for(var _e=null,Qe=null,Re=z,De=z=0,an=null;Re!==null&&De<F.length;De++){Re.index>De?(an=Re,Re=null):an=Re.sibling;var ct=K($,Re,F[De],oe);if(ct===null){Re===null&&(Re=an);break}a&&Re&&ct.alternate===null&&s($,Re),z=y(ct,z,De),Qe===null?_e=ct:Qe.sibling=ct,Qe=ct,Re=an}if(De===F.length)return l($,Re),ut&&Js($,De),_e;if(Re===null){for(;De<F.length;De++)Re=ue($,F[De],oe),Re!==null&&(z=y(Re,z,De),Qe===null?_e=Re:Qe.sibling=Re,Qe=Re);return ut&&Js($,De),_e}for(Re=d(Re);De<F.length;De++)an=J(Re,$,De,F[De],oe),an!==null&&(a&&an.alternate!==null&&Re.delete(an.key===null?De:an.key),z=y(an,z,De),Qe===null?_e=an:Qe.sibling=an,Qe=an);return a&&Re.forEach(function(bs){return s($,bs)}),ut&&Js($,De),_e}function Me($,z,F,oe){if(F==null)throw Error(r(151));for(var _e=null,Qe=null,Re=z,De=z=0,an=null,ct=F.next();Re!==null&&!ct.done;De++,ct=F.next()){Re.index>De?(an=Re,Re=null):an=Re.sibling;var bs=K($,Re,ct.value,oe);if(bs===null){Re===null&&(Re=an);break}a&&Re&&bs.alternate===null&&s($,Re),z=y(bs,z,De),Qe===null?_e=bs:Qe.sibling=bs,Qe=bs,Re=an}if(ct.done)return l($,Re),ut&&Js($,De),_e;if(Re===null){for(;!ct.done;De++,ct=F.next())ct=ue($,ct.value,oe),ct!==null&&(z=y(ct,z,De),Qe===null?_e=ct:Qe.sibling=ct,Qe=ct);return ut&&Js($,De),_e}for(Re=d(Re);!ct.done;De++,ct=F.next())ct=J(Re,$,De,ct.value,oe),ct!==null&&(a&&ct.alternate!==null&&Re.delete(ct.key===null?De:ct.key),z=y(ct,z,De),Qe===null?_e=ct:Qe.sibling=ct,Qe=ct);return a&&Re.forEach(function(sM){return s($,sM)}),ut&&Js($,De),_e}function bt($,z,F,oe){if(typeof F=="object"&&F!==null&&F.type===S&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case x:e:{for(var _e=F.key;z!==null;){if(z.key===_e){if(_e=F.type,_e===S){if(z.tag===7){l($,z.sibling),oe=p(z,F.props.children),oe.return=$,$=oe;break e}}else if(z.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===Z&&Pw(_e)===z.type){l($,z.sibling),oe=p(z,F.props),Gl(oe,F),oe.return=$,$=oe;break e}l($,z);break}else s($,z);z=z.sibling}F.type===S?(oe=Qs(F.props.children,$.mode,oe,F.key),oe.return=$,$=oe):(oe=Mu(F.type,F.key,F.props,null,$.mode,oe),Gl(oe,F),oe.return=$,$=oe)}return T($);case w:e:{for(_e=F.key;z!==null;){if(z.key===_e)if(z.tag===4&&z.stateNode.containerInfo===F.containerInfo&&z.stateNode.implementation===F.implementation){l($,z.sibling),oe=p(z,F.children||[]),oe.return=$,$=oe;break e}else{l($,z);break}else s($,z);z=z.sibling}oe=op(F,$.mode,oe),oe.return=$,$=oe}return T($);case Z:return _e=F._init,F=_e(F._payload),bt($,z,F,oe)}if(ve(F))return Ie($,z,F,oe);if(se(F)){if(_e=se(F),typeof _e!="function")throw Error(r(150));return F=_e.call(F),Me($,z,F,oe)}if(typeof F.then=="function")return bt($,z,Zu(F),oe);if(F.$$typeof===A)return bt($,z,Iu($,F),oe);Qu($,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,z!==null&&z.tag===6?(l($,z.sibling),oe=p(z,F),oe.return=$,$=oe):(l($,z),oe=ip(F,$.mode,oe),oe.return=$,$=oe),T($)):l($,z)}return function($,z,F,oe){try{Vl=0;var _e=bt($,z,F,oe);return ao=null,_e}catch(Re){if(Re===Ll||Re===Uu)throw Re;var Qe=qn(29,Re,null,$.mode);return Qe.lanes=oe,Qe.return=$,Qe}finally{}}}var so=Lw(!0),Iw=Lw(!1),mr=V(null),Jr=null;function as(a){var s=a.alternate;U(Kt,Kt.current&1),U(mr,a),Jr===null&&(s===null||eo.current!==null||s.memoizedState!==null)&&(Jr=a)}function zw(a){if(a.tag===22){if(U(Kt,Kt.current),U(mr,a),Jr===null){var s=a.alternate;s!==null&&s.memoizedState!==null&&(Jr=a)}}else ss()}function ss(){U(Kt,Kt.current),U(mr,mr.current)}function Ca(a){re(mr),Jr===a&&(Jr=null),re(Kt)}var Kt=V(0);function Xu(a){for(var s=a;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||Am(l)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function $p(a,s,l,d){s=a.memoizedState,l=l(d,s),l=l==null?s:m({},s,l),a.memoizedState=l,a.lanes===0&&(a.updateQueue.baseState=l)}var Bp={enqueueSetState:function(a,s,l){a=a._reactInternals;var d=Wn(),p=ts(d);p.payload=s,l!=null&&(p.callback=l),s=ns(a,p,d),s!==null&&(Kn(s,a,d),zl(s,a,d))},enqueueReplaceState:function(a,s,l){a=a._reactInternals;var d=Wn(),p=ts(d);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=ns(a,p,d),s!==null&&(Kn(s,a,d),zl(s,a,d))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var l=Wn(),d=ts(l);d.tag=2,s!=null&&(d.callback=s),s=ns(a,d,l),s!==null&&(Kn(s,a,l),zl(s,a,l))}};function Uw(a,s,l,d,p,y,T){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(d,y,T):s.prototype&&s.prototype.isPureReactComponent?!Ol(l,d)||!Ol(p,y):!0}function $w(a,s,l,d){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,d),s.state!==a&&Bp.enqueueReplaceState(s,s.state,null)}function ii(a,s){var l=s;if("ref"in s){l={};for(var d in s)d!=="ref"&&(l[d]=s[d])}if(a=a.defaultProps){l===s&&(l=m({},l));for(var p in a)l[p]===void 0&&(l[p]=a[p])}return l}var Ju=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function Bw(a){Ju(a)}function Hw(a){console.error(a)}function Fw(a){Ju(a)}function ed(a,s){try{var l=a.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function qw(a,s,l){try{var d=a.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Hp(a,s,l){return l=ts(l),l.tag=3,l.payload={element:null},l.callback=function(){ed(a,s)},l}function Vw(a){return a=ts(a),a.tag=3,a}function Gw(a,s,l,d){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;a.payload=function(){return p(y)},a.callback=function(){qw(s,l,d)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(a.callback=function(){qw(s,l,d),typeof p!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var O=d.stack;this.componentDidCatch(d.value,{componentStack:O!==null?O:""})})}function sk(a,s,l,d,p){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=l.alternate,s!==null&&Ml(s,l,p,!0),l=mr.current,l!==null){switch(l.tag){case 13:return Jr===null?fm():l.alternate===null&&Pt===0&&(Pt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,d===vp?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([d]):s.add(d),pm(a,d,p)),!1;case 22:return l.flags|=65536,d===vp?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([d]):l.add(d)),pm(a,d,p)),!1}throw Error(r(435,l.tag))}return pm(a,d,p),fm(),!1}if(ut)return s=mr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,d!==up&&(a=Error(r(422),{cause:d}),kl(dr(a,l)))):(d!==up&&(s=Error(r(423),{cause:d}),kl(dr(s,l))),a=a.current.alternate,a.flags|=65536,p&=-p,a.lanes|=p,d=dr(d,l),p=Hp(a.stateNode,d,p),wp(a,p),Pt!==4&&(Pt=2)),!1;var y=Error(r(520),{cause:d});if(y=dr(y,l),Jl===null?Jl=[y]:Jl.push(y),Pt!==4&&(Pt=2),s===null)return!0;d=dr(d,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,a=p&-p,l.lanes|=a,a=Hp(l.stateNode,d,a),wp(l,a),!1;case 1:if(s=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ds===null||!ds.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=Vw(p),Gw(p,a,l,d),wp(l,p),!1}l=l.return}while(l!==null);return!1}var Yw=Error(r(461)),nn=!1;function on(a,s,l,d){s.child=a===null?Iw(s,null,l,d):so(s,a.child,l,d)}function Ww(a,s,l,d,p){l=l.render;var y=s.ref;if("ref"in d){var T={};for(var O in d)O!=="ref"&&(T[O]=d[O])}else T=d;return ri(s),d=Tp(a,s,l,T,y,p),O=Cp(),a!==null&&!nn?(Rp(a,s,p),Ra(a,s,p)):(ut&&O&&lp(s),s.flags|=1,on(a,s,d,p),s.child)}function Kw(a,s,l,d,p){if(a===null){var y=l.type;return typeof y=="function"&&!sp(y)&&y.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=y,Zw(a,s,y,d,p)):(a=Mu(l.type,null,d,s,s.mode,p),a.ref=s.ref,a.return=s,s.child=a)}if(y=a.child,!Zp(a,p)){var T=y.memoizedProps;if(l=l.compare,l=l!==null?l:Ol,l(T,d)&&a.ref===s.ref)return Ra(a,s,p)}return s.flags|=1,a=wa(y,d),a.ref=s.ref,a.return=s,s.child=a}function Zw(a,s,l,d,p){if(a!==null){var y=a.memoizedProps;if(Ol(y,d)&&a.ref===s.ref)if(nn=!1,s.pendingProps=d=y,Zp(a,p))(a.flags&131072)!==0&&(nn=!0);else return s.lanes=a.lanes,Ra(a,s,p)}return Fp(a,s,l,d,p)}function Qw(a,s,l){var d=s.pendingProps,p=d.children,y=a!==null?a.memoizedState:null;if(d.mode==="hidden"){if((s.flags&128)!==0){if(d=y!==null?y.baseLanes|l:l,a!==null){for(p=s.child=a.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;s.childLanes=y&~d}else s.childLanes=0,s.child=null;return Xw(a,s,d,l)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&zu(s,y!==null?y.cachePool:null),y!==null?Zb(s,y):Sp(),zw(s);else return s.lanes=s.childLanes=536870912,Xw(a,s,y!==null?y.baseLanes|l:l,l)}else y!==null?(zu(s,y.cachePool),Zb(s,y),ss(),s.memoizedState=null):(a!==null&&zu(s,null),Sp(),ss());return on(a,s,p,l),s.child}function Xw(a,s,l,d){var p=gp();return p=p===null?null:{parent:Wt._currentValue,pool:p},s.memoizedState={baseLanes:l,cachePool:p},a!==null&&zu(s,null),Sp(),zw(s),a!==null&&Ml(a,s,d,!0),null}function td(a,s){var l=s.ref;if(l===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(a===null||a.ref!==l)&&(s.flags|=4194816)}}function Fp(a,s,l,d,p){return ri(s),l=Tp(a,s,l,d,void 0,p),d=Cp(),a!==null&&!nn?(Rp(a,s,p),Ra(a,s,p)):(ut&&d&&lp(s),s.flags|=1,on(a,s,l,p),s.child)}function Jw(a,s,l,d,p,y){return ri(s),s.updateQueue=null,l=Xb(s,d,l,p),Qb(a),d=Cp(),a!==null&&!nn?(Rp(a,s,y),Ra(a,s,y)):(ut&&d&&lp(s),s.flags|=1,on(a,s,l,y),s.child)}function ex(a,s,l,d,p){if(ri(s),s.stateNode===null){var y=Ki,T=l.contextType;typeof T=="object"&&T!==null&&(y=hn(T)),y=new l(d,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Bp,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=d,y.state=s.memoizedState,y.refs={},yp(s),T=l.contextType,y.context=typeof T=="object"&&T!==null?hn(T):Ki,y.state=s.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&($p(s,l,T,d),y.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(T=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),T!==y.state&&Bp.enqueueReplaceState(y,y.state,null),$l(s,d,y,p),Ul(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(a===null){y=s.stateNode;var O=s.memoizedProps,P=ii(l,O);y.props=P;var q=y.context,ae=l.contextType;T=Ki,typeof ae=="object"&&ae!==null&&(T=hn(ae));var ue=l.getDerivedStateFromProps;ae=typeof ue=="function"||typeof y.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,ae||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(O||q!==T)&&$w(s,y,d,T),es=!1;var K=s.memoizedState;y.state=K,$l(s,d,y,p),Ul(),q=s.memoizedState,O||K!==q||es?(typeof ue=="function"&&($p(s,l,ue,d),q=s.memoizedState),(P=es||Uw(s,l,P,d,K,q,T))?(ae||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=q),y.props=d,y.state=q,y.context=T,d=P):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{y=s.stateNode,bp(a,s),T=s.memoizedProps,ae=ii(l,T),y.props=ae,ue=s.pendingProps,K=y.context,q=l.contextType,P=Ki,typeof q=="object"&&q!==null&&(P=hn(q)),O=l.getDerivedStateFromProps,(q=typeof O=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T!==ue||K!==P)&&$w(s,y,d,P),es=!1,K=s.memoizedState,y.state=K,$l(s,d,y,p),Ul();var J=s.memoizedState;T!==ue||K!==J||es||a!==null&&a.dependencies!==null&&Lu(a.dependencies)?(typeof O=="function"&&($p(s,l,O,d),J=s.memoizedState),(ae=es||Uw(s,l,ae,d,K,J,P)||a!==null&&a.dependencies!==null&&Lu(a.dependencies))?(q||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,J,P),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,J,P)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||T===a.memoizedProps&&K===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&K===a.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=J),y.props=d,y.state=J,y.context=P,d=ae):(typeof y.componentDidUpdate!="function"||T===a.memoizedProps&&K===a.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&K===a.memoizedState||(s.flags|=1024),d=!1)}return y=d,td(a,s),d=(s.flags&128)!==0,y||d?(y=s.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,a!==null&&d?(s.child=so(s,a.child,null,p),s.child=so(s,null,l,p)):on(a,s,l,p),s.memoizedState=y.state,a=s.child):a=Ra(a,s,p),a}function tx(a,s,l,d){return jl(),s.flags|=256,on(a,s,l,d),s.child}var qp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vp(a){return{baseLanes:a,cachePool:Hb()}}function Gp(a,s,l){return a=a!==null?a.childLanes&~l:0,s&&(a|=gr),a}function nx(a,s,l){var d=s.pendingProps,p=!1,y=(s.flags&128)!==0,T;if((T=y)||(T=a!==null&&a.memoizedState===null?!1:(Kt.current&2)!==0),T&&(p=!0,s.flags&=-129),T=(s.flags&32)!==0,s.flags&=-33,a===null){if(ut){if(p?as(s):ss(),ut){var O=Dt,P;if(P=O){e:{for(P=O,O=Xr;P.nodeType!==8;){if(!O){O=null;break e}if(P=kr(P.nextSibling),P===null){O=null;break e}}O=P}O!==null?(s.memoizedState={dehydrated:O,treeContext:Xs!==null?{id:xa,overflow:Sa}:null,retryLane:536870912,hydrationErrors:null},P=qn(18,null,null,0),P.stateNode=O,P.return=s,s.child=P,En=s,Dt=null,P=!0):P=!1}P||ti(s)}if(O=s.memoizedState,O!==null&&(O=O.dehydrated,O!==null))return Am(O)?s.lanes=32:s.lanes=536870912,null;Ca(s)}return O=d.children,d=d.fallback,p?(ss(),p=s.mode,O=nd({mode:"hidden",children:O},p),d=Qs(d,p,l,null),O.return=s,d.return=s,O.sibling=d,s.child=O,p=s.child,p.memoizedState=Vp(l),p.childLanes=Gp(a,T,l),s.memoizedState=qp,d):(as(s),Yp(s,O))}if(P=a.memoizedState,P!==null&&(O=P.dehydrated,O!==null)){if(y)s.flags&256?(as(s),s.flags&=-257,s=Wp(a,s,l)):s.memoizedState!==null?(ss(),s.child=a.child,s.flags|=128,s=null):(ss(),p=d.fallback,O=s.mode,d=nd({mode:"visible",children:d.children},O),p=Qs(p,O,l,null),p.flags|=2,d.return=s,p.return=s,d.sibling=p,s.child=d,so(s,a.child,null,l),d=s.child,d.memoizedState=Vp(l),d.childLanes=Gp(a,T,l),s.memoizedState=qp,s=p);else if(as(s),Am(O)){if(T=O.nextSibling&&O.nextSibling.dataset,T)var q=T.dgst;T=q,d=Error(r(419)),d.stack="",d.digest=T,kl({value:d,source:null,stack:null}),s=Wp(a,s,l)}else if(nn||Ml(a,s,l,!1),T=(l&a.childLanes)!==0,nn||T){if(T=St,T!==null&&(d=l&-l,d=(d&42)!==0?1:rt(d),d=(d&(T.suspendedLanes|l))!==0?0:d,d!==0&&d!==P.retryLane))throw P.retryLane=d,Wi(a,d),Kn(T,a,d),Yw;O.data==="$?"||fm(),s=Wp(a,s,l)}else O.data==="$?"?(s.flags|=192,s.child=a.child,s=null):(a=P.treeContext,Dt=kr(O.nextSibling),En=s,ut=!0,ei=null,Xr=!1,a!==null&&(hr[pr++]=xa,hr[pr++]=Sa,hr[pr++]=Xs,xa=a.id,Sa=a.overflow,Xs=s),s=Yp(s,d.children),s.flags|=4096);return s}return p?(ss(),p=d.fallback,O=s.mode,P=a.child,q=P.sibling,d=wa(P,{mode:"hidden",children:d.children}),d.subtreeFlags=P.subtreeFlags&65011712,q!==null?p=wa(q,p):(p=Qs(p,O,l,null),p.flags|=2),p.return=s,d.return=s,d.sibling=p,s.child=d,d=p,p=s.child,O=a.child.memoizedState,O===null?O=Vp(l):(P=O.cachePool,P!==null?(q=Wt._currentValue,P=P.parent!==q?{parent:q,pool:q}:P):P=Hb(),O={baseLanes:O.baseLanes|l,cachePool:P}),p.memoizedState=O,p.childLanes=Gp(a,T,l),s.memoizedState=qp,d):(as(s),l=a.child,a=l.sibling,l=wa(l,{mode:"visible",children:d.children}),l.return=s,l.sibling=null,a!==null&&(T=s.deletions,T===null?(s.deletions=[a],s.flags|=16):T.push(a)),s.child=l,s.memoizedState=null,l)}function Yp(a,s){return s=nd({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function nd(a,s){return a=qn(22,a,null,s),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function Wp(a,s,l){return so(s,a.child,null,l),a=Yp(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function rx(a,s,l){a.lanes|=s;var d=a.alternate;d!==null&&(d.lanes|=s),fp(a.return,s,l)}function Kp(a,s,l,d,p){var y=a.memoizedState;y===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(y.isBackwards=s,y.rendering=null,y.renderingStartTime=0,y.last=d,y.tail=l,y.tailMode=p)}function ax(a,s,l){var d=s.pendingProps,p=d.revealOrder,y=d.tail;if(on(a,s,d.children,l),d=Kt.current,(d&2)!==0)d=d&1|2,s.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&rx(a,l,s);else if(a.tag===19)rx(a,l,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}d&=1}switch(U(Kt,d),p){case"forwards":for(l=s.child,p=null;l!==null;)a=l.alternate,a!==null&&Xu(a)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),Kp(s,!1,p,l,y);break;case"backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(a=p.alternate,a!==null&&Xu(a)===null){s.child=p;break}a=p.sibling,p.sibling=l,l=p,p=a}Kp(s,!0,l,null,y);break;case"together":Kp(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ra(a,s,l){if(a!==null&&(s.dependencies=a.dependencies),us|=s.lanes,(l&s.childLanes)===0)if(a!==null){if(Ml(a,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,l=wa(a,a.pendingProps),s.child=l,l.return=s;a.sibling!==null;)a=a.sibling,l=l.sibling=wa(a,a.pendingProps),l.return=s;l.sibling=null}return s.child}function Zp(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Lu(a)))}function ik(a,s,l){switch(s.tag){case 3:me(s,s.stateNode.containerInfo),Ja(s,Wt,a.memoizedState.cache),jl();break;case 27:case 5:xe(s);break;case 4:me(s,s.stateNode.containerInfo);break;case 10:Ja(s,s.type,s.memoizedProps.value);break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(as(s),s.flags|=128,null):(l&s.child.childLanes)!==0?nx(a,s,l):(as(s),a=Ra(a,s,l),a!==null?a.sibling:null);as(s);break;case 19:var p=(a.flags&128)!==0;if(d=(l&s.childLanes)!==0,d||(Ml(a,s,l,!1),d=(l&s.childLanes)!==0),p){if(d)return ax(a,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),U(Kt,Kt.current),d)break;return null;case 22:case 23:return s.lanes=0,Qw(a,s,l);case 24:Ja(s,Wt,a.memoizedState.cache)}return Ra(a,s,l)}function sx(a,s,l){if(a!==null)if(a.memoizedProps!==s.pendingProps)nn=!0;else{if(!Zp(a,l)&&(s.flags&128)===0)return nn=!1,ik(a,s,l);nn=(a.flags&131072)!==0}else nn=!1,ut&&(s.flags&1048576)!==0&&Pb(s,Pu,s.index);switch(s.lanes=0,s.tag){case 16:e:{a=s.pendingProps;var d=s.elementType,p=d._init;if(d=p(d._payload),s.type=d,typeof d=="function")sp(d)?(a=ii(d,a),s.tag=1,s=ex(null,s,d,a,l)):(s.tag=0,s=Fp(null,s,d,a,l));else{if(d!=null){if(p=d.$$typeof,p===k){s.tag=11,s=Ww(null,s,d,a,l);break e}else if(p===L){s.tag=14,s=Kw(null,s,d,a,l);break e}}throw s=pe(d)||d,Error(r(306,s,""))}}return s;case 0:return Fp(a,s,s.type,s.pendingProps,l);case 1:return d=s.type,p=ii(d,s.pendingProps),ex(a,s,d,p,l);case 3:e:{if(me(s,s.stateNode.containerInfo),a===null)throw Error(r(387));d=s.pendingProps;var y=s.memoizedState;p=y.element,bp(a,s),$l(s,d,null,l);var T=s.memoizedState;if(d=T.cache,Ja(s,Wt,d),d!==y.cache&&hp(s,[Wt],l,!0),Ul(),d=T.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:T.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=tx(a,s,d,l);break e}else if(d!==p){p=dr(Error(r(424)),s),kl(p),s=tx(a,s,d,l);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Dt=kr(a.firstChild),En=s,ut=!0,ei=null,Xr=!0,l=Iw(s,null,d,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(jl(),d===p){s=Ra(a,s,l);break e}on(a,s,d,l)}s=s.child}return s;case 26:return td(a,s),a===null?(l=cS(s.type,null,s.pendingProps,null))?s.memoizedState=l:ut||(l=s.type,a=s.pendingProps,d=gd(ie.current).createElement(l),d[le]=s,d[he]=a,cn(d,l,a),lt(d),s.stateNode=d):s.memoizedState=cS(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return xe(s),a===null&&ut&&(d=s.stateNode=iS(s.type,s.pendingProps,ie.current),En=s,Xr=!0,p=Dt,ps(s.type)?(Nm=p,Dt=kr(d.firstChild)):Dt=p),on(a,s,s.pendingProps.children,l),td(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&ut&&((p=d=Dt)&&(d=Dk(d,s.type,s.pendingProps,Xr),d!==null?(s.stateNode=d,En=s,Dt=kr(d.firstChild),Xr=!1,p=!0):p=!1),p||ti(s)),xe(s),p=s.type,y=s.pendingProps,T=a!==null?a.memoizedProps:null,d=y.children,Cm(p,y)?d=null:T!==null&&Cm(p,T)&&(s.flags|=32),s.memoizedState!==null&&(p=Tp(a,s,Xj,null,null,l),lc._currentValue=p),td(a,s),on(a,s,d,l),s.child;case 6:return a===null&&ut&&((a=l=Dt)&&(l=Pk(l,s.pendingProps,Xr),l!==null?(s.stateNode=l,En=s,Dt=null,a=!0):a=!1),a||ti(s)),null;case 13:return nx(a,s,l);case 4:return me(s,s.stateNode.containerInfo),d=s.pendingProps,a===null?s.child=so(s,null,d,l):on(a,s,d,l),s.child;case 11:return Ww(a,s,s.type,s.pendingProps,l);case 7:return on(a,s,s.pendingProps,l),s.child;case 8:return on(a,s,s.pendingProps.children,l),s.child;case 12:return on(a,s,s.pendingProps.children,l),s.child;case 10:return d=s.pendingProps,Ja(s,s.type,d.value),on(a,s,d.children,l),s.child;case 9:return p=s.type._context,d=s.pendingProps.children,ri(s),p=hn(p),d=d(p),s.flags|=1,on(a,s,d,l),s.child;case 14:return Kw(a,s,s.type,s.pendingProps,l);case 15:return Zw(a,s,s.type,s.pendingProps,l);case 19:return ax(a,s,l);case 31:return d=s.pendingProps,l=s.mode,d={mode:d.mode,children:d.children},a===null?(l=nd(d,l),l.ref=s.ref,s.child=l,l.return=s,s=l):(l=wa(a.child,d),l.ref=s.ref,s.child=l,l.return=s,s=l),s;case 22:return Qw(a,s,l);case 24:return ri(s),d=hn(Wt),a===null?(p=gp(),p===null&&(p=St,y=pp(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),s.memoizedState={parent:d,cache:p},yp(s),Ja(s,Wt,p)):((a.lanes&l)!==0&&(bp(a,s),$l(s,null,null,l),Ul()),p=a.memoizedState,y=s.memoizedState,p.parent!==d?(p={parent:d,cache:d},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Ja(s,Wt,d)):(d=y.cache,Ja(s,Wt,d),d!==p.cache&&hp(s,[Wt],l,!0))),on(a,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Oa(a){a.flags|=4}function ix(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!pS(s)){if(s=mr.current,s!==null&&((at&4194048)===at?Jr!==null:(at&62914560)!==at&&(at&536870912)===0||s!==Jr))throw Il=vp,Fb;a.flags|=8192}}function rd(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?Gs():536870912,a.lanes|=s,co|=s)}function Yl(a,s){if(!ut)switch(a.tailMode){case"hidden":s=a.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?a.tail=null:l.sibling=null;break;case"collapsed":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:d.sibling=null}}function kt(a){var s=a.alternate!==null&&a.alternate.child===a.child,l=0,d=0;if(s)for(var p=a.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=a,p=p.sibling;else for(p=a.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=a,p=p.sibling;return a.subtreeFlags|=d,a.childLanes=l,s}function ok(a,s,l){var d=s.pendingProps;switch(cp(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(s),null;case 1:return kt(s),null;case 3:return l=s.stateNode,d=null,a!==null&&(d=a.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),_a(Wt),Ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(a===null||a.child===null)&&(Nl(s)?Oa(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,zb())),kt(s),null;case 26:return l=s.memoizedState,a===null?(Oa(s),l!==null?(kt(s),ix(s,l)):(kt(s),s.flags&=-16777217)):l?l!==a.memoizedState?(Oa(s),kt(s),ix(s,l)):(kt(s),s.flags&=-16777217):(a.memoizedProps!==d&&Oa(s),kt(s),s.flags&=-16777217),null;case 27:Ne(s),l=ie.current;var p=s.type;if(a!==null&&s.stateNode!=null)a.memoizedProps!==d&&Oa(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return kt(s),null}a=ee.current,Nl(s)?Lb(s):(a=iS(p,d,l),s.stateNode=a,Oa(s))}return kt(s),null;case 5:if(Ne(s),l=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==d&&Oa(s);else{if(!d){if(s.stateNode===null)throw Error(r(166));return kt(s),null}if(a=ee.current,Nl(s))Lb(s);else{switch(p=gd(ie.current),a){case 1:a=p.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:a=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":a=p.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":a=p.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":a=p.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?a.multiple=!0:d.size&&(a.size=d.size);break;default:a=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}a[le]=s,a[he]=d;e:for(p=s.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===s)break e;for(;p.sibling===null;){if(p.return===null||p.return===s)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}s.stateNode=a;e:switch(cn(a,l,d),l){case"button":case"input":case"select":case"textarea":a=!!d.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Oa(s)}}return kt(s),s.flags&=-16777217,null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==d&&Oa(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(r(166));if(a=ie.current,Nl(s)){if(a=s.stateNode,l=s.memoizedProps,d=null,p=En,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}a[le]=s,a=!!(a.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||Jx(a.nodeValue,l)),a||ti(s)}else a=gd(a).createTextNode(d),a[le]=s,s.stateNode=a}return kt(s),null;case 13:if(d=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=Nl(s),d!==null&&d.dehydrated!==null){if(a===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[le]=s}else jl(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),p=!1}else p=zb(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Ca(s),s):(Ca(s),null)}if(Ca(s),(s.flags&128)!==0)return s.lanes=l,s;if(l=d!==null,a=a!==null&&a.memoizedState!==null,l){d=s.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var y=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)}return l!==a&&l&&(s.child.flags|=8192),rd(s,s.updateQueue),kt(s),null;case 4:return Ce(),a===null&&xm(s.stateNode.containerInfo),kt(s),null;case 10:return _a(s.type),kt(s),null;case 19:if(re(Kt),p=s.memoizedState,p===null)return kt(s),null;if(d=(s.flags&128)!==0,y=p.rendering,y===null)if(d)Yl(p,!1);else{if(Pt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(y=Xu(a),y!==null){for(s.flags|=128,Yl(p,!1),a=y.updateQueue,s.updateQueue=a,rd(s,a),s.subtreeFlags=0,a=l,l=s.child;l!==null;)Db(l,a),l=l.sibling;return U(Kt,Kt.current&1|2),s.child}a=a.sibling}p.tail!==null&&Nt()>id&&(s.flags|=128,d=!0,Yl(p,!1),s.lanes=4194304)}else{if(!d)if(a=Xu(y),a!==null){if(s.flags|=128,d=!0,a=a.updateQueue,s.updateQueue=a,rd(s,a),Yl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!ut)return kt(s),null}else 2*Nt()-p.renderingStartTime>id&&l!==536870912&&(s.flags|=128,d=!0,Yl(p,!1),s.lanes=4194304);p.isBackwards?(y.sibling=s.child,s.child=y):(a=p.last,a!==null?a.sibling=y:s.child=y,p.last=y)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=Nt(),s.sibling=null,a=Kt.current,U(Kt,d?a&1|2:a&1),s):(kt(s),null);case 22:case 23:return Ca(s),Ep(),d=s.memoizedState!==null,a!==null?a.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(l&536870912)!==0&&(s.flags&128)===0&&(kt(s),s.subtreeFlags&6&&(s.flags|=8192)):kt(s),l=s.updateQueue,l!==null&&rd(s,l.retryQueue),l=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==l&&(s.flags|=2048),a!==null&&re(ai),null;case 24:return l=null,a!==null&&(l=a.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),_a(Wt),kt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function lk(a,s){switch(cp(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return _a(Wt),Ce(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Ne(s),null;case 13:if(Ca(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));jl()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return re(Kt),null;case 4:return Ce(),null;case 10:return _a(s.type),null;case 22:case 23:return Ca(s),Ep(),a!==null&&re(ai),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return _a(Wt),null;case 25:return null;default:return null}}function ox(a,s){switch(cp(s),s.tag){case 3:_a(Wt),Ce();break;case 26:case 27:case 5:Ne(s);break;case 4:Ce();break;case 13:Ca(s);break;case 19:re(Kt);break;case 10:_a(s.type);break;case 22:case 23:Ca(s),Ep(),a!==null&&re(ai);break;case 24:_a(Wt)}}function Wl(a,s){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&a)===a){d=void 0;var y=l.create,T=l.inst;d=y(),T.destroy=d}l=l.next}while(l!==p)}}catch(O){xt(s,s.return,O)}}function is(a,s,l){try{var d=s.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&a)===a){var T=d.inst,O=T.destroy;if(O!==void 0){T.destroy=void 0,p=s;var P=l,q=O;try{q()}catch(ae){xt(p,P,ae)}}}d=d.next}while(d!==y)}}catch(ae){xt(s,s.return,ae)}}function lx(a){var s=a.updateQueue;if(s!==null){var l=a.stateNode;try{Kb(s,l)}catch(d){xt(a,a.return,d)}}}function cx(a,s,l){l.props=ii(a.type,a.memoizedProps),l.state=a.memoizedState;try{l.componentWillUnmount()}catch(d){xt(a,s,d)}}function Kl(a,s){try{var l=a.ref;if(l!==null){switch(a.tag){case 26:case 27:case 5:var d=a.stateNode;break;case 30:d=a.stateNode;break;default:d=a.stateNode}typeof l=="function"?a.refCleanup=l(d):l.current=d}}catch(p){xt(a,s,p)}}function ea(a,s){var l=a.ref,d=a.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(p){xt(a,s,p)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){xt(a,s,p)}else l.current=null}function ux(a){var s=a.type,l=a.memoizedProps,d=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(p){xt(a,a.return,p)}}function Qp(a,s,l){try{var d=a.stateNode;Ak(d,a.type,l,s),d[he]=s}catch(p){xt(a,a.return,p)}}function dx(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ps(a.type)||a.tag===4}function Xp(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||dx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ps(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Jp(a,s,l){var d=a.tag;if(d===5||d===6)a=a.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(a),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=md));else if(d!==4&&(d===27&&ps(a.type)&&(l=a.stateNode,s=null),a=a.child,a!==null))for(Jp(a,s,l),a=a.sibling;a!==null;)Jp(a,s,l),a=a.sibling}function ad(a,s,l){var d=a.tag;if(d===5||d===6)a=a.stateNode,s?l.insertBefore(a,s):l.appendChild(a);else if(d!==4&&(d===27&&ps(a.type)&&(l=a.stateNode),a=a.child,a!==null))for(ad(a,s,l),a=a.sibling;a!==null;)ad(a,s,l),a=a.sibling}function fx(a){var s=a.stateNode,l=a.memoizedProps;try{for(var d=a.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);cn(s,d,l),s[le]=a,s[he]=l}catch(y){xt(a,a.return,y)}}var Aa=!1,$t=!1,em=!1,hx=typeof WeakSet=="function"?WeakSet:Set,rn=null;function ck(a,s){if(a=a.containerInfo,_m=Sd,a=_b(a),Xh(a)){if("selectionStart"in a)var l={start:a.selectionStart,end:a.selectionEnd};else e:{l=(l=a.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var T=0,O=-1,P=-1,q=0,ae=0,ue=a,K=null;t:for(;;){for(var J;ue!==l||p!==0&&ue.nodeType!==3||(O=T+p),ue!==y||d!==0&&ue.nodeType!==3||(P=T+d),ue.nodeType===3&&(T+=ue.nodeValue.length),(J=ue.firstChild)!==null;)K=ue,ue=J;for(;;){if(ue===a)break t;if(K===l&&++q===p&&(O=T),K===y&&++ae===d&&(P=T),(J=ue.nextSibling)!==null)break;ue=K,K=ue.parentNode}ue=J}l=O===-1||P===-1?null:{start:O,end:P}}else l=null}l=l||{start:0,end:0}}else l=null;for(Tm={focusedElem:a,selectionRange:l},Sd=!1,rn=s;rn!==null;)if(s=rn,a=s.child,(s.subtreeFlags&1024)!==0&&a!==null)a.return=s,rn=a;else for(;rn!==null;){switch(s=rn,y=s.alternate,a=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,l=s,p=y.memoizedProps,y=y.memoizedState,d=l.stateNode;try{var Ie=ii(l.type,p,l.elementType===l.type);a=d.getSnapshotBeforeUpdate(Ie,y),d.__reactInternalSnapshotBeforeUpdate=a}catch(Me){xt(l,l.return,Me)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,l=a.nodeType,l===9)Om(a);else if(l===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Om(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,rn=a;break}rn=s.return}}function px(a,s,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:os(a,l),d&4&&Wl(5,l);break;case 1:if(os(a,l),d&4)if(a=l.stateNode,s===null)try{a.componentDidMount()}catch(T){xt(l,l.return,T)}else{var p=ii(l.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(p,s,a.__reactInternalSnapshotBeforeUpdate)}catch(T){xt(l,l.return,T)}}d&64&&lx(l),d&512&&Kl(l,l.return);break;case 3:if(os(a,l),d&64&&(a=l.updateQueue,a!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{Kb(a,s)}catch(T){xt(l,l.return,T)}}break;case 27:s===null&&d&4&&fx(l);case 26:case 5:os(a,l),s===null&&d&4&&ux(l),d&512&&Kl(l,l.return);break;case 12:os(a,l);break;case 13:os(a,l),d&4&&vx(a,l),d&64&&(a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(l=yk.bind(null,l),Lk(a,l))));break;case 22:if(d=l.memoizedState!==null||Aa,!d){s=s!==null&&s.memoizedState!==null||$t,p=Aa;var y=$t;Aa=d,($t=s)&&!y?ls(a,l,(l.subtreeFlags&8772)!==0):os(a,l),Aa=p,$t=y}break;case 30:break;default:os(a,l)}}function mx(a){var s=a.alternate;s!==null&&(a.alternate=null,mx(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Le(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Rt=null,Pn=!1;function Na(a,s,l){for(l=l.child;l!==null;)gx(a,s,l),l=l.sibling}function gx(a,s,l){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(wt,l)}catch{}switch(l.tag){case 26:$t||ea(l,s),Na(a,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$t||ea(l,s);var d=Rt,p=Pn;ps(l.type)&&(Rt=l.stateNode,Pn=!1),Na(a,s,l),ac(l.stateNode),Rt=d,Pn=p;break;case 5:$t||ea(l,s);case 6:if(d=Rt,p=Pn,Rt=null,Na(a,s,l),Rt=d,Pn=p,Rt!==null)if(Pn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(l.stateNode)}catch(y){xt(l,s,y)}else try{Rt.removeChild(l.stateNode)}catch(y){xt(l,s,y)}break;case 18:Rt!==null&&(Pn?(a=Rt,aS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,l.stateNode),fc(a)):aS(Rt,l.stateNode));break;case 4:d=Rt,p=Pn,Rt=l.stateNode.containerInfo,Pn=!0,Na(a,s,l),Rt=d,Pn=p;break;case 0:case 11:case 14:case 15:$t||is(2,l,s),$t||is(4,l,s),Na(a,s,l);break;case 1:$t||(ea(l,s),d=l.stateNode,typeof d.componentWillUnmount=="function"&&cx(l,s,d)),Na(a,s,l);break;case 21:Na(a,s,l);break;case 22:$t=(d=$t)||l.memoizedState!==null,Na(a,s,l),$t=d;break;default:Na(a,s,l)}}function vx(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{fc(a)}catch(l){xt(s,s.return,l)}}function uk(a){switch(a.tag){case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new hx),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new hx),s;default:throw Error(r(435,a.tag))}}function tm(a,s){var l=uk(a);s.forEach(function(d){var p=bk.bind(null,a,d);l.has(d)||(l.add(d),d.then(p,p))})}function Vn(a,s){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d],y=a,T=s,O=T;e:for(;O!==null;){switch(O.tag){case 27:if(ps(O.type)){Rt=O.stateNode,Pn=!1;break e}break;case 5:Rt=O.stateNode,Pn=!1;break e;case 3:case 4:Rt=O.stateNode.containerInfo,Pn=!0;break e}O=O.return}if(Rt===null)throw Error(r(160));gx(y,T,p),Rt=null,Pn=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)yx(s,a),s=s.sibling}var jr=null;function yx(a,s){var l=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Vn(s,a),Gn(a),d&4&&(is(3,a,a.return),Wl(3,a),is(5,a,a.return));break;case 1:Vn(s,a),Gn(a),d&512&&($t||l===null||ea(l,l.return)),d&64&&Aa&&(a=a.updateQueue,a!==null&&(d=a.callbacks,d!==null&&(l=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var p=jr;if(Vn(s,a),Gn(a),d&512&&($t||l===null||ea(l,l.return)),d&4){var y=l!==null?l.memoizedState:null;if(d=a.memoizedState,l===null)if(d===null)if(a.stateNode===null){e:{d=a.type,l=a.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Pe]||y[le]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),cn(y,d,l),y[le]=a,lt(y),d=y;break e;case"link":var T=fS("link","href",p).get(d+(l.href||""));if(T){for(var O=0;O<T.length;O++)if(y=T[O],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(O,1);break t}}y=p.createElement(d),cn(y,d,l),p.head.appendChild(y);break;case"meta":if(T=fS("meta","content",p).get(d+(l.content||""))){for(O=0;O<T.length;O++)if(y=T[O],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(O,1);break t}}y=p.createElement(d),cn(y,d,l),p.head.appendChild(y);break;default:throw Error(r(468,d))}y[le]=a,lt(y),d=y}a.stateNode=d}else hS(p,a.type,a.stateNode);else a.stateNode=dS(p,d,a.memoizedProps);else y!==d?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,d===null?hS(p,a.type,a.stateNode):dS(p,d,a.memoizedProps)):d===null&&a.stateNode!==null&&Qp(a,a.memoizedProps,l.memoizedProps)}break;case 27:Vn(s,a),Gn(a),d&512&&($t||l===null||ea(l,l.return)),l!==null&&d&4&&Qp(a,a.memoizedProps,l.memoizedProps);break;case 5:if(Vn(s,a),Gn(a),d&512&&($t||l===null||ea(l,l.return)),a.flags&32){p=a.stateNode;try{Bi(p,"")}catch(J){xt(a,a.return,J)}}d&4&&a.stateNode!=null&&(p=a.memoizedProps,Qp(a,p,l!==null?l.memoizedProps:p)),d&1024&&(em=!0);break;case 6:if(Vn(s,a),Gn(a),d&4){if(a.stateNode===null)throw Error(r(162));d=a.memoizedProps,l=a.stateNode;try{l.nodeValue=d}catch(J){xt(a,a.return,J)}}break;case 3:if(bd=null,p=jr,jr=vd(s.containerInfo),Vn(s,a),jr=p,Gn(a),d&4&&l!==null&&l.memoizedState.isDehydrated)try{fc(s.containerInfo)}catch(J){xt(a,a.return,J)}em&&(em=!1,bx(a));break;case 4:d=jr,jr=vd(a.stateNode.containerInfo),Vn(s,a),Gn(a),jr=d;break;case 12:Vn(s,a),Gn(a);break;case 13:Vn(s,a),Gn(a),a.child.flags&8192&&a.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(om=Nt()),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,tm(a,d)));break;case 22:p=a.memoizedState!==null;var P=l!==null&&l.memoizedState!==null,q=Aa,ae=$t;if(Aa=q||p,$t=ae||P,Vn(s,a),$t=ae,Aa=q,Gn(a),d&8192)e:for(s=a.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||P||Aa||$t||oi(a)),l=null,s=a;;){if(s.tag===5||s.tag===26){if(l===null){P=l=s;try{if(y=P.stateNode,p)T=y.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{O=P.stateNode;var ue=P.memoizedProps.style,K=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;O.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(J){xt(P,P.return,J)}}}else if(s.tag===6){if(l===null){P=s;try{P.stateNode.nodeValue=p?"":P.memoizedProps}catch(J){xt(P,P.return,J)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=a.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,tm(a,l))));break;case 19:Vn(s,a),Gn(a),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,tm(a,d)));break;case 30:break;case 21:break;default:Vn(s,a),Gn(a)}}function Gn(a){var s=a.flags;if(s&2){try{for(var l,d=a.return;d!==null;){if(dx(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var p=l.stateNode,y=Xp(a);ad(a,y,p);break;case 5:var T=l.stateNode;l.flags&32&&(Bi(T,""),l.flags&=-33);var O=Xp(a);ad(a,O,T);break;case 3:case 4:var P=l.stateNode.containerInfo,q=Xp(a);Jp(a,q,P);break;default:throw Error(r(161))}}catch(ae){xt(a,a.return,ae)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function bx(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;bx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function os(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)px(a,s.alternate,s),s=s.sibling}function oi(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:is(4,s,s.return),oi(s);break;case 1:ea(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&cx(s,s.return,l),oi(s);break;case 27:ac(s.stateNode);case 26:case 5:ea(s,s.return),oi(s);break;case 22:s.memoizedState===null&&oi(s);break;case 30:oi(s);break;default:oi(s)}a=a.sibling}}function ls(a,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,p=a,y=s,T=y.flags;switch(y.tag){case 0:case 11:case 15:ls(p,y,l),Wl(4,y);break;case 1:if(ls(p,y,l),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(q){xt(d,d.return,q)}if(d=y,p=d.updateQueue,p!==null){var O=d.stateNode;try{var P=p.shared.hiddenCallbacks;if(P!==null)for(p.shared.hiddenCallbacks=null,p=0;p<P.length;p++)Wb(P[p],O)}catch(q){xt(d,d.return,q)}}l&&T&64&&lx(y),Kl(y,y.return);break;case 27:fx(y);case 26:case 5:ls(p,y,l),l&&d===null&&T&4&&ux(y),Kl(y,y.return);break;case 12:ls(p,y,l);break;case 13:ls(p,y,l),l&&T&4&&vx(p,y);break;case 22:y.memoizedState===null&&ls(p,y,l),Kl(y,y.return);break;case 30:break;default:ls(p,y,l)}s=s.sibling}}function nm(a,s){var l=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==l&&(a!=null&&a.refCount++,l!=null&&Dl(l))}function rm(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Dl(a))}function ta(a,s,l,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)wx(a,s,l,d),s=s.sibling}function wx(a,s,l,d){var p=s.flags;switch(s.tag){case 0:case 11:case 15:ta(a,s,l,d),p&2048&&Wl(9,s);break;case 1:ta(a,s,l,d);break;case 3:ta(a,s,l,d),p&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Dl(a)));break;case 12:if(p&2048){ta(a,s,l,d),a=s.stateNode;try{var y=s.memoizedProps,T=y.id,O=y.onPostCommit;typeof O=="function"&&O(T,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(P){xt(s,s.return,P)}}else ta(a,s,l,d);break;case 13:ta(a,s,l,d);break;case 23:break;case 22:y=s.stateNode,T=s.alternate,s.memoizedState!==null?y._visibility&2?ta(a,s,l,d):Zl(a,s):y._visibility&2?ta(a,s,l,d):(y._visibility|=2,io(a,s,l,d,(s.subtreeFlags&10256)!==0)),p&2048&&nm(T,s);break;case 24:ta(a,s,l,d),p&2048&&rm(s.alternate,s);break;default:ta(a,s,l,d)}}function io(a,s,l,d,p){for(p=p&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var y=a,T=s,O=l,P=d,q=T.flags;switch(T.tag){case 0:case 11:case 15:io(y,T,O,P,p),Wl(8,T);break;case 23:break;case 22:var ae=T.stateNode;T.memoizedState!==null?ae._visibility&2?io(y,T,O,P,p):Zl(y,T):(ae._visibility|=2,io(y,T,O,P,p)),p&&q&2048&&nm(T.alternate,T);break;case 24:io(y,T,O,P,p),p&&q&2048&&rm(T.alternate,T);break;default:io(y,T,O,P,p)}s=s.sibling}}function Zl(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=a,d=s,p=d.flags;switch(d.tag){case 22:Zl(l,d),p&2048&&nm(d.alternate,d);break;case 24:Zl(l,d),p&2048&&rm(d.alternate,d);break;default:Zl(l,d)}s=s.sibling}}var Ql=8192;function oo(a){if(a.subtreeFlags&Ql)for(a=a.child;a!==null;)xx(a),a=a.sibling}function xx(a){switch(a.tag){case 26:oo(a),a.flags&Ql&&a.memoizedState!==null&&Kk(jr,a.memoizedState,a.memoizedProps);break;case 5:oo(a);break;case 3:case 4:var s=jr;jr=vd(a.stateNode.containerInfo),oo(a),jr=s;break;case 22:a.memoizedState===null&&(s=a.alternate,s!==null&&s.memoizedState!==null?(s=Ql,Ql=16777216,oo(a),Ql=s):oo(a));break;default:oo(a)}}function Sx(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function Xl(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];rn=d,_x(d,a)}Sx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ex(a),a=a.sibling}function Ex(a){switch(a.tag){case 0:case 11:case 15:Xl(a),a.flags&2048&&is(9,a,a.return);break;case 3:Xl(a);break;case 12:Xl(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,sd(a)):Xl(a);break;default:Xl(a)}}function sd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var d=s[l];rn=d,_x(d,a)}Sx(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:is(8,s,s.return),sd(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,sd(s));break;default:sd(s)}a=a.sibling}}function _x(a,s){for(;rn!==null;){var l=rn;switch(l.tag){case 0:case 11:case 15:is(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Dl(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,rn=d;else e:for(l=a;rn!==null;){d=rn;var p=d.sibling,y=d.return;if(mx(d),d===l){rn=null;break e}if(p!==null){p.return=y,rn=p;break e}rn=y}}}var dk={getCacheForType:function(a){var s=hn(Wt),l=s.data.get(a);return l===void 0&&(l=a(),s.data.set(a,l)),l}},fk=typeof WeakMap=="function"?WeakMap:Map,mt=0,St=null,Xe=null,at=0,gt=0,Yn=null,cs=!1,lo=!1,am=!1,ja=0,Pt=0,us=0,li=0,sm=0,gr=0,co=0,Jl=null,Ln=null,im=!1,om=0,id=1/0,od=null,ds=null,ln=0,fs=null,uo=null,fo=0,lm=0,cm=null,Tx=null,ec=0,um=null;function Wn(){if((mt&2)!==0&&at!==0)return at&-at;if(M.T!==null){var a=Xi;return a!==0?a:vm()}return I()}function Cx(){gr===0&&(gr=(at&536870912)===0||ut?ga():536870912);var a=mr.current;return a!==null&&(a.flags|=32),gr}function Kn(a,s,l){(a===St&&(gt===2||gt===9)||a.cancelPendingCommit!==null)&&(ho(a,0),hs(a,at,gr,!1)),Rr(a,l),((mt&2)===0||a!==St)&&(a===St&&((mt&2)===0&&(li|=l),Pt===4&&hs(a,at,gr,!1)),na(a))}function Rx(a,s,l){if((mt&6)!==0)throw Error(r(327));var d=!l&&(s&124)===0&&(s&a.expiredLanes)===0||or(a,s),p=d?mk(a,s):hm(a,s,!0),y=d;do{if(p===0){lo&&!d&&hs(a,s,0,!1);break}else{if(l=a.current.alternate,y&&!hk(l)){p=hm(a,s,!1),y=!1;continue}if(p===2){if(y=s,a.errorRecoveryDisabledLanes&y)var T=0;else T=a.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){s=T;e:{var O=a;p=Jl;var P=O.current.memoizedState.isDehydrated;if(P&&(ho(O,T).flags|=256),T=hm(O,T,!1),T!==2){if(am&&!P){O.errorRecoveryDisabledLanes|=y,li|=y,p=4;break e}y=Ln,Ln=p,y!==null&&(Ln===null?Ln=y:Ln.push.apply(Ln,y))}p=T}if(y=!1,p!==2)continue}}if(p===1){ho(a,0),hs(a,s,0,!0);break}e:{switch(d=a,y=p,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:hs(d,s,gr,!cs);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=om+300-Nt(),10<p)){if(hs(d,s,gr,!cs),Nn(d,0,!0)!==0)break e;d.timeoutHandle=nS(Ox.bind(null,d,l,Ln,od,im,s,gr,li,co,cs,y,2,-0,0),p);break e}Ox(d,l,Ln,od,im,s,gr,li,co,cs,y,0,-0,0)}}break}while(!0);na(a)}function Ox(a,s,l,d,p,y,T,O,P,q,ae,ue,K,J){if(a.timeoutHandle=-1,ue=s.subtreeFlags,(ue&8192||(ue&16785408)===16785408)&&(oc={stylesheets:null,count:0,unsuspend:Wk},xx(s),ue=Zk(),ue!==null)){a.cancelPendingCommit=ue(Px.bind(null,a,s,y,l,d,p,T,O,P,ae,1,K,J)),hs(a,y,T,!q);return}Px(a,s,y,l,d,p,T,O,P)}function hk(a){for(var s=a;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var p=l[d],y=p.getSnapshot;p=p.value;try{if(!Fn(y(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function hs(a,s,l,d){s&=~sm,s&=~li,a.suspendedLanes|=s,a.pingedLanes&=~s,d&&(a.warmLanes|=s),d=a.expirationTimes;for(var p=s;0<p;){var y=31-Yt(p),T=1<<y;d[y]=-1,p&=~T}l!==0&&va(a,l,s)}function ld(){return(mt&6)===0?(tc(0),!1):!0}function dm(){if(Xe!==null){if(gt===0)var a=Xe.return;else a=Xe,Ea=ni=null,Op(a),ao=null,Vl=0,a=Xe;for(;a!==null;)ox(a.alternate,a),a=a.return;Xe=null}}function ho(a,s){var l=a.timeoutHandle;l!==-1&&(a.timeoutHandle=-1,jk(l)),l=a.cancelPendingCommit,l!==null&&(a.cancelPendingCommit=null,l()),dm(),St=a,Xe=l=wa(a.current,null),at=s,gt=0,Yn=null,cs=!1,lo=or(a,s),am=!1,co=gr=sm=li=us=Pt=0,Ln=Jl=null,im=!1,(s&8)!==0&&(s|=s&32);var d=a.entangledLanes;if(d!==0)for(a=a.entanglements,d&=s;0<d;){var p=31-Yt(d),y=1<<p;s|=a[p],d&=~y}return ja=s,Nu(),l}function Ax(a,s){We=null,M.H=Ku,s===Ll||s===Uu?(s=Gb(),gt=3):s===Fb?(s=Gb(),gt=4):gt=s===Yw?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Yn=s,Xe===null&&(Pt=1,ed(a,dr(s,a.current)))}function Nx(){var a=M.H;return M.H=Ku,a===null?Ku:a}function jx(){var a=M.A;return M.A=dk,a}function fm(){Pt=4,cs||(at&4194048)!==at&&mr.current!==null||(lo=!0),(us&134217727)===0&&(li&134217727)===0||St===null||hs(St,at,gr,!1)}function hm(a,s,l){var d=mt;mt|=2;var p=Nx(),y=jx();(St!==a||at!==s)&&(od=null,ho(a,s)),s=!1;var T=Pt;e:do try{if(gt!==0&&Xe!==null){var O=Xe,P=Yn;switch(gt){case 8:dm(),T=6;break e;case 3:case 2:case 9:case 6:mr.current===null&&(s=!0);var q=gt;if(gt=0,Yn=null,po(a,O,P,q),l&&lo){T=0;break e}break;default:q=gt,gt=0,Yn=null,po(a,O,P,q)}}pk(),T=Pt;break}catch(ae){Ax(a,ae)}while(!0);return s&&a.shellSuspendCounter++,Ea=ni=null,mt=d,M.H=p,M.A=y,Xe===null&&(St=null,at=0,Nu()),T}function pk(){for(;Xe!==null;)kx(Xe)}function mk(a,s){var l=mt;mt|=2;var d=Nx(),p=jx();St!==a||at!==s?(od=null,id=Nt()+500,ho(a,s)):lo=or(a,s);e:do try{if(gt!==0&&Xe!==null){s=Xe;var y=Yn;t:switch(gt){case 1:gt=0,Yn=null,po(a,s,y,1);break;case 2:case 9:if(qb(y)){gt=0,Yn=null,Mx(s);break}s=function(){gt!==2&&gt!==9||St!==a||(gt=7),na(a)},y.then(s,s);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:qb(y)?(gt=0,Yn=null,Mx(s)):(gt=0,Yn=null,po(a,s,y,7));break;case 5:var T=null;switch(Xe.tag){case 26:T=Xe.memoizedState;case 5:case 27:var O=Xe;if(!T||pS(T)){gt=0,Yn=null;var P=O.sibling;if(P!==null)Xe=P;else{var q=O.return;q!==null?(Xe=q,cd(q)):Xe=null}break t}}gt=0,Yn=null,po(a,s,y,5);break;case 6:gt=0,Yn=null,po(a,s,y,6);break;case 8:dm(),Pt=6;break e;default:throw Error(r(462))}}gk();break}catch(ae){Ax(a,ae)}while(!0);return Ea=ni=null,M.H=d,M.A=p,mt=l,Xe!==null?0:(St=null,at=0,Nu(),Pt)}function gk(){for(;Xe!==null&&!bn();)kx(Xe)}function kx(a){var s=sx(a.alternate,a,ja);a.memoizedProps=a.pendingProps,s===null?cd(a):Xe=s}function Mx(a){var s=a,l=s.alternate;switch(s.tag){case 15:case 0:s=Jw(l,s,s.pendingProps,s.type,void 0,at);break;case 11:s=Jw(l,s,s.pendingProps,s.type.render,s.ref,at);break;case 5:Op(s);default:ox(l,s),s=Xe=Db(s,ja),s=sx(l,s,ja)}a.memoizedProps=a.pendingProps,s===null?cd(a):Xe=s}function po(a,s,l,d){Ea=ni=null,Op(s),ao=null,Vl=0;var p=s.return;try{if(sk(a,p,s,l,at)){Pt=1,ed(a,dr(l,a.current)),Xe=null;return}}catch(y){if(p!==null)throw Xe=p,y;Pt=1,ed(a,dr(l,a.current)),Xe=null;return}s.flags&32768?(ut||d===1?a=!0:lo||(at&536870912)!==0?a=!1:(cs=a=!0,(d===2||d===9||d===3||d===6)&&(d=mr.current,d!==null&&d.tag===13&&(d.flags|=16384))),Dx(s,a)):cd(s)}function cd(a){var s=a;do{if((s.flags&32768)!==0){Dx(s,cs);return}a=s.return;var l=ok(s.alternate,s,ja);if(l!==null){Xe=l;return}if(s=s.sibling,s!==null){Xe=s;return}Xe=s=a}while(s!==null);Pt===0&&(Pt=5)}function Dx(a,s){do{var l=lk(a.alternate,a);if(l!==null){l.flags&=32767,Xe=l;return}if(l=a.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(a=a.sibling,a!==null)){Xe=a;return}Xe=a=l}while(a!==null);Pt=6,Xe=null}function Px(a,s,l,d,p,y,T,O,P){a.cancelPendingCommit=null;do ud();while(ln!==0);if((mt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=rp,Hn(a,l,y,T,O,P),a===St&&(Xe=St=null,at=0),uo=s,fs=a,fo=l,lm=y,cm=p,Tx=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,wk(en,function(){return $x(),null})):(a.callbackNode=null,a.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=M.T,M.T=null,p=W.p,W.p=2,T=mt,mt|=4;try{ck(a,s,l)}finally{mt=T,W.p=p,M.T=d}}ln=1,Lx(),Ix(),zx()}}function Lx(){if(ln===1){ln=0;var a=fs,s=uo,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var d=W.p;W.p=2;var p=mt;mt|=4;try{yx(s,a);var y=Tm,T=_b(a.containerInfo),O=y.focusedElem,P=y.selectionRange;if(T!==O&&O&&O.ownerDocument&&Eb(O.ownerDocument.documentElement,O)){if(P!==null&&Xh(O)){var q=P.start,ae=P.end;if(ae===void 0&&(ae=q),"selectionStart"in O)O.selectionStart=q,O.selectionEnd=Math.min(ae,O.value.length);else{var ue=O.ownerDocument||document,K=ue&&ue.defaultView||window;if(K.getSelection){var J=K.getSelection(),Ie=O.textContent.length,Me=Math.min(P.start,Ie),bt=P.end===void 0?Me:Math.min(P.end,Ie);!J.extend&&Me>bt&&(T=bt,bt=Me,Me=T);var $=Sb(O,Me),z=Sb(O,bt);if($&&z&&(J.rangeCount!==1||J.anchorNode!==$.node||J.anchorOffset!==$.offset||J.focusNode!==z.node||J.focusOffset!==z.offset)){var F=ue.createRange();F.setStart($.node,$.offset),J.removeAllRanges(),Me>bt?(J.addRange(F),J.extend(z.node,z.offset)):(F.setEnd(z.node,z.offset),J.addRange(F))}}}}for(ue=[],J=O;J=J.parentNode;)J.nodeType===1&&ue.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ue.length;O++){var oe=ue[O];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Sd=!!_m,Tm=_m=null}finally{mt=p,W.p=d,M.T=l}}a.current=s,ln=2}}function Ix(){if(ln===2){ln=0;var a=fs,s=uo,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var d=W.p;W.p=2;var p=mt;mt|=4;try{px(a,s.alternate,s)}finally{mt=p,W.p=d,M.T=l}}ln=3}}function zx(){if(ln===4||ln===3){ln=0,wn();var a=fs,s=uo,l=fo,d=Tx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ln=5:(ln=0,uo=fs=null,Ux(a,a.pendingLanes));var p=a.pendingLanes;if(p===0&&(ds=null),ht(l),s=s.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(wt,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=M.T,p=W.p,W.p=2,M.T=null;try{for(var y=a.onRecoverableError,T=0;T<d.length;T++){var O=d[T];y(O.value,{componentStack:O.stack})}}finally{M.T=s,W.p=p}}(fo&3)!==0&&ud(),na(a),p=a.pendingLanes,(l&4194090)!==0&&(p&42)!==0?a===um?ec++:(ec=0,um=a):ec=0,tc(0)}}function Ux(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Dl(s)))}function ud(a){return Lx(),Ix(),zx(),$x()}function $x(){if(ln!==5)return!1;var a=fs,s=lm;lm=0;var l=ht(fo),d=M.T,p=W.p;try{W.p=32>l?32:l,M.T=null,l=cm,cm=null;var y=fs,T=fo;if(ln=0,uo=fs=null,fo=0,(mt&6)!==0)throw Error(r(331));var O=mt;if(mt|=4,Ex(y.current),wx(y,y.current,T,l),mt=O,tc(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(wt,y)}catch{}return!0}finally{W.p=p,M.T=d,Ux(a,s)}}function Bx(a,s,l){s=dr(l,s),s=Hp(a.stateNode,s,2),a=ns(a,s,2),a!==null&&(Rr(a,2),na(a))}function xt(a,s,l){if(a.tag===3)Bx(a,a,l);else for(;s!==null;){if(s.tag===3){Bx(s,a,l);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ds===null||!ds.has(d))){a=dr(l,a),l=Vw(2),d=ns(s,l,2),d!==null&&(Gw(l,d,s,a),Rr(d,2),na(d));break}}s=s.return}}function pm(a,s,l){var d=a.pingCache;if(d===null){d=a.pingCache=new fk;var p=new Set;d.set(s,p)}else p=d.get(s),p===void 0&&(p=new Set,d.set(s,p));p.has(l)||(am=!0,p.add(l),a=vk.bind(null,a,s,l),s.then(a,a))}function vk(a,s,l){var d=a.pingCache;d!==null&&d.delete(s),a.pingedLanes|=a.suspendedLanes&l,a.warmLanes&=~l,St===a&&(at&l)===l&&(Pt===4||Pt===3&&(at&62914560)===at&&300>Nt()-om?(mt&2)===0&&ho(a,0):sm|=l,co===at&&(co=0)),na(a)}function Hx(a,s){s===0&&(s=Gs()),a=Wi(a,s),a!==null&&(Rr(a,s),na(a))}function yk(a){var s=a.memoizedState,l=0;s!==null&&(l=s.retryLane),Hx(a,l)}function bk(a,s){var l=0;switch(a.tag){case 13:var d=a.stateNode,p=a.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=a.stateNode;break;case 22:d=a.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(s),Hx(a,l)}function wk(a,s){return Be(a,s)}var dd=null,mo=null,mm=!1,fd=!1,gm=!1,ci=0;function na(a){a!==mo&&a.next===null&&(mo===null?dd=mo=a:mo=mo.next=a),fd=!0,mm||(mm=!0,Sk())}function tc(a,s){if(!gm&&fd){gm=!0;do for(var l=!1,d=dd;d!==null;){if(a!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var T=d.suspendedLanes,O=d.pingedLanes;y=(1<<31-Yt(42|a)+1)-1,y&=p&~(T&~O),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Gx(d,y))}else y=at,y=Nn(d,d===St?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||or(d,y)||(l=!0,Gx(d,y));d=d.next}while(l);gm=!1}}function xk(){Fx()}function Fx(){fd=mm=!1;var a=0;ci!==0&&(Nk()&&(a=ci),ci=0);for(var s=Nt(),l=null,d=dd;d!==null;){var p=d.next,y=qx(d,s);y===0?(d.next=null,l===null?dd=p:l.next=p,p===null&&(mo=l)):(l=d,(a!==0||(y&3)!==0)&&(fd=!0)),d=p}tc(a)}function qx(a,s){for(var l=a.suspendedLanes,d=a.pingedLanes,p=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var T=31-Yt(y),O=1<<T,P=p[T];P===-1?((O&l)===0||(O&d)!==0)&&(p[T]=Ui(O,s)):P<=s&&(a.expiredLanes|=O),y&=~O}if(s=St,l=at,l=Nn(a,a===s?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),d=a.callbackNode,l===0||a===s&&(gt===2||gt===9)||a.cancelPendingCommit!==null)return d!==null&&d!==null&&st(d),a.callbackNode=null,a.callbackPriority=0;if((l&3)===0||or(a,l)){if(s=l&-l,s===a.callbackPriority)return s;switch(d!==null&&st(d),ht(l)){case 2:case 8:l=ma;break;case 32:l=en;break;case 268435456:l=tn;break;default:l=en}return d=Vx.bind(null,a),l=Be(l,d),a.callbackPriority=s,a.callbackNode=l,s}return d!==null&&d!==null&&st(d),a.callbackPriority=2,a.callbackNode=null,2}function Vx(a,s){if(ln!==0&&ln!==5)return a.callbackNode=null,a.callbackPriority=0,null;var l=a.callbackNode;if(ud()&&a.callbackNode!==l)return null;var d=at;return d=Nn(a,a===St?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),d===0?null:(Rx(a,d,s),qx(a,Nt()),a.callbackNode!=null&&a.callbackNode===l?Vx.bind(null,a):null)}function Gx(a,s){if(ud())return null;Rx(a,s,!0)}function Sk(){kk(function(){(mt&6)!==0?Be(pa,xk):Fx()})}function vm(){return ci===0&&(ci=ga()),ci}function Yx(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Eu(""+a)}function Wx(a,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,a.id&&l.setAttribute("form",a.id),s.parentNode.insertBefore(l,s),a=new FormData(a),l.parentNode.removeChild(l),a}function Ek(a,s,l,d,p){if(s==="submit"&&l&&l.stateNode===p){var y=Yx((p[he]||null).action),T=d.submitter;T&&(s=(s=T[he]||null)?Yx(s.formAction):T.getAttribute("formAction"),s!==null&&(y=s,T=null));var O=new Ru("action","action",null,d,p);a.push({event:O,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ci!==0){var P=T?Wx(p,T):new FormData(p);Ip(l,{pending:!0,data:P,method:p.method,action:y},null,P)}}else typeof y=="function"&&(O.preventDefault(),P=T?Wx(p,T):new FormData(p),Ip(l,{pending:!0,data:P,method:p.method,action:y},y,P))},currentTarget:p}]})}}for(var ym=0;ym<np.length;ym++){var bm=np[ym],_k=bm.toLowerCase(),Tk=bm[0].toUpperCase()+bm.slice(1);Nr(_k,"on"+Tk)}Nr(Rb,"onAnimationEnd"),Nr(Ob,"onAnimationIteration"),Nr(Ab,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(Hj,"onTransitionRun"),Nr(Fj,"onTransitionStart"),Nr(qj,"onTransitionCancel"),Nr(Nb,"onTransitionEnd"),lr("onMouseEnter",["mouseout","mouseover"]),lr("onMouseLeave",["mouseout","mouseover"]),lr("onPointerEnter",["pointerout","pointerover"]),lr("onPointerLeave",["pointerout","pointerover"]),Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nc="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(" "),Ck=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nc));function Kx(a,s){s=(s&4)!==0;for(var l=0;l<a.length;l++){var d=a[l],p=d.event;d=d.listeners;e:{var y=void 0;if(s)for(var T=d.length-1;0<=T;T--){var O=d[T],P=O.instance,q=O.currentTarget;if(O=O.listener,P!==y&&p.isPropagationStopped())break e;y=O,p.currentTarget=q;try{y(p)}catch(ae){Ju(ae)}p.currentTarget=null,y=P}else for(T=0;T<d.length;T++){if(O=d[T],P=O.instance,q=O.currentTarget,O=O.listener,P!==y&&p.isPropagationStopped())break e;y=O,p.currentTarget=q;try{y(p)}catch(ae){Ju(ae)}p.currentTarget=null,y=P}}}}function Je(a,s){var l=s[ke];l===void 0&&(l=s[ke]=new Set);var d=a+"__bubble";l.has(d)||(Zx(s,a,2,!1),l.add(d))}function wm(a,s,l){var d=0;s&&(d|=4),Zx(l,a,d,s)}var hd="_reactListening"+Math.random().toString(36).slice(2);function xm(a){if(!a[hd]){a[hd]=!0,nt.forEach(function(l){l!=="selectionchange"&&(Ck.has(l)||wm(l,!1,a),wm(l,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[hd]||(s[hd]=!0,wm("selectionchange",!1,s))}}function Zx(a,s,l,d){switch(wS(s)){case 2:var p=Jk;break;case 8:p=eM;break;default:p=Pm}l=p.bind(null,s,l,a),p=void 0,!Fh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),d?p!==void 0?a.addEventListener(s,l,{capture:!0,passive:p}):a.addEventListener(s,l,!0):p!==void 0?a.addEventListener(s,l,{passive:p}):a.addEventListener(s,l,!1)}function Sm(a,s,l,d,p){var y=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var T=d.tag;if(T===3||T===4){var O=d.stateNode.containerInfo;if(O===p)break;if(T===4)for(T=d.return;T!==null;){var P=T.tag;if((P===3||P===4)&&T.stateNode.containerInfo===p)return;T=T.return}for(;O!==null;){if(T=$e(O),T===null)return;if(P=T.tag,P===5||P===6||P===26||P===27){d=y=T;continue e}O=O.parentNode}}d=d.return}rb(function(){var q=y,ae=Bh(l),ue=[];e:{var K=jb.get(a);if(K!==void 0){var J=Ru,Ie=a;switch(a){case"keypress":if(Tu(l)===0)break e;case"keydown":case"keyup":J=wj;break;case"focusin":Ie="focus",J=Yh;break;case"focusout":Ie="blur",J=Yh;break;case"beforeblur":case"afterblur":J=Yh;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=ib;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=lj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Ej;break;case Rb:case Ob:case Ab:J=dj;break;case Nb:J=Tj;break;case"scroll":case"scrollend":J=ij;break;case"wheel":J=Rj;break;case"copy":case"cut":case"paste":J=hj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=lb;break;case"toggle":case"beforetoggle":J=Aj}var Me=(s&4)!==0,bt=!Me&&(a==="scroll"||a==="scrollend"),$=Me?K!==null?K+"Capture":null:K;Me=[];for(var z=q,F;z!==null;){var oe=z;if(F=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||F===null||$===null||(oe=xl(z,$),oe!=null&&Me.push(rc(z,oe,F))),bt)break;z=z.return}0<Me.length&&(K=new J(K,Ie,null,l,ae),ue.push({event:K,listeners:Me}))}}if((s&7)===0){e:{if(K=a==="mouseover"||a==="pointerover",J=a==="mouseout"||a==="pointerout",K&&l!==$h&&(Ie=l.relatedTarget||l.fromElement)&&($e(Ie)||Ie[Se]))break e;if((J||K)&&(K=ae.window===ae?ae:(K=ae.ownerDocument)?K.defaultView||K.parentWindow:window,J?(Ie=l.relatedTarget||l.toElement,J=q,Ie=Ie?$e(Ie):null,Ie!==null&&(bt=o(Ie),Me=Ie.tag,Ie!==bt||Me!==5&&Me!==27&&Me!==6)&&(Ie=null)):(J=null,Ie=q),J!==Ie)){if(Me=ib,oe="onMouseLeave",$="onMouseEnter",z="mouse",(a==="pointerout"||a==="pointerover")&&(Me=lb,oe="onPointerLeave",$="onPointerEnter",z="pointer"),bt=J==null?K:_t(J),F=Ie==null?K:_t(Ie),K=new Me(oe,z+"leave",J,l,ae),K.target=bt,K.relatedTarget=F,oe=null,$e(ae)===q&&(Me=new Me($,z+"enter",Ie,l,ae),Me.target=F,Me.relatedTarget=bt,oe=Me),bt=oe,J&&Ie)t:{for(Me=J,$=Ie,z=0,F=Me;F;F=go(F))z++;for(F=0,oe=$;oe;oe=go(oe))F++;for(;0<z-F;)Me=go(Me),z--;for(;0<F-z;)$=go($),F--;for(;z--;){if(Me===$||$!==null&&Me===$.alternate)break t;Me=go(Me),$=go($)}Me=null}else Me=null;J!==null&&Qx(ue,K,J,Me,!1),Ie!==null&&bt!==null&&Qx(ue,bt,Ie,Me,!0)}}e:{if(K=q?_t(q):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var _e=gb;else if(pb(K))if(vb)_e=Uj;else{_e=Ij;var Qe=Lj}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?q&&Uh(q.elementType)&&(_e=gb):_e=zj;if(_e&&(_e=_e(a,q))){mb(ue,_e,l,ae);break e}Qe&&Qe(a,K,q),a==="focusout"&&q&&K.type==="number"&&q.memoizedProps.value!=null&&zh(K,"number",K.value)}switch(Qe=q?_t(q):window,a){case"focusin":(pb(Qe)||Qe.contentEditable==="true")&&(Vi=Qe,Jh=q,Al=null);break;case"focusout":Al=Jh=Vi=null;break;case"mousedown":ep=!0;break;case"contextmenu":case"mouseup":case"dragend":ep=!1,Tb(ue,l,ae);break;case"selectionchange":if(Bj)break;case"keydown":case"keyup":Tb(ue,l,ae)}var Re;if(Kh)e:{switch(a){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else qi?fb(a,l)&&(De="onCompositionEnd"):a==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(cb&&l.locale!=="ko"&&(qi||De!=="onCompositionStart"?De==="onCompositionEnd"&&qi&&(Re=ab()):(Xa=ae,qh="value"in Xa?Xa.value:Xa.textContent,qi=!0)),Qe=pd(q,De),0<Qe.length&&(De=new ob(De,a,null,l,ae),ue.push({event:De,listeners:Qe}),Re?De.data=Re:(Re=hb(l),Re!==null&&(De.data=Re)))),(Re=jj?kj(a,l):Mj(a,l))&&(De=pd(q,"onBeforeInput"),0<De.length&&(Qe=new ob("onBeforeInput","beforeinput",null,l,ae),ue.push({event:Qe,listeners:De}),Qe.data=Re)),Ek(ue,a,q,l,ae)}Kx(ue,s)})}function rc(a,s,l){return{instance:a,listener:s,currentTarget:l}}function pd(a,s){for(var l=s+"Capture",d=[];a!==null;){var p=a,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=xl(a,l),p!=null&&d.unshift(rc(a,p,y)),p=xl(a,s),p!=null&&d.push(rc(a,p,y))),a.tag===3)return d;a=a.return}return[]}function go(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Qx(a,s,l,d,p){for(var y=s._reactName,T=[];l!==null&&l!==d;){var O=l,P=O.alternate,q=O.stateNode;if(O=O.tag,P!==null&&P===d)break;O!==5&&O!==26&&O!==27||q===null||(P=q,p?(q=xl(l,y),q!=null&&T.unshift(rc(l,q,P))):p||(q=xl(l,y),q!=null&&T.push(rc(l,q,P)))),l=l.return}T.length!==0&&a.push({event:s,listeners:T})}var Rk=/\r\n?/g,Ok=/\u0000|\uFFFD/g;function Xx(a){return(typeof a=="string"?a:""+a).replace(Rk,`
`).replace(Ok,"")}function Jx(a,s){return s=Xx(s),Xx(a)===s}function md(){}function yt(a,s,l,d,p,y){switch(l){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||Bi(a,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&Bi(a,""+d);break;case"className":ya(a,"class",d);break;case"tabIndex":ya(a,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ya(a,l,d);break;case"style":tb(a,d,y);break;case"data":if(s!=="object"){ya(a,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||l!=="href")){a.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(l);break}d=Eu(""+d),a.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){a.setAttribute(l,"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 y=="function"&&(l==="formAction"?(s!=="input"&&yt(a,s,"name",p.name,p,null),yt(a,s,"formEncType",p.formEncType,p,null),yt(a,s,"formMethod",p.formMethod,p,null),yt(a,s,"formTarget",p.formTarget,p,null)):(yt(a,s,"encType",p.encType,p,null),yt(a,s,"method",p.method,p,null),yt(a,s,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(l);break}d=Eu(""+d),a.setAttribute(l,d);break;case"onClick":d!=null&&(a.onclick=md);break;case"onScroll":d!=null&&Je("scroll",a);break;case"onScrollEnd":d!=null&&Je("scrollend",a);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"multiple":a.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":a.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){a.removeAttribute("xlink:href");break}l=Eu(""+d),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,""+d):a.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,""):a.removeAttribute(l);break;case"capture":case"download":d===!0?a.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,d):a.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?a.setAttribute(l,d):a.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?a.removeAttribute(l):a.setAttribute(l,d);break;case"popover":Je("beforetoggle",a),Je("toggle",a),cr(a,"popover",d);break;case"xlinkActuate":Ze(a,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ze(a,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ze(a,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ze(a,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ze(a,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ze(a,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ze(a,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ze(a,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ze(a,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":cr(a,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=aj.get(l)||l,cr(a,l,d))}}function Em(a,s,l,d,p,y){switch(l){case"style":tb(a,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(p.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"children":typeof d=="string"?Bi(a,d):(typeof d=="number"||typeof d=="bigint")&&Bi(a,""+d);break;case"onScroll":d!=null&&Je("scroll",a);break;case"onScrollEnd":d!=null&&Je("scrollend",a);break;case"onClick":d!=null&&(a.onclick=md);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wa.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),y=a[he]||null,y=y!=null?y[l]:null,typeof y=="function"&&a.removeEventListener(s,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(l in a?a[l]=null:a.hasAttribute(l)&&a.removeAttribute(l)),a.addEventListener(s,d,p);break e}l in a?a[l]=d:d===!0?a.setAttribute(l,""):cr(a,l,d)}}}function cn(a,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",a),Je("load",a);var d=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var T=l[y];if(T!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:yt(a,s,y,T,l,null)}}p&&yt(a,s,"srcSet",l.srcSet,l,null),d&&yt(a,s,"src",l.src,l,null);return;case"input":Je("invalid",a);var O=y=T=p=null,P=null,q=null;for(d in l)if(l.hasOwnProperty(d)){var ae=l[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":T=ae;break;case"checked":P=ae;break;case"defaultChecked":q=ae;break;case"value":y=ae;break;case"defaultValue":O=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:yt(a,s,d,ae,l,null)}}Q0(a,y,O,P,q,T,p,!1),xu(a);return;case"select":Je("invalid",a),d=T=y=null;for(p in l)if(l.hasOwnProperty(p)&&(O=l[p],O!=null))switch(p){case"value":y=O;break;case"defaultValue":T=O;break;case"multiple":d=O;default:yt(a,s,p,O,l,null)}s=y,l=T,a.multiple=!!d,s!=null?$i(a,!!d,s,!1):l!=null&&$i(a,!!d,l,!0);return;case"textarea":Je("invalid",a),y=p=d=null;for(T in l)if(l.hasOwnProperty(T)&&(O=l[T],O!=null))switch(T){case"value":d=O;break;case"defaultValue":p=O;break;case"children":y=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:yt(a,s,T,O,l,null)}J0(a,d,p,y),xu(a);return;case"option":for(P in l)if(l.hasOwnProperty(P)&&(d=l[P],d!=null))switch(P){case"selected":a.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:yt(a,s,P,d,l,null)}return;case"dialog":Je("beforetoggle",a),Je("toggle",a),Je("cancel",a),Je("close",a);break;case"iframe":case"object":Je("load",a);break;case"video":case"audio":for(d=0;d<nc.length;d++)Je(nc[d],a);break;case"image":Je("error",a),Je("load",a);break;case"details":Je("toggle",a);break;case"embed":case"source":case"link":Je("error",a),Je("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in l)if(l.hasOwnProperty(q)&&(d=l[q],d!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:yt(a,s,q,d,l,null)}return;default:if(Uh(s)){for(ae in l)l.hasOwnProperty(ae)&&(d=l[ae],d!==void 0&&Em(a,s,ae,d,l,void 0));return}}for(O in l)l.hasOwnProperty(O)&&(d=l[O],d!=null&&yt(a,s,O,d,l,null))}function Ak(a,s,l,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,T=null,O=null,P=null,q=null,ae=null;for(J in l){var ue=l[J];if(l.hasOwnProperty(J)&&ue!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":P=ue;default:d.hasOwnProperty(J)||yt(a,s,J,null,d,ue)}}for(var K in d){var J=d[K];if(ue=l[K],d.hasOwnProperty(K)&&(J!=null||ue!=null))switch(K){case"type":y=J;break;case"name":p=J;break;case"checked":q=J;break;case"defaultChecked":ae=J;break;case"value":T=J;break;case"defaultValue":O=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,s));break;default:J!==ue&&yt(a,s,K,J,d,ue)}}Ih(a,T,O,P,q,ae,y,p);return;case"select":J=T=O=K=null;for(y in l)if(P=l[y],l.hasOwnProperty(y)&&P!=null)switch(y){case"value":break;case"multiple":J=P;default:d.hasOwnProperty(y)||yt(a,s,y,null,d,P)}for(p in d)if(y=d[p],P=l[p],d.hasOwnProperty(p)&&(y!=null||P!=null))switch(p){case"value":K=y;break;case"defaultValue":O=y;break;case"multiple":T=y;default:y!==P&&yt(a,s,p,y,d,P)}s=O,l=T,d=J,K!=null?$i(a,!!l,K,!1):!!d!=!!l&&(s!=null?$i(a,!!l,s,!0):$i(a,!!l,l?[]:"",!1));return;case"textarea":J=K=null;for(O in l)if(p=l[O],l.hasOwnProperty(O)&&p!=null&&!d.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:yt(a,s,O,null,d,p)}for(T in d)if(p=d[T],y=l[T],d.hasOwnProperty(T)&&(p!=null||y!=null))switch(T){case"value":K=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==y&&yt(a,s,T,p,d,y)}X0(a,K,J);return;case"option":for(var Ie in l)if(K=l[Ie],l.hasOwnProperty(Ie)&&K!=null&&!d.hasOwnProperty(Ie))switch(Ie){case"selected":a.selected=!1;break;default:yt(a,s,Ie,null,d,K)}for(P in d)if(K=d[P],J=l[P],d.hasOwnProperty(P)&&K!==J&&(K!=null||J!=null))switch(P){case"selected":a.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:yt(a,s,P,K,d,J)}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 Me in l)K=l[Me],l.hasOwnProperty(Me)&&K!=null&&!d.hasOwnProperty(Me)&&yt(a,s,Me,null,d,K);for(q in d)if(K=d[q],J=l[q],d.hasOwnProperty(q)&&K!==J&&(K!=null||J!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,s));break;default:yt(a,s,q,K,d,J)}return;default:if(Uh(s)){for(var bt in l)K=l[bt],l.hasOwnProperty(bt)&&K!==void 0&&!d.hasOwnProperty(bt)&&Em(a,s,bt,void 0,d,K);for(ae in d)K=d[ae],J=l[ae],!d.hasOwnProperty(ae)||K===J||K===void 0&&J===void 0||Em(a,s,ae,K,d,J);return}}for(var $ in l)K=l[$],l.hasOwnProperty($)&&K!=null&&!d.hasOwnProperty($)&&yt(a,s,$,null,d,K);for(ue in d)K=d[ue],J=l[ue],!d.hasOwnProperty(ue)||K===J||K==null&&J==null||yt(a,s,ue,K,d,J)}var _m=null,Tm=null;function gd(a){return a.nodeType===9?a:a.ownerDocument}function eS(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tS(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function Cm(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Rm=null;function Nk(){var a=window.event;return a&&a.type==="popstate"?a===Rm?!1:(Rm=a,!0):(Rm=null,!1)}var nS=typeof setTimeout=="function"?setTimeout:void 0,jk=typeof clearTimeout=="function"?clearTimeout:void 0,rS=typeof Promise=="function"?Promise:void 0,kk=typeof queueMicrotask=="function"?queueMicrotask:typeof rS<"u"?function(a){return rS.resolve(null).then(a).catch(Mk)}:nS;function Mk(a){setTimeout(function(){throw a})}function ps(a){return a==="head"}function aS(a,s){var l=s,d=0,p=0;do{var y=l.nextSibling;if(a.removeChild(l),y&&y.nodeType===8)if(l=y.data,l==="/$"){if(0<d&&8>d){l=d;var T=a.ownerDocument;if(l&1&&ac(T.documentElement),l&2&&ac(T.body),l&4)for(l=T.head,ac(l),T=l.firstChild;T;){var O=T.nextSibling,P=T.nodeName;T[Pe]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&T.rel.toLowerCase()==="stylesheet"||l.removeChild(T),T=O}}if(p===0){a.removeChild(y),fc(s);return}p--}else l==="$"||l==="$?"||l==="$!"?p++:d=l.charCodeAt(0)-48;else d=0;l=y}while(l);fc(s)}function Om(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Om(l),Le(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}a.removeChild(l)}}function Dk(a,s,l,d){for(;a.nodeType===1;){var p=l;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(d){if(!a[Pe])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==p.rel||a.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||a.getAttribute("title")!==(p.title==null?null:p.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(p.src==null?null:p.src)||a.getAttribute("type")!==(p.type==null?null:p.type)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=kr(a.nextSibling),a===null)break}return null}function Pk(a,s,l){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=kr(a.nextSibling),a===null))return null;return a}function Am(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function Lk(a,s){var l=a.ownerDocument;if(a.data!=="$?"||l.readyState==="complete")s();else{var d=function(){s(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),a._reactRetry=d}}function kr(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return a}var Nm=null;function sS(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var l=a.data;if(l==="$"||l==="$!"||l==="$?"){if(s===0)return a;s--}else l==="/$"&&s++}a=a.previousSibling}return null}function iS(a,s,l){switch(s=gd(l),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function ac(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Le(a)}var vr=new Map,oS=new Set;function vd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ka=W.d;W.d={f:Ik,r:zk,D:Uk,C:$k,L:Bk,m:Hk,X:qk,S:Fk,M:Vk};function Ik(){var a=ka.f(),s=ld();return a||s}function zk(a){var s=it(a);s!==null&&s.tag===5&&s.type==="form"?Rw(s):ka.r(a)}var vo=typeof document>"u"?null:document;function lS(a,s,l){var d=vo;if(d&&typeof s=="string"&&s){var p=ur(s);p='link[rel="'+a+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),oS.has(p)||(oS.add(p),a={rel:a,crossOrigin:l,href:s},d.querySelector(p)===null&&(s=d.createElement("link"),cn(s,"link",a),lt(s),d.head.appendChild(s)))}}function Uk(a){ka.D(a),lS("dns-prefetch",a,null)}function $k(a,s){ka.C(a,s),lS("preconnect",a,s)}function Bk(a,s,l){ka.L(a,s,l);var d=vo;if(d&&a&&s){var p='link[rel="preload"][as="'+ur(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+ur(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+ur(l.imageSizes)+'"]')):p+='[href="'+ur(a)+'"]';var y=p;switch(s){case"style":y=yo(a);break;case"script":y=bo(a)}vr.has(y)||(a=m({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:a,as:s},l),vr.set(y,a),d.querySelector(p)!==null||s==="style"&&d.querySelector(sc(y))||s==="script"&&d.querySelector(ic(y))||(s=d.createElement("link"),cn(s,"link",a),lt(s),d.head.appendChild(s)))}}function Hk(a,s){ka.m(a,s);var l=vo;if(l&&a){var d=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+ur(d)+'"][href="'+ur(a)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=bo(a)}if(!vr.has(y)&&(a=m({rel:"modulepreload",href:a},s),vr.set(y,a),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ic(y)))return}d=l.createElement("link"),cn(d,"link",a),lt(d),l.head.appendChild(d)}}}function Fk(a,s,l){ka.S(a,s,l);var d=vo;if(d&&a){var p=jt(d).hoistableStyles,y=yo(a);s=s||"default";var T=p.get(y);if(!T){var O={loading:0,preload:null};if(T=d.querySelector(sc(y)))O.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":s},l),(l=vr.get(y))&&jm(a,l);var P=T=d.createElement("link");lt(P),cn(P,"link",a),P._p=new Promise(function(q,ae){P.onload=q,P.onerror=ae}),P.addEventListener("load",function(){O.loading|=1}),P.addEventListener("error",function(){O.loading|=2}),O.loading|=4,yd(T,s,d)}T={type:"stylesheet",instance:T,count:1,state:O},p.set(y,T)}}}function qk(a,s){ka.X(a,s);var l=vo;if(l&&a){var d=jt(l).hoistableScripts,p=bo(a),y=d.get(p);y||(y=l.querySelector(ic(p)),y||(a=m({src:a,async:!0},s),(s=vr.get(p))&&km(a,s),y=l.createElement("script"),lt(y),cn(y,"link",a),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Vk(a,s){ka.M(a,s);var l=vo;if(l&&a){var d=jt(l).hoistableScripts,p=bo(a),y=d.get(p);y||(y=l.querySelector(ic(p)),y||(a=m({src:a,async:!0,type:"module"},s),(s=vr.get(p))&&km(a,s),y=l.createElement("script"),lt(y),cn(y,"link",a),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function cS(a,s,l,d){var p=(p=ie.current)?vd(p):null;if(!p)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=yo(l.href),l=jt(p).hoistableStyles,d=l.get(s),d||(d={type:"style",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){a=yo(l.href);var y=jt(p).hoistableStyles,T=y.get(a);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,T),(y=p.querySelector(sc(a)))&&!y._p&&(T.instance=y,T.state.loading=5),vr.has(a)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},vr.set(a,l),y||Gk(p,a,l,T.state))),s&&d===null)throw Error(r(528,""));return T}if(s&&d!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=bo(l),l=jt(p).hoistableScripts,d=l.get(s),d||(d={type:"script",instance:null,count:0,state:null},l.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function yo(a){return'href="'+ur(a)+'"'}function sc(a){return'link[rel="stylesheet"]['+a+"]"}function uS(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function Gk(a,s,l,d){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=a.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),cn(s,"link",l),lt(s),a.head.appendChild(s))}function bo(a){return'[src="'+ur(a)+'"]'}function ic(a){return"script[async]"+a}function dS(a,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var d=a.querySelector('style[data-href~="'+ur(l.href)+'"]');if(d)return s.instance=d,lt(d),d;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(a.ownerDocument||a).createElement("style"),lt(d),cn(d,"style",p),yd(d,l.precedence,a),s.instance=d;case"stylesheet":p=yo(l.href);var y=a.querySelector(sc(p));if(y)return s.state.loading|=4,s.instance=y,lt(y),y;d=uS(l),(p=vr.get(p))&&jm(d,p),y=(a.ownerDocument||a).createElement("link"),lt(y);var T=y;return T._p=new Promise(function(O,P){T.onload=O,T.onerror=P}),cn(y,"link",d),s.state.loading|=4,yd(y,l.precedence,a),s.instance=y;case"script":return y=bo(l.src),(p=a.querySelector(ic(y)))?(s.instance=p,lt(p),p):(d=l,(p=vr.get(y))&&(d=m({},l),km(d,p)),a=a.ownerDocument||a,p=a.createElement("script"),lt(p),cn(p,"link",d),a.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,yd(d,l.precedence,a));return s.instance}function yd(a,s,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,T=0;T<d.length;T++){var O=d[T];if(O.dataset.precedence===s)y=O;else if(y!==p)break}y?y.parentNode.insertBefore(a,y.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(a,s.firstChild))}function jm(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function km(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var bd=null;function fS(a,s,l){if(bd===null){var d=new Map,p=bd=new Map;p.set(l,d)}else p=bd,d=p.get(l),d||(d=new Map,p.set(l,d));if(d.has(a))return d;for(d.set(a,null),l=l.getElementsByTagName(a),p=0;p<l.length;p++){var y=l[p];if(!(y[Pe]||y[le]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var T=y.getAttribute(s)||"";T=a+T;var O=d.get(T);O?O.push(y):d.set(T,[y])}}return d}function hS(a,s,l){a=a.ownerDocument||a,a.head.insertBefore(l,s==="title"?a.querySelector("head > title"):null)}function Yk(a,s,l){if(l===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function pS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var oc=null;function Wk(){}function Kk(a,s,l){if(oc===null)throw Error(r(475));var d=oc;if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=yo(l.href),y=a.querySelector(sc(p));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(d.count++,d=wd.bind(d),a.then(d,d)),s.state.loading|=4,s.instance=y,lt(y);return}y=a.ownerDocument||a,l=uS(l),(p=vr.get(p))&&jm(l,p),y=y.createElement("link"),lt(y);var T=y;T._p=new Promise(function(O,P){T.onload=O,T.onerror=P}),cn(y,"link",l),s.instance=y}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(d.count++,s=wd.bind(d),a.addEventListener("load",s),a.addEventListener("error",s))}}function Zk(){if(oc===null)throw Error(r(475));var a=oc;return a.stylesheets&&a.count===0&&Mm(a,a.stylesheets),0<a.count?function(s){var l=setTimeout(function(){if(a.stylesheets&&Mm(a,a.stylesheets),a.unsuspend){var d=a.unsuspend;a.unsuspend=null,d()}},6e4);return a.unsuspend=s,function(){a.unsuspend=null,clearTimeout(l)}}:null}function wd(){if(this.count--,this.count===0){if(this.stylesheets)Mm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xd=null;function Mm(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xd=new Map,s.forEach(Qk,a),xd=null,wd.call(a))}function Qk(a,s){if(!(s.state.loading&4)){var l=xd.get(a);if(l)var d=l.get(null);else{l=new Map,xd.set(a,l);for(var p=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var T=p[y];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),d=T)}d&&l.set(null,d)}p=s.instance,T=p.getAttribute("data-precedence"),y=l.get(T)||d,y===d&&l.set(null,p),l.set(T,p),this.count++,d=wd.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(p,a.firstChild)),s.state.loading|=4}}var lc={$$typeof:A,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function Xk(a,s,l,d,p,y,T,O){this.tag=1,this.containerInfo=a,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=Ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.hiddenUpdates=Ya(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function mS(a,s,l,d,p,y,T,O,P,q,ae,ue){return a=new Xk(a,s,l,T,O,P,q,ue),s=1,y===!0&&(s|=24),y=qn(3,null,null,s),a.current=y,y.stateNode=a,s=pp(),s.refCount++,a.pooledCache=s,s.refCount++,y.memoizedState={element:d,isDehydrated:l,cache:s},yp(y),a}function gS(a){return a?(a=Ki,a):Ki}function vS(a,s,l,d,p,y){p=gS(p),d.context===null?d.context=p:d.pendingContext=p,d=ts(s),d.payload={element:l},y=y===void 0?null:y,y!==null&&(d.callback=y),l=ns(a,d,s),l!==null&&(Kn(l,a,s),zl(l,a,s))}function yS(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var l=a.retryLane;a.retryLane=l!==0&&l<s?l:s}}function Dm(a,s){yS(a,s),(a=a.alternate)&&yS(a,s)}function bS(a){if(a.tag===13){var s=Wi(a,67108864);s!==null&&Kn(s,a,67108864),Dm(a,67108864)}}var Sd=!0;function Jk(a,s,l,d){var p=M.T;M.T=null;var y=W.p;try{W.p=2,Pm(a,s,l,d)}finally{W.p=y,M.T=p}}function eM(a,s,l,d){var p=M.T;M.T=null;var y=W.p;try{W.p=8,Pm(a,s,l,d)}finally{W.p=y,M.T=p}}function Pm(a,s,l,d){if(Sd){var p=Lm(d);if(p===null)Sm(a,s,d,Ed,l),xS(a,d);else if(nM(p,a,s,l,d))d.stopPropagation();else if(xS(a,d),s&4&&-1<tM.indexOf(a)){for(;p!==null;){var y=it(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var T=ir(y.pendingLanes);if(T!==0){var O=y;for(O.pendingLanes|=2,O.entangledLanes|=2;T;){var P=1<<31-Yt(T);O.entanglements[1]|=P,T&=~P}na(y),(mt&6)===0&&(id=Nt()+500,tc(0))}}break;case 13:O=Wi(y,2),O!==null&&Kn(O,y,2),ld(),Dm(y,2)}if(y=Lm(d),y===null&&Sm(a,s,d,Ed,l),y===p)break;p=y}p!==null&&d.stopPropagation()}else Sm(a,s,d,null,l)}}function Lm(a){return a=Bh(a),Im(a)}var Ed=null;function Im(a){if(Ed=null,a=$e(a),a!==null){var s=o(a);if(s===null)a=null;else{var l=s.tag;if(l===13){if(a=c(s),a!==null)return a;a=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return Ed=a,null}function wS(a){switch(a){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(Mt()){case pa:return 2;case ma:return 8;case en:case xn:return 32;case tn:return 268435456;default:return 32}default:return 32}}var zm=!1,ms=null,gs=null,vs=null,cc=new Map,uc=new Map,ys=[],tM="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 xS(a,s){switch(a){case"focusin":case"focusout":ms=null;break;case"dragenter":case"dragleave":gs=null;break;case"mouseover":case"mouseout":vs=null;break;case"pointerover":case"pointerout":cc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":uc.delete(s.pointerId)}}function dc(a,s,l,d,p,y){return a===null||a.nativeEvent!==y?(a={blockedOn:s,domEventName:l,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},s!==null&&(s=it(s),s!==null&&bS(s)),a):(a.eventSystemFlags|=d,s=a.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),a)}function nM(a,s,l,d,p){switch(s){case"focusin":return ms=dc(ms,a,s,l,d,p),!0;case"dragenter":return gs=dc(gs,a,s,l,d,p),!0;case"mouseover":return vs=dc(vs,a,s,l,d,p),!0;case"pointerover":var y=p.pointerId;return cc.set(y,dc(cc.get(y)||null,a,s,l,d,p)),!0;case"gotpointercapture":return y=p.pointerId,uc.set(y,dc(uc.get(y)||null,a,s,l,d,p)),!0}return!1}function SS(a){var s=$e(a.target);if(s!==null){var l=o(s);if(l!==null){if(s=l.tag,s===13){if(s=c(l),s!==null){a.blockedOn=s,B(a.priority,function(){if(l.tag===13){var d=Wn();d=rt(d);var p=Wi(l,d);p!==null&&Kn(p,l,d),Dm(l,d)}});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){a.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}a.blockedOn=null}function _d(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var l=Lm(a.nativeEvent);if(l===null){l=a.nativeEvent;var d=new l.constructor(l.type,l);$h=d,l.target.dispatchEvent(d),$h=null}else return s=it(l),s!==null&&bS(s),a.blockedOn=l,!1;s.shift()}return!0}function ES(a,s,l){_d(a)&&l.delete(s)}function rM(){zm=!1,ms!==null&&_d(ms)&&(ms=null),gs!==null&&_d(gs)&&(gs=null),vs!==null&&_d(vs)&&(vs=null),cc.forEach(ES),uc.forEach(ES)}function Td(a,s){a.blockedOn===s&&(a.blockedOn=null,zm||(zm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,rM)))}var Cd=null;function _S(a){Cd!==a&&(Cd=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Cd===a&&(Cd=null);for(var s=0;s<a.length;s+=3){var l=a[s],d=a[s+1],p=a[s+2];if(typeof d!="function"){if(Im(d||l)===null)continue;break}var y=it(l);y!==null&&(a.splice(s,3),s-=3,Ip(y,{pending:!0,data:p,method:l.method,action:d},d,p))}}))}function fc(a){function s(P){return Td(P,a)}ms!==null&&Td(ms,a),gs!==null&&Td(gs,a),vs!==null&&Td(vs,a),cc.forEach(s),uc.forEach(s);for(var l=0;l<ys.length;l++){var d=ys[l];d.blockedOn===a&&(d.blockedOn=null)}for(;0<ys.length&&(l=ys[0],l.blockedOn===null);)SS(l),l.blockedOn===null&&ys.shift();if(l=(a.ownerDocument||a).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var p=l[d],y=l[d+1],T=p[he]||null;if(typeof y=="function")T||_S(l);else if(T){var O=null;if(y&&y.hasAttribute("formAction")){if(p=y,T=y[he]||null)O=T.formAction;else if(Im(p)!==null)continue}else O=T.action;typeof O=="function"?l[d+1]=O:(l.splice(d,3),d-=3),_S(l)}}}function Um(a){this._internalRoot=a}Rd.prototype.render=Um.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,d=Wn();vS(l,d,a,s,null,null)},Rd.prototype.unmount=Um.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;vS(a.current,2,null,a,null,null),ld(),s[Se]=null}};function Rd(a){this._internalRoot=a}Rd.prototype.unstable_scheduleHydration=function(a){if(a){var s=I();a={blockedOn:null,target:a,priority:s};for(var l=0;l<ys.length&&s!==0&&s<ys[l].priority;l++);ys.splice(l,0,a),l===0&&SS(a)}};var TS=e.version;if(TS!=="19.1.0")throw Error(r(527,TS,"19.1.0"));W.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=f(s),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var aM={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Od=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Od.isDisabled&&Od.supportsFiber)try{wt=Od.inject(aM),ft=Od}catch{}}return pc.createRoot=function(a,s){if(!i(a))throw Error(r(299));var l=!1,d="",p=Bw,y=Hw,T=Fw,O=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(O=s.unstable_transitionCallbacks)),s=mS(a,1,!1,null,null,l,d,p,y,T,O,null),a[Se]=s.current,xm(a),new Um(s)},pc.hydrateRoot=function(a,s,l){if(!i(a))throw Error(r(299));var d=!1,p="",y=Bw,T=Hw,O=Fw,P=null,q=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(O=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(P=l.unstable_transitionCallbacks),l.formState!==void 0&&(q=l.formState)),s=mS(a,1,!0,s,l??null,d,p,y,T,O,P,q),s.context=gS(null),l=s.current,d=Wn(),d=rt(d),p=ts(d),p.callback=null,ns(l,p,d),l=d,s.current.lanes=l,Rr(s,l),na(s),a[Se]=s.current,xm(a),new Rd(s)},pc.version="19.1.0",pc}var LS;function vM(){if(LS)return Bm.exports;LS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Bm.exports=gM(),Bm.exports}var yM=vM(),b=Zv();const fe=Kv(b),j_=iM({__proto__:null,default:fe},[b]);var mc={},IS;function bM(){if(IS)return mc;IS=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.parse=c,mc.serialize=h;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const x=function(){};return x.prototype=Object.create(null),x})();function c(x,w){const S=new o,E=x.length;if(E<2)return S;const _=w?.decode||m;let C=0;do{const R=x.indexOf("=",C);if(R===-1)break;const A=x.indexOf(";",C),k=A===-1?E:A;if(R>k){C=x.lastIndexOf(";",R-1)+1;continue}const D=u(x,C,R),N=f(x,R,D),L=x.slice(D,N);if(S[L]===void 0){let Z=u(x,R+1,k),Q=f(x,k,Z);const te=_(x.slice(Z,Q));S[L]=te}C=k+1}while(C<E);return S}function u(x,w,S){do{const E=x.charCodeAt(w);if(E!==32&&E!==9)return w}while(++w<S);return S}function f(x,w,S){for(;w>S;){const E=x.charCodeAt(--w);if(E!==32&&E!==9)return w+1}return S}function h(x,w,S){const E=S?.encode||encodeURIComponent;if(!t.test(x))throw new TypeError(`argument name is invalid: ${x}`);const _=E(w);if(!e.test(_))throw new TypeError(`argument val is invalid: ${w}`);let C=x+"="+_;if(!S)return C;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);C+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);C+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);C+="; Path="+S.path}if(S.expires){if(!v(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);C+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(C+="; HttpOnly"),S.secure&&(C+="; Secure"),S.partitioned&&(C+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":C+="; Priority=Low";break;case"medium":C+="; Priority=Medium";break;case"high":C+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":C+="; SameSite=Strict";break;case"lax":C+="; SameSite=Lax";break;case"none":C+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return C}function m(x){if(x.indexOf("%")===-1)return x;try{return decodeURIComponent(x)}catch{return x}}function v(x){return i.call(x)==="[object Date]"}return mc}bM();/**
 * react-router v7.6.3
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var k_=t=>{throw TypeError(t)},wM=(t,e,n)=>e.has(t)||k_("Cannot "+n),Gm=(t,e,n)=>(wM(t,e,"read from private field"),n?n.call(t):e.get(t)),xM=(t,e,n)=>e.has(t)?k_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),zS="popstate";function SM(t={}){function e(r,i){let{pathname:o,search:c,hash:u}=r.location;return Fc("",{pathname:o,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ds(i)}return _M(e,n,null,t)}function tt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ht(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function EM(){return Math.random().toString(36).substring(2,10)}function US(t,e){return{usr:t.state,key:t.key,idx:e}}function Fc(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Is(e):e,state:n,key:e&&e.key||r||EM()}}function Ds({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Is(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function _M(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,c=i.history,u="POP",f=null,h=m();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function m(){return(c.state||{idx:null}).idx}function v(){u="POP";let _=m(),C=_==null?null:_-h;h=_,f&&f({action:u,location:E.location,delta:C})}function x(_,C){u="PUSH";let R=Fc(E.location,_,C);h=m()+1;let A=US(R,h),k=E.createHref(R);try{c.pushState(A,"",k)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(k)}o&&f&&f({action:u,location:E.location,delta:1})}function w(_,C){u="REPLACE";let R=Fc(E.location,_,C);h=m();let A=US(R,h),k=E.createHref(R);c.replaceState(A,"",k),o&&f&&f({action:u,location:E.location,delta:0})}function S(_){return M_(_)}let E={get action(){return u},get location(){return t(i,c)},listen(_){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(zS,v),f=_,()=>{i.removeEventListener(zS,v),f=null}},createHref(_){return e(i,_)},createURL:S,encodeLocation(_){let C=S(_);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:w,go(_){return c.go(_)}};return E}function M_(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),tt(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Ds(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Cc,$S=class{constructor(t){if(xM(this,Cc,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(Gm(this,Cc).has(t))return Gm(this,Cc).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){Gm(this,Cc).set(t,e)}};Cc=new WeakMap;var TM=new Set(["lazy","caseSensitive","path","id","index","children"]);function CM(t){return TM.has(t)}var RM=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function OM(t){return RM.has(t)}function AM(t){return t.index===!0}function hf(t,e,n=[],r={}){return t.map((i,o)=>{let c=[...n,String(o)],u=typeof i.id=="string"?i.id:c.join("-");if(tt(i.index!==!0||!i.children,"Cannot specify children on an index route"),tt(!r[u],`Found a route id collision on id "${u}".  Route id's must be globally unique within Data Router usages`),AM(i)){let f={...i,...e(i),id:u};return r[u]=f,f}else{let f={...i,...e(i),id:u,children:void 0};return r[u]=f,i.children&&(f.children=hf(i.children,e,c,r)),f}})}function Os(t,e,n="/"){return Qd(t,e,n,!1)}function Qd(t,e,n,r){let i=typeof e=="string"?Is(e):e,o=_r(i.pathname||"/",n);if(o==null)return null;let c=D_(t);jM(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let h=HM(o);u=$M(c[f],h,r)}return u}function NM(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function D_(t,e=[],n=[],r=""){let i=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(tt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let h=oa([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(tt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),D_(o.children,e,m,h)),!(o.path==null&&!o.index)&&e.push({path:h,score:zM(h,o.index),routesMeta:m})};return t.forEach((o,c)=>{if(o.path===""||!o.path?.includes("?"))i(o,c);else for(let u of P_(o.path))i(o,c,u)}),e}function P_(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let c=P_(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),i&&u.push(...c),u.map(f=>t.startsWith("/")&&f===""?"/":f)}function jM(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:UM(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var kM=/^:[\w-]+$/,MM=3,DM=2,PM=1,LM=10,IM=-2,BS=t=>t==="*";function zM(t,e){let n=t.split("/"),r=n.length;return n.some(BS)&&(r+=IM),e&&(r+=DM),n.filter(i=>!BS(i)).reduce((i,o)=>i+(kM.test(o)?MM:o===""?PM:LM),r)}function UM(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function $M(t,e,n=!1){let{routesMeta:r}=t,i={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],h=u===r.length-1,m=o==="/"?e:e.slice(o.length)||"/",v=pf({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},m),x=f.route;if(!v&&h&&n&&!r[r.length-1].route.index&&(v=pf({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!v)return null;Object.assign(i,v.params),c.push({params:i,pathname:oa([o,v.pathname]),pathnameBase:VM(oa([o,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(o=oa([o,v.pathnameBase]))}return c}function pf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=BM(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],c=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((h,{paramName:m,isOptional:v},x)=>{if(m==="*"){let S=u[x]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const w=u[x];return v&&!w?h[m]=void 0:h[m]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:t}}function BM(t,e=!1,n=!0){Ht(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function HM(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ht(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function _r(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function FM(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Is(t):t;return{pathname:n?n.startsWith("/")?n:qM(n,e):e,search:GM(r),hash:YM(i)}}function qM(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Ym(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function L_(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Qv(t){let e=L_(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Xv(t,e,n,r=!1){let i;typeof t=="string"?i=Is(t):(i={...t},tt(!i.pathname||!i.pathname.includes("?"),Ym("?","pathname","search",i)),tt(!i.pathname||!i.pathname.includes("#"),Ym("#","pathname","hash",i)),tt(!i.search||!i.search.includes("#"),Ym("#","search","hash",i)));let o=t===""||i.pathname==="",c=o?"/":i.pathname,u;if(c==null)u=n;else{let v=e.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;i.pathname=x.join("/")}u=v>=0?e[v]:"/"}let f=FM(i,u),h=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var oa=t=>t.join("/").replace(/\/\/+/g,"/"),VM=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),GM=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,YM=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,mf=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function qc(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var I_=["POST","PUT","PATCH","DELETE"],WM=new Set(I_),KM=["GET",...I_],ZM=new Set(KM),QM=new Set([301,302,303,307,308]),XM=new Set([307,308]),Wm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},JM={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Jv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eD=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),z_="remix-router-transitions",U_=Symbol("ResetLoaderData");function tD(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";tt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=t.hydrationRouteProperties||[],i=t.mapRouteProperties||eD,o={},c=hf(t.routes,i,void 0,o),u,f=t.basename||"/",h=t.dataStrategy||iD,m={unstable_middleware:!1,...t.future},v=null,x=new Set,w=null,S=null,E=null,_=t.hydrationData!=null,C=Os(c,t.history.location,f),R=!1,A=null,k;if(C==null&&!t.patchRoutesOnNavigation){let I=br(404,{pathname:t.history.location.pathname}),{matches:B,route:Y}=JS(c);k=!0,C=B,A={[Y.id]:I}}else if(C&&!t.hydrationData&&va(C,c,t.history.location.pathname).active&&(C=null),C)if(C.some(I=>I.route.lazy))k=!1;else if(!C.some(I=>I.route.loader))k=!0;else{let I=t.hydrationData?t.hydrationData.loaderData:null,B=t.hydrationData?t.hydrationData.errors:null;if(B){let Y=C.findIndex(le=>B[le.route.id]!==void 0);k=C.slice(0,Y+1).every(le=>!Ig(le.route,I,B))}else k=C.every(Y=>!Ig(Y.route,I,B))}else{k=!1,C=[];let I=va(null,c,t.history.location.pathname);I.active&&I.matches&&(R=!0,C=I.matches)}let D,N={historyAction:t.history.action,location:t.history.location,matches:C,initialized:k,navigation:Wm,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||A,fetchers:new Map,blockers:new Map},L="POP",Z=!1,Q,te=!1,ce=new Map,se=null,ge=!1,pe=!1,ve=new Set,M=new Map,W=0,X=-1,H=new Map,j=new Set,V=new Map,re=new Map,U=new Set,ee=new Map,de,ie=null;function G(){if(v=t.history.listen(({action:I,location:B,delta:Y})=>{if(de){de(),de=void 0;return}Ht(ee.size===0||Y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=Ui({currentLocation:N.location,nextLocation:B,historyAction:I});if(le&&Y!=null){let he=new Promise(Se=>{de=Se});t.history.go(Y*-1),or(le,{state:"blocked",location:B,proceed(){or(le,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),he.then(()=>t.history.go(Y))},reset(){let Se=new Map(N.blockers);Se.set(le,gc),xe({blockers:Se})}});return}return st(I,B)}),n){vD(e,ce);let I=()=>yD(e,ce);e.addEventListener("pagehide",I),se=()=>e.removeEventListener("pagehide",I)}return N.initialized||st("POP",N.location,{initialHydration:!0}),D}function me(){v&&v(),se&&se(),x.clear(),Q&&Q.abort(),N.fetchers.forEach((I,B)=>Yt(B)),N.blockers.forEach((I,B)=>Nn(B))}function Ce(I){return x.add(I),()=>x.delete(I)}function xe(I,B={}){N={...N,...I};let Y=[],le=[];N.fetchers.forEach((he,Se)=>{he.state==="idle"&&(U.has(Se)?Y.push(Se):le.push(Se))}),U.forEach(he=>{!N.fetchers.has(he)&&!M.has(he)&&Y.push(he)}),[...x].forEach(he=>he(N,{deletedFetchers:Y,viewTransitionOpts:B.viewTransitionOpts,flushSync:B.flushSync===!0})),Y.forEach(he=>Yt(he)),le.forEach(he=>N.fetchers.delete(he))}function Ne(I,B,{flushSync:Y}={}){let le=N.actionData!=null&&N.navigation.formMethod!=null&&Xn(N.navigation.formMethod)&&N.navigation.state==="loading"&&I.state?._isRedirect!==!0,he;B.actionData?Object.keys(B.actionData).length>0?he=B.actionData:he=null:le?he=N.actionData:he=null;let Se=B.loaderData?QS(N.loaderData,B.loaderData,B.matches||[],B.errors):N.loaderData,ke=N.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((Te,Pe)=>ke.set(Pe,gc)));let Ee=Z===!0||N.navigation.formMethod!=null&&Xn(N.navigation.formMethod)&&I.state?._isRedirect!==!0;u&&(c=u,u=void 0),ge||L==="POP"||(L==="PUSH"?t.history.push(I,I.state):L==="REPLACE"&&t.history.replace(I,I.state));let Ae;if(L==="POP"){let Te=ce.get(N.location.pathname);Te&&Te.has(I.pathname)?Ae={currentLocation:N.location,nextLocation:I}:ce.has(I.pathname)&&(Ae={currentLocation:I,nextLocation:N.location})}else if(te){let Te=ce.get(N.location.pathname);Te?Te.add(I.pathname):(Te=new Set([I.pathname]),ce.set(N.location.pathname,Te)),Ae={currentLocation:N.location,nextLocation:I}}xe({...B,actionData:he,loaderData:Se,historyAction:L,location:I,initialized:!0,navigation:Wm,revalidation:"idle",restoreScrollPosition:Hn(I,B.matches||N.matches),preventScrollReset:Ee,blockers:ke},{viewTransitionOpts:Ae,flushSync:Y===!0}),L="POP",Z=!1,te=!1,ge=!1,pe=!1,ie?.resolve(),ie=null}async function He(I,B){if(typeof I=="number"){t.history.go(I);return}let Y=Lg(N.location,N.matches,f,I,B?.fromRouteId,B?.relative),{path:le,submission:he,error:Se}=HS(!1,Y,B),ke=N.location,Ee=Fc(N.location,le,B&&B.state);Ee={...Ee,...t.history.encodeLocation(Ee)};let Ae=B&&B.replace!=null?B.replace:void 0,Te="PUSH";Ae===!0?Te="REPLACE":Ae===!1||he!=null&&Xn(he.formMethod)&&he.formAction===N.location.pathname+N.location.search&&(Te="REPLACE");let Pe=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,Le=(B&&B.flushSync)===!0,$e=Ui({currentLocation:ke,nextLocation:Ee,historyAction:Te});if($e){or($e,{state:"blocked",location:Ee,proceed(){or($e,{state:"proceeding",proceed:void 0,reset:void 0,location:Ee}),He(I,B)},reset(){let it=new Map(N.blockers);it.set($e,gc),xe({blockers:it})}});return}await st(Te,Ee,{submission:he,pendingError:Se,preventScrollReset:Pe,replace:B&&B.replace,enableViewTransition:B&&B.viewTransition,flushSync:Le})}function Be(){ie||(ie=bD()),qs(),xe({revalidation:"loading"});let I=ie.promise;return N.navigation.state==="submitting"?I:N.navigation.state==="idle"?(st(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),I):(st(L||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:te===!0}),I)}async function st(I,B,Y){Q&&Q.abort(),Q=null,L=I,ge=(Y&&Y.startUninterruptedRevalidation)===!0,Rr(N.location,N.matches),Z=(Y&&Y.preventScrollReset)===!0,te=(Y&&Y.enableViewTransition)===!0;let le=u||c,he=Y&&Y.overrideNavigation,Se=Y?.initialHydration&&N.matches&&N.matches.length>0&&!R?N.matches:Os(le,B,f),ke=(Y&&Y.flushSync)===!0;if(Se&&N.initialized&&!pe&&fD(N.location,B)&&!(Y&&Y.submission&&Xn(Y.submission.formMethod))){Ne(B,{matches:Se},{flushSync:ke});return}let Ee=va(Se,le,B.pathname);if(Ee.active&&Ee.matches&&(Se=Ee.matches),!Se){let{error:jt,notFoundMatches:lt,route:nt}=ga(B.pathname);Ne(B,{matches:lt,loaderData:{},errors:{[nt.id]:jt}},{flushSync:ke});return}Q=new AbortController;let Ae=Io(t.history,B,Q.signal,Y&&Y.submission),Te=new $S(t.unstable_getContext?await t.unstable_getContext():void 0),Pe;if(Y&&Y.pendingError)Pe=[gi(Se).route.id,{type:"error",error:Y.pendingError}];else if(Y&&Y.submission&&Xn(Y.submission.formMethod)){let jt=await bn(Ae,B,Y.submission,Se,Te,Ee.active,Y&&Y.initialHydration===!0,{replace:Y.replace,flushSync:ke});if(jt.shortCircuited)return;if(jt.pendingActionResult){let[lt,nt]=jt.pendingActionResult;if(Qn(nt)&&qc(nt.error)&&nt.error.status===404){Q=null,Ne(B,{matches:jt.matches,loaderData:{},errors:{[lt]:nt.error}});return}}Se=jt.matches||Se,Pe=jt.pendingActionResult,he=Km(B,Y.submission),ke=!1,Ee.active=!1,Ae=Io(t.history,Ae.url,Ae.signal)}let{shortCircuited:Le,matches:$e,loaderData:it,errors:_t}=await wn(Ae,B,Se,Te,Ee.active,he,Y&&Y.submission,Y&&Y.fetcherSubmission,Y&&Y.replace,Y&&Y.initialHydration===!0,ke,Pe);Le||(Q=null,Ne(B,{matches:$e||Se,...XS(Pe),loaderData:it,errors:_t}))}async function bn(I,B,Y,le,he,Se,ke,Ee={}){qs();let Ae=mD(B,Y);if(xe({navigation:Ae},{flushSync:Ee.flushSync===!0}),Se){let Le=await je(le,B.pathname,I.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){let $e=gi(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[$e,{type:"error",error:Le.error}]}}else if(Le.matches)le=Le.matches;else{let{notFoundMatches:$e,error:it,route:_t}=ga(B.pathname);return{matches:$e,pendingActionResult:[_t.id,{type:"error",error:it}]}}}let Te,Pe=Rc(le,B);if(!Pe.route.action&&!Pe.route.lazy)Te={type:"error",error:br(405,{method:I.method,pathname:B.pathname,routeId:Pe.route.id})};else{let Le=qo(i,o,I,le,Pe,ke?[]:r,he),$e=await tn(I,Le,he,null);if(Te=$e[Pe.route.id],!Te){for(let it of le)if($e[it.route.id]){Te=$e[it.route.id];break}}if(I.signal.aborted)return{shortCircuited:!0}}if(bi(Te)){let Le;return Ee&&Ee.replace!=null?Le=Ee.replace:Le=WS(Te.response.headers.get("Location"),new URL(I.url),f)===N.location.pathname+N.location.search,await xn(I,Te,!0,{submission:Y,replace:Le}),{shortCircuited:!0}}if(Qn(Te)){let Le=gi(le,Pe.route.id);return(Ee&&Ee.replace)!==!0&&(L="PUSH"),{matches:le,pendingActionResult:[Le.route.id,Te,Pe.route.id]}}return{matches:le,pendingActionResult:[Pe.route.id,Te]}}async function wn(I,B,Y,le,he,Se,ke,Ee,Ae,Te,Pe,Le){let $e=Se||Km(B,ke),it=ke||Ee||t1($e),_t=!ge&&!Te;if(he){if(_t){let fn=Nt(Le);xe({navigation:$e,...fn!==void 0?{actionData:fn}:{}},{flushSync:Pe})}let Ze=await je(Y,B.pathname,I.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){let fn=gi(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,loaderData:{},errors:{[fn]:Ze.error}}}else if(Ze.matches)Y=Ze.matches;else{let{error:fn,notFoundMatches:Or,route:Ar}=ga(B.pathname);return{matches:Or,loaderData:{},errors:{[Ar.id]:fn}}}}let jt=u||c,{dsMatches:lt,revalidatingFetchers:nt}=FS(I,le,i,o,t.history,N,Y,it,B,Te?[]:r,Te===!0,pe,ve,U,V,j,jt,f,t.patchRoutesOnNavigation!=null,Le);if(X=++W,!t.dataStrategy&&!lt.some(Ze=>Ze.shouldLoad)&&nt.length===0){let Ze=Cr();return Ne(B,{matches:Y,loaderData:{},errors:Le&&Qn(Le[1])?{[Le[0]]:Le[1].error}:null,...XS(Le),...Ze?{fetchers:new Map(N.fetchers)}:{}},{flushSync:Pe}),{shortCircuited:!0}}if(_t){let Ze={};if(!he){Ze.navigation=$e;let fn=Nt(Le);fn!==void 0&&(Ze.actionData=fn)}nt.length>0&&(Ze.fetchers=Mt(nt)),xe(Ze,{flushSync:Pe})}nt.forEach(Ze=>{sr(Ze.key),Ze.controller&&M.set(Ze.key,Ze.controller)});let Wa=()=>nt.forEach(Ze=>sr(Ze.key));Q&&Q.signal.addEventListener("abort",Wa);let{loaderResults:Sn,fetcherResults:lr}=await zi(lt,nt,I,le);if(I.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",Wa),nt.forEach(Ze=>M.delete(Ze.key));let jn=Ad(Sn);if(jn)return await xn(I,jn.result,!0,{replace:Ae}),{shortCircuited:!0};if(jn=Ad(lr),jn)return j.add(jn.key),await xn(I,jn.result,!0,{replace:Ae}),{shortCircuited:!0};let{loaderData:Ka,errors:Za}=ZS(N,Y,Sn,Le,nt,lr);Te&&N.errors&&(Za={...N.errors,...Za});let bl=Cr(),cr=An(X),ya=bl||cr||nt.length>0;return{matches:Y,loaderData:Ka,errors:Za,...ya?{fetchers:new Map(N.fetchers)}:{}}}function Nt(I){if(I&&!Qn(I[1]))return{[I[0]]:I[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Mt(I){return I.forEach(B=>{let Y=N.fetchers.get(B.key),le=vc(void 0,Y?Y.data:void 0);N.fetchers.set(B.key,le)}),new Map(N.fetchers)}async function pa(I,B,Y,le){sr(I);let he=(le&&le.flushSync)===!0,Se=u||c,ke=Lg(N.location,N.matches,f,Y,B,le?.relative),Ee=Os(Se,ke,f),Ae=va(Ee,Se,ke);if(Ae.active&&Ae.matches&&(Ee=Ae.matches),!Ee){ft(I,B,br(404,{pathname:ke}),{flushSync:he});return}let{path:Te,submission:Pe,error:Le}=HS(!0,ke,le);if(Le){ft(I,B,Le,{flushSync:he});return}let $e=Rc(Ee,Te),it=new $S(t.unstable_getContext?await t.unstable_getContext():void 0),_t=(le&&le.preventScrollReset)===!0;if(Pe&&Xn(Pe.formMethod)){await ma(I,B,Te,$e,Ee,it,Ae.active,he,_t,Pe);return}V.set(I,{routeId:B,path:Te}),await en(I,B,Te,$e,Ee,it,Ae.active,he,_t,Pe)}async function ma(I,B,Y,le,he,Se,ke,Ee,Ae,Te){qs(),V.delete(I);function Pe(Ct){if(!Ct.route.action&&!Ct.route.lazy){let Qa=br(405,{method:Te.formMethod,pathname:Y,routeId:B});return ft(I,B,Qa,{flushSync:Ee}),!0}return!1}if(!ke&&Pe(le))return;let Le=N.fetchers.get(I);wt(I,gD(Te,Le),{flushSync:Ee});let $e=new AbortController,it=Io(t.history,Y,$e.signal,Te);if(ke){let Ct=await je(he,Y,it.signal,I);if(Ct.type==="aborted")return;if(Ct.type==="error"){ft(I,B,Ct.error,{flushSync:Ee});return}else if(Ct.matches){if(he=Ct.matches,le=Rc(he,Y),Pe(le))return}else{ft(I,B,br(404,{pathname:Y}),{flushSync:Ee});return}}M.set(I,$e);let _t=W,jt=qo(i,o,it,he,le,r,Se),nt=(await tn(it,jt,Se,I))[le.route.id];if(it.signal.aborted){M.get(I)===$e&&M.delete(I);return}if(U.has(I)){if(bi(nt)||Qn(nt)){wt(I,_s(void 0));return}}else{if(bi(nt))if(M.delete(I),X>_t){wt(I,_s(void 0));return}else return j.add(I),wt(I,vc(Te)),xn(it,nt,!1,{fetcherSubmission:Te,preventScrollReset:Ae});if(Qn(nt)){ft(I,B,nt.error);return}}let Wa=N.navigation.location||N.location,Sn=Io(t.history,Wa,$e.signal),lr=u||c,jn=N.navigation.state!=="idle"?Os(lr,N.navigation.location,f):N.matches;tt(jn,"Didn't find any matches after fetcher action");let Ka=++W;H.set(I,Ka);let Za=vc(Te,nt.data);N.fetchers.set(I,Za);let{dsMatches:bl,revalidatingFetchers:cr}=FS(Sn,Se,i,o,t.history,N,jn,Te,Wa,r,!1,pe,ve,U,V,j,lr,f,t.patchRoutesOnNavigation!=null,[le.route.id,nt]);cr.filter(Ct=>Ct.key!==I).forEach(Ct=>{let Qa=Ct.key,wl=N.fetchers.get(Qa),kn=vc(void 0,wl?wl.data:void 0);N.fetchers.set(Qa,kn),sr(Qa),Ct.controller&&M.set(Qa,Ct.controller)}),xe({fetchers:new Map(N.fetchers)});let ya=()=>cr.forEach(Ct=>sr(Ct.key));$e.signal.addEventListener("abort",ya);let{loaderResults:Ze,fetcherResults:fn}=await zi(bl,cr,Sn,Se);if($e.signal.aborted)return;if($e.signal.removeEventListener("abort",ya),H.delete(I),M.delete(I),cr.forEach(Ct=>M.delete(Ct.key)),N.fetchers.has(I)){let Ct=_s(nt.data);N.fetchers.set(I,Ct)}let Or=Ad(Ze);if(Or)return xn(Sn,Or.result,!1,{preventScrollReset:Ae});if(Or=Ad(fn),Or)return j.add(Or.key),xn(Sn,Or.result,!1,{preventScrollReset:Ae});let{loaderData:Ar,errors:Ys}=ZS(N,jn,Ze,void 0,cr,fn);An(Ka),N.navigation.state==="loading"&&Ka>X?(tt(L,"Expected pending action"),Q&&Q.abort(),Ne(N.navigation.location,{matches:jn,loaderData:Ar,errors:Ys,fetchers:new Map(N.fetchers)})):(xe({errors:Ys,loaderData:QS(N.loaderData,Ar,jn,Ys),fetchers:new Map(N.fetchers)}),pe=!1)}async function en(I,B,Y,le,he,Se,ke,Ee,Ae,Te){let Pe=N.fetchers.get(I);wt(I,vc(Te,Pe?Pe.data:void 0),{flushSync:Ee});let Le=new AbortController,$e=Io(t.history,Y,Le.signal);if(ke){let nt=await je(he,Y,$e.signal,I);if(nt.type==="aborted")return;if(nt.type==="error"){ft(I,B,nt.error,{flushSync:Ee});return}else if(nt.matches)he=nt.matches,le=Rc(he,Y);else{ft(I,B,br(404,{pathname:Y}),{flushSync:Ee});return}}M.set(I,Le);let it=W,_t=qo(i,o,$e,he,le,r,Se),lt=(await tn($e,_t,Se,I))[le.route.id];if(M.get(I)===Le&&M.delete(I),!$e.signal.aborted){if(U.has(I)){wt(I,_s(void 0));return}if(bi(lt))if(X>it){wt(I,_s(void 0));return}else{j.add(I),await xn($e,lt,!1,{preventScrollReset:Ae});return}if(Qn(lt)){ft(I,B,lt.error);return}wt(I,_s(lt.data))}}async function xn(I,B,Y,{submission:le,fetcherSubmission:he,preventScrollReset:Se,replace:ke}={}){B.response.headers.has("X-Remix-Revalidate")&&(pe=!0);let Ee=B.response.headers.get("Location");tt(Ee,"Expected a Location header on the redirect Response"),Ee=WS(Ee,new URL(I.url),f);let Ae=Fc(N.location,Ee,{_isRedirect:!0});if(n){let _t=!1;if(B.response.headers.has("X-Remix-Reload-Document"))_t=!0;else if(Jv.test(Ee)){const jt=M_(Ee,!0);_t=jt.origin!==e.location.origin||_r(jt.pathname,f)==null}if(_t){ke?e.location.replace(Ee):e.location.assign(Ee);return}}Q=null;let Te=ke===!0||B.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Pe,formAction:Le,formEncType:$e}=N.navigation;!le&&!he&&Pe&&Le&&$e&&(le=t1(N.navigation));let it=le||he;if(XM.has(B.response.status)&&it&&Xn(it.formMethod))await st(Te,Ae,{submission:{...it,formAction:Ee},preventScrollReset:Se||Z,enableViewTransition:Y?te:void 0});else{let _t=Km(Ae,le);await st(Te,Ae,{overrideNavigation:_t,fetcherSubmission:he,preventScrollReset:Se||Z,enableViewTransition:Y?te:void 0})}}async function tn(I,B,Y,le){let he,Se={};try{he=await oD(h,I,B,le,Y,!1)}catch(ke){return B.filter(Ee=>Ee.shouldLoad).forEach(Ee=>{Se[Ee.route.id]={type:"error",error:ke}}),Se}if(I.signal.aborted)return Se;for(let[ke,Ee]of Object.entries(he))if(hD(Ee)){let Ae=Ee.result;Se[ke]={type:"redirect",response:uD(Ae,I,ke,B,f)}}else Se[ke]=await cD(Ee);return Se}async function zi(I,B,Y,le){let he=tn(Y,I,le,null),Se=Promise.all(B.map(async Ae=>{if(Ae.matches&&Ae.match&&Ae.request&&Ae.controller){let Pe=(await tn(Ae.request,Ae.matches,le,Ae.key))[Ae.match.route.id];return{[Ae.key]:Pe}}else return Promise.resolve({[Ae.key]:{type:"error",error:br(404,{pathname:Ae.path})}})})),ke=await he,Ee=(await Se).reduce((Ae,Te)=>Object.assign(Ae,Te),{});return{loaderResults:ke,fetcherResults:Ee}}function qs(){pe=!0,V.forEach((I,B)=>{M.has(B)&&ve.add(B),sr(B)})}function wt(I,B,Y={}){N.fetchers.set(I,B),xe({fetchers:new Map(N.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function ft(I,B,Y,le={}){let he=gi(N.matches,B);Yt(I),xe({errors:{[he.route.id]:Y},fetchers:new Map(N.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function Bn(I){return re.set(I,(re.get(I)||0)+1),U.has(I)&&U.delete(I),N.fetchers.get(I)||JM}function Yt(I){let B=N.fetchers.get(I);M.has(I)&&!(B&&B.state==="loading"&&H.has(I))&&sr(I),V.delete(I),H.delete(I),j.delete(I),U.delete(I),ve.delete(I),N.fetchers.delete(I)}function Ga(I){let B=(re.get(I)||0)-1;B<=0?(re.delete(I),U.add(I)):re.set(I,B),xe({fetchers:new Map(N.fetchers)})}function sr(I){let B=M.get(I);B&&(B.abort(),M.delete(I))}function Vs(I){for(let B of I){let Y=Bn(B),le=_s(Y.data);N.fetchers.set(B,le)}}function Cr(){let I=[],B=!1;for(let Y of j){let le=N.fetchers.get(Y);tt(le,`Expected fetcher: ${Y}`),le.state==="loading"&&(j.delete(Y),I.push(Y),B=!0)}return Vs(I),B}function An(I){let B=[];for(let[Y,le]of H)if(le<I){let he=N.fetchers.get(Y);tt(he,`Expected fetcher: ${Y}`),he.state==="loading"&&(sr(Y),H.delete(Y),B.push(Y))}return Vs(B),B.length>0}function ir(I,B){let Y=N.blockers.get(I)||gc;return ee.get(I)!==B&&ee.set(I,B),Y}function Nn(I){N.blockers.delete(I),ee.delete(I)}function or(I,B){let Y=N.blockers.get(I)||gc;tt(Y.state==="unblocked"&&B.state==="blocked"||Y.state==="blocked"&&B.state==="blocked"||Y.state==="blocked"&&B.state==="proceeding"||Y.state==="blocked"&&B.state==="unblocked"||Y.state==="proceeding"&&B.state==="unblocked",`Invalid blocker state transition: ${Y.state} -> ${B.state}`);let le=new Map(N.blockers);le.set(I,B),xe({blockers:le})}function Ui({currentLocation:I,nextLocation:B,historyAction:Y}){if(ee.size===0)return;ee.size>1&&Ht(!1,"A router only supports one blocker at a time");let le=Array.from(ee.entries()),[he,Se]=le[le.length-1],ke=N.blockers.get(he);if(!(ke&&ke.state==="proceeding")&&Se({currentLocation:I,nextLocation:B,historyAction:Y}))return he}function ga(I){let B=br(404,{pathname:I}),Y=u||c,{matches:le,route:he}=JS(Y);return{notFoundMatches:le,route:he,error:B}}function Gs(I,B,Y){if(w=I,E=B,S=Y||null,!_&&N.navigation===Wm){_=!0;let le=Hn(N.location,N.matches);le!=null&&xe({restoreScrollPosition:le})}return()=>{w=null,E=null,S=null}}function Ya(I,B){return S&&S(I,B.map(le=>NM(le,N.loaderData)))||I.key}function Rr(I,B){if(w&&E){let Y=Ya(I,B);w[Y]=E()}}function Hn(I,B){if(w){let Y=Ya(I,B),le=w[Y];if(typeof le=="number")return le}return null}function va(I,B,Y){if(t.patchRoutesOnNavigation)if(I){if(Object.keys(I[0].params).length>0)return{active:!0,matches:Qd(B,Y,f,!0)}}else return{active:!0,matches:Qd(B,Y,f,!0)||[]};return{active:!1,matches:null}}async function je(I,B,Y,le){if(!t.patchRoutesOnNavigation)return{type:"success",matches:I};let he=I;for(;;){let Se=u==null,ke=u||c,Ee=o;try{await t.patchRoutesOnNavigation({signal:Y,path:B,matches:he,fetcherKey:le,patch:(Pe,Le)=>{Y.aborted||qS(Pe,Le,ke,Ee,i)}})}catch(Pe){return{type:"error",error:Pe,partialMatches:he}}finally{Se&&!Y.aborted&&(c=[...c])}if(Y.aborted)return{type:"aborted"};let Ae=Os(ke,B,f);if(Ae)return{type:"success",matches:Ae};let Te=Qd(ke,B,f,!0);if(!Te||he.length===Te.length&&he.every((Pe,Le)=>Pe.route.id===Te[Le].route.id))return{type:"success",matches:null};he=Te}}function rt(I){o={},u=hf(I,i,void 0,o)}function ht(I,B){let Y=u==null;qS(I,B,u||c,o,i),Y&&(c=[...c],xe({}))}return D={get basename(){return f},get future(){return m},get state(){return N},get routes(){return c},get window(){return e},initialize:G,subscribe:Ce,enableScrollRestoration:Gs,navigate:He,fetch:pa,revalidate:Be,createHref:I=>t.history.createHref(I),encodeLocation:I=>t.history.encodeLocation(I),getFetcher:Bn,deleteFetcher:Ga,dispose:me,getBlocker:ir,deleteBlocker:Nn,patchRoutes:ht,_internalFetchControllers:M,_internalSetRoutes:rt},D}function nD(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Lg(t,e,n,r,i,o){let c,u;if(i){c=[];for(let h of e)if(c.push(h),h.route.id===i){u=h;break}}else c=e,u=e[e.length-1];let f=Xv(r||".",Qv(c),_r(t.pathname,n)||t.pathname,o==="path");if(r==null&&(f.search=t.search,f.hash=t.hash),(r==null||r===""||r===".")&&u){let h=ey(f.search);if(u.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let m=new URLSearchParams(f.search),v=m.getAll("index");m.delete("index"),v.filter(w=>w).forEach(w=>m.append("index",w));let x=m.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:oa([n,f.pathname])),Ds(f)}function HS(t,e,n){if(!n||!nD(n))return{path:e};if(n.formMethod&&!pD(n.formMethod))return{path:e,error:br(405,{method:n.formMethod})};let r=()=>({path:e,error:br(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=V_(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Xn(o))return r();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[w,S])=>`${x}${w}=${S}
`,""):String(n.body);return{path:e,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!Xn(o))return r();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return r()}}}tt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Ug(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Ug(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=KS(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=KS(u)}catch{return r()}let h={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Xn(h.formMethod))return{path:e,submission:h};let m=Is(e);return t&&m.search&&ey(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Ds(m),submission:h}}function FS(t,e,n,r,i,o,c,u,f,h,m,v,x,w,S,E,_,C,R,A){let k=A?Qn(A[1])?A[1].error:A[1].data:void 0,D=i.createURL(o.location),N=i.createURL(f),L;if(m&&o.errors){let ge=Object.keys(o.errors)[0];L=c.findIndex(pe=>pe.route.id===ge)}else if(A&&Qn(A[1])){let ge=A[0];L=c.findIndex(pe=>pe.route.id===ge)-1}let Z=A?A[1].statusCode:void 0,Q=Z&&Z>=400,te={currentUrl:D,currentParams:o.matches[0]?.params||{},nextUrl:N,nextParams:c[0].params,...u,actionResult:k,actionStatus:Z},ce=c.map((ge,pe)=>{let{route:ve}=ge,M=null;if(L!=null&&pe>L?M=!1:ve.lazy?M=!0:ve.loader==null?M=!1:m?M=Ig(ve,o.loaderData,o.errors):rD(o.loaderData,o.matches[pe],ge)&&(M=!0),M!==null)return zg(n,r,t,ge,h,e,M);let W=Q?!1:v||D.pathname+D.search===N.pathname+N.search||D.search!==N.search||aD(o.matches[pe],ge),X={...te,defaultShouldRevalidate:W},H=gf(ge,X);return zg(n,r,t,ge,h,e,H,X)}),se=[];return S.forEach((ge,pe)=>{if(m||!c.some(re=>re.route.id===ge.routeId)||w.has(pe))return;let ve=o.fetchers.get(pe),M=ve&&ve.state!=="idle"&&ve.data===void 0,W=Os(_,ge.path,C);if(!W){if(R&&M)return;se.push({key:pe,routeId:ge.routeId,path:ge.path,matches:null,match:null,request:null,controller:null});return}if(E.has(pe))return;let X=Rc(W,ge.path),H=new AbortController,j=Io(i,ge.path,H.signal),V=null;if(x.has(pe))x.delete(pe),V=qo(n,r,j,W,X,h,e);else if(M)v&&(V=qo(n,r,j,W,X,h,e));else{let re={...te,defaultShouldRevalidate:Q?!1:v};gf(X,re)&&(V=qo(n,r,j,W,X,h,e,re))}V&&se.push({key:pe,routeId:ge.routeId,path:ge.path,matches:V,match:X,request:j,controller:H})}),{dsMatches:ce,revalidatingFetchers:se}}function Ig(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&t.id in e,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function rD(t,e,n){let r=!e||n.route.id!==e.route.id,i=!t.hasOwnProperty(n.route.id);return r||i}function aD(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function gf(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function qS(t,e,n,r,i){let o;if(t){let f=r[t];tt(f,`No route found to patch children into: routeId = ${t}`),f.children||(f.children=[]),o=f.children}else o=n;let c=e.filter(f=>!o.some(h=>$_(f,h))),u=hf(c,i,[t||"_","patch",String(o?.length||"0")],r);o.push(...u)}function $_(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>e.children?.some(i=>$_(n,i))):!1}var VS=new WeakMap,B_=({key:t,route:e,manifest:n,mapRouteProperties:r})=>{let i=n[e.id];if(tt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[t];if(!o)return;let c=VS.get(i);c||(c={},VS.set(i,c));let u=c[t];if(u)return u;let f=(async()=>{let h=CM(t),v=i[t]!==void 0&&t!=="hasErrorBoundary";if(h)Ht(!h,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),c[t]=Promise.resolve();else if(v)Ht(!1,`Route "${i.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let x=await o();x!=null&&(Object.assign(i,{[t]:x}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[t]=void 0,Object.values(i.lazy).every(x=>x===void 0)&&(i.lazy=void 0))})();return c[t]=f,f},GS=new WeakMap;function sD(t,e,n,r,i){let o=n[t.id];if(tt(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let m=GS.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let v=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let x=await t.lazy(),w={};for(let S in x){let E=x[S];if(E===void 0)continue;let _=OM(S),R=o[S]!==void 0&&S!=="hasErrorBoundary";_?Ht(!_,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Ht(!R,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):w[S]=E}Object.assign(o,w),Object.assign(o,{...r(o),lazy:void 0})})();return GS.set(o,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(t.lazy),u=[],f;for(let m of c){if(i&&i.includes(m))continue;let v=B_({key:m,route:t,manifest:n,mapRouteProperties:r});v&&(u.push(v),m===e&&(f=v))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function YS(t){let e=t.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(e.map(i=>i.resolve()))).forEach((i,o)=>{n[e[o].route.id]=i}),n}async function iD(t){return t.matches.some(e=>e.route.unstable_middleware)?H_(t,!1,()=>YS(t),(e,n)=>({[n]:{type:"error",result:e}})):YS(t)}async function H_(t,e,n,r){let{matches:i,request:o,params:c,context:u}=t,f={handlerResult:void 0};try{let h=i.flatMap(v=>v.route.unstable_middleware?v.route.unstable_middleware.map(x=>[v.route.id,x]):[]),m=await F_({request:o,params:c,context:u},h,e,f,n);return e?m:f.handlerResult}catch(h){if(!f.middlewareError)throw h;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function F_(t,e,n,r,i,o=0){let{request:c}=t;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=e[o];if(!u)return r.handlerResult=await i(),r.handlerResult;let[f,h]=u,m=!1,v,x=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await F_(t,e,n,r,i,o+1)};try{let w=await h({request:t.request,params:t.params,context:t.context},x);return m?w===void 0?v:w:x()}catch(w){throw r.middlewareError?r.middlewareError.error!==w&&(r.middlewareError={routeId:f,error:w}):r.middlewareError={routeId:f,error:w},w}}function q_(t,e,n,r,i){let o=B_({key:"unstable_middleware",route:r.route,manifest:e,mapRouteProperties:t}),c=sD(r.route,Xn(n.method)?"action":"loader",e,t,i);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function zg(t,e,n,r,i,o,c,u=null){let f=!1,h=q_(t,e,n,r,i);return{...r,_lazyPromises:h,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?gf(r,{...u,defaultShouldRevalidate:m}):gf(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?lD({request:n,match:r,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function qo(t,e,n,r,i,o,c,u=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:q_(t,e,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:zg(t,e,n,f,o,c,!0,u))}async function oD(t,e,n,r,i,o){n.some(h=>h._lazyPromises?.middleware)&&await Promise.all(n.map(h=>h._lazyPromises?.middleware));let c={request:e,params:n[0].params,context:i,matches:n},f=await t({...c,fetcherKey:r,unstable_runClientMiddleware:h=>{let m=c;return H_(m,!1,()=>h({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(v,x)=>({[x]:{type:"error",result:v}}))}});try{await Promise.all(n.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return f}async function lD({request:t,match:e,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:o}){let c,u,f=Xn(t.method),h=f?"action":"loader",m=v=>{let x,w=new Promise((_,C)=>x=C);u=()=>x(),t.signal.addEventListener("abort",u);let S=_=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${e.route.id}]`)):v({request:t,params:e.params,context:o},..._!==void 0?[_]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(C=>S(C)):S())}}catch(_){return{type:"error",result:_}}})();return Promise.race([E,w])};try{let v=f?e.route.action:e.route.loader;if(n||r)if(v){let x,[w]=await Promise.all([m(v).catch(S=>{x=S}),n,r]);if(x!==void 0)throw x;c=w}else{await n;let x=f?e.route.action:e.route.loader;if(x)[c]=await Promise.all([m(x),r]);else if(h==="action"){let w=new URL(t.url),S=w.pathname+w.search;throw br(405,{method:t.method,pathname:S,routeId:e.route.id})}else return{type:"data",result:void 0}}else if(v)c=await m(v);else{let x=new URL(t.url),w=x.pathname+x.search;throw br(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function cD(t){let{result:e,type:n}=t;if(G_(e)){let r;try{let i=e.headers.get("Content-Type");i&&/\bapplication\/json\b/.test(i)?e.body==null?r=null:r=await e.json():r=await e.text()}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new mf(e.status,e.statusText,r),statusCode:e.status,headers:e.headers}:{type:"data",data:r,statusCode:e.status,headers:e.headers}}return n==="error"?e1(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:new mf(e.init?.status||500,void 0,e.data),statusCode:qc(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:qc(e)?e.status:void 0}:e1(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function uD(t,e,n,r,i){let o=t.headers.get("Location");if(tt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jv.test(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=Lg(new URL(e.url),c,i,o),t.headers.set("Location",o)}return t}function WS(t,e,n){if(Jv.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),o=_r(i.pathname,n)!=null;if(i.origin===e.origin&&o)return i.pathname+i.search+i.hash}return t}function Io(t,e,n,r){let i=t.createURL(V_(e)).toString(),o={signal:n};if(r&&Xn(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=Ug(r.formData):o.body=r.formData}return new Request(i,o)}function Ug(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function KS(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function dD(t,e,n,r=!1,i=!1){let o={},c=null,u,f=!1,h={},m=n&&Qn(n[1])?n[1].error:void 0;return t.forEach(v=>{if(!(v.route.id in e))return;let x=v.route.id,w=e[x];if(tt(!bi(w),"Cannot handle redirect results in processLoaderData"),Qn(w)){let S=w.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},i)c[x]=S;else{let E=gi(t,x);c[E.route.id]==null&&(c[E.route.id]=S)}r||(o[x]=U_),f||(f=!0,u=qc(w.error)?w.error.status:500),w.headers&&(h[x]=w.headers)}else o[x]=w.data,w.statusCode&&w.statusCode!==200&&!f&&(u=w.statusCode),w.headers&&(h[x]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:h}}function ZS(t,e,n,r,i,o){let{loaderData:c,errors:u}=dD(e,n,r);return i.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:m,controller:v}=f,x=o[h];if(tt(x,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(Qn(x)){let w=gi(t.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:x.error}),t.fetchers.delete(h)}else if(bi(x))tt(!1,"Unhandled fetcher revalidation redirect");else{let w=_s(x.data);t.fetchers.set(h,w)}}),{loaderData:c,errors:u}}function QS(t,e,n,r){let i=Object.entries(e).filter(([,o])=>o!==U_).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!e.hasOwnProperty(c)&&t.hasOwnProperty(c)&&o.route.loader&&(i[c]=t[c]),r&&r.hasOwnProperty(c))break}return i}function XS(t){return t?Qn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function gi(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function JS(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function br(t,{pathname:e,routeId:n,method:r,type:i,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return t===400?(c="Bad Request",r&&e&&n?u=`You made a ${r} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(u="Unable to encode submission body")):t===403?(c="Forbidden",u=`Route "${n}" does not match URL "${e}"`):t===404?(c="Not Found",u=`No route matches URL "${e}"`):t===405&&(c="Method Not Allowed",r&&e&&n?u=`You made a ${r.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new mf(t||500,c,new Error(u),!0)}function Ad(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(bi(i))return{key:r,result:i}}}function V_(t){let e=typeof t=="string"?Is(t):t;return Ds({...e,hash:""})}function fD(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function hD(t){return G_(t.result)&&QM.has(t.result.status)}function Qn(t){return t.type==="error"}function bi(t){return(t&&t.type)==="redirect"}function e1(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function G_(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function pD(t){return ZM.has(t.toUpperCase())}function Xn(t){return WM.has(t.toUpperCase())}function ey(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Rc(t,e){let n=typeof e=="string"?Is(e).search:e.search;if(t[t.length-1].route.index&&ey(n||""))return t[t.length-1];let r=L_(t);return r[r.length-1]}function t1(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:o,json:c}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function Km(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function mD(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function vc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function gD(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function _s(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function vD(t,e){try{let n=t.sessionStorage.getItem(z_);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&e.set(i,new Set(o||[]))}}catch{}}function yD(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(z_,JSON.stringify(n))}catch(r){Ht(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function bD(){let t,e,n=new Promise((r,i)=>{t=async o=>{r(o);try{await n}catch{}},e=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var ji=b.createContext(null);ji.displayName="DataRouter";var nu=b.createContext(null);nu.displayName="DataRouterState";var ty=b.createContext({isTransitioning:!1});ty.displayName="ViewTransition";var Y_=b.createContext(new Map);Y_.displayName="Fetchers";var wD=b.createContext(null);wD.displayName="Await";var da=b.createContext(null);da.displayName="Navigation";var qf=b.createContext(null);qf.displayName="Location";var Yr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Yr.displayName="Route";var ny=b.createContext(null);ny.displayName="RouteError";function xD(t,{relative:e}={}){tt(ru(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(da),{hash:i,pathname:o,search:c}=au(t,{relative:e}),u=o;return n!=="/"&&(u=o==="/"?n:oa([n,o])),r.createHref({pathname:u,search:c,hash:i})}function ru(){return b.useContext(qf)!=null}function Wr(){return tt(ru(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(qf).location}var W_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function K_(t){b.useContext(da).static||b.useLayoutEffect(t)}function Kr(){let{isDataRoute:t}=b.useContext(Yr);return t?LD():SD()}function SD(){tt(ru(),"useNavigate() may be used only in the context of a <Router> component.");let t=b.useContext(ji),{basename:e,navigator:n}=b.useContext(da),{matches:r}=b.useContext(Yr),{pathname:i}=Wr(),o=JSON.stringify(Qv(r)),c=b.useRef(!1);return K_(()=>{c.current=!0}),b.useCallback((f,h={})=>{if(Ht(c.current,W_),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Xv(f,JSON.parse(o),i,h.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:oa([e,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[e,n,o,i,t])}var ED=b.createContext(null);function _D(t){let e=b.useContext(Yr).outlet;return e&&b.createElement(ED.Provider,{value:t},e)}function Z_(){let{matches:t}=b.useContext(Yr),e=t[t.length-1];return e?e.params:{}}function au(t,{relative:e}={}){let{matches:n}=b.useContext(Yr),{pathname:r}=Wr(),i=JSON.stringify(Qv(n));return b.useMemo(()=>Xv(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function TD(t,e,n,r){tt(ru(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(da),{matches:o}=b.useContext(Yr),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",h=c?c.pathnameBase:"/",m=c&&c.route;{let C=m&&m.path||"";Q_(f,!m||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=Wr(),x;x=v;let w=x.pathname||"/",S=w;if(h!=="/"){let C=h.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=Os(t,{pathname:S});return Ht(m||E!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Ht(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),ND(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:oa([h,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?h:oa([h,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),o,n,r)}function CD(){let t=PD(),e=qc(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",t),c=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),n?b.createElement("pre",{style:i},n):null,c)}var RD=b.createElement(CD,null),OD=class extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return this.state.error!==void 0?b.createElement(Yr.Provider,{value:this.props.routeContext},b.createElement(ny.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function AD({routeContext:t,match:e,children:n}){let r=b.useContext(ji);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),b.createElement(Yr.Provider,{value:t},n)}function ND(t,e=[],n=null,r=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,o=n?.errors;if(o!=null){let f=i.findIndex(h=>h.route.id&&o?.[h.route.id]!==void 0);tt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<i.length;f++){let h=i[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:m,errors:v}=n,x=h.route.loader&&!m.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||x){c=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((f,h,m)=>{let v,x=!1,w=null,S=null;n&&(v=o&&h.route.id?o[h.route.id]:void 0,w=h.route.errorElement||RD,c&&(u<0&&m===0?(Q_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):u===m&&(x=!0,S=h.route.hydrateFallbackElement||null)));let E=e.concat(i.slice(0,m+1)),_=()=>{let C;return v?C=w:x?C=S:h.route.Component?C=b.createElement(h.route.Component,null):h.route.element?C=h.route.element:C=f,b.createElement(AD,{match:h,routeContext:{outlet:f,matches:E,isDataRoute:n!=null},children:C})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?b.createElement(OD,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:_(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):_()},null)}function ry(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function jD(t){let e=b.useContext(ji);return tt(e,ry(t)),e}function kD(t){let e=b.useContext(nu);return tt(e,ry(t)),e}function MD(t){let e=b.useContext(Yr);return tt(e,ry(t)),e}function ay(t){let e=MD(t),n=e.matches[e.matches.length-1];return tt(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function DD(){return ay("useRouteId")}function PD(){let t=b.useContext(ny),e=kD("useRouteError"),n=ay("useRouteError");return t!==void 0?t:e.errors?.[n]}function LD(){let{router:t}=jD("useNavigate"),e=ay("useNavigate"),n=b.useRef(!1);return K_(()=>{n.current=!0}),b.useCallback(async(i,o={})=>{Ht(n.current,W_),n.current&&(typeof i=="number"?t.navigate(i):await t.navigate(i,{fromRouteId:e,...o}))},[t,e])}var n1={};function Q_(t,e,n){!e&&!n1[t]&&(n1[t]=!0,Ht(!1,n))}var r1={};function a1(t,e){!t&&!r1[e]&&(r1[e]=!0,console.warn(e))}function ID(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Ht(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:b.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Ht(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:b.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Ht(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:b.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var zD=["HydrateFallback","hydrateFallbackElement"],UD=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function $D({router:t,flushSync:e}){let[n,r]=b.useState(t.state),[i,o]=b.useState(),[c,u]=b.useState({isTransitioning:!1}),[f,h]=b.useState(),[m,v]=b.useState(),[x,w]=b.useState(),S=b.useRef(new Map),E=b.useCallback((A,{deletedFetchers:k,flushSync:D,viewTransitionOpts:N})=>{A.fetchers.forEach((Z,Q)=>{Z.data!==void 0&&S.current.set(Q,Z.data)}),k.forEach(Z=>S.current.delete(Z)),a1(D===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let L=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(a1(N==null||L,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!N||!L){e&&D?e(()=>r(A)):b.startTransition(()=>r(A));return}if(e&&D){e(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let Z=t.window.document.startViewTransition(()=>{e(()=>r(A))});Z.finished.finally(()=>{e(()=>{h(void 0),v(void 0),o(void 0),u({isTransitioning:!1})})}),e(()=>v(Z));return}m?(f&&f.resolve(),m.skipTransition(),w({state:A,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(o(A),u({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[t.window,e,m,f]);b.useLayoutEffect(()=>t.subscribe(E),[t,E]),b.useEffect(()=>{c.isTransitioning&&!c.flushSync&&h(new UD)},[c]),b.useEffect(()=>{if(f&&i&&t.window){let A=i,k=f.promise,D=t.window.document.startViewTransition(async()=>{b.startTransition(()=>r(A)),await k});D.finished.finally(()=>{h(void 0),v(void 0),o(void 0),u({isTransitioning:!1})}),v(D)}},[i,f,t.window]),b.useEffect(()=>{f&&i&&n.location.key===i.location.key&&f.resolve()},[f,m,n.location,i]),b.useEffect(()=>{!c.isTransitioning&&x&&(o(x.state),u({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),w(void 0))},[c.isTransitioning,x]);let _=b.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:A=>t.navigate(A),push:(A,k,D)=>t.navigate(A,{state:k,preventScrollReset:D?.preventScrollReset}),replace:(A,k,D)=>t.navigate(A,{replace:!0,state:k,preventScrollReset:D?.preventScrollReset})}),[t]),C=t.basename||"/",R=b.useMemo(()=>({router:t,navigator:_,static:!1,basename:C}),[t,_,C]);return b.createElement(b.Fragment,null,b.createElement(ji.Provider,{value:R},b.createElement(nu.Provider,{value:n},b.createElement(Y_.Provider,{value:S.current},b.createElement(ty.Provider,{value:c},b.createElement(qD,{basename:C,location:n.location,navigationType:n.historyAction,navigator:_},b.createElement(BD,{routes:t.routes,future:t.future,state:n})))))),null)}var BD=b.memo(HD);function HD({routes:t,future:e,state:n}){return TD(t,void 0,n,e)}function FD(t){return _D(t.context)}function qD({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){tt(!ru(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:i,static:o,future:{}}),[c,i,o]);typeof n=="string"&&(n=Is(n));let{pathname:f="/",search:h="",hash:m="",state:v=null,key:x="default"}=n,w=b.useMemo(()=>{let S=_r(f,c);return S==null?null:{location:{pathname:S,search:h,hash:m,state:v,key:x},navigationType:r}},[c,f,h,m,v,x,r]);return Ht(w!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(da.Provider,{value:u},b.createElement(qf.Provider,{children:e,value:w}))}var Xd="get",Jd="application/x-www-form-urlencoded";function Vf(t){return t!=null&&typeof t.tagName=="string"}function VD(t){return Vf(t)&&t.tagName.toLowerCase()==="button"}function GD(t){return Vf(t)&&t.tagName.toLowerCase()==="form"}function YD(t){return Vf(t)&&t.tagName.toLowerCase()==="input"}function WD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function KD(t,e){return t.button===0&&(!e||e==="_self")&&!WD(t)}function $g(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function ZD(t,e){let n=$g(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Nd=null;function QD(){if(Nd===null)try{new FormData(document.createElement("form"),0),Nd=!1}catch{Nd=!0}return Nd}var XD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zm(t){return t!=null&&!XD.has(t)?(Ht(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jd}"`),null):t}function JD(t,e){let n,r,i,o,c;if(GD(t)){let u=t.getAttribute("action");r=u?_r(u,e):null,n=t.getAttribute("method")||Xd,i=Zm(t.getAttribute("enctype"))||Jd,o=new FormData(t)}else if(VD(t)||YD(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=t.getAttribute("formaction")||u.getAttribute("action");if(r=f?_r(f,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||Xd,i=Zm(t.getAttribute("formenctype"))||Zm(u.getAttribute("enctype"))||Jd,o=new FormData(u,t),!QD()){let{name:h,type:m,value:v}=t;if(m==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,v)}}else{if(Vf(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Xd,r=null,i=Jd,c=t}return o&&i==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:c}}function sy(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}async function eP(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tP(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function nP(t,e,n){let r=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let c=await eP(o,n);return c.links?c.links():[]}return[]}));return iP(r.flat(1).filter(tP).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function s1(t,e,n,r,i,o){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,u=(f,h)=>n[h].pathname!==f.pathname||n[h].route.path?.endsWith("*")&&n[h].params["*"]!==f.params["*"];return o==="assets"?e.filter((f,h)=>c(f,h)||u(f,h)):o==="data"?e.filter((f,h)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,h)||u(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function rP(t,e,{includeHydrateFallback:n}={}){return aP(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function aP(t){return[...new Set(t)]}function sP(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function iP(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let o=JSON.stringify(sP(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var oP=new Set([100,101,204,205]);function lP(t,e){let n=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n.pathname==="/"?n.pathname="_root.data":e&&_r(n.pathname,e)==="/"?n.pathname=`${e.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function X_(){let t=b.useContext(ji);return sy(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function cP(){let t=b.useContext(nu);return sy(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var iy=b.createContext(void 0);iy.displayName="FrameworkContext";function J_(){let t=b.useContext(iy);return sy(t,"You must render this element inside a <HydratedRouter> element"),t}function uP(t,e){let n=b.useContext(iy),[r,i]=b.useState(!1),[o,c]=b.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:h,onMouseLeave:m,onTouchStart:v}=e,x=b.useRef(null);b.useEffect(()=>{if(t==="render"&&c(!0),t==="viewport"){let E=C=>{C.forEach(R=>{c(R.isIntersecting)})},_=new IntersectionObserver(E,{threshold:.5});return x.current&&_.observe(x.current),()=>{_.disconnect()}}},[t]),b.useEffect(()=>{if(r){let E=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(E)}}},[r]);let w=()=>{i(!0)},S=()=>{i(!1),c(!1)};return n?t!=="intent"?[o,x,{}]:[o,x,{onFocus:yc(u,w),onBlur:yc(f,S),onMouseEnter:yc(h,w),onMouseLeave:yc(m,S),onTouchStart:yc(v,w)}]:[!1,x,{}]}function yc(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function dP({page:t,...e}){let{router:n}=X_(),r=b.useMemo(()=>Os(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?b.createElement(hP,{page:t,matches:r,...e}):null}function fP(t){let{manifest:e,routeModules:n}=J_(),[r,i]=b.useState([]);return b.useEffect(()=>{let o=!1;return nP(t,e,n).then(c=>{o||i(c)}),()=>{o=!0}},[t,e,n]),r}function hP({page:t,matches:e,...n}){let r=Wr(),{manifest:i,routeModules:o}=J_(),{basename:c}=X_(),{loaderData:u,matches:f}=cP(),h=b.useMemo(()=>s1(t,e,f,i,r,"data"),[t,e,f,i,r]),m=b.useMemo(()=>s1(t,e,f,i,r,"assets"),[t,e,f,i,r]),v=b.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let S=new Set,E=!1;if(e.forEach(C=>{let R=i.routes[C.route.id];!R||!R.hasLoader||(!h.some(A=>A.route.id===C.route.id)&&C.route.id in u&&o[C.route.id]?.shouldRevalidate||R.hasClientLoader?E=!0:S.add(C.route.id))}),S.size===0)return[];let _=lP(t,c);return E&&S.size>0&&_.searchParams.set("_routes",e.filter(C=>S.has(C.route.id)).map(C=>C.route.id).join(",")),[_.pathname+_.search]},[c,u,r,i,h,e,t,o]),x=b.useMemo(()=>rP(m,i),[m,i]),w=fP(m);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:E})=>b.createElement("link",{key:S,...E})))}function pP(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var eT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{eT&&(window.__reactRouterVersion="7.6.3")}catch{}function mP(t,e){return tD({basename:e?.basename,unstable_getContext:e?.unstable_getContext,future:e?.future,history:SM({window:e?.window}),hydrationData:e?.hydrationData||gP(),routes:t,mapRouteProperties:ID,hydrationRouteProperties:zD,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window}).initialize()}function gP(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:vP(t.errors)}),t}function vP(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new mf(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let c=new o(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var tT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gf=b.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:c,state:u,target:f,to:h,preventScrollReset:m,viewTransition:v,...x},w){let{basename:S}=b.useContext(da),E=typeof h=="string"&&tT.test(h),_,C=!1;if(typeof h=="string"&&E&&(_=h,eT))try{let Q=new URL(window.location.href),te=h.startsWith("//")?new URL(Q.protocol+h):new URL(h),ce=_r(te.pathname,S);te.origin===Q.origin&&ce!=null?h=ce+te.search+te.hash:C=!0}catch{Ht(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=xD(h,{relative:i}),[A,k,D]=uP(r,x),N=xP(h,{replace:c,state:u,target:f,preventScrollReset:m,relative:i,viewTransition:v});function L(Q){e&&e(Q),Q.defaultPrevented||N(Q)}let Z=b.createElement("a",{...x,...D,href:_||R,onClick:C||o?e:L,ref:pP(w,k),target:f,"data-discover":!E&&n==="render"?"true":void 0});return A&&!E?b.createElement(b.Fragment,null,Z,b.createElement(dP,{page:R})):Z});Gf.displayName="Link";var yP=b.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:c,viewTransition:u,children:f,...h},m){let v=au(c,{relative:h.relative}),x=Wr(),w=b.useContext(nu),{navigator:S,basename:E}=b.useContext(da),_=w!=null&&CP(v)&&u===!0,C=S.encodeLocation?S.encodeLocation(v).pathname:v.pathname,R=x.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&E&&(A=_r(A,E)||A);const k=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=R===C||!i&&R.startsWith(C)&&R.charAt(k)==="/",N=A!=null&&(A===C||!i&&A.startsWith(C)&&A.charAt(C.length)==="/"),L={isActive:D,isPending:N,isTransitioning:_},Z=D?e:void 0,Q;typeof r=="function"?Q=r(L):Q=[r,D?"active":null,N?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let te=typeof o=="function"?o(L):o;return b.createElement(Gf,{...h,"aria-current":Z,className:Q,ref:m,style:te,to:c,viewTransition:u},typeof f=="function"?f(L):f)});yP.displayName="NavLink";var bP=b.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:o,method:c=Xd,action:u,onSubmit:f,relative:h,preventScrollReset:m,viewTransition:v,...x},w)=>{let S=_P(),E=TP(u,{relative:h}),_=c.toLowerCase()==="get"?"get":"post",C=typeof u=="string"&&tT.test(u),R=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let k=A.nativeEvent.submitter,D=k?.getAttribute("formmethod")||c;S(k||A.currentTarget,{fetcherKey:e,method:D,navigate:n,replace:i,state:o,relative:h,preventScrollReset:m,viewTransition:v})};return b.createElement("form",{ref:w,method:_,action:E,onSubmit:r?f:R,...x,"data-discover":!C&&t==="render"?"true":void 0})});bP.displayName="Form";function wP(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function nT(t){let e=b.useContext(ji);return tt(e,wP(t)),e}function xP(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:c}={}){let u=Kr(),f=Wr(),h=au(t,{relative:o});return b.useCallback(m=>{if(KD(m,e)){m.preventDefault();let v=n!==void 0?n:Ds(f)===Ds(h);u(t,{replace:v,state:r,preventScrollReset:i,relative:o,viewTransition:c})}},[f,u,h,n,r,e,t,i,o,c])}function Yf(t){Ht(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=b.useRef($g(t)),n=b.useRef(!1),r=Wr(),i=b.useMemo(()=>ZD(r.search,n.current?null:e.current),[r.search]),o=Kr(),c=b.useCallback((u,f)=>{const h=$g(typeof u=="function"?u(i):u);n.current=!0,o("?"+h,f)},[o,i]);return[i,c]}var SP=0,EP=()=>`__${String(++SP)}__`;function _P(){let{router:t}=nT("useSubmit"),{basename:e}=b.useContext(da),n=DD();return b.useCallback(async(r,i={})=>{let{action:o,method:c,encType:u,formData:f,body:h}=JD(r,e);if(i.navigate===!1){let m=i.fetcherKey||EP();await t.fetch(m,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await t.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:f,body:h,formMethod:i.method||c,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[t,e,n])}function TP(t,{relative:e}={}){let{basename:n}=b.useContext(da),r=b.useContext(Yr);tt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...au(t||".",{relative:e})},c=Wr();if(t==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(v=>v).forEach(v=>u.append("index",v));let m=u.toString();o.search=m?`?${m}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:oa([n,o.pathname])),Ds(o)}function CP(t,e={}){let n=b.useContext(ty);tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=nT("useViewTransitionState"),i=au(t,{relative:e.relative});if(!n.isTransitioning)return!1;let o=_r(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=_r(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pf(i.pathname,c)!=null||pf(i.pathname,o)!=null}[...oP];var rl=N_();const rT=Kv(rl);/**
 * react-router v7.6.3
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function RP(t){return b.createElement($D,{flushSync:rl.flushSync,...t})}class ki extends Error{}class OP extends ki{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class AP extends ki{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class NP extends ki{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Bo extends ki{}class aT extends ki{constructor(e){super(`Invalid unit ${e}`)}}class mn extends ki{}class ws extends ki{constructor(){super("Zone is an abstract class")}}const we="numeric",Fr="short",tr="long",vf={year:we,month:we,day:we},sT={year:we,month:Fr,day:we},jP={year:we,month:Fr,day:we,weekday:Fr},iT={year:we,month:tr,day:we},oT={year:we,month:tr,day:we,weekday:tr},lT={hour:we,minute:we},cT={hour:we,minute:we,second:we},uT={hour:we,minute:we,second:we,timeZoneName:Fr},dT={hour:we,minute:we,second:we,timeZoneName:tr},fT={hour:we,minute:we,hourCycle:"h23"},hT={hour:we,minute:we,second:we,hourCycle:"h23"},pT={hour:we,minute:we,second:we,hourCycle:"h23",timeZoneName:Fr},mT={hour:we,minute:we,second:we,hourCycle:"h23",timeZoneName:tr},gT={year:we,month:we,day:we,hour:we,minute:we},vT={year:we,month:we,day:we,hour:we,minute:we,second:we},yT={year:we,month:Fr,day:we,hour:we,minute:we},bT={year:we,month:Fr,day:we,hour:we,minute:we,second:we},kP={year:we,month:Fr,day:we,weekday:Fr,hour:we,minute:we},wT={year:we,month:tr,day:we,hour:we,minute:we,timeZoneName:Fr},xT={year:we,month:tr,day:we,hour:we,minute:we,second:we,timeZoneName:Fr},ST={year:we,month:tr,day:we,weekday:tr,hour:we,minute:we,timeZoneName:tr},ET={year:we,month:tr,day:we,weekday:tr,hour:we,minute:we,second:we,timeZoneName:tr};class su{get type(){throw new ws}get name(){throw new ws}get ianaName(){return this.name}get isUniversal(){throw new ws}offsetName(e,n){throw new ws}formatOffset(e,n){throw new ws}offset(e){throw new ws}equals(e){throw new ws}get isValid(){throw new ws}}let Qm=null;class Wf extends su{static get instance(){return Qm===null&&(Qm=new Wf),Qm}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return DT(e,n,r)}formatOffset(e,n){return Uc(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Bg=new Map;function MP(t){let e=Bg.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Bg.set(t,e)),e}const DP={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function PP(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,c,u,f,h,m]=r;return[c,i,o,u,f,h,m]}function LP(t,e){const n=t.formatToParts(e),r=[];for(let i=0;i<n.length;i++){const{type:o,value:c}=n[i],u=DP[o];o==="era"?r[u]=c:ze(u)||(r[u]=parseInt(c,10))}return r}const Xm=new Map;class Ua extends su{static create(e){let n=Xm.get(e);return n===void 0&&Xm.set(e,n=new Ua(e)),n}static resetCache(){Xm.clear(),Bg.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=Ua.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return DT(e,n,r,this.name)}formatOffset(e,n){return Uc(this.offset(e),n)}offset(e){if(!this.valid)return NaN;const n=new Date(e);if(isNaN(n))return NaN;const r=MP(this.name);let[i,o,c,u,f,h,m]=r.formatToParts?LP(r,n):PP(r,n);u==="BC"&&(i=-Math.abs(i)+1);const x=Zf({year:i,month:o,day:c,hour:f===24?0:f,minute:h,second:m,millisecond:0});let w=+n;const S=w%1e3;return w-=S>=0?S:1e3+S,(x-w)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let i1={};function IP(t,e={}){const n=JSON.stringify([t,e]);let r=i1[n];return r||(r=new Intl.ListFormat(t,e),i1[n]=r),r}const Hg=new Map;function Fg(t,e={}){const n=JSON.stringify([t,e]);let r=Hg.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(t,e),Hg.set(n,r)),r}const qg=new Map;function zP(t,e={}){const n=JSON.stringify([t,e]);let r=qg.get(n);return r===void 0&&(r=new Intl.NumberFormat(t,e),qg.set(n,r)),r}const Vg=new Map;function UP(t,e={}){const{base:n,...r}=e,i=JSON.stringify([t,r]);let o=Vg.get(i);return o===void 0&&(o=new Intl.RelativeTimeFormat(t,e),Vg.set(i,o)),o}let Oc=null;function $P(){return Oc||(Oc=new Intl.DateTimeFormat().resolvedOptions().locale,Oc)}const Gg=new Map;function _T(t){let e=Gg.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),Gg.set(t,e)),e}const Yg=new Map;function BP(t){let e=Yg.get(t);if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...TT,...e}),Yg.set(t,e)}return e}function HP(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=Fg(t).resolvedOptions(),i=t}catch{const f=t.substring(0,n);r=Fg(f).resolvedOptions(),i=f}const{numberingSystem:o,calendar:c}=r;return[i,o,c]}}function FP(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function qP(t){const e=[];for(let n=1;n<=12;n++){const r=Ue.utc(2009,n,1);e.push(t(r))}return e}function VP(t){const e=[];for(let n=1;n<=7;n++){const r=Ue.utc(2016,11,13+n);e.push(t(r))}return e}function jd(t,e,n,r){const i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function GP(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||_T(t.locale).numberingSystem==="latn"}class YP{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...c}=r;if(!n||Object.keys(c).length>0){const u={useGrouping:!1,...r};r.padTo>0&&(u.minimumIntegerDigits=r.padTo),this.inf=zP(e,u)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):dy(e,3);return Gt(n,this.padTo)}}}class WP{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const c=-1*(e.offset/60),u=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;e.offset!==0&&Ua.create(u).valid?(i=u,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=Fg(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class KP{constructor(e,n,r){this.opts={style:"long",...r},!n&&kT()&&(this.rtf=UP(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):vL(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const TT={firstDay:1,minimalDays:4,weekend:[6,7]};class pt{static fromOpts(e){return pt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,o=!1){const c=e||Ot.defaultLocale,u=c||(o?"en-US":$P()),f=n||Ot.defaultNumberingSystem,h=r||Ot.defaultOutputCalendar,m=Kg(i)||Ot.defaultWeekSettings;return new pt(u,f,h,m,c)}static resetCache(){Oc=null,Hg.clear(),qg.clear(),Vg.clear(),Gg.clear(),Yg.clear()}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return pt.create(e,n,r,i)}constructor(e,n,r,i,o){const[c,u,f]=HP(e);this.locale=c,this.numberingSystem=n||u||null,this.outputCalendar=r||f||null,this.weekSettings=i,this.intl=FP(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=GP(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:pt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Kg(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return jd(this,e,IT,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const i=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";if(!this.monthsCache[o][e]){const c=r?u=>this.dtFormatter(u,i).format():u=>this.extract(u,i,"month");this.monthsCache[o][e]=qP(c)}return this.monthsCache[o][e]})}weekdays(e,n=!1){return jd(this,e,$T,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=VP(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return jd(this,void 0,()=>BT,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ue.utc(2016,11,13,9),Ue.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return jd(this,e,HT,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ue.utc(-40,1,1),Ue.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const i=this.dtFormatter(e,n),o=i.formatToParts(),c=o.find(u=>u.type.toLowerCase()===r);return c?c.value:null}numberFormatter(e={}){return new YP(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new WP(e,this.intl,n)}relFormatter(e={}){return new KP(this.intl,this.isEnglish(),e)}listFormatter(e={}){return IP(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||_T(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:MT()?BP(this.locale):TT}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Jm=null;class Cn extends su{static get utcInstance(){return Jm===null&&(Jm=new Cn(0)),Jm}static instance(e){return e===0?Cn.utcInstance:new Cn(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Cn(Qf(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Uc(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Uc(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Uc(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class ZP extends su{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function As(t,e){if(ze(t)||t===null)return e;if(t instanceof su)return t;if(nL(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Wf.instance:n==="utc"||n==="gmt"?Cn.utcInstance:Cn.parseSpecifier(n)||Ua.create(t)}else return ks(t)?Cn.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new ZP(t)}const oy={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[０-９]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},o1={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},QP=oy.hanidec.replace(/[\[|\]]/g,"").split("");function XP(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(t[n].search(oy.hanidec)!==-1)e+=QP.indexOf(t[n]);else for(const i in o1){const[o,c]=o1[i];r>=o&&r<=c&&(e+=r-o)}}return parseInt(e,10)}else return e}const Wg=new Map;function JP(){Wg.clear()}function Mr({numberingSystem:t},e=""){const n=t||"latn";let r=Wg.get(n);r===void 0&&(r=new Map,Wg.set(n,r));let i=r.get(e);return i===void 0&&(i=new RegExp(`${oy[n]}${e}`),r.set(e,i)),i}let l1=()=>Date.now(),c1="system",u1=null,d1=null,f1=null,h1=60,p1,m1=null;class Ot{static get now(){return l1}static set now(e){l1=e}static set defaultZone(e){c1=e}static get defaultZone(){return As(c1,Wf.instance)}static get defaultLocale(){return u1}static set defaultLocale(e){u1=e}static get defaultNumberingSystem(){return d1}static set defaultNumberingSystem(e){d1=e}static get defaultOutputCalendar(){return f1}static set defaultOutputCalendar(e){f1=e}static get defaultWeekSettings(){return m1}static set defaultWeekSettings(e){m1=Kg(e)}static get twoDigitCutoffYear(){return h1}static set twoDigitCutoffYear(e){h1=e%100}static get throwOnInvalid(){return p1}static set throwOnInvalid(e){p1=e}static resetCaches(){pt.resetCache(),Ua.resetCache(),Ue.resetCache(),JP()}}class Br{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const CT=[0,31,59,90,120,151,181,212,243,273,304,334],RT=[0,31,60,91,121,152,182,213,244,274,305,335];function xr(t,e){return new Br("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function ly(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function OT(t,e,n){return n+(iu(t)?RT:CT)[e-1]}function AT(t,e){const n=iu(t)?RT:CT,r=n.findIndex(o=>o<e),i=e-n[r];return{month:r+1,day:i}}function cy(t,e){return(t-e+7)%7+1}function yf(t,e=4,n=1){const{year:r,month:i,day:o}=t,c=OT(r,i,o),u=cy(ly(r,i,o),n);let f=Math.floor((c-u+14-e)/7),h;return f<1?(h=r-1,f=Vc(h,e,n)):f>Vc(r,e,n)?(h=r+1,f=1):h=r,{weekYear:h,weekNumber:f,weekday:u,...Xf(t)}}function g1(t,e=4,n=1){const{weekYear:r,weekNumber:i,weekday:o}=t,c=cy(ly(r,1,e),n),u=Vo(r);let f=i*7+o-c-7+e,h;f<1?(h=r-1,f+=Vo(h)):f>u?(h=r+1,f-=Vo(r)):h=r;const{month:m,day:v}=AT(h,f);return{year:h,month:m,day:v,...Xf(t)}}function eg(t){const{year:e,month:n,day:r}=t,i=OT(e,n,r);return{year:e,ordinal:i,...Xf(t)}}function v1(t){const{year:e,ordinal:n}=t,{month:r,day:i}=AT(e,n);return{year:e,month:r,day:i,...Xf(t)}}function y1(t,e){if(!ze(t.localWeekday)||!ze(t.localWeekNumber)||!ze(t.localWeekYear)){if(!ze(t.weekday)||!ze(t.weekNumber)||!ze(t.weekYear))throw new Bo("Cannot mix locale-based week fields with ISO-based week fields");return ze(t.localWeekday)||(t.weekday=t.localWeekday),ze(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),ze(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function eL(t,e=4,n=1){const r=Kf(t.weekYear),i=Sr(t.weekNumber,1,Vc(t.weekYear,e,n)),o=Sr(t.weekday,1,7);return r?i?o?!1:xr("weekday",t.weekday):xr("week",t.weekNumber):xr("weekYear",t.weekYear)}function tL(t){const e=Kf(t.year),n=Sr(t.ordinal,1,Vo(t.year));return e?n?!1:xr("ordinal",t.ordinal):xr("year",t.year)}function NT(t){const e=Kf(t.year),n=Sr(t.month,1,12),r=Sr(t.day,1,bf(t.year,t.month));return e?n?r?!1:xr("day",t.day):xr("month",t.month):xr("year",t.year)}function jT(t){const{hour:e,minute:n,second:r,millisecond:i}=t,o=Sr(e,0,23)||e===24&&n===0&&r===0&&i===0,c=Sr(n,0,59),u=Sr(r,0,59),f=Sr(i,0,999);return o?c?u?f?!1:xr("millisecond",i):xr("second",r):xr("minute",n):xr("hour",e)}function ze(t){return typeof t>"u"}function ks(t){return typeof t=="number"}function Kf(t){return typeof t=="number"&&t%1===0}function nL(t){return typeof t=="string"}function rL(t){return Object.prototype.toString.call(t)==="[object Date]"}function kT(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function MT(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function aL(t){return Array.isArray(t)?t:[t]}function b1(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{const o=[e(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function sL(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Qo(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Kg(t){if(t==null)return null;if(typeof t!="object")throw new mn("Week settings must be an object");if(!Sr(t.firstDay,1,7)||!Sr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Sr(e,1,7)))throw new mn("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Sr(t,e,n){return Kf(t)&&t>=e&&t<=n}function iL(t,e){return t-e*Math.floor(t/e)}function Gt(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Rs(t){if(!(ze(t)||t===null||t===""))return parseInt(t,10)}function ui(t){if(!(ze(t)||t===null||t===""))return parseFloat(t)}function uy(t){if(!(ze(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function dy(t,e,n="round"){const r=10**e;switch(n){case"expand":return t>0?Math.ceil(t*r)/r:Math.floor(t*r)/r;case"trunc":return Math.trunc(t*r)/r;case"round":return Math.round(t*r)/r;case"floor":return Math.floor(t*r)/r;case"ceil":return Math.ceil(t*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function iu(t){return t%4===0&&(t%100!==0||t%400===0)}function Vo(t){return iu(t)?366:365}function bf(t,e){const n=iL(e-1,12)+1,r=t+(e-n)/12;return n===2?iu(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Zf(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function w1(t,e,n){return-cy(ly(t,1,e),n)+e-1}function Vc(t,e=4,n=1){const r=w1(t,e,n),i=w1(t+1,e,n);return(Vo(t)-r+i)/7}function Zg(t){return t>99?t:t>Ot.twoDigitCutoffYear?1900+t:2e3+t}function DT(t,e,n,r=null){const i=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const c={timeZoneName:e,...o},u=new Intl.DateTimeFormat(n,c).formatToParts(i).find(f=>f.type.toLowerCase()==="timezonename");return u?u.value:null}function Qf(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function PT(t){const e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new mn(`Invalid unit value ${t}`);return e}function wf(t,e){const n={};for(const r in t)if(Qo(t,r)){const i=t[r];if(i==null)continue;n[e(r)]=PT(i)}return n}function Uc(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Gt(n,2)}:${Gt(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Gt(n,2)}${Gt(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Xf(t){return sL(t,["hour","minute","second","millisecond"])}const oL=["January","February","March","April","May","June","July","August","September","October","November","December"],LT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lL=["J","F","M","A","M","J","J","A","S","O","N","D"];function IT(t){switch(t){case"narrow":return[...lL];case"short":return[...LT];case"long":return[...oL];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const zT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],UT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],cL=["M","T","W","T","F","S","S"];function $T(t){switch(t){case"narrow":return[...cL];case"short":return[...UT];case"long":return[...zT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const BT=["AM","PM"],uL=["Before Christ","Anno Domini"],dL=["BC","AD"],fL=["B","A"];function HT(t){switch(t){case"narrow":return[...fL];case"short":return[...dL];case"long":return[...uL];default:return null}}function hL(t){return BT[t.hour<12?0:1]}function pL(t,e){return $T(e)[t.weekday-1]}function mL(t,e){return IT(e)[t.month-1]}function gL(t,e){return HT(e)[t.year<0?0:1]}function vL(t,e,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&o){const v=t==="days";switch(e){case 1:return v?"tomorrow":`next ${i[t][0]}`;case-1:return v?"yesterday":`last ${i[t][0]}`;case 0:return v?"today":`this ${i[t][0]}`}}const c=Object.is(e,-0)||e<0,u=Math.abs(e),f=u===1,h=i[t],m=r?f?h[1]:h[2]||h[1]:f?i[t][0]:t;return c?`${u} ${m} ago`:`in ${u} ${m}`}function x1(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const yL={D:vf,DD:sT,DDD:iT,DDDD:oT,t:lT,tt:cT,ttt:uT,tttt:dT,T:fT,TT:hT,TTT:pT,TTTT:mT,f:gT,ff:yT,fff:wT,ffff:ST,F:vT,FF:bT,FFF:xT,FFFF:ET};class vn{static create(e,n={}){return new vn(e,n)}static parseFormat(e){let n=null,r="",i=!1;const o=[];for(let c=0;c<e.length;c++){const u=e.charAt(c);u==="'"?((r.length>0||i)&&o.push({literal:i||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",i=!i):i||u===n?r+=u:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=u,n=u)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(e){return yL[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0,r=void 0){if(this.opts.forceSimple)return Gt(e,n);const i={...this.opts};return n>0&&(i.padTo=n),r&&(i.signDisplay=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(w,S)=>this.loc.extract(e,w,S),c=w=>e.isOffsetFixed&&e.offset===0&&w.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,w.format):"",u=()=>r?hL(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(w,S)=>r?mL(e,w):o(S?{month:w}:{month:w,day:"numeric"},"month"),h=(w,S)=>r?pL(e,w):o(S?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),m=w=>{const S=vn.macroTokenToFormatOpts(w);return S?this.formatWithSystemDefault(e,S):w},v=w=>r?gL(e,w):o({era:w},"era"),x=w=>{switch(w){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return u();case"d":return i?o({day:"numeric"},"day"):this.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(e.year,6);case"G":return v("short");case"GG":return v("long");case"GGGGG":return v("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return m(w)}};return x1(vn.parseFormat(n),x)}formatDurationFromString(e,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,i=m=>{switch(m[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},o=(m,v)=>x=>{const w=i(x);if(w){const S=v.isNegativeDuration&&w!==v.largestUnit?r:1;let E;return this.opts.signMode==="negativeLargestOnly"&&w!==v.largestUnit?E="never":this.opts.signMode==="all"?E="always":E="auto",this.num(m.get(w)*S,x.length,E)}else return x},c=vn.parseFormat(n),u=c.reduce((m,{literal:v,val:x})=>v?m:m.concat(x),[]),f=e.shiftTo(...u.map(i).filter(m=>m)),h={isNegativeDuration:f<0,largestUnit:Object.keys(f.values)[0]};return x1(c,o(f,h))}}const FT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function al(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function sl(...t){return e=>t.reduce(([n,r,i],o)=>{const[c,u,f]=o(e,i);return[{...n,...c},u||r,f]},[{},null,1]).slice(0,2)}function il(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const i=n.exec(t);if(i)return r(i)}return[null,null]}function qT(...t){return(e,n)=>{const r={};let i;for(i=0;i<t.length;i++)r[t[i]]=Rs(e[n+i]);return[r,null,n+i]}}const VT=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,bL=`(?:${VT.source}?(?:\\[(${FT.source})\\])?)?`,fy=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,GT=RegExp(`${fy.source}${bL}`),hy=RegExp(`(?:[Tt]${GT.source})?`),wL=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,xL=/(\d{4})-?W(\d\d)(?:-?(\d))?/,SL=/(\d{4})-?(\d{3})/,EL=qT("weekYear","weekNumber","weekDay"),_L=qT("year","ordinal"),TL=/(\d{4})-(\d\d)-(\d\d)/,YT=RegExp(`${fy.source} ?(?:${VT.source}|(${FT.source}))?`),CL=RegExp(`(?: ${YT.source})?`);function Go(t,e,n){const r=t[e];return ze(r)?n:Rs(r)}function RL(t,e){return[{year:Go(t,e),month:Go(t,e+1,1),day:Go(t,e+2,1)},null,e+3]}function ol(t,e){return[{hours:Go(t,e,0),minutes:Go(t,e+1,0),seconds:Go(t,e+2,0),milliseconds:uy(t[e+3])},null,e+4]}function ou(t,e){const n=!t[e]&&!t[e+1],r=Qf(t[e+1],t[e+2]),i=n?null:Cn.instance(r);return[{},i,e+3]}function lu(t,e){const n=t[e]?Ua.create(t[e]):null;return[{},n,e+1]}const OL=RegExp(`^T?${fy.source}$`),AL=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function NL(t){const[e,n,r,i,o,c,u,f,h]=t,m=e[0]==="-",v=f&&f[0]==="-",x=(w,S=!1)=>w!==void 0&&(S||w&&m)?-w:w;return[{years:x(ui(n)),months:x(ui(r)),weeks:x(ui(i)),days:x(ui(o)),hours:x(ui(c)),minutes:x(ui(u)),seconds:x(ui(f),f==="-0"),milliseconds:x(uy(h),v)}]}const jL={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function py(t,e,n,r,i,o,c){const u={year:e.length===2?Zg(Rs(e)):Rs(e),month:LT.indexOf(n)+1,day:Rs(r),hour:Rs(i),minute:Rs(o)};return c&&(u.second=Rs(c)),t&&(u.weekday=t.length>3?zT.indexOf(t)+1:UT.indexOf(t)+1),u}const kL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ML(t){const[,e,n,r,i,o,c,u,f,h,m,v]=t,x=py(e,i,r,n,o,c,u);let w;return f?w=jL[f]:h?w=0:w=Qf(m,v),[x,new Cn(w)]}function DL(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const PL=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,LL=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,IL=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function S1(t){const[,e,n,r,i,o,c,u]=t;return[py(e,i,r,n,o,c,u),Cn.utcInstance]}function zL(t){const[,e,n,r,i,o,c,u]=t;return[py(e,u,n,r,i,o,c),Cn.utcInstance]}const UL=al(wL,hy),$L=al(xL,hy),BL=al(SL,hy),HL=al(GT),WT=sl(RL,ol,ou,lu),FL=sl(EL,ol,ou,lu),qL=sl(_L,ol,ou,lu),VL=sl(ol,ou,lu);function GL(t){return il(t,[UL,WT],[$L,FL],[BL,qL],[HL,VL])}function YL(t){return il(DL(t),[kL,ML])}function WL(t){return il(t,[PL,S1],[LL,S1],[IL,zL])}function KL(t){return il(t,[AL,NL])}const ZL=sl(ol);function QL(t){return il(t,[OL,ZL])}const XL=al(TL,CL),JL=al(YT),eI=sl(ol,ou,lu);function tI(t){return il(t,[XL,WT],[JL,eI])}const E1="Invalid Duration",KT={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},nI={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...KT},yr=146097/400,wo=146097/4800,rI={years:{quarters:4,months:12,weeks:yr/7,days:yr,hours:yr*24,minutes:yr*24*60,seconds:yr*24*60*60,milliseconds:yr*24*60*60*1e3},quarters:{months:3,weeks:yr/28,days:yr/4,hours:yr*24/4,minutes:yr*24*60/4,seconds:yr*24*60*60/4,milliseconds:yr*24*60*60*1e3/4},months:{weeks:wo/7,days:wo,hours:wo*24,minutes:wo*24*60,seconds:wo*24*60*60,milliseconds:wo*24*60*60*1e3},...KT},wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],aI=wi.slice(0).reverse();function Ma(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ot(r)}function ZT(t,e){let n=e.milliseconds??0;for(const r of aI.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function _1(t,e){const n=ZT(t,e)<0?-1:1;wi.reduceRight((r,i)=>{if(ze(e[i]))return r;if(r){const o=e[r]*n,c=t[i][r],u=Math.floor(o/c);e[i]+=u*n,e[r]-=u*c*n}return i},null),wi.reduce((r,i)=>{if(ze(e[i]))return r;if(r){const o=e[r]%1;e[r]-=o,e[i]+=o*t[r][i]}return i},null)}function T1(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class ot{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?rI:nI;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||pt.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return ot.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new mn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:wf(e,ot.normalizeUnit),loc:pt.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(ks(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new mn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=KL(e);return r?ot.fromObject(r,n):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=QL(e);return r?ot.fromObject(r,n):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new mn("need to specify a reason the Duration is invalid");const r=e instanceof Br?e:new Br(e,n);if(Ot.throwOnInvalid)throw new NP(r);return new ot({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new aT(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?vn.create(this.loc,r).formatDurationFromString(this,e):E1}toHuman(e={}){if(!this.isValid)return E1;const n=e.showZeros!==!1,r=wi.map(i=>{const o=this.values[i];return ze(o)||o===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(o)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=dy(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Ue.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?ZT(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=ot.fromDurationLike(e),r={};for(const i of wi)(Qo(n.values,i)||Qo(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Ma(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=ot.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=PT(e(this.values[r],r));return Ma(this,{values:n},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...wf(e,ot.normalizeUnit)};return Ma(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const c={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Ma(this,c)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return _1(this.matrix,e),Ma(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=T1(this.normalize().shiftToAll().toObject());return Ma(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(c=>ot.normalizeUnit(c));const n={},r={},i=this.toObject();let o;for(const c of wi)if(e.indexOf(c)>=0){o=c;let u=0;for(const h in r)u+=this.matrix[h][c]*r[h],r[h]=0;ks(i[c])&&(u+=i[c]);const f=Math.trunc(u);n[c]=f,r[c]=(u*1e3-f*1e3)/1e3}else ks(i[c])&&(r[c]=i[c]);for(const c in r)r[c]!==0&&(n[o]+=c===o?r[c]:r[c]/this.matrix[o][c]);return _1(this.matrix,n),Ma(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Ma(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=T1(this.values);return Ma(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of wi)if(!n(this.values[r],e.values[r]))return!1;return!0}}const xo="Invalid Interval";function sI(t,e){return!t||!t.isValid?Lt.invalid("missing or invalid start"):!e||!e.isValid?Lt.invalid("missing or invalid end"):e<t?Lt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class Lt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new mn("need to specify a reason the Interval is invalid");const r=e instanceof Br?e:new Br(e,n);if(Ot.throwOnInvalid)throw new AP(r);return new Lt({invalid:r})}static fromDateTimes(e,n){const r=bc(e),i=bc(n),o=sI(r,i);return o??new Lt({start:r,end:i})}static after(e,n){const r=ot.fromDurationLike(n),i=bc(e);return Lt.fromDateTimes(i,i.plus(r))}static before(e,n){const r=ot.fromDurationLike(n),i=bc(e);return Lt.fromDateTimes(i.minus(r),i)}static fromISO(e,n){const[r,i]=(e||"").split("/",2);if(r&&i){let o,c;try{o=Ue.fromISO(r,n),c=o.isValid}catch{c=!1}let u,f;try{u=Ue.fromISO(i,n),f=u.isValid}catch{f=!1}if(c&&f)return Lt.fromDateTimes(o,u);if(c){const h=ot.fromISO(i,n);if(h.isValid)return Lt.after(o,h)}else if(f){const h=ot.fromISO(r,n);if(h.isValid)return Lt.before(u,h)}}return Lt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(e,n);let i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(e,n),Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?Lt.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(bc).filter(c=>this.contains(c)).sort((c,u)=>c.toMillis()-u.toMillis()),r=[];let{s:i}=this,o=0;for(;i<this.e;){const c=n[o]||this.e,u=+c>+this.e?this.e:c;r.push(Lt.fromDateTimes(i,u)),i=u,o+=1}return r}splitBy(e){const n=ot.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const c=[];for(;r<this.e;){const u=this.start.plus(n.mapUnits(f=>f*i));o=+u>+this.e?this.e:u,c.push(Lt.fromDateTimes(r,o)),r=o,i+=1}return c}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:Lt.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return Lt.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((i,o)=>i.s-o.s).reduce(([i,o],c)=>o?o.overlaps(c)||o.abutsStart(c)?[i,o.union(c)]:[i.concat([o]),c]:[i,c],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const i=[],o=e.map(f=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),c=Array.prototype.concat(...o),u=c.sort((f,h)=>f.time-h.time);for(const f of u)r+=f.type==="s"?1:-1,r===1?n=f.time:(n&&+n!=+f.time&&i.push(Lt.fromDateTimes(n,f.time)),n=null);return Lt.merge(i)}difference(...e){return Lt.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xo}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=vf,n={}){return this.isValid?vn.create(this.s.loc.clone(n),e).formatInterval(this):xo}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:xo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xo}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:xo}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:xo}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):ot.invalid(this.invalidReason)}mapEndpoints(e){return Lt.fromDateTimes(e(this.s),e(this.e))}}class kd{static hasDST(e=Ot.defaultZone){const n=Ue.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return Ua.isValidZone(e)}static normalizeZone(e){return As(e,Ot.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||pt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||pt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||pt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||pt.create(n,r,o)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||pt.create(n,r,o)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||pt.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||pt.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return pt.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return pt.create(n,null,"gregory").eras(e)}static features(){return{relative:kT(),localeWeek:MT()}}}function C1(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(ot.fromMillis(r).as("days"))}function iI(t,e,n){const r=[["years",(f,h)=>h.year-f.year],["quarters",(f,h)=>h.quarter-f.quarter+(h.year-f.year)*4],["months",(f,h)=>h.month-f.month+(h.year-f.year)*12],["weeks",(f,h)=>{const m=C1(f,h);return(m-m%7)/7}],["days",C1]],i={},o=t;let c,u;for(const[f,h]of r)n.indexOf(f)>=0&&(c=f,i[f]=h(t,e),u=o.plus(i),u>e?(i[f]--,t=o.plus(i),t>e&&(u=t,i[f]--,t=o.plus(i))):t=u);return[t,i,u,c]}function oI(t,e,n,r){let[i,o,c,u]=iI(t,e,n);const f=e-i,h=n.filter(v=>["hours","minutes","seconds","milliseconds"].indexOf(v)>=0);h.length===0&&(c<e&&(c=i.plus({[u]:1})),c!==i&&(o[u]=(o[u]||0)+f/(c-i)));const m=ot.fromObject(o,r);return h.length>0?ot.fromMillis(f,r).shiftTo(...h).plus(m):m}const lI="missing Intl.DateTimeFormat.formatToParts support";function dt(t,e=n=>n){return{regex:t,deser:([n])=>e(XP(n))}}const cI=" ",QT=`[ ${cI}]`,XT=new RegExp(QT,"g");function uI(t){return t.replace(/\./g,"\\.?").replace(XT,QT)}function R1(t){return t.replace(/\./g,"").replace(XT," ").toLowerCase()}function Dr(t,e){return t===null?null:{regex:RegExp(t.map(uI).join("|")),deser:([n])=>t.findIndex(r=>R1(n)===R1(r))+e}}function O1(t,e){return{regex:t,deser:([,n,r])=>Qf(n,r),groups:e}}function Md(t){return{regex:t,deser:([e])=>e}}function dI(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function fI(t,e){const n=Mr(e),r=Mr(e,"{2}"),i=Mr(e,"{3}"),o=Mr(e,"{4}"),c=Mr(e,"{6}"),u=Mr(e,"{1,2}"),f=Mr(e,"{1,3}"),h=Mr(e,"{1,6}"),m=Mr(e,"{1,9}"),v=Mr(e,"{2,4}"),x=Mr(e,"{4,6}"),w=_=>({regex:RegExp(dI(_.val)),deser:([C])=>C,literal:!0}),E=(_=>{if(t.literal)return w(_);switch(_.val){case"G":return Dr(e.eras("short"),0);case"GG":return Dr(e.eras("long"),0);case"y":return dt(h);case"yy":return dt(v,Zg);case"yyyy":return dt(o);case"yyyyy":return dt(x);case"yyyyyy":return dt(c);case"M":return dt(u);case"MM":return dt(r);case"MMM":return Dr(e.months("short",!0),1);case"MMMM":return Dr(e.months("long",!0),1);case"L":return dt(u);case"LL":return dt(r);case"LLL":return Dr(e.months("short",!1),1);case"LLLL":return Dr(e.months("long",!1),1);case"d":return dt(u);case"dd":return dt(r);case"o":return dt(f);case"ooo":return dt(i);case"HH":return dt(r);case"H":return dt(u);case"hh":return dt(r);case"h":return dt(u);case"mm":return dt(r);case"m":return dt(u);case"q":return dt(u);case"qq":return dt(r);case"s":return dt(u);case"ss":return dt(r);case"S":return dt(f);case"SSS":return dt(i);case"u":return Md(m);case"uu":return Md(u);case"uuu":return dt(n);case"a":return Dr(e.meridiems(),0);case"kkkk":return dt(o);case"kk":return dt(v,Zg);case"W":return dt(u);case"WW":return dt(r);case"E":case"c":return dt(n);case"EEE":return Dr(e.weekdays("short",!1),1);case"EEEE":return Dr(e.weekdays("long",!1),1);case"ccc":return Dr(e.weekdays("short",!0),1);case"cccc":return Dr(e.weekdays("long",!0),1);case"Z":case"ZZ":return O1(new RegExp(`([+-]${u.source})(?::(${r.source}))?`),2);case"ZZZ":return O1(new RegExp(`([+-]${u.source})(${r.source})?`),2);case"z":return Md(/[a-z_+-/]{1,256}?/i);case" ":return Md(/[^\S\n\r]/);default:return w(_)}})(t)||{invalidReason:lI};return E.token=t,E}const hI={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function pI(t,e,n){const{type:r,value:i}=t;if(r==="literal"){const f=/^\s+$/.test(i);return{literal:!f,val:f?" ":i}}const o=e[r];let c=r;r==="hour"&&(e.hour12!=null?c=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?c="hour12":c="hour24":c=n.hour12?"hour12":"hour24");let u=hI[c];if(typeof u=="object"&&(u=u[o]),u)return{literal:!1,val:u}}function mI(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function gI(t,e,n){const r=t.match(e);if(r){const i={};let o=1;for(const c in n)if(Qo(n,c)){const u=n[c],f=u.groups?u.groups+1:1;!u.literal&&u.token&&(i[u.token.val[0]]=u.deser(r.slice(o,o+f))),o+=f}return[r,i]}else return[r,{}]}function vI(t){const e=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return ze(t.z)||(n=Ua.create(t.z)),ze(t.Z)||(n||(n=new Cn(t.Z)),r=t.Z),ze(t.q)||(t.M=(t.q-1)*3+1),ze(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),ze(t.u)||(t.S=uy(t.u)),[Object.keys(t).reduce((o,c)=>{const u=e(c);return u&&(o[u]=t[c]),o},{}),n,r]}let tg=null;function yI(){return tg||(tg=Ue.fromMillis(1555555555555)),tg}function bI(t,e){if(t.literal)return t;const n=vn.macroTokenToFormatOpts(t.val),r=nC(n,e);return r==null||r.includes(void 0)?t:r}function JT(t,e){return Array.prototype.concat(...t.map(n=>bI(n,e)))}class eC{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=JT(vn.parseFormat(n),e),this.units=this.tokens.map(r=>fI(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,i]=mI(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){const[n,r]=gI(e,this.regex,this.handlers),[i,o,c]=r?vI(r):[null,null,void 0];if(Qo(r,"a")&&Qo(r,"H"))throw new Bo("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:o,specificOffset:c}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function tC(t,e,n){return new eC(t,n).explainFromTokens(e)}function wI(t,e,n){const{result:r,zone:i,specificOffset:o,invalidReason:c}=tC(t,e,n);return[r,i,o,c]}function nC(t,e){if(!t)return null;const r=vn.create(e,t).dtFormatter(yI()),i=r.formatToParts(),o=r.resolvedOptions();return i.map(c=>pI(c,t,o))}const ng="Invalid DateTime",A1=864e13;function Ac(t){return new Br("unsupported zone",`the zone "${t.name}" is not supported`)}function rg(t){return t.weekData===null&&(t.weekData=yf(t.c)),t.weekData}function ag(t){return t.localWeekData===null&&(t.localWeekData=yf(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function di(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Ue({...n,...e,old:n})}function rC(t,e,n){let r=t-e*60*1e3;const i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[t-Math.min(i,o)*60*1e3,Math.max(i,o)]}function Dd(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ef(t,e,n){return rC(Zf(t),e,n)}function N1(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,o={...t.c,year:r,month:i,day:Math.min(t.c.day,bf(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},c=ot.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),u=Zf(o);let[f,h]=rC(u,n,t.zone);return c!==0&&(f+=c,h=t.zone.offset(f)),{ts:f,o:h}}function So(t,e,n,r,i,o){const{setZone:c,zone:u}=n;if(t&&Object.keys(t).length!==0||e){const f=e||u,h=Ue.fromObject(t,{...n,zone:f,specificOffset:o});return c?h:h.setZone(u)}else return Ue.invalid(new Br("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Pd(t,e,n=!0){return t.isValid?vn.create(pt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function sg(t,e,n){const r=t.c.year>9999||t.c.year<0;let i="";if(r&&t.c.year>=0&&(i+="+"),i+=Gt(t.c.year,r?6:4),n==="year")return i;if(e){if(i+="-",i+=Gt(t.c.month),n==="month")return i;i+="-"}else if(i+=Gt(t.c.month),n==="month")return i;return i+=Gt(t.c.day),i}function j1(t,e,n,r,i,o,c){let u=!n||t.c.millisecond!==0||t.c.second!==0,f="";switch(c){case"day":case"month":case"year":break;default:if(f+=Gt(t.c.hour),c==="hour")break;if(e){if(f+=":",f+=Gt(t.c.minute),c==="minute")break;u&&(f+=":",f+=Gt(t.c.second))}else{if(f+=Gt(t.c.minute),c==="minute")break;u&&(f+=Gt(t.c.second))}if(c==="second")break;u&&(!r||t.c.millisecond!==0)&&(f+=".",f+=Gt(t.c.millisecond,3))}return i&&(t.isOffsetFixed&&t.offset===0&&!o?f+="Z":t.o<0?(f+="-",f+=Gt(Math.trunc(-t.o/60)),f+=":",f+=Gt(Math.trunc(-t.o%60))):(f+="+",f+=Gt(Math.trunc(t.o/60)),f+=":",f+=Gt(Math.trunc(t.o%60)))),o&&(f+="["+t.zone.ianaName+"]"),f}const aC={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xI={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},SI={ordinal:1,hour:0,minute:0,second:0,millisecond:0},tf=["year","month","day","hour","minute","second","millisecond"],EI=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],_I=["year","ordinal","hour","minute","second","millisecond"];function nf(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new aT(t);return e}function k1(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return nf(t)}}function TI(t){if(Nc===void 0&&(Nc=Ot.now()),t.type!=="iana")return t.offset(Nc);const e=t.name;let n=Qg.get(e);return n===void 0&&(n=t.offset(Nc),Qg.set(e,n)),n}function M1(t,e){const n=As(e.zone,Ot.defaultZone);if(!n.isValid)return Ue.invalid(Ac(n));const r=pt.fromObject(e);let i,o;if(ze(t.year))i=Ot.now();else{for(const f of tf)ze(t[f])&&(t[f]=aC[f]);const c=NT(t)||jT(t);if(c)return Ue.invalid(c);const u=TI(n);[i,o]=ef(t,u,n)}return new Ue({ts:i,zone:n,loc:r,o})}function D1(t,e,n){const r=ze(n.round)?!0:n.round,i=ze(n.rounding)?"trunc":n.rounding,o=(u,f)=>(u=dy(u,r||n.calendary?0:2,n.calendary?"round":i),e.loc.clone(n).relFormatter(n).format(u,f)),c=u=>n.calendary?e.hasSame(t,u)?0:e.startOf(u).diff(t.startOf(u),u).get(u):e.diff(t,u).get(u);if(n.unit)return o(c(n.unit),n.unit);for(const u of n.units){const f=c(u);if(Math.abs(f)>=1)return o(f,u)}return o(t>e?-0:0,n.units[n.units.length-1])}function P1(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let Nc;const Qg=new Map;class Ue{constructor(e){const n=e.zone||Ot.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Br("invalid input"):null)||(n.isValid?null:Ac(n));this.ts=ze(e.ts)?Ot.now():e.ts;let i=null,o=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,o]=[e.old.c,e.old.o];else{const u=ks(e.o)&&!e.old?e.o:n.offset(this.ts);i=Dd(this.ts,u),r=Number.isNaN(i.year)?new Br("invalid input"):null,i=r?null:i,o=r?null:u}this._zone=n,this.loc=e.loc||pt.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new Ue({})}static local(){const[e,n]=P1(arguments),[r,i,o,c,u,f,h]=n;return M1({year:r,month:i,day:o,hour:c,minute:u,second:f,millisecond:h},e)}static utc(){const[e,n]=P1(arguments),[r,i,o,c,u,f,h]=n;return e.zone=Cn.utcInstance,M1({year:r,month:i,day:o,hour:c,minute:u,second:f,millisecond:h},e)}static fromJSDate(e,n={}){const r=rL(e)?e.valueOf():NaN;if(Number.isNaN(r))return Ue.invalid("invalid input");const i=As(n.zone,Ot.defaultZone);return i.isValid?new Ue({ts:r,zone:i,loc:pt.fromObject(n)}):Ue.invalid(Ac(i))}static fromMillis(e,n={}){if(ks(e))return e<-A1||e>A1?Ue.invalid("Timestamp out of range"):new Ue({ts:e,zone:As(n.zone,Ot.defaultZone),loc:pt.fromObject(n)});throw new mn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(ks(e))return new Ue({ts:e*1e3,zone:As(n.zone,Ot.defaultZone),loc:pt.fromObject(n)});throw new mn("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=As(n.zone,Ot.defaultZone);if(!r.isValid)return Ue.invalid(Ac(r));const i=pt.fromObject(n),o=wf(e,k1),{minDaysInFirstWeek:c,startOfWeek:u}=y1(o,i),f=Ot.now(),h=ze(n.specificOffset)?r.offset(f):n.specificOffset,m=!ze(o.ordinal),v=!ze(o.year),x=!ze(o.month)||!ze(o.day),w=v||x,S=o.weekYear||o.weekNumber;if((w||m)&&S)throw new Bo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(x&&m)throw new Bo("Can't mix ordinal dates with month/day");const E=S||o.weekday&&!w;let _,C,R=Dd(f,h);E?(_=EI,C=xI,R=yf(R,c,u)):m?(_=_I,C=SI,R=eg(R)):(_=tf,C=aC);let A=!1;for(const te of _){const ce=o[te];ze(ce)?A?o[te]=C[te]:o[te]=R[te]:A=!0}const k=E?eL(o,c,u):m?tL(o):NT(o),D=k||jT(o);if(D)return Ue.invalid(D);const N=E?g1(o,c,u):m?v1(o):o,[L,Z]=ef(N,h,r),Q=new Ue({ts:L,zone:r,o:Z,loc:i});return o.weekday&&w&&e.weekday!==Q.weekday?Ue.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${Q.toISO()}`):Q.isValid?Q:Ue.invalid(Q.invalid)}static fromISO(e,n={}){const[r,i]=GL(e);return So(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,i]=YL(e);return So(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,i]=WL(e);return So(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(ze(e)||ze(n))throw new mn("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,c=pt.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[u,f,h,m]=wI(c,e,n);return m?Ue.invalid(m):So(u,f,r,`format ${n}`,e,h)}static fromString(e,n,r={}){return Ue.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,i]=tI(e);return So(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new mn("need to specify a reason the DateTime is invalid");const r=e instanceof Br?e:new Br(e,n);if(Ot.throwOnInvalid)throw new OP(r);return new Ue({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=nC(e,pt.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return JT(vn.parseFormat(e),pt.fromObject(n)).map(i=>i.val).join("")}static resetCache(){Nc=void 0,Qg.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?rg(this).weekYear:NaN}get weekNumber(){return this.isValid?rg(this).weekNumber:NaN}get weekday(){return this.isValid?rg(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ag(this).weekday:NaN}get localWeekNumber(){return this.isValid?ag(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ag(this).weekYear:NaN}get ordinal(){return this.isValid?eg(this.c).ordinal:NaN}get monthShort(){return this.isValid?kd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?kd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?kd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?kd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,r=Zf(this.c),i=this.zone.offset(r-e),o=this.zone.offset(r+e),c=this.zone.offset(r-i*n),u=this.zone.offset(r-o*n);if(c===u)return[this];const f=r-c*n,h=r-u*n,m=Dd(f,c),v=Dd(h,u);return m.hour===v.hour&&m.minute===v.minute&&m.second===v.second&&m.millisecond===v.millisecond?[di(this,{ts:f}),di(this,{ts:h})]:[this]}get isInLeapYear(){return iu(this.year)}get daysInMonth(){return bf(this.year,this.month)}get daysInYear(){return this.isValid?Vo(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vc(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vc(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:i}=vn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(Cn.instance(e),n)}toLocal(){return this.setZone(Ot.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=As(e,Ot.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){const o=e.offset(this.ts),c=this.toObject();[i]=ef(c,o,e)}return di(this,{ts:i,zone:e})}else return Ue.invalid(Ac(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return di(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=wf(e,k1),{minDaysInFirstWeek:r,startOfWeek:i}=y1(n,this.loc),o=!ze(n.weekYear)||!ze(n.weekNumber)||!ze(n.weekday),c=!ze(n.ordinal),u=!ze(n.year),f=!ze(n.month)||!ze(n.day),h=u||f,m=n.weekYear||n.weekNumber;if((h||c)&&m)throw new Bo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&c)throw new Bo("Can't mix ordinal dates with month/day");let v;o?v=g1({...yf(this.c,r,i),...n},r,i):ze(n.ordinal)?(v={...this.toObject(),...n},ze(n.day)&&(v.day=Math.min(bf(v.year,v.month),v.day))):v=v1({...eg(this.c),...n});const[x,w]=ef(v,this.o,this.zone);return di(this,{ts:x,o:w})}plus(e){if(!this.isValid)return this;const n=ot.fromDurationLike(e);return di(this,N1(this,n))}minus(e){if(!this.isValid)return this;const n=ot.fromDurationLike(e).negate();return di(this,N1(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=ot.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const o=this.loc.getStartOfWeek(),{weekday:c}=this;c<o&&(r.weekNumber=this.weekNumber-1),r.weekday=o}else r.weekday=1;if(i==="quarters"){const o=Math.ceil(this.month/3);r.month=(o-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?vn.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ng}toLocaleString(e=vf,n={}){return this.isValid?vn.create(this.loc.clone(n),e).formatDateTime(this):ng}toLocaleParts(e={}){return this.isValid?vn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1,precision:c="milliseconds"}={}){if(!this.isValid)return null;c=nf(c);const u=e==="extended";let f=sg(this,u,c);return tf.indexOf(c)>=3&&(f+="T"),f+=j1(this,u,n,r,i,o,c),f}toISODate({format:e="extended",precision:n="day"}={}){return this.isValid?sg(this,e==="extended",nf(n)):null}toISOWeekDate(){return Pd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:c="extended",precision:u="milliseconds"}={}){return this.isValid?(u=nf(u),(i&&tf.indexOf(u)>=3?"T":"")+j1(this,c==="extended",n,e,r,o,u)):null}toRFC2822(){return Pd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Pd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?sg(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),Pd(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ng}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return ot.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=aL(n).map(ot.normalizeUnit),c=e.valueOf()>this.valueOf(),u=c?this:e,f=c?e:this,h=oI(u,f,o,i);return c?h.negate():h}diffNow(e="milliseconds",n={}){return this.diff(Ue.now(),e,n)}until(e){return this.isValid?Lt.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(n,r)<=i&&i<=o.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Ue.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),D1(n,this.plus(r),{...e,numeric:"always",units:i,unit:o})}toRelativeCalendar(e={}){return this.isValid?D1(e.base||Ue.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Ue.isDateTime))throw new mn("min requires all arguments be DateTimes");return b1(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(Ue.isDateTime))throw new mn("max requires all arguments be DateTimes");return b1(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,c=pt.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return tC(c,e,n)}static fromStringExplain(e,n,r={}){return Ue.fromFormatExplain(e,n,r)}static buildFormatParser(e,n={}){const{locale:r=null,numberingSystem:i=null}=n,o=pt.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new eC(o,e)}static fromFormatParser(e,n,r={}){if(ze(e)||ze(n))throw new mn("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:o=null}=r,c=pt.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!c.equals(n.locale))throw new mn(`fromFormatParser called with a locale of ${c}, but the format parser was created for ${n.locale}`);const{result:u,zone:f,specificOffset:h,invalidReason:m}=n.explainFromTokens(e);return m?Ue.invalid(m):So(u,f,r,`format ${n.format}`,e,h)}static get DATE_SHORT(){return vf}static get DATE_MED(){return sT}static get DATE_MED_WITH_WEEKDAY(){return jP}static get DATE_FULL(){return iT}static get DATE_HUGE(){return oT}static get TIME_SIMPLE(){return lT}static get TIME_WITH_SECONDS(){return cT}static get TIME_WITH_SHORT_OFFSET(){return uT}static get TIME_WITH_LONG_OFFSET(){return dT}static get TIME_24_SIMPLE(){return fT}static get TIME_24_WITH_SECONDS(){return hT}static get TIME_24_WITH_SHORT_OFFSET(){return pT}static get TIME_24_WITH_LONG_OFFSET(){return mT}static get DATETIME_SHORT(){return gT}static get DATETIME_SHORT_WITH_SECONDS(){return vT}static get DATETIME_MED(){return yT}static get DATETIME_MED_WITH_SECONDS(){return bT}static get DATETIME_MED_WITH_WEEKDAY(){return kP}static get DATETIME_FULL(){return wT}static get DATETIME_FULL_WITH_SECONDS(){return xT}static get DATETIME_HUGE(){return ST}static get DATETIME_HUGE_WITH_SECONDS(){return ET}}function bc(t){if(Ue.isDateTime(t))return t;if(t&&t.valueOf&&ks(t.valueOf()))return Ue.fromJSDate(t);if(t&&typeof t=="object")return Ue.fromObject(t);throw new mn(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function CI(){return!1}var ll=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_i=typeof window>"u"||"Deno"in globalThis;function Tn(){}function RI(t,e){return typeof t=="function"?t(e):t}function Xg(t){return typeof t=="number"&&t>=0&&t!==1/0}function sC(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ms(t,e){return typeof t=="function"?t(e):t}function Ur(t,e){return typeof t=="function"?t(e):t}function L1(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:c,stale:u}=t;if(c){if(r){if(e.queryHash!==my(c,e.options))return!1}else if(!Gc(e.queryKey,c))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||o&&!o(e))}function I1(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Ti(e.options.mutationKey)!==Ti(o))return!1}else if(!Gc(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function my(t,e){return(e?.queryKeyHashFn||Ti)(t)}function Ti(t){return JSON.stringify(t,(e,n)=>Jg(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Gc(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Gc(t[n],e[n])):!1}function iC(t,e){if(t===e)return t;const n=z1(t)&&z1(e);if(n||Jg(t)&&Jg(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),c=o.length,u=n?[]:{},f=new Set(r);let h=0;for(let m=0;m<c;m++){const v=n?m:o[m];(!n&&f.has(v)||n)&&t[v]===void 0&&e[v]===void 0?(u[v]=void 0,h++):(u[v]=iC(t[v],e[v]),u[v]===t[v]&&t[v]!==void 0&&h++)}return i===c&&h===i?t:u}return e}function xf(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function z1(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Jg(t){if(!U1(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!U1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function U1(t){return Object.prototype.toString.call(t)==="[object Object]"}function OI(t){return new Promise(e=>{setTimeout(e,t)})}function ev(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?iC(t,e):e}function AI(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function NI(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var gy=Symbol();function oC(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===gy?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function lC(t,e){return typeof t=="function"?t(...e):!!t}var jI=class extends ll{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!_i&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},vy=new jI,kI=class extends ll{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!_i&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#t}},Sf=new kI;function tv(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function MI(t){return Math.min(1e3*2**t,3e4)}function cC(t){return(t??"online")==="online"?Sf.isOnline():!0}var uC=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function ig(t){return t instanceof uC}function dC(t){let e=!1,n=0,r=!1,i;const o=tv(),c=E=>{r||(x(new uC(E)),t.abort?.())},u=()=>{e=!0},f=()=>{e=!1},h=()=>vy.isFocused()&&(t.networkMode==="always"||Sf.isOnline())&&t.canRun(),m=()=>cC(t.networkMode)&&t.canRun(),v=E=>{r||(r=!0,t.onSuccess?.(E),i?.(),o.resolve(E))},x=E=>{r||(r=!0,t.onError?.(E),i?.(),o.reject(E))},w=()=>new Promise(E=>{i=_=>{(r||h())&&E(_)},t.onPause?.()}).then(()=>{i=void 0,r||t.onContinue?.()}),S=()=>{if(r)return;let E;const _=n===0?t.initialPromise:void 0;try{E=_??t.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(v).catch(C=>{if(r)return;const R=t.retry??(_i?0:3),A=t.retryDelay??MI,k=typeof A=="function"?A(n,C):A,D=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(e||!D){x(C);return}n++,t.onFail?.(n,C),OI(k).then(()=>h()?void 0:w()).then(()=>{e?x(C):S()})})};return{promise:o,cancel:c,continue:()=>(i?.(),o),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?S():w().then(S),o)}}var DI=t=>setTimeout(t,0);function PI(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=DI;const o=u=>{e?t.push(u):i(()=>{n(u)})},c=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||c()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Xt=PI(),fC=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xg(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(_i?1/0:5*60*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},LI=class extends fC{#t;#e;#n;#r;#a;#i;#o;constructor(t){super(),this.#o=!1,this.#i=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=II(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(t){this.options={...this.#i,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=ev(this.state.data,t,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#s({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#a?.promise;return this.#a?.cancel(t),e?e.then(Tn).catch(Tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>Ur(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gy||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ms(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!sC(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#a&&(this.#o?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,r=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const f=oC(this.options,e),m=(()=>{const v={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},c=(()=>{const f={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(f),f})();this.options.behavior?.onFetch(c,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta});const u=f=>{ig(f)&&f.silent||this.#s({type:"error",error:f}),ig(f)||(this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this)),this.scheduleGc()};return this.#a=dC({initialPromise:e?.initialPromise,fn:c.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{if(f===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(h){u(h);return}this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),this.scheduleGc()},onError:u,onFail:(f,h)=>{this.#s({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}),this.#a.start()}#s(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hC(n.data,this.options),fetchMeta:t.meta??null};case"success":return this.#e=void 0,{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return ig(r)&&r.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Xt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function hC(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cC(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function II(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zI=class extends ll{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,n){const r=e.queryKey,i=e.queryHash??my(r,e);let o=this.get(i);return o||(o=new LI({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>L1(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>L1(t,n)):e}notify(t){Xt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},UI=class extends fC{#t;#e;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#e=t.mutationCache,this.#t=[],this.state=t.state||pC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})};this.#n=dC({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#r({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#e.config.onMutate?.(t,this);const o=await this.options.onMutate?.(t);o!==this.state.context&&this.#r({type:"pending",context:o,variables:t,isPaused:r})}const i=await this.#n.start();return await this.#e.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#e.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#e.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#e.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#r({type:"error",error:i})}}finally{this.#e.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Xt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#e.notify({mutation:this,type:"updated",action:t})})}};function pC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $I=class extends ll{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(t,e,n){const r=new UI({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#t.add(t);const e=Ld(t);if(typeof e=="string"){const n=this.#e.get(e);n?n.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=Ld(t);if(typeof e=="string"){const n=this.#e.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Ld(t);if(typeof e=="string"){const r=this.#e.get(e)?.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=Ld(t);return typeof e=="string"?this.#e.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Xt.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>I1(e,n))}findAll(t={}){return this.getAll().filter(e=>I1(t,e))}notify(t){Xt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Xt.batch(()=>Promise.all(t.map(e=>e.continue().catch(Tn))))}};function Ld(t){return t.options.scope?.id}function $1(t){return{onFetch:(e,n)=>{const r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],c=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let m=!1;const v=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},x=oC(e.options,e.fetchOptions),w=async(S,E,_)=>{if(m)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const R=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:E,direction:_?"backward":"forward",meta:e.options.meta};return v(N),N})(),A=await x(R),{maxPages:k}=e.options,D=_?NI:AI;return{pages:D(S.pages,A,k),pageParams:D(S.pageParams,E,k)}};if(i&&o.length){const S=i==="backward",E=S?BI:B1,_={pages:o,pageParams:c},C=E(r,_);u=await w(_,C,S)}else{const S=t??o.length;do{const E=f===0?c[0]??r.initialPageParam:B1(r,u);if(f>0&&E==null)break;u=await w(u,E),f++}while(f<S)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=h}}}function B1(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function BI(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var HI=class{#t;#e;#n;#r;#a;#i;#o;#s;constructor(t={}){this.#t=t.queryCache||new zI,this.#e=t.mutationCache||new $I,this.#n=t.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=vy.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Sf.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#t.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ms(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),o=this.#t.get(r.queryHash)?.state.data,c=RI(e,o);if(c!==void 0)return this.#t.build(this,r).setData(c,{...n,manual:!0})}setQueriesData(t,e,n){return Xt.batch(()=>this.#t.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;Xt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#t;return Xt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Xt.batch(()=>this.#t.findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Tn).catch(Tn)}invalidateQueries(t,e={}){return Xt.batch(()=>(this.#t.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Xt.batch(()=>this.#t.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Tn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#t.build(this,e);return n.isStaleByTime(Ms(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Tn).catch(Tn)}fetchInfiniteQuery(t){return t.behavior=$1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Tn).catch(Tn)}ensureInfiniteQueryData(t){return t.behavior=$1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Sf.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(Ti(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{Gc(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#a.set(Ti(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#a.values()],n={};return e.forEach(r=>{Gc(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=my(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===gy&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},FI=class extends ll{constructor(t,e){super(),this.options=e,this.#t=t,this.#s=null,this.#o=tv(),this.options.experimental_prefetchInRender||this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#i;#o;#s;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),H1(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nv(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nv(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#x(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ur(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!xf(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&F1(this.#e,n,this.options,e)&&this.#d(),this.updateResult(),r&&(this.#e!==n||Ur(this.options.enabled,this.#e)!==Ur(e.enabled,this.#e)||Ms(this.options.staleTime,this.#e)!==Ms(e.staleTime,this.#e))&&this.#g();const i=this.#v();r&&(this.#e!==n||Ur(this.options.enabled,this.#e)!==Ur(e.enabled,this.#e)||i!==this.#l)&&this.#y(i)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),n=this.createResult(e,t);return VI(this,n)&&(this.#r=n,this.#i=this.options,this.#a=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),Reflect.get(n,r))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),n=this.#t.getQueryCache().build(this.#t,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Tn)),e}#g(){this.#w();const t=Ms(this.options.staleTime,this.#e);if(_i||this.#r.isStale||!Xg(t))return;const n=sC(this.#r.dataUpdatedAt,t)+1;this.#c=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(t){this.#x(),this.#l=t,!(_i||Ur(this.options.enabled,this.#e)===!1||!Xg(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||vy.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#w(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const n=this.#e,r=this.options,i=this.#r,o=this.#a,c=this.#i,f=t!==n?t.state:this.#n,{state:h}=t;let m={...h},v=!1,x;if(e._optimisticResults){const Z=this.hasListeners(),Q=!Z&&H1(t,e),te=Z&&F1(t,n,e,r);(Q||te)&&(m={...m,...hC(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:E}=m;x=m.data;let _=!1;if(e.placeholderData!==void 0&&x===void 0&&E==="pending"){let Z;i?.isPlaceholderData&&e.placeholderData===c?.placeholderData?(Z=i.data,_=!0):Z=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,Z!==void 0&&(E="success",x=ev(i?.data,Z,e),v=!0)}if(e.select&&x!==void 0&&!_)if(i&&x===o?.data&&e.select===this.#m)x=this.#f;else try{this.#m=e.select,x=e.select(x),x=ev(i?.data,x,e),this.#f=x,this.#s=null}catch(Z){this.#s=Z}this.#s&&(w=this.#s,x=this.#f,S=Date.now(),E="error");const C=m.fetchStatus==="fetching",R=E==="pending",A=E==="error",k=R&&C,D=x!==void 0,L={status:E,fetchStatus:m.fetchStatus,isPending:R,isSuccess:E==="success",isError:A,isInitialLoading:k,isLoading:k,data:x,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!R,isLoadingError:A&&!D,isPaused:m.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:A&&D,isStale:yy(t,e),refetch:this.refetch,promise:this.#o};if(this.options.experimental_prefetchInRender){const Z=ce=>{L.status==="error"?ce.reject(L.error):L.data!==void 0&&ce.resolve(L.data)},Q=()=>{const ce=this.#o=L.promise=tv();Z(ce)},te=this.#o;switch(te.status){case"pending":t.queryHash===n.queryHash&&Z(te);break;case"fulfilled":(L.status==="error"||L.data!==te.value)&&Q();break;case"rejected":(L.status!=="error"||L.error!==te.reason)&&Q();break}}return L}updateResult(){const t=this.#r,e=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#i=this.options,this.#a.data!==void 0&&(this.#h=this.#e),xf(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const o=new Set(i??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(c=>{const u=c;return this.#r[u]!==t[u]&&o.has(u)})};this.#E({listeners:n()})}#S(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function qI(t,e){return Ur(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function H1(t,e){return qI(t,e)||t.state.data!==void 0&&nv(t,e,e.refetchOnMount)}function nv(t,e,n){if(Ur(e.enabled,t)!==!1&&Ms(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&yy(t,e)}return!1}function F1(t,e,n,r){return(t!==e||Ur(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&yy(t,n)}function yy(t,e){return Ur(e.enabled,t)!==!1&&t.isStaleByTime(Ms(e.staleTime,t))}function VI(t,e){return!xf(t.getCurrentResult(),e)}var GI=class extends ll{#t;#e=void 0;#n;#r;constructor(e,n){super(),this.#t=e,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#t.defaultMutationOptions(e),xf(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ti(n.mutationKey)!==Ti(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#a(),this.#i(e)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#i()}mutate(e,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(e)}#a(){const e=this.#n?.state??pC();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#i(e){Xt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context;e?.type==="success"?(this.#r.onSuccess?.(e.data,n,r),this.#r.onSettled?.(e.data,null,n,r)):e?.type==="error"&&(this.#r.onError?.(e.error,n,r),this.#r.onSettled?.(void 0,e.error,n,r))}this.listeners.forEach(n=>{n(this.#e)})})}},mC=b.createContext(void 0),gC=t=>{const e=b.useContext(mC);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},YI=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),g.jsx(mC.Provider,{value:t,children:e})),vC=b.createContext(!1),WI=()=>b.useContext(vC);vC.Provider;function KI(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var ZI=b.createContext(KI()),QI=()=>b.useContext(ZI),XI=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},JI=t=>{b.useEffect(()=>{t.clearReset()},[t])},e4=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||lC(n,[t.error,r])),t4=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},n4=(t,e)=>t.isLoading&&t.isFetching&&!e,r4=(t,e)=>t?.suspense&&e.isPending,q1=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function a4(t,e,n){const r=WI(),i=QI(),o=gC(),c=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(c),c._optimisticResults=r?"isRestoring":"optimistic",t4(c),XI(c,i),JI(i);const u=!o.getQueryCache().get(c.queryHash),[f]=b.useState(()=>new e(o,c)),h=f.getOptimisticResult(c),m=!r&&t.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(v=>{const x=m?f.subscribe(Xt.batchCalls(v)):Tn;return f.updateResult(),x},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(c)},[c,f]),r4(c,h))throw q1(c,f,i);if(e4({result:h,errorResetBoundary:i,throwOnError:c.throwOnError,query:o.getQueryCache().get(c.queryHash),suspense:c.suspense}))throw h.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(c,h),c.experimental_prefetchInRender&&!_i&&n4(h,r)&&(u?q1(c,f,i):o.getQueryCache().get(c.queryHash)?.promise)?.catch(Tn).finally(()=>{f.updateResult()}),c.notifyOnChangeProps?h:f.trackResult(h)}function Jf(t,e){return a4(t,FI)}function Fa(t,e){const n=gC(),[r]=b.useState(()=>new GI(n,t));b.useEffect(()=>{r.setOptions(t)},[r,t]);const i=b.useSyncExternalStore(b.useCallback(c=>r.subscribe(Xt.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((c,u)=>{r.mutate(c,u).catch(Tn)},[r]);if(i.error&&lC(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const qa={mySpecs:()=>["mySpecs"],openApiSpec:(t,e)=>["openapi-spec",t,e],session:()=>["session"],verifyUserAccess:(t,e)=>["verifyUserAccess",t,e]},s4=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>tu(async()=>{const{default:r}=await Promise.resolve().then(()=>cl);return{default:r}},[]).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)};class by extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class i4 extends by{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class V1 extends by{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class G1 extends by{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var rv;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(rv||(rv={}));var o4=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};class l4{constructor(e,{headers:n={},customFetch:r,region:i=rv.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=s4(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,n={}){var r;return o4(this,void 0,void 0,function*(){try{const{headers:i,method:o,body:c}=n;let u={},{region:f}=n;f||(f=this.region);const h=new URL(`${this.url}/${e}`);f&&f!=="any"&&(u["x-region"]=f,h.searchParams.set("forceFunctionRegion",f));let m;c&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",m=c):typeof c=="string"?(u["Content-Type"]="text/plain",m=c):typeof FormData<"u"&&c instanceof FormData?m=c:(u["Content-Type"]="application/json",m=JSON.stringify(c)));const v=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:m}).catch(E=>{throw new i4(E)}),x=v.headers.get("x-relay-error");if(x&&x==="true")throw new V1(v);if(!v.ok)throw new G1(v);let w=((r=v.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield v.json():w==="application/octet-stream"?S=yield v.blob():w==="text/event-stream"?S=v:w==="multipart/form-data"?S=yield v.formData():S=yield v.text(),{data:S,error:null,response:v}}catch(i){return{data:null,error:i,response:i instanceof G1||i instanceof V1?i.context:void 0}}})}}var sn={},Eo={},_o={},To={},Co={},Ro={},c4=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Xo=c4();const u4=Xo.fetch,yC=Xo.fetch.bind(Xo),bC=Xo.Headers,d4=Xo.Request,f4=Xo.Response,cl=Object.freeze(Object.defineProperty({__proto__:null,Headers:bC,Request:d4,Response:f4,default:yC,fetch:u4},Symbol.toStringTag,{value:"Module"})),h4=cM(cl);var Id={},Y1;function wC(){if(Y1)return Id;Y1=1,Object.defineProperty(Id,"__esModule",{value:!0});class t extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.code=n.code}}return Id.default=t,Id}var W1;function xC(){if(W1)return Ro;W1=1;var t=Ro&&Ro.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ro,"__esModule",{value:!0});const e=t(h4),n=t(wC());class r{constructor(o){this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=o.headers,this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=o.shouldThrowOnError,this.signal=o.signal,this.isMaybeSingle=o.isMaybeSingle,o.fetch?this.fetch=o.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,c){return this.headers=Object.assign({},this.headers),this.headers[o]=c,this}then(o,c){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const u=this.fetch;let f=u(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var m,v,x;let w=null,S=null,E=null,_=h.status,C=h.statusText;if(h.ok){if(this.method!=="HEAD"){const D=await h.text();D===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?S=D:S=JSON.parse(D))}const A=(m=this.headers.Prefer)===null||m===void 0?void 0:m.match(/count=(exact|planned|estimated)/),k=(v=h.headers.get("content-range"))===null||v===void 0?void 0:v.split("/");A&&k&&k.length>1&&(E=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(S)&&(S.length>1?(w={code:"PGRST116",details:`Results contain ${S.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},S=null,E=null,_=406,C="Not Acceptable"):S.length===1?S=S[0]:S=null)}else{const A=await h.text();try{w=JSON.parse(A),Array.isArray(w)&&h.status===404&&(S=[],w=null,_=200,C="OK")}catch{h.status===404&&A===""?(_=204,C="No Content"):w={message:A}}if(w&&this.isMaybeSingle&&(!((x=w?.details)===null||x===void 0)&&x.includes("0 rows"))&&(w=null,_=200,C="OK"),w&&this.shouldThrowOnError)throw new n.default(w)}return{error:w,data:S,count:E,status:_,statusText:C}});return this.shouldThrowOnError||(f=f.catch(h=>{var m,v,x;return{error:{message:`${(m=h?.name)!==null&&m!==void 0?m:"FetchError"}: ${h?.message}`,details:`${(v=h?.stack)!==null&&v!==void 0?v:""}`,hint:"",code:`${(x=h?.code)!==null&&x!==void 0?x:""}`},data:null,count:null,status:0,statusText:""}})),f.then(o,c)}returns(){return this}overrideTypes(){return this}}return Ro.default=r,Ro}var K1;function SC(){if(K1)return Co;K1=1;var t=Co&&Co.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Co,"__esModule",{value:!0});const e=t(xC());class n extends e.default{select(i){let o=!1;const c=(i??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join("");return this.url.searchParams.set("select",c),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(i,{ascending:o=!0,nullsFirst:c,foreignTable:u,referencedTable:f=u}={}){const h=f?`${f}.order`:"order",m=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${m?`${m},`:""}${i}.${o?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:o,referencedTable:c=o}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${i}`),this}range(i,o,{foreignTable:c,referencedTable:u=c}={}){const f=typeof u>"u"?"offset":`${u}.offset`,h=typeof u>"u"?"limit":`${u}.limit`;return this.url.searchParams.set(f,`${i}`),this.url.searchParams.set(h,`${o-i+1}`),this}abortSignal(i){return this.signal=i,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:i=!1,verbose:o=!1,settings:c=!1,buffers:u=!1,wal:f=!1,format:h="text"}={}){var m;const v=[i?"analyze":null,o?"verbose":null,c?"settings":null,u?"buffers":null,f?"wal":null].filter(Boolean).join("|"),x=(m=this.headers.Accept)!==null&&m!==void 0?m:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${h}; for="${x}"; options=${v};`,h==="json"?this:this}rollback(){var i;return((i=this.headers.Prefer)!==null&&i!==void 0?i:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return Co.default=n,Co}var Z1;function wy(){if(Z1)return To;Z1=1;var t=To&&To.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(To,"__esModule",{value:!0});const e=t(SC());class n extends e.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}in(i,o){const c=Array.from(new Set(o)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(i,`in.(${c})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:c,type:u}={}){let f="";u==="plain"?f="pl":u==="phrase"?f="ph":u==="websearch"&&(f="w");const h=c===void 0?"":`(${c})`;return this.url.searchParams.append(i,`${f}fts${h}.${o}`),this}match(i){return Object.entries(i).forEach(([o,c])=>{this.url.searchParams.append(o,`eq.${c}`)}),this}not(i,o,c){return this.url.searchParams.append(i,`not.${o}.${c}`),this}or(i,{foreignTable:o,referencedTable:c=o}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${i})`),this}filter(i,o,c){return this.url.searchParams.append(i,`${o}.${c}`),this}}return To.default=n,To}var Q1;function EC(){if(Q1)return _o;Q1=1;var t=_o&&_o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_o,"__esModule",{value:!0});const e=t(wy());class n{constructor(i,{headers:o={},schema:c,fetch:u}){this.url=i,this.headers=o,this.schema=c,this.fetch=u}select(i,{head:o=!1,count:c}={}){const u=o?"HEAD":"GET";let f=!1;const h=(i??"*").split("").map(m=>/\s/.test(m)&&!f?"":(m==='"'&&(f=!f),m)).join("");return this.url.searchParams.set("select",h),c&&(this.headers.Prefer=`count=${c}`),new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(i,{count:o,defaultToNull:c=!0}={}){const u="POST",f=[];if(this.headers.Prefer&&f.push(this.headers.Prefer),o&&f.push(`count=${o}`),c||f.push("missing=default"),this.headers.Prefer=f.join(","),Array.isArray(i)){const h=i.reduce((m,v)=>m.concat(Object.keys(v)),[]);if(h.length>0){const m=[...new Set(h)].map(v=>`"${v}"`);this.url.searchParams.set("columns",m.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:this.fetch,allowEmpty:!1})}upsert(i,{onConflict:o,ignoreDuplicates:c=!1,count:u,defaultToNull:f=!0}={}){const h="POST",m=[`resolution=${c?"ignore":"merge"}-duplicates`];if(o!==void 0&&this.url.searchParams.set("on_conflict",o),this.headers.Prefer&&m.push(this.headers.Prefer),u&&m.push(`count=${u}`),f||m.push("missing=default"),this.headers.Prefer=m.join(","),Array.isArray(i)){const v=i.reduce((x,w)=>x.concat(Object.keys(w)),[]);if(v.length>0){const x=[...new Set(v)].map(w=>`"${w}"`);this.url.searchParams.set("columns",x.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:this.fetch,allowEmpty:!1})}update(i,{count:o}={}){const c="PATCH",u=[];return this.headers.Prefer&&u.push(this.headers.Prefer),o&&u.push(`count=${o}`),this.headers.Prefer=u.join(","),new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:this.fetch,allowEmpty:!1})}delete({count:i}={}){const o="DELETE",c=[];return i&&c.push(`count=${i}`),this.headers.Prefer&&c.unshift(this.headers.Prefer),this.headers.Prefer=c.join(","),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return _o.default=n,_o}var wc={},xc={},X1;function p4(){return X1||(X1=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.version=void 0,xc.version="0.0.0-automated"),xc}var J1;function m4(){if(J1)return wc;J1=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.DEFAULT_HEADERS=void 0;const t=p4();return wc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${t.version}`},wc}var eE;function g4(){if(eE)return Eo;eE=1;var t=Eo&&Eo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Eo,"__esModule",{value:!0});const e=t(EC()),n=t(wy()),r=m4();class i{constructor(c,{headers:u={},schema:f,fetch:h}={}){this.url=c,this.headers=Object.assign(Object.assign({},r.DEFAULT_HEADERS),u),this.schemaName=f,this.fetch=h}from(c){const u=new URL(`${this.url}/${c}`);return new e.default(u,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(c){return new i(this.url,{headers:this.headers,schema:c,fetch:this.fetch})}rpc(c,u={},{head:f=!1,get:h=!1,count:m}={}){let v;const x=new URL(`${this.url}/rpc/${c}`);let w;f||h?(v=f?"HEAD":"GET",Object.entries(u).filter(([E,_])=>_!==void 0).map(([E,_])=>[E,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([E,_])=>{x.searchParams.append(E,_)})):(v="POST",w=u);const S=Object.assign({},this.headers);return m&&(S.Prefer=`count=${m}`),new n.default({method:v,url:x,headers:S,schema:this.schemaName,body:w,fetch:this.fetch,allowEmpty:!1})}}return Eo.default=i,Eo}var tE;function v4(){if(tE)return sn;tE=1;var t=sn&&sn.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.PostgrestError=sn.PostgrestBuilder=sn.PostgrestTransformBuilder=sn.PostgrestFilterBuilder=sn.PostgrestQueryBuilder=sn.PostgrestClient=void 0;const e=t(g4());sn.PostgrestClient=e.default;const n=t(EC());sn.PostgrestQueryBuilder=n.default;const r=t(wy());sn.PostgrestFilterBuilder=r.default;const i=t(SC());sn.PostgrestTransformBuilder=i.default;const o=t(xC());sn.PostgrestBuilder=o.default;const c=t(wC());return sn.PostgrestError=c.default,sn.default={PostgrestClient:e.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:r.default,PostgrestTransformBuilder:i.default,PostgrestBuilder:o.default,PostgrestError:c.default},sn}var y4=v4();const b4=Kv(y4),{PostgrestClient:w4,PostgrestQueryBuilder:J9,PostgrestFilterBuilder:eV,PostgrestTransformBuilder:tV,PostgrestBuilder:nV,PostgrestError:rV}=b4;class x4{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"&&process.versions&&process.versions.node){const n=parseInt(process.versions.node.split(".")[0]);return n>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`

Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const S4="2.15.1",E4=`realtime-js/${S4}`,_4="1.0.0",av=1e4,T4=1e3,C4=100;var $c;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})($c||($c={}));var Zt;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Zt||(Zt={}));var zr;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(zr||(zr={}));var sv;(function(t){t.websocket="websocket"})(sv||(sv={}));var vi;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(vi||(vi={}));class R4{constructor(){this.HEADER_LENGTH=1}decode(e,n){return e.constructor===ArrayBuffer?n(this._binaryDecode(e)):n(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const n=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,n,r)}_decodeBroadcast(e,n,r){const i=n.getUint8(1),o=n.getUint8(2);let c=this.HEADER_LENGTH+2;const u=r.decode(e.slice(c,c+i));c=c+i;const f=r.decode(e.slice(c,c+o));c=c+o;const h=JSON.parse(r.decode(e.slice(c,e.byteLength)));return{ref:null,topic:u,event:f,payload:h}}}class _C{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Et;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Et||(Et={}));const nE=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((o,c)=>(o[c]=O4(c,t,e,i),o),{})},O4=(t,e,n,r)=>{const i=e.find(u=>u.name===t),o=i?.type,c=n[t];return o&&!r.includes(o)?TC(o,c):iv(c)},TC=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return k4(e,n)}switch(t){case Et.bool:return A4(e);case Et.float4:case Et.float8:case Et.int2:case Et.int4:case Et.int8:case Et.numeric:case Et.oid:return N4(e);case Et.json:case Et.jsonb:return j4(e);case Et.timestamp:return M4(e);case Et.abstime:case Et.date:case Et.daterange:case Et.int4range:case Et.int8range:case Et.money:case Et.reltime:case Et.text:case Et.time:case Et.timestamptz:case Et.timetz:case Et.tsrange:case Et.tstzrange:return iv(e);default:return iv(e)}},iv=t=>t,A4=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},N4=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},j4=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},k4=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let o;const c=t.slice(1,n);try{o=JSON.parse("["+c+"]")}catch{o=c?c.split(","):[]}return o.map(u=>TC(e,u))}return t},M4=t=>typeof t=="string"?t.replace(" ","T"):t,CC=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"};class og{constructor(e,n,r={},i=av){this.channel=e,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var rE;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(rE||(rE={}));class Bc{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=n?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:o,onLeave:c,onSync:u}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Bc.syncState(this.state,i,o,c),this.pendingDiffs.forEach(f=>{this.state=Bc.syncDiff(this.state,f,o,c)}),this.pendingDiffs=[],u()}),this.channel._on(r.diff,{},i=>{const{onJoin:o,onLeave:c,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Bc.syncDiff(this.state,i,o,c),u())}),this.onJoin((i,o,c)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:o,newPresences:c})}),this.onLeave((i,o,c)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:o,leftPresences:c})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,i){const o=this.cloneDeep(e),c=this.transformState(n),u={},f={};return this.map(o,(h,m)=>{c[h]||(f[h]=m)}),this.map(c,(h,m)=>{const v=o[h];if(v){const x=m.map(_=>_.presence_ref),w=v.map(_=>_.presence_ref),S=m.filter(_=>w.indexOf(_.presence_ref)<0),E=v.filter(_=>x.indexOf(_.presence_ref)<0);S.length>0&&(u[h]=S),E.length>0&&(f[h]=E)}else u[h]=m}),this.syncDiff(o,{joins:u,leaves:f},r,i)}static syncDiff(e,n,r,i){const{joins:o,leaves:c}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(o,(u,f)=>{var h;const m=(h=e[u])!==null&&h!==void 0?h:[];if(e[u]=this.cloneDeep(f),m.length>0){const v=e[u].map(w=>w.presence_ref),x=m.filter(w=>v.indexOf(w.presence_ref)<0);e[u].unshift(...x)}r(u,m,f)}),this.map(c,(u,f)=>{let h=e[u];if(!h)return;const m=f.map(v=>v.presence_ref);h=h.filter(v=>m.indexOf(v.presence_ref)<0),e[u]=h,i(u,h,f),h.length===0&&delete e[u]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return"metas"in i?n[r]=i.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):n[r]=i,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var aE;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(aE||(aE={}));var Hc;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Hc||(Hc={}));var Ia;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Ia||(Ia={}));class xy{constructor(e,n={config:{}},r){this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Zt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new og(this,zr.join,this.params,this.timeout),this.rejoinTimer=new _C(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Zt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Zt.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Zt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Zt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Zt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(zr.reply,{},(i,o)=>{this._trigger(this._replyEventName(o),i)}),this.presence=new Bc(this),this.broadcastEndpointURL=CC(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(e,n=this.timeout){var r,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Zt.closed){const{config:{broadcast:o,presence:c,private:u}}=this.params,f=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(x=>x.filter))!==null&&i!==void 0?i:[],h=!!this.bindings[Hc.PRESENCE]&&this.bindings[Hc.PRESENCE].length>0,m={},v={broadcast:o,presence:Object.assign(Object.assign({},c),{enabled:h}),postgres_changes:f,private:u};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(x=>e?.(Ia.CHANNEL_ERROR,x)),this._onClose(()=>e?.(Ia.CLOSED)),this.updateJoinPayload(Object.assign({config:v},m)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:x})=>{var w;if(this.socket.setAuth(),x===void 0){e?.(Ia.SUBSCRIBED);return}else{const S=this.bindings.postgres_changes,E=(w=S?.length)!==null&&w!==void 0?w:0,_=[];for(let C=0;C<E;C++){const R=S[C],{filter:{event:A,schema:k,table:D,filter:N}}=R,L=x&&x[C];if(L&&L.event===A&&L.schema===k&&L.table===D&&L.filter===N)_.push(Object.assign(Object.assign({},R),{id:L.id}));else{this.unsubscribe(),this.state=Zt.errored,e?.(Ia.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=_,e&&e(Ia.SUBSCRIBED);return}}).receive("error",x=>{this.state=Zt.errored,e?.(Ia.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(x).join(", ")||"error")))}).receive("timeout",()=>{e?.(Ia.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===Zt.joined&&e===Hc.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,n,r)}async send(e,n={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){const{event:o,payload:c}=e,f={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:c,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,f,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=h.body)===null||i===void 0?void 0:i.cancel()),h.ok?"ok":"error"}catch(h){return h.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var c,u,f;const h=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((f=(u=(c=this.params)===null||c===void 0?void 0:c.config)===null||u===void 0?void 0:u.broadcast)===null||f===void 0)&&f.ack)&&o("ok"),h.receive("ok",()=>o("ok")),h.receive("error",()=>o("error")),h.receive("timeout",()=>o("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Zt.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(zr.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new og(this,zr.leave,{},e),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Zt.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const i=new AbortController,o=setTimeout(()=>i.abort(),r),c=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(o),c}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new og(this,e,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>C4){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var i,o;const c=e.toLocaleLowerCase(),{close:u,error:f,leave:h,join:m}=zr;if(r&&[u,f,h,m].indexOf(c)>=0&&r!==this._joinRef())return;let x=this._onMessage(c,n,r);if(n&&!x)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(c)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(w=>{var S,E,_;return((S=w.filter)===null||S===void 0?void 0:S.event)==="*"||((_=(E=w.filter)===null||E===void 0?void 0:E.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===c}).map(w=>w.callback(x,r)):(o=this.bindings[c])===null||o===void 0||o.filter(w=>{var S,E,_,C,R,A;if(["broadcast","presence","postgres_changes"].includes(c))if("id"in w){const k=w.id,D=(S=w.filter)===null||S===void 0?void 0:S.event;return k&&((E=n.ids)===null||E===void 0?void 0:E.includes(k))&&(D==="*"||D?.toLocaleLowerCase()===((_=n.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const k=(R=(C=w?.filter)===null||C===void 0?void 0:C.event)===null||R===void 0?void 0:R.toLocaleLowerCase();return k==="*"||k===((A=n?.event)===null||A===void 0?void 0:A.toLocaleLowerCase())}else return w.type.toLocaleLowerCase()===c}).map(w=>{if(typeof x=="object"&&"ids"in x){const S=x.data,{schema:E,table:_,commit_timestamp:C,type:R,errors:A}=S;x=Object.assign(Object.assign({},{schema:E,table:_,commit_timestamp:C,eventType:R,new:{},old:{},errors:A}),this._getPayloadRecords(S))}w.callback(x,r)})}_isClosed(){return this.state===Zt.closed}_isJoined(){return this.state===Zt.joined}_isJoining(){return this.state===Zt.joining}_isLeaving(){return this.state===Zt.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const i=e.toLocaleLowerCase(),o={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(o):this.bindings[i]=[o],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var o;return!(((o=i.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===r&&xy.isEqual(i.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(zr.close,{},e)}_onError(e){this._on(zr.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Zt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=nE(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=nE(e.columns,e.old_record)),n}}const sE=()=>{},zd={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},D4=[1e3,2e3,5e3,1e4],P4=1e4,L4=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class I4{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=av,this.transport=null,this.heartbeatIntervalMs=zd.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=sE,this.ref=0,this.reconnectTimer=null,this.logger=sE,this.conn=null,this.sendBuffer=[],this.serializer=new R4,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...c)=>tu(async()=>{const{default:u}=await Promise.resolve().then(()=>cl);return{default:u}},void 0).then(({default:u})=>u(...c)).catch(u=>{throw new Error(`Failed to load @supabase/node-fetch: ${u.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):o=fetch,(...c)=>o(...c)},!(!((r=n?.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${sv.websocket}`,this.httpEndpoint=CC(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=x4.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n}

To use Realtime in Node.js, you need to provide a WebSocket implementation:

Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:_4}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},e?this.conn.close(e,n??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case $c.connecting:return vi.Connecting;case $c.open:return vi.Open;case $c.closing:return vi.Closing;default:return vi.Closed}}isConnected(){return this.connectionState()===vi.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(o=>o.topic===r);if(i)return i;{const o=new xy(`realtime:${e}`,n,this);return this.channels.push(o),o}}push(e){const{topic:n,event:r,payload:i,ref:o}=e,c=()=>{this.encode(e,u=>{var f;(f=this.conn)===null||f===void 0||f.send(u)})};this.log("push",`${n} ${r} (${o})`,i),this.isConnected()?c():this.sendBuffer.push(c)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(T4,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},zd.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{n.topic==="phoenix"&&n.event==="phx_reply"&&this.heartbeatCallback(n.payload.status==="ok"?"ok":"error"),n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:i,payload:o,ref:c}=n,u=c?`(${c})`:"",f=o.status||"";this.log("receive",`${f} ${r} ${i} ${u}`.trim(),o),this.channels.filter(h=>h._isMember(r)).forEach(h=>h._trigger(i,o,c)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(zr.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${e}${r}${i}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([L4],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n;e?n=e:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const i={access_token:n,version:E4};n&&r.updateJoinPayload(i),r.joinedOnce&&r._isJoined()&&r._push(zr.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new _C(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},zd.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,i,o,c,u,f,h;if(this.transport=(n=e?.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e?.timeout)!==null&&r!==void 0?r:av,this.heartbeatIntervalMs=(i=e?.heartbeatIntervalMs)!==null&&i!==void 0?i:zd.HEARTBEAT_INTERVAL,this.worker=(o=e?.worker)!==null&&o!==void 0?o:!1,this.accessToken=(c=e?.accessToken)!==null&&c!==void 0?c:null,e?.params&&(this.params=e.params),e?.logger&&(this.logger=e.logger),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e?.reconnectAfterMs)!==null&&u!==void 0?u:m=>D4[m-1]||P4,this.encode=(f=e?.encode)!==null&&f!==void 0?f:(m,v)=>v(JSON.stringify(m)),this.decode=(h=e?.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e?.workerUrl}}}class Sy extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Qt(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class z4 extends Sy{constructor(e,n,r){super(e),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class ov extends Sy{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}var U4=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};const RC=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>tu(async()=>{const{default:r}=await Promise.resolve().then(()=>cl);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},$4=()=>U4(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield tu(()=>Promise.resolve().then(()=>cl),void 0)).Response:Response}),lv=t=>{if(Array.isArray(t))return t.map(n=>lv(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=lv(r)}),e},B4=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};var Mi=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};const lg=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),H4=(t,e,n)=>Mi(void 0,void 0,void 0,function*(){const r=yield $4();t instanceof r&&!n?.noResolveJson?t.json().then(i=>{const o=t.status||500,c=i?.statusCode||o+"";e(new z4(lg(i),o,c))}).catch(i=>{e(new ov(lg(i),i))}):e(new ov(lg(t),t))}),F4=(t,e,n,r)=>{const i={method:t,headers:e?.headers||{}};return t==="GET"||!r?i:(B4(r)?(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),i.body=JSON.stringify(r)):i.body=r,e?.duplex&&(i.duplex=e.duplex),Object.assign(Object.assign({},i),n))};function cu(t,e,n,r,i,o){return Mi(this,void 0,void 0,function*(){return new Promise((c,u)=>{t(n,F4(e,r,i,o)).then(f=>{if(!f.ok)throw f;return r?.noResolveJson?f:f.json()}).then(f=>c(f)).catch(f=>H4(f,u,r))})})}function Ef(t,e,n,r){return Mi(this,void 0,void 0,function*(){return cu(t,"GET",e,n,r)})}function aa(t,e,n,r,i){return Mi(this,void 0,void 0,function*(){return cu(t,"POST",e,r,i,n)})}function cv(t,e,n,r,i){return Mi(this,void 0,void 0,function*(){return cu(t,"PUT",e,r,i,n)})}function q4(t,e,n,r){return Mi(this,void 0,void 0,function*(){return cu(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function OC(t,e,n,r,i){return Mi(this,void 0,void 0,function*(){return cu(t,"DELETE",e,r,i,n)})}var _n=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};const V4={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},iE={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class G4{constructor(e,n={},r,i){this.url=e,this.headers=n,this.bucketId=r,this.fetch=RC(i)}uploadOrUpdate(e,n,r,i){return _n(this,void 0,void 0,function*(){try{let o;const c=Object.assign(Object.assign({},iE),i);let u=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(c.upsert)});const f=c.metadata;typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",c.cacheControl),f&&o.append("metadata",this.encodeMetadata(f)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.append("cacheControl",c.cacheControl),f&&o.append("metadata",this.encodeMetadata(f))):(o=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,f&&(u["x-metadata"]=this.toBase64(this.encodeMetadata(f)))),i?.headers&&(u=Object.assign(Object.assign({},u),i.headers));const h=this._removeEmptyFolders(n),m=this._getFinalPath(h),v=yield(e=="PUT"?cv:aa)(this.fetch,`${this.url}/object/${m}`,o,Object.assign({headers:u},c?.duplex?{duplex:c.duplex}:{}));return{data:{path:h,id:v.Id,fullPath:v.Key},error:null}}catch(o){if(Qt(o))return{data:null,error:o};throw o}})}upload(e,n,r){return _n(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,i){return _n(this,void 0,void 0,function*(){const o=this._removeEmptyFolders(e),c=this._getFinalPath(o),u=new URL(this.url+`/object/upload/sign/${c}`);u.searchParams.set("token",n);try{let f;const h=Object.assign({upsert:iE.upsert},i),m=Object.assign(Object.assign({},this.headers),{"x-upsert":String(h.upsert)});typeof Blob<"u"&&r instanceof Blob?(f=new FormData,f.append("cacheControl",h.cacheControl),f.append("",r)):typeof FormData<"u"&&r instanceof FormData?(f=r,f.append("cacheControl",h.cacheControl)):(f=r,m["cache-control"]=`max-age=${h.cacheControl}`,m["content-type"]=h.contentType);const v=yield cv(this.fetch,u.toString(),f,{headers:m});return{data:{path:o,fullPath:v.Key},error:null}}catch(f){if(Qt(f))return{data:null,error:f};throw f}})}createSignedUploadUrl(e,n){return _n(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const i=Object.assign({},this.headers);n?.upsert&&(i["x-upsert"]="true");const o=yield aa(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),c=new URL(this.url+o.url),u=c.searchParams.get("token");if(!u)throw new Sy("No token returned by API");return{data:{signedUrl:c.toString(),path:e,token:u},error:null}}catch(r){if(Qt(r))return{data:null,error:r};throw r}})}update(e,n,r){return _n(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return _n(this,void 0,void 0,function*(){try{return{data:yield aa(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(Qt(i))return{data:null,error:i};throw i}})}copy(e,n,r){return _n(this,void 0,void 0,function*(){try{return{data:{path:(yield aa(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(Qt(i))return{data:null,error:i};throw i}})}createSignedUrl(e,n,r){return _n(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield aa(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:n},r?.transform?{transform:r.transform}:{}),{headers:this.headers});const c=r?.download?`&download=${r.download===!0?"":r.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${c}`)},{data:o,error:null}}catch(i){if(Qt(i))return{data:null,error:i};throw i}})}createSignedUrls(e,n,r){return _n(this,void 0,void 0,function*(){try{const i=yield aa(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),o=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(c=>Object.assign(Object.assign({},c),{signedUrl:c.signedURL?encodeURI(`${this.url}${c.signedURL}${o}`):null})),error:null}}catch(i){if(Qt(i))return{data:null,error:i};throw i}})}download(e,n){return _n(this,void 0,void 0,function*(){const i=typeof n?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(n?.transform||{}),c=o?`?${o}`:"";try{const u=this._getFinalPath(e);return{data:yield(yield Ef(this.fetch,`${this.url}/${i}/${u}${c}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(u){if(Qt(u))return{data:null,error:u};throw u}})}info(e){return _n(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield Ef(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:lv(r),error:null}}catch(r){if(Qt(r))return{data:null,error:r};throw r}})}exists(e){return _n(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield q4(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(Qt(r)&&r instanceof ov){const i=r.originalError;if([400,404].includes(i?.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),i=[],o=n?.download?`download=${n.download===!0?"":n.download}`:"";o!==""&&i.push(o);const u=typeof n?.transform<"u"?"render/image":"object",f=this.transformOptsToQueryString(n?.transform||{});f!==""&&i.push(f);let h=i.join("&");return h!==""&&(h=`?${h}`),{data:{publicUrl:encodeURI(`${this.url}/${u}/public/${r}${h}`)}}}remove(e){return _n(this,void 0,void 0,function*(){try{return{data:yield OC(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(Qt(n))return{data:null,error:n};throw n}})}list(e,n,r){return _n(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},V4),n),{prefix:e||""});return{data:yield aa(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(Qt(i))return{data:null,error:i};throw i}})}listV2(e,n){return _n(this,void 0,void 0,function*(){try{const r=Object.assign({},e);return{data:yield aa(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(Qt(r))return{data:null,error:r};throw r}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const Y4="2.11.0",W4={"X-Client-Info":`storage-js/${Y4}`};var Oo=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};class K4{constructor(e,n={},r,i){const o=new URL(e);i?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase.")),this.url=o.href,this.headers=Object.assign(Object.assign({},W4),n),this.fetch=RC(r)}listBuckets(){return Oo(this,void 0,void 0,function*(){try{return{data:yield Ef(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(Qt(e))return{data:null,error:e};throw e}})}getBucket(e){return Oo(this,void 0,void 0,function*(){try{return{data:yield Ef(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(Qt(n))return{data:null,error:n};throw n}})}createBucket(e,n={public:!1}){return Oo(this,void 0,void 0,function*(){try{return{data:yield aa(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Qt(r))return{data:null,error:r};throw r}})}updateBucket(e,n){return Oo(this,void 0,void 0,function*(){try{return{data:yield cv(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Qt(r))return{data:null,error:r};throw r}})}emptyBucket(e){return Oo(this,void 0,void 0,function*(){try{return{data:yield aa(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(Qt(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Oo(this,void 0,void 0,function*(){try{return{data:yield OC(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(Qt(n))return{data:null,error:n};throw n}})}}class Z4 extends K4{constructor(e,n={},r,i){super(e,n,r,i)}from(e){return new G4(this.url,this.headers,e,this.fetch)}}const Q4="2.55.0";let jc="";typeof Deno<"u"?jc="deno":typeof document<"u"?jc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?jc="react-native":jc="node";const X4={"X-Client-Info":`supabase-js-${jc}/${Q4}`},J4={headers:X4},ez={schema:"public"},tz={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},nz={};var rz=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};const az=t=>{let e;return t?e=t:typeof fetch>"u"?e=yC:e=fetch,(...n)=>e(...n)},sz=()=>typeof Headers>"u"?bC:Headers,iz=(t,e,n)=>{const r=az(n),i=sz();return(o,c)=>rz(void 0,void 0,void 0,function*(){var u;const f=(u=yield e())!==null&&u!==void 0?u:t;let h=new i(c?.headers);return h.has("apikey")||h.set("apikey",t),h.has("Authorization")||h.set("Authorization",`Bearer ${f}`),r(o,Object.assign(Object.assign({},c),{headers:h}))})};var oz=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};function lz(t){return t.endsWith("/")?t:t+"/"}function cz(t,e){var n,r;const{db:i,auth:o,realtime:c,global:u}=t,{db:f,auth:h,realtime:m,global:v}=e,x={db:Object.assign(Object.assign({},f),i),auth:Object.assign(Object.assign({},h),o),realtime:Object.assign(Object.assign({},m),c),storage:{},global:Object.assign(Object.assign(Object.assign({},v),u),{headers:Object.assign(Object.assign({},(n=v?.headers)!==null&&n!==void 0?n:{}),(r=u?.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>oz(this,void 0,void 0,function*(){return""})};return t.accessToken?x.accessToken=t.accessToken:delete x.accessToken,x}const AC="2.71.1",zo=30*1e3,uv=3,cg=uv*zo,uz="http://localhost:9999",dz="supabase.auth.token",fz={"X-Client-Info":`gotrue-js/${AC}`},dv="X-Supabase-Api-Version",NC={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},hz=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,pz=10*60*1e3;class Ey extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Fe(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class jC extends Ey{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function mz(t){return Fe(t)&&t.name==="AuthApiError"}class kC extends Ey{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class zs extends Ey{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class Ts extends zs{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function gz(t){return Fe(t)&&t.name==="AuthSessionMissingError"}class Ud extends zs{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class $d extends zs{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Bd extends zs{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function vz(t){return Fe(t)&&t.name==="AuthImplicitGrantRedirectError"}class oE extends zs{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class fv extends zs{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function ug(t){return Fe(t)&&t.name==="AuthRetryableFetchError"}class lE extends zs{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class hv extends zs{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const _f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),cE=` 	
\r=`.split(""),yz=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<cE.length;e+=1)t[cE[e].charCodeAt(0)]=-2;for(let e=0;e<_f.length;e+=1)t[_f[e].charCodeAt(0)]=e;return t})();function uE(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(_f[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(_f[r]),e.queuedBits-=6}}function MC(t,e,n){const r=yz[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function dE(t){const e=[],n=c=>{e.push(String.fromCodePoint(c))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},o=c=>{xz(c,r,n)};for(let c=0;c<t.length;c+=1)MC(t.charCodeAt(c),i,o);return e.join("")}function bz(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function wz(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}bz(r,e)}}function xz(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function Sz(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)MC(t.charCodeAt(i),n,r);return new Uint8Array(e)}function Ez(t){const e=[];return wz(t,n=>e.push(n)),new Uint8Array(e)}function _z(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};return t.forEach(i=>uE(i,n,r)),uE(null,n,r),e.join("")}function Tz(t){return Math.round(Date.now()/1e3)+t}function Cz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Lr=()=>typeof window<"u"&&typeof document<"u",fi={tested:!1,writable:!1},DC=()=>{if(!Lr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fi.tested)return fi.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),fi.tested=!0,fi.writable=!0}catch{fi.tested=!0,fi.writable=!1}return fi.writable};function Rz(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const PC=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>tu(async()=>{const{default:r}=await Promise.resolve().then(()=>cl);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},Oz=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Uo=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},hi=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},xs=async(t,e)=>{await t.removeItem(e)};class eh{constructor(){this.promise=new eh.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}eh.promiseConstructor=Promise;function dg(t){const e=t.split(".");if(e.length!==3)throw new hv("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!hz.test(e[r]))throw new hv("JWT not in base64url format");return{header:JSON.parse(dE(e[0])),payload:JSON.parse(dE(e[1])),signature:Sz(e[2]),raw:{header:e[0],payload:e[1]}}}async function Az(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Nz(t,e){return new Promise((r,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{const c=await t(o);if(!e(o,null,c)){r(c);return}}catch(c){if(!e(o,c)){i(c);return}}})()})}function jz(t){return("0"+t.toString(16)).substr(-2)}function kz(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let o=0;o<56;o++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,jz).join("")}async function Mz(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}async function Dz(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await Mz(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ao(t,e,n=!1){const r=kz();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await Uo(t,`${e}-code-verifier`,i);const o=await Dz(r);return[o,r===o?"plain":"s256"]}const Pz=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Lz(t){const e=t.headers.get(dv);if(!e||!e.match(Pz))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Iz(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function zz(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Uz=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function No(t){if(!Uz.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function fg(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function fE(t){return JSON.parse(JSON.stringify(t))}var $z=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const mi=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Bz=[502,503,504];async function hE(t){var e;if(!Oz(t))throw new fv(mi(t),0);if(Bz.includes(t.status))throw new fv(mi(t),t.status);let n;try{n=await t.json()}catch(o){throw new kC(mi(o),o)}let r;const i=Lz(t);if(i&&i.getTime()>=NC["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new lE(mi(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Ts}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((o,c)=>o&&typeof c=="string",!0))throw new lE(mi(n),t.status,n.weak_password.reasons);throw new jC(mi(n),t.status||500,r)}const Hz=(t,e,n,r)=>{const i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function et(t,e,n,r){var i;const o=Object.assign({},r?.headers);o[dv]||(o[dv]=NC["2024-01-01"].name),r?.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const c=(i=r?.query)!==null&&i!==void 0?i:{};r?.redirectTo&&(c.redirect_to=r.redirectTo);const u=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",f=await Fz(t,e,n+u,{headers:o,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(f):{data:Object.assign({},f),error:null}}async function Fz(t,e,n,r,i,o){const c=Hz(e,r,i,o);let u;try{u=await t(n,Object.assign({},c))}catch(f){throw console.error(f),new fv(mi(f),0)}if(u.ok||await hE(u),r?.noResolveJson)return u;try{return await u.json()}catch(f){await hE(f)}}function La(t){var e;let n=null;Yz(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=Tz(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function pE(t){const e=La(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Ns(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function qz(t){return{data:t,error:null}}function Vz(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o}=t,c=$z(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o},f=Object.assign({},c);return{data:{properties:u,user:f},error:null}}function Gz(t){return t}function Yz(t){return t.access_token&&t.refresh_token&&t.expires_in}const hg=["global","local","others"];var Wz=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};class Kz{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=PC(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,n=hg[0]){if(hg.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${hg.join(", ")}`);try{return await et(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Fe(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await et(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Ns})}catch(r){if(Fe(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Wz(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r?.newEmail,delete i.newEmail),await et(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:Vz,redirectTo:n?.redirectTo})}catch(n){if(Fe(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await et(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ns})}catch(n){if(Fe(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,o,c,u,f;try{const h={nextPage:null,lastPage:0,total:0},m=await et(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:Gz});if(m.error)throw m.error;const v=await m.json(),x=(c=m.headers.get("x-total-count"))!==null&&c!==void 0?c:0,w=(f=(u=m.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&f!==void 0?f:[];return w.length>0&&(w.forEach(S=>{const E=parseInt(S.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(S.split(";")[1].split("=")[1]);h[`${_}Page`]=E}),h.total=parseInt(x)),{data:Object.assign(Object.assign({},v),h),error:null}}catch(h){if(Fe(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){No(e);try{return await et(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ns})}catch(n){if(Fe(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){No(e);try{return await et(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Ns})}catch(r){if(Fe(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){No(e);try{return await et(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Ns})}catch(r){if(Fe(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){No(e.userId);try{const{data:n,error:r}=await et(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Fe(n))return{data:null,error:n};throw n}}async _deleteFactor(e){No(e.userId),No(e.id);try{return{data:await et(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Fe(n))return{data:null,error:n};throw n}}}function mE(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}function Zz(){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)}}const jo={debug:!!(globalThis&&DC()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class LC extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Qz extends LC{}async function Xz(t,e,n){jo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),jo.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){jo.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{jo.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw jo.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Qz(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(jo.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}Zz();const Jz={url:uz,storageKey:dz,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:fz,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function gE(t,e,n){return await n()}const ko={};class Yc{constructor(e){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Yc.nextInstanceID,Yc.nextInstanceID+=1,this.instanceID>0&&Lr()&&console.warn("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.");const i=Object.assign(Object.assign({},Jz),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new Kz({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=PC(i.fetch),this.lock=i.lock||gE,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Lr()&&(!((n=globalThis?.navigator)===null||n===void 0)&&n.locks)?this.lock=Xz:this.lock=gE,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)},this.persistSession?(i.storage?this.storage=i.storage:DC()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=mE(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=mE(this.memoryStorage)),Lr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}get jwks(){var e,n;return(n=(e=ko[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){ko[this.storageKey]=Object.assign(Object.assign({},ko[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=ko[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){ko[this.storageKey]=Object.assign(Object.assign({},ko[this.storageKey]),{cachedAt:e})}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${AC}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const n=Rz(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Lr()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),vz(o)){const f=(e=o.details)===null||e===void 0?void 0:e.code;if(f==="identity_already_exists"||f==="identity_not_found"||f==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}const{session:c,redirectType:u}=i;return this._debug("#_initialize()","detected session in URL",c,"redirect type",u),await this._saveSession(c),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Fe(n)?{error:n}:{error:new kC("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const o=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e?.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:La}),{data:c,error:u}=o;if(u||!c)return{data:{user:null,session:null},error:u};const f=c.session,h=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",f)),{data:{user:h,session:f},error:null}}catch(o){if(Fe(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var n,r,i;try{let o;if("email"in e){const{email:m,password:v,options:x}=e;let w=null,S=null;this.flowType==="pkce"&&([w,S]=await Ao(this.storage,this.storageKey)),o=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x?.emailRedirectTo,body:{email:m,password:v,data:(n=x?.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:x?.captchaToken},code_challenge:w,code_challenge_method:S},xform:La})}else if("phone"in e){const{phone:m,password:v,options:x}=e;o=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:m,password:v,data:(r=x?.data)!==null&&r!==void 0?r:{},channel:(i=x?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:x?.captchaToken}},xform:La})}else throw new $d("You must provide either an email or phone number and a password");const{data:c,error:u}=o;if(u||!c)return{data:{user:null,session:null},error:u};const f=c.session,h=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",f)),{data:{user:h,session:f},error:null}}catch(o){if(Fe(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let n;if("email"in e){const{email:o,password:c,options:u}=e;n=await et(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:c,gotrue_meta_security:{captcha_token:u?.captchaToken}},xform:pE})}else if("phone"in e){const{phone:o,password:c,options:u}=e;n=await et(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:c,gotrue_meta_security:{captcha_token:u?.captchaToken}},xform:pE})}else throw new $d("You must provide either an email or phone number and a password");const{data:r,error:i}=n;return i?{data:{user:null,session:null},error:i}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Ud}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Fe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(e){var n,r,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;if(n==="solana")return await this.signInWithSolana(e);throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}async signInWithSolana(e){var n,r,i,o,c,u,f,h,m,v,x,w;let S,E;if("message"in e)S=e.message,E=e.signature;else{const{chain:_,wallet:C,statement:R,options:A}=e;let k;if(Lr())if(typeof C=="object")k=C;else{const N=window;if("solana"in N&&typeof N.solana=="object"&&("signIn"in N.solana&&typeof N.solana.signIn=="function"||"signMessage"in N.solana&&typeof N.solana.signMessage=="function"))k=N.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 C!="object"||!A?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=C}const D=new URL((n=A?.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in k&&k.signIn){const N=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},A?.signInWithSolana),{version:"1",domain:D.host,uri:D.href}),R?{statement:R}:null));let L;if(Array.isArray(N)&&N[0]&&typeof N[0]=="object")L=N[0];else if(N&&typeof N=="object"&&"signedMessage"in N&&"signature"in N)L=N;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in L&&"signature"in L&&(typeof L.signedMessage=="string"||L.signedMessage instanceof Uint8Array)&&L.signature instanceof Uint8Array)S=typeof L.signedMessage=="string"?L.signedMessage:new TextDecoder().decode(L.signedMessage),E=L.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");S=[`${D.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...R?["",R,""]:[""],"Version: 1",`URI: ${D.href}`,`Issued At: ${(i=(r=A?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((o=A?.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${A.signInWithSolana.notBefore}`]:[],...!((c=A?.signInWithSolana)===null||c===void 0)&&c.expirationTime?[`Expiration Time: ${A.signInWithSolana.expirationTime}`]:[],...!((u=A?.signInWithSolana)===null||u===void 0)&&u.chainId?[`Chain ID: ${A.signInWithSolana.chainId}`]:[],...!((f=A?.signInWithSolana)===null||f===void 0)&&f.nonce?[`Nonce: ${A.signInWithSolana.nonce}`]:[],...!((h=A?.signInWithSolana)===null||h===void 0)&&h.requestId?[`Request ID: ${A.signInWithSolana.requestId}`]:[],...!((v=(m=A?.signInWithSolana)===null||m===void 0?void 0:m.resources)===null||v===void 0)&&v.length?["Resources",...A.signInWithSolana.resources.map(L=>`- ${L}`)]:[]].join(`
`);const N=await k.signMessage(new TextEncoder().encode(S),"utf8");if(!N||!(N instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");E=N}}try{const{data:_,error:C}=await et(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:S,signature:_z(E)},!((x=e.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(w=e.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:La});if(C)throw C;return!_||!_.session||!_.user?{data:{user:null,session:null},error:new Ud}:(_.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),{data:Object.assign({},_),error:C})}catch(_){if(Fe(_))return{data:{user:null,session:null},error:_};throw _}}async _exchangeCodeForSession(e){const n=await hi(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{const{data:o,error:c}=await et(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:La});if(await xs(this.storage,`${this.storageKey}-code-verifier`),c)throw c;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Ud}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:c})}catch(o){if(Fe(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:o,nonce:c}=e,u=await et(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:o,nonce:c,gotrue_meta_security:{captcha_token:n?.captchaToken}},xform:La}),{data:f,error:h}=u;return h?{data:{user:null,session:null},error:h}:!f||!f.session||!f.user?{data:{user:null,session:null},error:new Ud}:(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",f.session)),{data:f,error:h})}catch(n){if(Fe(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(e){var n,r,i,o,c;try{if("email"in e){const{email:u,options:f}=e;let h=null,m=null;this.flowType==="pkce"&&([h,m]=await Ao(this.storage,this.storageKey));const{error:v}=await et(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(n=f?.data)!==null&&n!==void 0?n:{},create_user:(r=f?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:h,code_challenge_method:m},redirectTo:f?.emailRedirectTo});return{data:{user:null,session:null},error:v}}if("phone"in e){const{phone:u,options:f}=e,{data:h,error:m}=await et(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(i=f?.data)!==null&&i!==void 0?i:{},create_user:(o=f?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:f?.captchaToken},channel:(c=f?.channel)!==null&&c!==void 0?c:"sms"}});return{data:{user:null,session:null,messageId:h?.message_id},error:m}}throw new $d("You must provide either an email or phone number.")}catch(u){if(Fe(u))return{data:{user:null,session:null},error:u};throw u}}async verifyOtp(e){var n,r;try{let i,o;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,o=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:c,error:u}=await et(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:La});if(u)throw u;if(!c)throw new Error("An error occurred on token verification.");const f=c.session,h=c.user;return f?.access_token&&(await this._saveSession(f),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",f)),{data:{user:h,session:f},error:null}}catch(i){if(Fe(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var n,r,i;try{let o=null,c=null;return this.flowType==="pkce"&&([o,c]=await Ao(this.storage,this.storageKey)),await et(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:c}),headers:this.headers,xform:qz})}catch(o){if(Fe(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Ts;const{error:i}=await et(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if(Fe(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:o}=e,{error:c}=await et(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:c}}else if("phone"in e){const{phone:r,type:i,options:o}=e,{data:c,error:u}=await et(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:c?.message_id},error:u}}throw new $d("You must provide either an email or phone number and a type")}catch(n){if(Fe(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await hi(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<cg:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const c=await hi(this.userStorage,this.storageKey+"-user");c?.user?e.user=c.user:e.user=fg()}if(this.storage.isServer&&e.user){let c=this.suppressGetSessionWarning;e=new Proxy(e,{get:(f,h,m)=>(!c&&h==="user"&&(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."),c=!0,this.suppressGetSessionWarning=!0),Reflect.get(f,h,m))})}return{data:{session:e},error:null}}const{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await et(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ns}):await this._useSession(async n=>{var r,i,o;const{data:c,error:u}=n;if(u)throw u;return!(!((r=c.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ts}:await et(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=c.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:Ns})})}catch(n){if(Fe(n))return gz(n)&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:o}=r;if(o)throw o;if(!i.session)throw new Ts;const c=i.session;let u=null,f=null;this.flowType==="pkce"&&e.email!=null&&([u,f]=await Ao(this.storage,this.storageKey));const{data:h,error:m}=await et(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:u,code_challenge_method:f}),jwt:c.access_token,xform:Ns});if(m)throw m;return c.user=h.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),{data:{user:c.user},error:null}})}catch(r){if(Fe(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ts;const n=Date.now()/1e3;let r=n,i=!0,o=null;const{payload:c}=dg(e.access_token);if(c.exp&&(r=c.exp,i=r<=n),i){const{session:u,error:f}=await this._callRefreshToken(e.refresh_token);if(f)return{data:{user:null,session:null},error:f};if(!u)return{data:{user:null,session:null},error:null};o=u}else{const{data:u,error:f}=await this._getUser(e.access_token);if(f)throw f;o={access_token:e.access_token,refresh_token:e.refresh_token,user:u.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(n){if(Fe(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:c,error:u}=n;if(u)throw u;e=(r=c.session)!==null&&r!==void 0?r:void 0}if(!e?.refresh_token)throw new Ts;const{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(Fe(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(e,n){try{if(!Lr())throw new Bd("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Bd(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new oE("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Bd("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new oE("No code detected.");const{data:R,error:A}=await this._exchangeCodeForSession(e.code);if(A)throw A;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:R.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:o,refresh_token:c,expires_in:u,expires_at:f,token_type:h}=e;if(!o||!u||!c||!h)throw new Bd("No session defined in URL");const m=Math.round(Date.now()/1e3),v=parseInt(u);let x=m+v;f&&(x=parseInt(f));const w=x-m;w*1e3<=zo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${v}s`);const S=x-v;m-S>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",S,x,m):m-S<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",S,x,m);const{data:E,error:_}=await this._getUser(o);if(_)throw _;const C={provider_token:r,provider_refresh_token:i,access_token:o,expires_in:v,expires_at:x,refresh_token:c,token_type:h,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:C,redirectType:e.type},error:null}}catch(r){if(Fe(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await hi(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:o}=n;if(o)return{error:o};const c=(r=i.session)===null||r===void 0?void 0:r.access_token;if(c){const{error:u}=await this.admin.signOut(c,e);if(u&&!(mz(u)&&(u.status===404||u.status===401||u.status===403)))return{error:u}}return e!=="others"&&(await this._removeSession(),await xs(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const n=Cz(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:o},error:c}=n;if(c)throw c;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Ao(this.storage,this.storageKey,!0));try{return await et(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(Fe(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(n){if(Fe(n))return{data:null,error:n};throw n}}async linkIdentity(e){var n;try{const{data:r,error:i}=await this._useSession(async o=>{var c,u,f,h,m;const{data:v,error:x}=o;if(x)throw x;const w=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(c=e.options)===null||c===void 0?void 0:c.redirectTo,scopes:(u=e.options)===null||u===void 0?void 0:u.scopes,queryParams:(f=e.options)===null||f===void 0?void 0:f.queryParams,skipBrowserRedirect:!0});return await et(this.fetch,"GET",w,{headers:this.headers,jwt:(m=(h=v.session)===null||h===void 0?void 0:h.access_token)!==null&&m!==void 0?m:void 0})});if(i)throw i;return Lr()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:e.provider,url:r?.url},error:null}}catch(r){if(Fe(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:o,error:c}=n;if(c)throw c;return await et(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Fe(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Nz(async i=>(i>0&&await Az(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await et(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:La})),(i,o)=>{const c=200*Math.pow(2,i);return o&&ug(o)&&Date.now()+c-r<zo})}catch(r){if(this._debug(n,"error",r),Fe(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Lr()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await hi(this.storage,this.storageKey);if(i&&this.userStorage){let c=await hi(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!c&&(c={user:i.user},await Uo(this.userStorage,this.storageKey+"-user",c)),i.user=(e=c?.user)!==null&&e!==void 0?e:fg()}else if(i&&!i.user&&!i.user){const c=await hi(this.storage,this.storageKey+"-user");c&&c?.user?(i.user=c.user,await xs(this.storage,this.storageKey+"-user"),await Uo(this.storage,this.storageKey,i)):i.user=fg()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const o=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<cg;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${cg}s`),o){if(this.autoRefreshToken&&i.refresh_token){const{error:c}=await this._callRefreshToken(i.refresh_token);c&&(console.error(c),ug(c)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:c,error:u}=await this._getUser(i.access_token);!u&&c?.user?(i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(c){console.error("Error getting user data:",c),this._debug(r,"error getting user data, skipping SIGNED_IN notification",c)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Ts;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new eh;const{data:o,error:c}=await this._refreshAccessToken(e);if(c)throw c;if(!o.session)throw new Ts;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const u={session:o.session,error:null};return this.refreshingDeferred.resolve(u),u}catch(o){if(this._debug(i,"error",o),Fe(o)){const c={session:null,error:o};return ug(o)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(c),c}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const o=[],c=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(e,n)}catch(f){o.push(f)}});if(await Promise.all(c),o.length>0){for(let u=0;u<o.length;u+=1)console.error(o[u]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Uo(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const o=fE(i);await Uo(this.storage,this.storageKey,o)}else{const i=fE(n);await Uo(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await xs(this.storage,this.storageKey),await xs(this.storage,this.storageKey+"-code-verifier"),await xs(this.storage,this.storageKey+"-user"),this.userStorage&&await xs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Lr()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),zo);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/zo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${zo}ms, refresh threshold is ${uv} ticks`),i<=uv&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof LC)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Lr()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,c]=await Ao(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(c)}`});i.push(u.toString())}if(r?.queryParams){const o=new URLSearchParams(r.queryParams);i.push(o.toString())}return r?.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:o}=n;return o?{data:null,error:o}:await et(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Fe(n))return{data:null,error:n};throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:o,error:c}=n;if(c)return{data:null,error:c};const u=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:f,error:h}=await et(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return h?{data:null,error:h}:(e.factorType==="totp"&&(!((i=f?.totp)===null||i===void 0)&&i.qr_code)&&(f.totp.qr_code=`data:image/svg+xml;utf-8,${f.totp.qr_code}`),{data:f,error:null})})}catch(n){if(Fe(n))return{data:null,error:n};throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:o}=n;if(o)return{data:null,error:o};const{data:c,error:u}=await et(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),{data:c,error:u})})}catch(n){if(Fe(n))return{data:null,error:n};throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:o}=n;return o?{data:null,error:o}:await et(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Fe(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){const{data:{user:e},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=e?.factors||[],i=r.filter(c=>c.factor_type==="totp"&&c.status==="verified"),o=r.filter(c=>c.factor_type==="phone"&&c.status==="verified");return{data:{all:r,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var n,r;const{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=dg(i.access_token);let u=null;c.aal&&(u=c.aal);let f=u;((r=(n=i.user.factors)===null||n===void 0?void 0:n.filter(v=>v.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(f="aal2");const m=c.amr||[];return{data:{currentLevel:u,nextLevel:f,currentAuthenticationMethods:m},error:null}}))}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(u=>u.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(u=>u.kid===e),r&&this.jwks_cached_at+pz>i)return r;const{data:o,error:c}=await et(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(c)throw c;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=i,r=o.keys.find(u=>u.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:w,error:S}=await this.getSession();if(S||!w.session)return{data:null,error:S};r=w.session.access_token}const{header:i,payload:o,signature:c,raw:{header:u,payload:f}}=dg(r);n?.allowExpired||Iz(o.exp);const h=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n?.keys?{keys:n.keys}:n?.jwks);if(!h){const{error:w}=await this.getUser(r);if(w)throw w;return{data:{claims:o,header:i,signature:c},error:null}}const m=zz(i.alg),v=await crypto.subtle.importKey("jwk",h,m,!0,["verify"]);if(!await crypto.subtle.verify(m,v,c,Ez(`${u}.${f}`)))throw new hv("Invalid JWT signature");return{data:{claims:o,header:i,signature:c},error:null}}catch(r){if(Fe(r))return{data:null,error:r};throw r}}}Yc.nextInstanceID=0;const e3=Yc;class t3 extends e3{constructor(e){super(e)}}var n3=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?o(m.value):i(m.value).then(u,f)}h((r=r.apply(t,e||[])).next())})};class r3{constructor(e,n,r){var i,o,c;if(this.supabaseUrl=e,this.supabaseKey=n,!e)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const u=lz(e),f=new URL(u);this.realtimeUrl=new URL("realtime/v1",f),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",f),this.storageUrl=new URL("storage/v1",f),this.functionsUrl=new URL("functions/v1",f);const h=`sb-${f.hostname.split(".")[0]}-auth-token`,m={db:ez,realtime:nz,auth:Object.assign(Object.assign({},tz),{storageKey:h}),global:J4},v=cz(r??{},m);this.storageKey=(i=v.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=v.global.headers)!==null&&o!==void 0?o:{},v.accessToken?(this.accessToken=v.accessToken,this.auth=new Proxy({},{get:(x,w)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(w)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((c=v.auth)!==null&&c!==void 0?c:{},this.headers,v.global.fetch),this.fetch=iz(n,this._getAccessToken.bind(this),v.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},v.realtime)),this.rest=new w4(new URL("rest/v1",f).href,{headers:this.headers,schema:v.db.schema,fetch:this.fetch}),this.storage=new Z4(this.storageUrl.href,this.headers,this.fetch,r?.storage),v.accessToken||this._listenForAuthEvents()}get functions(){return new l4(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},r={}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,n;return n3(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,storageKey:o,flowType:c,lock:u,debug:f},h,m){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new t3({url:this.authUrl.href,headers:Object.assign(Object.assign({},v),h),storageKey:o,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:i,flowType:c,lock:u,debug:f,fetch:m,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new I4(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r?.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const a3=(t,e,n)=>new r3(t,e,n);function s3(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}s3()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const i3="https://mauxfsscfzorijtgnmje.supabase.co",o3="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1hdXhmc3NjZnpvcmlqdGdubWplIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDY1OTYyNDMsImV4cCI6MjA2MjE3MjI0M30.qmnPzOPStffF1ppCjyssF8pDVyuk6EbwrNW-7jexvrA",Di=a3(i3,o3),Pi=new HI({defaultOptions:{queries:{staleTime:500}}}),l3=()=>Fa({mutationFn:t=>Di.auth.signUp(t)}),c3=()=>Fa({mutationFn:t=>Di.auth.signInWithPassword(t)}),IC=()=>Fa({mutationFn:()=>Di.auth.signOut(),onSuccess:()=>{Pi.removeQueries()}}),u3=()=>Fa({mutationFn:({provider:t,returnTo:e})=>{const n=`${window.location.origin}/zylo-docs/auth/callback`,r=e?`${n}?returnTo=${encodeURIComponent(e)}`:n;return Di.auth.signInWithOAuth({provider:t,options:{redirectTo:r}})}}),th=()=>Jf({queryKey:qa.session(),queryFn:async()=>{const{data:t,error:e}=await Di.auth.getSession();if(e)throw e;return t},staleTime:0,refetchOnWindowFocus:!0}),zC=()=>{const{data:t}=th();return t?.session?.user??null},_y=()=>{const{data:t}=th();return!!t?.session};function d3(){const t=Kr(),{data:e,isLoading:n}=th(),r=Wr();return b.useEffect(()=>{const o=new URLSearchParams(r.search).get("returnTo");!n&&e?.session&&t(o||r.state?.returnTo||"/")},[e,n,t,r]),g.jsxs("div",{className:"flex flex-col items-center justify-center h-screen",children:[g.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Signing you in..."}),g.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"})]})}var f3=t=>{switch(t){case"success":return m3;case"info":return v3;case"warning":return g3;case"error":return y3;default:return null}},h3=Array(12).fill(0),p3=({visible:t,className:e})=>fe.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},fe.createElement("div",{className:"sonner-spinner"},h3.map((n,r)=>fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),m3=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),g3=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),v3=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),y3=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),b3=fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),w3=()=>{let[t,e]=fe.useState(document.hidden);return fe.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},pv=1,x3=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:pv++,o=this.toasts.find(u=>u.id===i),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...t,id:i,title:n}),{...u,...t,id:i,dismissible:c,title:n}):u):this.addToast({title:n,...r,dismissible:c,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,c=r.then(async f=>{if(o=["resolve",f],fe.isValidElement(f))i=!1,this.create({id:n,type:"default",message:f});else if(E3(f)&&!f.ok){i=!1;let h=typeof e.error=="function"?await e.error(`HTTP error! status: ${f.status}`):e.error,m=typeof e.description=="function"?await e.description(`HTTP error! status: ${f.status}`):e.description;this.create({id:n,type:"error",message:h,description:m})}else if(e.success!==void 0){i=!1;let h=typeof e.success=="function"?await e.success(f):e.success,m=typeof e.description=="function"?await e.description(f):e.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async f=>{if(o=["reject",f],e.error!==void 0){i=!1;let h=typeof e.error=="function"?await e.error(f):e.error,m=typeof e.description=="function"?await e.description(f):e.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var f;i&&(this.dismiss(n),n=void 0),(f=e.finally)==null||f.call(e)}),u=()=>new Promise((f,h)=>c.then(()=>o[0]==="reject"?h(o[1]):f(o[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(t,e)=>{let n=e?.id||pv++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},In=new x3,S3=(t,e)=>{let n=e?.id||pv++;return In.addToast({title:t,...e,id:n}),n},E3=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",_3=S3,T3=()=>In.toasts,C3=()=>In.getActiveToasts(),gn=Object.assign(_3,{success:In.success,info:In.info,warning:In.warning,error:In.error,custom:In.custom,message:In.message,promise:In.promise,dismiss:In.dismiss,loading:In.loading},{getHistory:T3,getToasts:C3});function R3(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}R3(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function Hd(t){return t.label!==void 0}var O3=3,A3="32px",N3="16px",vE=4e3,j3=356,k3=14,M3=20,D3=200;function Pr(...t){return t.filter(Boolean).join(" ")}function P3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var L3=t=>{var e,n,r,i,o,c,u,f,h,m,v;let{invert:x,toast:w,unstyled:S,interacting:E,setHeights:_,visibleToasts:C,heights:R,index:A,toasts:k,expanded:D,removeToast:N,defaultRichColors:L,closeButton:Z,style:Q,cancelButtonStyle:te,actionButtonStyle:ce,className:se="",descriptionClassName:ge="",duration:pe,position:ve,gap:M,loadingIcon:W,expandByDefault:X,classNames:H,icons:j,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:re}=t,[U,ee]=fe.useState(null),[de,ie]=fe.useState(null),[G,me]=fe.useState(!1),[Ce,xe]=fe.useState(!1),[Ne,He]=fe.useState(!1),[Be,st]=fe.useState(!1),[bn,wn]=fe.useState(!1),[Nt,Mt]=fe.useState(0),[pa,ma]=fe.useState(0),en=fe.useRef(w.duration||pe||vE),xn=fe.useRef(null),tn=fe.useRef(null),zi=A===0,qs=A+1<=C,wt=w.type,ft=w.dismissible!==!1,Bn=w.className||"",Yt=w.descriptionClassName||"",Ga=fe.useMemo(()=>R.findIndex(je=>je.toastId===w.id)||0,[R,w.id]),sr=fe.useMemo(()=>{var je;return(je=w.closeButton)!=null?je:Z},[w.closeButton,Z]),Vs=fe.useMemo(()=>w.duration||pe||vE,[w.duration,pe]),Cr=fe.useRef(0),An=fe.useRef(0),ir=fe.useRef(0),Nn=fe.useRef(null),[or,Ui]=ve.split("-"),ga=fe.useMemo(()=>R.reduce((je,rt,ht)=>ht>=Ga?je:je+rt.height,0),[R,Ga]),Gs=w3(),Ya=w.invert||x,Rr=wt==="loading";An.current=fe.useMemo(()=>Ga*M+ga,[Ga,ga]),fe.useEffect(()=>{en.current=Vs},[Vs]),fe.useEffect(()=>{me(!0)},[]),fe.useEffect(()=>{let je=tn.current;if(je){let rt=je.getBoundingClientRect().height;return ma(rt),_(ht=>[{toastId:w.id,height:rt,position:w.position},...ht]),()=>_(ht=>ht.filter(I=>I.toastId!==w.id))}},[_,w.id]),fe.useLayoutEffect(()=>{if(!G)return;let je=tn.current,rt=je.style.height;je.style.height="auto";let ht=je.getBoundingClientRect().height;je.style.height=rt,ma(ht),_(I=>I.find(B=>B.toastId===w.id)?I.map(B=>B.toastId===w.id?{...B,height:ht}:B):[{toastId:w.id,height:ht,position:w.position},...I])},[G,w.title,w.description,_,w.id]);let Hn=fe.useCallback(()=>{xe(!0),Mt(An.current),_(je=>je.filter(rt=>rt.toastId!==w.id)),setTimeout(()=>{N(w)},D3)},[w,N,_,An]);fe.useEffect(()=>{if(w.promise&&wt==="loading"||w.duration===1/0||w.type==="loading")return;let je;return D||E||re&&Gs?(()=>{if(ir.current<Cr.current){let rt=new Date().getTime()-Cr.current;en.current=en.current-rt}ir.current=new Date().getTime()})():en.current!==1/0&&(Cr.current=new Date().getTime(),je=setTimeout(()=>{var rt;(rt=w.onAutoClose)==null||rt.call(w,w),Hn()},en.current)),()=>clearTimeout(je)},[D,E,w,wt,re,Gs,Hn]),fe.useEffect(()=>{w.delete&&Hn()},[Hn,w.delete]);function va(){var je,rt,ht;return j!=null&&j.loading?fe.createElement("div",{className:Pr(H?.loader,(je=w?.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":wt==="loading"},j.loading):W?fe.createElement("div",{className:Pr(H?.loader,(rt=w?.classNames)==null?void 0:rt.loader,"sonner-loader"),"data-visible":wt==="loading"},W):fe.createElement(p3,{className:Pr(H?.loader,(ht=w?.classNames)==null?void 0:ht.loader),visible:wt==="loading"})}return fe.createElement("li",{tabIndex:0,ref:tn,className:Pr(se,Bn,H?.toast,(e=w?.classNames)==null?void 0:e.toast,H?.default,H?.[wt],(n=w?.classNames)==null?void 0:n[wt]),"data-sonner-toast":"","data-rich-colors":(r=w.richColors)!=null?r:L,"data-styled":!(w.jsx||w.unstyled||S),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":bn,"data-removed":Ce,"data-visible":qs,"data-y-position":or,"data-x-position":Ui,"data-index":A,"data-front":zi,"data-swiping":Ne,"data-dismissible":ft,"data-type":wt,"data-invert":Ya,"data-swipe-out":Be,"data-swipe-direction":de,"data-expanded":!!(D||X&&G),style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Ce?Nt:An.current}px`,"--initial-height":X?"auto":`${pa}px`,...Q,...w.style},onDragEnd:()=>{He(!1),ee(null),Nn.current=null},onPointerDown:je=>{Rr||!ft||(xn.current=new Date,Mt(An.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(He(!0),Nn.current={x:je.clientX,y:je.clientY}))},onPointerUp:()=>{var je,rt,ht,I;if(Be||!ft)return;Nn.current=null;let B=Number(((je=tn.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Y=Number(((rt=tn.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),le=new Date().getTime()-((ht=xn.current)==null?void 0:ht.getTime()),he=U==="x"?B:Y,Se=Math.abs(he)/le;if(Math.abs(he)>=M3||Se>.11){Mt(An.current),(I=w.onDismiss)==null||I.call(w,w),ie(U==="x"?B>0?"right":"left":Y>0?"down":"up"),Hn(),st(!0),wn(!1);return}He(!1),ee(null)},onPointerMove:je=>{var rt,ht,I,B;if(!Nn.current||!ft||((rt=window.getSelection())==null?void 0:rt.toString().length)>0)return;let Y=je.clientY-Nn.current.y,le=je.clientX-Nn.current.x,he=(ht=t.swipeDirections)!=null?ht:P3(ve);!U&&(Math.abs(le)>1||Math.abs(Y)>1)&&ee(Math.abs(le)>Math.abs(Y)?"x":"y");let Se={x:0,y:0};U==="y"?(he.includes("top")||he.includes("bottom"))&&(he.includes("top")&&Y<0||he.includes("bottom")&&Y>0)&&(Se.y=Y):U==="x"&&(he.includes("left")||he.includes("right"))&&(he.includes("left")&&le<0||he.includes("right")&&le>0)&&(Se.x=le),(Math.abs(Se.x)>0||Math.abs(Se.y)>0)&&wn(!0),(I=tn.current)==null||I.style.setProperty("--swipe-amount-x",`${Se.x}px`),(B=tn.current)==null||B.style.setProperty("--swipe-amount-y",`${Se.y}px`)}},sr&&!w.jsx?fe.createElement("button",{"aria-label":V,"data-disabled":Rr,"data-close-button":!0,onClick:Rr||!ft?()=>{}:()=>{var je;Hn(),(je=w.onDismiss)==null||je.call(w,w)},className:Pr(H?.closeButton,(i=w?.classNames)==null?void 0:i.closeButton)},(o=j?.close)!=null?o:b3):null,w.jsx||b.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:fe.createElement(fe.Fragment,null,wt||w.icon||w.promise?fe.createElement("div",{"data-icon":"",className:Pr(H?.icon,(c=w?.classNames)==null?void 0:c.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||va():null,w.type!=="loading"?w.icon||j?.[wt]||f3(wt):null):null,fe.createElement("div",{"data-content":"",className:Pr(H?.content,(u=w?.classNames)==null?void 0:u.content)},fe.createElement("div",{"data-title":"",className:Pr(H?.title,(f=w?.classNames)==null?void 0:f.title)},typeof w.title=="function"?w.title():w.title),w.description?fe.createElement("div",{"data-description":"",className:Pr(ge,Yt,H?.description,(h=w?.classNames)==null?void 0:h.description)},typeof w.description=="function"?w.description():w.description):null),b.isValidElement(w.cancel)?w.cancel:w.cancel&&Hd(w.cancel)?fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||te,onClick:je=>{var rt,ht;Hd(w.cancel)&&ft&&((ht=(rt=w.cancel).onClick)==null||ht.call(rt,je),Hn())},className:Pr(H?.cancelButton,(m=w?.classNames)==null?void 0:m.cancelButton)},w.cancel.label):null,b.isValidElement(w.action)?w.action:w.action&&Hd(w.action)?fe.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||ce,onClick:je=>{var rt,ht;Hd(w.action)&&((ht=(rt=w.action).onClick)==null||ht.call(rt,je),!je.defaultPrevented&&Hn())},className:Pr(H?.actionButton,(v=w?.classNames)==null?void 0:v.actionButton)},w.action.label):null))};function yE(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function I3(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,c=o?"--mobile-offset":"--offset",u=o?N3:A3;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):f(u)}),n}var z3=b.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:f,mobileOffset:h,theme:m="light",richColors:v,duration:x,style:w,visibleToasts:S=O3,toastOptions:E,dir:_=yE(),gap:C=k3,loadingIcon:R,icons:A,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:D}=t,[N,L]=fe.useState([]),Z=fe.useMemo(()=>Array.from(new Set([r].concat(N.filter(re=>re.position).map(re=>re.position)))),[N,r]),[Q,te]=fe.useState([]),[ce,se]=fe.useState(!1),[ge,pe]=fe.useState(!1),[ve,M]=fe.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=fe.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=fe.useRef(null),j=fe.useRef(!1),V=fe.useCallback(re=>{L(U=>{var ee;return(ee=U.find(de=>de.id===re.id))!=null&&ee.delete||In.dismiss(re.id),U.filter(({id:de})=>de!==re.id)})},[]);return fe.useEffect(()=>In.subscribe(re=>{if(re.dismiss){L(U=>U.map(ee=>ee.id===re.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{rT.flushSync(()=>{L(U=>{let ee=U.findIndex(de=>de.id===re.id);return ee!==-1?[...U.slice(0,ee),{...U[ee],...re},...U.slice(ee+1)]:[re,...U]})})})}),[]),fe.useEffect(()=>{if(m!=="system"){M(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;let re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:U})=>{M(U?"dark":"light")})}catch{re.addListener(({matches:ee})=>{try{M(ee?"dark":"light")}catch(de){console.error(de)}})}},[m]),fe.useEffect(()=>{N.length<=1&&se(!1)},[N]),fe.useEffect(()=>{let re=U=>{var ee,de;i.every(ie=>U[ie]||U.code===ie)&&(se(!0),(ee=W.current)==null||ee.focus()),U.code==="Escape"&&(document.activeElement===W.current||(de=W.current)!=null&&de.contains(document.activeElement))&&se(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[i]),fe.useEffect(()=>{if(W.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,j.current=!1)}},[W.current]),fe.createElement("section",{ref:e,"aria-label":`${k} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Z.map((re,U)=>{var ee;let[de,ie]=re.split("-");return N.length?fe.createElement("ol",{key:re,dir:_==="auto"?yE():_,tabIndex:-1,ref:W,className:u,"data-sonner-toaster":!0,"data-theme":ve,"data-y-position":de,"data-lifted":ce&&N.length>1&&!o,"data-x-position":ie,style:{"--front-toast-height":`${((ee=Q[0])==null?void 0:ee.height)||0}px`,"--width":`${j3}px`,"--gap":`${C}px`,...w,...I3(f,h)},onBlur:G=>{j.current&&!G.currentTarget.contains(G.relatedTarget)&&(j.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||j.current||(j.current=!0,H.current=G.relatedTarget)},onMouseEnter:()=>se(!0),onMouseMove:()=>se(!0),onMouseLeave:()=>{ge||se(!1)},onDragEnd:()=>se(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||pe(!0)},onPointerUp:()=>pe(!1)},N.filter(G=>!G.position&&U===0||G.position===re).map((G,me)=>{var Ce,xe;return fe.createElement(L3,{key:G.id,icons:A,index:me,toast:G,defaultRichColors:v,duration:(Ce=E?.duration)!=null?Ce:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:n,visibleToasts:S,closeButton:(xe=E?.closeButton)!=null?xe:c,interacting:ge,position:re,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,removeToast:V,toasts:N.filter(Ne=>Ne.position==G.position),heights:Q.filter(Ne=>Ne.position==G.position),setHeights:te,expandByDefault:o,gap:C,loadingIcon:R,expanded:ce,pauseWhenPageIsHidden:D,swipeDirections:t.swipeDirections})})):null}))});function UC(t,e){return function(){return t.apply(e,arguments)}}const{toString:U3}=Object.prototype,{getPrototypeOf:Ty}=Object,{iterator:nh,toStringTag:$C}=Symbol,rh=(t=>e=>{const n=U3.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zr=t=>(t=t.toLowerCase(),e=>rh(e)===t),ah=t=>e=>typeof e===t,{isArray:ul}=Array,Wc=ah("undefined");function $3(t){return t!==null&&!Wc(t)&&t.constructor!==null&&!Wc(t.constructor)&&zn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const BC=Zr("ArrayBuffer");function B3(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&BC(t.buffer),e}const H3=ah("string"),zn=ah("function"),HC=ah("number"),sh=t=>t!==null&&typeof t=="object",F3=t=>t===!0||t===!1,rf=t=>{if(rh(t)!=="object")return!1;const e=Ty(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!($C in t)&&!(nh in t)},q3=Zr("Date"),V3=Zr("File"),G3=Zr("Blob"),Y3=Zr("FileList"),W3=t=>sh(t)&&zn(t.pipe),K3=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||zn(t.append)&&((e=rh(t))==="formdata"||e==="object"&&zn(t.toString)&&t.toString()==="[object FormData]"))},Z3=Zr("URLSearchParams"),[Q3,X3,J3,eU]=["ReadableStream","Request","Response","Headers"].map(Zr),tU=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function uu(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ul(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),c=o.length;let u;for(r=0;r<c;r++)u=o[r],e.call(null,t[u],u,t)}}function FC(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const xi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qC=t=>!Wc(t)&&t!==xi;function mv(){const{caseless:t}=qC(this)&&this||{},e={},n=(r,i)=>{const o=t&&FC(e,i)||i;rf(e[o])&&rf(r)?e[o]=mv(e[o],r):rf(r)?e[o]=mv({},r):ul(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&uu(arguments[r],n);return e}const nU=(t,e,n,{allOwnKeys:r}={})=>(uu(e,(i,o)=>{n&&zn(i)?t[o]=UC(i,n):t[o]=i},{allOwnKeys:r}),t),rU=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),aU=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},sU=(t,e,n,r)=>{let i,o,c;const u={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)c=i[o],(!r||r(c,t,e))&&!u[c]&&(e[c]=t[c],u[c]=!0);t=n!==!1&&Ty(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},iU=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},oU=t=>{if(!t)return null;if(ul(t))return t;let e=t.length;if(!HC(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},lU=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ty(Uint8Array)),cU=(t,e)=>{const r=(t&&t[nh]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},uU=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},dU=Zr("HTMLFormElement"),fU=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),bE=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),hU=Zr("RegExp"),VC=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};uu(n,(i,o)=>{let c;(c=e(i,o,t))!==!1&&(r[o]=c||i)}),Object.defineProperties(t,r)},pU=t=>{VC(t,(e,n)=>{if(zn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(zn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mU=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return ul(t)?r(t):r(String(t).split(e)),n},gU=()=>{},vU=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function yU(t){return!!(t&&zn(t.append)&&t[$C]==="FormData"&&t[nh])}const bU=t=>{const e=new Array(10),n=(r,i)=>{if(sh(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=ul(r)?[]:{};return uu(r,(c,u)=>{const f=n(c,i+1);!Wc(f)&&(o[u]=f)}),e[i]=void 0,o}}return r};return n(t,0)},wU=Zr("AsyncFunction"),xU=t=>t&&(sh(t)||zn(t))&&zn(t.then)&&zn(t.catch),GC=((t,e)=>t?setImmediate:e?((n,r)=>(xi.addEventListener("message",({source:i,data:o})=>{i===xi&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),xi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zn(xi.postMessage)),SU=typeof queueMicrotask<"u"?queueMicrotask.bind(xi):typeof process<"u"&&process.nextTick||GC,EU=t=>t!=null&&zn(t[nh]),ne={isArray:ul,isArrayBuffer:BC,isBuffer:$3,isFormData:K3,isArrayBufferView:B3,isString:H3,isNumber:HC,isBoolean:F3,isObject:sh,isPlainObject:rf,isReadableStream:Q3,isRequest:X3,isResponse:J3,isHeaders:eU,isUndefined:Wc,isDate:q3,isFile:V3,isBlob:G3,isRegExp:hU,isFunction:zn,isStream:W3,isURLSearchParams:Z3,isTypedArray:lU,isFileList:Y3,forEach:uu,merge:mv,extend:nU,trim:tU,stripBOM:rU,inherits:aU,toFlatObject:sU,kindOf:rh,kindOfTest:Zr,endsWith:iU,toArray:oU,forEachEntry:cU,matchAll:uU,isHTMLForm:dU,hasOwnProperty:bE,hasOwnProp:bE,reduceDescriptors:VC,freezeMethods:pU,toObjectSet:mU,toCamelCase:fU,noop:gU,toFiniteNumber:vU,findKey:FC,global:xi,isContextDefined:qC,isSpecCompliantForm:yU,toJSONObject:bU,isAsyncFn:wU,isThenable:xU,setImmediate:GC,asap:SU,isIterable:EU};function qe(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}ne.inherits(qe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ne.toJSONObject(this.config),code:this.code,status:this.status}}});const YC=qe.prototype,WC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{WC[t]={value:t}});Object.defineProperties(qe,WC);Object.defineProperty(YC,"isAxiosError",{value:!0});qe.from=(t,e,n,r,i,o)=>{const c=Object.create(YC);return ne.toFlatObject(t,c,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),qe.call(c,t.message,e,n,r,i),c.cause=t,c.name=t.name,o&&Object.assign(c,o),c};const _U=null;function gv(t){return ne.isPlainObject(t)||ne.isArray(t)}function KC(t){return ne.endsWith(t,"[]")?t.slice(0,-2):t}function wE(t,e,n){return t?t.concat(e).map(function(i,o){return i=KC(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function TU(t){return ne.isArray(t)&&!t.some(gv)}const CU=ne.toFlatObject(ne,{},null,function(e){return/^is[A-Z]/.test(e)});function ih(t,e,n){if(!ne.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!ne.isUndefined(_[E])});const r=n.metaTokens,i=n.visitor||m,o=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ne.isSpecCompliantForm(e);if(!ne.isFunction(i))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ne.isDate(S))return S.toISOString();if(ne.isBoolean(S))return S.toString();if(!f&&ne.isBlob(S))throw new qe("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(S)||ne.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,E,_){let C=S;if(S&&!_&&typeof S=="object"){if(ne.endsWith(E,"{}"))E=r?E:E.slice(0,-2),S=JSON.stringify(S);else if(ne.isArray(S)&&TU(S)||(ne.isFileList(S)||ne.endsWith(E,"[]"))&&(C=ne.toArray(S)))return E=KC(E),C.forEach(function(A,k){!(ne.isUndefined(A)||A===null)&&e.append(c===!0?wE([E],k,o):c===null?E:E+"[]",h(A))}),!1}return gv(S)?!0:(e.append(wE(_,E,o),h(S)),!1)}const v=[],x=Object.assign(CU,{defaultVisitor:m,convertValue:h,isVisitable:gv});function w(S,E){if(!ne.isUndefined(S)){if(v.indexOf(S)!==-1)throw Error("Circular reference detected in "+E.join("."));v.push(S),ne.forEach(S,function(C,R){(!(ne.isUndefined(C)||C===null)&&i.call(e,C,ne.isString(R)?R.trim():R,E,x))===!0&&w(C,E?E.concat(R):[R])}),v.pop()}}if(!ne.isObject(t))throw new TypeError("data must be an object");return w(t),e}function xE(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Cy(t,e){this._pairs=[],t&&ih(t,this,e)}const ZC=Cy.prototype;ZC.append=function(e,n){this._pairs.push([e,n])};ZC.toString=function(e){const n=e?function(r){return e.call(this,r,xE)}:xE;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function RU(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QC(t,e,n){if(!e)return t;const r=n&&n.encode||RU;ne.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(e,n):o=ne.isURLSearchParams(e)?e.toString():new Cy(e,n).toString(r),o){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class SE{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ne.forEach(this.handlers,function(r){r!==null&&e(r)})}}const XC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},OU=typeof URLSearchParams<"u"?URLSearchParams:Cy,AU=typeof FormData<"u"?FormData:null,NU=typeof Blob<"u"?Blob:null,jU={isBrowser:!0,classes:{URLSearchParams:OU,FormData:AU,Blob:NU},protocols:["http","https","file","blob","url","data"]},Ry=typeof window<"u"&&typeof document<"u",vv=typeof navigator=="object"&&navigator||void 0,kU=Ry&&(!vv||["ReactNative","NativeScript","NS"].indexOf(vv.product)<0),MU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",DU=Ry&&window.location.href||"http://localhost",PU=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ry,hasStandardBrowserEnv:kU,hasStandardBrowserWebWorkerEnv:MU,navigator:vv,origin:DU},Symbol.toStringTag,{value:"Module"})),yn={...PU,...jU};function LU(t,e){return ih(t,new yn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return yn.isNode&&ne.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function IU(t){return ne.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function zU(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function JC(t){function e(n,r,i,o){let c=n[o++];if(c==="__proto__")return!0;const u=Number.isFinite(+c),f=o>=n.length;return c=!c&&ne.isArray(i)?i.length:c,f?(ne.hasOwnProp(i,c)?i[c]=[i[c],r]:i[c]=r,!u):((!i[c]||!ne.isObject(i[c]))&&(i[c]=[]),e(n,r,i[c],o)&&ne.isArray(i[c])&&(i[c]=zU(i[c])),!u)}if(ne.isFormData(t)&&ne.isFunction(t.entries)){const n={};return ne.forEachEntry(t,(r,i)=>{e(IU(r),i,n,0)}),n}return null}function UU(t,e,n){if(ne.isString(t))try{return(e||JSON.parse)(t),ne.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const du={transitional:XC,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ne.isObject(e);if(o&&ne.isHTMLForm(e)&&(e=new FormData(e)),ne.isFormData(e))return i?JSON.stringify(JC(e)):e;if(ne.isArrayBuffer(e)||ne.isBuffer(e)||ne.isStream(e)||ne.isFile(e)||ne.isBlob(e)||ne.isReadableStream(e))return e;if(ne.isArrayBufferView(e))return e.buffer;if(ne.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return LU(e,this.formSerializer).toString();if((u=ne.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ih(u?{"files[]":e}:e,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),UU(e)):e}],transformResponse:[function(e){const n=this.transitional||du.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ne.isResponse(e)||ne.isReadableStream(e))return e;if(e&&ne.isString(e)&&(r&&!this.responseType||i)){const c=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(u){if(c)throw u.name==="SyntaxError"?qe.from(u,qe.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yn.classes.FormData,Blob:yn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],t=>{du.headers[t]={}});const $U=ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BU=t=>{const e={};let n,r,i;return t&&t.split(`
`).forEach(function(c){i=c.indexOf(":"),n=c.substring(0,i).trim().toLowerCase(),r=c.substring(i+1).trim(),!(!n||e[n]&&$U[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},EE=Symbol("internals");function Sc(t){return t&&String(t).trim().toLowerCase()}function af(t){return t===!1||t==null?t:ne.isArray(t)?t.map(af):String(t)}function HU(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const FU=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pg(t,e,n,r,i){if(ne.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!ne.isString(e)){if(ne.isString(r))return e.indexOf(r)!==-1;if(ne.isRegExp(r))return r.test(e)}}function qU(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function VU(t,e){const n=ne.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,c){return this[r].call(this,e,i,o,c)},configurable:!0})})}let Un=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(u,f,h){const m=Sc(f);if(!m)throw new Error("header name must be a non-empty string");const v=ne.findKey(i,m);(!v||i[v]===void 0||h===!0||h===void 0&&i[v]!==!1)&&(i[v||f]=af(u))}const c=(u,f)=>ne.forEach(u,(h,m)=>o(h,m,f));if(ne.isPlainObject(e)||e instanceof this.constructor)c(e,n);else if(ne.isString(e)&&(e=e.trim())&&!FU(e))c(BU(e),n);else if(ne.isObject(e)&&ne.isIterable(e)){let u={},f,h;for(const m of e){if(!ne.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[h=m[0]]=(f=u[h])?ne.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}c(u,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=Sc(e),e){const r=ne.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return HU(i);if(ne.isFunction(n))return n.call(this,i,r);if(ne.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Sc(e),e){const r=ne.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||pg(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(c){if(c=Sc(c),c){const u=ne.findKey(r,c);u&&(!n||pg(r,r[u],u,n))&&(delete r[u],i=!0)}}return ne.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||pg(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return ne.forEach(this,(i,o)=>{const c=ne.findKey(r,o);if(c){n[c]=af(i),delete n[o];return}const u=e?qU(o):String(o).trim();u!==o&&delete n[o],n[u]=af(i),r[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ne.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&ne.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[EE]=this[EE]={accessors:{}}).accessors,i=this.prototype;function o(c){const u=Sc(c);r[u]||(VU(i,c),r[u]=!0)}return ne.isArray(e)?e.forEach(o):o(e),this}};Un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ne.reduceDescriptors(Un.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ne.freezeMethods(Un);function mg(t,e){const n=this||du,r=e||n,i=Un.from(r.headers);let o=r.data;return ne.forEach(t,function(u){o=u.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function eR(t){return!!(t&&t.__CANCEL__)}function dl(t,e,n){qe.call(this,t??"canceled",qe.ERR_CANCELED,e,n),this.name="CanceledError"}ne.inherits(dl,qe,{__CANCEL__:!0});function tR(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new qe("Request failed with status code "+n.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function GU(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function YU(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,c;return e=e!==void 0?e:1e3,function(f){const h=Date.now(),m=r[o];c||(c=h),n[i]=f,r[i]=h;let v=o,x=0;for(;v!==i;)x+=n[v++],v=v%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),h-c<e)return;const w=m&&h-m;return w?Math.round(x*1e3/w):void 0}}function WU(t,e){let n=0,r=1e3/e,i,o;const c=(h,m=Date.now())=>{n=m,i=null,o&&(clearTimeout(o),o=null),t.apply(null,h)};return[(...h)=>{const m=Date.now(),v=m-n;v>=r?c(h,m):(i=h,o||(o=setTimeout(()=>{o=null,c(i)},r-v)))},()=>i&&c(i)]}const Tf=(t,e,n=3)=>{let r=0;const i=YU(50,250);return WU(o=>{const c=o.loaded,u=o.lengthComputable?o.total:void 0,f=c-r,h=i(f),m=c<=u;r=c;const v={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&m?(u-c)/h:void 0,event:o,lengthComputable:u!=null,[e?"download":"upload"]:!0};t(v)},n)},_E=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},TE=t=>(...e)=>ne.asap(()=>t(...e)),KU=yn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,yn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(yn.origin),yn.navigator&&/(msie|trident)/i.test(yn.navigator.userAgent)):()=>!0,ZU=yn.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const c=[t+"="+encodeURIComponent(e)];ne.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ne.isString(r)&&c.push("path="+r),ne.isString(i)&&c.push("domain="+i),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function QU(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function XU(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function nR(t,e,n){let r=!QU(e);return t&&(r||n==!1)?XU(t,e):e}const CE=t=>t instanceof Un?{...t}:t;function Ci(t,e){e=e||{};const n={};function r(h,m,v,x){return ne.isPlainObject(h)&&ne.isPlainObject(m)?ne.merge.call({caseless:x},h,m):ne.isPlainObject(m)?ne.merge({},m):ne.isArray(m)?m.slice():m}function i(h,m,v,x){if(ne.isUndefined(m)){if(!ne.isUndefined(h))return r(void 0,h,v,x)}else return r(h,m,v,x)}function o(h,m){if(!ne.isUndefined(m))return r(void 0,m)}function c(h,m){if(ne.isUndefined(m)){if(!ne.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function u(h,m,v){if(v in e)return r(h,m);if(v in t)return r(void 0,h)}const f={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(h,m,v)=>i(CE(h),CE(m),v,!0)};return ne.forEach(Object.keys(Object.assign({},t,e)),function(m){const v=f[m]||i,x=v(t[m],e[m],m);ne.isUndefined(x)&&v!==u||(n[m]=x)}),n}const rR=t=>{const e=Ci({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:c,auth:u}=e;e.headers=c=Un.from(c),e.url=QC(nR(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ne.isFormData(n)){if(yn.hasStandardBrowserEnv||yn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){const[h,...m]=f?f.split(";").map(v=>v.trim()).filter(Boolean):[];c.setContentType([h||"multipart/form-data",...m].join("; "))}}if(yn.hasStandardBrowserEnv&&(r&&ne.isFunction(r)&&(r=r(e)),r||r!==!1&&KU(e.url))){const h=i&&o&&ZU.read(o);h&&c.set(i,h)}return e},JU=typeof XMLHttpRequest<"u",e5=JU&&function(t){return new Promise(function(n,r){const i=rR(t);let o=i.data;const c=Un.from(i.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=i,m,v,x,w,S;function E(){w&&w(),S&&S(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let _=new XMLHttpRequest;_.open(i.method.toUpperCase(),i.url,!0),_.timeout=i.timeout;function C(){if(!_)return;const A=Un.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:t,request:_};tR(function(L){n(L),E()},function(L){r(L),E()},D),_=null}"onloadend"in _?_.onloadend=C:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(C)},_.onabort=function(){_&&(r(new qe("Request aborted",qe.ECONNABORTED,t,_)),_=null)},_.onerror=function(){r(new qe("Network Error",qe.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||XC;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new qe(k,D.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,t,_)),_=null},o===void 0&&c.setContentType(null),"setRequestHeader"in _&&ne.forEach(c.toJSON(),function(k,D){_.setRequestHeader(D,k)}),ne.isUndefined(i.withCredentials)||(_.withCredentials=!!i.withCredentials),u&&u!=="json"&&(_.responseType=i.responseType),h&&([x,S]=Tf(h,!0),_.addEventListener("progress",x)),f&&_.upload&&([v,w]=Tf(f),_.upload.addEventListener("progress",v),_.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(m=A=>{_&&(r(!A||A.type?new dl(null,t,_):A),_.abort(),_=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const R=GU(i.url);if(R&&yn.protocols.indexOf(R)===-1){r(new qe("Unsupported protocol "+R+":",qe.ERR_BAD_REQUEST,t));return}_.send(o||null)})},t5=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(h){if(!i){i=!0,u();const m=h instanceof Error?h:this.reason;r.abort(m instanceof qe?m:new dl(m instanceof Error?m.message:m))}};let c=e&&setTimeout(()=>{c=null,o(new qe(`timeout ${e} of ms exceeded`,qe.ETIMEDOUT))},e);const u=()=>{t&&(c&&clearTimeout(c),c=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),t=null)};t.forEach(h=>h.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>ne.asap(u),f}},n5=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},r5=async function*(t,e){for await(const n of a5(t))yield*n5(n,e)},a5=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},RE=(t,e,n,r)=>{const i=r5(t,e);let o=0,c,u=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await i.next();if(h){u(),f.close();return}let v=m.byteLength;if(n){let x=o+=v;n(x)}f.enqueue(new Uint8Array(m))}catch(h){throw u(h),h}},cancel(f){return u(f),i.return()}},{highWaterMark:2})},oh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",aR=oh&&typeof ReadableStream=="function",s5=oh&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),sR=(t,...e)=>{try{return!!t(...e)}catch{return!1}},i5=aR&&sR(()=>{let t=!1;const e=new Request(yn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),OE=64*1024,yv=aR&&sR(()=>ne.isReadableStream(new Response("").body)),Cf={stream:yv&&(t=>t.body)};oh&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Cf[e]&&(Cf[e]=ne.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new qe(`Response type '${e}' is not supported`,qe.ERR_NOT_SUPPORT,r)})})})(new Response);const o5=async t=>{if(t==null)return 0;if(ne.isBlob(t))return t.size;if(ne.isSpecCompliantForm(t))return(await new Request(yn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ne.isArrayBufferView(t)||ne.isArrayBuffer(t))return t.byteLength;if(ne.isURLSearchParams(t)&&(t=t+""),ne.isString(t))return(await s5(t)).byteLength},l5=async(t,e)=>{const n=ne.toFiniteNumber(t.getContentLength());return n??o5(e)},c5=oh&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:c,onDownloadProgress:u,onUploadProgress:f,responseType:h,headers:m,withCredentials:v="same-origin",fetchOptions:x}=rR(t);h=h?(h+"").toLowerCase():"text";let w=t5([i,o&&o.toAbortSignal()],c),S;const E=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let _;try{if(f&&i5&&n!=="get"&&n!=="head"&&(_=await l5(m,r))!==0){let D=new Request(e,{method:"POST",body:r,duplex:"half"}),N;if(ne.isFormData(r)&&(N=D.headers.get("content-type"))&&m.setContentType(N),D.body){const[L,Z]=_E(_,Tf(TE(f)));r=RE(D.body,OE,L,Z)}}ne.isString(v)||(v=v?"include":"omit");const C="credentials"in Request.prototype;S=new Request(e,{...x,signal:w,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:r,duplex:"half",credentials:C?v:void 0});let R=await fetch(S,x);const A=yv&&(h==="stream"||h==="response");if(yv&&(u||A&&E)){const D={};["status","statusText","headers"].forEach(Q=>{D[Q]=R[Q]});const N=ne.toFiniteNumber(R.headers.get("content-length")),[L,Z]=u&&_E(N,Tf(TE(u),!0))||[];R=new Response(RE(R.body,OE,L,()=>{Z&&Z(),E&&E()}),D)}h=h||"text";let k=await Cf[ne.findKey(Cf,h)||"text"](R,t);return!A&&E&&E(),await new Promise((D,N)=>{tR(D,N,{data:k,headers:Un.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:S})})}catch(C){throw E&&E(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new qe("Network Error",qe.ERR_NETWORK,t,S),{cause:C.cause||C}):qe.from(C,C&&C.code,t,S)}}),bv={http:_U,xhr:e5,fetch:c5};ne.forEach(bv,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const AE=t=>`- ${t}`,u5=t=>ne.isFunction(t)||t===null||t===!1,iR={getAdapter:t=>{t=ne.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let c;if(r=n,!u5(n)&&(r=bv[(c=String(n)).toLowerCase()],r===void 0))throw new qe(`Unknown adapter '${c}'`);if(r)break;i[c||"#"+o]=r}if(!r){const o=Object.entries(i).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=e?o.length>1?`since :
`+o.map(AE).join(`
`):" "+AE(o[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:bv};function gg(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dl(null,t)}function NE(t){return gg(t),t.headers=Un.from(t.headers),t.data=mg.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),iR.getAdapter(t.adapter||du.adapter)(t).then(function(r){return gg(t),r.data=mg.call(t,t.transformResponse,r),r.headers=Un.from(r.headers),r},function(r){return eR(r)||(gg(t),r&&r.response&&(r.response.data=mg.call(t,t.transformResponse,r.response),r.response.headers=Un.from(r.response.headers))),Promise.reject(r)})}const oR="1.10.0",lh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{lh[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const jE={};lh.transitional=function(e,n,r){function i(o,c){return"[Axios v"+oR+"] Transitional option '"+o+"'"+c+(r?". "+r:"")}return(o,c,u)=>{if(e===!1)throw new qe(i(c," has been removed"+(n?" in "+n:"")),qe.ERR_DEPRECATED);return n&&!jE[c]&&(jE[c]=!0,console.warn(i(c," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,c,u):!0}};lh.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function d5(t,e,n){if(typeof t!="object")throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],c=e[o];if(c){const u=t[o],f=u===void 0||c(u,o,t);if(f!==!0)throw new qe("option "+o+" must be "+f,qe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qe("Unknown option "+o,qe.ERR_BAD_OPTION)}}const sf={assertOptions:d5,validators:lh},ra=sf.validators;let Si=class{constructor(e){this.defaults=e||{},this.interceptors={request:new SE,response:new SE}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ci(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&sf.assertOptions(r,{silentJSONParsing:ra.transitional(ra.boolean),forcedJSONParsing:ra.transitional(ra.boolean),clarifyTimeoutError:ra.transitional(ra.boolean)},!1),i!=null&&(ne.isFunction(i)?n.paramsSerializer={serialize:i}:sf.assertOptions(i,{encode:ra.function,serialize:ra.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),sf.assertOptions(n,{baseUrl:ra.spelling("baseURL"),withXsrfToken:ra.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&ne.merge(o.common,o[n.method]);o&&ne.forEach(["delete","get","head","post","put","patch","common"],S=>{delete o[S]}),n.headers=Un.concat(c,o);const u=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,u.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let m,v=0,x;if(!f){const S=[NE.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,h),x=S.length,m=Promise.resolve(n);v<x;)m=m.then(S[v++],S[v++]);return m}x=u.length;let w=n;for(v=0;v<x;){const S=u[v++],E=u[v++];try{w=S(w)}catch(_){E.call(this,_);break}}try{m=NE.call(this,w)}catch(S){return Promise.reject(S)}for(v=0,x=h.length;v<x;)m=m.then(h[v++],h[v++]);return m}getUri(e){e=Ci(this.defaults,e);const n=nR(e.baseURL,e.url,e.allowAbsoluteUrls);return QC(n,e.params,e.paramsSerializer)}};ne.forEach(["delete","get","head","options"],function(e){Si.prototype[e]=function(n,r){return this.request(Ci(r||{},{method:e,url:n,data:(r||{}).data}))}});ne.forEach(["post","put","patch"],function(e){function n(r){return function(o,c,u){return this.request(Ci(u||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}Si.prototype[e]=n(),Si.prototype[e+"Form"]=n(!0)});let f5=class lR{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const c=new Promise(u=>{r.subscribe(u),o=u}).then(i);return c.cancel=function(){r.unsubscribe(o)},c},e(function(o,c,u){r.reason||(r.reason=new dl(o,c,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new lR(function(i){e=i}),cancel:e}}};function h5(t){return function(n){return t.apply(null,n)}}function p5(t){return ne.isObject(t)&&t.isAxiosError===!0}const wv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wv).forEach(([t,e])=>{wv[e]=t});function cR(t){const e=new Si(t),n=UC(Si.prototype.request,e);return ne.extend(n,Si.prototype,e,{allOwnKeys:!0}),ne.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return cR(Ci(t,i))},n}const zt=cR(du);zt.Axios=Si;zt.CanceledError=dl;zt.CancelToken=f5;zt.isCancel=eR;zt.VERSION=oR;zt.toFormData=ih;zt.AxiosError=qe;zt.Cancel=zt.CanceledError;zt.all=function(e){return Promise.all(e)};zt.spread=h5;zt.isAxiosError=p5;zt.mergeConfig=Ci;zt.AxiosHeaders=Un;zt.formToJSON=t=>JC(ne.isHTMLForm(t)?new FormData(t):t);zt.getAdapter=iR.getAdapter;zt.HttpStatusCode=wv;zt.default=zt;const{Axios:iV,AxiosError:xv,CanceledError:oV,isCancel:lV,CancelToken:cV,VERSION:uV,all:dV,Cancel:fV,isAxiosError:m5,spread:hV,toFormData:pV,AxiosHeaders:mV,HttpStatusCode:gV,formToJSON:vV,getAdapter:yV,mergeConfig:bV}=zt,g5=()=>"/zylo-docs",v5=g5(),uR=zt.create({baseURL:v5,headers:{"Content-Type":"application/json"}}),y5=()=>"/zylo-docs/api",b5=y5(),qr=zt.create({baseURL:b5,headers:{"Content-Type":"application/json"}});qr.interceptors.response.use(t=>t.data);qr.interceptors.request.use(async t=>{const{data:{session:e}}=await Di.auth.getSession(),n=e?.access_token;return n&&(t.headers.Authorization=`Bearer ${n}`),t});function w5(){const t=Kr(),[e]=Yf();return b.useEffect(()=>{(async()=>{try{if(!e.toString())throw new Error("Missing verification parameters");const r=await qr.get(`/auth/verify?${e.toString()}`),i=r.data?.project_id,o=r.data?.spec_id;if(!i||!o)throw new Error("Invalid verification response");t(`/projects/${i}/specs/${o}`)}catch(r){const o=r?.response?.data?.message||r.message||"Verification failed";gn.error(`Documentation Error: ${o}`),t(`/forbidden?returnTo=${encodeURIComponent(`/auth/verify?${e.toString()}`)}`)}})()},[t,e]),null}function x5(){const t=zC(),e=IC(),[n]=Yf(),r=Kr(),i=async()=>{await e.mutateAsync(),r(`/signin?${n.toString()}`)};return g.jsxs("div",{className:"flex flex-col items-center justify-center h-screen",children:[g.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Forbidden"}),t?g.jsxs("div",{className:"text-center mb-8",children:[g.jsxs("p",{className:"text-lg mb-4",children:["You are already logged in as"," ",g.jsx("span",{className:"font-semibold",children:t.email})," but don't have access to this page."]}),g.jsx("button",{onClick:i,disabled:e.isPending,className:"bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-md transition-colors disabled:opacity-50",children:e.isPending?"Signing out...":"Sign Out"})]}):g.jsx("p",{className:"text-lg mb-8",children:"You need to be logged in to access this page."}),!t&&g.jsx(Gf,{to:`/signin?${n.toString()}`,className:"text-blue-500 hover:underline",children:"Go to Sign In"})]})}var S5=function(){return null};const E5=({children:t})=>(b.useEffect(()=>{const{data:e}=Di.auth.onAuthStateChange(()=>{Pi.invalidateQueries({queryKey:qa.session()})});return()=>{e?.subscription.unsubscribe()}},[]),g.jsx(g.Fragment,{children:t})),_5=()=>g.jsxs(YI,{client:Pi,children:[g.jsx(E5,{children:g.jsx(FD,{})}),g.jsx(z3,{expand:!0,richColors:!0,closeButton:!0,position:"top-center"}),g.jsx(S5,{initialIsOpen:!1})]});function T5(){return g.jsxs("div",{className:"flex flex-col items-center justify-center h-screen",children:[g.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Page Not Found"}),g.jsx("p",{className:"text-lg mb-8",children:"The page you are looking for does not exist."}),g.jsx(Gf,{to:"/",className:"text-blue-500 hover:underline",children:"Go to Homepage"})]})}function kE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ch(...t){return e=>{let n=!1;const r=t.map(i=>{const o=kE(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():kE(t[i],null)}}}}function Ke(...t){return b.useCallback(ch(...t),t)}var $a=b.forwardRef((t,e)=>{const{children:n,...r}=t,i=b.Children.toArray(n),o=i.find(C5);if(o){const c=o.props.children,u=i.map(f=>f===o?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:f);return g.jsx(Sv,{...r,ref:e,children:b.isValidElement(c)?b.cloneElement(c,void 0,u):null})}return g.jsx(Sv,{...r,ref:e,children:n})});$a.displayName="Slot";var Sv=b.forwardRef((t,e)=>{const{children:n,...r}=t;if(b.isValidElement(n)){const i=O5(n);return b.cloneElement(n,{...R5(r,n.props),ref:e?ch(e,i):i})}return b.Children.count(n)>1?b.Children.only(null):null});Sv.displayName="SlotClone";var dR=({children:t})=>g.jsx(g.Fragment,{children:t});function C5(t){return b.isValidElement(t)&&t.type===dR}function R5(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{o(...u),i(...u)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function O5(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function fR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=fR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function hR(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=fR(t))&&(r&&(r+=" "),r+=e);return r}const ME=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,DE=hR,Us=(t,e)=>n=>{var r;if(e?.variants==null)return DE(t,n?.class,n?.className);const{variants:i,defaultVariants:o}=e,c=Object.keys(i).map(h=>{const m=n?.[h],v=o?.[h];if(m===null)return null;const x=ME(m)||ME(v);return i[h][x]}),u=n&&Object.entries(n).reduce((h,m)=>{let[v,x]=m;return x===void 0||(h[v]=x),h},{}),f=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:v,className:x,...w}=m;return Object.entries(w).every(S=>{let[E,_]=S;return Array.isArray(_)?_.includes({...o,...u}[E]):{...o,...u}[E]===_})?[...h,v,x]:h},[]);return DE(t,c,f,n?.class,n?.className)};/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pR=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var N5={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"};/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j5=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:c,...u},f)=>b.createElement("svg",{ref:f,...N5,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:pR("lucide",i),...u},[...c.map(([h,m])=>b.createElement(h,m)),...Array.isArray(o)?o:[o]]));/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ft=(t,e)=>{const n=b.forwardRef(({className:r,...i},o)=>b.createElement(j5,{ref:o,iconNode:e,className:pR(`lucide-${A5(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k5=Ft("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mR=Ft("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jo=Ft("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PE=Ft("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gR=Ft("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M5=Ft("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D5=Ft("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vR=Ft("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P5=Ft("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const of=Ft("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lf=Ft("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L5=Ft("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const I5=Ft("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const la=Ft("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z5=Ft("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const U5=Ft("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $5=Ft("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yR=Ft("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LE=Ft("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B5=Ft("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
 * @license lucide-react v0.454.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bR=Ft("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Oy="-",H5=t=>{const e=q5(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:c=>{const u=c.split(Oy);return u[0]===""&&u.length!==1&&u.shift(),wR(u,e)||F5(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&r[c]?[...f,...r[c]]:f}}},wR=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?wR(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(Oy);return e.validators.find(({validator:c})=>c(o))?.classGroupId},IE=/^\[(.+)\]$/,F5=t=>{if(IE.test(t)){const e=IE.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},q5=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return G5(Object.entries(t.classGroups),n).forEach(([o,c])=>{Ev(c,r,o,e)}),r},Ev=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:zE(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(V5(i)){Ev(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,c])=>{Ev(c,zE(e,o),n,r)})})},zE=(t,e)=>{let n=t;return e.split(Oy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},V5=t=>t.isThemeGetter,G5=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,u])=>[e+c,u])):o);return[n,i]}):t,Y5=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,c)=>{n.set(o,c),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let c=n.get(o);if(c!==void 0)return c;if((c=r.get(o))!==void 0)return i(o,c),c},set(o,c){n.has(o)?n.set(o,c):i(o,c)}}},xR="!",W5=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,c=u=>{const f=[];let h=0,m=0,v;for(let _=0;_<u.length;_++){let C=u[_];if(h===0){if(C===i&&(r||u.slice(_,_+o)===e)){f.push(u.slice(m,_)),m=_+o;continue}if(C==="/"){v=_;continue}}C==="["?h++:C==="]"&&h--}const x=f.length===0?u:u.substring(m),w=x.startsWith(xR),S=w?x.substring(1):x,E=v&&v>m?v-m:void 0;return{modifiers:f,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:E}};return n?u=>n({className:u,parseClassName:c}):c},K5=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},Z5=t=>({cache:Y5(t.cacheSize),parseClassName:W5(t),...H5(t)}),Q5=/\s+/,X5=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],c=t.trim().split(Q5);let u="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{modifiers:m,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:w}=n(h);let S=!!w,E=r(S?x.substring(0,w):x);if(!E){if(!S){u=h+(u.length>0?" "+u:u);continue}if(E=r(x),!E){u=h+(u.length>0?" "+u:u);continue}S=!1}const _=K5(m).join(":"),C=v?_+xR:_,R=C+E;if(o.includes(R))continue;o.push(R);const A=i(E,S);for(let k=0;k<A.length;++k){const D=A[k];o.push(C+D)}u=h+(u.length>0?" "+u:u)}return u};function J5(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=SR(e))&&(r&&(r+=" "),r+=n);return r}const SR=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=SR(t[r]))&&(n&&(n+=" "),n+=e);return n};function e6(t,...e){let n,r,i,o=c;function c(f){const h=e.reduce((m,v)=>v(m),t());return n=Z5(h),r=n.cache.get,i=n.cache.set,o=u,u(f)}function u(f){const h=r(f);if(h)return h;const m=X5(f,n);return i(f,m),m}return function(){return o(J5.apply(null,arguments))}}const Tt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},ER=/^\[(?:([a-z-]+):)?(.+)\]$/i,t6=/^\d+\/\d+$/,n6=new Set(["px","full","screen"]),r6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,a6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,s6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,i6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,o6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=t=>Yo(t)||n6.has(t)||t6.test(t),Ss=t=>fl(t,"length",m6),Yo=t=>!!t&&!Number.isNaN(Number(t)),vg=t=>fl(t,"number",Yo),Ec=t=>!!t&&Number.isInteger(Number(t)),l6=t=>t.endsWith("%")&&Yo(t.slice(0,-1)),Ge=t=>ER.test(t),Es=t=>r6.test(t),c6=new Set(["length","size","percentage"]),u6=t=>fl(t,c6,_R),d6=t=>fl(t,"position",_R),f6=new Set(["image","url"]),h6=t=>fl(t,f6,v6),p6=t=>fl(t,"",g6),_c=()=>!0,fl=(t,e,n)=>{const r=ER.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},m6=t=>a6.test(t)&&!s6.test(t),_R=()=>!1,g6=t=>i6.test(t),v6=t=>o6.test(t),y6=()=>{const t=Tt("colors"),e=Tt("spacing"),n=Tt("blur"),r=Tt("brightness"),i=Tt("borderColor"),o=Tt("borderRadius"),c=Tt("borderSpacing"),u=Tt("borderWidth"),f=Tt("contrast"),h=Tt("grayscale"),m=Tt("hueRotate"),v=Tt("invert"),x=Tt("gap"),w=Tt("gradientColorStops"),S=Tt("gradientColorStopPositions"),E=Tt("inset"),_=Tt("margin"),C=Tt("opacity"),R=Tt("padding"),A=Tt("saturate"),k=Tt("scale"),D=Tt("sepia"),N=Tt("skew"),L=Tt("space"),Z=Tt("translate"),Q=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",Ge,e],se=()=>[Ge,e],ge=()=>["",Da,Ss],pe=()=>["auto",Yo,Ge],ve=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",Ge],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Yo,Ge];return{cacheSize:500,separator:":",theme:{colors:[_c],spacing:[Da,Ss],blur:["none","",Es,Ge],brightness:V(),borderColor:[t],borderRadius:["none","","full",Es,Ge],borderSpacing:se(),borderWidth:ge(),contrast:V(),grayscale:H(),hueRotate:V(),invert:H(),gap:se(),gradientColorStops:[t],gradientColorStopPositions:[l6,Ss],inset:ce(),margin:ce(),opacity:V(),padding:se(),saturate:V(),scale:V(),sepia:H(),skew:V(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",Ge]}],container:["container"],columns:[{columns:[Es]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ve(),Ge]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ec,Ge]}],basis:[{basis:ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ge]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Ec,Ge]}],"grid-cols":[{"grid-cols":[_c]}],"col-start-end":[{col:["auto",{span:["full",Ec,Ge]},Ge]}],"col-start":[{"col-start":pe()}],"col-end":[{"col-end":pe()}],"grid-rows":[{"grid-rows":[_c]}],"row-start-end":[{row:["auto",{span:[Ec,Ge]},Ge]}],"row-start":[{"row-start":pe()}],"row-end":[{"row-end":pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ge]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ge,e]}],"min-w":[{"min-w":[Ge,e,"min","max","fit"]}],"max-w":[{"max-w":[Ge,e,"none","full","min","max","fit","prose",{screen:[Es]},Es]}],h:[{h:[Ge,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ge,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ge,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ge,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Es,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vg]}],"font-family":[{font:[_c]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ge]}],"line-clamp":[{"line-clamp":["none",Yo,vg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Da,Ge]}],"list-image":[{"list-image":["none",Ge]}],"list-style-type":[{list:["none","disc","decimal",Ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Da,Ss]}],"underline-offset":[{"underline-offset":["auto",Da,Ge]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ve(),d6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",u6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},h6]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Da,Ge]}],"outline-w":[{outline:[Da,Ss]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Da,Ss]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Es,p6]}],"shadow-color":[{shadow:[_c]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Es,Ge]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[v]}],saturate:[{saturate:[A]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ge]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",Ge]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Ec,Ge]}],"translate-x":[{"translate-x":[Z]}],"translate-y":[{"translate-y":[Z]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Da,Ss,vg]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},b6=e6(y6);function ye(...t){return b6(hR(t))}const w6=Us("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function At({className:t,variant:e,size:n,asChild:r=!1,...i}){const o=r?$a:"button";return g.jsx(o,{"data-slot":"button",className:ye(w6({variant:e,size:n,className:t})),...i})}function $r({className:t,type:e,...n}){return g.jsx("input",{type:e,"data-slot":"input",className:ye("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-xs","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}var x6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Oe=x6.reduce((t,e)=>{const n=b.forwardRef((r,i)=>{const{asChild:o,...c}=r,u=o?$a:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(u,{...c,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function TR(t,e){t&&rl.flushSync(()=>t.dispatchEvent(e))}var S6="Separator",UE="horizontal",E6=["horizontal","vertical"],CR=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=UE,...i}=t,o=_6(r)?r:UE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.jsx(Oe.div,{"data-orientation":o,...u,...i,ref:e})});CR.displayName=S6;function _6(t){return E6.includes(t)}var T6=CR;function Rf({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return g.jsx(T6,{"data-slot":"separator",decorative:n,orientation:e,className:ye("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function be(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function C6(t,e){const n=b.createContext(e),r=o=>{const{children:c,...u}=o,f=b.useMemo(()=>u,Object.values(u));return g.jsx(n.Provider,{value:f,children:c})};r.displayName=t+"Provider";function i(o){const c=b.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function Rn(t,e=[]){let n=[];function r(o,c){const u=b.createContext(c),f=n.length;n=[...n,c];const h=v=>{const{scope:x,children:w,...S}=v,E=x?.[t]?.[f]||u,_=b.useMemo(()=>S,Object.values(S));return g.jsx(E.Provider,{value:_,children:w})};h.displayName=o+"Provider";function m(v,x){const w=x?.[t]?.[f]||u,S=b.useContext(w);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${o}\``)}return[h,m]}const i=()=>{const o=n.map(c=>b.createContext(c));return function(u){const f=u?.[t]||o;return b.useMemo(()=>({[`__scope${t}`]:{...u,[t]:f}}),[u,f])}};return i.scopeName=t,[r,R6(i,...e)]}function R6(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const c=r.reduce((u,{useScope:f,scopeName:h})=>{const v=f(o)[`__scope${h}`];return{...u,...v}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}var un=globalThis?.document?b.useLayoutEffect:()=>{},O6=j_.useId||(()=>{}),A6=0;function nr(t){const[e,n]=b.useState(O6());return un(()=>{n(r=>r??String(A6++))},[t]),e?`radix-${e}`:""}function Jt(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...n)=>e.current?.(...n),[])}function $n({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=N6({defaultProp:e,onChange:n}),o=t!==void 0,c=o?t:r,u=Jt(n),f=b.useCallback(h=>{if(o){const v=typeof h=="function"?h(t):h;v!==t&&u(v)}else i(h)},[o,t,i,u]);return[c,f]}function N6({defaultProp:t,onChange:e}){const n=b.useState(t),[r]=n,i=b.useRef(r),o=Jt(e);return b.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function j6(t,e=globalThis?.document){const n=Jt(t);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var k6="DismissableLayer",_v="dismissableLayer.update",M6="dismissableLayer.pointerDownOutside",D6="dismissableLayer.focusOutside",$E,RR=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fu=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:u,...f}=t,h=b.useContext(RR),[m,v]=b.useState(null),x=m?.ownerDocument??globalThis?.document,[,w]=b.useState({}),S=Ke(e,L=>v(L)),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=E.indexOf(_),R=m?E.indexOf(m):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,k=R>=C,D=I6(L=>{const Z=L.target,Q=[...h.branches].some(te=>te.contains(Z));!k||Q||(i?.(L),c?.(L),L.defaultPrevented||u?.())},x),N=z6(L=>{const Z=L.target;[...h.branches].some(te=>te.contains(Z))||(o?.(L),c?.(L),L.defaultPrevented||u?.())},x);return j6(L=>{R===h.layers.size-1&&(r?.(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))},x),b.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&($E=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),BE(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=$E)}},[m,x,n,h]),b.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),BE())},[m,h]),b.useEffect(()=>{const L=()=>w({});return document.addEventListener(_v,L),()=>document.removeEventListener(_v,L)},[]),g.jsx(Oe.div,{...f,ref:S,style:{pointerEvents:A?k?"auto":"none":void 0,...t.style},onFocusCapture:be(t.onFocusCapture,N.onFocusCapture),onBlurCapture:be(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:be(t.onPointerDownCapture,D.onPointerDownCapture)})});fu.displayName=k6;var P6="DismissableLayerBranch",L6=b.forwardRef((t,e)=>{const n=b.useContext(RR),r=b.useRef(null),i=Ke(e,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(Oe.div,{...t,ref:i})});L6.displayName=P6;function I6(t,e=globalThis?.document){const n=Jt(t),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){OR(M6,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=f,e.addEventListener("click",i.current,{once:!0})):f()}else e.removeEventListener("click",i.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function z6(t,e=globalThis?.document){const n=Jt(t),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&OR(D6,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function BE(){const t=new CustomEvent(_v);document.dispatchEvent(t)}function OR(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?TR(i,o):i.dispatchEvent(o)}var yg="focusScope.autoFocusOnMount",bg="focusScope.autoFocusOnUnmount",HE={bubbles:!1,cancelable:!0},U6="FocusScope",uh=b.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[u,f]=b.useState(null),h=Jt(i),m=Jt(o),v=b.useRef(null),x=Ke(e,E=>f(E)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let E=function(A){if(w.paused||!u)return;const k=A.target;u.contains(k)?v.current=k:Cs(v.current,{select:!0})},_=function(A){if(w.paused||!u)return;const k=A.relatedTarget;k!==null&&(u.contains(k)||Cs(v.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Cs(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",_);const R=new MutationObserver(C);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",_),R.disconnect()}}},[r,u,w.paused]),b.useEffect(()=>{if(u){qE.add(w);const E=document.activeElement;if(!u.contains(E)){const C=new CustomEvent(yg,HE);u.addEventListener(yg,h),u.dispatchEvent(C),C.defaultPrevented||($6(V6(AR(u)),{select:!0}),document.activeElement===E&&Cs(u))}return()=>{u.removeEventListener(yg,h),setTimeout(()=>{const C=new CustomEvent(bg,HE);u.addEventListener(bg,m),u.dispatchEvent(C),C.defaultPrevented||Cs(E??document.body,{select:!0}),u.removeEventListener(bg,m),qE.remove(w)},0)}}},[u,h,m,w]);const S=b.useCallback(E=>{if(!n&&!r||w.paused)return;const _=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,C=document.activeElement;if(_&&C){const R=E.currentTarget,[A,k]=B6(R);A&&k?!E.shiftKey&&C===k?(E.preventDefault(),n&&Cs(A,{select:!0})):E.shiftKey&&C===A&&(E.preventDefault(),n&&Cs(k,{select:!0})):C===R&&E.preventDefault()}},[n,r,w.paused]);return g.jsx(Oe.div,{tabIndex:-1,...c,ref:x,onKeyDown:S})});uh.displayName=U6;function $6(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Cs(r,{select:e}),document.activeElement!==n)return}function B6(t){const e=AR(t),n=FE(e,t),r=FE(e.reverse(),t);return[n,r]}function AR(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function FE(t,e){for(const n of t)if(!H6(n,{upTo:e}))return n}function H6(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function F6(t){return t instanceof HTMLInputElement&&"select"in t}function Cs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&F6(t)&&e&&t.select()}}var qE=q6();function q6(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=VE(t,e),t.unshift(e)},remove(e){t=VE(t,e),t[0]?.resume()}}}function VE(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function V6(t){return t.filter(e=>e.tagName!=="A")}var G6="Portal",hu=b.forwardRef((t,e)=>{const{container:n,...r}=t,[i,o]=b.useState(!1);un(()=>o(!0),[]);const c=n||i&&globalThis?.document?.body;return c?rT.createPortal(g.jsx(Oe.div,{...r,ref:e}),c):null});hu.displayName=G6;function Y6(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var dn=t=>{const{present:e,children:n}=t,r=W6(e),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=Ke(r.ref,K6(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};dn.displayName="Presence";function W6(t){const[e,n]=b.useState(),r=b.useRef({}),i=b.useRef(t),o=b.useRef("none"),c=t?"mounted":"unmounted",[u,f]=Y6(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=Fd(r.current);o.current=u==="mounted"?h:"none"},[u]),un(()=>{const h=r.current,m=i.current;if(m!==t){const x=o.current,w=Fd(h);t?f("MOUNT"):w==="none"||h?.display==="none"?f("UNMOUNT"):f(m&&x!==w?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,f]),un(()=>{if(e){let h;const m=e.ownerDocument.defaultView??window,v=w=>{const E=Fd(r.current).includes(w.animationName);if(w.target===e&&E&&(f("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",h=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},x=w=>{w.target===e&&(o.current=Fd(r.current))};return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{m.clearTimeout(h),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(h=>{h&&(r.current=getComputedStyle(h)),n(h)},[])}}function Fd(t){return t?.animationName||"none"}function K6(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var wg=0;function Ay(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??GE()),document.body.insertAdjacentElement("beforeend",t[1]??GE()),wg++,()=>{wg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),wg--}},[])}function GE(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var sa=function(){return sa=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sa.apply(this,arguments)};function NR(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Z6(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var cf="right-scroll-bar-position",uf="width-before-scroll-bar",Q6="with-scroll-bars-hidden",X6="--removed-body-scroll-bar-size";function xg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function J6(t,e){var n=b.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var e$=typeof window<"u"?b.useLayoutEffect:b.useEffect,YE=new WeakMap;function t$(t,e){var n=J6(null,function(r){return t.forEach(function(i){return xg(i,r)})});return e$(function(){var r=YE.get(n);if(r){var i=new Set(r),o=new Set(t),c=n.current;i.forEach(function(u){o.has(u)||xg(u,null)}),o.forEach(function(u){i.has(u)||xg(u,c)})}YE.set(n,t)},[t]),n}function n$(t){return t}function r$(t,e){e===void 0&&(e=n$);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var c=e(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return i}function a$(t){t===void 0&&(t={});var e=r$(null);return e.options=sa({async:!0,ssr:!1},t),e}var jR=function(t){var e=t.sideCar,n=NR(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,sa({},n))};jR.isSideCarExport=!0;function s$(t,e){return t.useMedium(e),jR}var kR=a$(),Sg=function(){},dh=b.forwardRef(function(t,e){var n=b.useRef(null),r=b.useState({onScrollCapture:Sg,onWheelCapture:Sg,onTouchMoveCapture:Sg}),i=r[0],o=r[1],c=t.forwardProps,u=t.children,f=t.className,h=t.removeScrollBar,m=t.enabled,v=t.shards,x=t.sideCar,w=t.noRelative,S=t.noIsolation,E=t.inert,_=t.allowPinchZoom,C=t.as,R=C===void 0?"div":C,A=t.gapMode,k=NR(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,N=t$([n,e]),L=sa(sa({},k),i);return b.createElement(b.Fragment,null,m&&b.createElement(D,{sideCar:kR,removeScrollBar:h,shards:v,noRelative:w,noIsolation:S,inert:E,setCallbacks:o,allowPinchZoom:!!_,lockRef:n,gapMode:A}),c?b.cloneElement(b.Children.only(u),sa(sa({},L),{ref:N})):b.createElement(R,sa({},L,{className:f,ref:N}),u))});dh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dh.classNames={fullWidth:uf,zeroRight:cf};var i$=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function o$(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=i$();return e&&t.setAttribute("nonce",e),t}function l$(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function c$(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var u$=function(){var t=0,e=null;return{add:function(n){t==0&&(e=o$())&&(l$(e,n),c$(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},d$=function(){var t=u$();return function(e,n){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},MR=function(){var t=d$(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},f$={left:0,top:0,right:0,gap:0},Eg=function(t){return parseInt(t||"",10)||0},h$=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Eg(n),Eg(r),Eg(i)]},p$=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return f$;var e=h$(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},m$=MR(),Wo="data-scroll-locked",g$=function(t,e,n,r){var i=t.left,o=t.top,c=t.right,u=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(Q6,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(u,"px ").concat(r,`;
  }
  body[`).concat(Wo,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(c,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(u,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(cf,` {
    right: `).concat(u,"px ").concat(r,`;
  }
  
  .`).concat(uf,` {
    margin-right: `).concat(u,"px ").concat(r,`;
  }
  
  .`).concat(cf," .").concat(cf,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(uf," .").concat(uf,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Wo,`] {
    `).concat(X6,": ").concat(u,`px;
  }
`)},WE=function(){var t=parseInt(document.body.getAttribute(Wo)||"0",10);return isFinite(t)?t:0},v$=function(){b.useEffect(function(){return document.body.setAttribute(Wo,(WE()+1).toString()),function(){var t=WE()-1;t<=0?document.body.removeAttribute(Wo):document.body.setAttribute(Wo,t.toString())}},[])},y$=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;v$();var o=b.useMemo(function(){return p$(i)},[i]);return b.createElement(m$,{styles:g$(o,!e,i,n?"":"!important")})},Tv=!1;if(typeof window<"u")try{var qd=Object.defineProperty({},"passive",{get:function(){return Tv=!0,!0}});window.addEventListener("test",qd,qd),window.removeEventListener("test",qd,qd)}catch{Tv=!1}var Mo=Tv?{passive:!1}:!1,b$=function(t){return t.tagName==="TEXTAREA"},DR=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!b$(t)&&n[e]==="visible")},w$=function(t){return DR(t,"overflowY")},x$=function(t){return DR(t,"overflowX")},KE=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=PR(t,r);if(i){var o=LR(t,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},S$=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},E$=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},PR=function(t,e){return t==="v"?w$(e):x$(e)},LR=function(t,e){return t==="v"?S$(e):E$(e)},_$=function(t,e){return t==="h"&&e==="rtl"?-1:1},T$=function(t,e,n,r,i){var o=_$(t,window.getComputedStyle(e).direction),c=o*r,u=n.target,f=e.contains(u),h=!1,m=c>0,v=0,x=0;do{if(!u)break;var w=LR(t,u),S=w[0],E=w[1],_=w[2],C=E-_-o*S;(S||C)&&PR(t,u)&&(v+=C,x+=S);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&u!==document.body||f&&(e.contains(u)||e===u));return(m&&Math.abs(v)<1||!m&&Math.abs(x)<1)&&(h=!0),h},Vd=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},ZE=function(t){return[t.deltaX,t.deltaY]},QE=function(t){return t&&"current"in t?t.current:t},C$=function(t,e){return t[0]===e[0]&&t[1]===e[1]},R$=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},O$=0,Do=[];function A$(t){var e=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(O$++)[0],o=b.useState(MR)[0],c=b.useRef(t);b.useEffect(function(){c.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var E=Z6([t.lockRef.current],(t.shards||[]).map(QE),!0).filter(Boolean);return E.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),E.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var u=b.useCallback(function(E,_){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var C=Vd(E),R=n.current,A="deltaX"in E?E.deltaX:R[0]-C[0],k="deltaY"in E?E.deltaY:R[1]-C[1],D,N=E.target,L=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in E&&L==="h"&&N.type==="range")return!1;var Z=KE(L,N);if(!Z)return!0;if(Z?D=L:(D=L==="v"?"h":"v",Z=KE(L,N)),!Z)return!1;if(!r.current&&"changedTouches"in E&&(A||k)&&(r.current=D),!D)return!0;var Q=r.current||D;return T$(Q,_,E,Q==="h"?A:k)},[]),f=b.useCallback(function(E){var _=E;if(!(!Do.length||Do[Do.length-1]!==o)){var C="deltaY"in _?ZE(_):Vd(_),R=e.current.filter(function(D){return D.name===_.type&&(D.target===_.target||_.target===D.shadowParent)&&C$(D.delta,C)})[0];if(R&&R.should){_.cancelable&&_.preventDefault();return}if(!R){var A=(c.current.shards||[]).map(QE).filter(Boolean).filter(function(D){return D.contains(_.target)}),k=A.length>0?u(_,A[0]):!c.current.noIsolation;k&&_.cancelable&&_.preventDefault()}}},[]),h=b.useCallback(function(E,_,C,R){var A={name:E,delta:_,target:C,should:R,shadowParent:N$(C)};e.current.push(A),setTimeout(function(){e.current=e.current.filter(function(k){return k!==A})},1)},[]),m=b.useCallback(function(E){n.current=Vd(E),r.current=void 0},[]),v=b.useCallback(function(E){h(E.type,ZE(E),E.target,u(E,t.lockRef.current))},[]),x=b.useCallback(function(E){h(E.type,Vd(E),E.target,u(E,t.lockRef.current))},[]);b.useEffect(function(){return Do.push(o),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Mo),document.addEventListener("touchmove",f,Mo),document.addEventListener("touchstart",m,Mo),function(){Do=Do.filter(function(E){return E!==o}),document.removeEventListener("wheel",f,Mo),document.removeEventListener("touchmove",f,Mo),document.removeEventListener("touchstart",m,Mo)}},[]);var w=t.removeScrollBar,S=t.inert;return b.createElement(b.Fragment,null,S?b.createElement(o,{styles:R$(i)}):null,w?b.createElement(y$,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function N$(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const j$=s$(kR,A$);var fh=b.forwardRef(function(t,e){return b.createElement(dh,sa({},t,{ref:e,sideCar:j$}))});fh.classNames=dh.classNames;var k$=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Po=new WeakMap,Gd=new WeakMap,Yd={},_g=0,IR=function(t){return t&&(t.host||IR(t.parentNode))},M$=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=IR(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},D$=function(t,e,n,r){var i=M$(e,Array.isArray(t)?t:[t]);Yd[n]||(Yd[n]=new WeakMap);var o=Yd[n],c=[],u=new Set,f=new Set(i),h=function(v){!v||u.has(v)||(u.add(v),h(v.parentNode))};i.forEach(h);var m=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(x){if(u.has(x))m(x);else try{var w=x.getAttribute(r),S=w!==null&&w!=="false",E=(Po.get(x)||0)+1,_=(o.get(x)||0)+1;Po.set(x,E),o.set(x,_),c.push(x),E===1&&S&&Gd.set(x,!0),_===1&&x.setAttribute(n,"true"),S||x.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",x,C)}})};return m(e),u.clear(),_g++,function(){c.forEach(function(v){var x=Po.get(v)-1,w=o.get(v)-1;Po.set(v,x),o.set(v,w),x||(Gd.has(v)||v.removeAttribute(r),Gd.delete(v)),w||v.removeAttribute(n)}),_g--,_g||(Po=new WeakMap,Po=new WeakMap,Gd=new WeakMap,Yd={})}},Ny=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=k$(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),D$(r,i,n,"aria-hidden")):function(){return null}},jy="Dialog",[zR,wV]=Rn(jy),[P$,Qr]=zR(jy),UR=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,u=b.useRef(null),f=b.useRef(null),[h=!1,m]=$n({prop:r,defaultProp:i,onChange:o});return g.jsx(P$,{scope:e,triggerRef:u,contentRef:f,contentId:nr(),titleId:nr(),descriptionId:nr(),open:h,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(v=>!v),[m]),modal:c,children:n})};UR.displayName=jy;var $R="DialogTrigger",L$=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Qr($R,n),o=Ke(e,i.triggerRef);return g.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Dy(i.open),...r,ref:o,onClick:be(t.onClick,i.onOpenToggle)})});L$.displayName=$R;var ky="DialogPortal",[I$,BR]=zR(ky,{forceMount:void 0}),HR=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Qr(ky,e);return g.jsx(I$,{scope:e,forceMount:n,children:b.Children.map(r,c=>g.jsx(dn,{present:n||o.open,children:g.jsx(hu,{asChild:!0,container:i,children:c})}))})};HR.displayName=ky;var Of="DialogOverlay",FR=b.forwardRef((t,e)=>{const n=BR(Of,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Qr(Of,t.__scopeDialog);return o.modal?g.jsx(dn,{present:r||o.open,children:g.jsx(z$,{...i,ref:e})}):null});FR.displayName=Of;var z$=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Qr(Of,n);return g.jsx(fh,{as:$a,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(Oe.div,{"data-state":Dy(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Ri="DialogContent",qR=b.forwardRef((t,e)=>{const n=BR(Ri,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Qr(Ri,t.__scopeDialog);return g.jsx(dn,{present:r||o.open,children:o.modal?g.jsx(U$,{...i,ref:e}):g.jsx($$,{...i,ref:e})})});qR.displayName=Ri;var U$=b.forwardRef((t,e)=>{const n=Qr(Ri,t.__scopeDialog),r=b.useRef(null),i=Ke(e,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return Ny(o)},[]),g.jsx(VR,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(t.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:be(t.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:be(t.onFocusOutside,o=>o.preventDefault())})}),$$=b.forwardRef((t,e)=>{const n=Qr(Ri,t.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return g.jsx(VR,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),VR=b.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,u=Qr(Ri,n),f=b.useRef(null),h=Ke(e,f);return Ay(),g.jsxs(g.Fragment,{children:[g.jsx(uh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:g.jsx(fu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Dy(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(B$,{titleId:u.titleId}),g.jsx(F$,{contentRef:f,descriptionId:u.descriptionId})]})]})}),My="DialogTitle",GR=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Qr(My,n);return g.jsx(Oe.h2,{id:i.titleId,...r,ref:e})});GR.displayName=My;var YR="DialogDescription",WR=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Qr(YR,n);return g.jsx(Oe.p,{id:i.descriptionId,...r,ref:e})});WR.displayName=YR;var KR="DialogClose",ZR=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Qr(KR,n);return g.jsx(Oe.button,{type:"button",...r,ref:e,onClick:be(t.onClick,()=>i.onOpenChange(!1))})});ZR.displayName=KR;function Dy(t){return t?"open":"closed"}var QR="DialogTitleWarning",[xV,XR]=C6(QR,{contentName:Ri,titleName:My,docsSlug:"dialog"}),B$=({titleId:t})=>{const e=XR(QR),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return b.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},H$="DialogDescriptionWarning",F$=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${XR(H$).contentName}}.`;return b.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},q$=UR,V$=HR,G$=FR,Y$=qR,W$=GR,K$=WR,Z$=ZR;function Q$({...t}){return g.jsx(q$,{"data-slot":"sheet",...t})}function X$({...t}){return g.jsx(V$,{"data-slot":"sheet-portal",...t})}function J$({className:t,...e}){return g.jsx(G$,{"data-slot":"sheet-overlay",className:ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function eB({className:t,children:e,side:n="right",...r}){return g.jsxs(X$,{children:[g.jsx(J$,{}),g.jsxs(Y$,{"data-slot":"sheet-content",className:ye("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,g.jsxs(Z$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[g.jsx(bR,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function tB({className:t,...e}){return g.jsx("div",{"data-slot":"sheet-header",className:ye("flex flex-col gap-1.5 p-4",t),...e})}function nB({className:t,...e}){return g.jsx(W$,{"data-slot":"sheet-title",className:ye("text-foreground font-semibold",t),...e})}function rB({className:t,...e}){return g.jsx(K$,{"data-slot":"sheet-description",className:ye("text-muted-foreground text-sm",t),...e})}function aB({className:t,...e}){return g.jsx("div",{"data-slot":"skeleton",className:ye("bg-accent animate-pulse rounded-md",t),...e})}const sB=["top","right","bottom","left"],Ps=Math.min,Jn=Math.max,Af=Math.round,Wd=Math.floor,ca=t=>({x:t,y:t}),iB={left:"right",right:"left",bottom:"top",top:"bottom"},oB={start:"end",end:"start"};function Cv(t,e,n){return Jn(t,Ps(e,n))}function Ba(t,e){return typeof t=="function"?t(e):t}function Ha(t){return t.split("-")[0]}function hl(t){return t.split("-")[1]}function Py(t){return t==="x"?"y":"x"}function Ly(t){return t==="y"?"height":"width"}function ia(t){return["top","bottom"].includes(Ha(t))?"y":"x"}function Iy(t){return Py(ia(t))}function lB(t,e,n){n===void 0&&(n=!1);const r=hl(t),i=Iy(t),o=Ly(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(c=Nf(c)),[c,Nf(c)]}function cB(t){const e=Nf(t);return[Rv(t),e,Rv(e)]}function Rv(t){return t.replace(/start|end/g,e=>oB[e])}function uB(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],c=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:c;default:return[]}}function dB(t,e,n,r){const i=hl(t);let o=uB(Ha(t),n==="start",r);return i&&(o=o.map(c=>c+"-"+i),e&&(o=o.concat(o.map(Rv)))),o}function Nf(t){return t.replace(/left|right|bottom|top/g,e=>iB[e])}function fB(t){return{top:0,right:0,bottom:0,left:0,...t}}function JR(t){return typeof t!="number"?fB(t):{top:t,right:t,bottom:t,left:t}}function jf(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function XE(t,e,n){let{reference:r,floating:i}=t;const o=ia(e),c=Iy(e),u=Ly(c),f=Ha(e),h=o==="y",m=r.x+r.width/2-i.width/2,v=r.y+r.height/2-i.height/2,x=r[u]/2-i[u]/2;let w;switch(f){case"top":w={x:m,y:r.y-i.height};break;case"bottom":w={x:m,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:v};break;case"left":w={x:r.x-i.width,y:v};break;default:w={x:r.x,y:r.y}}switch(hl(e)){case"start":w[c]-=x*(n&&h?-1:1);break;case"end":w[c]+=x*(n&&h?-1:1);break}return w}const hB=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(e));let h=await c.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:v}=XE(h,r,f),x=r,w={},S=0;for(let E=0;E<u.length;E++){const{name:_,fn:C}=u[E],{x:R,y:A,data:k,reset:D}=await C({x:m,y:v,initialPlacement:r,placement:x,strategy:i,middlewareData:w,rects:h,platform:c,elements:{reference:t,floating:e}});m=R??m,v=A??v,w={...w,[_]:{...w[_],...k}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(x=D.placement),D.rects&&(h=D.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:i}):D.rects),{x:m,y:v}=XE(h,x,f)),E=-1)}return{x:m,y:v,placement:x,strategy:i,middlewareData:w}};async function Kc(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:c,elements:u,strategy:f}=t,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:v="floating",altBoundary:x=!1,padding:w=0}=Ba(e,t),S=JR(w),_=u[x?v==="floating"?"reference":"floating":v],C=jf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(_)))==null||n?_:_.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:f})),R=v==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),k=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},D=jf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:A,strategy:f}):R);return{top:(C.top-D.top+S.top)/k.y,bottom:(D.bottom-C.bottom+S.bottom)/k.y,left:(C.left-D.left+S.left)/k.x,right:(D.right-C.right+S.right)/k.x}}const pB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:c,elements:u,middlewareData:f}=e,{element:h,padding:m=0}=Ba(t,e)||{};if(h==null)return{};const v=JR(m),x={x:n,y:r},w=Iy(i),S=Ly(w),E=await c.getDimensions(h),_=w==="y",C=_?"top":"left",R=_?"bottom":"right",A=_?"clientHeight":"clientWidth",k=o.reference[S]+o.reference[w]-x[w]-o.floating[S],D=x[w]-o.reference[w],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let L=N?N[A]:0;(!L||!await(c.isElement==null?void 0:c.isElement(N)))&&(L=u.floating[A]||o.floating[S]);const Z=k/2-D/2,Q=L/2-E[S]/2-1,te=Ps(v[C],Q),ce=Ps(v[R],Q),se=te,ge=L-E[S]-ce,pe=L/2-E[S]/2+Z,ve=Cv(se,pe,ge),M=!f.arrow&&hl(i)!=null&&pe!==ve&&o.reference[S]/2-(pe<se?te:ce)-E[S]/2<0,W=M?pe<se?pe-se:pe-ge:0;return{[w]:x[w]+W,data:{[w]:ve,centerOffset:pe-ve-W,...M&&{alignmentOffset:W}},reset:M}}}),mB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:h}=e,{mainAxis:m=!0,crossAxis:v=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:E=!0,..._}=Ba(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Ha(i),R=ia(u),A=Ha(u)===u,k=await(f.isRTL==null?void 0:f.isRTL(h.floating)),D=x||(A||!E?[Nf(u)]:cB(u)),N=S!=="none";!x&&N&&D.push(...dB(u,E,S,k));const L=[u,...D],Z=await Kc(e,_),Q=[];let te=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&Q.push(Z[C]),v){const pe=lB(i,c,k);Q.push(Z[pe[0]],Z[pe[1]])}if(te=[...te,{placement:i,overflows:Q}],!Q.every(pe=>pe<=0)){var ce,se;const pe=(((ce=o.flip)==null?void 0:ce.index)||0)+1,ve=L[pe];if(ve&&(!(v==="alignment"?R!==ia(ve):!1)||te.every(X=>X.overflows[0]>0&&ia(X.placement)===R)))return{data:{index:pe,overflows:te},reset:{placement:ve}};let M=(se=te.filter(W=>W.overflows[0]<=0).sort((W,X)=>W.overflows[1]-X.overflows[1])[0])==null?void 0:se.placement;if(!M)switch(w){case"bestFit":{var ge;const W=(ge=te.filter(X=>{if(N){const H=ia(X.placement);return H===R||H==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(H=>H>0).reduce((H,j)=>H+j,0)]).sort((X,H)=>X[1]-H[1])[0])==null?void 0:ge[0];W&&(M=W);break}case"initialPlacement":M=u;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function JE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function e_(t){return sB.some(e=>t[e]>=0)}const gB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Ba(t,e);switch(r){case"referenceHidden":{const o=await Kc(e,{...i,elementContext:"reference"}),c=JE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:e_(c)}}}case"escaped":{const o=await Kc(e,{...i,altBoundary:!0}),c=JE(o,n.floating);return{data:{escapedOffsets:c,escaped:e_(c)}}}default:return{}}}}};async function vB(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Ha(n),u=hl(n),f=ia(n)==="y",h=["left","top"].includes(c)?-1:1,m=o&&f?-1:1,v=Ba(e,t);let{mainAxis:x,crossAxis:w,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return u&&typeof S=="number"&&(w=u==="end"?S*-1:S),f?{x:w*m,y:x*h}:{x:x*h,y:w*m}}const yB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:c,middlewareData:u}=e,f=await vB(e,t);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:c}}}}},bB=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:C,y:R}=_;return{x:C,y:R}}},...f}=Ba(t,e),h={x:n,y:r},m=await Kc(e,f),v=ia(Ha(i)),x=Py(v);let w=h[x],S=h[v];if(o){const _=x==="y"?"top":"left",C=x==="y"?"bottom":"right",R=w+m[_],A=w-m[C];w=Cv(R,w,A)}if(c){const _=v==="y"?"top":"left",C=v==="y"?"bottom":"right",R=S+m[_],A=S-m[C];S=Cv(R,S,A)}const E=u.fn({...e,[x]:w,[v]:S});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[x]:o,[v]:c}}}}}},wB=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:c}=e,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=Ba(t,e),m={x:n,y:r},v=ia(i),x=Py(v);let w=m[x],S=m[v];const E=Ba(u,e),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const A=x==="y"?"height":"width",k=o.reference[x]-o.floating[A]+_.mainAxis,D=o.reference[x]+o.reference[A]-_.mainAxis;w<k?w=k:w>D&&(w=D)}if(h){var C,R;const A=x==="y"?"width":"height",k=["top","left"].includes(Ha(i)),D=o.reference[v]-o.floating[A]+(k&&((C=c.offset)==null?void 0:C[v])||0)+(k?0:_.crossAxis),N=o.reference[v]+o.reference[A]+(k?0:((R=c.offset)==null?void 0:R[v])||0)-(k?_.crossAxis:0);S<D?S=D:S>N&&(S=N)}return{[x]:w,[v]:S}}}},xB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:c,elements:u}=e,{apply:f=()=>{},...h}=Ba(t,e),m=await Kc(e,h),v=Ha(i),x=hl(i),w=ia(i)==="y",{width:S,height:E}=o.floating;let _,C;v==="top"||v==="bottom"?(_=v,C=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(C=v,_=x==="end"?"top":"bottom");const R=E-m.top-m.bottom,A=S-m.left-m.right,k=Ps(E-m[_],R),D=Ps(S-m[C],A),N=!e.middlewareData.shift;let L=k,Z=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(Z=A),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(L=R),N&&!x){const te=Jn(m.left,0),ce=Jn(m.right,0),se=Jn(m.top,0),ge=Jn(m.bottom,0);w?Z=S-2*(te!==0||ce!==0?te+ce:Jn(m.left,m.right)):L=E-2*(se!==0||ge!==0?se+ge:Jn(m.top,m.bottom))}await f({...e,availableWidth:Z,availableHeight:L});const Q=await c.getDimensions(u.floating);return S!==Q.width||E!==Q.height?{reset:{rects:!0}}:{}}}};function hh(){return typeof window<"u"}function pl(t){return eO(t)?(t.nodeName||"").toLowerCase():"#document"}function rr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fa(t){var e;return(e=(eO(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function eO(t){return hh()?t instanceof Node||t instanceof rr(t).Node:!1}function Vr(t){return hh()?t instanceof Element||t instanceof rr(t).Element:!1}function ua(t){return hh()?t instanceof HTMLElement||t instanceof rr(t).HTMLElement:!1}function t_(t){return!hh()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof rr(t).ShadowRoot}function pu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Gr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function SB(t){return["table","td","th"].includes(pl(t))}function ph(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function zy(t){const e=Uy(),n=Vr(t)?Gr(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function EB(t){let e=Ls(t);for(;ua(e)&&!el(e);){if(zy(e))return e;if(ph(e))return null;e=Ls(e)}return null}function Uy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function el(t){return["html","body","#document"].includes(pl(t))}function Gr(t){return rr(t).getComputedStyle(t)}function mh(t){return Vr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ls(t){if(pl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||t_(t)&&t.host||fa(t);return t_(e)?e.host:e}function tO(t){const e=Ls(t);return el(e)?t.ownerDocument?t.ownerDocument.body:t.body:ua(e)&&pu(e)?e:tO(e)}function Zc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=tO(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),c=rr(i);if(o){const u=Ov(c);return e.concat(c,c.visualViewport||[],pu(i)?i:[],u&&n?Zc(u):[])}return e.concat(i,Zc(i,[],n))}function Ov(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function nO(t){const e=Gr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ua(t),o=i?t.offsetWidth:n,c=i?t.offsetHeight:r,u=Af(n)!==o||Af(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function $y(t){return Vr(t)?t:t.contextElement}function Ko(t){const e=$y(t);if(!ua(e))return ca(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=nO(e);let c=(o?Af(n.width):n.width)/r,u=(o?Af(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const _B=ca(0);function rO(t){const e=rr(t);return!Uy()||!e.visualViewport?_B:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function TB(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==rr(t)?!1:e}function Oi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=$y(t);let c=ca(1);e&&(r?Vr(r)&&(c=Ko(r)):c=Ko(t));const u=TB(o,n,r)?rO(o):ca(0);let f=(i.left+u.x)/c.x,h=(i.top+u.y)/c.y,m=i.width/c.x,v=i.height/c.y;if(o){const x=rr(o),w=r&&Vr(r)?rr(r):r;let S=x,E=Ov(S);for(;E&&r&&w!==S;){const _=Ko(E),C=E.getBoundingClientRect(),R=Gr(E),A=C.left+(E.clientLeft+parseFloat(R.paddingLeft))*_.x,k=C.top+(E.clientTop+parseFloat(R.paddingTop))*_.y;f*=_.x,h*=_.y,m*=_.x,v*=_.y,f+=A,h+=k,S=rr(E),E=Ov(S)}}return jf({width:m,height:v,x:f,y:h})}function By(t,e){const n=mh(t).scrollLeft;return e?e.left+n:Oi(fa(t)).left+n}function aO(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:By(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function CB(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",c=fa(r),u=e?ph(e.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},h=ca(1);const m=ca(0),v=ua(r);if((v||!v&&!o)&&((pl(r)!=="body"||pu(c))&&(f=mh(r)),ua(r))){const w=Oi(r);h=Ko(r),m.x=w.x+r.clientLeft,m.y=w.y+r.clientTop}const x=c&&!v&&!o?aO(c,f,!0):ca(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+x.x,y:n.y*h.y-f.scrollTop*h.y+m.y+x.y}}function RB(t){return Array.from(t.getClientRects())}function OB(t){const e=fa(t),n=mh(t),r=t.ownerDocument.body,i=Jn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Jn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+By(t);const u=-n.scrollTop;return Gr(r).direction==="rtl"&&(c+=Jn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:c,y:u}}function AB(t,e){const n=rr(t),r=fa(t),i=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(i){o=i.width,c=i.height;const h=Uy();(!h||h&&e==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:c,x:u,y:f}}function NB(t,e){const n=Oi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=ua(t)?Ko(t):ca(1),c=t.clientWidth*o.x,u=t.clientHeight*o.y,f=i*o.x,h=r*o.y;return{width:c,height:u,x:f,y:h}}function n_(t,e,n){let r;if(e==="viewport")r=AB(t,n);else if(e==="document")r=OB(fa(t));else if(Vr(e))r=NB(e,n);else{const i=rO(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return jf(r)}function sO(t,e){const n=Ls(t);return n===e||!Vr(n)||el(n)?!1:Gr(n).position==="fixed"||sO(n,e)}function jB(t,e){const n=e.get(t);if(n)return n;let r=Zc(t,[],!1).filter(u=>Vr(u)&&pl(u)!=="body"),i=null;const o=Gr(t).position==="fixed";let c=o?Ls(t):t;for(;Vr(c)&&!el(c);){const u=Gr(c),f=zy(c);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||pu(c)&&!f&&sO(t,c))?r=r.filter(m=>m!==c):i=u,c=Ls(c)}return e.set(t,r),r}function kB(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const c=[...n==="clippingAncestors"?ph(e)?[]:jB(e,this._c):[].concat(n),r],u=c[0],f=c.reduce((h,m)=>{const v=n_(e,m,i);return h.top=Jn(v.top,h.top),h.right=Ps(v.right,h.right),h.bottom=Ps(v.bottom,h.bottom),h.left=Jn(v.left,h.left),h},n_(e,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function MB(t){const{width:e,height:n}=nO(t);return{width:e,height:n}}function DB(t,e,n){const r=ua(e),i=fa(e),o=n==="fixed",c=Oi(t,!0,o,e);let u={scrollLeft:0,scrollTop:0};const f=ca(0);function h(){f.x=By(i)}if(r||!r&&!o)if((pl(e)!=="body"||pu(i))&&(u=mh(e)),r){const w=Oi(e,!0,o,e);f.x=w.x+e.clientLeft,f.y=w.y+e.clientTop}else i&&h();o&&!r&&i&&h();const m=i&&!r&&!o?aO(i,u):ca(0),v=c.left+u.scrollLeft-f.x-m.x,x=c.top+u.scrollTop-f.y-m.y;return{x:v,y:x,width:c.width,height:c.height}}function Tg(t){return Gr(t).position==="static"}function r_(t,e){if(!ua(t)||Gr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fa(t)===n&&(n=n.ownerDocument.body),n}function iO(t,e){const n=rr(t);if(ph(t))return n;if(!ua(t)){let i=Ls(t);for(;i&&!el(i);){if(Vr(i)&&!Tg(i))return i;i=Ls(i)}return n}let r=r_(t,e);for(;r&&SB(r)&&Tg(r);)r=r_(r,e);return r&&el(r)&&Tg(r)&&!zy(r)?n:r||EB(t)||n}const PB=async function(t){const e=this.getOffsetParent||iO,n=this.getDimensions,r=await n(t.floating);return{reference:DB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LB(t){return Gr(t).direction==="rtl"}const IB={convertOffsetParentRelativeRectToViewportRelativeRect:CB,getDocumentElement:fa,getClippingRect:kB,getOffsetParent:iO,getElementRects:PB,getClientRects:RB,getDimensions:MB,getScale:Ko,isElement:Vr,isRTL:LB};function oO(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zB(t,e){let n=null,r;const i=fa(t);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const h=t.getBoundingClientRect(),{left:m,top:v,width:x,height:w}=h;if(u||e(),!x||!w)return;const S=Wd(v),E=Wd(i.clientWidth-(m+x)),_=Wd(i.clientHeight-(v+w)),C=Wd(m),A={rootMargin:-S+"px "+-E+"px "+-_+"px "+-C+"px",threshold:Jn(0,Ps(1,f))||1};let k=!0;function D(N){const L=N[0].intersectionRatio;if(L!==f){if(!k)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}L===1&&!oO(h,t.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(D,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,A)}n.observe(t)}return c(!0),o}function UB(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=$y(t),m=i||o?[...h?Zc(h):[],...Zc(e)]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const v=h&&u?zB(h,n):null;let x=-1,w=null;c&&(w=new ResizeObserver(C=>{let[R]=C;R&&R.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(e)})),n()}),h&&!f&&w.observe(h),w.observe(e));let S,E=f?Oi(t):null;f&&_();function _(){const C=Oi(t);E&&!oO(E,C)&&n(),E=C,S=requestAnimationFrame(_)}return n(),()=>{var C;m.forEach(R=>{i&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),v?.(),(C=w)==null||C.disconnect(),w=null,f&&cancelAnimationFrame(S)}}const $B=yB,BB=bB,HB=mB,FB=xB,qB=gB,a_=pB,VB=wB,GB=(t,e,n)=>{const r=new Map,i={platform:IB,...n},o={...i.platform,_c:r};return hB(t,e,{...i,platform:o})};var YB=typeof document<"u",WB=function(){},df=YB?b.useLayoutEffect:WB;function kf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kf(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!kf(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function lO(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function s_(t,e){const n=lO(t);return Math.round(e*n)/n}function Cg(t){const e=b.useRef(t);return df(()=>{e.current=t}),e}function KB(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=t,[m,v]=b.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[x,w]=b.useState(r);kf(x,r)||w(r);const[S,E]=b.useState(null),[_,C]=b.useState(null),R=b.useCallback(X=>{X!==N.current&&(N.current=X,E(X))},[]),A=b.useCallback(X=>{X!==L.current&&(L.current=X,C(X))},[]),k=o||S,D=c||_,N=b.useRef(null),L=b.useRef(null),Z=b.useRef(m),Q=f!=null,te=Cg(f),ce=Cg(i),se=Cg(h),ge=b.useCallback(()=>{if(!N.current||!L.current)return;const X={placement:e,strategy:n,middleware:x};ce.current&&(X.platform=ce.current),GB(N.current,L.current,X).then(H=>{const j={...H,isPositioned:se.current!==!1};pe.current&&!kf(Z.current,j)&&(Z.current=j,rl.flushSync(()=>{v(j)}))})},[x,e,n,ce,se]);df(()=>{h===!1&&Z.current.isPositioned&&(Z.current.isPositioned=!1,v(X=>({...X,isPositioned:!1})))},[h]);const pe=b.useRef(!1);df(()=>(pe.current=!0,()=>{pe.current=!1}),[]),df(()=>{if(k&&(N.current=k),D&&(L.current=D),k&&D){if(te.current)return te.current(k,D,ge);ge()}},[k,D,ge,te,Q]);const ve=b.useMemo(()=>({reference:N,floating:L,setReference:R,setFloating:A}),[R,A]),M=b.useMemo(()=>({reference:k,floating:D}),[k,D]),W=b.useMemo(()=>{const X={position:n,left:0,top:0};if(!M.floating)return X;const H=s_(M.floating,m.x),j=s_(M.floating,m.y);return u?{...X,transform:"translate("+H+"px, "+j+"px)",...lO(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:j}},[n,u,M.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:ge,refs:ve,elements:M,floatingStyles:W}),[m,ge,ve,M,W])}const ZB=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?a_({element:r.current,padding:i}).fn(n):{}:r?a_({element:r,padding:i}).fn(n):{}}}},QB=(t,e)=>({...$B(t),options:[t,e]}),XB=(t,e)=>({...BB(t),options:[t,e]}),JB=(t,e)=>({...VB(t),options:[t,e]}),eH=(t,e)=>({...HB(t),options:[t,e]}),tH=(t,e)=>({...FB(t),options:[t,e]}),nH=(t,e)=>({...qB(t),options:[t,e]}),rH=(t,e)=>({...ZB(t),options:[t,e]});var aH="Arrow",cO=b.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return g.jsx(Oe.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});cO.displayName=aH;var sH=cO;function uO(t){const[e,n]=b.useState(void 0);return un(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let c,u;if("borderBoxSize"in o){const f=o.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=t.offsetWidth,u=t.offsetHeight;n({width:c,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Hy="Popper",[dO,ml]=Rn(Hy),[iH,fO]=dO(Hy),hO=t=>{const{__scopePopper:e,children:n}=t,[r,i]=b.useState(null);return g.jsx(iH,{scope:e,anchor:r,onAnchorChange:i,children:n})};hO.displayName=Hy;var pO="PopperAnchor",mO=b.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=fO(pO,n),c=b.useRef(null),u=Ke(e,c);return b.useEffect(()=>{o.onAnchorChange(r?.current||c.current)}),r?null:g.jsx(Oe.div,{...i,ref:u})});mO.displayName=pO;var Fy="PopperContent",[oH,lH]=dO(Fy),gO=b.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:v="partial",hideWhenDetached:x=!1,updatePositionStrategy:w="optimized",onPlaced:S,...E}=t,_=fO(Fy,n),[C,R]=b.useState(null),A=Ke(e,G=>R(G)),[k,D]=b.useState(null),N=uO(k),L=N?.width??0,Z=N?.height??0,Q=r+(o!=="center"?"-"+o:""),te=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ce=Array.isArray(h)?h:[h],se=ce.length>0,ge={padding:te,boundary:ce.filter(uH),altBoundary:se},{refs:pe,floatingStyles:ve,placement:M,isPositioned:W,middlewareData:X}=KB({strategy:"fixed",placement:Q,whileElementsMounted:(...G)=>UB(...G,{animationFrame:w==="always"}),elements:{reference:_.anchor},middleware:[QB({mainAxis:i+Z,alignmentAxis:c}),f&&XB({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?JB():void 0,...ge}),f&&eH({...ge}),tH({...ge,apply:({elements:G,rects:me,availableWidth:Ce,availableHeight:xe})=>{const{width:Ne,height:He}=me.reference,Be=G.floating.style;Be.setProperty("--radix-popper-available-width",`${Ce}px`),Be.setProperty("--radix-popper-available-height",`${xe}px`),Be.setProperty("--radix-popper-anchor-width",`${Ne}px`),Be.setProperty("--radix-popper-anchor-height",`${He}px`)}}),k&&rH({element:k,padding:u}),dH({arrowWidth:L,arrowHeight:Z}),x&&nH({strategy:"referenceHidden",...ge})]}),[H,j]=bO(M),V=Jt(S);un(()=>{W&&V?.()},[W,V]);const re=X.arrow?.x,U=X.arrow?.y,ee=X.arrow?.centerOffset!==0,[de,ie]=b.useState();return un(()=>{C&&ie(window.getComputedStyle(C).zIndex)},[C]),g.jsx("div",{ref:pe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:W?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[X.transformOrigin?.x,X.transformOrigin?.y].join(" "),...X.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(oH,{scope:n,placedSide:H,onArrowChange:D,arrowX:re,arrowY:U,shouldHideArrow:ee,children:g.jsx(Oe.div,{"data-side":H,"data-align":j,...E,ref:A,style:{...E.style,animation:W?void 0:"none"}})})})});gO.displayName=Fy;var vO="PopperArrow",cH={top:"bottom",right:"left",bottom:"top",left:"right"},yO=b.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=lH(vO,r),c=cH[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(sH,{...i,ref:n,style:{...i.style,display:"block"}})})});yO.displayName=vO;function uH(t){return t!==null}var dH=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,c=i.arrow?.centerOffset!==0,u=c?0:t.arrowWidth,f=c?0:t.arrowHeight,[h,m]=bO(n),v={start:"0%",center:"50%",end:"100%"}[m],x=(i.arrow?.x??0)+u/2,w=(i.arrow?.y??0)+f/2;let S="",E="";return h==="bottom"?(S=c?v:`${x}px`,E=`${-f}px`):h==="top"?(S=c?v:`${x}px`,E=`${r.floating.height+f}px`):h==="right"?(S=`${-f}px`,E=c?v:`${w}px`):h==="left"&&(S=`${r.floating.width+f}px`,E=c?v:`${w}px`),{data:{x:S,y:E}}}});function bO(t){const[e,n="center"]=t.split("-");return[e,n]}var qy=hO,Vy=mO,Gy=gO,Yy=yO,fH="VisuallyHidden",Wy=b.forwardRef((t,e)=>g.jsx(Oe.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Wy.displayName=fH;var hH=Wy,[gh,SV]=Rn("Tooltip",[ml]),vh=ml(),wO="TooltipProvider",pH=700,Av="tooltip.open",[mH,Ky]=gh(wO),xO=t=>{const{__scopeTooltip:e,delayDuration:n=pH,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,[c,u]=b.useState(!0),f=b.useRef(!1),h=b.useRef(0);return b.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),g.jsx(mH,{scope:e,isOpenDelayed:c,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(h.current),u(!1)},[]),onClose:b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:b.useCallback(m=>{f.current=m},[]),disableHoverableContent:i,children:o})};xO.displayName=wO;var yh="Tooltip",[gH,mu]=gh(yh),SO=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:c,delayDuration:u}=t,f=Ky(yh,t.__scopeTooltip),h=vh(e),[m,v]=b.useState(null),x=nr(),w=b.useRef(0),S=c??f.disableHoverableContent,E=u??f.delayDuration,_=b.useRef(!1),[C=!1,R]=$n({prop:r,defaultProp:i,onChange:L=>{L?(f.onOpen(),document.dispatchEvent(new CustomEvent(Av))):f.onClose(),o?.(L)}}),A=b.useMemo(()=>C?_.current?"delayed-open":"instant-open":"closed",[C]),k=b.useCallback(()=>{window.clearTimeout(w.current),w.current=0,_.current=!1,R(!0)},[R]),D=b.useCallback(()=>{window.clearTimeout(w.current),w.current=0,R(!1)},[R]),N=b.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{_.current=!0,R(!0),w.current=0},E)},[E,R]);return b.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),g.jsx(qy,{...h,children:g.jsx(gH,{scope:e,contentId:x,open:C,stateAttribute:A,trigger:m,onTriggerChange:v,onTriggerEnter:b.useCallback(()=>{f.isOpenDelayed?N():k()},[f.isOpenDelayed,N,k]),onTriggerLeave:b.useCallback(()=>{S?D():(window.clearTimeout(w.current),w.current=0)},[D,S]),onOpen:k,onClose:D,disableHoverableContent:S,children:n})})};SO.displayName=yh;var Nv="TooltipTrigger",EO=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=mu(Nv,n),o=Ky(Nv,n),c=vh(n),u=b.useRef(null),f=Ke(e,u,i.onTriggerChange),h=b.useRef(!1),m=b.useRef(!1),v=b.useCallback(()=>h.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),g.jsx(Vy,{asChild:!0,...c,children:g.jsx(Oe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:f,onPointerMove:be(t.onPointerMove,x=>{x.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:be(t.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:be(t.onPointerDown,()=>{h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:be(t.onFocus,()=>{h.current||i.onOpen()}),onBlur:be(t.onBlur,i.onClose),onClick:be(t.onClick,i.onClose)})})});EO.displayName=Nv;var Zy="TooltipPortal",[vH,yH]=gh(Zy,{forceMount:void 0}),_O=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,o=mu(Zy,e);return g.jsx(vH,{scope:e,forceMount:n,children:g.jsx(dn,{present:n||o.open,children:g.jsx(hu,{asChild:!0,container:i,children:r})})})};_O.displayName=Zy;var tl="TooltipContent",TO=b.forwardRef((t,e)=>{const n=yH(tl,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,c=mu(tl,t.__scopeTooltip);return g.jsx(dn,{present:r||c.open,children:c.disableHoverableContent?g.jsx(CO,{side:i,...o,ref:e}):g.jsx(bH,{side:i,...o,ref:e})})}),bH=b.forwardRef((t,e)=>{const n=mu(tl,t.__scopeTooltip),r=Ky(tl,t.__scopeTooltip),i=b.useRef(null),o=Ke(e,i),[c,u]=b.useState(null),{trigger:f,onClose:h}=n,m=i.current,{onPointerInTransitChange:v}=r,x=b.useCallback(()=>{u(null),v(!1)},[v]),w=b.useCallback((S,E)=>{const _=S.currentTarget,C={x:S.clientX,y:S.clientY},R=SH(C,_.getBoundingClientRect()),A=EH(C,R),k=_H(E.getBoundingClientRect()),D=CH([...A,...k]);u(D),v(!0)},[v]);return b.useEffect(()=>()=>x(),[x]),b.useEffect(()=>{if(f&&m){const S=_=>w(_,m),E=_=>w(_,f);return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",E)}}},[f,m,w,x]),b.useEffect(()=>{if(c){const S=E=>{const _=E.target,C={x:E.clientX,y:E.clientY},R=f?.contains(_)||m?.contains(_),A=!TH(C,c);R?x():A&&(x(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,h,x]),g.jsx(CO,{...t,ref:o})}),[wH,xH]=gh(yh,{isInside:!1}),CO=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:c,...u}=t,f=mu(tl,n),h=vh(n),{onClose:m}=f;return b.useEffect(()=>(document.addEventListener(Av,m),()=>document.removeEventListener(Av,m)),[m]),b.useEffect(()=>{if(f.trigger){const v=x=>{x.target?.contains(f.trigger)&&m()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,m]),g.jsx(fu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:g.jsxs(Gy,{"data-state":f.stateAttribute,...h,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(dR,{children:r}),g.jsx(wH,{scope:n,isInside:!0,children:g.jsx(hH,{id:f.contentId,role:"tooltip",children:i||r})})]})})});TO.displayName=tl;var RO="TooltipArrow",OO=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=vh(n);return xH(RO,n).isInside?null:g.jsx(Yy,{...i,...r,ref:e})});OO.displayName=RO;function SH(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function EH(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function _H(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function TH(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,c=e.length-1;o<e.length;c=o++){const u=e[o].x,f=e[o].y,h=e[c].x,m=e[c].y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(i=!i)}return i}function CH(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),RH(e)}function RH(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const o=e[e.length-1],c=e[e.length-2];if((o.x-c.x)*(i.y-c.y)>=(o.y-c.y)*(i.x-c.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(i.y-c.y)>=(o.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var OH=xO,AH=SO,NH=EO,jH=_O,kH=TO,MH=OO;function AO({delayDuration:t=0,...e}){return g.jsx(OH,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function Qy({...t}){return g.jsx(AO,{children:g.jsx(AH,{"data-slot":"tooltip",...t})})}function Xy({...t}){return g.jsx(NH,{"data-slot":"tooltip-trigger",...t})}function Jy({className:t,sideOffset:e=0,children:n,...r}){return g.jsx(jH,{children:g.jsxs(kH,{"data-slot":"tooltip-content",sideOffset:e,className:ye("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...r,children:[n,g.jsx(MH,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Rg=768;function DH(){const[t,e]=b.useState(void 0);return b.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Rg-1}px)`),r=()=>{e(window.innerWidth<Rg)};return n.addEventListener("change",r),e(window.innerWidth<Rg),()=>n.removeEventListener("change",r)},[]),!!t}const PH="sidebar_state",LH=60*60*24*7,IH="20rem",zH="18rem",UH="3rem",$H="b",NO=b.createContext(null);function gu(){const t=b.useContext(NO);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function BH({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:o,...c}){const u=DH(),[f,h]=b.useState(!1),[m,v]=b.useState(t),x=e??m,w=b.useCallback(C=>{const R=typeof C=="function"?C(x):C;n?n(R):v(R),document.cookie=`${PH}=${R}; path=/; max-age=${LH}`},[n,x]),S=b.useCallback(()=>u?h(C=>!C):w(C=>!C),[u,w,h]);b.useEffect(()=>{const C=R=>{R.key===$H&&(R.metaKey||R.ctrlKey)&&!((R.metaKey||R.ctrlKey)&&R.shiftKey)&&(R.preventDefault(),S())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[S]);const E=x?"expanded":"collapsed",_=b.useMemo(()=>({state:E,open:x,setOpen:w,isMobile:u,openMobile:f,setOpenMobile:h,toggleSidebar:S}),[E,x,w,u,f,h,S]);return g.jsx(NO.Provider,{value:_,children:g.jsx(AO,{delayDuration:0,children:g.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":IH,"--sidebar-width-icon":UH,...i},className:ye("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:o})})})}function HH({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...o}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:h}=gu();return n==="none"?g.jsx("div",{"data-slot":"sidebar",className:ye("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...o,children:i}):c?g.jsx(Q$,{open:f,onOpenChange:h,...o,children:g.jsxs(eB,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":zH},side:t,children:[g.jsxs(tB,{className:"sr-only",children:[g.jsx(nB,{children:"Sidebar"}),g.jsx(rB,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):g.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[g.jsx("div",{"data-slot":"sidebar-gap",className:ye("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),g.jsx("div",{"data-slot":"sidebar-container",className:ye("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...o,children:g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function FH({className:t,onClick:e,...n}){const{toggleSidebar:r}=gu();return g.jsxs(At,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ye("size-7",t),onClick:i=>{e?.(i),r()},...n,children:[g.jsx(z5,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function qH({className:t,...e}){const{toggleSidebar:n}=gu();return g.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ye("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})}function VH({className:t,...e}){return g.jsx("main",{"data-slot":"sidebar-inset",className:ye("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...e})}function GH({className:t,...e}){return g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ye("flex flex-col gap-2 p-2",t),...e})}function YH({className:t,...e}){return g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ye("flex flex-col gap-2 p-2",t),...e})}function WH({className:t,...e}){return g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ye("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function jO({className:t,...e}){return g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ye("relative flex w-full min-w-0 flex-col p-2",t),...e})}function KH({className:t,...e}){return g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ye("flex w-full min-w-0 flex-col gap-1",t),...e})}function kO({className:t,...e}){return g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ye("group/menu-item relative",t),...e})}const ZH=Us("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function jv({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:o,...c}){const u=t?$a:"button",{isMobile:f,state:h}=gu(),m=g.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:ye(ZH({variant:n,size:r}),o),...c});return i?(typeof i=="string"&&(i={children:i}),g.jsxs(Qy,{children:[g.jsx(Xy,{asChild:!0,children:m}),g.jsx(Jy,{side:"right",align:"center",hidden:h!=="collapsed"||f,...i})]})):m}function QH({className:t,...e}){return g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ye("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e})}function XH({className:t,...e}){return g.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ye("group/menu-sub-item relative",t),...e})}const i_=t=>{let e;const n=new Set,r=(h,m)=>{const v=typeof h=="function"?h(e):h;if(!Object.is(v,e)){const x=e;e=m??(typeof v!="object"||v===null)?v:Object.assign({},e,v),n.forEach(w=>w(e,x))}},i=()=>e,u={setState:r,getState:i,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=e=t(r,i,u);return u},JH=t=>t?i_(t):i_,e8=t=>t;function t8(t,e=e8){const n=fe.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return fe.useDebugValue(n),n}const o_=t=>{const e=JH(t),n=r=>t8(e,r);return Object.assign(n,e),n},e0=t=>t?o_(t):o_,ar=e0(t=>({selectedSpecId:"original",projectId:null,hasNewSpec:!1,isGeneratingDocs:!1,currentSource:"tuned",setSelectedSpecId:e=>t({selectedSpecId:e}),setProjectId:e=>t({projectId:e}),setHasNewSpec:e=>t({hasNewSpec:e}),setIsGeneratingDocs:e=>t({isGeneratingDocs:e}),setCurrentSource:e=>t({currentSource:e})}));function kv(t,[e,n]){return Math.min(n,Math.max(e,t))}function bh(t){const e=t+"CollectionProvider",[n,r]=Rn(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),c=w=>{const{scope:S,children:E}=w,_=fe.useRef(null),C=fe.useRef(new Map).current;return g.jsx(i,{scope:S,itemMap:C,collectionRef:_,children:E})};c.displayName=e;const u=t+"CollectionSlot",f=fe.forwardRef((w,S)=>{const{scope:E,children:_}=w,C=o(u,E),R=Ke(S,C.collectionRef);return g.jsx($a,{ref:R,children:_})});f.displayName=u;const h=t+"CollectionItemSlot",m="data-radix-collection-item",v=fe.forwardRef((w,S)=>{const{scope:E,children:_,...C}=w,R=fe.useRef(null),A=Ke(S,R),k=o(h,E);return fe.useEffect(()=>(k.itemMap.set(R,{ref:R,...C}),()=>void k.itemMap.delete(R))),g.jsx($a,{[m]:"",ref:A,children:_})});v.displayName=h;function x(w){const S=o(t+"CollectionConsumer",w);return fe.useCallback(()=>{const _=S.collectionRef.current;if(!_)return[];const C=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((k,D)=>C.indexOf(k.ref.current)-C.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:f,ItemSlot:v},x,r]}var n8=b.createContext(void 0);function $s(t){const e=b.useContext(n8);return t||e||"ltr"}function MO(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var r8=[" ","Enter","ArrowUp","ArrowDown"],a8=[" ","Enter"],vu="Select",[wh,xh,s8]=bh(vu),[gl,EV]=Rn(vu,[s8,ml]),Sh=ml(),[i8,Bs]=gl(vu),[o8,l8]=gl(vu),DO=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:c,defaultValue:u,onValueChange:f,dir:h,name:m,autoComplete:v,disabled:x,required:w,form:S}=t,E=Sh(e),[_,C]=b.useState(null),[R,A]=b.useState(null),[k,D]=b.useState(!1),N=$s(h),[L=!1,Z]=$n({prop:r,defaultProp:i,onChange:o}),[Q,te]=$n({prop:c,defaultProp:u,onChange:f}),ce=b.useRef(null),se=_?S||!!_.closest("form"):!0,[ge,pe]=b.useState(new Set),ve=Array.from(ge).map(M=>M.props.value).join(";");return g.jsx(qy,{...E,children:g.jsxs(i8,{required:w,scope:e,trigger:_,onTriggerChange:C,valueNode:R,onValueNodeChange:A,valueNodeHasChildren:k,onValueNodeHasChildrenChange:D,contentId:nr(),value:Q,onValueChange:te,open:L,onOpenChange:Z,dir:N,triggerPointerDownPosRef:ce,disabled:x,children:[g.jsx(wh.Provider,{scope:e,children:g.jsx(o8,{scope:t.__scopeSelect,onNativeOptionAdd:b.useCallback(M=>{pe(W=>new Set(W).add(M))},[]),onNativeOptionRemove:b.useCallback(M=>{pe(W=>{const X=new Set(W);return X.delete(M),X})},[]),children:n})}),se?g.jsxs(iA,{"aria-hidden":!0,required:w,tabIndex:-1,name:m,autoComplete:v,value:Q,onChange:M=>te(M.target.value),disabled:x,form:S,children:[Q===void 0?g.jsx("option",{value:""}):null,Array.from(ge)]},ve):null]})})};DO.displayName=vu;var PO="SelectTrigger",LO=b.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Sh(n),c=Bs(PO,n),u=c.disabled||r,f=Ke(e,c.onTriggerChange),h=xh(n),m=b.useRef("touch"),[v,x,w]=oA(E=>{const _=h().filter(A=>!A.disabled),C=_.find(A=>A.value===c.value),R=lA(_,E,C);R!==void 0&&c.onValueChange(R.value)}),S=E=>{u||(c.onOpenChange(!0),w()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return g.jsx(Vy,{asChild:!0,...o,children:g.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":sA(c.value)?"":void 0,...i,ref:f,onClick:be(i.onClick,E=>{E.currentTarget.focus(),m.current!=="mouse"&&S(E)}),onPointerDown:be(i.onPointerDown,E=>{m.current=E.pointerType;const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:be(i.onKeyDown,E=>{const _=v.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&x(E.key),!(_&&E.key===" ")&&r8.includes(E.key)&&(S(),E.preventDefault())})})})});LO.displayName=PO;var IO="SelectValue",zO=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:c="",...u}=t,f=Bs(IO,n),{onValueNodeHasChildrenChange:h}=f,m=o!==void 0,v=Ke(e,f.onValueNodeChange);return un(()=>{h(m)},[h,m]),g.jsx(Oe.span,{...u,ref:v,style:{pointerEvents:"none"},children:sA(f.value)?g.jsx(g.Fragment,{children:c}):o})});zO.displayName=IO;var c8="SelectIcon",UO=b.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return g.jsx(Oe.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});UO.displayName=c8;var u8="SelectPortal",$O=t=>g.jsx(hu,{asChild:!0,...t});$O.displayName=u8;var Ai="SelectContent",BO=b.forwardRef((t,e)=>{const n=Bs(Ai,t.__scopeSelect),[r,i]=b.useState();if(un(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?rl.createPortal(g.jsx(HO,{scope:t.__scopeSelect,children:g.jsx(wh.Slot,{scope:t.__scopeSelect,children:g.jsx("div",{children:t.children})})}),o):null}return g.jsx(FO,{...t,ref:e})});BO.displayName=Ai;var Ir=10,[HO,Hs]=gl(Ai),d8="SelectContentImpl",FO=b.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:v,collisionBoundary:x,collisionPadding:w,sticky:S,hideWhenDetached:E,avoidCollisions:_,...C}=t,R=Bs(Ai,n),[A,k]=b.useState(null),[D,N]=b.useState(null),L=Ke(e,G=>k(G)),[Z,Q]=b.useState(null),[te,ce]=b.useState(null),se=xh(n),[ge,pe]=b.useState(!1),ve=b.useRef(!1);b.useEffect(()=>{if(A)return Ny(A)},[A]),Ay();const M=b.useCallback(G=>{const[me,...Ce]=se().map(He=>He.ref.current),[xe]=Ce.slice(-1),Ne=document.activeElement;for(const He of G)if(He===Ne||(He?.scrollIntoView({block:"nearest"}),He===me&&D&&(D.scrollTop=0),He===xe&&D&&(D.scrollTop=D.scrollHeight),He?.focus(),document.activeElement!==Ne))return},[se,D]),W=b.useCallback(()=>M([Z,A]),[M,Z,A]);b.useEffect(()=>{ge&&W()},[ge,W]);const{onOpenChange:X,triggerPointerDownPosRef:H}=R;b.useEffect(()=>{if(A){let G={x:0,y:0};const me=xe=>{G={x:Math.abs(Math.round(xe.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(H.current?.y??0))}},Ce=xe=>{G.x<=10&&G.y<=10?xe.preventDefault():A.contains(xe.target)||X(!1),document.removeEventListener("pointermove",me),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[A,X,H]),b.useEffect(()=>{const G=()=>X(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[X]);const[j,V]=oA(G=>{const me=se().filter(Ne=>!Ne.disabled),Ce=me.find(Ne=>Ne.ref.current===document.activeElement),xe=lA(me,G,Ce);xe&&setTimeout(()=>xe.ref.current.focus())}),re=b.useCallback((G,me,Ce)=>{const xe=!ve.current&&!Ce;(R.value!==void 0&&R.value===me||xe)&&(Q(G),xe&&(ve.current=!0))},[R.value]),U=b.useCallback(()=>A?.focus(),[A]),ee=b.useCallback((G,me,Ce)=>{const xe=!ve.current&&!Ce;(R.value!==void 0&&R.value===me||xe)&&ce(G)},[R.value]),de=r==="popper"?Mv:qO,ie=de===Mv?{side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:v,collisionBoundary:x,collisionPadding:w,sticky:S,hideWhenDetached:E,avoidCollisions:_}:{};return g.jsx(HO,{scope:n,content:A,viewport:D,onViewportChange:N,itemRefCallback:re,selectedItem:Z,onItemLeave:U,itemTextRefCallback:ee,focusSelectedItem:W,selectedItemText:te,position:r,isPositioned:ge,searchRef:j,children:g.jsx(fh,{as:$a,allowPinchZoom:!0,children:g.jsx(uh,{asChild:!0,trapped:R.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:be(i,G=>{R.trigger?.focus({preventScroll:!0}),G.preventDefault()}),children:g.jsx(fu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:g.jsx(de,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:G=>G.preventDefault(),...C,...ie,onPlaced:()=>pe(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:be(C.onKeyDown,G=>{const me=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!me&&G.key.length===1&&V(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let xe=se().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(G.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const Ne=G.target,He=xe.indexOf(Ne);xe=xe.slice(He+1)}setTimeout(()=>M(xe)),G.preventDefault()}})})})})})})});FO.displayName=d8;var f8="SelectItemAlignedPosition",qO=b.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Bs(Ai,n),c=Hs(Ai,n),[u,f]=b.useState(null),[h,m]=b.useState(null),v=Ke(e,L=>m(L)),x=xh(n),w=b.useRef(!1),S=b.useRef(!0),{viewport:E,selectedItem:_,selectedItemText:C,focusSelectedItem:R}=c,A=b.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&h&&E&&_&&C){const L=o.trigger.getBoundingClientRect(),Z=h.getBoundingClientRect(),Q=o.valueNode.getBoundingClientRect(),te=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ne=te.left-Z.left,He=Q.left-Ne,Be=L.left-He,st=L.width+Be,bn=Math.max(st,Z.width),wn=window.innerWidth-Ir,Nt=kv(He,[Ir,Math.max(Ir,wn-bn)]);u.style.minWidth=st+"px",u.style.left=Nt+"px"}else{const Ne=Z.right-te.right,He=window.innerWidth-Q.right-Ne,Be=window.innerWidth-L.right-He,st=L.width+Be,bn=Math.max(st,Z.width),wn=window.innerWidth-Ir,Nt=kv(He,[Ir,Math.max(Ir,wn-bn)]);u.style.minWidth=st+"px",u.style.right=Nt+"px"}const ce=x(),se=window.innerHeight-Ir*2,ge=E.scrollHeight,pe=window.getComputedStyle(h),ve=parseInt(pe.borderTopWidth,10),M=parseInt(pe.paddingTop,10),W=parseInt(pe.borderBottomWidth,10),X=parseInt(pe.paddingBottom,10),H=ve+M+ge+X+W,j=Math.min(_.offsetHeight*5,H),V=window.getComputedStyle(E),re=parseInt(V.paddingTop,10),U=parseInt(V.paddingBottom,10),ee=L.top+L.height/2-Ir,de=se-ee,ie=_.offsetHeight/2,G=_.offsetTop+ie,me=ve+M+G,Ce=H-me;if(me<=ee){const Ne=ce.length>0&&_===ce[ce.length-1].ref.current;u.style.bottom="0px";const He=h.clientHeight-E.offsetTop-E.offsetHeight,Be=Math.max(de,ie+(Ne?U:0)+He+W),st=me+Be;u.style.height=st+"px"}else{const Ne=ce.length>0&&_===ce[0].ref.current;u.style.top="0px";const Be=Math.max(ee,ve+E.offsetTop+(Ne?re:0)+ie)+Ce;u.style.height=Be+"px",E.scrollTop=me-ee+E.offsetTop}u.style.margin=`${Ir}px 0`,u.style.minHeight=j+"px",u.style.maxHeight=se+"px",r?.(),requestAnimationFrame(()=>w.current=!0)}},[x,o.trigger,o.valueNode,u,h,E,_,C,o.dir,r]);un(()=>A(),[A]);const[k,D]=b.useState();un(()=>{h&&D(window.getComputedStyle(h).zIndex)},[h]);const N=b.useCallback(L=>{L&&S.current===!0&&(A(),R?.(),S.current=!1)},[A,R]);return g.jsx(p8,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:w,onScrollButtonChange:N,children:g.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:g.jsx(Oe.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});qO.displayName=f8;var h8="SelectPopperPosition",Mv=b.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ir,...o}=t,c=Sh(n);return g.jsx(Gy,{...c,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Mv.displayName=h8;var[p8,t0]=gl(Ai,{}),Dv="SelectViewport",VO=b.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Hs(Dv,n),c=t0(Dv,n),u=Ke(e,o.onViewportChange),f=b.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(wh.Slot,{scope:n,children:g.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:be(i.onScroll,h=>{const m=h.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=c;if(x?.current&&v){const w=Math.abs(f.current-m.scrollTop);if(w>0){const S=window.innerHeight-Ir*2,E=parseFloat(v.style.minHeight),_=parseFloat(v.style.height),C=Math.max(E,_);if(C<S){const R=C+w,A=Math.min(S,R),k=R-A;v.style.height=A+"px",v.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,v.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});VO.displayName=Dv;var GO="SelectGroup",[m8,g8]=gl(GO),YO=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=nr();return g.jsx(m8,{scope:n,id:i,children:g.jsx(Oe.div,{role:"group","aria-labelledby":i,...r,ref:e})})});YO.displayName=GO;var WO="SelectLabel",KO=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=g8(WO,n);return g.jsx(Oe.div,{id:i.id,...r,ref:e})});KO.displayName=WO;var Mf="SelectItem",[v8,ZO]=gl(Mf),QO=b.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...c}=t,u=Bs(Mf,n),f=Hs(Mf,n),h=u.value===r,[m,v]=b.useState(o??""),[x,w]=b.useState(!1),S=Ke(e,R=>f.itemRefCallback?.(R,r,i)),E=nr(),_=b.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(v8,{scope:n,value:r,disabled:i,textId:E,isSelected:h,onItemTextChange:b.useCallback(R=>{v(A=>A||(R?.textContent??"").trim())},[]),children:g.jsx(wh.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:g.jsx(Oe.div,{role:"option","aria-labelledby":E,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:S,onFocus:be(c.onFocus,()=>w(!0)),onBlur:be(c.onBlur,()=>w(!1)),onClick:be(c.onClick,()=>{_.current!=="mouse"&&C()}),onPointerUp:be(c.onPointerUp,()=>{_.current==="mouse"&&C()}),onPointerDown:be(c.onPointerDown,R=>{_.current=R.pointerType}),onPointerMove:be(c.onPointerMove,R=>{_.current=R.pointerType,i?f.onItemLeave?.():_.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(c.onPointerLeave,R=>{R.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:be(c.onKeyDown,R=>{f.searchRef?.current!==""&&R.key===" "||(a8.includes(R.key)&&C(),R.key===" "&&R.preventDefault())})})})})});QO.displayName=Mf;var kc="SelectItemText",XO=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,c=Bs(kc,n),u=Hs(kc,n),f=ZO(kc,n),h=l8(kc,n),[m,v]=b.useState(null),x=Ke(e,C=>v(C),f.onItemTextChange,C=>u.itemTextRefCallback?.(C,f.value,f.disabled)),w=m?.textContent,S=b.useMemo(()=>g.jsx("option",{value:f.value,disabled:f.disabled,children:w},f.value),[f.disabled,f.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return un(()=>(E(S),()=>_(S)),[E,_,S]),g.jsxs(g.Fragment,{children:[g.jsx(Oe.span,{id:f.textId,...o,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?rl.createPortal(o.children,c.valueNode):null]})});XO.displayName=kc;var JO="SelectItemIndicator",eA=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return ZO(JO,n).isSelected?g.jsx(Oe.span,{"aria-hidden":!0,...r,ref:e}):null});eA.displayName=JO;var Pv="SelectScrollUpButton",tA=b.forwardRef((t,e)=>{const n=Hs(Pv,t.__scopeSelect),r=t0(Pv,t.__scopeSelect),[i,o]=b.useState(!1),c=Ke(e,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;o(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?g.jsx(rA,{...t,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});tA.displayName=Pv;var Lv="SelectScrollDownButton",nA=b.forwardRef((t,e)=>{const n=Hs(Lv,t.__scopeSelect),r=t0(Lv,t.__scopeSelect),[i,o]=b.useState(!1),c=Ke(e,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)<h;o(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?g.jsx(rA,{...t,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});nA.displayName=Lv;var rA=b.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Hs("SelectScrollButton",n),c=b.useRef(null),u=xh(n),f=b.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return b.useEffect(()=>()=>f(),[f]),un(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),g.jsx(Oe.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:be(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:be(i.onPointerMove,()=>{o.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:be(i.onPointerLeave,()=>{f()})})}),y8="SelectSeparator",aA=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return g.jsx(Oe.div,{"aria-hidden":!0,...r,ref:e})});aA.displayName=y8;var Iv="SelectArrow",b8=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Sh(n),o=Bs(Iv,n),c=Hs(Iv,n);return o.open&&c.position==="popper"?g.jsx(Yy,{...i,...r,ref:e}):null});b8.displayName=Iv;function sA(t){return t===""||t===void 0}var iA=b.forwardRef((t,e)=>{const{value:n,...r}=t,i=b.useRef(null),o=Ke(e,i),c=MO(n);return b.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==n&&m){const v=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(v)}},[c,n]),g.jsx(Wy,{asChild:!0,children:g.jsx("select",{...r,ref:o,defaultValue:n})})});iA.displayName="BubbleSelect";function oA(t){const e=Jt(t),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(c=>{const u=n.current+c;e(u),function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[e]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function lA(t,e,n){const i=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let c=w8(t,Math.max(o,0));i.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function w8(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var x8=DO,cA=LO,S8=zO,E8=UO,_8=$O,uA=BO,T8=VO,C8=YO,dA=KO,fA=QO,R8=XO,O8=eA,hA=tA,pA=nA,mA=aA;const n0=x8,A8=C8,r0=S8,Eh=b.forwardRef(({className:t,children:e,...n},r)=>g.jsxs(cA,{ref:r,className:ye("border-input bg-background ring-offset-background placeholder:text-muted-foreground flex h-10 w-32 cursor-pointer items-center justify-between rounded-md border px-3 py-2 text-sm hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,g.jsx(E8,{asChild:!0,children:g.jsx(Jo,{className:"h-4 w-4 opacity-50"})})]}));Eh.displayName=cA.displayName;const gA=b.forwardRef(({className:t,...e},n)=>g.jsx(hA,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",t),...e,children:g.jsx(gR,{className:"h-4 w-4"})}));gA.displayName=hA.displayName;const vA=b.forwardRef(({className:t,...e},n)=>g.jsx(pA,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",t),...e,children:g.jsx(Jo,{className:"h-4 w-4"})}));vA.displayName=pA.displayName;const a0=b.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>g.jsx(_8,{children:g.jsxs(uA,{ref:i,className:ye("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[g.jsx(gA,{}),g.jsx(T8,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),g.jsx(vA,{})]})}));a0.displayName=uA.displayName;const N8=b.forwardRef(({className:t,...e},n)=>g.jsx(dA,{ref:n,className:ye("py-1.5 pr-2 pl-8 text-sm font-semibold",t),...e}));N8.displayName=dA.displayName;const s0=b.forwardRef(({className:t,children:e,...n},r)=>g.jsxs(fA,{ref:r,className:ye("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(O8,{children:g.jsx(mR,{className:"h-4 w-4"})})}),g.jsx(R8,{children:e})]}));s0.displayName=fA.displayName;const j8=b.forwardRef(({className:t,...e},n)=>g.jsx(mA,{ref:n,className:ye("bg-muted -mx-1 my-1 h-px",t),...e}));j8.displayName=mA.displayName;const k8=()=>{const{selectedSpecId:t}=ar(),[e,n]=b.useState(!1),r=async()=>{try{n(!0);const o=(await qr.get(`/download-spec?spec_id=${t}`)).data,c=JSON.stringify(o,null,2),u=new Blob([c],{type:"application/json"});if("showSaveFilePicker"in window){const h=await(await window.showSaveFilePicker({suggestedName:"openapi.json",startIn:"downloads"})).createWritable();await h.write(u),await h.close()}else{const f=URL.createObjectURL(u),h=document.createElement("a");h.href=f,h.download="openapi.json",document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(f)}}catch(i){i.name!=="AbortError"&&(console.error(i),alert("Failed to download the spec file."))}finally{n(!1)}};return g.jsx(At,{size:"sm",variant:"outline",onClick:r,children:g.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e?g.jsx(la,{className:"h-4 w-4 animate-spin"}):g.jsx(L5,{className:"h-4 w-4"}),"Export"]})})},M8=Us("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function zv({className:t,variant:e,...n}){return g.jsx("div",{className:ye(M8({variant:e}),t),...n})}const i0=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("bg-card text-card-foreground rounded-lg border border-border/60",t),...e}));i0.displayName="Card";const o0=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-6",t),...e}));o0.displayName="CardHeader";const l0=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("text-2xl leading-none font-semibold tracking-tight",t),...e}));l0.displayName="CardTitle";const c0=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("text-muted-foreground text-sm",t),...e}));c0.displayName="CardDescription";const u0=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("p-6 pt-0",t),...e}));u0.displayName="CardContent";const D8=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",t),...e}));D8.displayName="CardFooter";var Og="rovingFocusGroup.onEntryFocus",P8={bubbles:!1,cancelable:!0},_h="RovingFocusGroup",[Uv,yA,L8]=bh(_h),[I8,Fs]=Rn(_h,[L8]),[z8,U8]=I8(_h),bA=b.forwardRef((t,e)=>g.jsx(Uv.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(Uv.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx($8,{...t,ref:e})})}));bA.displayName=_h;var $8=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...v}=t,x=b.useRef(null),w=Ke(e,x),S=$s(o),[E=null,_]=$n({prop:c,defaultProp:u,onChange:f}),[C,R]=b.useState(!1),A=Jt(h),k=yA(n),D=b.useRef(!1),[N,L]=b.useState(0);return b.useEffect(()=>{const Z=x.current;if(Z)return Z.addEventListener(Og,A),()=>Z.removeEventListener(Og,A)},[A]),g.jsx(z8,{scope:n,orientation:r,dir:S,loop:i,currentTabStopId:E,onItemFocus:b.useCallback(Z=>_(Z),[_]),onItemShiftTab:b.useCallback(()=>R(!0),[]),onFocusableItemAdd:b.useCallback(()=>L(Z=>Z+1),[]),onFocusableItemRemove:b.useCallback(()=>L(Z=>Z-1),[]),children:g.jsx(Oe.div,{tabIndex:C||N===0?-1:0,"data-orientation":r,...v,ref:w,style:{outline:"none",...t.style},onMouseDown:be(t.onMouseDown,()=>{D.current=!0}),onFocus:be(t.onFocus,Z=>{const Q=!D.current;if(Z.target===Z.currentTarget&&Q&&!C){const te=new CustomEvent(Og,P8);if(Z.currentTarget.dispatchEvent(te),!te.defaultPrevented){const ce=k().filter(M=>M.focusable),se=ce.find(M=>M.active),ge=ce.find(M=>M.id===E),ve=[se,ge,...ce].filter(Boolean).map(M=>M.ref.current);SA(ve,m)}}D.current=!1}),onBlur:be(t.onBlur,()=>R(!1))})})}),wA="RovingFocusGroupItem",xA=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...c}=t,u=nr(),f=o||u,h=U8(wA,n),m=h.currentTabStopId===f,v=yA(n),{onFocusableItemAdd:x,onFocusableItemRemove:w}=h;return b.useEffect(()=>{if(r)return x(),()=>w()},[r,x,w]),g.jsx(Uv.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:g.jsx(Oe.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:e,onMouseDown:be(t.onMouseDown,S=>{r?h.onItemFocus(f):S.preventDefault()}),onFocus:be(t.onFocus,()=>h.onItemFocus(f)),onKeyDown:be(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=F8(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let C=v().filter(R=>R.focusable).map(R=>R.ref.current);if(E==="last")C.reverse();else if(E==="prev"||E==="next"){E==="prev"&&C.reverse();const R=C.indexOf(S.currentTarget);C=h.loop?q8(C,R+1):C.slice(R+1)}setTimeout(()=>SA(C))}})})})});xA.displayName=wA;var B8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function H8(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function F8(t,e,n){const r=H8(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return B8[r]}function SA(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function q8(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Th=bA,Ch=xA,$v=["Enter"," "],V8=["ArrowDown","PageUp","Home"],EA=["ArrowUp","PageDown","End"],G8=[...V8,...EA],Y8={ltr:[...$v,"ArrowRight"],rtl:[...$v,"ArrowLeft"]},W8={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yu="Menu",[Qc,K8,Z8]=bh(yu),[Li,_A]=Rn(yu,[Z8,ml,Fs]),Rh=ml(),TA=Fs(),[Q8,Ii]=Li(yu),[X8,bu]=Li(yu),CA=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:c=!0}=t,u=Rh(e),[f,h]=b.useState(null),m=b.useRef(!1),v=Jt(o),x=$s(i);return b.useEffect(()=>{const w=()=>{m.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>m.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),g.jsx(qy,{...u,children:g.jsx(Q8,{scope:e,open:n,onOpenChange:v,content:f,onContentChange:h,children:g.jsx(X8,{scope:e,onClose:b.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:m,dir:x,modal:c,children:r})})})};CA.displayName=yu;var J8="MenuAnchor",d0=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Rh(n);return g.jsx(Vy,{...i,...r,ref:e})});d0.displayName=J8;var f0="MenuPortal",[eF,RA]=Li(f0,{forceMount:void 0}),OA=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Ii(f0,e);return g.jsx(eF,{scope:e,forceMount:n,children:g.jsx(dn,{present:n||o.open,children:g.jsx(hu,{asChild:!0,container:i,children:r})})})};OA.displayName=f0;var Er="MenuContent",[tF,h0]=Li(Er),AA=b.forwardRef((t,e)=>{const n=RA(Er,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Ii(Er,t.__scopeMenu),c=bu(Er,t.__scopeMenu);return g.jsx(Qc.Provider,{scope:t.__scopeMenu,children:g.jsx(dn,{present:r||o.open,children:g.jsx(Qc.Slot,{scope:t.__scopeMenu,children:c.modal?g.jsx(nF,{...i,ref:e}):g.jsx(rF,{...i,ref:e})})})})}),nF=b.forwardRef((t,e)=>{const n=Ii(Er,t.__scopeMenu),r=b.useRef(null),i=Ke(e,r);return b.useEffect(()=>{const o=r.current;if(o)return Ny(o)},[]),g.jsx(p0,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:be(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rF=b.forwardRef((t,e)=>{const n=Ii(Er,t.__scopeMenu);return g.jsx(p0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),p0=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:x,onDismiss:w,disableOutsideScroll:S,...E}=t,_=Ii(Er,n),C=bu(Er,n),R=Rh(n),A=TA(n),k=K8(n),[D,N]=b.useState(null),L=b.useRef(null),Z=Ke(e,L,_.onContentChange),Q=b.useRef(0),te=b.useRef(""),ce=b.useRef(0),se=b.useRef(null),ge=b.useRef("right"),pe=b.useRef(0),ve=S?fh:b.Fragment,M=S?{as:$a,allowPinchZoom:!0}:void 0,W=H=>{const j=te.current+H,V=k().filter(G=>!G.disabled),re=document.activeElement,U=V.find(G=>G.ref.current===re)?.textValue,ee=V.map(G=>G.textValue),de=mF(ee,j,U),ie=V.find(G=>G.textValue===de)?.ref.current;(function G(me){te.current=me,window.clearTimeout(Q.current),me!==""&&(Q.current=window.setTimeout(()=>G(""),1e3))})(j),ie&&setTimeout(()=>ie.focus())};b.useEffect(()=>()=>window.clearTimeout(Q.current),[]),Ay();const X=b.useCallback(H=>ge.current===se.current?.side&&vF(H,se.current?.area),[]);return g.jsx(tF,{scope:n,searchRef:te,onItemEnter:b.useCallback(H=>{X(H)&&H.preventDefault()},[X]),onItemLeave:b.useCallback(H=>{X(H)||(L.current?.focus(),N(null))},[X]),onTriggerLeave:b.useCallback(H=>{X(H)&&H.preventDefault()},[X]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:b.useCallback(H=>{se.current=H},[]),children:g.jsx(ve,{...M,children:g.jsx(uh,{asChild:!0,trapped:i,onMountAutoFocus:be(o,H=>{H.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:g.jsx(fu,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:v,onInteractOutside:x,onDismiss:w,children:g.jsx(Th,{asChild:!0,...A,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:N,onEntryFocus:be(f,H=>{C.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Gy,{role:"menu","aria-orientation":"vertical","data-state":VA(_.open),"data-radix-menu-content":"",dir:C.dir,...R,...E,ref:Z,style:{outline:"none",...E.style},onKeyDown:be(E.onKeyDown,H=>{const V=H.target.closest("[data-radix-menu-content]")===H.currentTarget,re=H.ctrlKey||H.altKey||H.metaKey,U=H.key.length===1;V&&(H.key==="Tab"&&H.preventDefault(),!re&&U&&W(H.key));const ee=L.current;if(H.target!==ee||!G8.includes(H.key))return;H.preventDefault();const ie=k().filter(G=>!G.disabled).map(G=>G.ref.current);EA.includes(H.key)&&ie.reverse(),hF(ie)}),onBlur:be(t.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(Q.current),te.current="")}),onPointerMove:be(t.onPointerMove,Xc(H=>{const j=H.target,V=pe.current!==H.clientX;if(H.currentTarget.contains(j)&&V){const re=H.clientX>pe.current?"right":"left";ge.current=re,pe.current=H.clientX}}))})})})})})})});AA.displayName=Er;var aF="MenuGroup",m0=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Oe.div,{role:"group",...r,ref:e})});m0.displayName=aF;var sF="MenuLabel",NA=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Oe.div,{...r,ref:e})});NA.displayName=sF;var Df="MenuItem",l_="menu.itemSelect",Oh=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=b.useRef(null),c=bu(Df,t.__scopeMenu),u=h0(Df,t.__scopeMenu),f=Ke(e,o),h=b.useRef(!1),m=()=>{const v=o.current;if(!n&&v){const x=new CustomEvent(l_,{bubbles:!0,cancelable:!0});v.addEventListener(l_,w=>r?.(w),{once:!0}),TR(v,x),x.defaultPrevented?h.current=!1:c.onClose()}};return g.jsx(jA,{...i,ref:f,disabled:n,onClick:be(t.onClick,m),onPointerDown:v=>{t.onPointerDown?.(v),h.current=!0},onPointerUp:be(t.onPointerUp,v=>{h.current||v.currentTarget?.click()}),onKeyDown:be(t.onKeyDown,v=>{const x=u.searchRef.current!=="";n||x&&v.key===" "||$v.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Oh.displayName=Df;var jA=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,c=h0(Df,n),u=TA(n),f=b.useRef(null),h=Ke(e,f),[m,v]=b.useState(!1),[x,w]=b.useState("");return b.useEffect(()=>{const S=f.current;S&&w((S.textContent??"").trim())},[o.children]),g.jsx(Qc.ItemSlot,{scope:n,disabled:r,textValue:i??x,children:g.jsx(Ch,{asChild:!0,...u,focusable:!r,children:g.jsx(Oe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:h,onPointerMove:be(t.onPointerMove,Xc(S=>{r?c.onItemLeave(S):(c.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(t.onPointerLeave,Xc(S=>c.onItemLeave(S))),onFocus:be(t.onFocus,()=>v(!0)),onBlur:be(t.onBlur,()=>v(!1))})})})}),iF="MenuCheckboxItem",kA=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return g.jsx(IA,{scope:t.__scopeMenu,checked:n,children:g.jsx(Oh,{role:"menuitemcheckbox","aria-checked":Pf(n)?"mixed":n,...i,ref:e,"data-state":v0(n),onSelect:be(i.onSelect,()=>r?.(Pf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kA.displayName=iF;var MA="MenuRadioGroup",[oF,lF]=Li(MA,{value:void 0,onValueChange:()=>{}}),DA=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=Jt(r);return g.jsx(oF,{scope:t.__scopeMenu,value:n,onValueChange:o,children:g.jsx(m0,{...i,ref:e})})});DA.displayName=MA;var PA="MenuRadioItem",LA=b.forwardRef((t,e)=>{const{value:n,...r}=t,i=lF(PA,t.__scopeMenu),o=n===i.value;return g.jsx(IA,{scope:t.__scopeMenu,checked:o,children:g.jsx(Oh,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":v0(o),onSelect:be(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});LA.displayName=PA;var g0="MenuItemIndicator",[IA,cF]=Li(g0,{checked:!1}),zA=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=cF(g0,n);return g.jsx(dn,{present:r||Pf(o.checked)||o.checked===!0,children:g.jsx(Oe.span,{...i,ref:e,"data-state":v0(o.checked)})})});zA.displayName=g0;var uF="MenuSeparator",UA=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.jsx(Oe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});UA.displayName=uF;var dF="MenuArrow",$A=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Rh(n);return g.jsx(Yy,{...i,...r,ref:e})});$A.displayName=dF;var fF="MenuSub",[_V,BA]=Li(fF),Mc="MenuSubTrigger",HA=b.forwardRef((t,e)=>{const n=Ii(Mc,t.__scopeMenu),r=bu(Mc,t.__scopeMenu),i=BA(Mc,t.__scopeMenu),o=h0(Mc,t.__scopeMenu),c=b.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=o,h={__scopeMenu:t.__scopeMenu},m=b.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return b.useEffect(()=>m,[m]),b.useEffect(()=>{const v=u.current;return()=>{window.clearTimeout(v),f(null)}},[u,f]),g.jsx(d0,{asChild:!0,...h,children:g.jsx(jA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":VA(n.open),...t,ref:ch(e,i.onTriggerChange),onClick:v=>{t.onClick?.(v),!(t.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:be(t.onPointerMove,Xc(v=>{o.onItemEnter(v),!v.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:be(t.onPointerLeave,Xc(v=>{m();const x=n.content?.getBoundingClientRect();if(x){const w=n.content?.dataset.side,S=w==="right",E=S?-5:5,_=x[S?"left":"right"],C=x[S?"right":"left"];o.onPointerGraceIntentChange({area:[{x:v.clientX+E,y:v.clientY},{x:_,y:x.top},{x:C,y:x.top},{x:C,y:x.bottom},{x:_,y:x.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(v),v.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:be(t.onKeyDown,v=>{const x=o.searchRef.current!=="";t.disabled||x&&v.key===" "||Y8[r.dir].includes(v.key)&&(n.onOpenChange(!0),n.content?.focus(),v.preventDefault())})})})});HA.displayName=Mc;var FA="MenuSubContent",qA=b.forwardRef((t,e)=>{const n=RA(Er,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Ii(Er,t.__scopeMenu),c=bu(Er,t.__scopeMenu),u=BA(FA,t.__scopeMenu),f=b.useRef(null),h=Ke(e,f);return g.jsx(Qc.Provider,{scope:t.__scopeMenu,children:g.jsx(dn,{present:r||o.open,children:g.jsx(Qc.Slot,{scope:t.__scopeMenu,children:g.jsx(p0,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:h,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{c.isUsingKeyboardRef.current&&f.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:be(t.onFocusOutside,m=>{m.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:be(t.onEscapeKeyDown,m=>{c.onClose(),m.preventDefault()}),onKeyDown:be(t.onKeyDown,m=>{const v=m.currentTarget.contains(m.target),x=W8[c.dir].includes(m.key);v&&x&&(o.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});qA.displayName=FA;function VA(t){return t?"open":"closed"}function Pf(t){return t==="indeterminate"}function v0(t){return Pf(t)?"indeterminate":t?"checked":"unchecked"}function hF(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function pF(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function mF(t,e,n){const i=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let c=pF(t,Math.max(o,0));i.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function gF(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,c=e.length-1;o<e.length;c=o++){const u=e[o].x,f=e[o].y,h=e[c].x,m=e[c].y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(i=!i)}return i}function vF(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return gF(n,e)}function Xc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var yF=CA,bF=d0,wF=OA,xF=AA,SF=m0,EF=NA,_F=Oh,TF=kA,CF=DA,RF=LA,OF=zA,AF=UA,NF=$A,jF=HA,kF=qA,y0="DropdownMenu",[MF,TV]=Rn(y0,[_A]),On=_A(),[DF,GA]=MF(y0),YA=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:c,modal:u=!0}=t,f=On(e),h=b.useRef(null),[m=!1,v]=$n({prop:i,defaultProp:o,onChange:c});return g.jsx(DF,{scope:e,triggerId:nr(),triggerRef:h,contentId:nr(),open:m,onOpenChange:v,onOpenToggle:b.useCallback(()=>v(x=>!x),[v]),modal:u,children:g.jsx(yF,{...f,open:m,onOpenChange:v,dir:r,modal:u,children:n})})};YA.displayName=y0;var WA="DropdownMenuTrigger",KA=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=GA(WA,n),c=On(n);return g.jsx(bF,{asChild:!0,...c,children:g.jsx(Oe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ch(e,o.triggerRef),onPointerDown:be(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:be(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});KA.displayName=WA;var PF="DropdownMenuPortal",ZA=t=>{const{__scopeDropdownMenu:e,...n}=t,r=On(e);return g.jsx(wF,{...r,...n})};ZA.displayName=PF;var QA="DropdownMenuContent",XA=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=GA(QA,n),o=On(n),c=b.useRef(!1);return g.jsx(xF,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:be(t.onCloseAutoFocus,u=>{c.current||i.triggerRef.current?.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:be(t.onInteractOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;(!i.modal||m)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});XA.displayName=QA;var LF="DropdownMenuGroup",IF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(SF,{...i,...r,ref:e})});IF.displayName=LF;var zF="DropdownMenuLabel",UF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(EF,{...i,...r,ref:e})});UF.displayName=zF;var $F="DropdownMenuItem",JA=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(_F,{...i,...r,ref:e})});JA.displayName=$F;var BF="DropdownMenuCheckboxItem",HF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(TF,{...i,...r,ref:e})});HF.displayName=BF;var FF="DropdownMenuRadioGroup",qF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(CF,{...i,...r,ref:e})});qF.displayName=FF;var VF="DropdownMenuRadioItem",GF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(RF,{...i,...r,ref:e})});GF.displayName=VF;var YF="DropdownMenuItemIndicator",WF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(OF,{...i,...r,ref:e})});WF.displayName=YF;var KF="DropdownMenuSeparator",ZF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(AF,{...i,...r,ref:e})});ZF.displayName=KF;var QF="DropdownMenuArrow",XF=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(NF,{...i,...r,ref:e})});XF.displayName=QF;var JF="DropdownMenuSubTrigger",e7=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(jF,{...i,...r,ref:e})});e7.displayName=JF;var t7="DropdownMenuSubContent",n7=b.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=On(n);return g.jsx(kF,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});n7.displayName=t7;var r7=YA,a7=KA,s7=ZA,i7=XA,o7=JA;function eN({...t}){return g.jsx(r7,{"data-slot":"dropdown-menu",...t})}function Bv({...t}){return g.jsx(a7,{"data-slot":"dropdown-menu-trigger",...t})}function tN({className:t,sideOffset:e=4,...n}){return g.jsx(s7,{children:g.jsx(i7,{"data-slot":"dropdown-menu-content",sideOffset:e,className:ye("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function l7({className:t,inset:e,variant:n="default",...r}){return g.jsx(o7,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:ye("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}const b0=()=>{const t=_y(),e=Kr();return{withAuthGuard:b.useCallback(r=>async()=>{if(!t){e("/signin");return}await r()},[t,e])}},nN={inviteMembers:async(t,e,n)=>(await qr.post(`/projects/${t}/specs/${e}/invite`,n)).data,verifyUserAccess:async(t,e)=>{try{return await qr.get(`/sharing/user/verify/document?spec_id=${e}&project_id=${t}`),{success:!0}}catch(n){if(n instanceof xv&&n.response)return n.response.data;if(n instanceof xv&&!n.response)return{success:!1};throw n}}},c7=()=>Fa({mutationFn:({projectId:t,selectedSpecId:e,data:n})=>nN.inviteMembers(t,e,n),onSuccess:()=>{gn.success("Members invited successfully."),Pi.invalidateQueries({queryKey:qa.mySpecs()})},onError:t=>{gn.error(`Failed to invite members: ${t.message}`)}}),u7=async t=>(await uR.post("/test-execution",t)).data,d7=async()=>(await qr.get("/specs/me")).data,f7=async({specId:t,source:e})=>(await qr.post(`/toggle/spec/${t}?source=${e}`)).data,h7=async(t,e)=>t==="original"?(await uR.get("/openapi.json")).data.data:(await qr.get(`/specs/${t}`,{params:{source:e}})).data.spec_content,p7=async t=>(await qr.post("/zylo-ai/user-context",{title:"title",version:"1.0.0",doc_type:"public",user_context:t.context,spec_id:t.specId})).data,m7=async t=>(await qr.patch("/testcases",{path:t.path,method:t.method,spec_id:t.specId})).data,rN=()=>{const t=_y();return Jf({queryKey:qa.mySpecs(),queryFn:d7,enabled:!!t})},w0=t=>rN().data?.find(n=>n.id===t);function g7({projectId:t}){const[e,n]=b.useState(""),[r,i]=b.useState([]),[o,c]=b.useState(!1),[u,f]=b.useState(null),[h,m]=b.useState(!1),v=b.useRef(null),{selectedSpecId:x}=ar(),w=w0(x),S=c7(),{withAuthGuard:E}=b0(),_=te=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(te),C=te=>{const ce=te.trim();return ce?_(ce)?r.includes(ce)?(f(`"${ce}" has already been added`),!1):(i([...r,ce]),n(""),f(null),!0):(f(`"${ce}" is not a valid email address`),!1):!1},R=te=>{const ce=[...r];ce.splice(te,1),i(ce),f(null)},A=te=>{te.key==="Enter"&&e?(te.preventDefault(),C(e)):te.key==="Backspace"&&!e&&r.length>0&&R(r.length-1)},k=te=>{if(n(te.target.value),f(null),te.target.value.includes(",")){const ce=te.target.value.split(","),se=ce.pop()||"";ce.forEach(ge=>C(ge)),n(se)}},D=()=>{e&&C(e)},N=()=>{const te=C(e);r.length!==0&&(e&&!te||S.mutate({projectId:t,selectedSpecId:x,data:{emails:r}},{onSuccess:()=>{i([]),n(""),f(null)}}))},L=()=>{v.current?.focus()},Z=E(()=>{c(te=>!te)}),Q=async te=>{try{await navigator.clipboard.writeText(te),m(!0),setTimeout(()=>m(!1),2e3)}catch(ce){console.error("Failed to copy text: ",ce)}};return g.jsxs(eN,{open:o,onOpenChange:Z,children:[g.jsx(Bv,{asChild:!0,children:g.jsx(At,{size:"sm",variant:"default",className:"bg-black/80 hover:bg-black",children:"Share"})}),g.jsx(tN,{className:"w-[28rem]",align:"end",children:g.jsxs(i0,{className:"border-0 shadow-none",children:[g.jsxs(o0,{className:"pb-3",children:[g.jsx(l0,{className:"text-lg",children:"Share this document with others by sending an invitation."}),g.jsx(c0,{children:"Only people you invite can access this document."})]}),g.jsxs(u0,{className:"pt-0",children:[g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsxs("div",{className:"flex flex-row items-start gap-2",children:[g.jsxs("div",{className:`flex flex-1 flex-col justify-start gap-1 rounded-sm border p-1 ${u?"border-red-500":""}`,onClick:L,children:[r.map((te,ce)=>g.jsxs(zv,{className:"flex items-center gap-1 self-start rounded-sm bg-blue-500 px-2 font-light hover:bg-blue-600",children:[te,g.jsx(bR,{className:"h-3 w-3 cursor-pointer",onClick:se=>{se.stopPropagation(),R(ce)}})]},ce)),g.jsx($r,{ref:v,type:"text",value:e,onChange:k,onKeyDown:A,onBlur:D,disabled:S.isPending,size:12,className:"h-8 min-w-[100px] flex-1 border-none px-1 text-[2px] placeholder:text-xs focus-visible:ring-0 focus-visible:ring-offset-0",placeholder:r.length===0?"example@email.com":""})]}),g.jsx("div",{className:"flex justify-end",children:g.jsx(At,{variant:"default",size:"sm",className:"w-28",onClick:N,disabled:S.isPending||r.length===0&&!e,children:S.isPending?g.jsx(la,{className:"h-4 w-4 animate-spin"}):"Invite"})})]}),u&&g.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-500",children:[g.jsx(M5,{className:"h-3 w-3"}),g.jsx("span",{children:u})]})]}),w&&w.shared_users&&w.shared_users.length>0&&g.jsxs("div",{className:"mt-4 border-t pt-4",children:[g.jsx("h4",{className:"mb-2 text-sm font-medium",children:"Shared with:"}),g.jsx("div",{className:"flex flex-wrap gap-1",children:w.shared_users.map((te,ce)=>g.jsx(zv,{variant:"outline",className:"px-2 py-1 text-xs",children:te},ce))})]}),w&&w.shared_doc_path&&g.jsxs("div",{className:"mt-4 border-t pt-4",children:[g.jsx("h4",{className:"mb-2 text-sm font-medium",children:"Document Link:"}),g.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-50 p-2",children:[g.jsx($r,{value:w.shared_doc_path,readOnly:!0,className:"flex-1 border-none bg-transparent text-xs focus-visible:ring-0 focus-visible:ring-offset-0"}),g.jsx(At,{variant:"outline",size:"sm",onClick:()=>Q(w.shared_doc_path),className:"px-2",children:h?g.jsx(mR,{className:"h-3 w-3 text-green-600"}):g.jsx(vR,{className:"h-3 w-3"})})]})]})]})]})})]})}const v7=t=>Ue.fromISO(t).toRelative()??"unknown",y7=({specId:t,label:e,baseSpecVersion:n})=>{const r=w0(t);return g.jsxs(s0,{value:t,className:"text-xs",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("pre",{children:e}),r&&t!=="original"&&g.jsx("span",{className:"text-muted-foreground",children:v7(r.created_at)}),n&&g.jsxs("span",{className:"flex flex-row items-center",children:["basd on",g.jsx("pre",{className:"ml-1 ",children:n})]})]}),g.jsx("div",{className:"ml-4"})]},t)};function b7(){const t=rN(),e=b.useRef(!1),{selectedSpecId:n,setSelectedSpecId:r,hasNewSpec:i,setHasNewSpec:o}=ar(),c=b.useMemo(()=>{const f={id:"original",base_spec_id:null};return t.isSuccess?[f,...t.data].toReversed():[f]},[t.data,t.isSuccess]),u=c.length-c.findIndex(f=>f.id===n)-1;return b.useEffect(()=>{t.isSuccess&&c.length>0&&!e.current&&(e.current=!0,r(c[0].id))},[t.isSuccess,c,r]),g.jsxs(n0,{disabled:c.length===1,defaultValue:"original",value:n,onValueChange:r,onOpenChange:()=>{o(!1)},children:[g.jsxs(Eh,{className:"relative h-8 text-xs",children:[g.jsx(r0,{placeholder:"Select a example",children:g.jsx("pre",{children:n==="original"?"original":`v${u}`})}),i&&g.jsx("div",{className:"absolute -top-3 -right-3",children:g.jsx(P5,{strokeWidth:6,className:"stroke-red-700"})})]}),g.jsx(a0,{children:g.jsx(A8,{children:c.map((f,h)=>{const m=c.findIndex(w=>w.id===f.base_spec_id),v=f.base_spec_id?`v${c.length-m-1}`:"",x=f.id==="original"?"original":`v${c.length-h-1}`;return g.jsx(y7,{specId:f.id,baseSpecVersion:v,label:x},f.id)})})})]})}const w7=()=>Fa({mutationFn:f7}),x7="t",S7="tuned";function E7(){const{selectedSpecId:t,currentSource:e,setCurrentSource:n}=ar(),{mutateAsync:r,isPending:i}=w7(),o=b.useCallback(f=>{Pi.invalidateQueries({queryKey:qa.openApiSpec(t,f)})},[t]),c=b.useCallback(async f=>{if(!(!f||f===e||i))try{await r({specId:t,source:f}),o(f),n(f)}catch(h){console.error("Failed to toggle spec source:",h)}},[e,o,i,t,n,r]),u=b.useCallback(()=>{c(e==="original"?"tuned":"original")},[e,c]);return b.useEffect(()=>{const f=h=>{h.key===x7&&h.ctrlKey&&(h.preventDefault(),u())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[u]),b.useEffect(()=>{n(S7)},[n,t]),{currentSource:e,handleToggle:c,isToggling:i}}var _7="Toggle",x0=b.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...o}=t,[c=!1,u]=$n({prop:n,onChange:i,defaultProp:r});return g.jsx(Oe.button,{type:"button","aria-pressed":c,"data-state":c?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:be(t.onClick,()=>{t.disabled||u(!c)})})});x0.displayName=_7;var aN=x0,vl="ToggleGroup",[sN,CV]=Rn(vl,[Fs]),iN=Fs(),S0=fe.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const i=r;return g.jsx(T7,{...i,ref:e})}if(n==="multiple"){const i=r;return g.jsx(C7,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${vl}\``)});S0.displayName=vl;var[oN,lN]=sN(vl),T7=fe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[c,u]=$n({prop:n,defaultProp:r,onChange:i});return g.jsx(oN,{scope:t.__scopeToggleGroup,type:"single",value:c?[c]:[],onItemActivate:u,onItemDeactivate:fe.useCallback(()=>u(""),[u]),children:g.jsx(cN,{...o,ref:e})})}),C7=fe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[c=[],u]=$n({prop:n,defaultProp:r,onChange:i}),f=fe.useCallback(m=>u((v=[])=>[...v,m]),[u]),h=fe.useCallback(m=>u((v=[])=>v.filter(x=>x!==m)),[u]);return g.jsx(oN,{scope:t.__scopeToggleGroup,type:"multiple",value:c,onItemActivate:f,onItemDeactivate:h,children:g.jsx(cN,{...o,ref:e})})});S0.displayName=vl;var[R7,O7]=sN(vl),cN=fe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:c,loop:u=!0,...f}=t,h=iN(n),m=$s(c),v={role:"group",dir:m,...f};return g.jsx(R7,{scope:n,rovingFocus:i,disabled:r,children:i?g.jsx(Th,{asChild:!0,...h,orientation:o,dir:m,loop:u,children:g.jsx(Oe.div,{...v,ref:e})}):g.jsx(Oe.div,{...v,ref:e})})}),Lf="ToggleGroupItem",uN=fe.forwardRef((t,e)=>{const n=lN(Lf,t.__scopeToggleGroup),r=O7(Lf,t.__scopeToggleGroup),i=iN(t.__scopeToggleGroup),o=n.value.includes(t.value),c=r.disabled||t.disabled,u={...t,pressed:o,disabled:c},f=fe.useRef(null);return r.rovingFocus?g.jsx(Ch,{asChild:!0,...i,focusable:!c,active:o,ref:f,children:g.jsx(c_,{...u,ref:e})}):g.jsx(c_,{...u,ref:e})});uN.displayName=Lf;var c_=fe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...i}=t,o=lN(Lf,n),c={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},u=o.type==="single"?c:void 0;return g.jsx(x0,{...u,...i,ref:e,onPressedChange:f=>{f?o.onItemActivate(r):o.onItemDeactivate(r)}})}),A7=S0,N7=uN;const dN=Us("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-blue-400 data-[state=on]:text-white [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3 min-w-10",sm:"h-9 px-2.5 min-w-9",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"default",size:"default"}}),j7=b.forwardRef(({className:t,variant:e,size:n,...r},i)=>g.jsx(aN,{ref:i,className:ye(dN({variant:e,size:n,className:t})),...r}));j7.displayName=aN.displayName;const fN=b.createContext({size:"default",variant:"default"});function k7({className:t,variant:e,size:n,children:r,...i}){return g.jsx(A7,{"data-slot":"toggle-group","data-variant":e,"data-size":n,className:ye("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",t),...i,children:g.jsx(fN.Provider,{value:{variant:e,size:n},children:r})})}function u_({className:t,children:e,variant:n,size:r,...i}){const o=b.useContext(fN);return g.jsx(N7,{"data-slot":"toggle-group-item","data-variant":o.variant||n,"data-size":o.size||r,className:ye(dN({variant:o.variant||n,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",t),...i,children:e})}const M7=4;function D7({currentSource:t,onToggle:e,specId:n,disabled:r=!1}){return g.jsxs(k7,{value:t,onValueChange:e,type:"single",disabled:r,className:"*:h-8 border border-accent text-xs",children:[g.jsx(u_,{className:"text-xs hover:h-8",value:"tuned","aria-label":"Switch to tuned specification",children:g.jsx("pre",{children:n.slice(0,M7)})}),g.jsx(u_,{className:"text-xs hover:h-8",value:"original","aria-label":"Switch to original specification",children:g.jsx("pre",{children:"base"})})]})}function P7({children:t,shortcut:e="Ctrl + T"}){return g.jsxs(Qy,{delayDuration:200,children:[g.jsx(Xy,{asChild:!0,children:t}),g.jsx(Jy,{children:g.jsxs("p",{children:["Toggle (",e,")"]})})]})}function L7(){const{selectedSpecId:t}=ar(),e=w0(t),{currentSource:n,handleToggle:r,isToggling:i}=E7();return e?.base_spec_id?g.jsx("div",{className:"flex items-center space-x-2",children:g.jsx(P7,{children:g.jsx(D7,{currentSource:n,onToggle:r,specId:e.id,disabled:i})})}):null}function I7({isHubMode:t=!1,customBaseURL:e,onBaseURLChange:n}){return g.jsx("div",{className:"sticky top-0 border-b bg-white/60 dark:bg-slate-900/60",children:g.jsxs("div",{className:"flex items-center justify-between pl-4 pr-6 py-2",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(FH,{}),!t&&g.jsx(b7,{}),!t&&g.jsx(L7,{}),t?g.jsx($r,{value:e,onChange:r=>n(r.target.value),placeholder:"https://example.com",className:"w-60"}):g.jsx(n0,{disabled:!0,value:e,children:g.jsx(Eh,{className:"w-60 h-8 text-xs",children:g.jsx(r0,{placeholder:"Select a example",children:e})})})]}),g.jsxs("div",{className:"flex items-center gap-4 ",children:[!t&&g.jsx(k8,{}),!t&&g.jsx(g7,{projectId:"project_123"})]})]})})}const Ah=b.createContext(null);Ah.displayName="PanelGroupContext";const It={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},E0=10,Ei=b.useLayoutEffect,d_=j_.useId,z7=typeof d_=="function"?d_:()=>null;let U7=0;function _0(t=null){const e=z7(),n=b.useRef(t||e||null);return n.current===null&&(n.current=""+U7++),t??n.current}function hN({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:c,maxSize:u,minSize:f,onCollapse:h,onExpand:m,onResize:v,order:x,style:w,tagName:S="div",...E}){const _=b.useContext(Ah);if(_===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:C,expandPanel:R,getPanelSize:A,getPanelStyle:k,groupId:D,isPanelCollapsed:N,reevaluatePanelConstraints:L,registerPanel:Z,resizePanel:Q,unregisterPanel:te}=_,ce=_0(c),se=b.useRef({callbacks:{onCollapse:h,onExpand:m,onResize:v},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:u,minSize:f},id:ce,idIsFromProps:c!==void 0,order:x});b.useRef({didLogMissingDefaultSizeWarning:!1}),Ei(()=>{const{callbacks:pe,constraints:ve}=se.current,M={...ve};se.current.id=ce,se.current.idIsFromProps=c!==void 0,se.current.order=x,pe.onCollapse=h,pe.onExpand=m,pe.onResize=v,ve.collapsedSize=n,ve.collapsible=r,ve.defaultSize=i,ve.maxSize=u,ve.minSize=f,(M.collapsedSize!==ve.collapsedSize||M.collapsible!==ve.collapsible||M.maxSize!==ve.maxSize||M.minSize!==ve.minSize)&&L(se.current,M)}),Ei(()=>{const pe=se.current;return Z(pe),()=>{te(pe)}},[x,ce,Z,te]),b.useImperativeHandle(o,()=>({collapse:()=>{C(se.current)},expand:pe=>{R(se.current,pe)},getId(){return ce},getSize(){return A(se.current)},isCollapsed(){return N(se.current)},isExpanded(){return!N(se.current)},resize:pe=>{Q(se.current,pe)}}),[C,R,A,N,ce,Q]);const ge=k(se.current,i);return b.createElement(S,{...E,children:t,className:e,id:ce,style:{...ge,...w},[It.groupId]:D,[It.panel]:"",[It.panelCollapsible]:r||void 0,[It.panelId]:ce,[It.panelSize]:parseFloat(""+ge.flexGrow).toFixed(1)})}const pN=b.forwardRef((t,e)=>b.createElement(hN,{...t,forwardedRef:e}));hN.displayName="Panel";pN.displayName="forwardRef(Panel)";let Hv=null,ff=-1,js=null;function $7(t,e){if(e){const n=(e&bN)!==0,r=(e&wN)!==0,i=(e&xN)!==0,o=(e&SN)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function B7(){js!==null&&(document.head.removeChild(js),Hv=null,js=null,ff=-1)}function Ag(t,e){var n,r;const i=$7(t,e);if(Hv!==i){if(Hv=i,js===null&&(js=document.createElement("style"),document.head.appendChild(js)),ff>=0){var o;(o=js.sheet)===null||o===void 0||o.removeRule(ff)}ff=(n=(r=js.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function mN(t){return t.type==="keydown"}function gN(t){return t.type.startsWith("pointer")}function vN(t){return t.type.startsWith("mouse")}function Nh(t){if(gN(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(vN(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function H7(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function F7(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function q7(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:p_(t),b:p_(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Ye(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:h_(f_(n.a)),b:h_(f_(n.b))};if(i.a===i.b){const o=r.childNodes,c={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const f=o[u];if(f===c.a)return 1;if(f===c.b)return-1}}return Math.sign(i.a-i.b)}const V7=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function G7(t){var e;const n=getComputedStyle((e=yN(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Y7(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||G7(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||V7.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function f_(t){let e=t.length;for(;e--;){const n=t[e];if(Ye(n,"Missing node"),Y7(n))return n}return null}function h_(t){return t&&Number(getComputedStyle(t).zIndex)||0}function p_(t){const e=[];for(;t;)e.push(t),t=yN(t);return e}function yN(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const bN=1,wN=2,xN=4,SN=8,W7=H7()==="coarse";let Hr=[],Zo=!1,yi=new Map,jh=new Map;const Jc=new Set;function K7(t,e,n,r,i){var o;const{ownerDocument:c}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},f=(o=yi.get(c))!==null&&o!==void 0?o:0;return yi.set(c,f+1),Jc.add(u),If(),function(){var m;jh.delete(t),Jc.delete(u);const v=(m=yi.get(c))!==null&&m!==void 0?m:1;if(yi.set(c,v-1),If(),v===1&&yi.delete(c),Hr.includes(u)){const x=Hr.indexOf(u);x>=0&&Hr.splice(x,1),C0(),i("up",!0,null)}}}function Z7(t){const{target:e}=t,{x:n,y:r}=Nh(t);Zo=!0,T0({target:e,x:n,y:r}),If(),Hr.length>0&&(zf("down",t),t.preventDefault(),EN(e)||t.stopImmediatePropagation())}function Ng(t){const{x:e,y:n}=Nh(t);if(Zo&&t.buttons===0&&(Zo=!1,zf("up",t)),!Zo){const{target:r}=t;T0({target:r,x:e,y:n})}zf("move",t),C0(),Hr.length>0&&t.preventDefault()}function jg(t){const{target:e}=t,{x:n,y:r}=Nh(t);jh.clear(),Zo=!1,Hr.length>0&&(t.preventDefault(),EN(e)||t.stopImmediatePropagation()),zf("up",t),T0({target:e,x:n,y:r}),C0(),If()}function EN(t){let e=t;for(;e;){if(e.hasAttribute(It.resizeHandle))return!0;e=e.parentElement}return!1}function T0({target:t,x:e,y:n}){Hr.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Jc.forEach(i=>{const{element:o,hitAreaMargins:c}=i,u=o.getBoundingClientRect(),{bottom:f,left:h,right:m,top:v}=u,x=W7?c.coarse:c.fine;if(e>=h-x&&e<=m+x&&n>=v-x&&n<=f+x){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&q7(r,o)>0){let S=r,E=!1;for(;S&&!S.contains(o);){if(F7(S.getBoundingClientRect(),u)){E=!0;break}S=S.parentElement}if(E)return}Hr.push(i)}})}function kg(t,e){jh.set(t,e)}function C0(){let t=!1,e=!1;Hr.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;jh.forEach(r=>{n|=r}),t&&e?Ag("intersection",n):t?Ag("horizontal",n):e?Ag("vertical",n):B7()}let Mg=new AbortController;function If(){Mg.abort(),Mg=new AbortController;const t={capture:!0,signal:Mg.signal};Jc.size&&(Zo?(Hr.length>0&&yi.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",jg,t),r.addEventListener("pointerleave",Ng,t),r.addEventListener("pointermove",Ng,t))}),window.addEventListener("pointerup",jg,t),window.addEventListener("pointercancel",jg,t)):yi.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",Z7,t),r.addEventListener("pointermove",Ng,t))}))}function zf(t,e){Jc.forEach(n=>{const{setResizeHandlerState:r}=n,i=Hr.includes(n);r(t,i,e)})}function Q7(){const[t,e]=b.useState(0);return b.useCallback(()=>e(n=>n+1),[])}function Ye(t,e){if(!t)throw console.error(e),Error(e)}function Ni(t,e,n=E0){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function za(t,e,n=E0){return Ni(t,e,n)===0}function Zn(t,e,n){return Ni(t,e,n)===0}function X7(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],o=e[r];if(!Zn(i,o,n))return!1}return!0}function Ho({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];Ye(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:c=100,minSize:u=0}=r;if(Ni(n,u)<0)if(o){const f=(i+u)/2;Ni(n,f)<0?n=i:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(E0)),n}function Dc({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Zn(t,0))return e;const c=[...e],[u,f]=r;Ye(u!=null,"Invalid first pivot index"),Ye(f!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const v=t<0?f:u,x=n[v];Ye(x,`Panel constraints not found for index ${v}`);const{collapsedSize:w=0,collapsible:S,minSize:E=0}=x;if(S){const _=e[v];if(Ye(_!=null,`Previous layout not found for panel index ${v}`),Zn(_,w)){const C=E-_;Ni(C,Math.abs(t))>0&&(t=t<0?0-C:C)}}}{const v=t<0?u:f,x=n[v];Ye(x,`No panel constraints found for index ${v}`);const{collapsedSize:w=0,collapsible:S,minSize:E=0}=x;if(S){const _=e[v];if(Ye(_!=null,`Previous layout not found for panel index ${v}`),Zn(_,E)){const C=_-w;Ni(C,Math.abs(t))>0&&(t=t<0?0-C:C)}}}}{const v=t<0?1:-1;let x=t<0?f:u,w=0;for(;;){const E=e[x];Ye(E!=null,`Previous layout not found for panel index ${x}`);const C=Ho({panelConstraints:n,panelIndex:x,size:100})-E;if(w+=C,x+=v,x<0||x>=n.length)break}const S=Math.min(Math.abs(t),Math.abs(w));t=t<0?0-S:S}{let x=t<0?u:f;for(;x>=0&&x<n.length;){const w=Math.abs(t)-Math.abs(h),S=e[x];Ye(S!=null,`Previous layout not found for panel index ${x}`);const E=S-w,_=Ho({panelConstraints:n,panelIndex:x,size:E});if(!Zn(S,_)&&(h+=S-_,c[x]=_,h.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?x--:x++}}if(X7(i,c))return i;{const v=t<0?f:u,x=e[v];Ye(x!=null,`Previous layout not found for panel index ${v}`);const w=x+h,S=Ho({panelConstraints:n,panelIndex:v,size:w});if(c[v]=S,!Zn(S,w)){let E=w-S,C=t<0?f:u;for(;C>=0&&C<n.length;){const R=c[C];Ye(R!=null,`Previous layout not found for panel index ${C}`);const A=R+E,k=Ho({panelConstraints:n,panelIndex:C,size:A});if(Zn(R,k)||(E-=k-R,c[C]=k),Zn(E,0))break;t>0?C--:C++}}}const m=c.reduce((v,x)=>x+v,0);return Zn(m,100)?c:i}function J7({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,o=0,c=0;const u=n[0];Ye(u!=null,"No pivot index found"),e.forEach((v,x)=>{const{constraints:w}=v,{maxSize:S=100,minSize:E=0}=w;x===u?(r=E,i=S):(o+=E,c+=S)});const f=Math.min(i,100-o),h=Math.max(r,100-c),m=t[u];return{valueMax:f,valueMin:h,valueNow:m}}function eu(t,e=document){return Array.from(e.querySelectorAll(`[${It.resizeHandleId}][data-panel-group-id="${t}"]`))}function _N(t,e,n=document){const i=eu(t,n).findIndex(o=>o.getAttribute(It.resizeHandleId)===e);return i??null}function TN(t,e,n){const r=_N(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function CN(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function kh(t,e=document){const n=e.querySelector(`[${It.resizeHandleId}="${t}"]`);return n||null}function eq(t,e,n,r=document){var i,o,c,u;const f=kh(e,r),h=eu(t,r),m=f?h.indexOf(f):-1,v=(i=(o=n[m])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,x=(c=(u=n[m+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[v,x]}function tq({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:c}){b.useRef({didWarnAboutMissingResizeHandle:!1}),Ei(()=>{if(!o)return;const u=eu(n,o);for(let f=0;f<i.length-1;f++){const{valueMax:h,valueMin:m,valueNow:v}=J7({layout:r,panelsArray:i,pivotIndices:[f,f+1]}),x=u[f];if(x!=null){const w=i[f];Ye(w,`No panel data found for index "${f}"`),x.setAttribute("aria-controls",w.id),x.setAttribute("aria-valuemax",""+Math.round(h)),x.setAttribute("aria-valuemin",""+Math.round(m)),x.setAttribute("aria-valuenow",v!=null?""+Math.round(v):"")}}return()=>{u.forEach((f,h)=>{f.removeAttribute("aria-controls"),f.removeAttribute("aria-valuemax"),f.removeAttribute("aria-valuemin"),f.removeAttribute("aria-valuenow")})}},[n,r,i,o]),b.useEffect(()=>{if(!o)return;const u=e.current;Ye(u,"Eager values not found");const{panelDataArray:f}=u,h=CN(n,o);Ye(h!=null,`No group found for id "${n}"`);const m=eu(n,o);Ye(m,`No resize handles found for group id "${n}"`);const v=m.map(x=>{const w=x.getAttribute(It.resizeHandleId);Ye(w,"Resize handle element has no handle id attribute");const[S,E]=eq(n,w,f,o);if(S==null||E==null)return()=>{};const _=C=>{if(!C.defaultPrevented)switch(C.key){case"Enter":{C.preventDefault();const R=f.findIndex(A=>A.id===S);if(R>=0){const A=f[R];Ye(A,`No panel data found for index ${R}`);const k=r[R],{collapsedSize:D=0,collapsible:N,minSize:L=0}=A.constraints;if(k!=null&&N){const Z=Dc({delta:Zn(k,D)?L-D:D-k,initialLayout:r,panelConstraints:f.map(Q=>Q.constraints),pivotIndices:TN(n,w,o),prevLayout:r,trigger:"keyboard"});r!==Z&&c(Z)}}break}}};return x.addEventListener("keydown",_),()=>{x.removeEventListener("keydown",_)}});return()=>{v.forEach(x=>x())}},[o,t,e,n,r,i,c])}function m_(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function RN(t,e){const n=t==="horizontal",{x:r,y:i}=Nh(e);return n?r:i}function nq(t,e,n,r,i){const o=n==="horizontal",c=kh(e,i);Ye(c,`No resize handle element found for id "${e}"`);const u=c.getAttribute(It.groupId);Ye(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const h=RN(n,t),m=CN(u,i);Ye(m,`No group element found for id "${u}"`);const v=m.getBoundingClientRect(),x=o?v.width:v.height;return(h-f)/x*100}function rq(t,e,n,r,i,o){if(mN(t)){const c=n==="horizontal";let u=0;t.shiftKey?u=100:i!=null?u=i:u=10;let f=0;switch(t.key){case"ArrowDown":f=c?0:u;break;case"ArrowLeft":f=c?-u:0;break;case"ArrowRight":f=c?u:0;break;case"ArrowUp":f=c?0:-u;break;case"End":f=100;break;case"Home":f=-100;break}return f}else return r==null?0:nq(t,e,n,r,o)}function aq({panelDataArray:t}){const e=Array(t.length),n=t.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<t.length;o++){const c=n[o];Ye(c,`Panel constraints not found for index ${o}`);const{defaultSize:u}=c;u!=null&&(r++,e[o]=u,i-=u)}for(let o=0;o<t.length;o++){const c=n[o];Ye(c,`Panel constraints not found for index ${o}`);const{defaultSize:u}=c;if(u!=null)continue;const f=t.length-r,h=i/f;r++,e[o]=h,i-=h}return e}function Lo(t,e,n){e.forEach((r,i)=>{const o=t[i];Ye(o,`Panel data not found for index ${i}`);const{callbacks:c,constraints:u,id:f}=o,{collapsedSize:h=0,collapsible:m}=u,v=n[f];if(v==null||r!==v){n[f]=r;const{onCollapse:x,onExpand:w,onResize:S}=c;S&&S(r,v),m&&(x||w)&&(w&&(v==null||za(v,h))&&!za(r,h)&&w(),x&&(v==null||!za(v,h))&&za(r,h)&&x())}})}function Kd(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function sq({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:o=3}){const c=n[i];let u;return c==null?u=t!=null?t.toPrecision(o):"1":r.length===1?u="1":u=c.toPrecision(o),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function iq(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function g_(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function ON(t){return`react-resizable-panels:${t}`}function AN(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function NN(t,e){try{const n=ON(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function oq(t,e,n){var r,i;const o=(r=NN(t,n))!==null&&r!==void 0?r:{},c=AN(e);return(i=o[c])!==null&&i!==void 0?i:null}function lq(t,e,n,r,i){var o;const c=ON(t),u=AN(e),f=(o=NN(t,i))!==null&&o!==void 0?o:{};f[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(c,JSON.stringify(f))}catch(h){console.error(h)}}function v_({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((o,c)=>o+c,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Zn(r,100)&&n.length>0)for(let o=0;o<e.length;o++){const c=n[o];Ye(c!=null,`No layout data found for index ${o}`);const u=100/r*c;n[o]=u}let i=0;for(let o=0;o<e.length;o++){const c=n[o];Ye(c!=null,`No layout data found for index ${o}`);const u=Ho({panelConstraints:e,panelIndex:o,size:c});c!=u&&(i+=c-u,n[o]=u)}if(!Zn(i,0))for(let o=0;o<e.length;o++){const c=n[o];Ye(c!=null,`No layout data found for index ${o}`);const u=c+i,f=Ho({panelConstraints:e,panelIndex:o,size:u});if(c!==f&&(i-=f-c,n[o]=f,Zn(i,0)))break}return n}const cq=100,Pc={getItem:t=>(g_(Pc),Pc.getItem(t)),setItem:(t,e)=>{g_(Pc),Pc.setItem(t,e)}},y_={};function jN({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Pc,style:h,tagName:m="div",...v}){const x=_0(o),w=b.useRef(null),[S,E]=b.useState(null),[_,C]=b.useState([]),R=Q7(),A=b.useRef({}),k=b.useRef(new Map),D=b.useRef(0),N=b.useRef({autoSaveId:t,direction:r,dragState:S,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),L=b.useRef({layout:_,panelDataArray:[],panelDataArrayChanged:!1});b.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),b.useImperativeHandle(i,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:U}=L.current;return U},setLayout:U=>{const{onLayout:ee}=N.current,{layout:de,panelDataArray:ie}=L.current,G=v_({layout:U,panelConstraints:ie.map(me=>me.constraints)});m_(de,G)||(C(G),L.current.layout=G,ee&&ee(G),Lo(ie,G,A.current))}}),[]),Ei(()=>{N.current.autoSaveId=t,N.current.direction=r,N.current.dragState=S,N.current.id=x,N.current.onLayout=c,N.current.storage=f}),tq({committedValuesRef:N,eagerValuesRef:L,groupId:x,layout:_,panelDataArray:L.current.panelDataArray,setLayout:C,panelGroupElement:w.current}),b.useEffect(()=>{const{panelDataArray:U}=L.current;if(t){if(_.length===0||_.length!==U.length)return;let ee=y_[t];ee==null&&(ee=iq(lq,cq),y_[t]=ee);const de=[...U],ie=new Map(k.current);ee(t,de,ie,_,f)}},[t,_,f]),b.useEffect(()=>{});const Z=b.useCallback(U=>{const{onLayout:ee}=N.current,{layout:de,panelDataArray:ie}=L.current;if(U.constraints.collapsible){const G=ie.map(Ne=>Ne.constraints),{collapsedSize:me=0,panelSize:Ce,pivotIndices:xe}=pi(ie,U,de);if(Ye(Ce!=null,`Panel size not found for panel "${U.id}"`),!za(Ce,me)){k.current.set(U.id,Ce);const He=$o(ie,U)===ie.length-1?Ce-me:me-Ce,Be=Dc({delta:He,initialLayout:de,panelConstraints:G,pivotIndices:xe,prevLayout:de,trigger:"imperative-api"});Kd(de,Be)||(C(Be),L.current.layout=Be,ee&&ee(Be),Lo(ie,Be,A.current))}}},[]),Q=b.useCallback((U,ee)=>{const{onLayout:de}=N.current,{layout:ie,panelDataArray:G}=L.current;if(U.constraints.collapsible){const me=G.map(st=>st.constraints),{collapsedSize:Ce=0,panelSize:xe=0,minSize:Ne=0,pivotIndices:He}=pi(G,U,ie),Be=ee??Ne;if(za(xe,Ce)){const st=k.current.get(U.id),bn=st!=null&&st>=Be?st:Be,Nt=$o(G,U)===G.length-1?xe-bn:bn-xe,Mt=Dc({delta:Nt,initialLayout:ie,panelConstraints:me,pivotIndices:He,prevLayout:ie,trigger:"imperative-api"});Kd(ie,Mt)||(C(Mt),L.current.layout=Mt,de&&de(Mt),Lo(G,Mt,A.current))}}},[]),te=b.useCallback(U=>{const{layout:ee,panelDataArray:de}=L.current,{panelSize:ie}=pi(de,U,ee);return Ye(ie!=null,`Panel size not found for panel "${U.id}"`),ie},[]),ce=b.useCallback((U,ee)=>{const{panelDataArray:de}=L.current,ie=$o(de,U);return sq({defaultSize:ee,dragState:S,layout:_,panelData:de,panelIndex:ie})},[S,_]),se=b.useCallback(U=>{const{layout:ee,panelDataArray:de}=L.current,{collapsedSize:ie=0,collapsible:G,panelSize:me}=pi(de,U,ee);return Ye(me!=null,`Panel size not found for panel "${U.id}"`),G===!0&&za(me,ie)},[]),ge=b.useCallback(U=>{const{layout:ee,panelDataArray:de}=L.current,{collapsedSize:ie=0,collapsible:G,panelSize:me}=pi(de,U,ee);return Ye(me!=null,`Panel size not found for panel "${U.id}"`),!G||Ni(me,ie)>0},[]),pe=b.useCallback(U=>{const{panelDataArray:ee}=L.current;ee.push(U),ee.sort((de,ie)=>{const G=de.order,me=ie.order;return G==null&&me==null?0:G==null?-1:me==null?1:G-me}),L.current.panelDataArrayChanged=!0,R()},[R]);Ei(()=>{if(L.current.panelDataArrayChanged){L.current.panelDataArrayChanged=!1;const{autoSaveId:U,onLayout:ee,storage:de}=N.current,{layout:ie,panelDataArray:G}=L.current;let me=null;if(U){const xe=oq(U,G,de);xe&&(k.current=new Map(Object.entries(xe.expandToSizes)),me=xe.layout)}me==null&&(me=aq({panelDataArray:G}));const Ce=v_({layout:me,panelConstraints:G.map(xe=>xe.constraints)});m_(ie,Ce)||(C(Ce),L.current.layout=Ce,ee&&ee(Ce),Lo(G,Ce,A.current))}}),Ei(()=>{const U=L.current;return()=>{U.layout=[]}},[]);const ve=b.useCallback(U=>{let ee=!1;const de=w.current;return de&&window.getComputedStyle(de,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(G){G.preventDefault();const me=w.current;if(!me)return()=>null;const{direction:Ce,dragState:xe,id:Ne,keyboardResizeBy:He,onLayout:Be}=N.current,{layout:st,panelDataArray:bn}=L.current,{initialLayout:wn}=xe??{},Nt=TN(Ne,U,me);let Mt=rq(G,U,Ce,xe,He,me);const pa=Ce==="horizontal";pa&&ee&&(Mt=-Mt);const ma=bn.map(tn=>tn.constraints),en=Dc({delta:Mt,initialLayout:wn??st,panelConstraints:ma,pivotIndices:Nt,prevLayout:st,trigger:mN(G)?"keyboard":"mouse-or-touch"}),xn=!Kd(st,en);(gN(G)||vN(G))&&D.current!=Mt&&(D.current=Mt,!xn&&Mt!==0?pa?kg(U,Mt<0?bN:wN):kg(U,Mt<0?xN:SN):kg(U,0)),xn&&(C(en),L.current.layout=en,Be&&Be(en),Lo(bn,en,A.current))}},[]),M=b.useCallback((U,ee)=>{const{onLayout:de}=N.current,{layout:ie,panelDataArray:G}=L.current,me=G.map(st=>st.constraints),{panelSize:Ce,pivotIndices:xe}=pi(G,U,ie);Ye(Ce!=null,`Panel size not found for panel "${U.id}"`);const He=$o(G,U)===G.length-1?Ce-ee:ee-Ce,Be=Dc({delta:He,initialLayout:ie,panelConstraints:me,pivotIndices:xe,prevLayout:ie,trigger:"imperative-api"});Kd(ie,Be)||(C(Be),L.current.layout=Be,de&&de(Be),Lo(G,Be,A.current))},[]),W=b.useCallback((U,ee)=>{const{layout:de,panelDataArray:ie}=L.current,{collapsedSize:G=0,collapsible:me}=ee,{collapsedSize:Ce=0,collapsible:xe,maxSize:Ne=100,minSize:He=0}=U.constraints,{panelSize:Be}=pi(ie,U,de);Be!=null&&(me&&xe&&za(Be,G)?za(G,Ce)||M(U,Ce):Be<He?M(U,He):Be>Ne&&M(U,Ne))},[M]),X=b.useCallback((U,ee)=>{const{direction:de}=N.current,{layout:ie}=L.current;if(!w.current)return;const G=kh(U,w.current);Ye(G,`Drag handle element not found for id "${U}"`);const me=RN(de,ee);E({dragHandleId:U,dragHandleRect:G.getBoundingClientRect(),initialCursorPosition:me,initialLayout:ie})},[]),H=b.useCallback(()=>{E(null)},[]),j=b.useCallback(U=>{const{panelDataArray:ee}=L.current,de=$o(ee,U);de>=0&&(ee.splice(de,1),delete A.current[U.id],L.current.panelDataArrayChanged=!0,R())},[R]),V=b.useMemo(()=>({collapsePanel:Z,direction:r,dragState:S,expandPanel:Q,getPanelSize:te,getPanelStyle:ce,groupId:x,isPanelCollapsed:se,isPanelExpanded:ge,reevaluatePanelConstraints:W,registerPanel:pe,registerResizeHandle:ve,resizePanel:M,startDragging:X,stopDragging:H,unregisterPanel:j,panelGroupElement:w.current}),[Z,S,r,Q,te,ce,x,se,ge,W,pe,ve,M,X,H,j]),re={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return b.createElement(Ah.Provider,{value:V},b.createElement(m,{...v,children:e,className:n,id:o,ref:w,style:{...re,...h},[It.group]:"",[It.groupDirection]:r,[It.groupId]:x}))}const kN=b.forwardRef((t,e)=>b.createElement(jN,{...t,forwardedRef:e}));jN.displayName="PanelGroup";kN.displayName="forwardRef(PanelGroup)";function $o(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function pi(t,e,n){const r=$o(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],c=n[r];return{...e.constraints,panelSize:c,pivotIndices:o}}function uq({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){b.useEffect(()=>{if(t||n==null||r==null)return;const i=kh(e,r);if(i==null)return;const o=c=>{if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),n(c);break}case"F6":{c.preventDefault();const u=i.getAttribute(It.groupId);Ye(u,`No group element found for id "${u}"`);const f=eu(u,r),h=_N(u,e,r);Ye(h!==null,`No resize element found for id "${e}"`);const m=c.shiftKey?h>0?h-1:f.length-1:h+1<f.length?h+1:0;f[m].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,t,e,n])}function MN({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:c,onDragging:u,onFocus:f,onPointerDown:h,onPointerUp:m,style:v={},tabIndex:x=0,tagName:w="div",...S}){var E,_;const C=b.useRef(null),R=b.useRef({onClick:c,onDragging:u,onPointerDown:h,onPointerUp:m});b.useEffect(()=>{R.current.onClick=c,R.current.onDragging=u,R.current.onPointerDown=h,R.current.onPointerUp=m});const A=b.useContext(Ah);if(A===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:k,groupId:D,registerResizeHandle:N,startDragging:L,stopDragging:Z,panelGroupElement:Q}=A,te=_0(i),[ce,se]=b.useState("inactive"),[ge,pe]=b.useState(!1),[ve,M]=b.useState(null),W=b.useRef({state:ce});Ei(()=>{W.current.state=ce}),b.useEffect(()=>{if(n)M(null);else{const V=N(te);M(()=>V)}},[n,te,N]);const X=(E=r?.coarse)!==null&&E!==void 0?E:15,H=(_=r?.fine)!==null&&_!==void 0?_:5;b.useEffect(()=>{if(n||ve==null)return;const V=C.current;Ye(V,"Element ref not attached");let re=!1;return K7(te,V,k,{coarse:X,fine:H},(ee,de,ie)=>{if(!de){se("inactive");return}switch(ee){case"down":{se("drag"),re=!1,Ye(ie,'Expected event to be defined for "down" action'),L(te,ie);const{onDragging:G,onPointerDown:me}=R.current;G?.(!0),me?.();break}case"move":{const{state:G}=W.current;re=!0,G!=="drag"&&se("hover"),Ye(ie,'Expected event to be defined for "move" action'),ve(ie);break}case"up":{se("hover"),Z();const{onClick:G,onDragging:me,onPointerUp:Ce}=R.current;me?.(!1),Ce?.(),re||G?.();break}}})},[X,k,n,H,N,te,ve,L,Z]),uq({disabled:n,handleId:te,resizeHandler:ve,panelGroupElement:Q});const j={touchAction:"none",userSelect:"none"};return b.createElement(w,{...S,children:t,className:e,id:i,onBlur:()=>{pe(!1),o?.()},onFocus:()=>{pe(!0),f?.()},ref:C,role:"separator",style:{...j,...v},tabIndex:x,[It.groupDirection]:k,[It.groupId]:D,[It.resizeHandle]:"",[It.resizeHandleActive]:ce==="drag"?"pointer":ge?"keyboard":void 0,[It.resizeHandleEnabled]:!n,[It.resizeHandleId]:te,[It.resizeHandleState]:ce})}MN.displayName="PanelResizeHandle";const b_=({className:t,...e})=>g.jsx(kN,{className:ye("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e}),Zd=pN,w_=({withHandle:t,className:e,...n})=>g.jsx(MN,{className:ye("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&g.jsxs("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:[g.jsx("div",{className:"h-2.5 w-[1px] bg-gray-400"}),g.jsx("div",{className:"h-2.5 w-[1px] bg-gray-400 ml-[1px]"})]})});function dq(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var R0="ScrollArea",[DN,RV]=Rn(R0),[fq,Tr]=DN(R0),PN=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...c}=t,[u,f]=b.useState(null),[h,m]=b.useState(null),[v,x]=b.useState(null),[w,S]=b.useState(null),[E,_]=b.useState(null),[C,R]=b.useState(0),[A,k]=b.useState(0),[D,N]=b.useState(!1),[L,Z]=b.useState(!1),Q=Ke(e,ce=>f(ce)),te=$s(i);return g.jsx(fq,{scope:n,type:r,dir:te,scrollHideDelay:o,scrollArea:u,viewport:h,onViewportChange:m,content:v,onContentChange:x,scrollbarX:w,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:N,scrollbarY:E,onScrollbarYChange:_,scrollbarYEnabled:L,onScrollbarYEnabledChange:Z,onCornerWidthChange:R,onCornerHeightChange:k,children:g.jsx(Oe.div,{dir:te,...c,ref:Q,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":A+"px",...t.style}})})});PN.displayName=R0;var LN="ScrollAreaViewport",IN=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=t,c=Tr(LN,n),u=b.useRef(null),f=Ke(e,u,c.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(Oe.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:g.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});IN.displayName=LN;var ha="ScrollAreaScrollbar",O0=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Tr(ha,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,u=t.orientation==="horizontal";return b.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),i.type==="hover"?g.jsx(hq,{...r,ref:e,forceMount:n}):i.type==="scroll"?g.jsx(pq,{...r,ref:e,forceMount:n}):i.type==="auto"?g.jsx(zN,{...r,ref:e,forceMount:n}):i.type==="always"?g.jsx(A0,{...r,ref:e}):null});O0.displayName=ha;var hq=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Tr(ha,t.__scopeScrollArea),[o,c]=b.useState(!1);return b.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),g.jsx(dn,{present:n||o,children:g.jsx(zN,{"data-state":o?"visible":"hidden",...r,ref:e})})}),pq=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Tr(ha,t.__scopeScrollArea),o=t.orientation==="horizontal",c=Dh(()=>f("SCROLL_END"),100),[u,f]=dq("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,i.scrollHideDelay,f]),b.useEffect(()=>{const h=i.viewport,m=o?"scrollLeft":"scrollTop";if(h){let v=h[m];const x=()=>{const w=h[m];v!==w&&(f("SCROLL"),c()),v=w};return h.addEventListener("scroll",x),()=>h.removeEventListener("scroll",x)}},[i.viewport,o,f,c]),g.jsx(dn,{present:n||u!=="hidden",children:g.jsx(A0,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:be(t.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:be(t.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),zN=b.forwardRef((t,e)=>{const n=Tr(ha,t.__scopeScrollArea),{forceMount:r,...i}=t,[o,c]=b.useState(!1),u=t.orientation==="horizontal",f=Dh(()=>{if(n.viewport){const h=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?h:m)}},10);return nl(n.viewport,f),nl(n.content,f),g.jsx(dn,{present:r||o,children:g.jsx(A0,{"data-state":o?"visible":"hidden",...i,ref:e})})}),A0=b.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=Tr(ha,t.__scopeScrollArea),o=b.useRef(null),c=b.useRef(0),[u,f]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=FN(u.viewport,u.content),m={...r,sizes:u,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:x=>o.current=x,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:x=>c.current=x};function v(x,w){return wq(x,c.current,u,w)}return n==="horizontal"?g.jsx(mq,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const x=i.viewport.scrollLeft,w=x_(x,u,i.dir);o.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollLeft=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollLeft=v(x,i.dir))}}):n==="vertical"?g.jsx(gq,{...m,ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const x=i.viewport.scrollTop,w=x_(x,u);o.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollTop=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollTop=v(x))}}):null}),mq=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=Tr(ha,t.__scopeScrollArea),[c,u]=b.useState(),f=b.useRef(null),h=Ke(e,f,o.onScrollbarXChange);return b.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),g.jsx($N,{"data-orientation":"horizontal",...i,ref:h,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Mh(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,v)=>{if(o.viewport){const x=o.viewport.scrollLeft+m.deltaX;t.onWheelScroll(x),VN(x,v)&&m.preventDefault()}},onResize:()=>{f.current&&o.viewport&&c&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:$f(c.paddingLeft),paddingEnd:$f(c.paddingRight)}})}})}),gq=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=Tr(ha,t.__scopeScrollArea),[c,u]=b.useState(),f=b.useRef(null),h=Ke(e,f,o.onScrollbarYChange);return b.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),g.jsx($N,{"data-orientation":"vertical",...i,ref:h,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Mh(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,v)=>{if(o.viewport){const x=o.viewport.scrollTop+m.deltaY;t.onWheelScroll(x),VN(x,v)&&m.preventDefault()}},onResize:()=>{f.current&&o.viewport&&c&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:$f(c.paddingTop),paddingEnd:$f(c.paddingBottom)}})}})}),[vq,UN]=DN(ha),$N=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:v,...x}=t,w=Tr(ha,n),[S,E]=b.useState(null),_=Ke(e,Q=>E(Q)),C=b.useRef(null),R=b.useRef(""),A=w.viewport,k=r.content-r.viewport,D=Jt(m),N=Jt(f),L=Dh(v,10);function Z(Q){if(C.current){const te=Q.clientX-C.current.left,ce=Q.clientY-C.current.top;h({x:te,y:ce})}}return b.useEffect(()=>{const Q=te=>{const ce=te.target;S?.contains(ce)&&D(te,k)};return document.addEventListener("wheel",Q,{passive:!1}),()=>document.removeEventListener("wheel",Q,{passive:!1})},[A,S,k,D]),b.useEffect(N,[r,N]),nl(S,L),nl(w.content,L),g.jsx(vq,{scope:n,scrollbar:S,hasThumb:i,onThumbChange:Jt(o),onThumbPointerUp:Jt(c),onThumbPositionChange:N,onThumbPointerDown:Jt(u),children:g.jsx(Oe.div,{...x,ref:_,style:{position:"absolute",...x.style},onPointerDown:be(t.onPointerDown,Q=>{Q.button===0&&(Q.target.setPointerCapture(Q.pointerId),C.current=S.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),Z(Q))}),onPointerMove:be(t.onPointerMove,Z),onPointerUp:be(t.onPointerUp,Q=>{const te=Q.target;te.hasPointerCapture(Q.pointerId)&&te.releasePointerCapture(Q.pointerId),document.body.style.webkitUserSelect=R.current,w.viewport&&(w.viewport.style.scrollBehavior=""),C.current=null})})})}),Uf="ScrollAreaThumb",BN=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=UN(Uf,t.__scopeScrollArea);return g.jsx(dn,{present:n||i.hasThumb,children:g.jsx(yq,{ref:e,...r})})}),yq=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,o=Tr(Uf,n),c=UN(Uf,n),{onThumbPositionChange:u}=c,f=Ke(e,v=>c.onThumbChange(v)),h=b.useRef(void 0),m=Dh(()=>{h.current&&(h.current(),h.current=void 0)},100);return b.useEffect(()=>{const v=o.viewport;if(v){const x=()=>{if(m(),!h.current){const w=xq(v,u);h.current=w,u()}};return u(),v.addEventListener("scroll",x),()=>v.removeEventListener("scroll",x)}},[o.viewport,m,u]),g.jsx(Oe.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:be(t.onPointerDownCapture,v=>{const w=v.target.getBoundingClientRect(),S=v.clientX-w.left,E=v.clientY-w.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:be(t.onPointerUp,c.onThumbPointerUp)})});BN.displayName=Uf;var N0="ScrollAreaCorner",HN=b.forwardRef((t,e)=>{const n=Tr(N0,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(bq,{...t,ref:e}):null});HN.displayName=N0;var bq=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=Tr(N0,n),[o,c]=b.useState(0),[u,f]=b.useState(0),h=!!(o&&u);return nl(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),f(m)}),nl(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),c(m)}),h?g.jsx(Oe.div,{...r,ref:e,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function $f(t){return t?parseInt(t,10):0}function FN(t,e){const n=t/e;return isNaN(n)?0:n}function Mh(t){const e=FN(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function wq(t,e,n,r="ltr"){const i=Mh(n),o=i/2,c=e||o,u=i-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,v=r==="ltr"?[0,m]:[m*-1,0];return qN([f,h],v)(t)}function x_(t,e,n="ltr"){const r=Mh(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-i,c=e.content-e.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],h=kv(t,f);return qN([0,c],[0,u])(h)}function qN(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function VN(t,e){return t>0&&t<e}var xq=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const o={left:t.scrollLeft,top:t.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&e(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Dh(t,e){const n=Jt(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function nl(t,e){const n=Jt(e);un(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}var GN=PN,Sq=IN,Eq=HN;const Lc=b.forwardRef(({className:t,children:e,...n},r)=>g.jsxs(GN,{ref:r,className:ye("relative overflow-hidden",t),...n,children:[g.jsx(Sq,{className:"h-full w-full rounded-[inherit]",children:e}),g.jsx(Bf,{}),g.jsx(Eq,{})]}));Lc.displayName=GN.displayName;const Bf=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>g.jsx(O0,{ref:r,orientation:e,className:ye("flex touch-none transition-colors select-none",e==="vertical"&&"h-full w-2",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:g.jsx(BN,{className:"bg-border relative flex-1 rounded-full"})}));Bf.displayName=O0.displayName;function YN({className:t,...e}){return g.jsx("textarea",{"data-slot":"textarea",className:ye("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}const Dg="ZyloAI",WN=({loadingMessage:t})=>{const{setIsGeneratingDocs:e}=ar();return b.useMemo(()=>({onMutate:()=>{e(!0),gn.loading(t,{id:Dg})},onSuccess:()=>{e(!1),gn.success("New docs generated successfully!"),gn.dismiss(Dg),Pi.invalidateQueries({queryKey:qa.mySpecs()})},onError:n=>{e(!1),m5(n)&&n.response?.data?.message?gn.error(n.response.data.message,{duration:1e4}):gn.error(n.message),gn.dismiss(Dg)}}),[t,e])},_q=()=>{const t=WN({loadingMessage:"Zylo Docs AI is working! Your upgraded docs will be ready in about 30 seconds."}),{isGeneratingDocs:e}=ar(),n=Fa({mutationFn:p7,...t});return{...n,isPending:n.isPending||e}},Tq=()=>{const t=WN({loadingMessage:"Zylo Docs AI is working! Your test cases will be ready in about 10 seconds."}),{isGeneratingDocs:e}=ar(),n=Fa({mutationFn:m7,...t});return{...n,isPending:n.isPending||e}},S_=()=>{const[t,e]=b.useState(""),{selectedSpecId:n,setHasNewSpec:r}=ar(),[i,o]=b.useState(!1),{mutateAsync:c,isPending:u}=_q(),{withAuthGuard:f}=b0(),h=b.useCallback(f(async()=>{await c({specId:n,context:t}),r(!0),e("")}),[t,n,c,r]);return b.useEffect(()=>{const m=v=>{i&&(v.key==="Enter"&&v.shiftKey||v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),h()))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[t,u,h,i]),g.jsxs("div",{className:"flex flex-col border rounded-3xl bg-muted has-[.textarea:focus]:ring has-[.textarea:focus]:ring-accent",children:[g.jsx("div",{className:"mx-5 my-3 mask-y-from-98%",children:g.jsx(YN,{onFocus:()=>o(!0),onBlur:()=>o(!1),value:t,onChange:m=>e(m.target.value),placeholder:"Add your context..",className:"textarea p-0 min-h-14 max-h-48 resize-none bg-transparent border-none focus-visible:ring-0 [scrollbar-width:thin] shadow-none"})}),g.jsx(At,{size:"sm",className:"self-end mr-2 mb-2 h-8 w-8 rounded-full p-0 bg-black/80 hover:bg-black/90 dark:bg-black-600 dark:hover:bg-black-700",onClick:h,disabled:u||t.length===0,children:u?g.jsx(la,{className:"h-4 w-4 animate-spin"}):g.jsx(B5,{className:"h-4 w-4"})})]})},Cq=Us("",{variants:{variant:{h1:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold tracking-tight",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 pl-6 italic",list:"my-6 ml-6 list-disc [&>li]:mt-2","inline-code":"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",lead:"text-xl text-muted-foreground",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-muted-foreground",code:"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm",caption:"text-xs text-muted-foreground",label:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}},defaultVariants:{variant:"p"}}),Bt=b.forwardRef(({className:t,variant:e,as:n,...r},i)=>{const o=n||Rq(e);return g.jsx(o,{className:ye(Cq({variant:e}),t),ref:i,...r})});Bt.displayName="Typography";function Rq(t){switch(t){case"h1":return"h1";case"h2":return"h2";case"h3":return"h3";case"h4":return"h4";case"blockquote":return"blockquote";case"list":return"ul";case"inline-code":case"code":return"code";case"label":return"label";default:return"p"}}const wu=e0(t=>({selectedOperation:{path:"",method:"GET"},setSelectedOperation:e=>t({selectedOperation:e})}));class Fo{spec;defaultContext;constructor(e,n=10){this.spec=e,this.defaultContext={visitedRefs:new Set,maxDepth:n,currentDepth:0}}static isReferenceObject(e){return e&&typeof e=="object"&&"$ref"in e}parseRef(e){if(!e.startsWith("#/"))throw new Error(`Unsupported reference format: ${e}. Only local references (#/...) are supported.`);return e.substring(2).split("/")}resolveJsonPointer(e){let n=this.spec;for(const r of e){if(!n||typeof n!="object")throw new Error(`Cannot resolve reference: path segment '${r}' not found`);n=n[r]}return n}resolveSchema(e,n={...this.defaultContext}){if(n.currentDepth>=n.maxDepth)return console.warn("Maximum resolution depth reached, returning empty schema"),{type:"object",description:"Maximum depth reached"};if(!Fo.isReferenceObject(e))return this.resolveSchemaComposition(e,n);const r=e.$ref;if(n.visitedRefs.has(r))return console.warn(`Circular reference detected: ${r}`),{type:"object",description:`Circular reference to ${r}`,"x-circular-ref":r};try{const i={visitedRefs:new Set(n.visitedRefs).add(r),maxDepth:n.maxDepth,currentDepth:n.currentDepth+1},o=this.parseRef(r),c=this.resolveJsonPointer(o);if(!c)throw new Error(`Reference not found: ${r}`);return this.resolveSchema(c,i)}catch(i){return console.error(`Failed to resolve reference ${r}:`,i),{type:"object",description:`Failed to resolve ${r}: ${i}`,"x-resolution-error":r}}}resolveSchemaComposition(e,n){const{allOf:r,oneOf:i,anyOf:o,properties:c,items:u,...f}=e,h={...f};if(e.allOf){const v=e.allOf.map(S=>this.resolveSchema(S,n)).reduce((S,E)=>({...S,...E,properties:{...S.properties,...E.properties},required:[...S.required||[],...E.required||[]]}),{}),{allOf:x,...w}=h;return{...w,...v}}if(e.oneOf&&(h.oneOf=e.oneOf.map(m=>this.resolveSchema(m,n))),e.anyOf&&(h.anyOf=e.anyOf.map(m=>this.resolveSchema(m,n))),e.properties){h.properties={};for(const[m,v]of Object.entries(e.properties))h.properties[m]=this.resolveSchema(v,n)}return e.items&&(h.items=this.resolveSchema(e.items,n)),h}resolveParameter(e){if(!Fo.isReferenceObject(e)){if(e.schema)return{...e,schema:this.resolveSchema(e.schema)};const{schema:r,...i}=e;return{...i,schema:r?this.resolveSchema(r):void 0}}const n=this.resolveJsonPointer(this.parseRef(e.$ref));return this.resolveParameter(n)}resolveRequestBody(e){if(!Fo.isReferenceObject(e)){const{content:r,...i}=e,o={...i};if(e.content){o.content={};for(const[c,u]of Object.entries(e.content))o.content[c]={schema:u.schema?this.resolveSchema(u.schema):void 0,example:u.example,examples:u.examples,encoding:u.encoding}}return o}const n=this.resolveJsonPointer(this.parseRef(e.$ref));return this.resolveRequestBody(n)}resolveResponse(e){if(!Fo.isReferenceObject(e)){const{content:r,...i}=e,o={...i};if(e.content){o.content={};for(const[c,u]of Object.entries(e.content))o.content[c]={schema:u.schema?this.resolveSchema(u.schema):void 0,example:u.example,examples:u.examples,encoding:u.encoding}}return o}const n=this.resolveJsonPointer(this.parseRef(e.$ref));return this.resolveResponse(n)}}const Oq=(t,e,n)=>{const r=t.paths?.[e];if(!r)return null;const i=r[n.toLowerCase()];if(!i)return null;const o=new Fo(t);return{...i,parameters:i.parameters?.map(u=>o.resolveParameter(u)),requestBody:i.requestBody?o.resolveRequestBody(i.requestBody):void 0,responses:i.responses?Object.entries(i.responses).reduce((u,[f,h])=>(u[f]=o.resolveResponse(h),u),{}):void 0}},E_=t=>!!(t&&typeof t=="object"&&!("$ref"in t)),Aq=["get","post","put","delete","patch","options","head","trace"],Nq=t=>{if(!t||!t.paths)return{operationGroups:[]};const e={};for(const[n,r]of Object.entries(t.paths))for(const i of Aq)if(r&&r[i]){const o=r[i],c=o.tags?.[0]||"default";e[c]||(e[c]={tag:c,operations:[]}),e[c].operations.push({operationId:o.operationId,summary:o.summary,method:i.toUpperCase(),path:n})}return{operationGroups:Object.values(e)}},KN=({select:t})=>{const{selectedSpecId:e,currentSource:n}=ar();return Jf({queryKey:qa.openApiSpec(e,n),queryFn:()=>h7(e,n),enabled:!!e,select:t,staleTime:e==="original"?0:1/0})},ZN=()=>KN({select:Nq}),yl=({select:t}={})=>{const{selectedOperation:e}=wu(),n=b.useMemo(()=>r=>{const i=Oq(r,e.path,e.method);return t?t(i||{}):i},[t,e.method,e.path]);return KN({select:n})},QN=({method:t})=>{const e=r=>{switch(r.toUpperCase()){case"POST":return"text-green-700 bg-green-100 hover:bg-green-200";case"GET":return"text-blue-700 bg-blue-100 hover:bg-blue-200";case"PUT":return"text-orange-700 bg-orange-100 hover:bg-orange-200";case"DELETE":return"text-red-700 bg-red-100 hover:bg-red-200";case"PATCH":return"text-purple-700 bg-purple-100 hover:bg-purple-200";case"HEAD":return"text-indigo-700 bg-indigo-100 hover:bg-indigo-200";case"OPTIONS":return"text-teal-700 bg-teal-100 hover:bg-teal-200";case"TRACE":return"text-pink-700 bg-pink-100 hover:bg-pink-200";case"CONNECT":return"text-yellow-700 bg-yellow-100 hover:bg-yellow-200";default:return"text-gray-700 bg-gray-100 hover:bg-gray-200"}},n=r=>{switch(r.toUpperCase()){case"GET":case"PUT":case"POST":case"HEAD":case"PATCH":return r.toUpperCase();case"DELETE":return"DEL";case"OPTIONS":return"OPT";case"TRACE":return"TRC";case"CONNECT":return"CONN";default:return r.slice(0,5).toUpperCase()}};return g.jsx(zv,{className:`flex w-10.5 justify-center rounded-md px-0.5 text-[0.66rem] font-bold ${e(t)}`,children:n(t)})};var j0="Collapsible",[jq,XN]=Rn(j0),[kq,k0]=jq(j0),JN=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:c,...u}=t,[f=!1,h]=$n({prop:r,defaultProp:i,onChange:c});return g.jsx(kq,{scope:n,disabled:o,contentId:nr(),open:f,onOpenToggle:b.useCallback(()=>h(m=>!m),[h]),children:g.jsx(Oe.div,{"data-state":L0(f),"data-disabled":o?"":void 0,...u,ref:e})})});JN.displayName=j0;var e2="CollapsibleTrigger",M0=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=k0(e2,n);return g.jsx(Oe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":L0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:be(t.onClick,i.onOpenToggle)})});M0.displayName=e2;var D0="CollapsibleContent",P0=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=k0(D0,t.__scopeCollapsible);return g.jsx(dn,{present:n||i.open,children:({present:o})=>g.jsx(Mq,{...r,ref:e,present:o})})});P0.displayName=D0;var Mq=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,c=k0(D0,n),[u,f]=b.useState(r),h=b.useRef(null),m=Ke(e,h),v=b.useRef(0),x=v.current,w=b.useRef(0),S=w.current,E=c.open||u,_=b.useRef(E),C=b.useRef(void 0);return b.useEffect(()=>{const R=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(R)},[]),un(()=>{const R=h.current;if(R){C.current=C.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";const A=R.getBoundingClientRect();v.current=A.height,w.current=A.width,_.current||(R.style.transitionDuration=C.current.transitionDuration,R.style.animationName=C.current.animationName),f(r)}},[c.open,r]),g.jsx(Oe.div,{"data-state":L0(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!E,...o,ref:m,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...t.style},children:E&&i})});function L0(t){return t?"open":"closed"}var t2=JN,Dq=M0,Pq=P0,Va="Accordion",Lq=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[I0,Iq,zq]=bh(Va),[Ph,OV]=Rn(Va,[zq,XN]),z0=XN(),n2=fe.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,o=r;return g.jsx(I0.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?g.jsx(Hq,{...o,ref:e}):g.jsx(Bq,{...i,ref:e})})});n2.displayName=Va;var[r2,Uq]=Ph(Va),[a2,$q]=Ph(Va,{collapsible:!1}),Bq=fe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...c}=t,[u,f]=$n({prop:n,defaultProp:r,onChange:i});return g.jsx(r2,{scope:t.__scopeAccordion,value:u?[u]:[],onItemOpen:f,onItemClose:fe.useCallback(()=>o&&f(""),[o,f]),children:g.jsx(a2,{scope:t.__scopeAccordion,collapsible:o,children:g.jsx(s2,{...c,ref:e})})})}),Hq=fe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[c=[],u]=$n({prop:n,defaultProp:r,onChange:i}),f=fe.useCallback(m=>u((v=[])=>[...v,m]),[u]),h=fe.useCallback(m=>u((v=[])=>v.filter(x=>x!==m)),[u]);return g.jsx(r2,{scope:t.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:g.jsx(a2,{scope:t.__scopeAccordion,collapsible:!0,children:g.jsx(s2,{...o,ref:e})})})}),[Fq,Lh]=Ph(Va),s2=fe.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...c}=t,u=fe.useRef(null),f=Ke(u,e),h=Iq(n),v=$s(i)==="ltr",x=be(t.onKeyDown,w=>{if(!Lq.includes(w.key))return;const S=w.target,E=h().filter(Z=>!Z.ref.current?.disabled),_=E.findIndex(Z=>Z.ref.current===S),C=E.length;if(_===-1)return;w.preventDefault();let R=_;const A=0,k=C-1,D=()=>{R=_+1,R>k&&(R=A)},N=()=>{R=_-1,R<A&&(R=k)};switch(w.key){case"Home":R=A;break;case"End":R=k;break;case"ArrowRight":o==="horizontal"&&(v?D():N());break;case"ArrowDown":o==="vertical"&&D();break;case"ArrowLeft":o==="horizontal"&&(v?N():D());break;case"ArrowUp":o==="vertical"&&N();break}const L=R%C;E[L].ref.current?.focus()});return g.jsx(Fq,{scope:n,disabled:r,direction:i,orientation:o,children:g.jsx(I0.Slot,{scope:n,children:g.jsx(Oe.div,{...c,"data-orientation":o,ref:f,onKeyDown:r?void 0:x})})})}),Hf="AccordionItem",[qq,U0]=Ph(Hf),i2=fe.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,o=Lh(Hf,n),c=Uq(Hf,n),u=z0(n),f=nr(),h=r&&c.value.includes(r)||!1,m=o.disabled||t.disabled;return g.jsx(qq,{scope:n,open:h,disabled:m,triggerId:f,children:g.jsx(t2,{"data-orientation":o.orientation,"data-state":f2(h),...u,...i,ref:e,disabled:m,open:h,onOpenChange:v=>{v?c.onItemOpen(r):c.onItemClose(r)}})})});i2.displayName=Hf;var o2="AccordionHeader",l2=fe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Lh(Va,n),o=U0(o2,n);return g.jsx(Oe.h3,{"data-orientation":i.orientation,"data-state":f2(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:e})});l2.displayName=o2;var Fv="AccordionTrigger",c2=fe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Lh(Va,n),o=U0(Fv,n),c=$q(Fv,n),u=z0(n);return g.jsx(I0.ItemSlot,{scope:n,children:g.jsx(Dq,{"aria-disabled":o.open&&!c.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...r,ref:e})})});c2.displayName=Fv;var u2="AccordionContent",d2=fe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Lh(Va,n),o=U0(u2,n),c=z0(n);return g.jsx(Pq,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...c,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});d2.displayName=u2;function f2(t){return t?"open":"closed"}var Vq=n2,Gq=i2,Yq=l2,h2=c2,p2=d2;const m2=Vq,$0=b.forwardRef(({className:t,...e},n)=>g.jsx(Gq,{ref:n,className:ye("border-b",t),...e}));$0.displayName="AccordionItem";const B0=b.forwardRef(({className:t,children:e,...n},r)=>g.jsx(Yq,{className:"flex",children:g.jsxs(h2,{ref:r,className:ye("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,g.jsx(Jo,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));B0.displayName=h2.displayName;const H0=b.forwardRef(({className:t,children:e,...n},r)=>g.jsx(p2,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:g.jsx("div",{className:ye("pb-4 pt-0",t),children:e})}));H0.displayName=p2.displayName;const g2=b.forwardRef(({className:t,...e},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:ye("w-full caption-bottom text-sm",t),...e})}));g2.displayName="Table";const v2=b.forwardRef(({className:t,...e},n)=>g.jsx("thead",{ref:n,className:ye("[&_tr]:border-b",t),...e}));v2.displayName="TableHeader";const y2=b.forwardRef(({className:t,...e},n)=>g.jsx("tbody",{ref:n,className:ye("[&_tr:last-child]:border-0",t),...e}));y2.displayName="TableBody";const Wq=b.forwardRef(({className:t,...e},n)=>g.jsx("tfoot",{ref:n,className:ye("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...e}));Wq.displayName="TableFooter";const Ic=b.forwardRef(({className:t,...e},n)=>g.jsx("tr",{ref:n,className:ye("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e}));Ic.displayName="TableRow";const zc=b.forwardRef(({className:t,...e},n)=>g.jsx("th",{ref:n,className:ye("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",t),...e}));zc.displayName="TableHead";const b2=b.forwardRef(({className:t,...e},n)=>g.jsx("td",{ref:n,className:ye("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));b2.displayName="TableCell";const Kq=b.forwardRef(({className:t,...e},n)=>g.jsx("caption",{ref:n,className:ye("text-muted-foreground mt-4 text-sm",t),...e}));Kq.displayName="TableCaption";const __=t=>{if(!t)return"-";if(t.anyOf&&Array.isArray(t.anyOf)){const e=t.anyOf.map(r=>r.type?r.type:r.const!==void 0?`"${r.const}"`:"unknown").filter(r=>r!=="unknown"),n=[...new Set(e)];return n.length>0?n.join(" | "):"unknown"}if(t.oneOf&&Array.isArray(t.oneOf)){const e=t.oneOf.map(r=>r.type?r.type:r.const!==void 0?`"${r.const}"`:"unknown").filter(r=>r!=="unknown"),n=[...new Set(e)];return n.length>0?n.join(" | "):"unknown"}return t.type?t.nullable?`${t.type} | null`:t.type:t.enum&&Array.isArray(t.enum)?t.enum.map(e=>`"${e}"`).join(" | "):"unknown"},F0=({schema:t,examples:e,isLoading:n=!1,isError:r=!1,error:i=null,emptyMessage:o="No schema found"})=>{const[c,u]=b.useState(new Set),f=Object.entries(t?.properties||{}).length>0,h=e?Object.keys(e)[0]:void 0,m=h&&e&&"value"in e[h]?e[h].value:void 0,v=S=>{const E=new Set(c);E.has(S)?E.delete(S):E.add(S),u(E)},x=S=>!!(S.type==="object"&&S.properties&&Object.keys(S.properties).length>0||S.type==="array"&&S.items&&typeof S.items=="object"&&!("$ref"in S.items)&&"properties"in S.items&&S.items.properties&&Object.keys(S.items.properties).length>0),w=(S,E,_=1)=>S.type==="object"&&S.properties?Object.entries(S.properties).map(([C,R])=>{const A=`${E}.${C}`,k=("$ref"in R,R),D=!("$ref"in R)&&x(k),N=c.has(A);return g.jsxs(fe.Fragment,{children:[g.jsxs(Ic,{className:ye("border-b border-border smooth-transition bg-muted/20","hover:bg-primary/5"),children:[g.jsx(Pa,{className:"font-mono px-6",style:{paddingLeft:`${24+_*16}px`},children:g.jsxs("div",{className:"flex items-center gap-2",children:[D&&g.jsx(At,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>v(A),children:N?g.jsx(Jo,{className:"h-4 w-4"}):g.jsx(PE,{className:"h-4 w-4"})}),C,S.required?.includes(C)&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}),g.jsx(Pa,{children:g.jsx("div",{className:"px-2 py-1 rounded-full bg-muted/50 text-muted-foreground text-xs font-mono font-medium inline-block",children:"$ref"in R?"reference":__(k)})}),g.jsx(Pa,{className:"text-foreground",children:"$ref"in R?R.$ref:k.description||"-"}),g.jsx(Pa,{children:(()=>{if("$ref"in R)return g.jsx("span",{className:"text-muted-foreground",children:"-"});let L;return m&&typeof m=="object"&&m[E]&&typeof m[E]=="object"&&m[E][C]!==void 0?L=m[E][C]:!("$ref"in k)&&k.examples&&Array.isArray(k.examples)&&k.examples.length>0?L=k.examples[0]:!("$ref"in k)&&k.example!==void 0&&(L=k.example),L!==void 0?typeof L=="object"?g.jsx("code",{className:"text-xs bg-muted/50 px-2 py-1 rounded font-mono whitespace-break-spaces",children:JSON.stringify(L,null,2)}):g.jsx("code",{className:"text-xs bg-muted/50 px-2 py-1 rounded font-mono",children:String(L)}):g.jsx("span",{className:"text-muted-foreground",children:"-"})})()})]}),N&&D&&!("$ref"in R)&&w(k,A,_+1)]},A)}):S.type==="array"&&S.items&&typeof S.items=="object"&&!("$ref"in S.items)&&"properties"in S.items?w(S.items,`${E}[0]`,_):null;return n?g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx(la,{className:"h-6 w-6 animate-spin"})}):r?g.jsxs("div",{className:"flex items-center justify-center py-8 text-red-500",children:["Error: ",i?.message||"Unknown error"]}):t?g.jsx("div",{className:"space-y-6",children:g.jsx("div",{className:"rounded-2xl overflow-hidden slide-up",children:g.jsxs(g2,{className:"table-fixed border-separate border-spacing-0",children:[g.jsxs("colgroup",{children:[g.jsx("col",{style:{width:"30%"}}),g.jsx("col",{style:{width:"20%"}}),g.jsx("col",{style:{width:"25%"}}),g.jsx("col",{style:{width:"35%"}})]}),g.jsx(v2,{children:g.jsxs(Ic,{className:"border-b border-border bg-muted/20",children:[g.jsx(zc,{className:"h-12 text-foreground font-semibold px-6 border-b border-border",children:"Name"}),g.jsx(zc,{className:"h-12 text-foreground font-semibold border-b border-border",children:"Type"}),g.jsx(zc,{className:"h-12 text-foreground font-semibold border-b border-border",children:"Description"}),g.jsx(zc,{className:"h-12 text-foreground font-semibold border-b border-border",children:"Example"})]})}),g.jsxs(y2,{children:[!f&&g.jsx(Ic,{children:g.jsx(Pa,{colSpan:4,className:"text-center py-12",children:g.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[n&&g.jsxs(g.Fragment,{children:[g.jsx(la,{className:"h-6 w-6 animate-spin text-primary"}),g.jsx("p",{className:"text-muted-foreground font-medium",children:"Loading schema..."})]}),r&&g.jsx(g.Fragment,{children:g.jsxs("p",{className:"text-destructive font-medium",children:["Error: ",i?.message||"Unknown error"]})}),!n&&!r&&g.jsx("p",{className:"text-muted-foreground font-medium",children:o})]})})}),f&&Object.entries(t?.properties||{}).map(([S,E])=>{const _=("$ref"in E,E),C=!("$ref"in E)&&x(_),R=c.has(S);return g.jsxs(fe.Fragment,{children:[g.jsxs(Ic,{className:ye("border-b border-border smooth-transition","hover:bg-primary/5"),children:[g.jsx(Pa,{className:"font-mono text-primary font-semibold px-6",children:g.jsxs("div",{className:"flex items-center gap-2",children:[C&&g.jsx(At,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>v(S),children:R?g.jsx(Jo,{className:"h-4 w-4"}):g.jsx(PE,{className:"h-4 w-4"})}),S,t?.required?.includes(S)&&g.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}),g.jsx(Pa,{children:g.jsx("div",{className:" text-xs font-mono font-medium inline-block",children:"$ref"in E?"reference":__(_)})}),g.jsx(Pa,{className:"text-foreground",children:"$ref"in E?E.$ref:_.description||"-"}),g.jsx(Pa,{children:(()=>{if("$ref"in E)return g.jsx("span",{className:"text-muted-foreground",children:"-"});let A;return m&&typeof m=="object"&&m[S]!==void 0?A=m[S]:!("$ref"in _)&&_.examples&&Array.isArray(_.examples)&&_.examples.length>0?A=_.examples[0]:!("$ref"in _)&&_.example!==void 0&&(A=_.example),A!==void 0?typeof A=="object"?g.jsx("pre",{className:"text-xs bg-muted/50 px-2 py-1 rounded font-mono",children:JSON.stringify(A,null,2)}):g.jsx("pre",{className:"text-xs bg-muted/50 px-2 py-1 rounded font-mono",children:String(A)}):g.jsx("span",{className:"text-muted-foreground",children:"-"})})()})]}),R&&C&&!("$ref"in E)&&w(_,S)]},S)})]})]})})}):g.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:o})},Pa=fe.forwardRef(({className:t,...e},n)=>g.jsx(b2,{ref:n,className:ye("py-2 text-sm break-words border-b border-border [tr:last-child_&]:border-b-0",t),...e})),q0=({title:t,children:e,isLoading:n=!1,isError:r=!1,error:i=null,isEmpty:o=!1,emptyMessage:c="No data found",loadingMessage:u=`Loading ${t.toLowerCase()}...`})=>g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-xl font-semibold tracking-tight text-foreground",children:t}),n&&g.jsx("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(la,{className:"h-4 w-4 animate-spin"}),g.jsx("span",{children:u})]})}),r&&g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsxs("div",{className:"text-destructive",children:["Error: ",i?.message||"Unknown error"]})}),!n&&!r&&o&&g.jsx("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:c}),g.jsx("div",{className:"pl-1",children:!n&&!r&&!o&&e})]}),Zq=t=>{const e={},n=[];let r={};return t.forEach(o=>{e[o.name]={...o.schema,description:o.description||o.schema?.description,example:o.example},o.required&&n.push(o.name),o.examples&&Object.keys(o.examples).forEach(c=>{r[c]||(r[c]={value:{}}),"value"in o.examples[c]&&(r[c].value[o.name]=o.examples[c].value)})}),{schema:{type:"object",properties:e,required:n.length>0?n:void 0},examples:Object.keys(r).length>0?r:void 0}},Qq=()=>{const t=yl(),e=t.data?.parameters||[],n=e.length>0,r=e.reduce((c,u)=>(c[u.in]||(c[u.in]=[]),c[u.in].push(u),c),{}),i=["path","query","header","cookie"],o=i.filter(c=>r[c]);return g.jsx(q0,{title:"Parameters",isLoading:t.isLoading,isError:t.isError,error:t.error,isEmpty:!n&&t.isSuccess,emptyMessage:"No parameters found",loadingMessage:"Loading parameters...",children:g.jsx(m2,{type:"multiple",className:"space-y-3",defaultValue:i,children:o.map(c=>{const{schema:u,examples:f}=Zq(r[c]),h={path:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-950 dark:text-blue-300 dark:border-blue-800",query:"bg-green-100 text-green-700 border-green-200 dark:bg-green-950 dark:text-green-300 dark:border-green-800",header:"bg-purple-100 text-purple-700 border-purple-200 dark:bg-purple-950 dark:text-purple-300 dark:border-purple-800",cookie:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:border-orange-800"},m=r[c].length;return g.jsxs($0,{value:c,className:"group border rounded-xl bg-card/50 backdrop-blur-sm",children:[g.jsx(B0,{className:"px-5 py-4 hover:no-underline",children:g.jsxs("div",{className:"flex items-center gap-3 w-full",children:[g.jsx("div",{className:`text-xs px-2 py-1 rounded-full font-bold tracking-wide capitalize ${h[c]||"bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-950 dark:text-gray-300 dark:border-gray-800"}`,children:c}),g.jsxs("span",{className:"text-sm text-muted-foreground group-data-[state=open]:hidden",children:[m," parameter",m!==1?"s":""]})]})}),g.jsx(H0,{className:"px-5 pb-5",children:g.jsx(F0,{schema:u,examples:f,emptyMessage:`No ${c} parameters found`})})]},c)})})})},Xq=()=>{const t=yl(),e=t.data?.requestBody?.content?.["application/json"],n=e?.schema,r=e?.examples,i=!!(n||r);return g.jsx(q0,{title:"Request Body",isLoading:t.isLoading,isError:t.isError,error:t.error,isEmpty:!i&&t.isSuccess,emptyMessage:"No request body schema found",loadingMessage:"Loading request body...",children:g.jsx("div",{className:"border rounded-xl bg-card/50 backdrop-blur-sm p-5",children:g.jsx(F0,{schema:n,examples:r,isLoading:t.isLoading,isError:t.isError,error:t.error,emptyMessage:"No request body schema found"})})})},Jq=()=>{const t=yl(),e=t.data?.responses||{},n=Object.keys(e);return g.jsx(q0,{title:"Responses",isLoading:t.isLoading,isError:t.isError,error:t.error,isEmpty:n.length===0&&t.isSuccess,emptyMessage:"No response schemas found",loadingMessage:"Loading responses...",children:g.jsx(m2,{type:"multiple",defaultValue:n,className:"space-y-3",children:n.map(r=>{const i=e[r],{description:o,content:c}=i||{},u=c?.["application/json"]?.schema,f=c?.["application/json"]?.examples||{},h=v=>v>=200&&v<300?"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900 dark:text-green-300 dark:hover:bg-green-800":v>=300&&v<400?"bg-blue-100 text-blue-700 hover:bg-blue-200 dark:bg-blue-900 dark:text-blue-300 dark:hover:bg-blue-800":v>=400&&v<500?"bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900 dark:text-orange-300 dark:hover:bg-orange-800":v>=500?"bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900 dark:text-red-300 dark:hover:bg-red-800":"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-900 dark:text-gray-300 dark:hover:bg-gray-800",m=v=>v>=200&&v<300?"Success":v>=300&&v<400?"Redirect":v>=400&&v<500?"Client Error":v>=500?"Server Error":"Response";return g.jsxs($0,{value:r,className:"group border rounded-xl bg-card/50 backdrop-blur-sm",children:[g.jsx(B0,{className:"px-5 py-4 hover:no-underline",children:g.jsxs("div",{className:"flex items-center gap-3 w-full",children:[g.jsxs("span",{className:`text-xs px-2 py-1 rounded-full font-bold space-x-2 ${h(+r)}`,children:[g.jsx("span",{children:r}),g.jsx("span",{children:m(+r)})]}),o&&g.jsx("span",{className:"text-sm text-muted-foreground truncate max-w-md group-data-[state=open]:hidden ",children:o})]})}),g.jsxs(H0,{className:"px-5 pb-5 space-y-4",children:[o&&g.jsx("h3",{className:"ml-2 fade-in",children:o}),g.jsx(F0,{schema:u,examples:f,isLoading:t.isLoading,isError:t.isError,error:t.error,emptyMessage:`No response schema found for ${r}`})]})]},r)})})})};function T_(){const{selectedOperation:t}=wu(),e=yl(),n=(e.data?.parameters?.length||0)>0,r=!!e.data?.requestBody,i=Object.keys(e.data?.responses||{}).length>0;return g.jsxs("div",{className:"space-y-6 p-6",children:[g.jsxs("header",{className:"ml-1 border border-border bg-card/50 backdrop-blur-sm rounded-xl p-4 space-y-3",children:[g.jsxs("div",{className:"flex flex-row items-center gap-3",children:[g.jsx(QN,{method:t.method}),g.jsx(Bt,{variant:"h3",className:"font-mono",children:t.path})]}),e.data?.summary&&g.jsx(Bt,{variant:"h4",className:"text-slate-700",children:e.data.summary}),e.data?.description&&g.jsx(Bt,{variant:"small",className:"text-slate-700",children:e.data.description})]}),(n||e.isLoading)&&g.jsx(Qq,{}),(r||e.isLoading)&&g.jsx(Xq,{}),(i||e.isLoading)&&g.jsx(Jq,{})]})}const w2=t2,e9=M0,qv=P0;var t9="Label",x2=b.forwardRef((t,e)=>g.jsx(Oe.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));x2.displayName=t9;var S2=x2;const n9=Us("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),er=b.forwardRef(({className:t,...e},n)=>g.jsx(S2,{ref:n,className:ye(n9(),t),...e}));er.displayName=S2.displayName;var V0="Radio",[r9,E2]=Rn(V0),[a9,s9]=r9(V0),_2=b.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:c,value:u="on",onCheck:f,form:h,...m}=t,[v,x]=b.useState(null),w=Ke(e,_=>x(_)),S=b.useRef(!1),E=v?h||!!v.closest("form"):!0;return g.jsxs(a9,{scope:n,checked:i,disabled:c,children:[g.jsx(Oe.button,{type:"button",role:"radio","aria-checked":i,"data-state":R2(i),"data-disabled":c?"":void 0,disabled:c,value:u,...m,ref:w,onClick:be(t.onClick,_=>{i||f?.(),E&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),E&&g.jsx(i9,{control:v,bubbles:!S.current,name:r,value:u,checked:i,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});_2.displayName=V0;var T2="RadioIndicator",C2=b.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,o=s9(T2,n);return g.jsx(dn,{present:r||o.checked,children:g.jsx(Oe.span,{"data-state":R2(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e})})});C2.displayName=T2;var i9=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=b.useRef(null),c=MO(n),u=uO(e);return b.useEffect(()=>{const f=o.current,h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&v){const x=new Event("click",{bubbles:r});v.call(f,n),f.dispatchEvent(x)}},[c,n,r]),g.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...t.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function R2(t){return t?"checked":"unchecked"}var o9=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G0="RadioGroup",[l9,AV]=Rn(G0,[Fs,E2]),O2=Fs(),A2=E2(),[c9,u9]=l9(G0),N2=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:c=!1,disabled:u=!1,orientation:f,dir:h,loop:m=!0,onValueChange:v,...x}=t,w=O2(n),S=$s(h),[E,_]=$n({prop:o,defaultProp:i,onChange:v});return g.jsx(c9,{scope:n,name:r,required:c,disabled:u,value:E,onValueChange:_,children:g.jsx(Th,{asChild:!0,...w,orientation:f,dir:S,loop:m,children:g.jsx(Oe.div,{role:"radiogroup","aria-required":c,"aria-orientation":f,"data-disabled":u?"":void 0,dir:S,...x,ref:e})})})});N2.displayName=G0;var j2="RadioGroupItem",k2=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,o=u9(j2,n),c=o.disabled||r,u=O2(n),f=A2(n),h=b.useRef(null),m=Ke(e,h),v=o.value===i.value,x=b.useRef(!1);return b.useEffect(()=>{const w=E=>{o9.includes(E.key)&&(x.current=!0)},S=()=>x.current=!1;return document.addEventListener("keydown",w),document.addEventListener("keyup",S),()=>{document.removeEventListener("keydown",w),document.removeEventListener("keyup",S)}},[]),g.jsx(Ch,{asChild:!0,...u,focusable:!c,active:v,children:g.jsx(_2,{disabled:c,required:o.required,checked:v,...f,...i,name:o.name,ref:m,onCheck:()=>o.onValueChange(i.value),onKeyDown:be(w=>{w.key==="Enter"&&w.preventDefault()}),onFocus:be(i.onFocus,()=>{x.current&&h.current?.click()})})})});k2.displayName=j2;var d9="RadioGroupIndicator",M2=b.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=A2(n);return g.jsx(C2,{...i,...r,ref:e})});M2.displayName=d9;var D2=N2,P2=k2,f9=M2;const Vv=b.forwardRef(({className:t,...e},n)=>g.jsx(D2,{className:ye("grid gap-2",t),...e,ref:n}));Vv.displayName=D2.displayName;const Gv=b.forwardRef(({className:t,...e},n)=>g.jsx(P2,{ref:n,className:ye("ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:g.jsx(f9,{className:"flex items-center justify-center",children:g.jsx(D5,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Gv.displayName=P2.displayName;const h9=Us("relative flex overflow-hidden before:content-[''] before:absolute before:inset-[-50%] before:animate-spin",{variants:{variant:{default:"before:bg-gradient-conic",rainbow:"before:bg-gradient-rainbow",primary:"before:bg-gradient-primary"},size:{sm:"w-[120px] h-[120px]",md:"w-[200px] h-[200px]",lg:"w-[300px] h-[300px]",full:"w-full h-full",auto:"w-full h-auto min-h-[50px]",content:"w-fit h-fit"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},shadow:{none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl",dramatic:"shadow-[16px_16px_20px_#0000008c]"}},defaultVariants:{variant:"default",size:"md",rounded:"lg",shadow:"lg"}}),p9=Us("relative flex flex-col flex-1 z-10",{variants:{padding:{none:"p-0",sm:"p-[2px]",md:"p-[3px]",lg:"p-[5px]"},background:{white:"bg-white",dark:"bg-[#1c1c1c] text-white",card:"bg-card text-card-foreground",transparent:"bg-transparent"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}},defaultVariants:{padding:"md",background:"white",rounded:"lg"}}),L2=b.forwardRef(({className:t,variant:e,size:n,rounded:r,shadow:i,contentProps:o,children:c,...u},f)=>g.jsx("div",{className:ye(h9({variant:e,size:n,rounded:r,shadow:i}),t),ref:f,...u,children:g.jsx("div",{className:ye(p9({padding:o?.padding,background:o?.background,rounded:o?.rounded||r}),o?.className),children:c})}));L2.displayName="SpinningBorder";const m9=()=>Fa({mutationFn:u7});function g9(t){return t!==null&&typeof t=="object"&&!("$ref"in t)&&"name"in t&&"in"in t}const v9=t=>{const e={};(t.parameters||[]).forEach(i=>{if(!g9(i))return;const o=i.in,c=i.examples;c&&Object.entries(c).forEach(([u,f])=>{if(!E_(f))return;e[u]||(e[u]={});const h=f.value;switch(o){case"query":e[u].query_params||(e[u].query_params={}),e[u].query_params[i.name]=h;break;case"path":e[u].path_params||(e[u].path_params={}),e[u].path_params[i.name]=h;break;case"header":e[u].header_params||(e[u].header_params={}),e[u].header_params[i.name]=h;break;case"cookie":e[u].cookie_params||(e[u].cookie_params={}),e[u].cookie_params[i.name]=h;break}})});const r=t.requestBody;if(r&&!("$ref"in r)){const i=r.content?.["application/json"];i?.examples&&Object.entries(i.examples).forEach(([o,c])=>{E_(c)&&(e[o]||(e[o]={}),e[o].body={summary:c.summary||"",value:c.value})})}return e},y9=()=>yl({select:v9}),Pg={"header-api-key":{id:"header-api-key",label:"Header API Key",description:"API Key in Header (X-API-KEY)"},"query-api-key":{id:"query-api-key",label:"Query API Key",description:"API Key in Query Parameter (?api_key=...)"},"cookie-api-key":{id:"cookie-api-key",label:"Cookie API Key",description:"API Key in Cookie (session_id)"},"http-basic":{id:"http-basic",label:"HTTP Basic",description:"HTTP Basic Authentication (user:password)"},"http-bearer":{id:"http-bearer",label:"HTTP Bearer",description:"HTTP Bearer Token Authentication"}},I2=e0((t,e)=>({selectedMethod:"http-bearer",authConfigs:{"header-api-key":{key:"X-API-KEY",value:""},"query-api-key":{key:"api_key",value:""},"cookie-api-key":{key:"session_id",value:""},"http-basic":{username:"",password:""},"http-bearer":{token:""}},setSelectedMethod:n=>t({selectedMethod:n}),updateAuthField:(n,r,i)=>t(o=>({authConfigs:{...o.authConfigs,[n]:{...o.authConfigs[n],[r]:i}}})),getAuthForRequest:()=>{const{selectedMethod:n,authConfigs:r}=e(),i=r[n];switch(n){case"header-api-key":return{headers:{[i.key]:i.value}};case"query-api-key":return{query_params:{[i.key]:i.value}};case"cookie-api-key":return{cookie_params:{[i.key]:i.value}};case"http-basic":if(i.username&&i.password)return{headers:{Authorization:`Basic ${btoa(`${i.username}:${i.password}`)}`}};break;case"http-bearer":if(i.token)return{headers:{Authorization:`Bearer ${i.token}`}};break}return{}},get tokenInput(){const{selectedMethod:n,authConfigs:r}=e();return n==="http-bearer"&&r["http-bearer"].token||""},setTokenInput:n=>{const{updateAuthField:r}=e();r("http-bearer","token",n)}}));function b9({method:t,path:e,baseURL:n,queryParams:r,headers:i,body:o,pathParams:c,cookieParams:u}){let f=e;c&&Object.entries(c).forEach(([v,x])=>{f=f.replace(new RegExp(`\\{${v}\\}`,"g"),String(x)).replace(new RegExp(`:${v}\\b`,"g"),String(x))});let h=n?`${n.replace(/\/$/,"")}${f}`:f;if(r&&Object.keys(r).length>0){const v=new URLSearchParams(r).toString();h+=`?${v}`}const m=[`curl -X ${t.toUpperCase()} "${h}"`];if(i)for(const v in i)m.push(`-H "${v}: ${i[v]}"`);if(u&&Object.keys(u).length>0){const v=Object.entries(u).map(([x,w])=>`${x}=${w}`).join("; ");m.push(`--cookie "${v}"`)}return o&&!i?.["Content-Type"]&&!i?.["content-type"]&&m.push('-H "Content-Type: application/json"'),o&&m.push(`-d '${JSON.stringify(o)}'`),m.join(` \\
  `)}const w9=({method:t,path:e,baseURL:n,queryParams:r,headers:i,body:o,pathParams:c,cookieParams:u})=>{const f=b9({method:t,path:e,baseURL:n,queryParams:r,headers:i,body:o,pathParams:c,cookieParams:u}),h=async()=>{try{await navigator.clipboard.writeText(f),gn.success("cURL Copied!")}catch(m){console.error("Failed to copy: ",m)}};return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("header",{className:"flex items-center justify-between",children:[g.jsx(Bt,{variant:"large",className:"text-green-600",children:"cURL Command"}),g.jsxs(At,{size:"sm",variant:"outline",onClick:h,className:"h-8",children:[g.jsx(vR,{className:"h-4 w-4 mr-1"}),"Copy"]})]}),g.jsx("div",{className:"relative rounded-lg border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-900",children:g.jsxs("div",{className:"grid grid-cols-[auto_1fr]",children:[g.jsx("div",{className:"p-4 pr-3 text-xs text-slate-400 dark:text-slate-500 font-mono select-none border-r border-slate-200 dark:border-slate-700",children:f.split(`
`).map((m,v)=>g.jsx("div",{className:"h-5 flex items-center",children:v+1},v))}),g.jsx("div",{className:"p-4 pl-3 overflow-x-auto",children:g.jsx("pre",{className:"font-mono text-sm text-slate-700 dark:text-slate-300 whitespace-pre",children:f})})]})})]})},C_=({baseURL:t})=>{const e=y9(),n=yl(),r=wu(),i=ar(),{mutateAsync:o,isPending:c}=Tq(),{withAuthGuard:u}=b0(),{getAuthForRequest:f}=I2(),h=u(async()=>{await o({path:r.selectedOperation.path,method:r.selectedOperation.method,specId:i.selectedSpecId}),await n.refetch(),E(!0)}),[m,v]=b.useState(void 0),[x,w]=b.useState(void 0),[S,E]=b.useState(!1),[_,C]=b.useState(!1),[R,A]=b.useState(null),[k,D]=b.useState({}),N=M=>k[M]||"{}",L=Object.keys(e.data||{}),Z=m!==void 0?L[m]:void 0,Q=Z&&e.data&&e.data[Z]||null,te=m9(),ce=async()=>{A(null);try{const M=f(),W=(()=>{try{return JSON.parse(N("query_params"))}catch{return{}}})(),X=(()=>{try{return JSON.parse(N("headers"))}catch{return{}}})(),H=(()=>{try{return JSON.parse(N("cookie_params"))}catch{return{}}})(),j=(()=>{try{return JSON.parse(N("path_params"))}catch{return{}}})(),V=(()=>{try{return JSON.parse(N("body"))}catch{return}})(),re={base_url:t,method:r.selectedOperation.method,path:r.selectedOperation.path,input:{headers:{...X,...M.headers||{}},query_params:{...W,...M.query_params||{}},cookie_params:{...H,...M.cookie_params||{}},path_params:j,body:V}},U=await te.mutateAsync(re);A(U)}catch(M){if(M instanceof xv){A(M.response?.data);return}gn.error(M.message)}};b.useEffect(()=>{A(null),v(void 0),w(void 0),D({})},[r.selectedOperation]),b.useEffect(()=>{m===void 0&&e.isSuccess&&Object.keys(e.data).length>0&&(v(0),w(0))},[m,L,e]),b.useEffect(()=>{if(Q&&x!==void 0){const W=Object.keys(Q)[x];if(W){const X=Q;let H;if(W==="body"){const j=X[W];H=typeof j=="object"&&j!==null&&"value"in j?j.value:j||{}}else H=X[W]||{};D(j=>({...j,[W]:JSON.stringify(H,null,2)}))}}},[Q,x]);const se=_||c||S,ge=f(),pe=b.useMemo(()=>{const M=(()=>{try{return JSON.parse(N("query_params"))}catch{return{}}})(),W=(()=>{try{return JSON.parse(N("headers"))}catch{return{}}})(),X=(()=>{try{return JSON.parse(N("path_params"))}catch{return{}}})(),H=(()=>{try{return JSON.parse(N("cookie_params"))}catch{return{}}})(),j=(()=>{try{return JSON.parse(N("body"))}catch{return}})();return g.jsx("div",{className:"mt-6",children:g.jsx(w9,{method:r.selectedOperation.method,path:r.selectedOperation.path,baseURL:t,queryParams:{...M,...ge.query_params||{}},headers:{...W,...ge.headers||{}},pathParams:X,cookieParams:{...H,...ge.cookie_params||{}},body:j})})},[r.selectedOperation.method,r.selectedOperation.path,t,ge,N]),ve=g.jsxs("div",{className:ye("relative space-y-3 transition-all duration-300 bg-white rounded-xl"),onMouseEnter:()=>{E(!1)},children:[L.length===0&&g.jsxs("div",{className:"flex py-8 items-center justify-center border rounded-sm",children:[e.isLoading&&g.jsx(la,{className:"h-4 w-4 animate-spin"}),e.isError&&g.jsxs(Bt,{variant:"small",className:"text-destructive",children:["Error loading test cases: ",e.error?.message]}),e.isSuccess&&g.jsx(Bt,{variant:"small",className:"text-muted-foreground",children:"No test cases found."})]}),e.isSuccess&&g.jsxs(Vv,{onValueChange:M=>{const W=L.findIndex(X=>X===M);W!==-1&&(v(W),w(0)),A(null)},value:Z,children:[L?.map((M,W)=>g.jsx(w2,{open:m===W,children:g.jsxs(er,{htmlFor:M,className:"border flex cursor-pointer flex-col gap-3 rounded-lg px-4 py-3 transition-all duration-200",children:[g.jsxs("div",{className:"flex items-center",children:[g.jsx(Gv,{value:M,id:M}),g.jsx("div",{className:"h-5 w-full flex items-center",children:c?g.jsx(aB,{className:"w-[80%] ml-2 h-3"}):g.jsx(Bt,{variant:"small",className:"ml-2 font-medium",children:M})})]}),g.jsx(qv,{className:"mt-1 max-h-0 overflow-hidden transition-all duration-300 ease-in-out data-[state=open]:max-h-full",children:Q&&m===W&&g.jsxs("div",{className:"space-y-3",children:[g.jsx(Vv,{value:x!==void 0?Object.keys(Q)[x]:void 0,onValueChange:X=>{const H=Object.keys(Q).findIndex(j=>j===X);H!==-1&&w(H)},className:"flex flex-wrap gap-2",children:Object.keys(Q).map(X=>g.jsxs("div",{className:"flex items-center space-x-2 border p-2 rounded-lg",children:[g.jsx(Gv,{value:X,id:X}),g.jsx(er,{htmlFor:X,className:"cursor-pointer",children:g.jsx(Bt,{variant:"small",children:X.replace("_params","")})})]},X))}),x!==void 0&&Q&&g.jsx("div",{className:"space-y-3",children:(()=>{const H=Object.keys(Q)[x];if(["query_params","body","headers","cookie_params","path_params"].includes(H)){const re=de=>{switch(de){case"query_params":return"Query Parameters";case"body":return"Request Body";case"headers":return"Headers";case"cookie_params":return"Cookie Parameters";case"path_params":return"Path Parameters";default:return de.charAt(0).toUpperCase()+de.slice(1)}},U=de=>{switch(de){case"query_params":return"Enter JSON for query parameters";case"body":return"Enter JSON for request body";case"headers":return"Enter JSON for headers";case"cookie_params":return"Enter JSON for cookie parameters";case"path_params":return"Enter JSON for path parameters";default:return`Enter JSON for ${de}`}},ee=H==="body"?"min-h-[150px]":"min-h-[100px]";return g.jsxs("div",{className:"space-y-2",children:[g.jsx(er,{htmlFor:H,className:"text-sm font-medium",children:re(H)}),g.jsx(YN,{id:H,value:N(H),onChange:de=>D(ie=>({...ie,[H]:de.target.value})),className:`mt-2 font-mono text-xs resize-none ${ee} focus-visible:ring-0 focus-visible:border-muted-foreground`,placeholder:U(H)})]})}else return g.jsx("div",{className:"mt-1 rounded-lg border border-slate-200/50 bg-slate-50 p-3 hover:bg-slate-100 dark:border-slate-700/50 dark:bg-slate-900",children:g.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-slate-700 dark:text-slate-300",children:JSON.stringify(Q[H]||{},null,2)})})})()}),R&&g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx(Bt,{variant:"small",className:"font-medium text-slate-700 dark:text-slate-300",children:"Test Result"}),R?.message&&g.jsx("span",{className:"ml-0.5 text-xs text-slate-500 dark:text-slate-400",children:R.message})]}),g.jsx("div",{className:`rounded-lg border p-3 dark:border-slate-700/50 ${te.isSuccess?"border-green-200/50 bg-green-50 hover:bg-green-100":"border-red-200/50 bg-red-50 hover:bg-red-100"}`,children:g.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-slate-700 dark:text-slate-300",children:JSON.stringify(R.data,null,2)})})]})]})})]})},M)),L.length===0&&R&&g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx(Bt,{variant:"small",className:"font-medium text-slate-700 dark:text-slate-300",children:"Test Result"}),R?.message&&g.jsx("span",{className:"ml-0.5 text-xs text-slate-500 dark:text-slate-400",children:R.message})]}),g.jsx("div",{className:`rounded-lg border p-3 dark:border-slate-700/50 ${te.isSuccess?"border-green-200/50 bg-green-50 hover:bg-green-100":"border-red-200/50 bg-red-50 hover:bg-red-100"}`,children:g.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-slate-700 dark:text-slate-300",children:JSON.stringify(R.data,null,2)})})]})]})]});return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("header",{className:"flex items-center justify-between",children:[g.jsx(Bt,{variant:"large",className:"text-blue-600",children:"Test Cases"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsxs(Qy,{children:[g.jsx(Xy,{asChild:!0,children:g.jsx(At,{size:"sm",className:"ai-button bg-zylo text-zylo-foreground hover:bg-zylo/90",onClick:h,disabled:c,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:c?g.jsx(la,{className:"h-4 w-4 animate-spin"}):g.jsx($5,{className:"h-4 w-4"})})}),g.jsx(Jy,{children:g.jsx(Bt,{variant:"small",children:"Generate new test cases."})})]}),g.jsxs(At,{size:"sm",className:"h-8 bg-slate-700 text-white shadow-lg transition-all duration-200 hover:bg-slate-800 hover:shadow-xl",onClick:ce,disabled:te.isPending,children:[te.isPending?g.jsx(la,{className:"h-4 w-4 animate-spin"}):g.jsx(U5,{className:"h-4 w-4"}),"Test"]})]})]}),se?g.jsx(L2,{variant:"default",size:"auto",shadow:"none",rounded:"xl",contentProps:{background:"transparent",padding:"sm",rounded:"xl"},children:ve}):g.jsx("section",{className:"border-[2px] border-transparent",children:ve}),g.jsx(Rf,{}),pe]})};function R_(){const{selectedMethod:t,authConfigs:e,setSelectedMethod:n,updateAuthField:r}=I2(),[i,o]=b.useState(!1),c=e[t],u=()=>{switch(t){case"header-api-key":case"query-api-key":case"cookie-api-key":return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{children:[g.jsx(er,{htmlFor:"auth-key",children:g.jsx(Bt,{variant:"small",children:"Key Name"})}),g.jsx($r,{id:"auth-key",value:c.key||"",onChange:f=>r(t,"key",f.target.value),placeholder:`e.g., ${Pg[t].description.match(/\((.*?)\)/)?.[1]||"key"}`,className:"mt-2"})]}),g.jsxs("div",{children:[g.jsx(er,{htmlFor:"auth-value",children:g.jsx(Bt,{variant:"small",children:"Key Value"})}),g.jsxs("div",{className:"relative",children:[g.jsx($r,{id:"auth-value",type:i?"text":"password",value:c.value||"",onChange:f=>{r(t,"value",f.target.value)},placeholder:"Enter API key value",autoComplete:"new-password","data-form-type":"other","data-lpignore":"true","data-1p-ignore":"true",className:ye("mt-2",c.value?"border-green-500":"border-slate-500")}),g.jsx(At,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-3 hover:bg-transparent",onClick:()=>o(!i),children:i?g.jsx(of,{className:"h-4 w-4 text-slate-500"}):g.jsx(lf,{className:"h-4 w-4 text-slate-500"})})]})]})]});case"http-basic":return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{children:[g.jsx(er,{htmlFor:"auth-username",children:g.jsx(Bt,{variant:"small",children:"Username"})}),g.jsx($r,{id:"auth-username",value:c.username||"",onChange:f=>r(t,"username",f.target.value),placeholder:"Enter username",className:"mt-2"})]}),g.jsxs("div",{children:[g.jsx(er,{htmlFor:"auth-password",children:g.jsx(Bt,{variant:"small",children:"Password"})}),g.jsxs("div",{className:"relative",children:[g.jsx($r,{id:"auth-password",type:i?"text":"password",value:c.password||"",onChange:f=>{r(t,"password",f.target.value)},placeholder:"Enter password",autoComplete:"new-password","data-form-type":"other",className:ye("mt-2",c.password?"border-green-500":"border-slate-500")}),g.jsx(At,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-3 hover:bg-transparent",onClick:()=>o(!i),children:i?g.jsx(of,{className:"h-4 w-4 text-slate-500"}):g.jsx(lf,{className:"h-4 w-4 text-slate-500"})})]})]})]});case"http-bearer":return g.jsxs("div",{children:[g.jsx(er,{htmlFor:"auth-token",children:g.jsx(Bt,{variant:"small",children:"Bearer Token"})}),g.jsxs("div",{className:"relative",children:[g.jsx($r,{id:"auth-token",type:i?"text":"password",value:c.token||"",onChange:f=>{r(t,"token",f.target.value)},placeholder:"Enter bearer token",autoComplete:"new-password",className:ye("mt-2",c.token?"border-green-500":"border-slate-500")}),g.jsx(At,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-3 hover:bg-transparent",onClick:()=>o(!i),children:i?g.jsx(of,{className:"h-4 w-4 text-slate-500"}):g.jsx(lf,{className:"h-4 w-4 text-slate-500"})})]})]});default:return null}};return g.jsxs("section",{className:"space-y-4",children:[g.jsx("header",{children:g.jsx(Bt,{variant:"large",className:"text-foreground",children:"Authentication"})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"w-full",children:[g.jsxs(n0,{value:t,onValueChange:f=>n(f),children:[g.jsx(Eh,{className:"w-full",children:g.jsx(r0,{})}),g.jsx(a0,{children:Object.values(Pg).map(f=>g.jsx(s0,{value:f.id,children:g.jsx(Bt,{variant:"small",className:"font-medium",children:f.label})},f.id))})]}),g.jsx("div",{className:"ml-2 mt-2",children:g.jsx(er,{htmlFor:"auth-method",children:g.jsx(Bt,{variant:"p",className:"text-muted-foreground",children:Pg[t].description})})})]}),g.jsx("div",{className:"ml-2",children:u()})]})]})}function O_({isHubMode:t=!1,selectedOperation:e,customBaseURL:n,isMobile:r=!1}){return r?g.jsx("div",{className:"grid md:hidden h-full w-full",children:g.jsxs(b_,{direction:"vertical",className:"h-full w-full gap-2",children:[g.jsx(Zd,{defaultSize:60,minSize:40,children:g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsx(Lc,{className:"flex-1 h-0 border-white/20 bg-white/40 dark:bg-slate-900/40",children:e?g.jsx("div",{className:"pb-12 max-w-full overflow-hidden",children:g.jsx(T_,{})}):g.jsx("div",{className:"flex h-full items-center justify-center",children:"Select an operation to view details"})}),!t&&g.jsxs("div",{className:"w-full px-6 dark:bg-slate-900/40",children:[g.jsx(S_,{}),g.jsx("div",{className:"h-6 backdrop-blur-xs"})]})]})}),g.jsx(w_,{withHandle:!0}),g.jsx(Zd,{defaultSize:40,minSize:25,maxSize:60,children:g.jsx(Lc,{className:"h-full border-white/20 bg-white/40 backdrop-blur-xl dark:bg-slate-900/40",children:g.jsxs("div",{className:"space-y-6 p-4 py-6",children:[g.jsx(R_,{}),g.jsx(Rf,{}),g.jsx(C_,{baseURL:n})]})})})]})}):g.jsx("div",{className:"hidden md:flex h-full w-full",children:g.jsxs(b_,{direction:"horizontal",className:"h-full w-full gap-2",children:[g.jsx(Zd,{defaultSize:70,minSize:40,children:g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsxs(Lc,{className:"flex-1 h-0 border-white/20 bg-white/40 dark:bg-slate-900/40",children:[e?g.jsx("div",{className:"pb-12 max-w-full overflow-hidden",children:g.jsx(T_,{})}):g.jsx("div",{className:"flex h-full items-center justify-center",children:"Select an operation to view details"}),g.jsx(Bf,{orientation:"horizontal"})]}),!t&&g.jsxs("div",{className:"w-full px-6 dark:bg-slate-900/40",children:[g.jsx(S_,{}),g.jsx("div",{className:"h-6 backdrop-blur-xs"})]})]})}),g.jsx(w_,{}),g.jsx(Zd,{defaultSize:30,minSize:25,maxSize:50,children:g.jsxs(Lc,{className:"h-full border-white/20 bg-white/40 backdrop-blur-xl dark:bg-slate-900/40",children:[e&&g.jsxs("div",{className:"space-y-6 p-4 py-6",children:[g.jsx(R_,{}),g.jsx(Rf,{}),g.jsx(C_,{baseURL:n})]}),g.jsx(Bf,{orientation:"horizontal"})]})})]})})}const x9=({children:t,fallback:e=null,showWhenLoggedOut:n=!1})=>{const r=_y();return n?r?e:t:r?t:e},A_=.6;function S9({size:t=40}){return g.jsx("div",{style:{width:t,height:t},className:"bg-zylo flex items-center justify-center rounded-xl shadow-lg",children:g.jsxs("svg",{style:{width:t*A_,height:t*A_},viewBox:"0 0 177 177",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("path",{d:"M7.00003 76C17.015 111.134 33 145.191 47.7145 165.686C51.2152 170.562 66.8978 168.378 76.3286 165.686C98 159.5 113 152 124.496 145.191C136.542 138.055 155.5 127.5 171.232 102.737C179.091 90.3658 172.641 69.7256 166 56C158.5 40.5 151.5 32.1508 134.5 19.5C117.5 6.84923 85.1286 6.62383 72 11C57 16 41 22 27 29C18.2657 33.3671 -2.28984 43.4094 7.00003 76Z",fill:"white"}),g.jsx("circle",{cx:"114",cy:"59",r:"16",fill:"#0000FF"})]})})}const E9=()=>{const{selectedOperation:t,setSelectedOperation:e}=wu(),{data:n,isLoading:r,isError:i,error:o}=ZN();return g.jsx("div",{children:g.jsx(w2,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(jO,{children:[g.jsx(e9,{asChild:!0,children:g.jsxs(jv,{tooltip:"Collections",className:ye("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0"),children:[g.jsx(I5,{className:"h-4 w-4"}),g.jsx("span",{className:"font-medium",children:"Collections"}),g.jsx(Jo,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),g.jsxs(qv,{children:[r&&g.jsx("div",{className:"flex h-full items-center justify-center py-4",children:g.jsx(la,{className:"h-6 w-6 animate-spin"})}),i&&g.jsxs("div",{className:"py-2 text-sm text-red-500",children:["Error loading operations: ",o?.message]}),!r&&!i&&n?.operationGroups.length===0&&g.jsx("div",{className:"py-2 text-sm text-slate-500 dark:text-slate-400",children:"No test cases found."}),!r&&!i&&n?.operationGroups?.map(c=>g.jsxs(QH,{children:[g.jsx(kO,{className:"text-muted-foreground py-2 text-xs",children:`${c.tag[0].toUpperCase()}${c.tag.slice(1).toLowerCase()}`}),g.jsx(qv,{className:"space-y-1",children:c.operations.map(u=>g.jsxs(XH,{className:`group/item flex cursor-pointer flex-row items-center rounded-md border p-1 transition-all duration-200 hover:bg-neutral-300 ${u.operationId===t?.operationId?"border-neutral-200/50 bg-neutral-200":"border-transparent"}`,onClick:()=>{e(u)},children:[g.jsx("div",{className:"duration-200",children:g.jsx(QN,{method:u.method})}),g.jsx("div",{className:"ml-2 text-xs flex group-hover/item:hidden duration-300",children:u.summary}),g.jsx("div",{className:"ml-2 text-xs hidden group-hover/item:flex font-mono truncate duration-300",children:u.path})]},u.operationId))})]},c.tag))]})]})})})};function _9(){return g.jsxs(HH,{collapsible:"icon",children:[g.jsx(T9,{}),g.jsxs(WH,{children:[g.jsx(E9,{}),g.jsx(jO,{})]}),g.jsx(YH,{children:g.jsx(C9,{})}),g.jsx(qH,{})]})}const T9=()=>{const{open:t}=gu();return g.jsx(GH,{children:g.jsxs("div",{className:ye("flex items-center gap-3",t?"p-2 pt-0":"justify-center pt-1.5"),children:[g.jsx(S9,{size:t?40:24}),t&&g.jsxs("div",{className:"flex flex-col justify-between h-full",children:[g.jsx("div",{className:"text-zylo text-xl/6 font-bold",children:"zylo-docs"}),g.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Upgrade API docs"})]})]})})},C9=()=>{const t=zC(),e=Kr(),{mutateAsync:n}=IC();return g.jsx(KH,{children:g.jsx(kO,{children:g.jsx(eN,{children:g.jsxs(x9,{fallback:g.jsx(Bv,{asChild:!0,children:g.jsxs(jv,{className:"bg-black/80 py-6 text-white hover:bg-black/70",onClick:()=>{e("/signin")},children:[g.jsx(LE,{className:"text-white"}),g.jsx("div",{className:"text-white",children:"Sign In / Sign Up"})]})}),children:[g.jsx(Bv,{asChild:!0,children:g.jsxs(jv,{className:"bg-black/80 py-6 text-white hover:bg-black/70 focus-visible:ring-0",children:[g.jsx(LE,{className:"text-white"}),g.jsx("div",{className:"text-white",children:t?.email}),g.jsx(gR,{className:"ml-auto text-white"})]})}),g.jsx(tN,{side:"top",align:"end",className:"right-0",children:g.jsx(l7,{onClick:()=>{n()},children:g.jsx("div",{children:"Sign Out"})})})]})})})})};function z2(){const{data:t}=ZN(),{selectedSpecId:e}=ar(),{selectedOperation:n,setSelectedOperation:r}=wu(),[i,o]=b.useState(window.location.origin),c=b.useMemo(()=>t?.operationGroups?.flatMap(f=>f.operations)||[],[t?.operationGroups]),u=CI();return b.useEffect(()=>{c.length>0&&r(c[0])},[e,c,r]),b.useEffect(()=>{c.length>0&&!n.operationId&&r(c[0])},[c,n.operationId,r]),g.jsxs(BH,{children:[g.jsx(_9,{}),g.jsxs(VH,{className:ye("flex h-screen flex-1 flex-col smooth-transition","bg-gradient-to-br from-background via-background to-muted/20"),children:[g.jsx("div",{className:"slide-up",children:g.jsx(I7,{isHubMode:u,customBaseURL:i,onBaseURLChange:o})}),g.jsx("div",{className:"hidden md:flex flex-1 min-h-0 fade-in",children:g.jsx(O_,{isHubMode:u,selectedOperation:n,customBaseURL:i,isMobile:!1})}),g.jsx("div",{className:"md:hidden flex-1 min-h-0 fade-in",children:g.jsx(O_,{isHubMode:u,selectedOperation:n,customBaseURL:i,isMobile:!0})})]})]})}function R9(){return g.jsx(z2,{})}const O9=({children:t})=>{const{data:e,isPending:n}=th(),r=e?.session?.user,i=Kr(),o=Wr(),{projectId:c,specId:u}=Z_(),{data:f,isPending:h}=Jf({queryKey:qa.verifyUserAccess(c,u),queryFn:()=>nN.verifyUserAccess(c,u),enabled:!!r&&!!c&&!!u});return b.useEffect(()=>{!n&&!r&&i(`/signin?returnTo=${encodeURIComponent(o.pathname)}`)},[n,r,i,o.pathname]),b.useEffect(()=>{!h&&!f?.success&&i(`/forbidden?returnTo=${encodeURIComponent(o.pathname)}`)},[f,i,o.pathname,h]),f?.success?g.jsx(g.Fragment,{children:t}):null};function A9(){const t=Z_(),{setSelectedSpecId:e,setProjectId:n}=ar();return b.useEffect(()=>{t.projectId&&t.specId&&(n(t.projectId),e(t.specId))},[n,e,t.projectId,t.specId]),g.jsx(O9,{children:g.jsx(z2,{})})}var Y0="Tabs",[N9,NV]=Rn(Y0,[Fs]),U2=Fs(),[j9,W0]=N9(Y0),$2=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=t,m=$s(u),[v,x]=$n({prop:r,onChange:i,defaultProp:o});return g.jsx(j9,{scope:n,baseId:nr(),value:v,onValueChange:x,orientation:c,dir:m,activationMode:f,children:g.jsx(Oe.div,{dir:m,"data-orientation":c,...h,ref:e})})});$2.displayName=Y0;var B2="TabsList",H2=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,o=W0(B2,n),c=U2(n);return g.jsx(Th,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:r,children:g.jsx(Oe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:e})})});H2.displayName=B2;var F2="TabsTrigger",q2=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=t,c=W0(F2,n),u=U2(n),f=Y2(c.baseId,r),h=W2(c.baseId,r),m=r===c.value;return g.jsx(Ch,{asChild:!0,...u,focusable:!i,active:m,children:g.jsx(Oe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:e,onMouseDown:be(t.onMouseDown,v=>{!i&&v.button===0&&v.ctrlKey===!1?c.onValueChange(r):v.preventDefault()}),onKeyDown:be(t.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(r)}),onFocus:be(t.onFocus,()=>{const v=c.activationMode!=="manual";!m&&!i&&v&&c.onValueChange(r)})})})});q2.displayName=F2;var V2="TabsContent",G2=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...c}=t,u=W0(V2,n),f=Y2(u.baseId,r),h=W2(u.baseId,r),m=r===u.value,v=b.useRef(m);return b.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),g.jsx(dn,{present:i||m,children:({present:x})=>g.jsx(Oe.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:h,tabIndex:0,...c,ref:e,style:{...t.style,animationDuration:v.current?"0s":void 0},children:x&&o})})});G2.displayName=V2;function Y2(t,e){return`${t}-trigger-${e}`}function W2(t,e){return`${t}-content-${e}`}var k9=$2,K2=H2,Z2=q2,Q2=G2;const M9=k9,X2=b.forwardRef(({className:t,...e},n)=>g.jsx(K2,{ref:n,className:ye("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",t),...e}));X2.displayName=K2.displayName;const Yv=b.forwardRef(({className:t,...e},n)=>g.jsx(Z2,{ref:n,className:ye("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex cursor-pointer items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",t),...e}));Yv.displayName=Z2.displayName;const D9=b.forwardRef(({className:t,...e},n)=>g.jsx(Q2,{ref:n,className:ye("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",t),...e}));D9.displayName=Q2.displayName;const P9=()=>{const t=Kr(),e=Wr(),[n]=Yf(),r=e.pathname.includes("signup")?"signup":"signin",i=o=>{t(`/${o}?${n.toString()}`)};return g.jsx(M9,{value:r,onValueChange:i,className:"w-full",children:g.jsxs(X2,{className:"mb-6 grid w-full grid-cols-2 bg-slate-100/80 dark:bg-slate-800/80",children:[g.jsx(Yv,{value:"signin",className:"data-[state=active]:bg-zylo transition-all duration-300 disabled:opacity-50 data-[state=active]:text-white",children:"Sign In"}),g.jsx(Yv,{value:"signup",className:"data-[state=active]:bg-zylo transition-all duration-300 data-[state=active]:text-white",children:"Sign Up"})]})})},L9=({height:t="1em",fill:e="currentColor",focusable:n="false",...r})=>g.jsx("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:t,focusable:n,...r,children:g.jsx("path",{fill:e,d:"M256 32C132.3 32 32 134.9 32 261.7c0 101.5 64.2 187.5 153.2 217.9a17.56 17.56 0 0 0 3.8.4c8.3 0 11.5-6.1 11.5-11.4c0-5.5-.2-19.9-.3-39.1a102.4 102.4 0 0 1-22.6 2.7c-43.1 0-52.9-33.5-52.9-33.5c-10.2-26.5-24.9-33.6-24.9-33.6c-19.5-13.7-.1-14.1 1.4-14.1h.1c22.5 2 34.3 23.8 34.3 23.8c11.2 19.6 26.2 25.1 39.6 25.1a63 63 0 0 0 25.6-6c2-14.8 7.8-24.9 14.2-30.7c-49.7-5.8-102-25.5-102-113.5c0-25.1 8.7-45.6 23-61.6c-2.3-5.8-10-29.2 2.2-60.8a18.64 18.64 0 0 1 5-.5c8.1 0 26.4 3.1 56.6 24.1a208.21 208.21 0 0 1 112.2 0c30.2-21 48.5-24.1 56.6-24.1a18.64 18.64 0 0 1 5 .5c12.2 31.6 4.5 55 2.2 60.8c14.3 16.1 23 36.6 23 61.6c0 88.2-52.4 107.6-102.3 113.3c8 7.1 15.2 21.1 15.2 42.5c0 30.7-.3 55.5-.3 63c0 5.4 3.1 11.5 11.4 11.5a19.35 19.35 0 0 0 4-.4C415.9 449.2 480 363.1 480 261.7C480 134.9 379.7 32 256 32"})}),I9=({className:t="",size:e=20})=>g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#fff"}),g.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),g.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),g.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),g.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),z9=({onSocialLogin:t,isLoading:e})=>g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs(At,{variant:"outline",onClick:()=>t("google"),disabled:e,className:"border-slate-200 bg-white/50 hover:bg-white dark:border-slate-700 dark:bg-slate-800/50 dark:hover:bg-slate-800",children:[g.jsx(I9,{size:16}),"Google"]}),g.jsxs(At,{variant:"outline",onClick:()=>t("github"),disabled:e,className:"border-slate-200 bg-white/50 hover:bg-white dark:border-slate-700 dark:bg-slate-800/50 dark:hover:bg-slate-800",children:[g.jsx(L9,{}),"GitHub"]})]});function U9(){return g.jsx("div",{className:"mb-4 flex justify-center",children:g.jsx("div",{className:"bg-zylo flex h-12 w-12 items-center justify-center rounded-xl shadow-lg",children:g.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 177 177",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.jsx("path",{d:"M7.00003 76C17.015 111.134 33 145.191 47.7145 165.686C51.2152 170.562 66.8978 168.378 76.3286 165.686C98 159.5 113 152 124.496 145.191C136.542 138.055 155.5 127.5 171.232 102.737C179.091 90.3658 172.641 69.7256 166 56C158.5 40.5 151.5 32.1508 134.5 19.5C117.5 6.84923 85.1286 6.62383 72 11C57 16 41 22 27 29C18.2657 33.3671 -2.28984 43.4094 7.00003 76Z",fill:"white"}),g.jsx("circle",{cx:"114",cy:"59",r:"16",fill:"#091DFE"})]})})})}const Ff={TERMS_OF_SERVICE:"https://ballistic-place-5e1.notion.site/Terms-of-Service-2393bf1cfda1805990eefb350d9861e3?source=copy_link",PRIVACY_POLICY:"https://ballistic-place-5e1.notion.site/Zylosystems-Privacy-Policy-2393bf1cfda180afa4e0ef42abe8c927"},wr={SIGNIN_EMAIL:"signin-email",SIGNIN_PASSWORD:"signin-password",SIGNUP_EMAIL:"signup-email",SIGNUP_PASSWORD:"signup-password",SIGNUP_CONFIRM_PASSWORD:"signup-confirm-password"},Tc={SIGNIN_SUCCESS:"Login complete!",SIGNIN_ERROR_OAUTH:"Email already registered with OAuth provider.",SIGNUP_SUCCESS:"Account created successfully! Please check your email to verify your account.",SIGNUP_ERROR_OAUTH:"Email already registered with OAuth provider.",PASSWORD_MISMATCH:"Passwords do not match"};function $9(){const t=()=>{window.open(Ff.PRIVACY_POLICY,"_blank")},e=()=>{window.open(Ff.TERMS_OF_SERVICE,"_blank")};return g.jsx("div",{className:"mt-6 text-center text-sm text-slate-500 dark:text-slate-400",children:g.jsxs("p",{children:["By signing in, you agree to our"," ",g.jsx(At,{variant:"link",className:"text-zylo hover:text-zylo h-auto p-0",onClick:e,children:"Terms"})," ","and"," ",g.jsx(At,{variant:"link",className:"text-zylo hover:text-zylo h-auto p-0",onClick:t,children:"Privacy Policy"})]})})}function J2({title:t,description:e,children:n,onSocialLogin:r,isLoading:i,showFooter:o=!0}){const c=Kr();return g.jsxs("div",{className:"flex min-h-screen items-start justify-center bg-slate-50 p-4 dark:bg-slate-950",children:[g.jsx("div",{className:"bg-grid-slate-100 dark:bg-grid-slate-700/25 absolute inset-0 [mask-image:linear-gradient(0deg,white,rgba(255,255,255,0.6))]"}),g.jsxs("div",{className:"relative mt-20 w-full max-w-md",children:[g.jsxs(At,{variant:"ghost",size:"sm",onClick:()=>c("/"),className:"mb-4 hover:bg-white/60 dark:hover:bg-slate-800/60",children:[g.jsx(k5,{className:"mr-2 h-4 w-4"}),"Back to Platform"]}),g.jsxs(i0,{className:"border border-white/20 bg-white/80 shadow-2xl backdrop-blur-xl dark:border-slate-700/20 dark:bg-slate-900/80",children:[g.jsxs(o0,{className:"pb-2 text-center",children:[g.jsx(U9,{}),g.jsx(l0,{className:"text-zylo text-2xl font-bold",children:t}),g.jsx(c0,{className:"text-slate-600 dark:text-slate-400",children:e})]}),g.jsxs(u0,{className:"pt-2",children:[g.jsx(P9,{}),n,g.jsxs("div",{className:"relative my-6",children:[g.jsx(Rf,{className:"bg-slate-200 dark:bg-slate-700"}),g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("span",{className:"bg-white px-3 text-sm text-slate-500 dark:bg-slate-900 dark:text-slate-400",children:"Or continue with"})})]}),g.jsx(z9,{onSocialLogin:r,isLoading:i})]})]}),o&&g.jsx($9,{})]})]})}function Wv({name:t,label:e,placeholder:n,autoComplete:r="current-password",required:i=!1}){const[o,c]=b.useState(!1);return g.jsxs("div",{className:"space-y-2",children:[g.jsx(er,{htmlFor:t,className:"text-sm font-medium",children:e}),g.jsxs("div",{className:"relative",children:[g.jsx($r,{name:t,type:o?"text":"password",placeholder:n,autoComplete:r,className:"focus:border-zylo dark:focus:border-zylo border-slate-200 bg-white/50 pr-10 dark:border-slate-700 dark:bg-slate-800/50",required:i}),g.jsx(At,{type:"button",variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-full px-3 hover:bg-transparent",onClick:()=>c(!o),children:o?g.jsx(of,{className:"h-4 w-4 text-slate-500"}):g.jsx(lf,{className:"h-4 w-4 text-slate-500"})})]})]})}function B9({onSubmit:t,isLoading:e}){return g.jsxs("form",{onSubmit:t,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(er,{htmlFor:wr.SIGNIN_EMAIL,className:"text-sm font-medium",children:"Email"}),g.jsx($r,{name:wr.SIGNIN_EMAIL,type:"email",placeholder:"Enter your email",autoComplete:"username",className:"focus:border-zylo dark:focus:border-zylo border-slate-200 bg-white/50 read-only:cursor-not-allowed read-only:opacity-60 dark:border-slate-700 dark:bg-slate-800/50",required:!0})]}),g.jsx(Wv,{name:wr.SIGNIN_PASSWORD,label:"Password",placeholder:"Enter your password",autoComplete:"current-password",required:!0}),g.jsx(At,{type:"submit",className:"bg-zylo/80 hover:bg-zylo w-full text-white transition-all duration-200",disabled:e,children:e?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),"Signing in..."]}):g.jsxs(g.Fragment,{children:[g.jsx(yR,{className:"mr-2 h-4 w-4"}),"Sign In / Sign Up"]})})]})}function H9({onSubmit:t,isLoading:e,onOpenTermsOfService:n,onOpenPrivacyPolicy:r}){return g.jsxs("form",{onSubmit:t,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(er,{htmlFor:wr.SIGNUP_EMAIL,className:"text-sm font-medium",children:"Email"}),g.jsx($r,{name:wr.SIGNUP_EMAIL,type:"email",placeholder:"Enter your email",autoComplete:"username",className:"focus:border-zylo dark:focus:border-zylo border-slate-200 bg-white/50 read-only:cursor-not-allowed read-only:opacity-60 dark:border-slate-700 dark:bg-slate-800/50",required:!0})]}),g.jsx(Wv,{name:wr.SIGNUP_PASSWORD,label:"Password",placeholder:"Create a password",autoComplete:"new-password",required:!0}),g.jsx(Wv,{name:wr.SIGNUP_CONFIRM_PASSWORD,label:"Confirm Password",placeholder:"Confirm your password",autoComplete:"new-password",required:!0}),g.jsxs("div",{className:"flex items-start space-x-2 text-sm",children:[g.jsx("input",{type:"checkbox",className:"mt-0.5 rounded border-slate-300",required:!0}),g.jsxs("span",{className:"text-slate-600 dark:text-slate-400",children:["I agree to the"," ",g.jsx(At,{variant:"link",className:"text-zylo hover:text-zylo h-auto p-0",onClick:n,children:"Terms of Service"})," ","and"," ",g.jsx(At,{variant:"link",className:"text-zylo hover:text-zylo h-auto p-0",onClick:r,children:"Privacy Policy"})]})]}),g.jsx(At,{type:"submit",className:"w-full bg-green-500 text-white shadow-lg transition-all duration-200 hover:bg-green-600 hover:shadow-xl",disabled:e,children:e?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),"Creating account..."]}):g.jsxs(g.Fragment,{children:[g.jsx(yR,{className:"mr-2 h-4 w-4"}),"Create Account"]})})]})}function ej(t){const e=Kr(),[n]=Yf(),{mutateAsync:r,isPending:i}=c3(),{mutateAsync:o,isPending:c}=l3(),{mutateAsync:u,isPending:f}=u3(),h=i||c||f,m=b.useCallback(w=>{const S=new FormData(w.currentTarget);return t==="signin"?{email:S.get(wr.SIGNIN_EMAIL),password:S.get(wr.SIGNIN_PASSWORD)}:{email:S.get(wr.SIGNUP_EMAIL),password:S.get(wr.SIGNUP_PASSWORD),confirmPassword:S.get(wr.SIGNUP_CONFIRM_PASSWORD)}},[t]),v=b.useCallback(async w=>{w.preventDefault();const{email:S,password:E,confirmPassword:_}=m(w);try{if(t==="signup"){if(E!==_)throw new Error(Tc.PASSWORD_MISMATCH);const{error:C}=await o({email:S,password:E});if(C)throw C;gn.success(Tc.SIGNUP_SUCCESS);const R=n.get("returnTo");e(`/signin${R?`?returnTo=${R}`:""}`)}else{const{error:C}=await r({email:S,password:E});if(C)throw C;gn.success(Tc.SIGNIN_SUCCESS);const R=n.get("returnTo");await Pi.refetchQueries({queryKey:qa.session()}),e(R||"/")}}catch(C){if(C instanceof jC&&(C.message==="Invalid login credentials"||C.message==="User already registered")){const k=t==="signin"?Tc.SIGNIN_ERROR_OAUTH:Tc.SIGNUP_ERROR_OAUTH;gn.error(`Failed to ${t==="signin"?"login":"sign up"}: ${k}`)}else gn.error(`Failed to ${t==="signin"?"login":"sign up"}: ${C.message}`)}},[t,m,r,o,n,e]),x=b.useCallback(async w=>{try{const S=n.get("returnTo")||void 0,{error:E}=await u({provider:w,returnTo:S});if(E)throw E}catch(S){const E=t==="signin"?"login":"sign up";gn.error(`Failed to ${E} with ${w}: ${S.message}`)}},[u,n,t]);return{handleSubmit:v,handleSocialLogin:x,isLoading:h}}function F9(){const t=b.useCallback(()=>{window.open(Ff.PRIVACY_POLICY,"_blank")},[]),e=b.useCallback(()=>{window.open(Ff.TERMS_OF_SERVICE,"_blank")},[]);return{openPrivacyPolicy:t,openTermsOfService:e}}function q9(){const{handleSubmit:t,handleSocialLogin:e,isLoading:n}=ej("signin");return g.jsx(J2,{title:"Welcome to Zylo Docs",description:"Sign in to your account to continue",onSocialLogin:e,isLoading:n,children:g.jsx(B9,{onSubmit:t,isLoading:n})})}function V9(){const{handleSubmit:t,handleSocialLogin:e,isLoading:n}=ej("signup"),{openTermsOfService:r,openPrivacyPolicy:i}=F9();return g.jsx(J2,{title:"Welcome to Zylo Docs",description:"Enter your email below to create your account",onSocialLogin:e,isLoading:n,children:g.jsx(H9,{onSubmit:t,isLoading:n,onOpenTermsOfService:r,onOpenPrivacyPolicy:i})})}const G9=[{element:g.jsx(_5,{}),children:[{path:"/",element:g.jsx(R9,{})},{path:"/projects/:projectId/specs/:specId",element:g.jsx(A9,{})},{path:"/signin",element:g.jsx(q9,{})},{path:"/signup",element:g.jsx(V9,{})},{path:"/auth/callback",element:g.jsx(d3,{})},{path:"/auth/verify",element:g.jsx(w5,{})},{path:"/forbidden",element:g.jsx(x5,{})},{path:"*",element:g.jsx(T5,{})}]}],Y9=mP(G9,{basename:"/zylo-docs"});Ot.defaultLocale="en-US";Ot.defaultZone=Intl.DateTimeFormat().resolvedOptions().timeZone;function W9(){document.title="Zylo Docs UI"}async function K9(){}const Z9=document.getElementById("root");W9();K9().then(()=>{yM.createRoot(Z9).render(g.jsx(RP,{router:Y9}))});
