database-studio 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,4 +6,4 @@ function Ig(n,o){for(var s=0;s<o.length;s++){const l=o[s];if(typeof l!="string"&
6
6
  `).replace(Gm,"")}function Ss(e,t,r){if(t=yc(t),yc(e)!==t&&r)throw Error(s(425))}function Es(){}var fl=null,pl=null;function hl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ml=typeof setTimeout=="function"?setTimeout:void 0,qm=typeof clearTimeout=="function"?clearTimeout:void 0,wc=typeof Promise=="function"?Promise:void 0,Xm=typeof queueMicrotask=="function"?queueMicrotask:typeof wc<"u"?function(e){return wc.resolve(null).then(e).catch(Zm)}:ml;function Zm(e){setTimeout(function(){throw e})}function gl(e,t){var r=t,i=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(i===0){e.removeChild(a),uo(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=a}while(r);uo(t)}function On(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Pr=Math.random().toString(36).slice(2),en="__reactFiber$"+Pr,So="__reactProps$"+Pr,cn="__reactContainer$"+Pr,vl="__reactEvents$"+Pr,Jm="__reactListeners$"+Pr,eg="__reactHandles$"+Pr;function Jn(e){var t=e[en];if(t)return t;for(var r=e.parentNode;r;){if(t=r[cn]||r[en]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=xc(e);e!==null;){if(r=e[en])return r;e=xc(e)}return t}e=r,r=e.parentNode}return null}function Eo(e){return e=e[en]||e[cn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function bs(e){return e[So]||null}var yl=[],Tr=-1;function _n(e){return{current:e}}function Oe(e){0>Tr||(e.current=yl[Tr],yl[Tr]=null,Tr--)}function Te(e,t){Tr++,yl[Tr]=e.current,e.current=t}var jn={},Xe=_n(jn),lt=_n(!1),er=jn;function Nr(e,t){var r=e.type.contextTypes;if(!r)return jn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in r)a[c]=t[c];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function at(e){return e=e.childContextTypes,e!=null}function Cs(){Oe(lt),Oe(Xe)}function Sc(e,t,r){if(Xe.current!==jn)throw Error(s(168));Te(Xe,t),Te(lt,r)}function Ec(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(s(108,le(e)||"Unknown",a));return V({},r,i)}function ks(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jn,er=Xe.current,Te(Xe,e),Te(lt,lt.current),!0}function bc(e,t,r){var i=e.stateNode;if(!i)throw Error(s(169));r?(e=Ec(e,t,er),i.__reactInternalMemoizedMergedChildContext=e,Oe(lt),Oe(Xe),Te(Xe,e)):Oe(lt),Te(lt,r)}var dn=null,Ps=!1,wl=!1;function Cc(e){dn===null?dn=[e]:dn.push(e)}function tg(e){Ps=!0,Cc(e)}function An(){if(!wl&&dn!==null){wl=!0;var e=0,t=Pe;try{var r=dn;for(Pe=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}dn=null,Ps=!1}catch(a){throw dn!==null&&(dn=dn.slice(e+1)),Pu(Bi,An),a}finally{Pe=t,wl=!1}}return null}var Or=[],_r=0,Rs=null,Ts=0,Rt=[],Tt=0,tr=null,fn=1,pn="";function nr(e,t){Or[_r++]=Ts,Or[_r++]=Rs,Rs=e,Ts=t}function kc(e,t,r){Rt[Tt++]=fn,Rt[Tt++]=pn,Rt[Tt++]=tr,tr=e;var i=fn;e=pn;var a=32-It(i)-1;i&=~(1<<a),r+=1;var c=32-It(t)+a;if(30<c){var h=a-a%5;c=(i&(1<<h)-1).toString(32),i>>=h,a-=h,fn=1<<32-It(t)+a|r<<a|i,pn=c+e}else fn=1<<c|r<<a|i,pn=e}function xl(e){e.return!==null&&(nr(e,1),kc(e,1,0))}function Sl(e){for(;e===Rs;)Rs=Or[--_r],Or[_r]=null,Ts=Or[--_r],Or[_r]=null;for(;e===tr;)tr=Rt[--Tt],Rt[Tt]=null,pn=Rt[--Tt],Rt[Tt]=null,fn=Rt[--Tt],Rt[Tt]=null}var wt=null,xt=null,je=!1,Ft=null;function Pc(e,t){var r=jt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Rc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wt=e,xt=On(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wt=e,xt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=tr!==null?{id:fn,overflow:pn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=jt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,wt=e,xt=null,!0):!1;default:return!1}}function El(e){return(e.mode&1)!==0&&(e.flags&128)===0}function bl(e){if(je){var t=xt;if(t){var r=t;if(!Rc(e,t)){if(El(e))throw Error(s(418));t=On(r.nextSibling);var i=wt;t&&Rc(e,t)?Pc(i,r):(e.flags=e.flags&-4097|2,je=!1,wt=e)}}else{if(El(e))throw Error(s(418));e.flags=e.flags&-4097|2,je=!1,wt=e}}}function Tc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wt=e}function Ns(e){if(e!==wt)return!1;if(!je)return Tc(e),je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!hl(e.type,e.memoizedProps)),t&&(t=xt)){if(El(e))throw Nc(),Error(s(418));for(;t;)Pc(e,t),t=On(t.nextSibling)}if(Tc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){xt=On(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}xt=null}}else xt=wt?On(e.stateNode.nextSibling):null;return!0}function Nc(){for(var e=xt;e;)e=On(e.nextSibling)}function jr(){xt=wt=null,je=!1}function Cl(e){Ft===null?Ft=[e]:Ft.push(e)}var ng=z.ReactCurrentBatchConfig;function bo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(s(309));var i=r.stateNode}if(!i)throw Error(s(147,e));var a=i,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(h){var S=a.refs;h===null?delete S[c]:S[c]=h},t._stringRef=c,t)}if(typeof e!="string")throw Error(s(284));if(!r._owner)throw Error(s(290,e))}return e}function Os(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Oc(e){var t=e._init;return t(e._payload)}function _c(e){function t(O,R){if(e){var _=O.deletions;_===null?(O.deletions=[R],O.flags|=16):_.push(R)}}function r(O,R){if(!e)return null;for(;R!==null;)t(O,R),R=R.sibling;return null}function i(O,R){for(O=new Map;R!==null;)R.key!==null?O.set(R.key,R):O.set(R.index,R),R=R.sibling;return O}function a(O,R){return O=Bn(O,R),O.index=0,O.sibling=null,O}function c(O,R,_){return O.index=_,e?(_=O.alternate,_!==null?(_=_.index,_<R?(O.flags|=2,R):_):(O.flags|=2,R)):(O.flags|=1048576,R)}function h(O){return e&&O.alternate===null&&(O.flags|=2),O}function S(O,R,_,H){return R===null||R.tag!==6?(R=ma(_,O.mode,H),R.return=O,R):(R=a(R,_),R.return=O,R)}function P(O,R,_,H){var se=_.type;return se===K?B(O,R,_.props.children,H,_.key):R!==null&&(R.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===ie&&Oc(se)===R.type)?(H=a(R,_.props),H.ref=bo(O,R,_),H.return=O,H):(H=ei(_.type,_.key,_.props,null,O.mode,H),H.ref=bo(O,R,_),H.return=O,H)}function j(O,R,_,H){return R===null||R.tag!==4||R.stateNode.containerInfo!==_.containerInfo||R.stateNode.implementation!==_.implementation?(R=ga(_,O.mode,H),R.return=O,R):(R=a(R,_.children||[]),R.return=O,R)}function B(O,R,_,H,se){return R===null||R.tag!==7?(R=cr(_,O.mode,H,se),R.return=O,R):(R=a(R,_),R.return=O,R)}function $(O,R,_){if(typeof R=="string"&&R!==""||typeof R=="number")return R=ma(""+R,O.mode,_),R.return=O,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Q:return _=ei(R.type,R.key,R.props,null,O.mode,_),_.ref=bo(O,null,R),_.return=O,_;case W:return R=ga(R,O.mode,_),R.return=O,R;case ie:var H=R._init;return $(O,H(R._payload),_)}if(En(R)||F(R))return R=cr(R,O.mode,_,null),R.return=O,R;Os(O,R)}return null}function U(O,R,_,H){var se=R!==null?R.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return se!==null?null:S(O,R,""+_,H);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Q:return _.key===se?P(O,R,_,H):null;case W:return _.key===se?j(O,R,_,H):null;case ie:return se=_._init,U(O,R,se(_._payload),H)}if(En(_)||F(_))return se!==null?null:B(O,R,_,H,null);Os(O,_)}return null}function Z(O,R,_,H,se){if(typeof H=="string"&&H!==""||typeof H=="number")return O=O.get(_)||null,S(R,O,""+H,se);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case Q:return O=O.get(H.key===null?_:H.key)||null,P(R,O,H,se);case W:return O=O.get(H.key===null?_:H.key)||null,j(R,O,H,se);case ie:var ae=H._init;return Z(O,R,_,ae(H._payload),se)}if(En(H)||F(H))return O=O.get(_)||null,B(R,O,H,se,null);Os(R,H)}return null}function te(O,R,_,H){for(var se=null,ae=null,ue=R,he=R=0,Qe=null;ue!==null&&he<_.length;he++){ue.index>he?(Qe=ue,ue=null):Qe=ue.sibling;var Ce=U(O,ue,_[he],H);if(Ce===null){ue===null&&(ue=Qe);break}e&&ue&&Ce.alternate===null&&t(O,ue),R=c(Ce,R,he),ae===null?se=Ce:ae.sibling=Ce,ae=Ce,ue=Qe}if(he===_.length)return r(O,ue),je&&nr(O,he),se;if(ue===null){for(;he<_.length;he++)ue=$(O,_[he],H),ue!==null&&(R=c(ue,R,he),ae===null?se=ue:ae.sibling=ue,ae=ue);return je&&nr(O,he),se}for(ue=i(O,ue);he<_.length;he++)Qe=Z(ue,O,he,_[he],H),Qe!==null&&(e&&Qe.alternate!==null&&ue.delete(Qe.key===null?he:Qe.key),R=c(Qe,R,he),ae===null?se=Qe:ae.sibling=Qe,ae=Qe);return e&&ue.forEach(function($n){return t(O,$n)}),je&&nr(O,he),se}function ne(O,R,_,H){var se=F(_);if(typeof se!="function")throw Error(s(150));if(_=se.call(_),_==null)throw Error(s(151));for(var ae=se=null,ue=R,he=R=0,Qe=null,Ce=_.next();ue!==null&&!Ce.done;he++,Ce=_.next()){ue.index>he?(Qe=ue,ue=null):Qe=ue.sibling;var $n=U(O,ue,Ce.value,H);if($n===null){ue===null&&(ue=Qe);break}e&&ue&&$n.alternate===null&&t(O,ue),R=c($n,R,he),ae===null?se=$n:ae.sibling=$n,ae=$n,ue=Qe}if(Ce.done)return r(O,ue),je&&nr(O,he),se;if(ue===null){for(;!Ce.done;he++,Ce=_.next())Ce=$(O,Ce.value,H),Ce!==null&&(R=c(Ce,R,he),ae===null?se=Ce:ae.sibling=Ce,ae=Ce);return je&&nr(O,he),se}for(ue=i(O,ue);!Ce.done;he++,Ce=_.next())Ce=Z(ue,O,he,Ce.value,H),Ce!==null&&(e&&Ce.alternate!==null&&ue.delete(Ce.key===null?he:Ce.key),R=c(Ce,R,he),ae===null?se=Ce:ae.sibling=Ce,ae=Ce);return e&&ue.forEach(function(Lg){return t(O,Lg)}),je&&nr(O,he),se}function Fe(O,R,_,H){if(typeof _=="object"&&_!==null&&_.type===K&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Q:e:{for(var se=_.key,ae=R;ae!==null;){if(ae.key===se){if(se=_.type,se===K){if(ae.tag===7){r(O,ae.sibling),R=a(ae,_.props.children),R.return=O,O=R;break e}}else if(ae.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===ie&&Oc(se)===ae.type){r(O,ae.sibling),R=a(ae,_.props),R.ref=bo(O,ae,_),R.return=O,O=R;break e}r(O,ae);break}else t(O,ae);ae=ae.sibling}_.type===K?(R=cr(_.props.children,O.mode,H,_.key),R.return=O,O=R):(H=ei(_.type,_.key,_.props,null,O.mode,H),H.ref=bo(O,R,_),H.return=O,O=H)}return h(O);case W:e:{for(ae=_.key;R!==null;){if(R.key===ae)if(R.tag===4&&R.stateNode.containerInfo===_.containerInfo&&R.stateNode.implementation===_.implementation){r(O,R.sibling),R=a(R,_.children||[]),R.return=O,O=R;break e}else{r(O,R);break}else t(O,R);R=R.sibling}R=ga(_,O.mode,H),R.return=O,O=R}return h(O);case ie:return ae=_._init,Fe(O,R,ae(_._payload),H)}if(En(_))return te(O,R,_,H);if(F(_))return ne(O,R,_,H);Os(O,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,R!==null&&R.tag===6?(r(O,R.sibling),R=a(R,_),R.return=O,O=R):(r(O,R),R=ma(_,O.mode,H),R.return=O,O=R),h(O)):r(O,R)}return Fe}var Ar=_c(!0),jc=_c(!1),_s=_n(null),js=null,Mr=null,kl=null;function Pl(){kl=Mr=js=null}function Rl(e){var t=_s.current;Oe(_s),e._currentValue=t}function Tl(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Lr(e,t){js=e,kl=Mr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ut=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(kl!==e)if(e={context:e,memoizedValue:t,next:null},Mr===null){if(js===null)throw Error(s(308));Mr=e,js.dependencies={lanes:0,firstContext:e}}else Mr=Mr.next=e;return t}var rr=null;function Nl(e){rr===null?rr=[e]:rr.push(e)}function Ac(e,t,r,i){var a=t.interleaved;return a===null?(r.next=r,Nl(t)):(r.next=a.next,a.next=r),t.interleaved=r,hn(e,i)}function hn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Mn=!1;function Ol(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ln(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ee&2)!==0){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,hn(e,r)}return a=i.interleaved,a===null?(t.next=t,Nl(i)):(t.next=a.next,a.next=t),i.interleaved=t,hn(e,r)}function As(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Wi(e,r)}}function Lc(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var a=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var h={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?a=c=h:c=c.next=h,r=r.next}while(r!==null);c===null?a=c=t:c=c.next=t}else a=c=t;r={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ms(e,t,r,i){var a=e.updateQueue;Mn=!1;var c=a.firstBaseUpdate,h=a.lastBaseUpdate,S=a.shared.pending;if(S!==null){a.shared.pending=null;var P=S,j=P.next;P.next=null,h===null?c=j:h.next=j,h=P;var B=e.alternate;B!==null&&(B=B.updateQueue,S=B.lastBaseUpdate,S!==h&&(S===null?B.firstBaseUpdate=j:S.next=j,B.lastBaseUpdate=P))}if(c!==null){var $=a.baseState;h=0,B=j=P=null,S=c;do{var U=S.lane,Z=S.eventTime;if((i&U)===U){B!==null&&(B=B.next={eventTime:Z,lane:0,tag:S.tag,payload:S.payload,callback:S.callback,next:null});e:{var te=e,ne=S;switch(U=t,Z=r,ne.tag){case 1:if(te=ne.payload,typeof te=="function"){$=te.call(Z,$,U);break e}$=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ne.payload,U=typeof te=="function"?te.call(Z,$,U):te,U==null)break e;$=V({},$,U);break e;case 2:Mn=!0}}S.callback!==null&&S.lane!==0&&(e.flags|=64,U=a.effects,U===null?a.effects=[S]:U.push(S))}else Z={eventTime:Z,lane:U,tag:S.tag,payload:S.payload,callback:S.callback,next:null},B===null?(j=B=Z,P=$):B=B.next=Z,h|=U;if(S=S.next,S===null){if(S=a.shared.pending,S===null)break;U=S,S=U.next,U.next=null,a.lastBaseUpdate=U,a.shared.pending=null}}while(!0);if(B===null&&(P=$),a.baseState=P,a.firstBaseUpdate=j,a.lastBaseUpdate=B,t=a.shared.interleaved,t!==null){a=t;do h|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);ir|=h,e.lanes=h,e.memoizedState=$}}function Ic(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=r,typeof a!="function")throw Error(s(191,a));a.call(i)}}}var Co={},tn=_n(Co),ko=_n(Co),Po=_n(Co);function or(e){if(e===Co)throw Error(s(174));return e}function _l(e,t){switch(Te(Po,t),Te(ko,e),Te(tn,Co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Yt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Yt(t,e)}Oe(tn),Te(tn,t)}function Ir(){Oe(tn),Oe(ko),Oe(Po)}function Dc(e){or(Po.current);var t=or(tn.current),r=Yt(t,e.type);t!==r&&(Te(ko,e),Te(tn,r))}function jl(e){ko.current===e&&(Oe(tn),Oe(ko))}var Ae=_n(0);function Ls(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Al=[];function Ml(){for(var e=0;e<Al.length;e++)Al[e]._workInProgressVersionPrimary=null;Al.length=0}var Is=z.ReactCurrentDispatcher,Ll=z.ReactCurrentBatchConfig,sr=0,Me=null,Be=null,We=null,Ds=!1,Ro=!1,To=0,rg=0;function Ze(){throw Error(s(321))}function Il(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Dt(e[r],t[r]))return!1;return!0}function Dl(e,t,r,i,a,c){if(sr=c,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Is.current=e===null||e.memoizedState===null?lg:ag,e=r(i,a),Ro){c=0;do{if(Ro=!1,To=0,25<=c)throw Error(s(301));c+=1,We=Be=null,t.updateQueue=null,Is.current=ug,e=r(i,a)}while(Ro)}if(Is.current=Us,t=Be!==null&&Be.next!==null,sr=0,We=Be=Me=null,Ds=!1,t)throw Error(s(300));return e}function Fl(){var e=To!==0;return To=0,e}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Me.memoizedState=We=e:We=We.next=e,We}function Ot(){if(Be===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=We===null?Me.memoizedState:We.next;if(t!==null)We=t,Be=e;else{if(e===null)throw Error(s(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},We===null?Me.memoizedState=We=e:We=We.next=e}return We}function No(e,t){return typeof t=="function"?t(e):t}function zl(e){var t=Ot(),r=t.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=Be,a=i.baseQueue,c=r.pending;if(c!==null){if(a!==null){var h=a.next;a.next=c.next,c.next=h}i.baseQueue=a=c,r.pending=null}if(a!==null){c=a.next,i=i.baseState;var S=h=null,P=null,j=c;do{var B=j.lane;if((sr&B)===B)P!==null&&(P=P.next={lane:0,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),i=j.hasEagerState?j.eagerState:e(i,j.action);else{var $={lane:B,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null};P===null?(S=P=$,h=i):P=P.next=$,Me.lanes|=B,ir|=B}j=j.next}while(j!==null&&j!==c);P===null?h=i:P.next=S,Dt(i,t.memoizedState)||(ut=!0),t.memoizedState=i,t.baseState=h,t.baseQueue=P,r.lastRenderedState=i}if(e=r.interleaved,e!==null){a=e;do c=a.lane,Me.lanes|=c,ir|=c,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ul(e){var t=Ot(),r=t.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=r.dispatch,a=r.pending,c=t.memoizedState;if(a!==null){r.pending=null;var h=a=a.next;do c=e(c,h.action),h=h.next;while(h!==a);Dt(c,t.memoizedState)||(ut=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),r.lastRenderedState=c}return[c,i]}function Fc(){}function zc(e,t){var r=Me,i=Ot(),a=t(),c=!Dt(i.memoizedState,a);if(c&&(i.memoizedState=a,ut=!0),i=i.queue,Bl($c.bind(null,r,i,e),[e]),i.getSnapshot!==t||c||We!==null&&We.memoizedState.tag&1){if(r.flags|=2048,Oo(9,Bc.bind(null,r,i,a,t),void 0,null),He===null)throw Error(s(349));(sr&30)!==0||Uc(r,t,a)}return a}function Uc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Bc(e,t,r,i){t.value=r,t.getSnapshot=i,Vc(t)&&Wc(e)}function $c(e,t,r){return r(function(){Vc(t)&&Wc(e)})}function Vc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Dt(e,r)}catch{return!0}}function Wc(e){var t=hn(e,1);t!==null&&$t(t,e,1,-1)}function Hc(e){var t=nn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t.queue=e,e=e.dispatch=ig.bind(null,Me,e),[t.memoizedState,e]}function Oo(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Qc(){return Ot().memoizedState}function Fs(e,t,r,i){var a=nn();Me.flags|=e,a.memoizedState=Oo(1|t,r,void 0,i===void 0?null:i)}function zs(e,t,r,i){var a=Ot();i=i===void 0?null:i;var c=void 0;if(Be!==null){var h=Be.memoizedState;if(c=h.destroy,i!==null&&Il(i,h.deps)){a.memoizedState=Oo(t,r,c,i);return}}Me.flags|=e,a.memoizedState=Oo(1|t,r,c,i)}function Kc(e,t){return Fs(8390656,8,e,t)}function Bl(e,t){return zs(2048,8,e,t)}function Yc(e,t){return zs(4,2,e,t)}function Gc(e,t){return zs(4,4,e,t)}function qc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xc(e,t,r){return r=r!=null?r.concat([e]):null,zs(4,4,qc.bind(null,t,e),r)}function $l(){}function Zc(e,t){var r=Ot();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Il(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Jc(e,t){var r=Ot();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Il(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function ed(e,t,r){return(sr&21)===0?(e.baseState&&(e.baseState=!1,ut=!0),e.memoizedState=r):(Dt(r,t)||(r=Ou(),Me.lanes|=r,ir|=r,e.baseState=!0),t)}function og(e,t){var r=Pe;Pe=r!==0&&4>r?r:4,e(!0);var i=Ll.transition;Ll.transition={};try{e(!1),t()}finally{Pe=r,Ll.transition=i}}function td(){return Ot().memoizedState}function sg(e,t,r){var i=zn(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},nd(e))rd(t,r);else if(r=Ac(e,t,r,i),r!==null){var a=ot();$t(r,e,i,a),od(r,t,i)}}function ig(e,t,r){var i=zn(e),a={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(nd(e))rd(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,S=c(h,r);if(a.hasEagerState=!0,a.eagerState=S,Dt(S,h)){var P=t.interleaved;P===null?(a.next=a,Nl(t)):(a.next=P.next,P.next=a),t.interleaved=a;return}}catch{}r=Ac(e,t,a,i),r!==null&&(a=ot(),$t(r,e,i,a),od(r,t,i))}}function nd(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function rd(e,t){Ro=Ds=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function od(e,t,r){if((r&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Wi(e,r)}}var Us={readContext:Nt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},lg={readContext:Nt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:Kc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Fs(4194308,4,qc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fs(4,2,e,t)},useMemo:function(e,t){var r=nn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=nn();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=sg.bind(null,Me,e),[i.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:Hc,useDebugValue:$l,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=Hc(!1),t=e[0];return e=og.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=Me,a=nn();if(je){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),He===null)throw Error(s(349));(sr&30)!==0||Uc(i,t,r)}a.memoizedState=r;var c={value:r,getSnapshot:t};return a.queue=c,Kc($c.bind(null,i,c,e),[e]),i.flags|=2048,Oo(9,Bc.bind(null,i,c,r,t),void 0,null),r},useId:function(){var e=nn(),t=He.identifierPrefix;if(je){var r=pn,i=fn;r=(i&~(1<<32-It(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=To++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=rg++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ag={readContext:Nt,useCallback:Zc,useContext:Nt,useEffect:Bl,useImperativeHandle:Xc,useInsertionEffect:Yc,useLayoutEffect:Gc,useMemo:Jc,useReducer:zl,useRef:Qc,useState:function(){return zl(No)},useDebugValue:$l,useDeferredValue:function(e){var t=Ot();return ed(t,Be.memoizedState,e)},useTransition:function(){var e=zl(No)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:Fc,useSyncExternalStore:zc,useId:td,unstable_isNewReconciler:!1},ug={readContext:Nt,useCallback:Zc,useContext:Nt,useEffect:Bl,useImperativeHandle:Xc,useInsertionEffect:Yc,useLayoutEffect:Gc,useMemo:Jc,useReducer:Ul,useRef:Qc,useState:function(){return Ul(No)},useDebugValue:$l,useDeferredValue:function(e){var t=Ot();return Be===null?t.memoizedState=e:ed(t,Be.memoizedState,e)},useTransition:function(){var e=Ul(No)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:Fc,useSyncExternalStore:zc,useId:td,unstable_isNewReconciler:!1};function zt(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Vl(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:V({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Bs={isMounted:function(e){return(e=e._reactInternals)?Zn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=ot(),a=zn(e),c=mn(i,a);c.payload=t,r!=null&&(c.callback=r),t=Ln(e,c,a),t!==null&&($t(t,e,a,i),As(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=ot(),a=zn(e),c=mn(i,a);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Ln(e,c,a),t!==null&&($t(t,e,a,i),As(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ot(),i=zn(e),a=mn(r,i);a.tag=2,t!=null&&(a.callback=t),t=Ln(e,a,i),t!==null&&($t(t,e,i,r),As(t,e,i))}};function sd(e,t,r,i,a,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!go(r,i)||!go(a,c):!0}function id(e,t,r){var i=!1,a=jn,c=t.contextType;return typeof c=="object"&&c!==null?c=Nt(c):(a=at(t)?er:Xe.current,i=t.contextTypes,c=(i=i!=null)?Nr(e,a):jn),t=new t(r,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bs,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function ld(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Wl(e,t,r,i){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Ol(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=Nt(c):(c=at(t)?er:Xe.current,a.context=Nr(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Vl(e,t,c,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ms(e,r,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Dr(e,t){try{var r="",i=t;do r+=fe(i),i=i.return;while(i);var a=r}catch(c){a=`
7
7
  Error generating stack: `+c.message+`
8
8
  `+c.stack}return{value:e,source:t,stack:a,digest:null}}function Hl(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ql(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var cg=typeof WeakMap=="function"?WeakMap:Map;function ad(e,t,r){r=mn(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){Ys||(Ys=!0,la=i),Ql(e,t)},r}function ud(e,t,r){r=mn(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){Ql(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(r.callback=function(){Ql(e,t),typeof i!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),r}function cd(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new cg;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(r)||(a.add(r),e=Cg.bind(null,e,t,r),t.then(e,e))}function dd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function fd(e,t,r,i,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=mn(-1,1),t.tag=2,Ln(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var dg=z.ReactCurrentOwner,ut=!1;function rt(e,t,r,i){t.child=e===null?jc(t,null,r,i):Ar(t,e.child,r,i)}function pd(e,t,r,i,a){r=r.render;var c=t.ref;return Lr(t,a),i=Dl(e,t,r,i,c,a),r=Fl(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,gn(e,t,a)):(je&&r&&xl(t),t.flags|=1,rt(e,t,i,a),t.child)}function hd(e,t,r,i,a){if(e===null){var c=r.type;return typeof c=="function"&&!ha(c)&&c.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=c,md(e,t,c,i,a)):(e=ei(r.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var h=c.memoizedProps;if(r=r.compare,r=r!==null?r:go,r(h,i)&&e.ref===t.ref)return gn(e,t,a)}return t.flags|=1,e=Bn(c,i),e.ref=t.ref,e.return=t,t.child=e}function md(e,t,r,i,a){if(e!==null){var c=e.memoizedProps;if(go(c,i)&&e.ref===t.ref)if(ut=!1,t.pendingProps=i=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(ut=!0);else return t.lanes=e.lanes,gn(e,t,a)}return Kl(e,t,r,i,a)}function gd(e,t,r){var i=t.pendingProps,a=i.children,c=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Te(zr,St),St|=r;else{if((r&1073741824)===0)return e=c!==null?c.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Te(zr,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=c!==null?c.baseLanes:r,Te(zr,St),St|=i}else c!==null?(i=c.baseLanes|r,t.memoizedState=null):i=r,Te(zr,St),St|=i;return rt(e,t,a,r),t.child}function vd(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Kl(e,t,r,i,a){var c=at(r)?er:Xe.current;return c=Nr(t,c),Lr(t,a),r=Dl(e,t,r,i,c,a),i=Fl(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,gn(e,t,a)):(je&&i&&xl(t),t.flags|=1,rt(e,t,r,a),t.child)}function yd(e,t,r,i,a){if(at(r)){var c=!0;ks(t)}else c=!1;if(Lr(t,a),t.stateNode===null)Vs(e,t),id(t,r,i),Wl(t,r,i,a),i=!0;else if(e===null){var h=t.stateNode,S=t.memoizedProps;h.props=S;var P=h.context,j=r.contextType;typeof j=="object"&&j!==null?j=Nt(j):(j=at(r)?er:Xe.current,j=Nr(t,j));var B=r.getDerivedStateFromProps,$=typeof B=="function"||typeof h.getSnapshotBeforeUpdate=="function";$||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==i||P!==j)&&ld(t,h,i,j),Mn=!1;var U=t.memoizedState;h.state=U,Ms(t,i,h,a),P=t.memoizedState,S!==i||U!==P||lt.current||Mn?(typeof B=="function"&&(Vl(t,r,B,i),P=t.memoizedState),(S=Mn||sd(t,r,S,i,U,P,j))?($||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=P),h.props=i,h.state=P,h.context=j,i=S):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,Mc(e,t),S=t.memoizedProps,j=t.type===t.elementType?S:zt(t.type,S),h.props=j,$=t.pendingProps,U=h.context,P=r.contextType,typeof P=="object"&&P!==null?P=Nt(P):(P=at(r)?er:Xe.current,P=Nr(t,P));var Z=r.getDerivedStateFromProps;(B=typeof Z=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==$||U!==P)&&ld(t,h,i,P),Mn=!1,U=t.memoizedState,h.state=U,Ms(t,i,h,a);var te=t.memoizedState;S!==$||U!==te||lt.current||Mn?(typeof Z=="function"&&(Vl(t,r,Z,i),te=t.memoizedState),(j=Mn||sd(t,r,j,i,U,te,P)||!1)?(B||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,te,P),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,te,P)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=te),h.props=i,h.state=te,h.context=P,i=j):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),i=!1)}return Yl(e,t,r,i,c,a)}function Yl(e,t,r,i,a,c){vd(e,t);var h=(t.flags&128)!==0;if(!i&&!h)return a&&bc(t,r,!1),gn(e,t,c);i=t.stateNode,dg.current=t;var S=h&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&h?(t.child=Ar(t,e.child,null,c),t.child=Ar(t,null,S,c)):rt(e,t,S,c),t.memoizedState=i.state,a&&bc(t,r,!0),t.child}function wd(e){var t=e.stateNode;t.pendingContext?Sc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sc(e,t.context,!1),_l(e,t.containerInfo)}function xd(e,t,r,i,a){return jr(),Cl(a),t.flags|=256,rt(e,t,r,i),t.child}var Gl={dehydrated:null,treeContext:null,retryLane:0};function ql(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sd(e,t,r){var i=t.pendingProps,a=Ae.current,c=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(a&2)!==0),S?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Te(Ae,a&1),e===null)return bl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(h=i.children,e=i.fallback,c?(i=t.mode,c=t.child,h={mode:"hidden",children:h},(i&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=h):c=ti(h,i,0,null),e=cr(e,i,r,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=ql(r),t.memoizedState=Gl,e):Xl(t,h));if(a=e.memoizedState,a!==null&&(S=a.dehydrated,S!==null))return fg(e,t,h,i,S,a,r);if(c){c=i.fallback,h=t.mode,a=e.child,S=a.sibling;var P={mode:"hidden",children:i.children};return(h&1)===0&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=P,t.deletions=null):(i=Bn(a,P),i.subtreeFlags=a.subtreeFlags&14680064),S!==null?c=Bn(S,c):(c=cr(c,h,r,null),c.flags|=2),c.return=t,i.return=t,i.sibling=c,t.child=i,i=c,c=t.child,h=e.child.memoizedState,h=h===null?ql(r):{baseLanes:h.baseLanes|r,cachePool:null,transitions:h.transitions},c.memoizedState=h,c.childLanes=e.childLanes&~r,t.memoizedState=Gl,i}return c=e.child,e=c.sibling,i=Bn(c,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Xl(e,t){return t=ti({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $s(e,t,r,i){return i!==null&&Cl(i),Ar(t,e.child,null,r),e=Xl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fg(e,t,r,i,a,c,h){if(r)return t.flags&256?(t.flags&=-257,i=Hl(Error(s(422))),$s(e,t,h,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=i.fallback,a=t.mode,i=ti({mode:"visible",children:i.children},a,0,null),c=cr(c,a,h,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,(t.mode&1)!==0&&Ar(t,e.child,null,h),t.child.memoizedState=ql(h),t.memoizedState=Gl,c);if((t.mode&1)===0)return $s(e,t,h,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var S=i.dgst;return i=S,c=Error(s(419)),i=Hl(c,i,void 0),$s(e,t,h,i)}if(S=(h&e.childLanes)!==0,ut||S){if(i=He,i!==null){switch(h&-h){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|h))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,hn(e,a),$t(i,e,a,-1))}return pa(),i=Hl(Error(s(421))),$s(e,t,h,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=kg.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,xt=On(a.nextSibling),wt=t,je=!0,Ft=null,e!==null&&(Rt[Tt++]=fn,Rt[Tt++]=pn,Rt[Tt++]=tr,fn=e.id,pn=e.overflow,tr=t),t=Xl(t,i.children),t.flags|=4096,t)}function Ed(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Tl(e.return,t,r)}function Zl(e,t,r,i,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=i,c.tail=r,c.tailMode=a)}function bd(e,t,r){var i=t.pendingProps,a=i.revealOrder,c=i.tail;if(rt(e,t,i.children,r),i=Ae.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ed(e,r,t);else if(e.tag===19)Ed(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Te(Ae,i),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Ls(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Zl(t,!1,a,r,c);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ls(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Zl(t,!0,r,null,c);break;case"together":Zl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vs(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ir|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=Bn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Bn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function pg(e,t,r){switch(t.tag){case 3:wd(t),jr();break;case 5:Dc(t);break;case 1:at(t.type)&&ks(t);break;case 4:_l(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;Te(_s,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Te(Ae,Ae.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Sd(e,t,r):(Te(Ae,Ae.current&1),e=gn(e,t,r),e!==null?e.sibling:null);Te(Ae,Ae.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return bd(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Te(Ae,Ae.current),i)break;return null;case 22:case 23:return t.lanes=0,gd(e,t,r)}return gn(e,t,r)}var Cd,Jl,kd,Pd;Cd=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Jl=function(){},kd=function(e,t,r,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,or(tn.current);var c=null;switch(r){case"input":a=qr(e,a),i=qr(e,i),c=[];break;case"select":a=V({},a,{value:void 0}),i=V({},i,{value:void 0}),c=[];break;case"textarea":a=mr(e,a),i=mr(e,i),c=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Es)}qt(r,i);var h;r=null;for(j in a)if(!i.hasOwnProperty(j)&&a.hasOwnProperty(j)&&a[j]!=null)if(j==="style"){var S=a[j];for(h in S)S.hasOwnProperty(h)&&(r||(r={}),r[h]="")}else j!=="dangerouslySetInnerHTML"&&j!=="children"&&j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(u.hasOwnProperty(j)?c||(c=[]):(c=c||[]).push(j,null));for(j in i){var P=i[j];if(S=a?.[j],i.hasOwnProperty(j)&&P!==S&&(P!=null||S!=null))if(j==="style")if(S){for(h in S)!S.hasOwnProperty(h)||P&&P.hasOwnProperty(h)||(r||(r={}),r[h]="");for(h in P)P.hasOwnProperty(h)&&S[h]!==P[h]&&(r||(r={}),r[h]=P[h])}else r||(c||(c=[]),c.push(j,r)),r=P;else j==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,S=S?S.__html:void 0,P!=null&&S!==P&&(c=c||[]).push(j,P)):j==="children"?typeof P!="string"&&typeof P!="number"||(c=c||[]).push(j,""+P):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&(u.hasOwnProperty(j)?(P!=null&&j==="onScroll"&&Ne("scroll",e),c||S===P||(c=[])):(c=c||[]).push(j,P))}r&&(c=c||[]).push("style",r);var j=c;(t.updateQueue=j)&&(t.flags|=4)}},Pd=function(e,t,r,i){r!==i&&(t.flags|=4)};function _o(e,t){if(!je)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function hg(e,t,r){var i=t.pendingProps;switch(Sl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return at(t.type)&&Cs(),Je(t),null;case 3:return i=t.stateNode,Ir(),Oe(lt),Oe(Xe),Ml(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ns(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ft!==null&&(ca(Ft),Ft=null))),Jl(e,t),Je(t),null;case 5:jl(t);var a=or(Po.current);if(r=t.type,e!==null&&t.stateNode!=null)kd(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Je(t),null}if(e=or(tn.current),Ns(t)){i=t.stateNode,r=t.type;var c=t.memoizedProps;switch(i[en]=t,i[So]=c,e=(t.mode&1)!==0,r){case"dialog":Ne("cancel",i),Ne("close",i);break;case"iframe":case"object":case"embed":Ne("load",i);break;case"video":case"audio":for(a=0;a<yo.length;a++)Ne(yo[a],i);break;case"source":Ne("error",i);break;case"img":case"image":case"link":Ne("error",i),Ne("load",i);break;case"details":Ne("toggle",i);break;case"input":Yo(i,c),Ne("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!c.multiple},Ne("invalid",i);break;case"textarea":Kt(i,c),Ne("invalid",i)}qt(r,c),a=null;for(var h in c)if(c.hasOwnProperty(h)){var S=c[h];h==="children"?typeof S=="string"?i.textContent!==S&&(c.suppressHydrationWarning!==!0&&Ss(i.textContent,S,e),a=["children",S]):typeof S=="number"&&i.textContent!==""+S&&(c.suppressHydrationWarning!==!0&&Ss(i.textContent,S,e),a=["children",""+S]):u.hasOwnProperty(h)&&S!=null&&h==="onScroll"&&Ne("scroll",i)}switch(r){case"input":Ct(i),hr(i,c,!0);break;case"textarea":Ct(i),qo(i);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(i.onclick=Es)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{h=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=h.createElement(r,{is:i.is}):(e=h.createElement(r),r==="select"&&(h=e,i.multiple?h.multiple=!0:i.size&&(h.size=i.size))):e=h.createElementNS(e,r),e[en]=t,e[So]=i,Cd(e,t,!1,!1),t.stateNode=e;e:{switch(h=eo(r,i),r){case"dialog":Ne("cancel",e),Ne("close",e),a=i;break;case"iframe":case"object":case"embed":Ne("load",e),a=i;break;case"video":case"audio":for(a=0;a<yo.length;a++)Ne(yo[a],e);a=i;break;case"source":Ne("error",e),a=i;break;case"img":case"image":case"link":Ne("error",e),Ne("load",e),a=i;break;case"details":Ne("toggle",e),a=i;break;case"input":Yo(e,i),a=qr(e,i),Ne("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=V({},i,{value:void 0}),Ne("invalid",e);break;case"textarea":Kt(e,i),a=mr(e,i),Ne("invalid",e);break;default:a=i}qt(r,a),S=a;for(c in S)if(S.hasOwnProperty(c)){var P=S[c];c==="style"?un(e,P):c==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&Xo(e,P)):c==="children"?typeof P=="string"?(r!=="textarea"||P!=="")&&Gt(e,P):typeof P=="number"&&Gt(e,""+P):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(u.hasOwnProperty(c)?P!=null&&c==="onScroll"&&Ne("scroll",e):P!=null&&D(e,c,P,h))}switch(r){case"input":Ct(e),hr(e,i,!1);break;case"textarea":Ct(e),qo(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Se(i.value));break;case"select":e.multiple=!!i.multiple,c=i.value,c!=null?Pt(e,!!i.multiple,c,!1):i.defaultValue!=null&&Pt(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Es)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Je(t),null;case 6:if(e&&t.stateNode!=null)Pd(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(r=or(Po.current),or(tn.current),Ns(t)){if(i=t.stateNode,r=t.memoizedProps,i[en]=t,(c=i.nodeValue!==r)&&(e=wt,e!==null))switch(e.tag){case 3:Ss(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ss(i.nodeValue,r,(e.mode&1)!==0)}c&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[en]=t,t.stateNode=i}return Je(t),null;case 13:if(Oe(Ae),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(je&&xt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Nc(),jr(),t.flags|=98560,c=!1;else if(c=Ns(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(s(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));c[en]=t}else jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else Ft!==null&&(ca(Ft),Ft=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ae.current&1)!==0?$e===0&&($e=3):pa())),t.updateQueue!==null&&(t.flags|=4),Je(t),null);case 4:return Ir(),Jl(e,t),e===null&&wo(t.stateNode.containerInfo),Je(t),null;case 10:return Rl(t.type._context),Je(t),null;case 17:return at(t.type)&&Cs(),Je(t),null;case 19:if(Oe(Ae),c=t.memoizedState,c===null)return Je(t),null;if(i=(t.flags&128)!==0,h=c.rendering,h===null)if(i)_o(c,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ls(e),h!==null){for(t.flags|=128,_o(c,!1),i=h.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)c=r,e=i,c.flags&=14680066,h=c.alternate,h===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,e=h.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Te(Ae,Ae.current&1|2),t.child}e=e.sibling}c.tail!==null&&De()>Ur&&(t.flags|=128,i=!0,_o(c,!1),t.lanes=4194304)}else{if(!i)if(e=Ls(h),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),_o(c,!0),c.tail===null&&c.tailMode==="hidden"&&!h.alternate&&!je)return Je(t),null}else 2*De()-c.renderingStartTime>Ur&&r!==1073741824&&(t.flags|=128,i=!0,_o(c,!1),t.lanes=4194304);c.isBackwards?(h.sibling=t.child,t.child=h):(r=c.last,r!==null?r.sibling=h:t.child=h,c.last=h)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=De(),t.sibling=null,r=Ae.current,Te(Ae,i?r&1|2:r&1),t):(Je(t),null);case 22:case 23:return fa(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(St&1073741824)!==0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function mg(e,t){switch(Sl(t),t.tag){case 1:return at(t.type)&&Cs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ir(),Oe(lt),Oe(Xe),Ml(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return jl(t),null;case 13:if(Oe(Ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Ae),null;case 4:return Ir(),null;case 10:return Rl(t.type._context),null;case 22:case 23:return fa(),null;case 24:return null;default:return null}}var Ws=!1,et=!1,gg=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Fr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Ie(e,t,i)}else r.current=null}function ea(e,t,r){try{r()}catch(i){Ie(e,t,i)}}var Rd=!1;function vg(e,t){if(fl=cs,e=sc(),ol(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var h=0,S=-1,P=-1,j=0,B=0,$=e,U=null;t:for(;;){for(var Z;$!==r||a!==0&&$.nodeType!==3||(S=h+a),$!==c||i!==0&&$.nodeType!==3||(P=h+i),$.nodeType===3&&(h+=$.nodeValue.length),(Z=$.firstChild)!==null;)U=$,$=Z;for(;;){if($===e)break t;if(U===r&&++j===a&&(S=h),U===c&&++B===i&&(P=h),(Z=$.nextSibling)!==null)break;$=U,U=$.parentNode}$=Z}r=S===-1||P===-1?null:{start:S,end:P}}else r=null}r=r||{start:0,end:0}}else r=null;for(pl={focusedElem:e,selectionRange:r},cs=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var te=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(te!==null){var ne=te.memoizedProps,Fe=te.memoizedState,O=t.stateNode,R=O.getSnapshotBeforeUpdate(t.elementType===t.type?ne:zt(t.type,ne),Fe);O.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(H){Ie(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return te=Rd,Rd=!1,te}function jo(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&ea(t,r,c)}a=a.next}while(a!==i)}}function Hs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function ta(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function Td(e){var t=e.alternate;t!==null&&(e.alternate=null,Td(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[en],delete t[So],delete t[vl],delete t[Jm],delete t[eg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nd(e){return e.tag===5||e.tag===3||e.tag===4}function Od(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function na(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Es));else if(i!==4&&(e=e.child,e!==null))for(na(e,t,r),e=e.sibling;e!==null;)na(e,t,r),e=e.sibling}function ra(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(ra(e,t,r),e=e.sibling;e!==null;)ra(e,t,r),e=e.sibling}var Ye=null,Ut=!1;function In(e,t,r){for(r=r.child;r!==null;)_d(e,t,r),r=r.sibling}function _d(e,t,r){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(os,r)}catch{}switch(r.tag){case 5:et||Fr(r,t);case 6:var i=Ye,a=Ut;Ye=null,In(e,t,r),Ye=i,Ut=a,Ye!==null&&(Ut?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Ut?(e=Ye,r=r.stateNode,e.nodeType===8?gl(e.parentNode,r):e.nodeType===1&&gl(e,r),uo(e)):gl(Ye,r.stateNode));break;case 4:i=Ye,a=Ut,Ye=r.stateNode.containerInfo,Ut=!0,In(e,t,r),Ye=i,Ut=a;break;case 0:case 11:case 14:case 15:if(!et&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var c=a,h=c.destroy;c=c.tag,h!==void 0&&((c&2)!==0||(c&4)!==0)&&ea(r,t,h),a=a.next}while(a!==i)}In(e,t,r);break;case 1:if(!et&&(Fr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(S){Ie(r,t,S)}In(e,t,r);break;case 21:In(e,t,r);break;case 22:r.mode&1?(et=(i=et)||r.memoizedState!==null,In(e,t,r),et=i):In(e,t,r);break;default:In(e,t,r)}}function jd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new gg),t.forEach(function(i){var a=Pg.bind(null,e,i);r.has(i)||(r.add(i),i.then(a,a))})}}function Bt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{var c=e,h=t,S=h;e:for(;S!==null;){switch(S.tag){case 5:Ye=S.stateNode,Ut=!1;break e;case 3:Ye=S.stateNode.containerInfo,Ut=!0;break e;case 4:Ye=S.stateNode.containerInfo,Ut=!0;break e}S=S.return}if(Ye===null)throw Error(s(160));_d(c,h,a),Ye=null,Ut=!1;var P=a.alternate;P!==null&&(P.return=null),a.return=null}catch(j){Ie(a,t,j)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ad(t,e),t=t.sibling}function Ad(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),rn(e),i&4){try{jo(3,e,e.return),Hs(3,e)}catch(ne){Ie(e,e.return,ne)}try{jo(5,e,e.return)}catch(ne){Ie(e,e.return,ne)}}break;case 1:Bt(t,e),rn(e),i&512&&r!==null&&Fr(r,r.return);break;case 5:if(Bt(t,e),rn(e),i&512&&r!==null&&Fr(r,r.return),e.flags&32){var a=e.stateNode;try{Gt(a,"")}catch(ne){Ie(e,e.return,ne)}}if(i&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,h=r!==null?r.memoizedProps:c,S=e.type,P=e.updateQueue;if(e.updateQueue=null,P!==null)try{S==="input"&&c.type==="radio"&&c.name!=null&&Xr(a,c),eo(S,h);var j=eo(S,c);for(h=0;h<P.length;h+=2){var B=P[h],$=P[h+1];B==="style"?un(a,$):B==="dangerouslySetInnerHTML"?Xo(a,$):B==="children"?Gt(a,$):D(a,B,$,j)}switch(S){case"input":Zr(a,c);break;case"textarea":Go(a,c);break;case"select":var U=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var Z=c.value;Z!=null?Pt(a,!!c.multiple,Z,!1):U!==!!c.multiple&&(c.defaultValue!=null?Pt(a,!!c.multiple,c.defaultValue,!0):Pt(a,!!c.multiple,c.multiple?[]:"",!1))}a[So]=c}catch(ne){Ie(e,e.return,ne)}}break;case 6:if(Bt(t,e),rn(e),i&4){if(e.stateNode===null)throw Error(s(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(ne){Ie(e,e.return,ne)}}break;case 3:if(Bt(t,e),rn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{uo(t.containerInfo)}catch(ne){Ie(e,e.return,ne)}break;case 4:Bt(t,e),rn(e);break;case 13:Bt(t,e),rn(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(ia=De())),i&4&&jd(e);break;case 22:if(B=r!==null&&r.memoizedState!==null,e.mode&1?(et=(j=et)||B,Bt(t,e),et=j):Bt(t,e),rn(e),i&8192){if(j=e.memoizedState!==null,(e.stateNode.isHidden=j)&&!B&&(e.mode&1)!==0)for(ee=e,B=e.child;B!==null;){for($=ee=B;ee!==null;){switch(U=ee,Z=U.child,U.tag){case 0:case 11:case 14:case 15:jo(4,U,U.return);break;case 1:Fr(U,U.return);var te=U.stateNode;if(typeof te.componentWillUnmount=="function"){i=U,r=U.return;try{t=i,te.props=t.memoizedProps,te.state=t.memoizedState,te.componentWillUnmount()}catch(ne){Ie(i,r,ne)}}break;case 5:Fr(U,U.return);break;case 22:if(U.memoizedState!==null){Id($);continue}}Z!==null?(Z.return=U,ee=Z):Id($)}B=B.sibling}e:for(B=null,$=e;;){if($.tag===5){if(B===null){B=$;try{a=$.stateNode,j?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(S=$.stateNode,P=$.memoizedProps.style,h=P!=null&&P.hasOwnProperty("display")?P.display:null,S.style.display=vr("display",h))}catch(ne){Ie(e,e.return,ne)}}}else if($.tag===6){if(B===null)try{$.stateNode.nodeValue=j?"":$.memoizedProps}catch(ne){Ie(e,e.return,ne)}}else if(($.tag!==22&&$.tag!==23||$.memoizedState===null||$===e)&&$.child!==null){$.child.return=$,$=$.child;continue}if($===e)break e;for(;$.sibling===null;){if($.return===null||$.return===e)break e;B===$&&(B=null),$=$.return}B===$&&(B=null),$.sibling.return=$.return,$=$.sibling}}break;case 19:Bt(t,e),rn(e),i&4&&jd(e);break;case 21:break;default:Bt(t,e),rn(e)}}function rn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Nd(r)){var i=r;break e}r=r.return}throw Error(s(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Gt(a,""),i.flags&=-33);var c=Od(e);ra(e,c,a);break;case 3:case 4:var h=i.stateNode.containerInfo,S=Od(e);na(e,S,h);break;default:throw Error(s(161))}}catch(P){Ie(e,e.return,P)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yg(e,t,r){ee=e,Md(e)}function Md(e,t,r){for(var i=(e.mode&1)!==0;ee!==null;){var a=ee,c=a.child;if(a.tag===22&&i){var h=a.memoizedState!==null||Ws;if(!h){var S=a.alternate,P=S!==null&&S.memoizedState!==null||et;S=Ws;var j=et;if(Ws=h,(et=P)&&!j)for(ee=a;ee!==null;)h=ee,P=h.child,h.tag===22&&h.memoizedState!==null?Dd(a):P!==null?(P.return=h,ee=P):Dd(a);for(;c!==null;)ee=c,Md(c),c=c.sibling;ee=a,Ws=S,et=j}Ld(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,ee=c):Ld(e)}}function Ld(e){for(;ee!==null;){var t=ee;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:et||Hs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!et)if(r===null)i.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:zt(t.type,r.memoizedProps);i.componentDidUpdate(a,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Ic(t,c,i);break;case 3:var h=t.updateQueue;if(h!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ic(t,h,r)}break;case 5:var S=t.stateNode;if(r===null&&t.flags&4){r=S;var P=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&r.focus();break;case"img":P.src&&(r.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var j=t.alternate;if(j!==null){var B=j.memoizedState;if(B!==null){var $=B.dehydrated;$!==null&&uo($)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}et||t.flags&512&&ta(t)}catch(U){Ie(t,t.return,U)}}if(t===e){ee=null;break}if(r=t.sibling,r!==null){r.return=t.return,ee=r;break}ee=t.return}}function Id(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ee=r;break}ee=t.return}}function Dd(e){for(;ee!==null;){var t=ee;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Hs(4,t)}catch(P){Ie(t,r,P)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(P){Ie(t,a,P)}}var c=t.return;try{ta(t)}catch(P){Ie(t,c,P)}break;case 5:var h=t.return;try{ta(t)}catch(P){Ie(t,h,P)}}}catch(P){Ie(t,t.return,P)}if(t===e){ee=null;break}var S=t.sibling;if(S!==null){S.return=t.return,ee=S;break}ee=t.return}}var wg=Math.ceil,Qs=z.ReactCurrentDispatcher,oa=z.ReactCurrentOwner,_t=z.ReactCurrentBatchConfig,Ee=0,He=null,Ue=null,Ge=0,St=0,zr=_n(0),$e=0,Ao=null,ir=0,Ks=0,sa=0,Mo=null,ct=null,ia=0,Ur=1/0,vn=null,Ys=!1,la=null,Dn=null,Gs=!1,Fn=null,qs=0,Lo=0,aa=null,Xs=-1,Zs=0;function ot(){return(Ee&6)!==0?De():Xs!==-1?Xs:Xs=De()}function zn(e){return(e.mode&1)===0?1:(Ee&2)!==0&&Ge!==0?Ge&-Ge:ng.transition!==null?(Zs===0&&(Zs=Ou()),Zs):(e=Pe,e!==0||(e=window.event,e=e===void 0?16:zu(e.type)),e)}function $t(e,t,r,i){if(50<Lo)throw Lo=0,aa=null,Error(s(185));oo(e,r,i),((Ee&2)===0||e!==He)&&(e===He&&((Ee&2)===0&&(Ks|=r),$e===4&&Un(e,Ge)),dt(e,i),r===1&&Ee===0&&(t.mode&1)===0&&(Ur=De()+500,Ps&&An()))}function dt(e,t){var r=e.callbackNode;nm(e,t);var i=ls(e,e===He?Ge:0);if(i===0)r!==null&&Ru(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Ru(r),t===1)e.tag===0?tg(zd.bind(null,e)):Cc(zd.bind(null,e)),Xm(function(){(Ee&6)===0&&An()}),r=null;else{switch(_u(i)){case 1:r=Bi;break;case 4:r=Tu;break;case 16:r=rs;break;case 536870912:r=Nu;break;default:r=rs}r=Kd(r,Fd.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Fd(e,t){if(Xs=-1,Zs=0,(Ee&6)!==0)throw Error(s(327));var r=e.callbackNode;if(Br()&&e.callbackNode!==r)return null;var i=ls(e,e===He?Ge:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Js(e,i);else{t=i;var a=Ee;Ee|=2;var c=Bd();(He!==e||Ge!==t)&&(vn=null,Ur=De()+500,ar(e,t));do try{Eg();break}catch(S){Ud(e,S)}while(!0);Pl(),Qs.current=c,Ee=a,Ue!==null?t=0:(He=null,Ge=0,t=$e)}if(t!==0){if(t===2&&(a=$i(e),a!==0&&(i=a,t=ua(e,a))),t===1)throw r=Ao,ar(e,0),Un(e,i),dt(e,De()),r;if(t===6)Un(e,i);else{if(a=e.current.alternate,(i&30)===0&&!xg(a)&&(t=Js(e,i),t===2&&(c=$i(e),c!==0&&(i=c,t=ua(e,c))),t===1))throw r=Ao,ar(e,0),Un(e,i),dt(e,De()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(s(345));case 2:ur(e,ct,vn);break;case 3:if(Un(e,i),(i&130023424)===i&&(t=ia+500-De(),10<t)){if(ls(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){ot(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ml(ur.bind(null,e,ct,vn),t);break}ur(e,ct,vn);break;case 4:if(Un(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var h=31-It(i);c=1<<h,h=t[h],h>a&&(a=h),i&=~c}if(i=a,i=De()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*wg(i/1960))-i,10<i){e.timeoutHandle=ml(ur.bind(null,e,ct,vn),i);break}ur(e,ct,vn);break;case 5:ur(e,ct,vn);break;default:throw Error(s(329))}}}return dt(e,De()),e.callbackNode===r?Fd.bind(null,e):null}function ua(e,t){var r=Mo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=Js(e,t),e!==2&&(t=ct,ct=r,t!==null&&ca(t)),e}function ca(e){ct===null?ct=e:ct.push.apply(ct,e)}function xg(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var a=r[i],c=a.getSnapshot;a=a.value;try{if(!Dt(c(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Un(e,t){for(t&=~sa,t&=~Ks,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-It(t),i=1<<r;e[r]=-1,t&=~i}}function zd(e){if((Ee&6)!==0)throw Error(s(327));Br();var t=ls(e,0);if((t&1)===0)return dt(e,De()),null;var r=Js(e,t);if(e.tag!==0&&r===2){var i=$i(e);i!==0&&(t=i,r=ua(e,i))}if(r===1)throw r=Ao,ar(e,0),Un(e,t),dt(e,De()),r;if(r===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ur(e,ct,vn),dt(e,De()),null}function da(e,t){var r=Ee;Ee|=1;try{return e(t)}finally{Ee=r,Ee===0&&(Ur=De()+500,Ps&&An())}}function lr(e){Fn!==null&&Fn.tag===0&&(Ee&6)===0&&Br();var t=Ee;Ee|=1;var r=_t.transition,i=Pe;try{if(_t.transition=null,Pe=1,e)return e()}finally{Pe=i,_t.transition=r,Ee=t,(Ee&6)===0&&An()}}function fa(){St=zr.current,Oe(zr)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,qm(r)),Ue!==null)for(r=Ue.return;r!==null;){var i=r;switch(Sl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Cs();break;case 3:Ir(),Oe(lt),Oe(Xe),Ml();break;case 5:jl(i);break;case 4:Ir();break;case 13:Oe(Ae);break;case 19:Oe(Ae);break;case 10:Rl(i.type._context);break;case 22:case 23:fa()}r=r.return}if(He=e,Ue=e=Bn(e.current,null),Ge=St=t,$e=0,Ao=null,sa=Ks=ir=0,ct=Mo=null,rr!==null){for(t=0;t<rr.length;t++)if(r=rr[t],i=r.interleaved,i!==null){r.interleaved=null;var a=i.next,c=r.pending;if(c!==null){var h=c.next;c.next=a,i.next=h}r.pending=i}rr=null}return e}function Ud(e,t){do{var r=Ue;try{if(Pl(),Is.current=Us,Ds){for(var i=Me.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Ds=!1}if(sr=0,We=Be=Me=null,Ro=!1,To=0,oa.current=null,r===null||r.return===null){$e=1,Ao=t,Ue=null;break}e:{var c=e,h=r.return,S=r,P=t;if(t=Ge,S.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var j=P,B=S,$=B.tag;if((B.mode&1)===0&&($===0||$===11||$===15)){var U=B.alternate;U?(B.updateQueue=U.updateQueue,B.memoizedState=U.memoizedState,B.lanes=U.lanes):(B.updateQueue=null,B.memoizedState=null)}var Z=dd(h);if(Z!==null){Z.flags&=-257,fd(Z,h,S,c,t),Z.mode&1&&cd(c,j,t),t=Z,P=j;var te=t.updateQueue;if(te===null){var ne=new Set;ne.add(P),t.updateQueue=ne}else te.add(P);break e}else{if((t&1)===0){cd(c,j,t),pa();break e}P=Error(s(426))}}else if(je&&S.mode&1){var Fe=dd(h);if(Fe!==null){(Fe.flags&65536)===0&&(Fe.flags|=256),fd(Fe,h,S,c,t),Cl(Dr(P,S));break e}}c=P=Dr(P,S),$e!==4&&($e=2),Mo===null?Mo=[c]:Mo.push(c),c=h;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var O=ad(c,P,t);Lc(c,O);break e;case 1:S=P;var R=c.type,_=c.stateNode;if((c.flags&128)===0&&(typeof R.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Dn===null||!Dn.has(_)))){c.flags|=65536,t&=-t,c.lanes|=t;var H=ud(c,S,t);Lc(c,H);break e}}c=c.return}while(c!==null)}Vd(r)}catch(se){t=se,Ue===r&&r!==null&&(Ue=r=r.return);continue}break}while(!0)}function Bd(){var e=Qs.current;return Qs.current=Us,e===null?Us:e}function pa(){($e===0||$e===3||$e===2)&&($e=4),He===null||(ir&268435455)===0&&(Ks&268435455)===0||Un(He,Ge)}function Js(e,t){var r=Ee;Ee|=2;var i=Bd();(He!==e||Ge!==t)&&(vn=null,ar(e,t));do try{Sg();break}catch(a){Ud(e,a)}while(!0);if(Pl(),Ee=r,Qs.current=i,Ue!==null)throw Error(s(261));return He=null,Ge=0,$e}function Sg(){for(;Ue!==null;)$d(Ue)}function Eg(){for(;Ue!==null&&!Kh();)$d(Ue)}function $d(e){var t=Qd(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?Vd(e):Ue=t,oa.current=null}function Vd(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=hg(r,t,St),r!==null){Ue=r;return}}else{if(r=mg(r,t),r!==null){r.flags&=32767,Ue=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$e=6,Ue=null;return}}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);$e===0&&($e=5)}function ur(e,t,r){var i=Pe,a=_t.transition;try{_t.transition=null,Pe=1,bg(e,t,r,i)}finally{_t.transition=a,Pe=i}return null}function bg(e,t,r,i){do Br();while(Fn!==null);if((Ee&6)!==0)throw Error(s(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var c=r.lanes|r.childLanes;if(rm(e,c),e===He&&(Ue=He=null,Ge=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Gs||(Gs=!0,Kd(rs,function(){return Br(),null})),c=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||c){c=_t.transition,_t.transition=null;var h=Pe;Pe=1;var S=Ee;Ee|=4,oa.current=null,vg(e,r),Ad(r,e),Vm(pl),cs=!!fl,pl=fl=null,e.current=r,yg(r),Yh(),Ee=S,Pe=h,_t.transition=c}else e.current=r;if(Gs&&(Gs=!1,Fn=e,qs=a),c=e.pendingLanes,c===0&&(Dn=null),Xh(r.stateNode),dt(e,De()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],i(a.value,{componentStack:a.stack,digest:a.digest});if(Ys)throw Ys=!1,e=la,la=null,e;return(qs&1)!==0&&e.tag!==0&&Br(),c=e.pendingLanes,(c&1)!==0?e===aa?Lo++:(Lo=0,aa=e):Lo=0,An(),null}function Br(){if(Fn!==null){var e=_u(qs),t=_t.transition,r=Pe;try{if(_t.transition=null,Pe=16>e?16:e,Fn===null)var i=!1;else{if(e=Fn,Fn=null,qs=0,(Ee&6)!==0)throw Error(s(331));var a=Ee;for(Ee|=4,ee=e.current;ee!==null;){var c=ee,h=c.child;if((ee.flags&16)!==0){var S=c.deletions;if(S!==null){for(var P=0;P<S.length;P++){var j=S[P];for(ee=j;ee!==null;){var B=ee;switch(B.tag){case 0:case 11:case 15:jo(8,B,c)}var $=B.child;if($!==null)$.return=B,ee=$;else for(;ee!==null;){B=ee;var U=B.sibling,Z=B.return;if(Td(B),B===j){ee=null;break}if(U!==null){U.return=Z,ee=U;break}ee=Z}}}var te=c.alternate;if(te!==null){var ne=te.child;if(ne!==null){te.child=null;do{var Fe=ne.sibling;ne.sibling=null,ne=Fe}while(ne!==null)}}ee=c}}if((c.subtreeFlags&2064)!==0&&h!==null)h.return=c,ee=h;else e:for(;ee!==null;){if(c=ee,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:jo(9,c,c.return)}var O=c.sibling;if(O!==null){O.return=c.return,ee=O;break e}ee=c.return}}var R=e.current;for(ee=R;ee!==null;){h=ee;var _=h.child;if((h.subtreeFlags&2064)!==0&&_!==null)_.return=h,ee=_;else e:for(h=R;ee!==null;){if(S=ee,(S.flags&2048)!==0)try{switch(S.tag){case 0:case 11:case 15:Hs(9,S)}}catch(se){Ie(S,S.return,se)}if(S===h){ee=null;break e}var H=S.sibling;if(H!==null){H.return=S.return,ee=H;break e}ee=S.return}}if(Ee=a,An(),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(os,e)}catch{}i=!0}return i}finally{Pe=r,_t.transition=t}}return!1}function Wd(e,t,r){t=Dr(r,t),t=ad(e,t,1),e=Ln(e,t,1),t=ot(),e!==null&&(oo(e,1,t),dt(e,t))}function Ie(e,t,r){if(e.tag===3)Wd(e,e,r);else for(;t!==null;){if(t.tag===3){Wd(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Dn===null||!Dn.has(i))){e=Dr(r,e),e=ud(t,e,1),t=Ln(t,e,1),e=ot(),t!==null&&(oo(t,1,e),dt(t,e));break}}t=t.return}}function Cg(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=ot(),e.pingedLanes|=e.suspendedLanes&r,He===e&&(Ge&r)===r&&($e===4||$e===3&&(Ge&130023424)===Ge&&500>De()-ia?ar(e,0):sa|=r),dt(e,t)}function Hd(e,t){t===0&&((e.mode&1)===0?t=1:(t=is,is<<=1,(is&130023424)===0&&(is=4194304)));var r=ot();e=hn(e,t),e!==null&&(oo(e,t,r),dt(e,r))}function kg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Hd(e,r)}function Pg(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(s(314))}i!==null&&i.delete(t),Hd(e,r)}var Qd;Qd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)ut=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ut=!1,pg(e,t,r);ut=(e.flags&131072)!==0}else ut=!1,je&&(t.flags&1048576)!==0&&kc(t,Ts,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Vs(e,t),e=t.pendingProps;var a=Nr(t,Xe.current);Lr(t,r),a=Dl(null,t,i,e,a,r);var c=Fl();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(i)?(c=!0,ks(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ol(t),a.updater=Bs,t.stateNode=a,a._reactInternals=t,Wl(t,i,e,r),t=Yl(null,t,i,!0,c,r)):(t.tag=0,je&&c&&xl(t),rt(null,t,a,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Vs(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Tg(i),e=zt(i,e),a){case 0:t=Kl(null,t,i,e,r);break e;case 1:t=yd(null,t,i,e,r);break e;case 11:t=pd(null,t,i,e,r);break e;case 14:t=hd(null,t,i,zt(i.type,e),r);break e}throw Error(s(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:zt(i,a),Kl(e,t,i,a,r);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:zt(i,a),yd(e,t,i,a,r);case 3:e:{if(wd(t),e===null)throw Error(s(387));i=t.pendingProps,c=t.memoizedState,a=c.element,Mc(e,t),Ms(t,i,null,r);var h=t.memoizedState;if(i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=Dr(Error(s(423)),t),t=xd(e,t,i,r,a);break e}else if(i!==a){a=Dr(Error(s(424)),t),t=xd(e,t,i,r,a);break e}else for(xt=On(t.stateNode.containerInfo.firstChild),wt=t,je=!0,Ft=null,r=jc(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(jr(),i===a){t=gn(e,t,r);break e}rt(e,t,i,r)}t=t.child}return t;case 5:return Dc(t),e===null&&bl(t),i=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,h=a.children,hl(i,a)?h=null:c!==null&&hl(i,c)&&(t.flags|=32),vd(e,t),rt(e,t,h,r),t.child;case 6:return e===null&&bl(t),null;case 13:return Sd(e,t,r);case 4:return _l(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ar(t,null,i,r):rt(e,t,i,r),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:zt(i,a),pd(e,t,i,a,r);case 7:return rt(e,t,t.pendingProps,r),t.child;case 8:return rt(e,t,t.pendingProps.children,r),t.child;case 12:return rt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,c=t.memoizedProps,h=a.value,Te(_s,i._currentValue),i._currentValue=h,c!==null)if(Dt(c.value,h)){if(c.children===a.children&&!lt.current){t=gn(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var S=c.dependencies;if(S!==null){h=c.child;for(var P=S.firstContext;P!==null;){if(P.context===i){if(c.tag===1){P=mn(-1,r&-r),P.tag=2;var j=c.updateQueue;if(j!==null){j=j.shared;var B=j.pending;B===null?P.next=P:(P.next=B.next,B.next=P),j.pending=P}}c.lanes|=r,P=c.alternate,P!==null&&(P.lanes|=r),Tl(c.return,r,t),S.lanes|=r;break}P=P.next}}else if(c.tag===10)h=c.type===t.type?null:c.child;else if(c.tag===18){if(h=c.return,h===null)throw Error(s(341));h.lanes|=r,S=h.alternate,S!==null&&(S.lanes|=r),Tl(h,r,t),h=c.sibling}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===t){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}rt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Lr(t,r),a=Nt(a),i=i(a),t.flags|=1,rt(e,t,i,r),t.child;case 14:return i=t.type,a=zt(i,t.pendingProps),a=zt(i.type,a),hd(e,t,i,a,r);case 15:return md(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:zt(i,a),Vs(e,t),t.tag=1,at(i)?(e=!0,ks(t)):e=!1,Lr(t,r),id(t,i,a),Wl(t,i,a,r),Yl(null,t,i,!0,e,r);case 19:return bd(e,t,r);case 22:return gd(e,t,r)}throw Error(s(156,t.tag))};function Kd(e,t){return Pu(e,t)}function Rg(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,r,i){return new Rg(e,t,r,i)}function ha(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tg(e){if(typeof e=="function")return ha(e)?1:0;if(e!=null){if(e=e.$$typeof,e===X)return 11;if(e===ve)return 14}return 2}function Bn(e,t){var r=e.alternate;return r===null?(r=jt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ei(e,t,r,i,a,c){var h=2;if(i=e,typeof e=="function")ha(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case K:return cr(r.children,a,c,t);case re:h=8,a|=8;break;case pe:return e=jt(12,r,t,a|2),e.elementType=pe,e.lanes=c,e;case de:return e=jt(13,r,t,a),e.elementType=de,e.lanes=c,e;case G:return e=jt(19,r,t,a),e.elementType=G,e.lanes=c,e;case oe:return ti(r,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ce:h=10;break e;case ge:h=9;break e;case X:h=11;break e;case ve:h=14;break e;case ie:h=16,i=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=jt(h,r,t,a),t.elementType=e,t.type=i,t.lanes=c,t}function cr(e,t,r,i){return e=jt(7,e,i,t),e.lanes=r,e}function ti(e,t,r,i){return e=jt(22,e,i,t),e.elementType=oe,e.lanes=r,e.stateNode={isHidden:!1},e}function ma(e,t,r){return e=jt(6,e,null,t),e.lanes=r,e}function ga(e,t,r){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ng(e,t,r,i,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vi(0),this.expirationTimes=Vi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vi(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function va(e,t,r,i,a,c,h,S,P){return e=new Ng(e,t,r,S,P),t===1?(t=1,c===!0&&(t|=8)):t=0,c=jt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ol(c),e}function Og(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Yd(e){if(!e)return jn;e=e._reactInternals;e:{if(Zn(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(at(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var r=e.type;if(at(r))return Ec(e,r,t)}return t}function Gd(e,t,r,i,a,c,h,S,P){return e=va(r,i,!0,e,a,c,h,S,P),e.context=Yd(null),r=e.current,i=ot(),a=zn(r),c=mn(i,a),c.callback=t??null,Ln(r,c,a),e.current.lanes=a,oo(e,a,i),dt(e,i),e}function ni(e,t,r,i){var a=t.current,c=ot(),h=zn(a);return r=Yd(r),t.context===null?t.context=r:t.pendingContext=r,t=mn(c,h),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Ln(a,t,h),e!==null&&($t(e,a,h,c),As(e,a,h)),h}function ri(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function qd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ya(e,t){qd(e,t),(e=e.alternate)&&qd(e,t)}function _g(){return null}var Xd=typeof reportError=="function"?reportError:function(e){console.error(e)};function wa(e){this._internalRoot=e}oi.prototype.render=wa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));ni(e,t,null,null)},oi.prototype.unmount=wa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lr(function(){ni(null,e,null,null)}),t[cn]=null}};function oi(e){this._internalRoot=e}oi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mu();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Rn.length&&t!==0&&t<Rn[r].priority;r++);Rn.splice(r,0,e),r===0&&Du(e)}};function xa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function si(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zd(){}function jg(e,t,r,i,a){if(a){if(typeof i=="function"){var c=i;i=function(){var j=ri(h);c.call(j)}}var h=Gd(t,i,e,0,null,!1,!1,"",Zd);return e._reactRootContainer=h,e[cn]=h.current,wo(e.nodeType===8?e.parentNode:e),lr(),h}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var S=i;i=function(){var j=ri(P);S.call(j)}}var P=va(e,0,!1,null,null,!1,!1,"",Zd);return e._reactRootContainer=P,e[cn]=P.current,wo(e.nodeType===8?e.parentNode:e),lr(function(){ni(t,P,r,i)}),P}function ii(e,t,r,i,a){var c=r._reactRootContainer;if(c){var h=c;if(typeof a=="function"){var S=a;a=function(){var P=ri(h);S.call(P)}}ni(t,h,e,a)}else h=jg(r,t,e,a,i);return ri(h)}ju=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ro(t.pendingLanes);r!==0&&(Wi(t,r|1),dt(t,De()),(Ee&6)===0&&(Ur=De()+500,An()))}break;case 13:lr(function(){var i=hn(e,1);if(i!==null){var a=ot();$t(i,e,1,a)}}),ya(e,1)}},Hi=function(e){if(e.tag===13){var t=hn(e,134217728);if(t!==null){var r=ot();$t(t,e,134217728,r)}ya(e,134217728)}},Au=function(e){if(e.tag===13){var t=zn(e),r=hn(e,t);if(r!==null){var i=ot();$t(r,e,t,i)}ya(e,t)}},Mu=function(){return Pe},Lu=function(e,t){var r=Pe;try{return Pe=e,t()}finally{Pe=r}},wr=function(e,t,r){switch(t){case"input":if(Zr(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var a=bs(i);if(!a)throw Error(s(90));Sn(i),Zr(i,a)}}}break;case"textarea":Go(e,r);break;case"select":t=r.value,t!=null&&Pt(e,!!r.multiple,t,!1)}},ke=da,Re=lr;var Ag={usingClientEntryPoint:!1,Events:[Eo,Rr,bs,es,me,da]},Io={findFiberByHostInstance:Jn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mg={bundleType:Io.bundleType,version:Io.version,rendererPackageName:Io.rendererPackageName,rendererConfig:Io.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Cu(e),e===null?null:e.stateNode},findFiberByHostInstance:Io.findFiberByHostInstance||_g,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var li=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!li.isDisabled&&li.supportsFiber)try{os=li.inject(Mg),Jt=li}catch{}}return ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ag,ft.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xa(t))throw Error(s(200));return Og(e,t,null,r)},ft.createRoot=function(e,t){if(!xa(e))throw Error(s(299));var r=!1,i="",a=Xd;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=va(e,1,!1,null,null,r,!1,i,a),e[cn]=t.current,wo(e.nodeType===8?e.parentNode:e),new wa(t)},ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=Cu(t),e=e===null?null:e.stateNode,e},ft.flushSync=function(e){return lr(e)},ft.hydrate=function(e,t,r){if(!si(t))throw Error(s(200));return ii(null,e,t,!0,r)},ft.hydrateRoot=function(e,t,r){if(!xa(e))throw Error(s(405));var i=r!=null&&r.hydratedSources||null,a=!1,c="",h=Xd;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(h=r.onRecoverableError)),t=Gd(t,null,e,1,r??null,a,!1,c,h),e[cn]=t.current,wo(e),i)for(e=0;e<i.length;e++)r=i[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new oi(t)},ft.render=function(e,t,r){if(!si(t))throw Error(s(200));return ii(null,e,t,!1,r)},ft.unmountComponentAtNode=function(e){if(!si(e))throw Error(s(40));return e._reactRootContainer?(lr(function(){ii(null,null,e,!1,function(){e._reactRootContainer=null,e[cn]=null})}),!0):!1},ft.unstable_batchedUpdates=da,ft.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!si(r))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return ii(e,t,r,!1,i)},ft.version="18.3.1-next-f1338f8080-20240426",ft}var af;function tp(){if(af)return ka.exports;af=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),ka.exports=Yg(),ka.exports}var Ri=tp();const np=ep(Ri);function Ve(n,o,{checkForDefaultPrevented:s=!0}={}){return function(u){if(n?.(u),s===!1||!u.defaultPrevented)return o?.(u)}}function uf(n,o){if(typeof n=="function")return n(o);n!=null&&(n.current=o)}function nu(...n){return o=>{let s=!1;const l=n.map(u=>{const d=uf(u,o);return!s&&typeof d=="function"&&(s=!0),d});if(s)return()=>{for(let u=0;u<l.length;u++){const d=l[u];typeof d=="function"?d():uf(n[u],null)}}}}function Wt(...n){return w.useCallback(nu(...n),n)}function Ti(n,o=[]){let s=[];function l(d,f){const p=w.createContext(f),m=s.length;s=[...s,f];const g=x=>{const{scope:k,children:v,...N}=x,b=k?.[n]?.[m]||p,C=w.useMemo(()=>N,Object.values(N));return E.jsx(b.Provider,{value:C,children:v})};g.displayName=d+"Provider";function y(x,k){const v=k?.[n]?.[m]||p,N=w.useContext(v);if(N)return N;if(f!==void 0)return f;throw new Error(`\`${x}\` must be used within \`${d}\``)}return[g,y]}const u=()=>{const d=s.map(f=>w.createContext(f));return function(p){const m=p?.[n]||d;return w.useMemo(()=>({[`__scope${n}`]:{...p,[n]:m}}),[p,m])}};return u.scopeName=n,[l,Gg(u,...o)]}function Gg(...n){const o=n[0];if(n.length===1)return o;const s=()=>{const l=n.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(d){const f=l.reduce((p,{useScope:m,scopeName:g})=>{const x=m(d)[`__scope${g}`];return{...p,...x}},{});return w.useMemo(()=>({[`__scope${o.scopeName}`]:f}),[f])}};return s.scopeName=o.scopeName,s}function Aa(n){const o=qg(n),s=w.forwardRef((l,u)=>{const{children:d,...f}=l,p=w.Children.toArray(d),m=p.find(Zg);if(m){const g=m.props.children,y=p.map(x=>x===m?w.Children.count(g)>1?w.Children.only(null):w.isValidElement(g)?g.props.children:null:x);return E.jsx(o,{...f,ref:u,children:w.isValidElement(g)?w.cloneElement(g,void 0,y):null})}return E.jsx(o,{...f,ref:u,children:d})});return s.displayName=`${n}.Slot`,s}function qg(n){const o=w.forwardRef((s,l)=>{const{children:u,...d}=s;if(w.isValidElement(u)){const f=ev(u),p=Jg(d,u.props);return u.type!==w.Fragment&&(p.ref=l?nu(l,f):f),w.cloneElement(u,p)}return w.Children.count(u)>1?w.Children.only(null):null});return o.displayName=`${n}.SlotClone`,o}var rp=Symbol("radix.slottable");function Xg(n){const o=({children:s})=>E.jsx(E.Fragment,{children:s});return o.displayName=`${n}.Slottable`,o.__radixId=rp,o}function Zg(n){return w.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===rp}function Jg(n,o){const s={...o};for(const l in o){const u=n[l],d=o[l];/^on[A-Z]/.test(l)?u&&d?s[l]=(...p)=>{const m=d(...p);return u(...p),m}:u&&(s[l]=u):l==="style"?s[l]={...u,...d}:l==="className"&&(s[l]=[u,d].filter(Boolean).join(" "))}return{...n,...s}}function ev(n){let o=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning;return s?n.ref:(o=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}function tv(n){const o=n+"CollectionProvider",[s,l]=Ti(o),[u,d]=s(o,{collectionRef:{current:null},itemMap:new Map}),f=b=>{const{scope:C,children:A}=b,L=Y.useRef(null),D=Y.useRef(new Map).current;return E.jsx(u,{scope:C,itemMap:D,collectionRef:L,children:A})};f.displayName=o;const p=n+"CollectionSlot",m=Aa(p),g=Y.forwardRef((b,C)=>{const{scope:A,children:L}=b,D=d(p,A),z=Wt(C,D.collectionRef);return E.jsx(m,{ref:z,children:L})});g.displayName=p;const y=n+"CollectionItemSlot",x="data-radix-collection-item",k=Aa(y),v=Y.forwardRef((b,C)=>{const{scope:A,children:L,...D}=b,z=Y.useRef(null),Q=Wt(C,z),W=d(y,A);return Y.useEffect(()=>(W.itemMap.set(z,{ref:z,...D}),()=>{W.itemMap.delete(z)})),E.jsx(k,{[x]:"",ref:Q,children:L})});v.displayName=y;function N(b){const C=d(n+"CollectionConsumer",b);return Y.useCallback(()=>{const L=C.collectionRef.current;if(!L)return[];const D=Array.from(L.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((W,K)=>D.indexOf(W.ref.current)-D.indexOf(K.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:f,Slot:g,ItemSlot:v},N,l]}var nv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gt=nv.reduce((n,o)=>{const s=Aa(`Primitive.${o}`),l=w.forwardRef((u,d)=>{const{asChild:f,...p}=u,m=f?s:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(m,{...p,ref:d})});return l.displayName=`Primitive.${o}`,{...n,[o]:l}},{});function op(n,o){n&&Ri.flushSync(()=>n.dispatchEvent(o))}function Kn(n){const o=w.useRef(n);return w.useEffect(()=>{o.current=n}),w.useMemo(()=>(...s)=>o.current?.(...s),[])}function rv(n,o=globalThis?.document){const s=Kn(n);w.useEffect(()=>{const l=u=>{u.key==="Escape"&&s(u)};return o.addEventListener("keydown",l,{capture:!0}),()=>o.removeEventListener("keydown",l,{capture:!0})},[s,o])}var ov="DismissableLayer",Ma="dismissableLayer.update",sv="dismissableLayer.pointerDownOutside",iv="dismissableLayer.focusOutside",cf,sp=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ru=w.forwardRef((n,o)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,...m}=n,g=w.useContext(sp),[y,x]=w.useState(null),k=y?.ownerDocument??globalThis?.document,[,v]=w.useState({}),N=Wt(o,K=>x(K)),b=Array.from(g.layers),[C]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),A=b.indexOf(C),L=y?b.indexOf(y):-1,D=g.layersWithOutsidePointerEventsDisabled.size>0,z=L>=A,Q=av(K=>{const re=K.target,pe=[...g.branches].some(ce=>ce.contains(re));!z||pe||(u?.(K),f?.(K),K.defaultPrevented||p?.())},k),W=uv(K=>{const re=K.target;[...g.branches].some(ce=>ce.contains(re))||(d?.(K),f?.(K),K.defaultPrevented||p?.())},k);return rv(K=>{L===g.layers.size-1&&(l?.(K),!K.defaultPrevented&&p&&(K.preventDefault(),p()))},k),w.useEffect(()=>{if(y)return s&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(cf=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(y)),g.layers.add(y),df(),()=>{s&&g.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=cf)}},[y,k,s,g]),w.useEffect(()=>()=>{y&&(g.layers.delete(y),g.layersWithOutsidePointerEventsDisabled.delete(y),df())},[y,g]),w.useEffect(()=>{const K=()=>v({});return document.addEventListener(Ma,K),()=>document.removeEventListener(Ma,K)},[]),E.jsx(gt.div,{...m,ref:N,style:{pointerEvents:D?z?"auto":"none":void 0,...n.style},onFocusCapture:Ve(n.onFocusCapture,W.onFocusCapture),onBlurCapture:Ve(n.onBlurCapture,W.onBlurCapture),onPointerDownCapture:Ve(n.onPointerDownCapture,Q.onPointerDownCapture)})});ru.displayName=ov;var lv="DismissableLayerBranch",ip=w.forwardRef((n,o)=>{const s=w.useContext(sp),l=w.useRef(null),u=Wt(o,l);return w.useEffect(()=>{const d=l.current;if(d)return s.branches.add(d),()=>{s.branches.delete(d)}},[s.branches]),E.jsx(gt.div,{...n,ref:u})});ip.displayName=lv;function av(n,o=globalThis?.document){const s=Kn(n),l=w.useRef(!1),u=w.useRef(()=>{});return w.useEffect(()=>{const d=p=>{if(p.target&&!l.current){let m=function(){lp(sv,s,g,{discrete:!0})};const g={originalEvent:p};p.pointerType==="touch"?(o.removeEventListener("click",u.current),u.current=m,o.addEventListener("click",u.current,{once:!0})):m()}else o.removeEventListener("click",u.current);l.current=!1},f=window.setTimeout(()=>{o.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),o.removeEventListener("pointerdown",d),o.removeEventListener("click",u.current)}},[o,s]),{onPointerDownCapture:()=>l.current=!0}}function uv(n,o=globalThis?.document){const s=Kn(n),l=w.useRef(!1);return w.useEffect(()=>{const u=d=>{d.target&&!l.current&&lp(iv,s,{originalEvent:d},{discrete:!1})};return o.addEventListener("focusin",u),()=>o.removeEventListener("focusin",u)},[o,s]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function df(){const n=new CustomEvent(Ma);document.dispatchEvent(n)}function lp(n,o,s,{discrete:l}){const u=s.originalEvent.target,d=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:s});o&&u.addEventListener(n,o,{once:!0}),l?op(u,d):u.dispatchEvent(d)}var cv=ru,dv=ip,Yn=globalThis?.document?w.useLayoutEffect:()=>{},fv="Portal",ap=w.forwardRef((n,o)=>{const{container:s,...l}=n,[u,d]=w.useState(!1);Yn(()=>d(!0),[]);const f=s||u&&globalThis?.document?.body;return f?np.createPortal(E.jsx(gt.div,{...l,ref:o}),f):null});ap.displayName=fv;function pv(n,o){return w.useReducer((s,l)=>o[s][l]??s,n)}var ou=n=>{const{present:o,children:s}=n,l=hv(o),u=typeof s=="function"?s({present:l.isPresent}):w.Children.only(s),d=Wt(l.ref,mv(u));return typeof s=="function"||l.isPresent?w.cloneElement(u,{ref:d}):null};ou.displayName="Presence";function hv(n){const[o,s]=w.useState(),l=w.useRef(null),u=w.useRef(n),d=w.useRef("none"),f=n?"mounted":"unmounted",[p,m]=pv(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const g=ai(l.current);d.current=p==="mounted"?g:"none"},[p]),Yn(()=>{const g=l.current,y=u.current;if(y!==n){const k=d.current,v=ai(g);n?m("MOUNT"):v==="none"||g?.display==="none"?m("UNMOUNT"):m(y&&k!==v?"ANIMATION_OUT":"UNMOUNT"),u.current=n}},[n,m]),Yn(()=>{if(o){let g;const y=o.ownerDocument.defaultView??window,x=v=>{const b=ai(l.current).includes(CSS.escape(v.animationName));if(v.target===o&&b&&(m("ANIMATION_END"),!u.current)){const C=o.style.animationFillMode;o.style.animationFillMode="forwards",g=y.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=C)})}},k=v=>{v.target===o&&(d.current=ai(l.current))};return o.addEventListener("animationstart",k),o.addEventListener("animationcancel",x),o.addEventListener("animationend",x),()=>{y.clearTimeout(g),o.removeEventListener("animationstart",k),o.removeEventListener("animationcancel",x),o.removeEventListener("animationend",x)}}else m("ANIMATION_END")},[o,m]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:w.useCallback(g=>{l.current=g?getComputedStyle(g):null,s(g)},[])}}function ai(n){return n?.animationName||"none"}function mv(n){let o=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning;return s?n.ref:(o=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}var gv=tu[" useInsertionEffect ".trim().toString()]||Yn;function vv({prop:n,defaultProp:o,onChange:s=()=>{},caller:l}){const[u,d,f]=yv({defaultProp:o,onChange:s}),p=n!==void 0,m=p?n:u;{const y=w.useRef(n!==void 0);w.useEffect(()=>{const x=y.current;x!==p&&console.warn(`${l} is changing from ${x?"controlled":"uncontrolled"} to ${p?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=p},[p,l])}const g=w.useCallback(y=>{if(p){const x=wv(y)?y(n):y;x!==n&&f.current?.(x)}else d(y)},[p,n,d,f]);return[m,g]}function yv({defaultProp:n,onChange:o}){const[s,l]=w.useState(n),u=w.useRef(s),d=w.useRef(o);return gv(()=>{d.current=o},[o]),w.useEffect(()=>{u.current!==s&&(d.current?.(s),u.current=s)},[s,u]),[s,l,d]}function wv(n){return typeof n=="function"}var xv=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Sv="VisuallyHidden",Ni=w.forwardRef((n,o)=>E.jsx(gt.span,{...n,ref:o,style:{...xv,...n.style}}));Ni.displayName=Sv;var Ev=Ni,su="ToastProvider",[iu,bv,Cv]=tv("Toast"),[up]=Ti("Toast",[Cv]),[kv,Oi]=up(su),cp=n=>{const{__scopeToast:o,label:s="Notification",duration:l=5e3,swipeDirection:u="right",swipeThreshold:d=50,children:f}=n,[p,m]=w.useState(null),[g,y]=w.useState(0),x=w.useRef(!1),k=w.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${su}\`. Expected non-empty \`string\`.`),E.jsx(iu.Provider,{scope:o,children:E.jsx(kv,{scope:o,label:s,duration:l,swipeDirection:u,swipeThreshold:d,toastCount:g,viewport:p,onViewportChange:m,onToastAdd:w.useCallback(()=>y(v=>v+1),[]),onToastRemove:w.useCallback(()=>y(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:k,children:f})})};cp.displayName=su;var dp="ToastViewport",Pv=["F8"],La="toast.viewportPause",Ia="toast.viewportResume",fp=w.forwardRef((n,o)=>{const{__scopeToast:s,hotkey:l=Pv,label:u="Notifications ({hotkey})",...d}=n,f=Oi(dp,s),p=bv(s),m=w.useRef(null),g=w.useRef(null),y=w.useRef(null),x=w.useRef(null),k=Wt(o,x,f.onViewportChange),v=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=f.toastCount>0;w.useEffect(()=>{const C=A=>{l.length!==0&&l.every(D=>A[D]||A.code===D)&&x.current?.focus()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[l]),w.useEffect(()=>{const C=m.current,A=x.current;if(N&&C&&A){const L=()=>{if(!f.isClosePausedRef.current){const W=new CustomEvent(La);A.dispatchEvent(W),f.isClosePausedRef.current=!0}},D=()=>{if(f.isClosePausedRef.current){const W=new CustomEvent(Ia);A.dispatchEvent(W),f.isClosePausedRef.current=!1}},z=W=>{!C.contains(W.relatedTarget)&&D()},Q=()=>{C.contains(document.activeElement)||D()};return C.addEventListener("focusin",L),C.addEventListener("focusout",z),C.addEventListener("pointermove",L),C.addEventListener("pointerleave",Q),window.addEventListener("blur",L),window.addEventListener("focus",D),()=>{C.removeEventListener("focusin",L),C.removeEventListener("focusout",z),C.removeEventListener("pointermove",L),C.removeEventListener("pointerleave",Q),window.removeEventListener("blur",L),window.removeEventListener("focus",D)}}},[N,f.isClosePausedRef]);const b=w.useCallback(({tabbingDirection:C})=>{const L=p().map(D=>{const z=D.ref.current,Q=[z,...zv(z)];return C==="forwards"?Q:Q.reverse()});return(C==="forwards"?L.reverse():L).flat()},[p]);return w.useEffect(()=>{const C=x.current;if(C){const A=L=>{const D=L.altKey||L.ctrlKey||L.metaKey;if(L.key==="Tab"&&!D){const Q=document.activeElement,W=L.shiftKey;if(L.target===C&&W){g.current?.focus();return}const pe=b({tabbingDirection:W?"backwards":"forwards"}),ce=pe.findIndex(ge=>ge===Q);Ta(pe.slice(ce+1))?L.preventDefault():W?g.current?.focus():y.current?.focus()}};return C.addEventListener("keydown",A),()=>C.removeEventListener("keydown",A)}},[p,b]),E.jsxs(dv,{ref:m,role:"region","aria-label":u.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:N?void 0:"none"},children:[N&&E.jsx(Da,{ref:g,onFocusFromOutsideViewport:()=>{const C=b({tabbingDirection:"forwards"});Ta(C)}}),E.jsx(iu.Slot,{scope:s,children:E.jsx(gt.ol,{tabIndex:-1,...d,ref:k})}),N&&E.jsx(Da,{ref:y,onFocusFromOutsideViewport:()=>{const C=b({tabbingDirection:"backwards"});Ta(C)}})]})});fp.displayName=dp;var pp="ToastFocusProxy",Da=w.forwardRef((n,o)=>{const{__scopeToast:s,onFocusFromOutsideViewport:l,...u}=n,d=Oi(pp,s);return E.jsx(Ni,{tabIndex:0,...u,ref:o,style:{position:"fixed"},onFocus:f=>{const p=f.relatedTarget;!d.viewport?.contains(p)&&l()}})});Da.displayName=pp;var Ho="Toast",Rv="toast.swipeStart",Tv="toast.swipeMove",Nv="toast.swipeCancel",Ov="toast.swipeEnd",hp=w.forwardRef((n,o)=>{const{forceMount:s,open:l,defaultOpen:u,onOpenChange:d,...f}=n,[p,m]=vv({prop:l,defaultProp:u??!0,onChange:d,caller:Ho});return E.jsx(ou,{present:s||p,children:E.jsx(Av,{open:p,...f,ref:o,onClose:()=>m(!1),onPause:Kn(n.onPause),onResume:Kn(n.onResume),onSwipeStart:Ve(n.onSwipeStart,g=>{g.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ve(n.onSwipeMove,g=>{const{x:y,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","move"),g.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${y}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Ve(n.onSwipeCancel,g=>{g.currentTarget.setAttribute("data-swipe","cancel"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ve(n.onSwipeEnd,g=>{const{x:y,y:x}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","end"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${y}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});hp.displayName=Ho;var[_v,jv]=up(Ho,{onClose(){}}),Av=w.forwardRef((n,o)=>{const{__scopeToast:s,type:l="foreground",duration:u,open:d,onClose:f,onEscapeKeyDown:p,onPause:m,onResume:g,onSwipeStart:y,onSwipeMove:x,onSwipeCancel:k,onSwipeEnd:v,...N}=n,b=Oi(Ho,s),[C,A]=w.useState(null),L=Wt(o,G=>A(G)),D=w.useRef(null),z=w.useRef(null),Q=u||b.duration,W=w.useRef(0),K=w.useRef(Q),re=w.useRef(0),{onToastAdd:pe,onToastRemove:ce}=b,ge=Kn(()=>{C?.contains(document.activeElement)&&b.viewport?.focus(),f()}),X=w.useCallback(G=>{!G||G===1/0||(window.clearTimeout(re.current),W.current=new Date().getTime(),re.current=window.setTimeout(ge,G))},[ge]);w.useEffect(()=>{const G=b.viewport;if(G){const ve=()=>{X(K.current),g?.()},ie=()=>{const oe=new Date().getTime()-W.current;K.current=K.current-oe,window.clearTimeout(re.current),m?.()};return G.addEventListener(La,ie),G.addEventListener(Ia,ve),()=>{G.removeEventListener(La,ie),G.removeEventListener(Ia,ve)}}},[b.viewport,Q,m,g,X]),w.useEffect(()=>{d&&!b.isClosePausedRef.current&&X(Q)},[d,Q,b.isClosePausedRef,X]),w.useEffect(()=>(pe(),()=>ce()),[pe,ce]);const de=w.useMemo(()=>C?Sp(C):null,[C]);return b.viewport?E.jsxs(E.Fragment,{children:[de&&E.jsx(Mv,{__scopeToast:s,role:"status","aria-live":l==="foreground"?"assertive":"polite",children:de}),E.jsx(_v,{scope:s,onClose:ge,children:Ri.createPortal(E.jsx(iu.ItemSlot,{scope:s,children:E.jsx(cv,{asChild:!0,onEscapeKeyDown:Ve(p,()=>{b.isFocusedToastEscapeKeyDownRef.current||ge(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:E.jsx(gt.li,{tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":b.swipeDirection,...N,ref:L,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:Ve(n.onKeyDown,G=>{G.key==="Escape"&&(p?.(G.nativeEvent),G.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,ge()))}),onPointerDown:Ve(n.onPointerDown,G=>{G.button===0&&(D.current={x:G.clientX,y:G.clientY})}),onPointerMove:Ve(n.onPointerMove,G=>{if(!D.current)return;const ve=G.clientX-D.current.x,ie=G.clientY-D.current.y,oe=!!z.current,I=["left","right"].includes(b.swipeDirection),F=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,V=I?F(0,ve):0,T=I?0:F(0,ie),M=G.pointerType==="touch"?10:2,q={x:V,y:T},J={originalEvent:G,delta:q};oe?(z.current=q,ui(Tv,x,J,{discrete:!1})):ff(q,b.swipeDirection,M)?(z.current=q,ui(Rv,y,J,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ve)>M||Math.abs(ie)>M)&&(D.current=null)}),onPointerUp:Ve(n.onPointerUp,G=>{const ve=z.current,ie=G.target;if(ie.hasPointerCapture(G.pointerId)&&ie.releasePointerCapture(G.pointerId),z.current=null,D.current=null,ve){const oe=G.currentTarget,I={originalEvent:G,delta:ve};ff(ve,b.swipeDirection,b.swipeThreshold)?ui(Ov,v,I,{discrete:!0}):ui(Nv,k,I,{discrete:!0}),oe.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),Mv=n=>{const{__scopeToast:o,children:s,...l}=n,u=Oi(Ho,o),[d,f]=w.useState(!1),[p,m]=w.useState(!1);return Dv(()=>f(!0)),w.useEffect(()=>{const g=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(g)},[]),p?null:E.jsx(ap,{asChild:!0,children:E.jsx(Ni,{...l,children:d&&E.jsxs(E.Fragment,{children:[u.label," ",s]})})})},Lv="ToastTitle",mp=w.forwardRef((n,o)=>{const{__scopeToast:s,...l}=n;return E.jsx(gt.div,{...l,ref:o})});mp.displayName=Lv;var Iv="ToastDescription",gp=w.forwardRef((n,o)=>{const{__scopeToast:s,...l}=n;return E.jsx(gt.div,{...l,ref:o})});gp.displayName=Iv;var vp="ToastAction",yp=w.forwardRef((n,o)=>{const{altText:s,...l}=n;return s.trim()?E.jsx(xp,{altText:s,asChild:!0,children:E.jsx(lu,{...l,ref:o})}):(console.error(`Invalid prop \`altText\` supplied to \`${vp}\`. Expected non-empty \`string\`.`),null)});yp.displayName=vp;var wp="ToastClose",lu=w.forwardRef((n,o)=>{const{__scopeToast:s,...l}=n,u=jv(wp,s);return E.jsx(xp,{asChild:!0,children:E.jsx(gt.button,{type:"button",...l,ref:o,onClick:Ve(n.onClick,u.onClose)})})});lu.displayName=wp;var xp=w.forwardRef((n,o)=>{const{__scopeToast:s,altText:l,...u}=n;return E.jsx(gt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":l||void 0,...u,ref:o})});function Sp(n){const o=[];return Array.from(n.childNodes).forEach(l=>{if(l.nodeType===l.TEXT_NODE&&l.textContent&&o.push(l.textContent),Fv(l)){const u=l.ariaHidden||l.hidden||l.style.display==="none",d=l.dataset.radixToastAnnounceExclude==="";if(!u)if(d){const f=l.dataset.radixToastAnnounceAlt;f&&o.push(f)}else o.push(...Sp(l))}}),o}function ui(n,o,s,{discrete:l}){const u=s.originalEvent.currentTarget,d=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:s});o&&u.addEventListener(n,o,{once:!0}),l?op(u,d):u.dispatchEvent(d)}var ff=(n,o,s=0)=>{const l=Math.abs(n.x),u=Math.abs(n.y),d=l>u;return o==="left"||o==="right"?d&&l>s:!d&&u>s};function Dv(n=()=>{}){const o=Kn(n);Yn(()=>{let s=0,l=0;return s=window.requestAnimationFrame(()=>l=window.requestAnimationFrame(o)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(l)}},[o])}function Fv(n){return n.nodeType===n.ELEMENT_NODE}function zv(n){const o=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const u=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||u?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)o.push(s.currentNode);return o}function Ta(n){const o=document.activeElement;return n.some(s=>s===o?!0:(s.focus(),document.activeElement!==o))}var Uv=cp,Ep=fp,bp=hp,Cp=mp,kp=gp,Pp=yp,Rp=lu;function Tp(n){var o,s,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(o=0;o<u;o++)n[o]&&(s=Tp(n[o]))&&(l&&(l+=" "),l+=s)}else for(s in n)n[s]&&(l&&(l+=" "),l+=s);return l}function Np(){for(var n,o,s=0,l="",u=arguments.length;s<u;s++)(n=arguments[s])&&(o=Tp(n))&&(l&&(l+=" "),l+=o);return l}const pf=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,hf=Np,Op=(n,o)=>s=>{var l;if(o?.variants==null)return hf(n,s?.class,s?.className);const{variants:u,defaultVariants:d}=o,f=Object.keys(u).map(g=>{const y=s?.[g],x=d?.[g];if(y===null)return null;const k=pf(y)||pf(x);return u[g][k]}),p=s&&Object.entries(s).reduce((g,y)=>{let[x,k]=y;return k===void 0||(g[x]=k),g},{}),m=o==null||(l=o.compoundVariants)===null||l===void 0?void 0:l.reduce((g,y)=>{let{class:x,className:k,...v}=y;return Object.entries(v).every(N=>{let[b,C]=N;return Array.isArray(C)?C.includes({...d,...p}[b]):{...d,...p}[b]===C})?[...g,x,k]:g},[]);return hf(n,f,m,s?.class,s?.className)};const Bv=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$v=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,s,l)=>l?l.toUpperCase():s.toLowerCase()),mf=n=>{const o=$v(n);return o.charAt(0).toUpperCase()+o.slice(1)},_p=(...n)=>n.filter((o,s,l)=>!!o&&o.trim()!==""&&l.indexOf(o)===s).join(" ").trim(),Vv=n=>{for(const o in n)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};var Wv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Hv=w.forwardRef(({color:n="currentColor",size:o=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:u="",children:d,iconNode:f,...p},m)=>w.createElement("svg",{ref:m,...Wv,width:o,height:o,stroke:n,strokeWidth:l?Number(s)*24/Number(o):s,className:_p("lucide",u),...!d&&!Vv(p)&&{"aria-hidden":"true"},...p},[...f.map(([g,y])=>w.createElement(g,y)),...Array.isArray(d)?d:[d]]));const vt=(n,o)=>{const s=w.forwardRef(({className:l,...u},d)=>w.createElement(Hv,{ref:d,iconNode:o,className:_p(`lucide-${Bv(mf(n))}`,`lucide-${n}`,l),...u}));return s.displayName=mf(n),s};const Qv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kv=vt("chevron-down",Qv);const Yv=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Gv=vt("chevron-left",Yv);const qv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xv=vt("chevron-right",qv);const Zv=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Jv=vt("chevrons-left",Zv);const ey=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],ty=vt("chevrons-right",ey);const ny=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ry=vt("columns-2",ny);const oy=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],sy=vt("database",oy);const iy=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ly=vt("download",iy);const ay=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],uy=vt("key",ay);const cy=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],dy=vt("layout-grid",cy);const fy=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],py=vt("menu",fy);const hy=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],jp=vt("table-2",hy);const my=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],gy=vt("table",my);const vy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ap=vt("x",vy),au="-",yy=n=>{const o=xy(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:f=>{const p=f.split(au);return p[0]===""&&p.length!==1&&p.shift(),Mp(p,o)||wy(f)},getConflictingClassGroupIds:(f,p)=>{const m=s[f]||[];return p&&l[f]?[...m,...l[f]]:m}}},Mp=(n,o)=>{if(n.length===0)return o.classGroupId;const s=n[0],l=o.nextPart.get(s),u=l?Mp(n.slice(1),l):void 0;if(u)return u;if(o.validators.length===0)return;const d=n.join(au);return o.validators.find(({validator:f})=>f(d))?.classGroupId},gf=/^\[(.+)\]$/,wy=n=>{if(gf.test(n)){const o=gf.exec(n)[1],s=o?.substring(0,o.indexOf(":"));if(s)return"arbitrary.."+s}},xy=n=>{const{theme:o,prefix:s}=n,l={nextPart:new Map,validators:[]};return Ey(Object.entries(n.classGroups),s).forEach(([d,f])=>{Fa(f,l,d,o)}),l},Fa=(n,o,s,l)=>{n.forEach(u=>{if(typeof u=="string"){const d=u===""?o:vf(o,u);d.classGroupId=s;return}if(typeof u=="function"){if(Sy(u)){Fa(u(l),o,s,l);return}o.validators.push({validator:u,classGroupId:s});return}Object.entries(u).forEach(([d,f])=>{Fa(f,vf(o,d),s,l)})})},vf=(n,o)=>{let s=n;return o.split(au).forEach(l=>{s.nextPart.has(l)||s.nextPart.set(l,{nextPart:new Map,validators:[]}),s=s.nextPart.get(l)}),s},Sy=n=>n.isThemeGetter,Ey=(n,o)=>o?n.map(([s,l])=>{const u=l.map(d=>typeof d=="string"?o+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([f,p])=>[o+f,p])):d);return[s,u]}):n,by=n=>{if(n<1)return{get:()=>{},set:()=>{}};let o=0,s=new Map,l=new Map;const u=(d,f)=>{s.set(d,f),o++,o>n&&(o=0,l=s,s=new Map)};return{get(d){let f=s.get(d);if(f!==void 0)return f;if((f=l.get(d))!==void 0)return u(d,f),f},set(d,f){s.has(d)?s.set(d,f):u(d,f)}}},Lp="!",Cy=n=>{const{separator:o,experimentalParseClassName:s}=n,l=o.length===1,u=o[0],d=o.length,f=p=>{const m=[];let g=0,y=0,x;for(let C=0;C<p.length;C++){let A=p[C];if(g===0){if(A===u&&(l||p.slice(C,C+d)===o)){m.push(p.slice(y,C)),y=C+d;continue}if(A==="/"){x=C;continue}}A==="["?g++:A==="]"&&g--}const k=m.length===0?p:p.substring(y),v=k.startsWith(Lp),N=v?k.substring(1):k,b=x&&x>y?x-y:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:N,maybePostfixModifierPosition:b}};return s?p=>s({className:p,parseClassName:f}):f},ky=n=>{if(n.length<=1)return n;const o=[];let s=[];return n.forEach(l=>{l[0]==="["?(o.push(...s.sort(),l),s=[]):s.push(l)}),o.push(...s.sort()),o},Py=n=>({cache:by(n.cacheSize),parseClassName:Cy(n),...yy(n)}),Ry=/\s+/,Ty=(n,o)=>{const{parseClassName:s,getClassGroupId:l,getConflictingClassGroupIds:u}=o,d=[],f=n.trim().split(Ry);let p="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{modifiers:y,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:v}=s(g);let N=!!v,b=l(N?k.substring(0,v):k);if(!b){if(!N){p=g+(p.length>0?" "+p:p);continue}if(b=l(k),!b){p=g+(p.length>0?" "+p:p);continue}N=!1}const C=ky(y).join(":"),A=x?C+Lp:C,L=A+b;if(d.includes(L))continue;d.push(L);const D=u(b,N);for(let z=0;z<D.length;++z){const Q=D[z];d.push(A+Q)}p=g+(p.length>0?" "+p:p)}return p};function Ny(){let n=0,o,s,l="";for(;n<arguments.length;)(o=arguments[n++])&&(s=Ip(o))&&(l&&(l+=" "),l+=s);return l}const Ip=n=>{if(typeof n=="string")return n;let o,s="";for(let l=0;l<n.length;l++)n[l]&&(o=Ip(n[l]))&&(s&&(s+=" "),s+=o);return s};function Oy(n,...o){let s,l,u,d=f;function f(m){const g=o.reduce((y,x)=>x(y),n());return s=Py(g),l=s.cache.get,u=s.cache.set,d=p,p(m)}function p(m){const g=l(m);if(g)return g;const y=Ty(m,s);return u(m,y),y}return function(){return d(Ny.apply(null,arguments))}}const _e=n=>{const o=s=>s[n]||[];return o.isThemeGetter=!0,o},Dp=/^\[(?:([a-z-]+):)?(.+)\]$/i,_y=/^\d+\/\d+$/,jy=new Set(["px","full","screen"]),Ay=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,My=/\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$/,Ly=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Iy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=n=>$r(n)||jy.has(n)||_y.test(n),Vn=n=>Kr(n,"length",Hy),$r=n=>!!n&&!Number.isNaN(Number(n)),Na=n=>Kr(n,"number",$r),Fo=n=>!!n&&Number.isInteger(Number(n)),Fy=n=>n.endsWith("%")&&$r(n.slice(0,-1)),we=n=>Dp.test(n),Wn=n=>Ay.test(n),zy=new Set(["length","size","percentage"]),Uy=n=>Kr(n,zy,Fp),By=n=>Kr(n,"position",Fp),$y=new Set(["image","url"]),Vy=n=>Kr(n,$y,Ky),Wy=n=>Kr(n,"",Qy),zo=()=>!0,Kr=(n,o,s)=>{const l=Dp.exec(n);return l?l[1]?typeof o=="string"?l[1]===o:o.has(l[1]):s(l[2]):!1},Hy=n=>My.test(n)&&!Ly.test(n),Fp=()=>!1,Qy=n=>Iy.test(n),Ky=n=>Dy.test(n),Yy=()=>{const n=_e("colors"),o=_e("spacing"),s=_e("blur"),l=_e("brightness"),u=_e("borderColor"),d=_e("borderRadius"),f=_e("borderSpacing"),p=_e("borderWidth"),m=_e("contrast"),g=_e("grayscale"),y=_e("hueRotate"),x=_e("invert"),k=_e("gap"),v=_e("gradientColorStops"),N=_e("gradientColorStopPositions"),b=_e("inset"),C=_e("margin"),A=_e("opacity"),L=_e("padding"),D=_e("saturate"),z=_e("scale"),Q=_e("sepia"),W=_e("skew"),K=_e("space"),re=_e("translate"),pe=()=>["auto","contain","none"],ce=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto",we,o],X=()=>[we,o],de=()=>["",yn,Vn],G=()=>["auto",$r,we],ve=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",we],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[$r,we];return{cacheSize:500,separator:":",theme:{colors:[zo],spacing:[yn,Vn],blur:["none","",Wn,we],brightness:T(),borderColor:[n],borderRadius:["none","","full",Wn,we],borderSpacing:X(),borderWidth:de(),contrast:T(),grayscale:F(),hueRotate:T(),invert:F(),gap:X(),gradientColorStops:[n],gradientColorStopPositions:[Fy,Vn],inset:ge(),margin:ge(),opacity:T(),padding:X(),saturate:T(),scale:T(),sepia:F(),skew:T(),space:X(),translate:X()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[Wn]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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(),we]}],overflow:[{overflow:ce()}],"overflow-x":[{"overflow-x":ce()}],"overflow-y":[{"overflow-y":ce()}],overscroll:[{overscroll:pe()}],"overscroll-x":[{"overscroll-x":pe()}],"overscroll-y":[{"overscroll-y":pe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Fo,we]}],basis:[{basis:ge()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Fo,we]}],"grid-cols":[{"grid-cols":[zo]}],"col-start-end":[{col:["auto",{span:["full",Fo,we]},we]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[zo]}],"row-start-end":[{row:["auto",{span:[Fo,we]},we]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[k]}],"gap-x":[{"gap-x":[k]}],"gap-y":[{"gap-y":[k]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[L]}],px:[{px:[L]}],py:[{py:[L]}],ps:[{ps:[L]}],pe:[{pe:[L]}],pt:[{pt:[L]}],pr:[{pr:[L]}],pb:[{pb:[L]}],pl:[{pl:[L]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[K]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[K]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,o]}],"min-w":[{"min-w":[we,o,"min","max","fit"]}],"max-w":[{"max-w":[we,o,"none","full","min","max","fit","prose",{screen:[Wn]},Wn]}],h:[{h:[we,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,o,"auto","min","max","fit"]}],"font-size":[{text:["base",Wn,Vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Na]}],"font-family":[{font:[zo]}],"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",we]}],"line-clamp":[{"line-clamp":["none",$r,Na]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",yn,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[A]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",yn,Vn]}],"underline-offset":[{"underline-offset":["auto",yn,we]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:X()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],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",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[A]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ve(),By]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Uy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Vy]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[A]}],"border-style":[{border:[...ie(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[A]}],"divide-style":[{divide:ie()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[yn,we]}],"outline-w":[{outline:[yn,Vn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[A]}],"ring-offset-w":[{"ring-offset":[yn,Vn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Wn,Wy]}],"shadow-color":[{shadow:[zo]}],opacity:[{opacity:[A]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[l]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",Wn,we]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[y]}],invert:[{invert:[x]}],saturate:[{saturate:[D]}],sepia:[{sepia:[Q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[l]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[A]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Fo,we]}],"translate-x":[{"translate-x":[re]}],"translate-y":[{"translate-y":[re]}],"skew-x":[{"skew-x":[W]}],"skew-y":[{"skew-y":[W]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",n]}],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",we]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"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",we]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[yn,Vn,Na]}],stroke:[{stroke:[n,"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"]}}},Gy=Oy(Yy);function Le(...n){return Gy(Np(n))}const qy=Uv,zp=w.forwardRef(({className:n,...o},s)=>E.jsx(Ep,{ref:s,className:Le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...o}));zp.displayName=Ep.displayName;const Xy=Op("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Up=w.forwardRef(({className:n,variant:o,...s},l)=>E.jsx(bp,{ref:l,className:Le(Xy({variant:o}),n),...s}));Up.displayName=bp.displayName;const Zy=w.forwardRef(({className:n,...o},s)=>E.jsx(Pp,{ref:s,className:Le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...o}));Zy.displayName=Pp.displayName;const Bp=w.forwardRef(({className:n,...o},s)=>E.jsx(Rp,{ref:s,className:Le("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...o,children:E.jsx(Ap,{className:"h-4 w-4"})}));Bp.displayName=Rp.displayName;const $p=w.forwardRef(({className:n,...o},s)=>E.jsx(Cp,{ref:s,className:Le("text-sm font-semibold",n),...o}));$p.displayName=Cp.displayName;const Vp=w.forwardRef(({className:n,...o},s)=>E.jsx(kp,{ref:s,className:Le("text-sm opacity-90",n),...o}));Vp.displayName=kp.displayName;function Jy(){const{toasts:n}=Hg();return E.jsxs(qy,{children:[n.map(function({id:o,title:s,description:l,action:u,...d}){return E.jsxs(Up,{...d,children:[E.jsxs("div",{className:"grid gap-1",children:[s&&E.jsx($p,{children:s}),l&&E.jsx(Vp,{children:l})]}),u,E.jsx(Bp,{})]},o)}),E.jsx(zp,{})]})}var ci={},yf;function e0(){if(yf)return ci;yf=1;var n=tp();return ci.createRoot=n.createRoot,ci.hydrateRoot=n.hydrateRoot,ci}var t0=e0(),n0=(n,o,s,l,u,d,f,p)=>{let m=document.documentElement,g=["light","dark"];function y(v){(Array.isArray(n)?n:[n]).forEach(N=>{let b=N==="class",C=b&&d?u.map(A=>d[A]||A):u;b?(m.classList.remove(...C),m.classList.add(d&&d[v]?d[v]:v)):m.setAttribute(N,v)}),x(v)}function x(v){p&&g.includes(v)&&(m.style.colorScheme=v)}function k(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(l)y(l);else try{let v=localStorage.getItem(o)||s,N=f&&v==="system"?k():v;y(N)}catch{}},r0=w.createContext(void 0),o0={setTheme:n=>{},themes:[]},s0=()=>{var n;return(n=w.useContext(r0))!=null?n:o0};w.memo(({forcedTheme:n,storageKey:o,attribute:s,enableSystem:l,enableColorScheme:u,defaultTheme:d,value:f,themes:p,nonce:m,scriptProps:g})=>{let y=JSON.stringify([s,o,d,n,p,f,l,u]).slice(1,-1);return w.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${n0.toString()})(${y})`}})});var i0=n=>{switch(n){case"success":return u0;case"info":return d0;case"warning":return c0;case"error":return f0;default:return null}},l0=Array(12).fill(0),a0=({visible:n,className:o})=>Y.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":n},Y.createElement("div",{className:"sonner-spinner"},l0.map((s,l)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${l}`})))),u0=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),c0=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),d0=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),f0=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),p0=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h0=()=>{let[n,o]=Y.useState(document.hidden);return Y.useEffect(()=>{let s=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),n},za=1,m0=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let o=this.subscribers.indexOf(n);this.subscribers.splice(o,1)}),this.publish=n=>{this.subscribers.forEach(o=>o(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var o;let{message:s,...l}=n,u=typeof n?.id=="number"||((o=n.id)==null?void 0:o.length)>0?n.id:za++,d=this.toasts.find(p=>p.id===u),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...n,id:u,title:s}),{...p,...n,id:u,dismissible:f,title:s}):p):this.addToast({title:s,...l,dismissible:f,id:u}),u},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(o=>{this.subscribers.forEach(s=>s({id:o.id,dismiss:!0}))}),this.subscribers.forEach(o=>o({id:n,dismiss:!0})),n),this.message=(n,o)=>this.create({...o,message:n}),this.error=(n,o)=>this.create({...o,message:n,type:"error"}),this.success=(n,o)=>this.create({...o,type:"success",message:n}),this.info=(n,o)=>this.create({...o,type:"info",message:n}),this.warning=(n,o)=>this.create({...o,type:"warning",message:n}),this.loading=(n,o)=>this.create({...o,type:"loading",message:n}),this.promise=(n,o)=>{if(!o)return;let s;o.loading!==void 0&&(s=this.create({...o,promise:n,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));let l=n instanceof Promise?n:n(),u=s!==void 0,d,f=l.then(async m=>{if(d=["resolve",m],Y.isValidElement(m))u=!1,this.create({id:s,type:"default",message:m});else if(v0(m)&&!m.ok){u=!1;let g=typeof o.error=="function"?await o.error(`HTTP error! status: ${m.status}`):o.error,y=typeof o.description=="function"?await o.description(`HTTP error! status: ${m.status}`):o.description;this.create({id:s,type:"error",message:g,description:y})}else if(o.success!==void 0){u=!1;let g=typeof o.success=="function"?await o.success(m):o.success,y=typeof o.description=="function"?await o.description(m):o.description;this.create({id:s,type:"success",message:g,description:y})}}).catch(async m=>{if(d=["reject",m],o.error!==void 0){u=!1;let g=typeof o.error=="function"?await o.error(m):o.error,y=typeof o.description=="function"?await o.description(m):o.description;this.create({id:s,type:"error",message:g,description:y})}}).finally(()=>{var m;u&&(this.dismiss(s),s=void 0),(m=o.finally)==null||m.call(o)}),p=()=>new Promise((m,g)=>f.then(()=>d[0]==="reject"?g(d[1]):m(d[1])).catch(g));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(n,o)=>{let s=o?.id||za++;return this.create({jsx:n(s),id:s,...o}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},pt=new m0,g0=(n,o)=>{let s=o?.id||za++;return pt.addToast({title:n,...o,id:s}),s},v0=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",y0=g0,w0=()=>pt.toasts,x0=()=>pt.getActiveToasts();Object.assign(y0,{success:pt.success,info:pt.info,warning:pt.warning,error:pt.error,custom:pt.custom,message:pt.message,promise:pt.promise,dismiss:pt.dismiss,loading:pt.loading},{getHistory:w0,getToasts:x0});function S0(n,{insertAt:o}={}){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",o==="top"&&s.firstChild?s.insertBefore(l,s.firstChild):s.appendChild(l),l.styleSheet?l.styleSheet.cssText=n:l.appendChild(document.createTextNode(n))}S0(`: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%)}
9
- `);function di(n){return n.label!==void 0}var E0=3,b0="32px",C0="16px",wf=4e3,k0=356,P0=14,R0=20,T0=200;function Vt(...n){return n.filter(Boolean).join(" ")}function N0(n){let[o,s]=n.split("-"),l=[];return o&&l.push(o),s&&l.push(s),l}var O0=n=>{var o,s,l,u,d,f,p,m,g,y,x;let{invert:k,toast:v,unstyled:N,interacting:b,setHeights:C,visibleToasts:A,heights:L,index:D,toasts:z,expanded:Q,removeToast:W,defaultRichColors:K,closeButton:re,style:pe,cancelButtonStyle:ce,actionButtonStyle:ge,className:X="",descriptionClassName:de="",duration:G,position:ve,gap:ie,loadingIcon:oe,expandByDefault:I,classNames:F,icons:V,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:M}=n,[q,J]=Y.useState(null),[fe,ye]=Y.useState(null),[le,Se]=Y.useState(!1),[be,ze]=Y.useState(!1),[Ct,Sn]=Y.useState(!1),[kt,qr]=Y.useState(!1),[Yo,Xr]=Y.useState(!1),[Zr,hr]=Y.useState(0),[Jr,En]=Y.useState(0),Pt=Y.useRef(v.duration||G||wf),mr=Y.useRef(null),Kt=Y.useRef(null),Go=D===0,qo=D+1<=A,tt=v.type,Yt=v.dismissible!==!1,gr=v.className||"",Xo=v.descriptionClassName||"",Gt=Y.useMemo(()=>L.findIndex(me=>me.toastId===v.id)||0,[L,v.id]),Xn=Y.useMemo(()=>{var me;return(me=v.closeButton)!=null?me:re},[v.closeButton,re]),Zo=Y.useMemo(()=>v.duration||G||wf,[v.duration,G]),vr=Y.useRef(0),un=Y.useRef(0),Jo=Y.useRef(0),qt=Y.useRef(null),[eo,to]=ve.split("-"),yr=Y.useMemo(()=>L.reduce((me,ke,Re)=>Re>=Gt?me:me+ke.height,0),[L,Gt]),wr=h0(),bn=v.invert||k,Xt=tt==="loading";un.current=Y.useMemo(()=>Gt*ie+yr,[Gt,yr]),Y.useEffect(()=>{Pt.current=Zo},[Zo]),Y.useEffect(()=>{Se(!0)},[]),Y.useEffect(()=>{let me=Kt.current;if(me){let ke=me.getBoundingClientRect().height;return En(ke),C(Re=>[{toastId:v.id,height:ke,position:v.position},...Re]),()=>C(Re=>Re.filter(nt=>nt.toastId!==v.id))}},[C,v.id]),Y.useLayoutEffect(()=>{if(!le)return;let me=Kt.current,ke=me.style.height;me.style.height="auto";let Re=me.getBoundingClientRect().height;me.style.height=ke,En(Re),C(nt=>nt.find(st=>st.toastId===v.id)?nt.map(st=>st.toastId===v.id?{...st,height:Re}:st):[{toastId:v.id,height:Re,position:v.position},...nt])},[le,v.title,v.description,C,v.id]);let Mt=Y.useCallback(()=>{ze(!0),hr(un.current),C(me=>me.filter(ke=>ke.toastId!==v.id)),setTimeout(()=>{W(v)},T0)},[v,W,C,un]);Y.useEffect(()=>{if(v.promise&&tt==="loading"||v.duration===1/0||v.type==="loading")return;let me;return Q||b||M&&wr?(()=>{if(Jo.current<vr.current){let ke=new Date().getTime()-vr.current;Pt.current=Pt.current-ke}Jo.current=new Date().getTime()})():Pt.current!==1/0&&(vr.current=new Date().getTime(),me=setTimeout(()=>{var ke;(ke=v.onAutoClose)==null||ke.call(v,v),Mt()},Pt.current)),()=>clearTimeout(me)},[Q,b,v,tt,M,wr,Mt]),Y.useEffect(()=>{v.delete&&Mt()},[Mt,v.delete]);function es(){var me,ke,Re;return V!=null&&V.loading?Y.createElement("div",{className:Vt(F?.loader,(me=v?.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":tt==="loading"},V.loading):oe?Y.createElement("div",{className:Vt(F?.loader,(ke=v?.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":tt==="loading"},oe):Y.createElement(a0,{className:Vt(F?.loader,(Re=v?.classNames)==null?void 0:Re.loader),visible:tt==="loading"})}return Y.createElement("li",{tabIndex:0,ref:Kt,className:Vt(X,gr,F?.toast,(o=v?.classNames)==null?void 0:o.toast,F?.default,F?.[tt],(s=v?.classNames)==null?void 0:s[tt]),"data-sonner-toast":"","data-rich-colors":(l=v.richColors)!=null?l:K,"data-styled":!(v.jsx||v.unstyled||N),"data-mounted":le,"data-promise":!!v.promise,"data-swiped":Yo,"data-removed":be,"data-visible":qo,"data-y-position":eo,"data-x-position":to,"data-index":D,"data-front":Go,"data-swiping":Ct,"data-dismissible":Yt,"data-type":tt,"data-invert":bn,"data-swipe-out":kt,"data-swipe-direction":fe,"data-expanded":!!(Q||I&&le),style:{"--index":D,"--toasts-before":D,"--z-index":z.length-D,"--offset":`${be?Zr:un.current}px`,"--initial-height":I?"auto":`${Jr}px`,...pe,...v.style},onDragEnd:()=>{Sn(!1),J(null),qt.current=null},onPointerDown:me=>{Xt||!Yt||(mr.current=new Date,hr(un.current),me.target.setPointerCapture(me.pointerId),me.target.tagName!=="BUTTON"&&(Sn(!0),qt.current={x:me.clientX,y:me.clientY}))},onPointerUp:()=>{var me,ke,Re,nt;if(kt||!Yt)return;qt.current=null;let st=Number(((me=Kt.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),it=Number(((ke=Kt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Re=mr.current)==null?void 0:Re.getTime()),Ke=q==="x"?st:it,Zt=Math.abs(Ke)/Lt;if(Math.abs(Ke)>=R0||Zt>.11){hr(un.current),(nt=v.onDismiss)==null||nt.call(v,v),ye(q==="x"?st>0?"right":"left":it>0?"down":"up"),Mt(),qr(!0),Xr(!1);return}Sn(!1),J(null)},onPointerMove:me=>{var ke,Re,nt,st;if(!qt.current||!Yt||((ke=window.getSelection())==null?void 0:ke.toString().length)>0)return;let it=me.clientY-qt.current.y,Lt=me.clientX-qt.current.x,Ke=(Re=n.swipeDirections)!=null?Re:N0(ve);!q&&(Math.abs(Lt)>1||Math.abs(it)>1)&&J(Math.abs(Lt)>Math.abs(it)?"x":"y");let Zt={x:0,y:0};q==="y"?(Ke.includes("top")||Ke.includes("bottom"))&&(Ke.includes("top")&&it<0||Ke.includes("bottom")&&it>0)&&(Zt.y=it):q==="x"&&(Ke.includes("left")||Ke.includes("right"))&&(Ke.includes("left")&&Lt<0||Ke.includes("right")&&Lt>0)&&(Zt.x=Lt),(Math.abs(Zt.x)>0||Math.abs(Zt.y)>0)&&Xr(!0),(nt=Kt.current)==null||nt.style.setProperty("--swipe-amount-x",`${Zt.x}px`),(st=Kt.current)==null||st.style.setProperty("--swipe-amount-y",`${Zt.y}px`)}},Xn&&!v.jsx?Y.createElement("button",{"aria-label":T,"data-disabled":Xt,"data-close-button":!0,onClick:Xt||!Yt?()=>{}:()=>{var me;Mt(),(me=v.onDismiss)==null||me.call(v,v)},className:Vt(F?.closeButton,(u=v?.classNames)==null?void 0:u.closeButton)},(d=V?.close)!=null?d:p0):null,v.jsx||w.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Y.createElement(Y.Fragment,null,tt||v.icon||v.promise?Y.createElement("div",{"data-icon":"",className:Vt(F?.icon,(f=v?.classNames)==null?void 0:f.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||es():null,v.type!=="loading"?v.icon||V?.[tt]||i0(tt):null):null,Y.createElement("div",{"data-content":"",className:Vt(F?.content,(p=v?.classNames)==null?void 0:p.content)},Y.createElement("div",{"data-title":"",className:Vt(F?.title,(m=v?.classNames)==null?void 0:m.title)},typeof v.title=="function"?v.title():v.title),v.description?Y.createElement("div",{"data-description":"",className:Vt(de,Xo,F?.description,(g=v?.classNames)==null?void 0:g.description)},typeof v.description=="function"?v.description():v.description):null),w.isValidElement(v.cancel)?v.cancel:v.cancel&&di(v.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||ce,onClick:me=>{var ke,Re;di(v.cancel)&&Yt&&((Re=(ke=v.cancel).onClick)==null||Re.call(ke,me),Mt())},className:Vt(F?.cancelButton,(y=v?.classNames)==null?void 0:y.cancelButton)},v.cancel.label):null,w.isValidElement(v.action)?v.action:v.action&&di(v.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ge,onClick:me=>{var ke,Re;di(v.action)&&((Re=(ke=v.action).onClick)==null||Re.call(ke,me),!me.defaultPrevented&&Mt())},className:Vt(F?.actionButton,(x=v?.classNames)==null?void 0:x.actionButton)},v.action.label):null))};function xf(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function _0(n,o){let s={};return[n,o].forEach((l,u)=>{let d=u===1,f=d?"--mobile-offset":"--offset",p=d?C0:b0;function m(g){["top","right","bottom","left"].forEach(y=>{s[`${f}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof l=="number"||typeof l=="string"?m(l):typeof l=="object"?["top","right","bottom","left"].forEach(g=>{l[g]===void 0?s[`${f}-${g}`]=p:s[`${f}-${g}`]=typeof l[g]=="number"?`${l[g]}px`:l[g]}):m(p)}),s}var j0=w.forwardRef(function(n,o){let{invert:s,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:f,className:p,offset:m,mobileOffset:g,theme:y="light",richColors:x,duration:k,style:v,visibleToasts:N=E0,toastOptions:b,dir:C=xf(),gap:A=P0,loadingIcon:L,icons:D,containerAriaLabel:z="Notifications",pauseWhenPageIsHidden:Q}=n,[W,K]=Y.useState([]),re=Y.useMemo(()=>Array.from(new Set([l].concat(W.filter(M=>M.position).map(M=>M.position)))),[W,l]),[pe,ce]=Y.useState([]),[ge,X]=Y.useState(!1),[de,G]=Y.useState(!1),[ve,ie]=Y.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),oe=Y.useRef(null),I=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Y.useRef(null),V=Y.useRef(!1),T=Y.useCallback(M=>{K(q=>{var J;return(J=q.find(fe=>fe.id===M.id))!=null&&J.delete||pt.dismiss(M.id),q.filter(({id:fe})=>fe!==M.id)})},[]);return Y.useEffect(()=>pt.subscribe(M=>{if(M.dismiss){K(q=>q.map(J=>J.id===M.id?{...J,delete:!0}:J));return}setTimeout(()=>{np.flushSync(()=>{K(q=>{let J=q.findIndex(fe=>fe.id===M.id);return J!==-1?[...q.slice(0,J),{...q[J],...M},...q.slice(J+1)]:[M,...q]})})})}),[]),Y.useEffect(()=>{if(y!=="system"){ie(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ie("dark"):ie("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:q})=>{ie(q?"dark":"light")})}catch{M.addListener(({matches:J})=>{try{ie(J?"dark":"light")}catch(fe){console.error(fe)}})}},[y]),Y.useEffect(()=>{W.length<=1&&X(!1)},[W]),Y.useEffect(()=>{let M=q=>{var J,fe;u.every(ye=>q[ye]||q.code===ye)&&(X(!0),(J=oe.current)==null||J.focus()),q.code==="Escape"&&(document.activeElement===oe.current||(fe=oe.current)!=null&&fe.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[u]),Y.useEffect(()=>{if(oe.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,V.current=!1)}},[oe.current]),Y.createElement("section",{ref:o,"aria-label":`${z} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((M,q)=>{var J;let[fe,ye]=M.split("-");return W.length?Y.createElement("ol",{key:M,dir:C==="auto"?xf():C,tabIndex:-1,ref:oe,className:p,"data-sonner-toaster":!0,"data-theme":ve,"data-y-position":fe,"data-lifted":ge&&W.length>1&&!d,"data-x-position":ye,style:{"--front-toast-height":`${((J=pe[0])==null?void 0:J.height)||0}px`,"--width":`${k0}px`,"--gap":`${A}px`,...v,..._0(m,g)},onBlur:le=>{V.current&&!le.currentTarget.contains(le.relatedTarget)&&(V.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||V.current||(V.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{de||X(!1)},onDragEnd:()=>X(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},W.filter(le=>!le.position&&q===0||le.position===M).map((le,Se)=>{var be,ze;return Y.createElement(O0,{key:le.id,icons:D,index:Se,toast:le,defaultRichColors:x,duration:(be=b?.duration)!=null?be:k,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:N,closeButton:(ze=b?.closeButton)!=null?ze:f,interacting:de,position:M,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:T,toasts:W.filter(Ct=>Ct.position==le.position),heights:pe.filter(Ct=>Ct.position==le.position),setHeights:ce,expandByDefault:d,gap:A,loadingIcon:L,expanded:ge,pauseWhenPageIsHidden:Q,swipeDirections:n.swipeDirections})})):null}))});const A0=({...n})=>{const{theme:o="system"}=s0();return E.jsx(j0,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})},M0=["top","right","bottom","left"],Gn=Math.min,Et=Math.max,wi=Math.round,fi=Math.floor,sn=n=>({x:n,y:n}),L0={left:"right",right:"left",bottom:"top",top:"bottom"},I0={start:"end",end:"start"};function Ua(n,o,s){return Et(n,Gn(o,s))}function wn(n,o){return typeof n=="function"?n(o):n}function xn(n){return n.split("-")[0]}function Yr(n){return n.split("-")[1]}function uu(n){return n==="x"?"y":"x"}function cu(n){return n==="y"?"height":"width"}const D0=new Set(["top","bottom"]);function on(n){return D0.has(xn(n))?"y":"x"}function du(n){return uu(on(n))}function F0(n,o,s){s===void 0&&(s=!1);const l=Yr(n),u=du(n),d=cu(u);let f=u==="x"?l===(s?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[d]>o.floating[d]&&(f=xi(f)),[f,xi(f)]}function z0(n){const o=xi(n);return[Ba(n),o,Ba(o)]}function Ba(n){return n.replace(/start|end/g,o=>I0[o])}const Sf=["left","right"],Ef=["right","left"],U0=["top","bottom"],B0=["bottom","top"];function $0(n,o,s){switch(n){case"top":case"bottom":return s?o?Ef:Sf:o?Sf:Ef;case"left":case"right":return o?U0:B0;default:return[]}}function V0(n,o,s,l){const u=Yr(n);let d=$0(xn(n),s==="start",l);return u&&(d=d.map(f=>f+"-"+u),o&&(d=d.concat(d.map(Ba)))),d}function xi(n){return n.replace(/left|right|bottom|top/g,o=>L0[o])}function W0(n){return{top:0,right:0,bottom:0,left:0,...n}}function Wp(n){return typeof n!="number"?W0(n):{top:n,right:n,bottom:n,left:n}}function Si(n){const{x:o,y:s,width:l,height:u}=n;return{width:l,height:u,top:s,left:o,right:o+l,bottom:s+u,x:o,y:s}}function bf(n,o,s){let{reference:l,floating:u}=n;const d=on(o),f=du(o),p=cu(f),m=xn(o),g=d==="y",y=l.x+l.width/2-u.width/2,x=l.y+l.height/2-u.height/2,k=l[p]/2-u[p]/2;let v;switch(m){case"top":v={x:y,y:l.y-u.height};break;case"bottom":v={x:y,y:l.y+l.height};break;case"right":v={x:l.x+l.width,y:x};break;case"left":v={x:l.x-u.width,y:x};break;default:v={x:l.x,y:l.y}}switch(Yr(o)){case"start":v[f]-=k*(s&&g?-1:1);break;case"end":v[f]+=k*(s&&g?-1:1);break}return v}async function H0(n,o){var s;o===void 0&&(o={});const{x:l,y:u,platform:d,rects:f,elements:p,strategy:m}=n,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:x="floating",altBoundary:k=!1,padding:v=0}=wn(o,n),N=Wp(v),C=p[k?x==="floating"?"reference":"floating":x],A=Si(await d.getClippingRect({element:(s=await(d.isElement==null?void 0:d.isElement(C)))==null||s?C:C.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(p.floating)),boundary:g,rootBoundary:y,strategy:m})),L=x==="floating"?{x:l,y:u,width:f.floating.width,height:f.floating.height}:f.reference,D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p.floating)),z=await(d.isElement==null?void 0:d.isElement(D))?await(d.getScale==null?void 0:d.getScale(D))||{x:1,y:1}:{x:1,y:1},Q=Si(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:L,offsetParent:D,strategy:m}):L);return{top:(A.top-Q.top+N.top)/z.y,bottom:(Q.bottom-A.bottom+N.bottom)/z.y,left:(A.left-Q.left+N.left)/z.x,right:(Q.right-A.right+N.right)/z.x}}const Q0=async(n,o,s)=>{const{placement:l="bottom",strategy:u="absolute",middleware:d=[],platform:f}=s,p=d.filter(Boolean),m=await(f.isRTL==null?void 0:f.isRTL(o));let g=await f.getElementRects({reference:n,floating:o,strategy:u}),{x:y,y:x}=bf(g,l,m),k=l,v={},N=0;for(let C=0;C<p.length;C++){var b;const{name:A,fn:L}=p[C],{x:D,y:z,data:Q,reset:W}=await L({x:y,y:x,initialPlacement:l,placement:k,strategy:u,middlewareData:v,rects:g,platform:{...f,detectOverflow:(b=f.detectOverflow)!=null?b:H0},elements:{reference:n,floating:o}});y=D??y,x=z??x,v={...v,[A]:{...v[A],...Q}},W&&N<=50&&(N++,typeof W=="object"&&(W.placement&&(k=W.placement),W.rects&&(g=W.rects===!0?await f.getElementRects({reference:n,floating:o,strategy:u}):W.rects),{x:y,y:x}=bf(g,k,m)),C=-1)}return{x:y,y:x,placement:k,strategy:u,middlewareData:v}},K0=n=>({name:"arrow",options:n,async fn(o){const{x:s,y:l,placement:u,rects:d,platform:f,elements:p,middlewareData:m}=o,{element:g,padding:y=0}=wn(n,o)||{};if(g==null)return{};const x=Wp(y),k={x:s,y:l},v=du(u),N=cu(v),b=await f.getDimensions(g),C=v==="y",A=C?"top":"left",L=C?"bottom":"right",D=C?"clientHeight":"clientWidth",z=d.reference[N]+d.reference[v]-k[v]-d.floating[N],Q=k[v]-d.reference[v],W=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let K=W?W[D]:0;(!K||!await(f.isElement==null?void 0:f.isElement(W)))&&(K=p.floating[D]||d.floating[N]);const re=z/2-Q/2,pe=K/2-b[N]/2-1,ce=Gn(x[A],pe),ge=Gn(x[L],pe),X=ce,de=K-b[N]-ge,G=K/2-b[N]/2+re,ve=Ua(X,G,de),ie=!m.arrow&&Yr(u)!=null&&G!==ve&&d.reference[N]/2-(G<X?ce:ge)-b[N]/2<0,oe=ie?G<X?G-X:G-de:0;return{[v]:k[v]+oe,data:{[v]:ve,centerOffset:G-ve-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),Y0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(o){var s,l;const{placement:u,middlewareData:d,rects:f,initialPlacement:p,platform:m,elements:g}=o,{mainAxis:y=!0,crossAxis:x=!0,fallbackPlacements:k,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:b=!0,...C}=wn(n,o);if((s=d.arrow)!=null&&s.alignmentOffset)return{};const A=xn(u),L=on(p),D=xn(p)===p,z=await(m.isRTL==null?void 0:m.isRTL(g.floating)),Q=k||(D||!b?[xi(p)]:z0(p)),W=N!=="none";!k&&W&&Q.push(...V0(p,b,N,z));const K=[p,...Q],re=await m.detectOverflow(o,C),pe=[];let ce=((l=d.flip)==null?void 0:l.overflows)||[];if(y&&pe.push(re[A]),x){const G=F0(u,f,z);pe.push(re[G[0]],re[G[1]])}if(ce=[...ce,{placement:u,overflows:pe}],!pe.every(G=>G<=0)){var ge,X;const G=(((ge=d.flip)==null?void 0:ge.index)||0)+1,ve=K[G];if(ve&&(!(x==="alignment"?L!==on(ve):!1)||ce.every(I=>on(I.placement)===L?I.overflows[0]>0:!0)))return{data:{index:G,overflows:ce},reset:{placement:ve}};let ie=(X=ce.filter(oe=>oe.overflows[0]<=0).sort((oe,I)=>oe.overflows[1]-I.overflows[1])[0])==null?void 0:X.placement;if(!ie)switch(v){case"bestFit":{var de;const oe=(de=ce.filter(I=>{if(W){const F=on(I.placement);return F===L||F==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,V)=>F+V,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:de[0];oe&&(ie=oe);break}case"initialPlacement":ie=p;break}if(u!==ie)return{reset:{placement:ie}}}return{}}}};function Cf(n,o){return{top:n.top-o.height,right:n.right-o.width,bottom:n.bottom-o.height,left:n.left-o.width}}function kf(n){return M0.some(o=>n[o]>=0)}const G0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(o){const{rects:s,platform:l}=o,{strategy:u="referenceHidden",...d}=wn(n,o);switch(u){case"referenceHidden":{const f=await l.detectOverflow(o,{...d,elementContext:"reference"}),p=Cf(f,s.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:kf(p)}}}case"escaped":{const f=await l.detectOverflow(o,{...d,altBoundary:!0}),p=Cf(f,s.floating);return{data:{escapedOffsets:p,escaped:kf(p)}}}default:return{}}}}},Hp=new Set(["left","top"]);async function q0(n,o){const{placement:s,platform:l,elements:u}=n,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=xn(s),p=Yr(s),m=on(s)==="y",g=Hp.has(f)?-1:1,y=d&&m?-1:1,x=wn(o,n);let{mainAxis:k,crossAxis:v,alignmentAxis:N}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return p&&typeof N=="number"&&(v=p==="end"?N*-1:N),m?{x:v*y,y:k*g}:{x:k*g,y:v*y}}const X0=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(o){var s,l;const{x:u,y:d,placement:f,middlewareData:p}=o,m=await q0(o,n);return f===((s=p.offset)==null?void 0:s.placement)&&(l=p.arrow)!=null&&l.alignmentOffset?{}:{x:u+m.x,y:d+m.y,data:{...m,placement:f}}}}},Z0=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(o){const{x:s,y:l,placement:u,platform:d}=o,{mainAxis:f=!0,crossAxis:p=!1,limiter:m={fn:A=>{let{x:L,y:D}=A;return{x:L,y:D}}},...g}=wn(n,o),y={x:s,y:l},x=await d.detectOverflow(o,g),k=on(xn(u)),v=uu(k);let N=y[v],b=y[k];if(f){const A=v==="y"?"top":"left",L=v==="y"?"bottom":"right",D=N+x[A],z=N-x[L];N=Ua(D,N,z)}if(p){const A=k==="y"?"top":"left",L=k==="y"?"bottom":"right",D=b+x[A],z=b-x[L];b=Ua(D,b,z)}const C=m.fn({...o,[v]:N,[k]:b});return{...C,data:{x:C.x-s,y:C.y-l,enabled:{[v]:f,[k]:p}}}}}},J0=function(n){return n===void 0&&(n={}),{options:n,fn(o){const{x:s,y:l,placement:u,rects:d,middlewareData:f}=o,{offset:p=0,mainAxis:m=!0,crossAxis:g=!0}=wn(n,o),y={x:s,y:l},x=on(u),k=uu(x);let v=y[k],N=y[x];const b=wn(p,o),C=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(m){const D=k==="y"?"height":"width",z=d.reference[k]-d.floating[D]+C.mainAxis,Q=d.reference[k]+d.reference[D]-C.mainAxis;v<z?v=z:v>Q&&(v=Q)}if(g){var A,L;const D=k==="y"?"width":"height",z=Hp.has(xn(u)),Q=d.reference[x]-d.floating[D]+(z&&((A=f.offset)==null?void 0:A[x])||0)+(z?0:C.crossAxis),W=d.reference[x]+d.reference[D]+(z?0:((L=f.offset)==null?void 0:L[x])||0)-(z?C.crossAxis:0);N<Q?N=Q:N>W&&(N=W)}return{[k]:v,[x]:N}}}},ew=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(o){var s,l;const{placement:u,rects:d,platform:f,elements:p}=o,{apply:m=()=>{},...g}=wn(n,o),y=await f.detectOverflow(o,g),x=xn(u),k=Yr(u),v=on(u)==="y",{width:N,height:b}=d.floating;let C,A;x==="top"||x==="bottom"?(C=x,A=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(A=x,C=k==="end"?"top":"bottom");const L=b-y.top-y.bottom,D=N-y.left-y.right,z=Gn(b-y[C],L),Q=Gn(N-y[A],D),W=!o.middlewareData.shift;let K=z,re=Q;if((s=o.middlewareData.shift)!=null&&s.enabled.x&&(re=D),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(K=L),W&&!k){const ce=Et(y.left,0),ge=Et(y.right,0),X=Et(y.top,0),de=Et(y.bottom,0);v?re=N-2*(ce!==0||ge!==0?ce+ge:Et(y.left,y.right)):K=b-2*(X!==0||de!==0?X+de:Et(y.top,y.bottom))}await m({...o,availableWidth:re,availableHeight:K});const pe=await f.getDimensions(p.floating);return N!==pe.width||b!==pe.height?{reset:{rects:!0}}:{}}}};function _i(){return typeof window<"u"}function Gr(n){return Qp(n)?(n.nodeName||"").toLowerCase():"#document"}function bt(n){var o;return(n==null||(o=n.ownerDocument)==null?void 0:o.defaultView)||window}function an(n){var o;return(o=(Qp(n)?n.ownerDocument:n.document)||window.document)==null?void 0:o.documentElement}function Qp(n){return _i()?n instanceof Node||n instanceof bt(n).Node:!1}function Ht(n){return _i()?n instanceof Element||n instanceof bt(n).Element:!1}function ln(n){return _i()?n instanceof HTMLElement||n instanceof bt(n).HTMLElement:!1}function Pf(n){return!_i()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof bt(n).ShadowRoot}const tw=new Set(["inline","contents"]);function Qo(n){const{overflow:o,overflowX:s,overflowY:l,display:u}=Qt(n);return/auto|scroll|overlay|hidden|clip/.test(o+l+s)&&!tw.has(u)}const nw=new Set(["table","td","th"]);function rw(n){return nw.has(Gr(n))}const ow=[":popover-open",":modal"];function ji(n){return ow.some(o=>{try{return n.matches(o)}catch{return!1}})}const sw=["transform","translate","scale","rotate","perspective"],iw=["transform","translate","scale","rotate","perspective","filter"],lw=["paint","layout","strict","content"];function fu(n){const o=pu(),s=Ht(n)?Qt(n):n;return sw.some(l=>s[l]?s[l]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!o&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!o&&(s.filter?s.filter!=="none":!1)||iw.some(l=>(s.willChange||"").includes(l))||lw.some(l=>(s.contain||"").includes(l))}function aw(n){let o=qn(n);for(;ln(o)&&!Hr(o);){if(fu(o))return o;if(ji(o))return null;o=qn(o)}return null}function pu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const uw=new Set(["html","body","#document"]);function Hr(n){return uw.has(Gr(n))}function Qt(n){return bt(n).getComputedStyle(n)}function Ai(n){return Ht(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function qn(n){if(Gr(n)==="html")return n;const o=n.assignedSlot||n.parentNode||Pf(n)&&n.host||an(n);return Pf(o)?o.host:o}function Kp(n){const o=qn(n);return Hr(o)?n.ownerDocument?n.ownerDocument.body:n.body:ln(o)&&Qo(o)?o:Kp(o)}function Bo(n,o,s){var l;o===void 0&&(o=[]),s===void 0&&(s=!0);const u=Kp(n),d=u===((l=n.ownerDocument)==null?void 0:l.body),f=bt(u);if(d){const p=$a(f);return o.concat(f,f.visualViewport||[],Qo(u)?u:[],p&&s?Bo(p):[])}return o.concat(u,Bo(u,[],s))}function $a(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Yp(n){const o=Qt(n);let s=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const u=ln(n),d=u?n.offsetWidth:s,f=u?n.offsetHeight:l,p=wi(s)!==d||wi(l)!==f;return p&&(s=d,l=f),{width:s,height:l,$:p}}function hu(n){return Ht(n)?n:n.contextElement}function Vr(n){const o=hu(n);if(!ln(o))return sn(1);const s=o.getBoundingClientRect(),{width:l,height:u,$:d}=Yp(o);let f=(d?wi(s.width):s.width)/l,p=(d?wi(s.height):s.height)/u;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const cw=sn(0);function Gp(n){const o=bt(n);return!pu()||!o.visualViewport?cw:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function dw(n,o,s){return o===void 0&&(o=!1),!s||o&&s!==bt(n)?!1:o}function fr(n,o,s,l){o===void 0&&(o=!1),s===void 0&&(s=!1);const u=n.getBoundingClientRect(),d=hu(n);let f=sn(1);o&&(l?Ht(l)&&(f=Vr(l)):f=Vr(n));const p=dw(d,s,l)?Gp(d):sn(0);let m=(u.left+p.x)/f.x,g=(u.top+p.y)/f.y,y=u.width/f.x,x=u.height/f.y;if(d){const k=bt(d),v=l&&Ht(l)?bt(l):l;let N=k,b=$a(N);for(;b&&l&&v!==N;){const C=Vr(b),A=b.getBoundingClientRect(),L=Qt(b),D=A.left+(b.clientLeft+parseFloat(L.paddingLeft))*C.x,z=A.top+(b.clientTop+parseFloat(L.paddingTop))*C.y;m*=C.x,g*=C.y,y*=C.x,x*=C.y,m+=D,g+=z,N=bt(b),b=$a(N)}}return Si({width:y,height:x,x:m,y:g})}function Mi(n,o){const s=Ai(n).scrollLeft;return o?o.left+s:fr(an(n)).left+s}function qp(n,o){const s=n.getBoundingClientRect(),l=s.left+o.scrollLeft-Mi(n,s),u=s.top+o.scrollTop;return{x:l,y:u}}function fw(n){let{elements:o,rect:s,offsetParent:l,strategy:u}=n;const d=u==="fixed",f=an(l),p=o?ji(o.floating):!1;if(l===f||p&&d)return s;let m={scrollLeft:0,scrollTop:0},g=sn(1);const y=sn(0),x=ln(l);if((x||!x&&!d)&&((Gr(l)!=="body"||Qo(f))&&(m=Ai(l)),ln(l))){const v=fr(l);g=Vr(l),y.x=v.x+l.clientLeft,y.y=v.y+l.clientTop}const k=f&&!x&&!d?qp(f,m):sn(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-m.scrollLeft*g.x+y.x+k.x,y:s.y*g.y-m.scrollTop*g.y+y.y+k.y}}function pw(n){return Array.from(n.getClientRects())}function hw(n){const o=an(n),s=Ai(n),l=n.ownerDocument.body,u=Et(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),d=Et(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let f=-s.scrollLeft+Mi(n);const p=-s.scrollTop;return Qt(l).direction==="rtl"&&(f+=Et(o.clientWidth,l.clientWidth)-u),{width:u,height:d,x:f,y:p}}const Rf=25;function mw(n,o){const s=bt(n),l=an(n),u=s.visualViewport;let d=l.clientWidth,f=l.clientHeight,p=0,m=0;if(u){d=u.width,f=u.height;const y=pu();(!y||y&&o==="fixed")&&(p=u.offsetLeft,m=u.offsetTop)}const g=Mi(l);if(g<=0){const y=l.ownerDocument,x=y.body,k=getComputedStyle(x),v=y.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,N=Math.abs(l.clientWidth-x.clientWidth-v);N<=Rf&&(d-=N)}else g<=Rf&&(d+=g);return{width:d,height:f,x:p,y:m}}const gw=new Set(["absolute","fixed"]);function vw(n,o){const s=fr(n,!0,o==="fixed"),l=s.top+n.clientTop,u=s.left+n.clientLeft,d=ln(n)?Vr(n):sn(1),f=n.clientWidth*d.x,p=n.clientHeight*d.y,m=u*d.x,g=l*d.y;return{width:f,height:p,x:m,y:g}}function Tf(n,o,s){let l;if(o==="viewport")l=mw(n,s);else if(o==="document")l=hw(an(n));else if(Ht(o))l=vw(o,s);else{const u=Gp(n);l={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Si(l)}function Xp(n,o){const s=qn(n);return s===o||!Ht(s)||Hr(s)?!1:Qt(s).position==="fixed"||Xp(s,o)}function yw(n,o){const s=o.get(n);if(s)return s;let l=Bo(n,[],!1).filter(p=>Ht(p)&&Gr(p)!=="body"),u=null;const d=Qt(n).position==="fixed";let f=d?qn(n):n;for(;Ht(f)&&!Hr(f);){const p=Qt(f),m=fu(f);!m&&p.position==="fixed"&&(u=null),(d?!m&&!u:!m&&p.position==="static"&&!!u&&gw.has(u.position)||Qo(f)&&!m&&Xp(n,f))?l=l.filter(y=>y!==f):u=p,f=qn(f)}return o.set(n,l),l}function ww(n){let{element:o,boundary:s,rootBoundary:l,strategy:u}=n;const f=[...s==="clippingAncestors"?ji(o)?[]:yw(o,this._c):[].concat(s),l],p=f[0],m=f.reduce((g,y)=>{const x=Tf(o,y,u);return g.top=Et(x.top,g.top),g.right=Gn(x.right,g.right),g.bottom=Gn(x.bottom,g.bottom),g.left=Et(x.left,g.left),g},Tf(o,p,u));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function xw(n){const{width:o,height:s}=Yp(n);return{width:o,height:s}}function Sw(n,o,s){const l=ln(o),u=an(o),d=s==="fixed",f=fr(n,!0,d,o);let p={scrollLeft:0,scrollTop:0};const m=sn(0);function g(){m.x=Mi(u)}if(l||!l&&!d)if((Gr(o)!=="body"||Qo(u))&&(p=Ai(o)),l){const v=fr(o,!0,d,o);m.x=v.x+o.clientLeft,m.y=v.y+o.clientTop}else u&&g();d&&!l&&u&&g();const y=u&&!l&&!d?qp(u,p):sn(0),x=f.left+p.scrollLeft-m.x-y.x,k=f.top+p.scrollTop-m.y-y.y;return{x,y:k,width:f.width,height:f.height}}function Oa(n){return Qt(n).position==="static"}function Nf(n,o){if(!ln(n)||Qt(n).position==="fixed")return null;if(o)return o(n);let s=n.offsetParent;return an(n)===s&&(s=s.ownerDocument.body),s}function Zp(n,o){const s=bt(n);if(ji(n))return s;if(!ln(n)){let u=qn(n);for(;u&&!Hr(u);){if(Ht(u)&&!Oa(u))return u;u=qn(u)}return s}let l=Nf(n,o);for(;l&&rw(l)&&Oa(l);)l=Nf(l,o);return l&&Hr(l)&&Oa(l)&&!fu(l)?s:l||aw(n)||s}const Ew=async function(n){const o=this.getOffsetParent||Zp,s=this.getDimensions,l=await s(n.floating);return{reference:Sw(n.reference,await o(n.floating),n.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function bw(n){return Qt(n).direction==="rtl"}const Cw={convertOffsetParentRelativeRectToViewportRelativeRect:fw,getDocumentElement:an,getClippingRect:ww,getOffsetParent:Zp,getElementRects:Ew,getClientRects:pw,getDimensions:xw,getScale:Vr,isElement:Ht,isRTL:bw};function Jp(n,o){return n.x===o.x&&n.y===o.y&&n.width===o.width&&n.height===o.height}function kw(n,o){let s=null,l;const u=an(n);function d(){var p;clearTimeout(l),(p=s)==null||p.disconnect(),s=null}function f(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),d();const g=n.getBoundingClientRect(),{left:y,top:x,width:k,height:v}=g;if(p||o(),!k||!v)return;const N=fi(x),b=fi(u.clientWidth-(y+k)),C=fi(u.clientHeight-(x+v)),A=fi(y),D={rootMargin:-N+"px "+-b+"px "+-C+"px "+-A+"px",threshold:Et(0,Gn(1,m))||1};let z=!0;function Q(W){const K=W[0].intersectionRatio;if(K!==m){if(!z)return f();K?f(!1,K):l=setTimeout(()=>{f(!1,1e-7)},1e3)}K===1&&!Jp(g,n.getBoundingClientRect())&&f(),z=!1}try{s=new IntersectionObserver(Q,{...D,root:u.ownerDocument})}catch{s=new IntersectionObserver(Q,D)}s.observe(n)}return f(!0),d}function Pw(n,o,s,l){l===void 0&&(l={});const{ancestorScroll:u=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:m=!1}=l,g=hu(n),y=u||d?[...g?Bo(g):[],...Bo(o)]:[];y.forEach(A=>{u&&A.addEventListener("scroll",s,{passive:!0}),d&&A.addEventListener("resize",s)});const x=g&&p?kw(g,s):null;let k=-1,v=null;f&&(v=new ResizeObserver(A=>{let[L]=A;L&&L.target===g&&v&&(v.unobserve(o),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var D;(D=v)==null||D.observe(o)})),s()}),g&&!m&&v.observe(g),v.observe(o));let N,b=m?fr(n):null;m&&C();function C(){const A=fr(n);b&&!Jp(b,A)&&s(),b=A,N=requestAnimationFrame(C)}return s(),()=>{var A;y.forEach(L=>{u&&L.removeEventListener("scroll",s),d&&L.removeEventListener("resize",s)}),x?.(),(A=v)==null||A.disconnect(),v=null,m&&cancelAnimationFrame(N)}}const Rw=X0,Tw=Z0,Nw=Y0,Ow=ew,_w=G0,Of=K0,jw=J0,Aw=(n,o,s)=>{const l=new Map,u={platform:Cw,...s},d={...u.platform,_c:l};return Q0(n,o,{...u,platform:d})};var Mw=typeof document<"u",Lw=function(){},yi=Mw?w.useLayoutEffect:Lw;function Ei(n,o){if(n===o)return!0;if(typeof n!=typeof o)return!1;if(typeof n=="function"&&n.toString()===o.toString())return!0;let s,l,u;if(n&&o&&typeof n=="object"){if(Array.isArray(n)){if(s=n.length,s!==o.length)return!1;for(l=s;l--!==0;)if(!Ei(n[l],o[l]))return!1;return!0}if(u=Object.keys(n),s=u.length,s!==Object.keys(o).length)return!1;for(l=s;l--!==0;)if(!{}.hasOwnProperty.call(o,u[l]))return!1;for(l=s;l--!==0;){const d=u[l];if(!(d==="_owner"&&n.$$typeof)&&!Ei(n[d],o[d]))return!1}return!0}return n!==n&&o!==o}function eh(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function _f(n,o){const s=eh(n);return Math.round(o*s)/s}function _a(n){const o=w.useRef(n);return yi(()=>{o.current=n}),o}function Iw(n){n===void 0&&(n={});const{placement:o="bottom",strategy:s="absolute",middleware:l=[],platform:u,elements:{reference:d,floating:f}={},transform:p=!0,whileElementsMounted:m,open:g}=n,[y,x]=w.useState({x:0,y:0,strategy:s,placement:o,middlewareData:{},isPositioned:!1}),[k,v]=w.useState(l);Ei(k,l)||v(l);const[N,b]=w.useState(null),[C,A]=w.useState(null),L=w.useCallback(I=>{I!==W.current&&(W.current=I,b(I))},[]),D=w.useCallback(I=>{I!==K.current&&(K.current=I,A(I))},[]),z=d||N,Q=f||C,W=w.useRef(null),K=w.useRef(null),re=w.useRef(y),pe=m!=null,ce=_a(m),ge=_a(u),X=_a(g),de=w.useCallback(()=>{if(!W.current||!K.current)return;const I={placement:o,strategy:s,middleware:k};ge.current&&(I.platform=ge.current),Aw(W.current,K.current,I).then(F=>{const V={...F,isPositioned:X.current!==!1};G.current&&!Ei(re.current,V)&&(re.current=V,Ri.flushSync(()=>{x(V)}))})},[k,o,s,ge,X]);yi(()=>{g===!1&&re.current.isPositioned&&(re.current.isPositioned=!1,x(I=>({...I,isPositioned:!1})))},[g]);const G=w.useRef(!1);yi(()=>(G.current=!0,()=>{G.current=!1}),[]),yi(()=>{if(z&&(W.current=z),Q&&(K.current=Q),z&&Q){if(ce.current)return ce.current(z,Q,de);de()}},[z,Q,de,ce,pe]);const ve=w.useMemo(()=>({reference:W,floating:K,setReference:L,setFloating:D}),[L,D]),ie=w.useMemo(()=>({reference:z,floating:Q}),[z,Q]),oe=w.useMemo(()=>{const I={position:s,left:0,top:0};if(!ie.floating)return I;const F=_f(ie.floating,y.x),V=_f(ie.floating,y.y);return p?{...I,transform:"translate("+F+"px, "+V+"px)",...eh(ie.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:F,top:V}},[s,p,ie.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:de,refs:ve,elements:ie,floatingStyles:oe}),[y,de,ve,ie,oe])}const Dw=n=>{function o(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:n,fn(s){const{element:l,padding:u}=typeof n=="function"?n(s):n;return l&&o(l)?l.current!=null?Of({element:l.current,padding:u}).fn(s):{}:l?Of({element:l,padding:u}).fn(s):{}}}},Fw=(n,o)=>({...Rw(n),options:[n,o]}),zw=(n,o)=>({...Tw(n),options:[n,o]}),Uw=(n,o)=>({...jw(n),options:[n,o]}),Bw=(n,o)=>({...Nw(n),options:[n,o]}),$w=(n,o)=>({...Ow(n),options:[n,o]}),Vw=(n,o)=>({..._w(n),options:[n,o]}),Ww=(n,o)=>({...Dw(n),options:[n,o]});var Hw="Arrow",th=w.forwardRef((n,o)=>{const{children:s,width:l=10,height:u=5,...d}=n;return E.jsx(gt.svg,{...d,ref:o,width:l,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?s:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});th.displayName=Hw;var Qw=th;function Kw(n){const[o,s]=w.useState(void 0);return Yn(()=>{if(n){s({width:n.offsetWidth,height:n.offsetHeight});const l=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];let f,p;if("borderBoxSize"in d){const m=d.borderBoxSize,g=Array.isArray(m)?m[0]:m;f=g.inlineSize,p=g.blockSize}else f=n.offsetWidth,p=n.offsetHeight;s({width:f,height:p})});return l.observe(n,{box:"border-box"}),()=>l.unobserve(n)}else s(void 0)},[n]),o}var nh="Popper",[rh,oh]=Ti(nh),[pS,sh]=rh(nh),ih="PopperAnchor",lh=w.forwardRef((n,o)=>{const{__scopePopper:s,virtualRef:l,...u}=n,d=sh(ih,s),f=w.useRef(null),p=Wt(o,f),m=w.useRef(null);return w.useEffect(()=>{const g=m.current;m.current=l?.current||f.current,g!==m.current&&d.onAnchorChange(m.current)}),l?null:E.jsx(gt.div,{...u,ref:p})});lh.displayName=ih;var mu="PopperContent",[Yw,Gw]=rh(mu),ah=w.forwardRef((n,o)=>{const{__scopePopper:s,side:l="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:y=0,sticky:x="partial",hideWhenDetached:k=!1,updatePositionStrategy:v="optimized",onPlaced:N,...b}=n,C=sh(mu,s),[A,L]=w.useState(null),D=Wt(o,le=>L(le)),[z,Q]=w.useState(null),W=Kw(z),K=W?.width??0,re=W?.height??0,pe=l+(d!=="center"?"-"+d:""),ce=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ge=Array.isArray(g)?g:[g],X=ge.length>0,de={padding:ce,boundary:ge.filter(Xw),altBoundary:X},{refs:G,floatingStyles:ve,placement:ie,isPositioned:oe,middlewareData:I}=Iw({strategy:"fixed",placement:pe,whileElementsMounted:(...le)=>Pw(...le,{animationFrame:v==="always"}),elements:{reference:C.anchor},middleware:[Fw({mainAxis:u+re,alignmentAxis:f}),m&&zw({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?Uw():void 0,...de}),m&&Bw({...de}),$w({...de,apply:({elements:le,rects:Se,availableWidth:be,availableHeight:ze})=>{const{width:Ct,height:Sn}=Se.reference,kt=le.floating.style;kt.setProperty("--radix-popper-available-width",`${be}px`),kt.setProperty("--radix-popper-available-height",`${ze}px`),kt.setProperty("--radix-popper-anchor-width",`${Ct}px`),kt.setProperty("--radix-popper-anchor-height",`${Sn}px`)}}),z&&Ww({element:z,padding:p}),Zw({arrowWidth:K,arrowHeight:re}),k&&Vw({strategy:"referenceHidden",...de})]}),[F,V]=dh(ie),T=Kn(N);Yn(()=>{oe&&T?.()},[oe,T]);const M=I.arrow?.x,q=I.arrow?.y,J=I.arrow?.centerOffset!==0,[fe,ye]=w.useState();return Yn(()=>{A&&ye(window.getComputedStyle(A).zIndex)},[A]),E.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:oe?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:E.jsx(Yw,{scope:s,placedSide:F,onArrowChange:Q,arrowX:M,arrowY:q,shouldHideArrow:J,children:E.jsx(gt.div,{"data-side":F,"data-align":V,...b,ref:D,style:{...b.style,animation:oe?void 0:"none"}})})})});ah.displayName=mu;var uh="PopperArrow",qw={top:"bottom",right:"left",bottom:"top",left:"right"},ch=w.forwardRef(function(o,s){const{__scopePopper:l,...u}=o,d=Gw(uh,l),f=qw[d.placedSide];return E.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:E.jsx(Qw,{...u,ref:s,style:{...u.style,display:"block"}})})});ch.displayName=uh;function Xw(n){return n!==null}var Zw=n=>({name:"transformOrigin",options:n,fn(o){const{placement:s,rects:l,middlewareData:u}=o,f=u.arrow?.centerOffset!==0,p=f?0:n.arrowWidth,m=f?0:n.arrowHeight,[g,y]=dh(s),x={start:"0%",center:"50%",end:"100%"}[y],k=(u.arrow?.x??0)+p/2,v=(u.arrow?.y??0)+m/2;let N="",b="";return g==="bottom"?(N=f?x:`${k}px`,b=`${-m}px`):g==="top"?(N=f?x:`${k}px`,b=`${l.floating.height+m}px`):g==="right"?(N=`${-m}px`,b=f?x:`${v}px`):g==="left"&&(N=`${l.floating.width+m}px`,b=f?x:`${v}px`),{data:{x:N,y:b}}}});function dh(n){const[o,s="center"]=n.split("-");return[o,s]}var Jw=lh,ex=ah,tx=ch,[Li]=Ti("Tooltip",[oh]),gu=oh(),fh="TooltipProvider",nx=700,jf="tooltip.open",[rx,ph]=Li(fh),hh=n=>{const{__scopeTooltip:o,delayDuration:s=nx,skipDelayDuration:l=300,disableHoverableContent:u=!1,children:d}=n,f=w.useRef(!0),p=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const g=m.current;return()=>window.clearTimeout(g)},[]),E.jsx(rx,{scope:o,isOpenDelayedRef:f,delayDuration:s,onOpen:w.useCallback(()=>{window.clearTimeout(m.current),f.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>f.current=!0,l)},[l]),isPointerInTransitRef:p,onPointerInTransitChange:w.useCallback(g=>{p.current=g},[]),disableHoverableContent:u,children:d})};hh.displayName=fh;var mh="Tooltip",[hS,Ii]=Li(mh),Va="TooltipTrigger",ox=w.forwardRef((n,o)=>{const{__scopeTooltip:s,...l}=n,u=Ii(Va,s),d=ph(Va,s),f=gu(s),p=w.useRef(null),m=Wt(o,p,u.onTriggerChange),g=w.useRef(!1),y=w.useRef(!1),x=w.useCallback(()=>g.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),E.jsx(Jw,{asChild:!0,...f,children:E.jsx(gt.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...l,ref:m,onPointerMove:Ve(n.onPointerMove,k=>{k.pointerType!=="touch"&&!y.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ve(n.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:Ve(n.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Ve(n.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ve(n.onBlur,u.onClose),onClick:Ve(n.onClick,u.onClose)})})});ox.displayName=Va;var sx="TooltipPortal",[mS,ix]=Li(sx,{forceMount:void 0}),Qr="TooltipContent",gh=w.forwardRef((n,o)=>{const s=ix(Qr,n.__scopeTooltip),{forceMount:l=s.forceMount,side:u="top",...d}=n,f=Ii(Qr,n.__scopeTooltip);return E.jsx(ou,{present:l||f.open,children:f.disableHoverableContent?E.jsx(vh,{side:u,...d,ref:o}):E.jsx(lx,{side:u,...d,ref:o})})}),lx=w.forwardRef((n,o)=>{const s=Ii(Qr,n.__scopeTooltip),l=ph(Qr,n.__scopeTooltip),u=w.useRef(null),d=Wt(o,u),[f,p]=w.useState(null),{trigger:m,onClose:g}=s,y=u.current,{onPointerInTransitChange:x}=l,k=w.useCallback(()=>{p(null),x(!1)},[x]),v=w.useCallback((N,b)=>{const C=N.currentTarget,A={x:N.clientX,y:N.clientY},L=fx(A,C.getBoundingClientRect()),D=px(A,L),z=hx(b.getBoundingClientRect()),Q=gx([...D,...z]);p(Q),x(!0)},[x]);return w.useEffect(()=>()=>k(),[k]),w.useEffect(()=>{if(m&&y){const N=C=>v(C,y),b=C=>v(C,m);return m.addEventListener("pointerleave",N),y.addEventListener("pointerleave",b),()=>{m.removeEventListener("pointerleave",N),y.removeEventListener("pointerleave",b)}}},[m,y,v,k]),w.useEffect(()=>{if(f){const N=b=>{const C=b.target,A={x:b.clientX,y:b.clientY},L=m?.contains(C)||y?.contains(C),D=!mx(A,f);L?k():D&&(k(),g())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[m,y,f,g,k]),E.jsx(vh,{...n,ref:d})}),[ax,ux]=Li(mh,{isInside:!1}),cx=Xg("TooltipContent"),vh=w.forwardRef((n,o)=>{const{__scopeTooltip:s,children:l,"aria-label":u,onEscapeKeyDown:d,onPointerDownOutside:f,...p}=n,m=Ii(Qr,s),g=gu(s),{onClose:y}=m;return w.useEffect(()=>(document.addEventListener(jf,y),()=>document.removeEventListener(jf,y)),[y]),w.useEffect(()=>{if(m.trigger){const x=k=>{k.target?.contains(m.trigger)&&y()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[m.trigger,y]),E.jsx(ru,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:x=>x.preventDefault(),onDismiss:y,children:E.jsxs(ex,{"data-state":m.stateAttribute,...g,...p,ref:o,style:{...p.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:[E.jsx(cx,{children:l}),E.jsx(ax,{scope:s,isInside:!0,children:E.jsx(Ev,{id:m.contentId,role:"tooltip",children:u||l})})]})})});gh.displayName=Qr;var yh="TooltipArrow",dx=w.forwardRef((n,o)=>{const{__scopeTooltip:s,...l}=n,u=gu(s);return ux(yh,s).isInside?null:E.jsx(tx,{...u,...l,ref:o})});dx.displayName=yh;function fx(n,o){const s=Math.abs(o.top-n.y),l=Math.abs(o.bottom-n.y),u=Math.abs(o.right-n.x),d=Math.abs(o.left-n.x);switch(Math.min(s,l,u,d)){case d:return"left";case u:return"right";case s:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function px(n,o,s=5){const l=[];switch(o){case"top":l.push({x:n.x-s,y:n.y+s},{x:n.x+s,y:n.y+s});break;case"bottom":l.push({x:n.x-s,y:n.y-s},{x:n.x+s,y:n.y-s});break;case"left":l.push({x:n.x+s,y:n.y-s},{x:n.x+s,y:n.y+s});break;case"right":l.push({x:n.x-s,y:n.y-s},{x:n.x-s,y:n.y+s});break}return l}function hx(n){const{top:o,right:s,bottom:l,left:u}=n;return[{x:u,y:o},{x:s,y:o},{x:s,y:l},{x:u,y:l}]}function mx(n,o){const{x:s,y:l}=n;let u=!1;for(let d=0,f=o.length-1;d<o.length;f=d++){const p=o[d],m=o[f],g=p.x,y=p.y,x=m.x,k=m.y;y>l!=k>l&&s<(x-g)*(l-y)/(k-y)+g&&(u=!u)}return u}function gx(n){const o=n.slice();return o.sort((s,l)=>s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0),vx(o)}function vx(n){if(n.length<=1)return n.slice();const o=[];for(let l=0;l<n.length;l++){const u=n[l];for(;o.length>=2;){const d=o[o.length-1],f=o[o.length-2];if((d.x-f.x)*(u.y-f.y)>=(d.y-f.y)*(u.x-f.x))o.pop();else break}o.push(u)}o.pop();const s=[];for(let l=n.length-1;l>=0;l--){const u=n[l];for(;s.length>=2;){const d=s[s.length-1],f=s[s.length-2];if((d.x-f.x)*(u.y-f.y)>=(d.y-f.y)*(u.x-f.x))s.pop();else break}s.push(u)}return s.pop(),o.length===1&&s.length===1&&o[0].x===s[0].x&&o[0].y===s[0].y?o:o.concat(s)}var yx=hh,wh=gh;const wx=yx,xx=w.forwardRef(({className:n,sideOffset:o=4,...s},l)=>E.jsx(wh,{ref:l,sideOffset:o,className:Le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...s}));xx.displayName=wh.displayName;var Ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sx={setTimeout:(n,o)=>setTimeout(n,o),clearTimeout:n=>clearTimeout(n),setInterval:(n,o)=>setInterval(n,o),clearInterval:n=>clearInterval(n)},Ex=class{#e=Sx;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,o){return this.#e.setTimeout(n,o)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,o){return this.#e.setInterval(n,o)}clearInterval(n){this.#e.clearInterval(n)}},dr=new Ex;function bx(n){setTimeout(n,0)}var pr=typeof window>"u"||"Deno"in globalThis;function ht(){}function Cx(n,o){return typeof n=="function"?n(o):n}function Wa(n){return typeof n=="number"&&n>=0&&n!==1/0}function xh(n,o){return Math.max(n+(o||0)-Date.now(),0)}function Qn(n,o){return typeof n=="function"?n(o):n}function At(n,o){return typeof n=="function"?n(o):n}function Af(n,o){const{type:s="all",exact:l,fetchStatus:u,predicate:d,queryKey:f,stale:p}=n;if(f){if(l){if(o.queryHash!==vu(f,o.options))return!1}else if(!Vo(o.queryKey,f))return!1}if(s!=="all"){const m=o.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof p=="boolean"&&o.isStale()!==p||u&&u!==o.state.fetchStatus||d&&!d(o))}function Mf(n,o){const{exact:s,status:l,predicate:u,mutationKey:d}=n;if(d){if(!o.options.mutationKey)return!1;if(s){if($o(o.options.mutationKey)!==$o(d))return!1}else if(!Vo(o.options.mutationKey,d))return!1}return!(l&&o.state.status!==l||u&&!u(o))}function vu(n,o){return(o?.queryKeyHashFn||$o)(n)}function $o(n){return JSON.stringify(n,(o,s)=>Qa(s)?Object.keys(s).sort().reduce((l,u)=>(l[u]=s[u],l),{}):s)}function Vo(n,o){return n===o?!0:typeof n!=typeof o?!1:n&&o&&typeof n=="object"&&typeof o=="object"?Object.keys(o).every(s=>Vo(n[s],o[s])):!1}var kx=Object.prototype.hasOwnProperty;function Sh(n,o,s=0){if(n===o)return n;if(s>500)return o;const l=Lf(n)&&Lf(o);if(!l&&!(Qa(n)&&Qa(o)))return o;const d=(l?n:Object.keys(n)).length,f=l?o:Object.keys(o),p=f.length,m=l?new Array(p):{};let g=0;for(let y=0;y<p;y++){const x=l?y:f[y],k=n[x],v=o[x];if(k===v){m[x]=k,(l?y<d:kx.call(n,x))&&g++;continue}if(k===null||v===null||typeof k!="object"||typeof v!="object"){m[x]=v;continue}const N=Sh(k,v,s+1);m[x]=N,N===k&&g++}return d===p&&g===d?n:m}function Ha(n,o){if(!o||Object.keys(n).length!==Object.keys(o).length)return!1;for(const s in n)if(n[s]!==o[s])return!1;return!0}function Lf(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Qa(n){if(!If(n))return!1;const o=n.constructor;if(o===void 0)return!0;const s=o.prototype;return!(!If(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function If(n){return Object.prototype.toString.call(n)==="[object Object]"}function Px(n){return new Promise(o=>{dr.setTimeout(o,n)})}function Ka(n,o,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,o):s.structuralSharing!==!1?Sh(n,o):o}function Rx(n,o,s=0){const l=[...n,o];return s&&l.length>s?l.slice(1):l}function Tx(n,o,s=0){const l=[o,...n];return s&&l.length>s?l.slice(0,-1):l}var yu=Symbol();function Eh(n,o){return!n.queryFn&&o?.initialPromise?()=>o.initialPromise:!n.queryFn||n.queryFn===yu?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function bh(n,o){return typeof n=="function"?n(...o):!!n}function Nx(n,o,s){let l=!1,u;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(u??=o(),l||(l=!0,u.aborted?s():u.addEventListener("abort",s,{once:!0})),u)}),n}var Ox=class extends Ko{#e;#t;#n;constructor(){super(),this.#n=n=>{if(!pr&&window.addEventListener){const o=()=>n();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(o=>{o(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},wu=new Ox;function Ya(){let n,o;const s=new Promise((u,d)=>{n=u,o=d});s.status="pending",s.catch(()=>{});function l(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{l({status:"fulfilled",value:u}),n(u)},s.reject=u=>{l({status:"rejected",reason:u}),o(u)},s}var _x=bx;function jx(){let n=[],o=0,s=p=>{p()},l=p=>{p()},u=_x;const d=p=>{o?n.push(p):u(()=>{s(p)})},f=()=>{const p=n;n=[],p.length&&u(()=>{l(()=>{p.forEach(m=>{s(m)})})})};return{batch:p=>{let m;o++;try{m=p()}finally{o--,o||f()}return m},batchCalls:p=>(...m)=>{d(()=>{p(...m)})},schedule:d,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{l=p},setScheduler:p=>{u=p}}}var qe=jx(),Ax=class extends Ko{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(!pr&&window.addEventListener){const o=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(s=>{s(n)}))}isOnline(){return this.#e}},bi=new Ax;function Mx(n){return Math.min(1e3*2**n,3e4)}function Ch(n){return(n??"online")==="online"?bi.isOnline():!0}var Ga=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function kh(n){let o=!1,s=0,l;const u=Ya(),d=()=>u.status!=="pending",f=b=>{if(!d()){const C=new Ga(b);k(C),n.onCancel?.(C)}},p=()=>{o=!0},m=()=>{o=!1},g=()=>wu.isFocused()&&(n.networkMode==="always"||bi.isOnline())&&n.canRun(),y=()=>Ch(n.networkMode)&&n.canRun(),x=b=>{d()||(l?.(),u.resolve(b))},k=b=>{d()||(l?.(),u.reject(b))},v=()=>new Promise(b=>{l=C=>{(d()||g())&&b(C)},n.onPause?.()}).then(()=>{l=void 0,d()||n.onContinue?.()}),N=()=>{if(d())return;let b;const C=s===0?n.initialPromise:void 0;try{b=C??n.fn()}catch(A){b=Promise.reject(A)}Promise.resolve(b).then(x).catch(A=>{if(d())return;const L=n.retry??(pr?0:3),D=n.retryDelay??Mx,z=typeof D=="function"?D(s,A):D,Q=L===!0||typeof L=="number"&&s<L||typeof L=="function"&&L(s,A);if(o||!Q){k(A);return}s++,n.onFail?.(s,A),Px(z).then(()=>g()?void 0:v()).then(()=>{o?k(A):N()})})};return{promise:u,status:()=>u.status,cancel:f,continue:()=>(l?.(),u),cancelRetry:p,continueRetry:m,canStart:y,start:()=>(y()?N():v().then(N),u)}}var Ph=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wa(this.gcTime)&&(this.#e=dr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(pr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(dr.clearTimeout(this.#e),this.#e=void 0)}},Lx=class extends Ph{#e;#t;#n;#o;#r;#l;#i;constructor(n){super(),this.#i=!1,this.#l=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#o=n.client,this.#n=this.#o.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=Ff(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(n){if(this.options={...this.#l,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=Ff(this.options);o.data!==void 0&&(this.setState(Df(o.data,o.dataUpdatedAt)),this.#e=o)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,o){const s=Ka(this.state.data,n,this.options);return this.#s({data:s,type:"success",dataUpdatedAt:o?.updatedAt,manual:o?.manual}),s}setState(n,o){this.#s({type:"setState",state:n,setStateOptions:o})}cancel(n){const o=this.#r?.promise;return this.#r?.cancel(n),o?o.then(ht).catch(ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>At(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yu||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Qn(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!xh(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(o=>o.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(o=>o.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(o=>o!==n),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(n,o){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&o?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(n&&this.setOptions(n),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const s=new AbortController,l=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#i=!0,s.signal)})},u=()=>{const p=Eh(this.options,o),g=(()=>{const y={client:this.#o,queryKey:this.queryKey,meta:this.meta};return l(y),y})();return this.#i=!1,this.options.persister?this.options.persister(p,g,this):p(g)},f=(()=>{const p={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:u};return l(p),p})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=kh({initialPromise:o?.initialPromise,fn:f.fetchFn,onCancel:p=>{p instanceof Ga&&p.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(p,m)=>{this.#s({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const p=await this.#r.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#n.config.onSuccess?.(p,this),this.#n.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof Ga){if(p.silent)return this.#r.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#n.config.onError?.(p,this),this.#n.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#s(n){const o=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Rh(s.data,this.options),fetchMeta:n.meta??null};case"success":const l={...s,...Df(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=n.manual?l:void 0,l;case"error":const u=n.error;return{...s,error:u,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=o(this.state),qe.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function Rh(n,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ch(o.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Df(n,o){return{data:n,dataUpdatedAt:o??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ff(n){const o=typeof n.initialData=="function"?n.initialData():n.initialData,s=o!==void 0,l=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:s?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Ix=class extends Ko{constructor(n,o){super(),this.options=o,this.#e=n,this.#s=null,this.#i=Ya(),this.bindMethods(),this.setOptions(o)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#l;#i;#s;#m;#f;#p;#u;#c;#a;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),zf(this.#t,this.options)?this.#d():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qa(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qa(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(n){const o=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof At(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),o._defaulted&&!Ha(this.options,o)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&Uf(this.#t,s,this.options,o)&&this.#d(),this.updateResult(),l&&(this.#t!==s||At(this.options.enabled,this.#t)!==At(o.enabled,this.#t)||Qn(this.options.staleTime,this.#t)!==Qn(o.staleTime,this.#t))&&this.#g();const u=this.#v();l&&(this.#t!==s||At(this.options.enabled,this.#t)!==At(o.enabled,this.#t)||u!==this.#a)&&this.#y(u)}getOptimisticResult(n){const o=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(o,n);return Fx(this,s)&&(this.#o=s,this.#l=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#o}trackResult(n,o){return new Proxy(n,{get:(s,l)=>(this.trackProp(l),o?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(n){this.#h.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const o=this.#e.defaultQueryOptions(n),s=this.#e.getQueryCache().build(this.#e,o);return s.fetch().then(()=>this.createResult(s,o))}fetch(n){return this.#d({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(n){this.#E();let o=this.#t.fetch(this.options,n);return n?.throwOnError||(o=o.catch(ht)),o}#g(){this.#x();const n=Qn(this.options.staleTime,this.#t);if(pr||this.#o.isStale||!Wa(n))return;const s=xh(this.#o.dataUpdatedAt,n)+1;this.#u=dr.setTimeout(()=>{this.#o.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(n){this.#S(),this.#a=n,!(pr||At(this.options.enabled,this.#t)===!1||!Wa(this.#a)||this.#a===0)&&(this.#c=dr.setInterval(()=>{(this.options.refetchIntervalInBackground||wu.isFocused())&&this.#d()},this.#a))}#w(){this.#g(),this.#y(this.#v())}#x(){this.#u&&(dr.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(dr.clearInterval(this.#c),this.#c=void 0)}createResult(n,o){const s=this.#t,l=this.options,u=this.#o,d=this.#r,f=this.#l,m=n!==s?n.state:this.#n,{state:g}=n;let y={...g},x=!1,k;if(o._optimisticResults){const re=this.hasListeners(),pe=!re&&zf(n,o),ce=re&&Uf(n,s,o,l);(pe||ce)&&(y={...y,...Rh(g.data,n.options)}),o._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:v,errorUpdatedAt:N,status:b}=y;k=y.data;let C=!1;if(o.placeholderData!==void 0&&k===void 0&&b==="pending"){let re;u?.isPlaceholderData&&o.placeholderData===f?.placeholderData?(re=u.data,C=!0):re=typeof o.placeholderData=="function"?o.placeholderData(this.#p?.state.data,this.#p):o.placeholderData,re!==void 0&&(b="success",k=Ka(u?.data,re,o),x=!0)}if(o.select&&k!==void 0&&!C)if(u&&k===d?.data&&o.select===this.#m)k=this.#f;else try{this.#m=o.select,k=o.select(k),k=Ka(u?.data,k,o),this.#f=k,this.#s=null}catch(re){this.#s=re}this.#s&&(v=this.#s,k=this.#f,N=Date.now(),b="error");const A=y.fetchStatus==="fetching",L=b==="pending",D=b==="error",z=L&&A,Q=k!==void 0,K={status:b,fetchStatus:y.fetchStatus,isPending:L,isSuccess:b==="success",isError:D,isInitialLoading:z,isLoading:z,data:k,dataUpdatedAt:y.dataUpdatedAt,error:v,errorUpdatedAt:N,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:A,isRefetching:A&&!L,isLoadingError:D&&!Q,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&Q,isStale:xu(n,o),refetch:this.refetch,promise:this.#i,isEnabled:At(o.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const re=K.data!==void 0,pe=K.status==="error"&&!re,ce=de=>{pe?de.reject(K.error):re&&de.resolve(K.data)},ge=()=>{const de=this.#i=K.promise=Ya();ce(de)},X=this.#i;switch(X.status){case"pending":n.queryHash===s.queryHash&&ce(X);break;case"fulfilled":(pe||K.data!==X.value)&&ge();break;case"rejected":(!pe||K.error!==X.reason)&&ge();break}}return K}updateResult(){const n=this.#o,o=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#l=this.options,this.#r.data!==void 0&&(this.#p=this.#t),Ha(o,n))return;this.#o=o;const s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!this.#h.size)return!0;const d=new Set(u??this.#h);return this.options.throwOnError&&d.add("error"),Object.keys(this.#o).some(f=>{const p=f;return this.#o[p]!==n[p]&&d.has(p)})};this.#b({listeners:s()})}#E(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const o=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(o?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}#b(n){qe.batch(()=>{n.listeners&&this.listeners.forEach(o=>{o(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Dx(n,o){return At(o.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&o.retryOnMount===!1)}function zf(n,o){return Dx(n,o)||n.state.data!==void 0&&qa(n,o,o.refetchOnMount)}function qa(n,o,s){if(At(o.enabled,n)!==!1&&Qn(o.staleTime,n)!=="static"){const l=typeof s=="function"?s(n):s;return l==="always"||l!==!1&&xu(n,o)}return!1}function Uf(n,o,s,l){return(n!==o||At(l.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&xu(n,s)}function xu(n,o){return At(o.enabled,n)!==!1&&n.isStaleByTime(Qn(o.staleTime,n))}function Fx(n,o){return!Ha(n.getCurrentResult(),o)}function Bf(n){return{onFetch:(o,s)=>{const l=o.options,u=o.fetchOptions?.meta?.fetchMore?.direction,d=o.state.data?.pages||[],f=o.state.data?.pageParams||[];let p={pages:[],pageParams:[]},m=0;const g=async()=>{let y=!1;const x=N=>{Nx(N,()=>o.signal,()=>y=!0)},k=Eh(o.options,o.fetchOptions),v=async(N,b,C)=>{if(y)return Promise.reject();if(b==null&&N.pages.length)return Promise.resolve(N);const L=(()=>{const W={client:o.client,queryKey:o.queryKey,pageParam:b,direction:C?"backward":"forward",meta:o.options.meta};return x(W),W})(),D=await k(L),{maxPages:z}=o.options,Q=C?Tx:Rx;return{pages:Q(N.pages,D,z),pageParams:Q(N.pageParams,b,z)}};if(u&&d.length){const N=u==="backward",b=N?zx:$f,C={pages:d,pageParams:f},A=b(l,C);p=await v(C,A,N)}else{const N=n??d.length;do{const b=m===0?f[0]??l.initialPageParam:$f(l,p);if(m>0&&b==null)break;p=await v(p,b),m++}while(m<N)}return p};o.options.persister?o.fetchFn=()=>o.options.persister?.(g,{client:o.client,queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},s):o.fetchFn=g}}}function $f(n,{pages:o,pageParams:s}){const l=o.length-1;return o.length>0?n.getNextPageParam(o[l],o,s[l],s):void 0}function zx(n,{pages:o,pageParams:s}){return o.length>0?n.getPreviousPageParam?.(o[0],o,s[0],s):void 0}var Ux=class extends Ph{#e;#t;#n;#o;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Bx(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(o=>o!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(n){const o=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=kh({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(d,f)=>{this.#r({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#r({type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",u=!this.#o.canStart();try{if(l)o();else{this.#r({type:"pending",variables:n,isPaused:u}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,s);const f=await this.options.onMutate?.(n,s);f!==this.state.context&&this.#r({type:"pending",context:f,variables:n,isPaused:u})}const d=await this.#o.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,s),await this.options.onSuccess?.(d,n,this.state.context,s),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(d,null,n,this.state.context,s),this.#r({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onError?.(d,n,this.state.context,s)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,s)}catch(f){Promise.reject(f)}throw this.#r({type:"error",error:d}),d}finally{this.#n.runNext(this)}}#r(n){const o=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=o(this.state),qe.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Bx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $x=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,o,s){const l=new Ux({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(o),state:s});return this.add(l),l}add(n){this.#e.add(n);const o=pi(n);if(typeof o=="string"){const s=this.#t.get(o);s?s.push(n):this.#t.set(o,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const o=pi(n);if(typeof o=="string"){const s=this.#t.get(o);if(s)if(s.length>1){const l=s.indexOf(n);l!==-1&&s.splice(l,1)}else s[0]===n&&this.#t.delete(o)}}this.notify({type:"removed",mutation:n})}canRun(n){const o=pi(n);if(typeof o=="string"){const l=this.#t.get(o)?.find(u=>u.state.status==="pending");return!l||l===n}else return!0}runNext(n){const o=pi(n);return typeof o=="string"?this.#t.get(o)?.find(l=>l!==n&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){qe.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const o={exact:!0,...n};return this.getAll().find(s=>Mf(o,s))}findAll(n={}){return this.getAll().filter(o=>Mf(n,o))}notify(n){qe.batch(()=>{this.listeners.forEach(o=>{o(n)})})}resumePausedMutations(){const n=this.getAll().filter(o=>o.state.isPaused);return qe.batch(()=>Promise.all(n.map(o=>o.continue().catch(ht))))}};function pi(n){return n.options.scope?.id}var Vx=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,o,s){const l=o.queryKey,u=o.queryHash??vu(l,o);let d=this.get(u);return d||(d=new Lx({client:n,queryKey:l,queryHash:u,options:n.defaultQueryOptions(o),state:s,defaultOptions:n.getQueryDefaults(l)}),this.add(d)),d}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const o=this.#e.get(n.queryHash);o&&(n.destroy(),o===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){qe.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const o={exact:!0,...n};return this.getAll().find(s=>Af(o,s))}findAll(n={}){const o=this.getAll();return Object.keys(n).length>0?o.filter(s=>Af(n,s)):o}notify(n){qe.batch(()=>{this.listeners.forEach(o=>{o(n)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Wx=class{#e;#t;#n;#o;#r;#l;#i;#s;constructor(n={}){this.#e=n.queryCache||new Vx,this.#t=n.mutationCache||new $x,this.#n=n.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#i=wu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bi.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const o=this.defaultQueryOptions({queryKey:n});return this.#e.get(o.queryHash)?.state.data}ensureQueryData(n){const o=this.defaultQueryOptions(n),s=this.#e.build(this,o),l=s.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(Qn(o.staleTime,s))&&this.prefetchQuery(o),Promise.resolve(l))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:o,state:s})=>{const l=s.data;return[o,l]})}setQueryData(n,o,s){const l=this.defaultQueryOptions({queryKey:n}),d=this.#e.get(l.queryHash)?.state.data,f=Cx(o,d);if(f!==void 0)return this.#e.build(this,l).setData(f,{...s,manual:!0})}setQueriesData(n,o,s){return qe.batch(()=>this.#e.findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,o,s)]))}getQueryState(n){const o=this.defaultQueryOptions({queryKey:n});return this.#e.get(o.queryHash)?.state}removeQueries(n){const o=this.#e;qe.batch(()=>{o.findAll(n).forEach(s=>{o.remove(s)})})}resetQueries(n,o){const s=this.#e;return qe.batch(()=>(s.findAll(n).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...n},o)))}cancelQueries(n,o={}){const s={revert:!0,...o},l=qe.batch(()=>this.#e.findAll(n).map(u=>u.cancel(s)));return Promise.all(l).then(ht).catch(ht)}invalidateQueries(n,o={}){return qe.batch(()=>(this.#e.findAll(n).forEach(s=>{s.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},o)))}refetchQueries(n,o={}){const s={...o,cancelRefetch:o.cancelRefetch??!0},l=qe.batch(()=>this.#e.findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let d=u.fetch(void 0,s);return s.throwOnError||(d=d.catch(ht)),u.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(l).then(ht)}fetchQuery(n){const o=this.defaultQueryOptions(n);o.retry===void 0&&(o.retry=!1);const s=this.#e.build(this,o);return s.isStaleByTime(Qn(o.staleTime,s))?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ht).catch(ht)}fetchInfiniteQuery(n){return n.behavior=Bf(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ht).catch(ht)}ensureInfiniteQueryData(n){return n.behavior=Bf(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return bi.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,o){this.#o.set($o(n),{queryKey:n,defaultOptions:o})}getQueryDefaults(n){const o=[...this.#o.values()],s={};return o.forEach(l=>{Vo(n,l.queryKey)&&Object.assign(s,l.defaultOptions)}),s}setMutationDefaults(n,o){this.#r.set($o(n),{mutationKey:n,defaultOptions:o})}getMutationDefaults(n){const o=[...this.#r.values()],s={};return o.forEach(l=>{Vo(n,l.mutationKey)&&Object.assign(s,l.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const o={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return o.queryHash||(o.queryHash=vu(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.queryFn===yu&&(o.enabled=!1),o}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Th=w.createContext(void 0),Hx=n=>{const o=w.useContext(Th);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},Qx=({client:n,children:o})=>(w.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),E.jsx(Th.Provider,{value:n,children:o})),Nh=w.createContext(!1),Kx=()=>w.useContext(Nh);Nh.Provider;function Yx(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Gx=w.createContext(Yx()),qx=()=>w.useContext(Gx),Xx=(n,o,s)=>{const l=s?.state.error&&typeof n.throwOnError=="function"?bh(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||l)&&(o.isReset()||(n.retryOnMount=!1))},Zx=n=>{w.useEffect(()=>{n.clearReset()},[n])},Jx=({result:n,errorResetBoundary:o,throwOnError:s,query:l,suspense:u})=>n.isError&&!o.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||bh(s,[n.error,l])),e1=n=>{if(n.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>s(l(...u)):s(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},t1=(n,o)=>n.isLoading&&n.isFetching&&!o,n1=(n,o)=>n?.suspense&&o.isPending,Vf=(n,o,s)=>o.fetchOptimistic(n).catch(()=>{s.clearReset()});function r1(n,o,s){const l=Kx(),u=qx(),d=Hx(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=d.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",e1(f),Xx(f,u,p),Zx(u);const m=!d.getQueryCache().get(f.queryHash),[g]=w.useState(()=>new o(d,f)),y=g.getOptimisticResult(f),x=!l&&n.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(k=>{const v=x?g.subscribe(qe.batchCalls(k)):ht;return g.updateResult(),v},[g,x]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),w.useEffect(()=>{g.setOptions(f)},[f,g]),n1(f,y))throw Vf(f,g,u);if(Jx({result:y,errorResetBoundary:u,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw y.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,y),f.experimental_prefetchInRender&&!pr&&t1(y,l)&&(m?Vf(f,g,u):p?.promise)?.catch(ht).finally(()=>{g.updateResult()}),f.notifyOnChangeProps?y:g.trackResult(y)}function o1(n,o){return r1(n,Ix)}function Ci(){return Ci=Object.assign?Object.assign.bind():function(n){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(n[l]=s[l])}return n},Ci.apply(this,arguments)}var Hn;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Hn||(Hn={}));const Wf="popstate";function s1(n){n===void 0&&(n={});function o(l,u){let{pathname:d,search:f,hash:p}=l.location;return Xa("",{pathname:d,search:f,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function s(l,u){return typeof u=="string"?u:_h(u)}return l1(o,s,null,n)}function mt(n,o){if(n===!1||n===null||typeof n>"u")throw new Error(o)}function Oh(n,o){if(!n){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function i1(){return Math.random().toString(36).substr(2,8)}function Hf(n,o){return{usr:n.state,key:n.key,idx:o}}function Xa(n,o,s,l){return s===void 0&&(s=null),Ci({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof o=="string"?Di(o):o,{state:s,key:o&&o.key||l||i1()})}function _h(n){let{pathname:o="/",search:s="",hash:l=""}=n;return s&&s!=="?"&&(o+=s.charAt(0)==="?"?s:"?"+s),l&&l!=="#"&&(o+=l.charAt(0)==="#"?l:"#"+l),o}function Di(n){let o={};if(n){let s=n.indexOf("#");s>=0&&(o.hash=n.substr(s),n=n.substr(0,s));let l=n.indexOf("?");l>=0&&(o.search=n.substr(l),n=n.substr(0,l)),n&&(o.pathname=n)}return o}function l1(n,o,s,l){l===void 0&&(l={});let{window:u=document.defaultView,v5Compat:d=!1}=l,f=u.history,p=Hn.Pop,m=null,g=y();g==null&&(g=0,f.replaceState(Ci({},f.state,{idx:g}),""));function y(){return(f.state||{idx:null}).idx}function x(){p=Hn.Pop;let C=y(),A=C==null?null:C-g;g=C,m&&m({action:p,location:b.location,delta:A})}function k(C,A){p=Hn.Push;let L=Xa(b.location,C,A);g=y()+1;let D=Hf(L,g),z=b.createHref(L);try{f.pushState(D,"",z)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;u.location.assign(z)}d&&m&&m({action:p,location:b.location,delta:1})}function v(C,A){p=Hn.Replace;let L=Xa(b.location,C,A);g=y();let D=Hf(L,g),z=b.createHref(L);f.replaceState(D,"",z),d&&m&&m({action:p,location:b.location,delta:0})}function N(C){let A=u.location.origin!=="null"?u.location.origin:u.location.href,L=typeof C=="string"?C:_h(C);return L=L.replace(/ $/,"%20"),mt(A,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,A)}let b={get action(){return p},get location(){return n(u,f)},listen(C){if(m)throw new Error("A history only accepts one active listener");return u.addEventListener(Wf,x),m=C,()=>{u.removeEventListener(Wf,x),m=null}},createHref(C){return o(u,C)},createURL:N,encodeLocation(C){let A=N(C);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:k,replace:v,go(C){return f.go(C)}};return b}var Qf;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Qf||(Qf={}));function a1(n,o,s){return s===void 0&&(s="/"),u1(n,o,s)}function u1(n,o,s,l){let u=typeof o=="string"?Di(o):o,d=Mh(u.pathname||"/",s);if(d==null)return null;let f=jh(n);c1(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=E1(d);p=w1(f[m],g)}return p}function jh(n,o,s,l){o===void 0&&(o=[]),s===void 0&&(s=[]),l===void 0&&(l="");let u=(d,f,p)=>{let m={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};m.relativePath.startsWith("/")&&(mt(m.relativePath.startsWith(l),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(l.length));let g=Wr([l,m.relativePath]),y=s.concat(m);d.children&&d.children.length>0&&(mt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),jh(d.children,o,y,g)),!(d.path==null&&!d.index)&&o.push({path:g,score:v1(g,d.index),routesMeta:y})};return n.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))u(d,f);else for(let m of Ah(d.path))u(d,f,m)}),o}function Ah(n){let o=n.split("/");if(o.length===0)return[];let[s,...l]=o,u=s.endsWith("?"),d=s.replace(/\?$/,"");if(l.length===0)return u?[d,""]:[d];let f=Ah(l.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),u&&p.push(...f),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function c1(n){n.sort((o,s)=>o.score!==s.score?s.score-o.score:y1(o.routesMeta.map(l=>l.childrenIndex),s.routesMeta.map(l=>l.childrenIndex)))}const d1=/^:[\w-]+$/,f1=3,p1=2,h1=1,m1=10,g1=-2,Kf=n=>n==="*";function v1(n,o){let s=n.split("/"),l=s.length;return s.some(Kf)&&(l+=g1),o&&(l+=p1),s.filter(u=>!Kf(u)).reduce((u,d)=>u+(d1.test(d)?f1:d===""?h1:m1),l)}function y1(n,o){return n.length===o.length&&n.slice(0,-1).every((l,u)=>l===o[u])?n[n.length-1]-o[o.length-1]:0}function w1(n,o,s){let{routesMeta:l}=n,u={},d="/",f=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=d==="/"?o:o.slice(d.length)||"/",x=x1({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),k=m.route;if(!x)return null;Object.assign(u,x.params),f.push({params:u,pathname:Wr([d,x.pathname]),pathnameBase:b1(Wr([d,x.pathnameBase])),route:k}),x.pathnameBase!=="/"&&(d=Wr([d,x.pathnameBase]))}return f}function x1(n,o){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,l]=S1(n.path,n.caseSensitive,n.end),u=o.match(s);if(!u)return null;let d=u[0],f=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:l.reduce((g,y,x)=>{let{paramName:k,isOptional:v}=y;if(k==="*"){let b=p[x]||"";f=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const N=p[x];return v&&!N?g[k]=void 0:g[k]=(N||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:n}}function S1(n,o,s){o===void 0&&(o=!1),s===void 0&&(s=!0),Oh(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let l=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m)=>(l.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(l.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,o?void 0:"i"),l]}function E1(n){try{return n.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Oh(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),n}}function Mh(n,o){if(o==="/")return n;if(!n.toLowerCase().startsWith(o.toLowerCase()))return null;let s=o.endsWith("/")?o.length-1:o.length,l=n.charAt(s);return l&&l!=="/"?null:n.slice(s)||"/"}const Wr=n=>n.join("/").replace(/\/\/+/g,"/"),b1=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/");function C1(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Lh=["post","put","patch","delete"];new Set(Lh);const k1=["get",...Lh];new Set(k1);function ki(){return ki=Object.assign?Object.assign.bind():function(n){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(n[l]=s[l])}return n},ki.apply(this,arguments)}const P1=w.createContext(null),R1=w.createContext(null),Ih=w.createContext(null),Fi=w.createContext(null),zi=w.createContext({outlet:null,matches:[],isDataRoute:!1}),Dh=w.createContext(null);function Su(){return w.useContext(Fi)!=null}function Fh(){return Su()||mt(!1),w.useContext(Fi).location}function T1(n,o){return N1(n,o)}function N1(n,o,s,l){Su()||mt(!1);let{navigator:u}=w.useContext(Ih),{matches:d}=w.useContext(zi),f=d[d.length-1],p=f?f.params:{};f&&f.pathname;let m=f?f.pathnameBase:"/";f&&f.route;let g=Fh(),y;if(o){var x;let C=typeof o=="string"?Di(o):o;m==="/"||(x=C.pathname)!=null&&x.startsWith(m)||mt(!1),y=C}else y=g;let k=y.pathname||"/",v=k;if(m!=="/"){let C=m.replace(/^\//,"").split("/");v="/"+k.replace(/^\//,"").split("/").slice(C.length).join("/")}let N=a1(n,{pathname:v}),b=M1(N&&N.map(C=>Object.assign({},C,{params:Object.assign({},p,C.params),pathname:Wr([m,u.encodeLocation?u.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Wr([m,u.encodeLocation?u.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),d,s,l);return o&&b?w.createElement(Fi.Provider,{value:{location:ki({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:Hn.Pop}},b):b}function O1(){let n=F1(),o=C1(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,u={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},o),s?w.createElement("pre",{style:u},s):null,null)}const _1=w.createElement(O1,null);class j1 extends w.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,s){return s.location!==o.location||s.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:s.error,location:s.location,revalidation:o.revalidation||s.revalidation}}componentDidCatch(o,s){console.error("React Router caught the following error during render",o,s)}render(){return this.state.error!==void 0?w.createElement(zi.Provider,{value:this.props.routeContext},w.createElement(Dh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function A1(n){let{routeContext:o,match:s,children:l}=n,u=w.useContext(P1);return u&&u.static&&u.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=s.route.id),w.createElement(zi.Provider,{value:o},l)}function M1(n,o,s,l){var u;if(o===void 0&&(o=[]),s===void 0&&(s=null),l===void 0&&(l=null),n==null){var d;if(!s)return null;if(s.errors)n=s.matches;else if((d=l)!=null&&d.v7_partialHydration&&o.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let f=n,p=(u=s)==null?void 0:u.errors;if(p!=null){let y=f.findIndex(x=>x.route.id&&p?.[x.route.id]!==void 0);y>=0||mt(!1),f=f.slice(0,Math.min(f.length,y+1))}let m=!1,g=-1;if(s&&l&&l.v7_partialHydration)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:k,errors:v}=s,N=x.route.loader&&k[x.route.id]===void 0&&(!v||v[x.route.id]===void 0);if(x.route.lazy||N){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((y,x,k)=>{let v,N=!1,b=null,C=null;s&&(v=p&&x.route.id?p[x.route.id]:void 0,b=x.route.errorElement||_1,m&&(g<0&&k===0?(z1("route-fallback"),N=!0,C=null):g===k&&(N=!0,C=x.route.hydrateFallbackElement||null)));let A=o.concat(f.slice(0,k+1)),L=()=>{let D;return v?D=b:N?D=C:x.route.Component?D=w.createElement(x.route.Component,null):x.route.element?D=x.route.element:D=y,w.createElement(A1,{match:x,routeContext:{outlet:y,matches:A,isDataRoute:s!=null},children:D})};return s&&(x.route.ErrorBoundary||x.route.errorElement||k===0)?w.createElement(j1,{location:s.location,revalidation:s.revalidation,component:b,error:v,children:L(),routeContext:{outlet:null,matches:A,isDataRoute:!0}}):L()},null)}var zh=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(zh||{});function L1(n){let o=w.useContext(R1);return o||mt(!1),o}function I1(n){let o=w.useContext(zi);return o||mt(!1),o}function D1(n){let o=I1(),s=o.matches[o.matches.length-1];return s.route.id||mt(!1),s.route.id}function F1(){var n;let o=w.useContext(Dh),s=L1(zh.UseRouteError),l=D1();return o!==void 0?o:(n=s.errors)==null?void 0:n[l]}const Yf={};function z1(n,o,s){Yf[n]||(Yf[n]=!0)}function U1(n,o){n?.v7_startTransition,n?.v7_relativeSplatPath}function Za(n){mt(!1)}function B1(n){let{basename:o="/",children:s=null,location:l,navigationType:u=Hn.Pop,navigator:d,static:f=!1,future:p}=n;Su()&&mt(!1);let m=o.replace(/^\/*/,"/"),g=w.useMemo(()=>({basename:m,navigator:d,static:f,future:ki({v7_relativeSplatPath:!1},p)}),[m,p,d,f]);typeof l=="string"&&(l=Di(l));let{pathname:y="/",search:x="",hash:k="",state:v=null,key:N="default"}=l,b=w.useMemo(()=>{let C=Mh(y,m);return C==null?null:{location:{pathname:C,search:x,hash:k,state:v,key:N},navigationType:u}},[m,y,x,k,v,N,u]);return b==null?null:w.createElement(Ih.Provider,{value:g},w.createElement(Fi.Provider,{children:s,value:b}))}function $1(n){let{children:o,location:s}=n;return T1(Ja(o),s)}new Promise(()=>{});function Ja(n,o){o===void 0&&(o=[]);let s=[];return w.Children.forEach(n,(l,u)=>{if(!w.isValidElement(l))return;let d=[...o,u];if(l.type===w.Fragment){s.push.apply(s,Ja(l.props.children,d));return}l.type!==Za&&mt(!1),!l.props.index||!l.props.children||mt(!1);let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Ja(l.props.children,d)),s.push(f)}),s}const V1="6";try{window.__reactRouterVersion=V1}catch{}const W1="startTransition",Gf=tu[W1];function H1(n){let{basename:o,children:s,future:l,window:u}=n,d=w.useRef();d.current==null&&(d.current=s1({window:u,v5Compat:!0}));let f=d.current,[p,m]=w.useState({action:f.action,location:f.location}),{v7_startTransition:g}=l||{},y=w.useCallback(x=>{g&&Gf?Gf(()=>m(x)):m(x)},[m,g]);return w.useLayoutEffect(()=>f.listen(y),[f,y]),w.useEffect(()=>U1(l),[l]),w.createElement(B1,{basename:o,children:s,location:p.location,navigationType:p.action,navigator:f,future:l})}var qf;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(qf||(qf={}));var Xf;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(Xf||(Xf={}));async function Wo(n,o={}){const s=localStorage.getItem("STUDIO_API_KEY")||"",l={...o.headers,"x-api-key":s,"Content-Type":"application/json"},u=await fetch(n,{...o,headers:l});return u.status===401&&console.error("Unauthorized: Invalid API Key"),u}function Q1({isOpen:n,onClose:o,selectedTable:s,onSelectTable:l}){const[u,d]=w.useState(!0),{data:f=[],isLoading:p}=o1({queryKey:["tables"],queryFn:async()=>{const m=await Wo("/api/tables");if(!m.ok)throw new Error("Failed to fetch tables");return m.json()}});return E.jsxs(E.Fragment,{children:[n&&E.jsx("div",{className:"fixed inset-0 bg-black/50 lg:hidden z-40",onClick:o}),E.jsxs("aside",{className:Le("fixed lg:static inset-y-0 left-0 z-50 w-64 border-r border-sidebar-border bg-sidebar-background transition-transform duration-300 ease-in-out overflow-hidden flex flex-col",!n&&"-translate-x-full lg:translate-x-0"),children:[E.jsx("div",{className:"p-6 border-b border-sidebar-border",children:E.jsx("div",{className:"flex items-center justify-between mb-4",children:E.jsx("h2",{className:"text-sm font-semibold text-sidebar-foreground",children:"Database"})})}),E.jsxs("nav",{className:"flex-1 overflow-auto p-4 space-y-1",children:[E.jsxs("button",{onClick:()=>{d(!u)},className:Le("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-sm font-medium transition-colors duration-200","bg-sidebar-primary/20 text-sidebar-primary"),children:[E.jsx(sy,{className:"w-4 h-4 flex-shrink-0"}),E.jsx("span",{className:"flex-1 text-left truncate",children:"MySQL Database"}),E.jsx(Kv,{className:Le("w-4 h-4 flex-shrink-0 transition-transform duration-200",u?"rotate-0":"-rotate-90")})]}),u&&E.jsxs("div",{className:"ml-2 mt-1 space-y-1",children:[p&&E.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading tables..."}),f.map(m=>E.jsxs("button",{onClick:()=>{l(m),o()},className:Le("w-full flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors duration-200 text-sidebar-foreground hover:bg-sidebar-accent",s===m?"bg-sidebar-primary/20 text-sidebar-primary":""),children:[E.jsx(jp,{className:"w-4 h-4 flex-shrink-0"}),E.jsx("span",{className:"flex-1 text-left truncate",children:m})]},m)),!p&&f.length===0&&E.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No tables found"})]})]}),E.jsx("div",{className:"p-4 border-t border-sidebar-border",children:E.jsx("button",{className:"w-full px-3 py-2 text-sm text-sidebar-foreground hover:bg-sidebar-accent rounded-md transition-colors",children:"Settings"})})]})]})}function K1({children:n,selectedTable:o,onSelectTable:s,view:l,onViewChange:u,dbName:d,schemaColumns:f,onSchemaColumnsChange:p}){const[m,g]=w.useState(!0),y=l==="data",x=typeof window<"u"&&new URLSearchParams(window.location.search).get("export")==="true";return E.jsxs("div",{className:Le("flex bg-background",x?"h-auto overflow-visible":"h-screen overflow-hidden"),children:[y&&E.jsx(Q1,{isOpen:m,onClose:()=>g(!1),selectedTable:o,onSelectTable:s}),E.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[E.jsxs("header",{className:" flex items-center justify-between px-6 py-4 border-b border-border bg-background",children:[E.jsxs("div",{className:"flex items-center gap-4",children:[y&&E.jsx("button",{onClick:()=>g(!m),className:"lg:hidden p-2 hover:bg-secondary rounded-md transition-colors",children:m?E.jsx(Ap,{className:"w-5 h-5"}):E.jsx(py,{className:"w-5 h-5"})}),E.jsxs("h1",{className:"text-xl font-semibold flex items-center gap-2",children:[E.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),d?E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-muted-foreground font-normal",children:"Database:"}),d]}):"Database Studio"]})]}),E.jsxs("div",{className:"print:hidden flex items-center gap-4",children:[l==="schema"&&E.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 bg-secondary rounded-md border border-border",children:[E.jsx(ry,{className:"w-4 h-4 text-muted-foreground"}),E.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4].map(k=>E.jsx("button",{onClick:()=>p(k),className:Le("w-7 h-7 flex items-center justify-center text-xs font-bold rounded transition-all",f===k?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-background hover:text-foreground"),children:k},k))})]}),E.jsxs("div",{className:" flex items-center rounded-md p-1 bg-secondary",children:[E.jsxs("button",{onClick:()=>u("data"),className:Le("flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",l==="data"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-secondary/70"),children:[E.jsx(gy,{className:"w-4 h-4"}),"Data View"]}),E.jsxs("button",{onClick:()=>u("schema"),className:Le("flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",l==="schema"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-secondary/70"),children:[E.jsx(dy,{className:"w-4 h-4"}),"Schema View"]})]})]})]}),E.jsx("div",{className:"flex-1 overflow-auto",children:n})]})]})}const hi=10;function Y1({selectedTable:n}){const[o,s]=w.useState(""),[l,u]=w.useState(null),[d,f]=w.useState(1),[p,m]=w.useState(!1),[g,y]=w.useState(null);if(w.useEffect(()=>{s(""),f(1)},[n]),w.useEffect(()=>{if(!n)return;async function v(){try{m(!0),y(null);const N=await Wo(`/api/table/${n}?page=${d}&limit=${hi}&search=${o}`);if(!N.ok)throw new Error("Failed to fetch table");const b=await N.json();console.log("data+++",b),u(b)}catch(N){y(N.message)}finally{m(!1)}}v()},[n,d,o]),!n)return E.jsx(q1,{title:"No Table Selected",description:"Select a table from the sidebar to view its content and manage records."});if(p)return E.jsx(Zf,{message:"Loading table..."});if(g)return E.jsx(Zf,{message:g});if(!l)return null;const x=Math.max(1,Math.ceil(l.total/hi)),k=(d-1)*hi;return E.jsxs("div",{className:"flex flex-col h-full",children:[E.jsx("div",{className:"px-8 py-6 border-b border-border bg-background",children:E.jsxs("div",{className:"mb-4",children:[E.jsx("h2",{className:"text-2xl font-bold text-foreground",children:l.name}),E.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l.total," rows"]})]})}),E.jsx("div",{className:"flex-1 overflow-auto",children:E.jsxs("table",{className:"w-full text-sm",children:[E.jsx("thead",{className:"sticky top-0 bg-secondary border-b border-border",children:E.jsxs("tr",{children:[l.columns.map(v=>E.jsxs("th",{className:"px-6 py-3 text-left font-semibold whitespace-nowrap",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{children:v.name}),v.key==="PRI"&&E.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-mono bg-primary/10 text-primary",children:"PK"}),v.key==="UNI"&&E.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-mono bg-orange/10 text-orange",children:"U"})]}),E.jsx("p",{className:"text-xs text-muted-foreground font-normal mt-1",children:v.type})]},v.name)),E.jsx("th",{className:"px-6 py-3 w-12"})]})}),E.jsx("tbody",{className:"divide-y divide-border",children:l.rows.length===0?E.jsx("tr",{children:E.jsx("td",{colSpan:l.columns.length+1,className:"px-6 py-12 text-center text-muted-foreground",children:"No data found"})}):l.rows.map((v,N)=>E.jsx("tr",{className:"hover:bg-secondary/50 transition-colors",children:l.columns.map(b=>E.jsx("td",{className:"px-6 py-4 font-mono text-xs",children:E.jsx(G1,{value:v[b.name],type:b.type})},b.name))},v.id??N))})]})}),l.total>0&&E.jsxs("div",{className:"flex items-center justify-between px-8 py-4 border-t border-border bg-background",children:[E.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing"," ",E.jsx("span",{className:"font-semibold text-foreground",children:k+1})," ","to"," ",E.jsx("span",{className:"font-semibold text-foreground",children:Math.min(k+hi,l.total)})," ","of"," ",E.jsx("span",{className:"font-semibold text-foreground",children:l.total})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(mi,{disabled:d===1,onClick:()=>f(1),children:E.jsx(Jv,{className:"w-4 h-4"})}),E.jsx(mi,{disabled:d===1,onClick:()=>f(v=>v-1),children:E.jsx(Gv,{className:"w-4 h-4"})}),E.jsxs("span",{className:"text-sm text-muted-foreground",children:[d," of ",x]}),E.jsx(mi,{disabled:d===x,onClick:()=>f(v=>v+1),children:E.jsx(Xv,{className:"w-4 h-4"})}),E.jsx(mi,{disabled:d===x,onClick:()=>f(x),children:E.jsx(ty,{className:"w-4 h-4"})})]})]})]})}function G1({value:n,type:o}){return n==null?E.jsx("span",{className:"text-muted-foreground italic",children:"null"}):o==="BOOLEAN"?E.jsx("span",{className:Le("inline-flex px-2 py-1 rounded text-xs font-semibold",n?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400"),children:String(n)}):o==="UUID"||o==="ObjectId"?E.jsxs("span",{title:String(n),className:"truncate block max-w-xs text-muted-foreground",children:[String(n).slice(0,8),"..."]}):o==="TIMESTAMP"||o==="DATE"?E.jsx("span",{className:"text-muted-foreground",children:new Date(n).toLocaleString()}):E.jsx("span",{children:String(n)})}function mi({children:n,disabled:o,onClick:s}){return E.jsx("button",{onClick:s,disabled:o,className:"p-2 hover:bg-secondary rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:n})}function Zf({message:n}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("p",{className:"text-muted-foreground",children:n})})}function q1({title:n,description:o,showActions:s=!1}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsxs("div",{className:"text-center max-w-md",children:[E.jsx("div",{className:"w-20 h-20 rounded-lg bg-card border border-border mx-auto mb-6"}),E.jsx("h2",{className:"text-xl font-semibold mb-2",children:n}),E.jsx("p",{className:"text-muted-foreground mb-6",children:o}),s&&E.jsxs("div",{className:"flex gap-3 justify-center",children:[E.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 text-sm font-medium",children:"Create Table"}),E.jsx("button",{className:"px-4 py-2 border border-input hover:bg-secondary rounded-md text-sm font-medium",children:"Documentation"})]})]})})}const Jf=[{bg:"bg-blue-500/5",border:"border-blue-500/20",icon:"text-blue-500",headerBg:"bg-blue-500/10"},{bg:"bg-purple-500/5",border:"border-purple-500/20",icon:"text-purple-500",headerBg:"bg-purple-500/10"},{bg:"bg-emerald-500/5",border:"border-emerald-500/20",icon:"text-emerald-500",headerBg:"bg-emerald-500/10"},{bg:"bg-orange-500/5",border:"border-orange-500/20",icon:"text-orange-500",headerBg:"bg-orange-500/10"},{bg:"bg-pink-500/5",border:"border-pink-500/20",icon:"text-pink-500",headerBg:"bg-pink-500/10"},{bg:"bg-indigo-500/5",border:"border-indigo-500/20",icon:"text-indigo-500",headerBg:"bg-indigo-500/10"},{bg:"bg-rose-500/5",border:"border-rose-500/20",icon:"text-rose-500",headerBg:"bg-rose-500/10"},{bg:"bg-amber-500/5",border:"border-amber-500/20",icon:"text-amber-500",headerBg:"bg-amber-500/10"}];function ja({message:n}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("p",{className:"text-muted-foreground",children:n})})}function X1({columns:n=3}){const[o,s]=w.useState([]),[l,u]=w.useState(!0),[d,f]=w.useState(null),p=w.useRef(null),m=new URLSearchParams(window.location.search).get("export")==="true";w.useEffect(()=>{async function k(){try{u(!0),f(null);const v=await Wo("/api/tables");if(!v.ok)throw new Error("Failed to fetch table names");const N=await v.json(),b=await Promise.all(N.map(async C=>{const A=await Wo(`/api/table/${C}/schema`);if(!A.ok)throw new Error(`Failed to fetch schema for ${C}`);return A.json()}));s(b)}catch(v){f(v.message)}finally{u(!1)}}k()},[]);const g=async()=>{window.open("/api/export-pdf","_blank")};if(l)return E.jsx(ja,{message:"Loading schemas..."});if(d)return E.jsx(ja,{message:d});if(o.length===0)return E.jsx(ja,{message:"No table schemas found. Create a table to get started."});const x={1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}[m?1:n]||"grid-cols-1 md:grid-cols-2 lg:grid-cols-3";return E.jsxs("div",{className:"flex flex-col h-full",children:[!m&&E.jsx("div",{className:"px-8 py-6 border-b border-border bg-background flex justify-end",children:E.jsxs("button",{onClick:g,className:"flex items-center gap-2 px-4 py-2 border border-input hover:bg-secondary rounded-md text-sm font-medium",children:[E.jsx(ly,{className:"w-4 h-4"}),"Export to PDF"]})}),E.jsx("div",{ref:p,id:"schema-grid",className:Le("p-8 grid gap-6",x),children:o.map((k,v)=>{const N=Jf[v%Jf.length];return E.jsxs("div",{className:Le("border rounded-xl shadow-sm overflow-hidden transition-all hover:shadow-md hover:-translate-y-1",N.bg,N.border),children:[E.jsxs("div",{className:Le("p-5 border-b flex items-center gap-3",N.headerBg,N.border),children:[E.jsx("div",{className:Le("p-2 rounded-lg bg-background/50 backdrop-blur-sm shadow-sm",N.icon),children:E.jsx(jp,{className:"w-5 h-5"})}),E.jsx("h3",{className:"text-lg font-bold text-foreground tracking-tight",children:k.name})]}),E.jsxs("div",{className:"p-5",children:[E.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[E.jsx("div",{className:"h-px flex-1 bg-border/50"}),E.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground/50",children:"Columns"}),E.jsx("div",{className:"h-px flex-1 bg-border/50"})]}),E.jsx("ul",{className:"space-y-3",children:k.columns.map(b=>E.jsxs("li",{className:"flex items-center justify-between group",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:Le("w-1.5 h-1.5 rounded-full",b.key==="PRI"?"bg-blue-500":b.key==="UNI"?"bg-yellow-500":"bg-muted-foreground/30")}),E.jsx("span",{className:"font-mono text-sm font-medium text-foreground group-hover:text-primary transition-colors whitespace-nowrap overflow-hidden text-ellipsis",title:b.name,children:b.name})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[b.isPrimary&&E.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-yellow-500/10 text-yellow-600 border border-yellow-500/20 uppercase",children:"PK"}),E.jsx("span",{className:"px-2 py-0.5 rounded-md text-[10px] font-mono bg-background/50 border border-border/50 text-muted-foreground uppercase",children:b.type})]})]},b.name))})]})]},k.name)})})]})}function Z1(){const[n,o]=w.useState(null),[s,l]=w.useState("data"),[u,d]=w.useState(""),[f,p]=w.useState(3);w.useEffect(()=>{const y=new URLSearchParams(window.location.search).get("view");(y==="schema"||y==="data")&&l(y);async function x(){try{const v=await(await Wo("/api/database")).json();v.success&&d(v.dbname)}catch(k){console.error("Error fetching db name:",k)}}x()},[]);const m=g=>{o(g)};return E.jsx(K1,{selectedTable:n,onSelectTable:m,view:s,onViewChange:l,dbName:u,schemaColumns:f,onSchemaColumnsChange:p,children:s==="data"?E.jsx(Y1,{selectedTable:n}):E.jsx(X1,{columns:f})})}const J1=()=>{const n=Fh();return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",n.pathname)},[n.pathname]),E.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:E.jsxs("div",{className:"text-center",children:[E.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),E.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),E.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},Uh=w.forwardRef(({className:n,type:o,...s},l)=>E.jsx("input",{type:o,className:Le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:l,...s}));Uh.displayName="Input";var eS=Symbol.for("react.lazy"),Pi=tu[" use ".trim().toString()];function tS(n){return typeof n=="object"&&n!==null&&"then"in n}function Bh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===eS&&"_payload"in n&&tS(n._payload)}function nS(n){const o=oS(n),s=w.forwardRef((l,u)=>{let{children:d,...f}=l;Bh(d)&&typeof Pi=="function"&&(d=Pi(d._payload));const p=w.Children.toArray(d),m=p.find(iS);if(m){const g=m.props.children,y=p.map(x=>x===m?w.Children.count(g)>1?w.Children.only(null):w.isValidElement(g)?g.props.children:null:x);return E.jsx(o,{...f,ref:u,children:w.isValidElement(g)?w.cloneElement(g,void 0,y):null})}return E.jsx(o,{...f,ref:u,children:d})});return s.displayName=`${n}.Slot`,s}var rS=nS("Slot");function oS(n){const o=w.forwardRef((s,l)=>{let{children:u,...d}=s;if(Bh(u)&&typeof Pi=="function"&&(u=Pi(u._payload)),w.isValidElement(u)){const f=aS(u),p=lS(d,u.props);return u.type!==w.Fragment&&(p.ref=l?nu(l,f):f),w.cloneElement(u,p)}return w.Children.count(u)>1?w.Children.only(null):null});return o.displayName=`${n}.SlotClone`,o}var sS=Symbol("radix.slottable");function iS(n){return w.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===sS}function lS(n,o){const s={...o};for(const l in o){const u=n[l],d=o[l];/^on[A-Z]/.test(l)?u&&d?s[l]=(...p)=>{const m=d(...p);return u(...p),m}:u&&(s[l]=u):l==="style"?s[l]={...u,...d}:l==="className"&&(s[l]=[u,d].filter(Boolean).join(" "))}return{...n,...s}}function aS(n){let o=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning;return s?n.ref:(o=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}const uS=Op("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$h=w.forwardRef(({className:n,variant:o,size:s,asChild:l=!1,...u},d)=>{const f=l?rS:"button";return E.jsx(f,{className:Le(uS({variant:o,size:s,className:n})),ref:d,...u})});$h.displayName="Button";const cS=new Wx,dS=()=>{const[n,o]=w.useState(!1),[s,l]=w.useState(""),[u,d]=w.useState(!1),[f,p]=w.useState(null),[m,g]=w.useState(!0);w.useEffect(()=>{fetch("/api/database",{credentials:"include"}).then(x=>{x.status===401?d(!1):d(!0)}).finally(()=>g(!1))},[]);const y=async()=>{const x=s.trim();if(!x){p("Please enter a license key");return}o(!0),p(null);try{const v=await(await fetch("/api/validate-license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:x})})).json();v.success?(d(!0),window.location.reload()):p(v.message||"Invalid License Key. Please check and try again.")}catch(k){console.error("Validation error:",k),p("Failed to validate license.")}finally{o(!1)}};return u?E.jsx(H1,{children:E.jsxs($1,{children:[E.jsx(Za,{path:"/",element:E.jsx(Z1,{})}),E.jsx(Za,{path:"*",element:E.jsx(J1,{})})]})}):E.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:E.jsxs("div",{className:"w-full max-w-md space-y-6 text-center",children:[E.jsx("div",{className:"inline-flex p-4 rounded-full bg-primary/10 text-primary mb-2",children:E.jsx(uy,{className:"w-8 h-8"})}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"API Key Required"}),E.jsx("p",{className:"text-muted-foreground text-sm",children:"Please enter your license key to access the Database Studio."})]}),E.jsxs("div",{className:"space-y-4",children:[E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Uh,{type:"password",placeholder:"Enter License Key",value:s,onChange:x=>{l(x.target.value),p(null)},onKeyDown:x=>x.key==="Enter"&&!n&&y(),disabled:n}),E.jsx($h,{onClick:y,disabled:n,children:n?"Validating...":"Connect"})]}),f&&E.jsx("p",{className:"text-destructive text-sm font-medium animate-in fade-in slide-in-from-top-1",children:f})]})]})})},fS=()=>E.jsx(Qx,{client:cS,children:E.jsxs(wx,{children:[E.jsx(Jy,{}),E.jsx(A0,{}),E.jsx(dS,{})]})});t0.createRoot(document.getElementById("root")).render(E.jsx(fS,{}));
9
+ `);function di(n){return n.label!==void 0}var E0=3,b0="32px",C0="16px",wf=4e3,k0=356,P0=14,R0=20,T0=200;function Vt(...n){return n.filter(Boolean).join(" ")}function N0(n){let[o,s]=n.split("-"),l=[];return o&&l.push(o),s&&l.push(s),l}var O0=n=>{var o,s,l,u,d,f,p,m,g,y,x;let{invert:k,toast:v,unstyled:N,interacting:b,setHeights:C,visibleToasts:A,heights:L,index:D,toasts:z,expanded:Q,removeToast:W,defaultRichColors:K,closeButton:re,style:pe,cancelButtonStyle:ce,actionButtonStyle:ge,className:X="",descriptionClassName:de="",duration:G,position:ve,gap:ie,loadingIcon:oe,expandByDefault:I,classNames:F,icons:V,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:M}=n,[q,J]=Y.useState(null),[fe,ye]=Y.useState(null),[le,Se]=Y.useState(!1),[be,ze]=Y.useState(!1),[Ct,Sn]=Y.useState(!1),[kt,qr]=Y.useState(!1),[Yo,Xr]=Y.useState(!1),[Zr,hr]=Y.useState(0),[Jr,En]=Y.useState(0),Pt=Y.useRef(v.duration||G||wf),mr=Y.useRef(null),Kt=Y.useRef(null),Go=D===0,qo=D+1<=A,tt=v.type,Yt=v.dismissible!==!1,gr=v.className||"",Xo=v.descriptionClassName||"",Gt=Y.useMemo(()=>L.findIndex(me=>me.toastId===v.id)||0,[L,v.id]),Xn=Y.useMemo(()=>{var me;return(me=v.closeButton)!=null?me:re},[v.closeButton,re]),Zo=Y.useMemo(()=>v.duration||G||wf,[v.duration,G]),vr=Y.useRef(0),un=Y.useRef(0),Jo=Y.useRef(0),qt=Y.useRef(null),[eo,to]=ve.split("-"),yr=Y.useMemo(()=>L.reduce((me,ke,Re)=>Re>=Gt?me:me+ke.height,0),[L,Gt]),wr=h0(),bn=v.invert||k,Xt=tt==="loading";un.current=Y.useMemo(()=>Gt*ie+yr,[Gt,yr]),Y.useEffect(()=>{Pt.current=Zo},[Zo]),Y.useEffect(()=>{Se(!0)},[]),Y.useEffect(()=>{let me=Kt.current;if(me){let ke=me.getBoundingClientRect().height;return En(ke),C(Re=>[{toastId:v.id,height:ke,position:v.position},...Re]),()=>C(Re=>Re.filter(nt=>nt.toastId!==v.id))}},[C,v.id]),Y.useLayoutEffect(()=>{if(!le)return;let me=Kt.current,ke=me.style.height;me.style.height="auto";let Re=me.getBoundingClientRect().height;me.style.height=ke,En(Re),C(nt=>nt.find(st=>st.toastId===v.id)?nt.map(st=>st.toastId===v.id?{...st,height:Re}:st):[{toastId:v.id,height:Re,position:v.position},...nt])},[le,v.title,v.description,C,v.id]);let Mt=Y.useCallback(()=>{ze(!0),hr(un.current),C(me=>me.filter(ke=>ke.toastId!==v.id)),setTimeout(()=>{W(v)},T0)},[v,W,C,un]);Y.useEffect(()=>{if(v.promise&&tt==="loading"||v.duration===1/0||v.type==="loading")return;let me;return Q||b||M&&wr?(()=>{if(Jo.current<vr.current){let ke=new Date().getTime()-vr.current;Pt.current=Pt.current-ke}Jo.current=new Date().getTime()})():Pt.current!==1/0&&(vr.current=new Date().getTime(),me=setTimeout(()=>{var ke;(ke=v.onAutoClose)==null||ke.call(v,v),Mt()},Pt.current)),()=>clearTimeout(me)},[Q,b,v,tt,M,wr,Mt]),Y.useEffect(()=>{v.delete&&Mt()},[Mt,v.delete]);function es(){var me,ke,Re;return V!=null&&V.loading?Y.createElement("div",{className:Vt(F?.loader,(me=v?.classNames)==null?void 0:me.loader,"sonner-loader"),"data-visible":tt==="loading"},V.loading):oe?Y.createElement("div",{className:Vt(F?.loader,(ke=v?.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":tt==="loading"},oe):Y.createElement(a0,{className:Vt(F?.loader,(Re=v?.classNames)==null?void 0:Re.loader),visible:tt==="loading"})}return Y.createElement("li",{tabIndex:0,ref:Kt,className:Vt(X,gr,F?.toast,(o=v?.classNames)==null?void 0:o.toast,F?.default,F?.[tt],(s=v?.classNames)==null?void 0:s[tt]),"data-sonner-toast":"","data-rich-colors":(l=v.richColors)!=null?l:K,"data-styled":!(v.jsx||v.unstyled||N),"data-mounted":le,"data-promise":!!v.promise,"data-swiped":Yo,"data-removed":be,"data-visible":qo,"data-y-position":eo,"data-x-position":to,"data-index":D,"data-front":Go,"data-swiping":Ct,"data-dismissible":Yt,"data-type":tt,"data-invert":bn,"data-swipe-out":kt,"data-swipe-direction":fe,"data-expanded":!!(Q||I&&le),style:{"--index":D,"--toasts-before":D,"--z-index":z.length-D,"--offset":`${be?Zr:un.current}px`,"--initial-height":I?"auto":`${Jr}px`,...pe,...v.style},onDragEnd:()=>{Sn(!1),J(null),qt.current=null},onPointerDown:me=>{Xt||!Yt||(mr.current=new Date,hr(un.current),me.target.setPointerCapture(me.pointerId),me.target.tagName!=="BUTTON"&&(Sn(!0),qt.current={x:me.clientX,y:me.clientY}))},onPointerUp:()=>{var me,ke,Re,nt;if(kt||!Yt)return;qt.current=null;let st=Number(((me=Kt.current)==null?void 0:me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),it=Number(((ke=Kt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((Re=mr.current)==null?void 0:Re.getTime()),Ke=q==="x"?st:it,Zt=Math.abs(Ke)/Lt;if(Math.abs(Ke)>=R0||Zt>.11){hr(un.current),(nt=v.onDismiss)==null||nt.call(v,v),ye(q==="x"?st>0?"right":"left":it>0?"down":"up"),Mt(),qr(!0),Xr(!1);return}Sn(!1),J(null)},onPointerMove:me=>{var ke,Re,nt,st;if(!qt.current||!Yt||((ke=window.getSelection())==null?void 0:ke.toString().length)>0)return;let it=me.clientY-qt.current.y,Lt=me.clientX-qt.current.x,Ke=(Re=n.swipeDirections)!=null?Re:N0(ve);!q&&(Math.abs(Lt)>1||Math.abs(it)>1)&&J(Math.abs(Lt)>Math.abs(it)?"x":"y");let Zt={x:0,y:0};q==="y"?(Ke.includes("top")||Ke.includes("bottom"))&&(Ke.includes("top")&&it<0||Ke.includes("bottom")&&it>0)&&(Zt.y=it):q==="x"&&(Ke.includes("left")||Ke.includes("right"))&&(Ke.includes("left")&&Lt<0||Ke.includes("right")&&Lt>0)&&(Zt.x=Lt),(Math.abs(Zt.x)>0||Math.abs(Zt.y)>0)&&Xr(!0),(nt=Kt.current)==null||nt.style.setProperty("--swipe-amount-x",`${Zt.x}px`),(st=Kt.current)==null||st.style.setProperty("--swipe-amount-y",`${Zt.y}px`)}},Xn&&!v.jsx?Y.createElement("button",{"aria-label":T,"data-disabled":Xt,"data-close-button":!0,onClick:Xt||!Yt?()=>{}:()=>{var me;Mt(),(me=v.onDismiss)==null||me.call(v,v)},className:Vt(F?.closeButton,(u=v?.classNames)==null?void 0:u.closeButton)},(d=V?.close)!=null?d:p0):null,v.jsx||w.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Y.createElement(Y.Fragment,null,tt||v.icon||v.promise?Y.createElement("div",{"data-icon":"",className:Vt(F?.icon,(f=v?.classNames)==null?void 0:f.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||es():null,v.type!=="loading"?v.icon||V?.[tt]||i0(tt):null):null,Y.createElement("div",{"data-content":"",className:Vt(F?.content,(p=v?.classNames)==null?void 0:p.content)},Y.createElement("div",{"data-title":"",className:Vt(F?.title,(m=v?.classNames)==null?void 0:m.title)},typeof v.title=="function"?v.title():v.title),v.description?Y.createElement("div",{"data-description":"",className:Vt(de,Xo,F?.description,(g=v?.classNames)==null?void 0:g.description)},typeof v.description=="function"?v.description():v.description):null),w.isValidElement(v.cancel)?v.cancel:v.cancel&&di(v.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||ce,onClick:me=>{var ke,Re;di(v.cancel)&&Yt&&((Re=(ke=v.cancel).onClick)==null||Re.call(ke,me),Mt())},className:Vt(F?.cancelButton,(y=v?.classNames)==null?void 0:y.cancelButton)},v.cancel.label):null,w.isValidElement(v.action)?v.action:v.action&&di(v.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ge,onClick:me=>{var ke,Re;di(v.action)&&((Re=(ke=v.action).onClick)==null||Re.call(ke,me),!me.defaultPrevented&&Mt())},className:Vt(F?.actionButton,(x=v?.classNames)==null?void 0:x.actionButton)},v.action.label):null))};function xf(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function _0(n,o){let s={};return[n,o].forEach((l,u)=>{let d=u===1,f=d?"--mobile-offset":"--offset",p=d?C0:b0;function m(g){["top","right","bottom","left"].forEach(y=>{s[`${f}-${y}`]=typeof g=="number"?`${g}px`:g})}typeof l=="number"||typeof l=="string"?m(l):typeof l=="object"?["top","right","bottom","left"].forEach(g=>{l[g]===void 0?s[`${f}-${g}`]=p:s[`${f}-${g}`]=typeof l[g]=="number"?`${l[g]}px`:l[g]}):m(p)}),s}var j0=w.forwardRef(function(n,o){let{invert:s,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:f,className:p,offset:m,mobileOffset:g,theme:y="light",richColors:x,duration:k,style:v,visibleToasts:N=E0,toastOptions:b,dir:C=xf(),gap:A=P0,loadingIcon:L,icons:D,containerAriaLabel:z="Notifications",pauseWhenPageIsHidden:Q}=n,[W,K]=Y.useState([]),re=Y.useMemo(()=>Array.from(new Set([l].concat(W.filter(M=>M.position).map(M=>M.position)))),[W,l]),[pe,ce]=Y.useState([]),[ge,X]=Y.useState(!1),[de,G]=Y.useState(!1),[ve,ie]=Y.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),oe=Y.useRef(null),I=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Y.useRef(null),V=Y.useRef(!1),T=Y.useCallback(M=>{K(q=>{var J;return(J=q.find(fe=>fe.id===M.id))!=null&&J.delete||pt.dismiss(M.id),q.filter(({id:fe})=>fe!==M.id)})},[]);return Y.useEffect(()=>pt.subscribe(M=>{if(M.dismiss){K(q=>q.map(J=>J.id===M.id?{...J,delete:!0}:J));return}setTimeout(()=>{np.flushSync(()=>{K(q=>{let J=q.findIndex(fe=>fe.id===M.id);return J!==-1?[...q.slice(0,J),{...q[J],...M},...q.slice(J+1)]:[M,...q]})})})}),[]),Y.useEffect(()=>{if(y!=="system"){ie(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ie("dark"):ie("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:q})=>{ie(q?"dark":"light")})}catch{M.addListener(({matches:J})=>{try{ie(J?"dark":"light")}catch(fe){console.error(fe)}})}},[y]),Y.useEffect(()=>{W.length<=1&&X(!1)},[W]),Y.useEffect(()=>{let M=q=>{var J,fe;u.every(ye=>q[ye]||q.code===ye)&&(X(!0),(J=oe.current)==null||J.focus()),q.code==="Escape"&&(document.activeElement===oe.current||(fe=oe.current)!=null&&fe.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[u]),Y.useEffect(()=>{if(oe.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,V.current=!1)}},[oe.current]),Y.createElement("section",{ref:o,"aria-label":`${z} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((M,q)=>{var J;let[fe,ye]=M.split("-");return W.length?Y.createElement("ol",{key:M,dir:C==="auto"?xf():C,tabIndex:-1,ref:oe,className:p,"data-sonner-toaster":!0,"data-theme":ve,"data-y-position":fe,"data-lifted":ge&&W.length>1&&!d,"data-x-position":ye,style:{"--front-toast-height":`${((J=pe[0])==null?void 0:J.height)||0}px`,"--width":`${k0}px`,"--gap":`${A}px`,...v,..._0(m,g)},onBlur:le=>{V.current&&!le.currentTarget.contains(le.relatedTarget)&&(V.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||V.current||(V.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{de||X(!1)},onDragEnd:()=>X(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},W.filter(le=>!le.position&&q===0||le.position===M).map((le,Se)=>{var be,ze;return Y.createElement(O0,{key:le.id,icons:D,index:Se,toast:le,defaultRichColors:x,duration:(be=b?.duration)!=null?be:k,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:N,closeButton:(ze=b?.closeButton)!=null?ze:f,interacting:de,position:M,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:T,toasts:W.filter(Ct=>Ct.position==le.position),heights:pe.filter(Ct=>Ct.position==le.position),setHeights:ce,expandByDefault:d,gap:A,loadingIcon:L,expanded:ge,pauseWhenPageIsHidden:Q,swipeDirections:n.swipeDirections})})):null}))});const A0=({...n})=>{const{theme:o="system"}=s0();return E.jsx(j0,{theme:o,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})},M0=["top","right","bottom","left"],Gn=Math.min,Et=Math.max,wi=Math.round,fi=Math.floor,sn=n=>({x:n,y:n}),L0={left:"right",right:"left",bottom:"top",top:"bottom"},I0={start:"end",end:"start"};function Ua(n,o,s){return Et(n,Gn(o,s))}function wn(n,o){return typeof n=="function"?n(o):n}function xn(n){return n.split("-")[0]}function Yr(n){return n.split("-")[1]}function uu(n){return n==="x"?"y":"x"}function cu(n){return n==="y"?"height":"width"}const D0=new Set(["top","bottom"]);function on(n){return D0.has(xn(n))?"y":"x"}function du(n){return uu(on(n))}function F0(n,o,s){s===void 0&&(s=!1);const l=Yr(n),u=du(n),d=cu(u);let f=u==="x"?l===(s?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[d]>o.floating[d]&&(f=xi(f)),[f,xi(f)]}function z0(n){const o=xi(n);return[Ba(n),o,Ba(o)]}function Ba(n){return n.replace(/start|end/g,o=>I0[o])}const Sf=["left","right"],Ef=["right","left"],U0=["top","bottom"],B0=["bottom","top"];function $0(n,o,s){switch(n){case"top":case"bottom":return s?o?Ef:Sf:o?Sf:Ef;case"left":case"right":return o?U0:B0;default:return[]}}function V0(n,o,s,l){const u=Yr(n);let d=$0(xn(n),s==="start",l);return u&&(d=d.map(f=>f+"-"+u),o&&(d=d.concat(d.map(Ba)))),d}function xi(n){return n.replace(/left|right|bottom|top/g,o=>L0[o])}function W0(n){return{top:0,right:0,bottom:0,left:0,...n}}function Wp(n){return typeof n!="number"?W0(n):{top:n,right:n,bottom:n,left:n}}function Si(n){const{x:o,y:s,width:l,height:u}=n;return{width:l,height:u,top:s,left:o,right:o+l,bottom:s+u,x:o,y:s}}function bf(n,o,s){let{reference:l,floating:u}=n;const d=on(o),f=du(o),p=cu(f),m=xn(o),g=d==="y",y=l.x+l.width/2-u.width/2,x=l.y+l.height/2-u.height/2,k=l[p]/2-u[p]/2;let v;switch(m){case"top":v={x:y,y:l.y-u.height};break;case"bottom":v={x:y,y:l.y+l.height};break;case"right":v={x:l.x+l.width,y:x};break;case"left":v={x:l.x-u.width,y:x};break;default:v={x:l.x,y:l.y}}switch(Yr(o)){case"start":v[f]-=k*(s&&g?-1:1);break;case"end":v[f]+=k*(s&&g?-1:1);break}return v}async function H0(n,o){var s;o===void 0&&(o={});const{x:l,y:u,platform:d,rects:f,elements:p,strategy:m}=n,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:x="floating",altBoundary:k=!1,padding:v=0}=wn(o,n),N=Wp(v),C=p[k?x==="floating"?"reference":"floating":x],A=Si(await d.getClippingRect({element:(s=await(d.isElement==null?void 0:d.isElement(C)))==null||s?C:C.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(p.floating)),boundary:g,rootBoundary:y,strategy:m})),L=x==="floating"?{x:l,y:u,width:f.floating.width,height:f.floating.height}:f.reference,D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p.floating)),z=await(d.isElement==null?void 0:d.isElement(D))?await(d.getScale==null?void 0:d.getScale(D))||{x:1,y:1}:{x:1,y:1},Q=Si(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:L,offsetParent:D,strategy:m}):L);return{top:(A.top-Q.top+N.top)/z.y,bottom:(Q.bottom-A.bottom+N.bottom)/z.y,left:(A.left-Q.left+N.left)/z.x,right:(Q.right-A.right+N.right)/z.x}}const Q0=async(n,o,s)=>{const{placement:l="bottom",strategy:u="absolute",middleware:d=[],platform:f}=s,p=d.filter(Boolean),m=await(f.isRTL==null?void 0:f.isRTL(o));let g=await f.getElementRects({reference:n,floating:o,strategy:u}),{x:y,y:x}=bf(g,l,m),k=l,v={},N=0;for(let C=0;C<p.length;C++){var b;const{name:A,fn:L}=p[C],{x:D,y:z,data:Q,reset:W}=await L({x:y,y:x,initialPlacement:l,placement:k,strategy:u,middlewareData:v,rects:g,platform:{...f,detectOverflow:(b=f.detectOverflow)!=null?b:H0},elements:{reference:n,floating:o}});y=D??y,x=z??x,v={...v,[A]:{...v[A],...Q}},W&&N<=50&&(N++,typeof W=="object"&&(W.placement&&(k=W.placement),W.rects&&(g=W.rects===!0?await f.getElementRects({reference:n,floating:o,strategy:u}):W.rects),{x:y,y:x}=bf(g,k,m)),C=-1)}return{x:y,y:x,placement:k,strategy:u,middlewareData:v}},K0=n=>({name:"arrow",options:n,async fn(o){const{x:s,y:l,placement:u,rects:d,platform:f,elements:p,middlewareData:m}=o,{element:g,padding:y=0}=wn(n,o)||{};if(g==null)return{};const x=Wp(y),k={x:s,y:l},v=du(u),N=cu(v),b=await f.getDimensions(g),C=v==="y",A=C?"top":"left",L=C?"bottom":"right",D=C?"clientHeight":"clientWidth",z=d.reference[N]+d.reference[v]-k[v]-d.floating[N],Q=k[v]-d.reference[v],W=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let K=W?W[D]:0;(!K||!await(f.isElement==null?void 0:f.isElement(W)))&&(K=p.floating[D]||d.floating[N]);const re=z/2-Q/2,pe=K/2-b[N]/2-1,ce=Gn(x[A],pe),ge=Gn(x[L],pe),X=ce,de=K-b[N]-ge,G=K/2-b[N]/2+re,ve=Ua(X,G,de),ie=!m.arrow&&Yr(u)!=null&&G!==ve&&d.reference[N]/2-(G<X?ce:ge)-b[N]/2<0,oe=ie?G<X?G-X:G-de:0;return{[v]:k[v]+oe,data:{[v]:ve,centerOffset:G-ve-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),Y0=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(o){var s,l;const{placement:u,middlewareData:d,rects:f,initialPlacement:p,platform:m,elements:g}=o,{mainAxis:y=!0,crossAxis:x=!0,fallbackPlacements:k,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:b=!0,...C}=wn(n,o);if((s=d.arrow)!=null&&s.alignmentOffset)return{};const A=xn(u),L=on(p),D=xn(p)===p,z=await(m.isRTL==null?void 0:m.isRTL(g.floating)),Q=k||(D||!b?[xi(p)]:z0(p)),W=N!=="none";!k&&W&&Q.push(...V0(p,b,N,z));const K=[p,...Q],re=await m.detectOverflow(o,C),pe=[];let ce=((l=d.flip)==null?void 0:l.overflows)||[];if(y&&pe.push(re[A]),x){const G=F0(u,f,z);pe.push(re[G[0]],re[G[1]])}if(ce=[...ce,{placement:u,overflows:pe}],!pe.every(G=>G<=0)){var ge,X;const G=(((ge=d.flip)==null?void 0:ge.index)||0)+1,ve=K[G];if(ve&&(!(x==="alignment"?L!==on(ve):!1)||ce.every(I=>on(I.placement)===L?I.overflows[0]>0:!0)))return{data:{index:G,overflows:ce},reset:{placement:ve}};let ie=(X=ce.filter(oe=>oe.overflows[0]<=0).sort((oe,I)=>oe.overflows[1]-I.overflows[1])[0])==null?void 0:X.placement;if(!ie)switch(v){case"bestFit":{var de;const oe=(de=ce.filter(I=>{if(W){const F=on(I.placement);return F===L||F==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,V)=>F+V,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:de[0];oe&&(ie=oe);break}case"initialPlacement":ie=p;break}if(u!==ie)return{reset:{placement:ie}}}return{}}}};function Cf(n,o){return{top:n.top-o.height,right:n.right-o.width,bottom:n.bottom-o.height,left:n.left-o.width}}function kf(n){return M0.some(o=>n[o]>=0)}const G0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(o){const{rects:s,platform:l}=o,{strategy:u="referenceHidden",...d}=wn(n,o);switch(u){case"referenceHidden":{const f=await l.detectOverflow(o,{...d,elementContext:"reference"}),p=Cf(f,s.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:kf(p)}}}case"escaped":{const f=await l.detectOverflow(o,{...d,altBoundary:!0}),p=Cf(f,s.floating);return{data:{escapedOffsets:p,escaped:kf(p)}}}default:return{}}}}},Hp=new Set(["left","top"]);async function q0(n,o){const{placement:s,platform:l,elements:u}=n,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=xn(s),p=Yr(s),m=on(s)==="y",g=Hp.has(f)?-1:1,y=d&&m?-1:1,x=wn(o,n);let{mainAxis:k,crossAxis:v,alignmentAxis:N}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return p&&typeof N=="number"&&(v=p==="end"?N*-1:N),m?{x:v*y,y:k*g}:{x:k*g,y:v*y}}const X0=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(o){var s,l;const{x:u,y:d,placement:f,middlewareData:p}=o,m=await q0(o,n);return f===((s=p.offset)==null?void 0:s.placement)&&(l=p.arrow)!=null&&l.alignmentOffset?{}:{x:u+m.x,y:d+m.y,data:{...m,placement:f}}}}},Z0=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(o){const{x:s,y:l,placement:u,platform:d}=o,{mainAxis:f=!0,crossAxis:p=!1,limiter:m={fn:A=>{let{x:L,y:D}=A;return{x:L,y:D}}},...g}=wn(n,o),y={x:s,y:l},x=await d.detectOverflow(o,g),k=on(xn(u)),v=uu(k);let N=y[v],b=y[k];if(f){const A=v==="y"?"top":"left",L=v==="y"?"bottom":"right",D=N+x[A],z=N-x[L];N=Ua(D,N,z)}if(p){const A=k==="y"?"top":"left",L=k==="y"?"bottom":"right",D=b+x[A],z=b-x[L];b=Ua(D,b,z)}const C=m.fn({...o,[v]:N,[k]:b});return{...C,data:{x:C.x-s,y:C.y-l,enabled:{[v]:f,[k]:p}}}}}},J0=function(n){return n===void 0&&(n={}),{options:n,fn(o){const{x:s,y:l,placement:u,rects:d,middlewareData:f}=o,{offset:p=0,mainAxis:m=!0,crossAxis:g=!0}=wn(n,o),y={x:s,y:l},x=on(u),k=uu(x);let v=y[k],N=y[x];const b=wn(p,o),C=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(m){const D=k==="y"?"height":"width",z=d.reference[k]-d.floating[D]+C.mainAxis,Q=d.reference[k]+d.reference[D]-C.mainAxis;v<z?v=z:v>Q&&(v=Q)}if(g){var A,L;const D=k==="y"?"width":"height",z=Hp.has(xn(u)),Q=d.reference[x]-d.floating[D]+(z&&((A=f.offset)==null?void 0:A[x])||0)+(z?0:C.crossAxis),W=d.reference[x]+d.reference[D]+(z?0:((L=f.offset)==null?void 0:L[x])||0)-(z?C.crossAxis:0);N<Q?N=Q:N>W&&(N=W)}return{[k]:v,[x]:N}}}},ew=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(o){var s,l;const{placement:u,rects:d,platform:f,elements:p}=o,{apply:m=()=>{},...g}=wn(n,o),y=await f.detectOverflow(o,g),x=xn(u),k=Yr(u),v=on(u)==="y",{width:N,height:b}=d.floating;let C,A;x==="top"||x==="bottom"?(C=x,A=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(A=x,C=k==="end"?"top":"bottom");const L=b-y.top-y.bottom,D=N-y.left-y.right,z=Gn(b-y[C],L),Q=Gn(N-y[A],D),W=!o.middlewareData.shift;let K=z,re=Q;if((s=o.middlewareData.shift)!=null&&s.enabled.x&&(re=D),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(K=L),W&&!k){const ce=Et(y.left,0),ge=Et(y.right,0),X=Et(y.top,0),de=Et(y.bottom,0);v?re=N-2*(ce!==0||ge!==0?ce+ge:Et(y.left,y.right)):K=b-2*(X!==0||de!==0?X+de:Et(y.top,y.bottom))}await m({...o,availableWidth:re,availableHeight:K});const pe=await f.getDimensions(p.floating);return N!==pe.width||b!==pe.height?{reset:{rects:!0}}:{}}}};function _i(){return typeof window<"u"}function Gr(n){return Qp(n)?(n.nodeName||"").toLowerCase():"#document"}function bt(n){var o;return(n==null||(o=n.ownerDocument)==null?void 0:o.defaultView)||window}function an(n){var o;return(o=(Qp(n)?n.ownerDocument:n.document)||window.document)==null?void 0:o.documentElement}function Qp(n){return _i()?n instanceof Node||n instanceof bt(n).Node:!1}function Ht(n){return _i()?n instanceof Element||n instanceof bt(n).Element:!1}function ln(n){return _i()?n instanceof HTMLElement||n instanceof bt(n).HTMLElement:!1}function Pf(n){return!_i()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof bt(n).ShadowRoot}const tw=new Set(["inline","contents"]);function Qo(n){const{overflow:o,overflowX:s,overflowY:l,display:u}=Qt(n);return/auto|scroll|overlay|hidden|clip/.test(o+l+s)&&!tw.has(u)}const nw=new Set(["table","td","th"]);function rw(n){return nw.has(Gr(n))}const ow=[":popover-open",":modal"];function ji(n){return ow.some(o=>{try{return n.matches(o)}catch{return!1}})}const sw=["transform","translate","scale","rotate","perspective"],iw=["transform","translate","scale","rotate","perspective","filter"],lw=["paint","layout","strict","content"];function fu(n){const o=pu(),s=Ht(n)?Qt(n):n;return sw.some(l=>s[l]?s[l]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!o&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!o&&(s.filter?s.filter!=="none":!1)||iw.some(l=>(s.willChange||"").includes(l))||lw.some(l=>(s.contain||"").includes(l))}function aw(n){let o=qn(n);for(;ln(o)&&!Hr(o);){if(fu(o))return o;if(ji(o))return null;o=qn(o)}return null}function pu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const uw=new Set(["html","body","#document"]);function Hr(n){return uw.has(Gr(n))}function Qt(n){return bt(n).getComputedStyle(n)}function Ai(n){return Ht(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function qn(n){if(Gr(n)==="html")return n;const o=n.assignedSlot||n.parentNode||Pf(n)&&n.host||an(n);return Pf(o)?o.host:o}function Kp(n){const o=qn(n);return Hr(o)?n.ownerDocument?n.ownerDocument.body:n.body:ln(o)&&Qo(o)?o:Kp(o)}function Bo(n,o,s){var l;o===void 0&&(o=[]),s===void 0&&(s=!0);const u=Kp(n),d=u===((l=n.ownerDocument)==null?void 0:l.body),f=bt(u);if(d){const p=$a(f);return o.concat(f,f.visualViewport||[],Qo(u)?u:[],p&&s?Bo(p):[])}return o.concat(u,Bo(u,[],s))}function $a(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Yp(n){const o=Qt(n);let s=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const u=ln(n),d=u?n.offsetWidth:s,f=u?n.offsetHeight:l,p=wi(s)!==d||wi(l)!==f;return p&&(s=d,l=f),{width:s,height:l,$:p}}function hu(n){return Ht(n)?n:n.contextElement}function Vr(n){const o=hu(n);if(!ln(o))return sn(1);const s=o.getBoundingClientRect(),{width:l,height:u,$:d}=Yp(o);let f=(d?wi(s.width):s.width)/l,p=(d?wi(s.height):s.height)/u;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const cw=sn(0);function Gp(n){const o=bt(n);return!pu()||!o.visualViewport?cw:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function dw(n,o,s){return o===void 0&&(o=!1),!s||o&&s!==bt(n)?!1:o}function fr(n,o,s,l){o===void 0&&(o=!1),s===void 0&&(s=!1);const u=n.getBoundingClientRect(),d=hu(n);let f=sn(1);o&&(l?Ht(l)&&(f=Vr(l)):f=Vr(n));const p=dw(d,s,l)?Gp(d):sn(0);let m=(u.left+p.x)/f.x,g=(u.top+p.y)/f.y,y=u.width/f.x,x=u.height/f.y;if(d){const k=bt(d),v=l&&Ht(l)?bt(l):l;let N=k,b=$a(N);for(;b&&l&&v!==N;){const C=Vr(b),A=b.getBoundingClientRect(),L=Qt(b),D=A.left+(b.clientLeft+parseFloat(L.paddingLeft))*C.x,z=A.top+(b.clientTop+parseFloat(L.paddingTop))*C.y;m*=C.x,g*=C.y,y*=C.x,x*=C.y,m+=D,g+=z,N=bt(b),b=$a(N)}}return Si({width:y,height:x,x:m,y:g})}function Mi(n,o){const s=Ai(n).scrollLeft;return o?o.left+s:fr(an(n)).left+s}function qp(n,o){const s=n.getBoundingClientRect(),l=s.left+o.scrollLeft-Mi(n,s),u=s.top+o.scrollTop;return{x:l,y:u}}function fw(n){let{elements:o,rect:s,offsetParent:l,strategy:u}=n;const d=u==="fixed",f=an(l),p=o?ji(o.floating):!1;if(l===f||p&&d)return s;let m={scrollLeft:0,scrollTop:0},g=sn(1);const y=sn(0),x=ln(l);if((x||!x&&!d)&&((Gr(l)!=="body"||Qo(f))&&(m=Ai(l)),ln(l))){const v=fr(l);g=Vr(l),y.x=v.x+l.clientLeft,y.y=v.y+l.clientTop}const k=f&&!x&&!d?qp(f,m):sn(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-m.scrollLeft*g.x+y.x+k.x,y:s.y*g.y-m.scrollTop*g.y+y.y+k.y}}function pw(n){return Array.from(n.getClientRects())}function hw(n){const o=an(n),s=Ai(n),l=n.ownerDocument.body,u=Et(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),d=Et(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let f=-s.scrollLeft+Mi(n);const p=-s.scrollTop;return Qt(l).direction==="rtl"&&(f+=Et(o.clientWidth,l.clientWidth)-u),{width:u,height:d,x:f,y:p}}const Rf=25;function mw(n,o){const s=bt(n),l=an(n),u=s.visualViewport;let d=l.clientWidth,f=l.clientHeight,p=0,m=0;if(u){d=u.width,f=u.height;const y=pu();(!y||y&&o==="fixed")&&(p=u.offsetLeft,m=u.offsetTop)}const g=Mi(l);if(g<=0){const y=l.ownerDocument,x=y.body,k=getComputedStyle(x),v=y.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,N=Math.abs(l.clientWidth-x.clientWidth-v);N<=Rf&&(d-=N)}else g<=Rf&&(d+=g);return{width:d,height:f,x:p,y:m}}const gw=new Set(["absolute","fixed"]);function vw(n,o){const s=fr(n,!0,o==="fixed"),l=s.top+n.clientTop,u=s.left+n.clientLeft,d=ln(n)?Vr(n):sn(1),f=n.clientWidth*d.x,p=n.clientHeight*d.y,m=u*d.x,g=l*d.y;return{width:f,height:p,x:m,y:g}}function Tf(n,o,s){let l;if(o==="viewport")l=mw(n,s);else if(o==="document")l=hw(an(n));else if(Ht(o))l=vw(o,s);else{const u=Gp(n);l={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Si(l)}function Xp(n,o){const s=qn(n);return s===o||!Ht(s)||Hr(s)?!1:Qt(s).position==="fixed"||Xp(s,o)}function yw(n,o){const s=o.get(n);if(s)return s;let l=Bo(n,[],!1).filter(p=>Ht(p)&&Gr(p)!=="body"),u=null;const d=Qt(n).position==="fixed";let f=d?qn(n):n;for(;Ht(f)&&!Hr(f);){const p=Qt(f),m=fu(f);!m&&p.position==="fixed"&&(u=null),(d?!m&&!u:!m&&p.position==="static"&&!!u&&gw.has(u.position)||Qo(f)&&!m&&Xp(n,f))?l=l.filter(y=>y!==f):u=p,f=qn(f)}return o.set(n,l),l}function ww(n){let{element:o,boundary:s,rootBoundary:l,strategy:u}=n;const f=[...s==="clippingAncestors"?ji(o)?[]:yw(o,this._c):[].concat(s),l],p=f[0],m=f.reduce((g,y)=>{const x=Tf(o,y,u);return g.top=Et(x.top,g.top),g.right=Gn(x.right,g.right),g.bottom=Gn(x.bottom,g.bottom),g.left=Et(x.left,g.left),g},Tf(o,p,u));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function xw(n){const{width:o,height:s}=Yp(n);return{width:o,height:s}}function Sw(n,o,s){const l=ln(o),u=an(o),d=s==="fixed",f=fr(n,!0,d,o);let p={scrollLeft:0,scrollTop:0};const m=sn(0);function g(){m.x=Mi(u)}if(l||!l&&!d)if((Gr(o)!=="body"||Qo(u))&&(p=Ai(o)),l){const v=fr(o,!0,d,o);m.x=v.x+o.clientLeft,m.y=v.y+o.clientTop}else u&&g();d&&!l&&u&&g();const y=u&&!l&&!d?qp(u,p):sn(0),x=f.left+p.scrollLeft-m.x-y.x,k=f.top+p.scrollTop-m.y-y.y;return{x,y:k,width:f.width,height:f.height}}function Oa(n){return Qt(n).position==="static"}function Nf(n,o){if(!ln(n)||Qt(n).position==="fixed")return null;if(o)return o(n);let s=n.offsetParent;return an(n)===s&&(s=s.ownerDocument.body),s}function Zp(n,o){const s=bt(n);if(ji(n))return s;if(!ln(n)){let u=qn(n);for(;u&&!Hr(u);){if(Ht(u)&&!Oa(u))return u;u=qn(u)}return s}let l=Nf(n,o);for(;l&&rw(l)&&Oa(l);)l=Nf(l,o);return l&&Hr(l)&&Oa(l)&&!fu(l)?s:l||aw(n)||s}const Ew=async function(n){const o=this.getOffsetParent||Zp,s=this.getDimensions,l=await s(n.floating);return{reference:Sw(n.reference,await o(n.floating),n.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function bw(n){return Qt(n).direction==="rtl"}const Cw={convertOffsetParentRelativeRectToViewportRelativeRect:fw,getDocumentElement:an,getClippingRect:ww,getOffsetParent:Zp,getElementRects:Ew,getClientRects:pw,getDimensions:xw,getScale:Vr,isElement:Ht,isRTL:bw};function Jp(n,o){return n.x===o.x&&n.y===o.y&&n.width===o.width&&n.height===o.height}function kw(n,o){let s=null,l;const u=an(n);function d(){var p;clearTimeout(l),(p=s)==null||p.disconnect(),s=null}function f(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),d();const g=n.getBoundingClientRect(),{left:y,top:x,width:k,height:v}=g;if(p||o(),!k||!v)return;const N=fi(x),b=fi(u.clientWidth-(y+k)),C=fi(u.clientHeight-(x+v)),A=fi(y),D={rootMargin:-N+"px "+-b+"px "+-C+"px "+-A+"px",threshold:Et(0,Gn(1,m))||1};let z=!0;function Q(W){const K=W[0].intersectionRatio;if(K!==m){if(!z)return f();K?f(!1,K):l=setTimeout(()=>{f(!1,1e-7)},1e3)}K===1&&!Jp(g,n.getBoundingClientRect())&&f(),z=!1}try{s=new IntersectionObserver(Q,{...D,root:u.ownerDocument})}catch{s=new IntersectionObserver(Q,D)}s.observe(n)}return f(!0),d}function Pw(n,o,s,l){l===void 0&&(l={});const{ancestorScroll:u=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:m=!1}=l,g=hu(n),y=u||d?[...g?Bo(g):[],...Bo(o)]:[];y.forEach(A=>{u&&A.addEventListener("scroll",s,{passive:!0}),d&&A.addEventListener("resize",s)});const x=g&&p?kw(g,s):null;let k=-1,v=null;f&&(v=new ResizeObserver(A=>{let[L]=A;L&&L.target===g&&v&&(v.unobserve(o),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var D;(D=v)==null||D.observe(o)})),s()}),g&&!m&&v.observe(g),v.observe(o));let N,b=m?fr(n):null;m&&C();function C(){const A=fr(n);b&&!Jp(b,A)&&s(),b=A,N=requestAnimationFrame(C)}return s(),()=>{var A;y.forEach(L=>{u&&L.removeEventListener("scroll",s),d&&L.removeEventListener("resize",s)}),x?.(),(A=v)==null||A.disconnect(),v=null,m&&cancelAnimationFrame(N)}}const Rw=X0,Tw=Z0,Nw=Y0,Ow=ew,_w=G0,Of=K0,jw=J0,Aw=(n,o,s)=>{const l=new Map,u={platform:Cw,...s},d={...u.platform,_c:l};return Q0(n,o,{...u,platform:d})};var Mw=typeof document<"u",Lw=function(){},yi=Mw?w.useLayoutEffect:Lw;function Ei(n,o){if(n===o)return!0;if(typeof n!=typeof o)return!1;if(typeof n=="function"&&n.toString()===o.toString())return!0;let s,l,u;if(n&&o&&typeof n=="object"){if(Array.isArray(n)){if(s=n.length,s!==o.length)return!1;for(l=s;l--!==0;)if(!Ei(n[l],o[l]))return!1;return!0}if(u=Object.keys(n),s=u.length,s!==Object.keys(o).length)return!1;for(l=s;l--!==0;)if(!{}.hasOwnProperty.call(o,u[l]))return!1;for(l=s;l--!==0;){const d=u[l];if(!(d==="_owner"&&n.$$typeof)&&!Ei(n[d],o[d]))return!1}return!0}return n!==n&&o!==o}function eh(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function _f(n,o){const s=eh(n);return Math.round(o*s)/s}function _a(n){const o=w.useRef(n);return yi(()=>{o.current=n}),o}function Iw(n){n===void 0&&(n={});const{placement:o="bottom",strategy:s="absolute",middleware:l=[],platform:u,elements:{reference:d,floating:f}={},transform:p=!0,whileElementsMounted:m,open:g}=n,[y,x]=w.useState({x:0,y:0,strategy:s,placement:o,middlewareData:{},isPositioned:!1}),[k,v]=w.useState(l);Ei(k,l)||v(l);const[N,b]=w.useState(null),[C,A]=w.useState(null),L=w.useCallback(I=>{I!==W.current&&(W.current=I,b(I))},[]),D=w.useCallback(I=>{I!==K.current&&(K.current=I,A(I))},[]),z=d||N,Q=f||C,W=w.useRef(null),K=w.useRef(null),re=w.useRef(y),pe=m!=null,ce=_a(m),ge=_a(u),X=_a(g),de=w.useCallback(()=>{if(!W.current||!K.current)return;const I={placement:o,strategy:s,middleware:k};ge.current&&(I.platform=ge.current),Aw(W.current,K.current,I).then(F=>{const V={...F,isPositioned:X.current!==!1};G.current&&!Ei(re.current,V)&&(re.current=V,Ri.flushSync(()=>{x(V)}))})},[k,o,s,ge,X]);yi(()=>{g===!1&&re.current.isPositioned&&(re.current.isPositioned=!1,x(I=>({...I,isPositioned:!1})))},[g]);const G=w.useRef(!1);yi(()=>(G.current=!0,()=>{G.current=!1}),[]),yi(()=>{if(z&&(W.current=z),Q&&(K.current=Q),z&&Q){if(ce.current)return ce.current(z,Q,de);de()}},[z,Q,de,ce,pe]);const ve=w.useMemo(()=>({reference:W,floating:K,setReference:L,setFloating:D}),[L,D]),ie=w.useMemo(()=>({reference:z,floating:Q}),[z,Q]),oe=w.useMemo(()=>{const I={position:s,left:0,top:0};if(!ie.floating)return I;const F=_f(ie.floating,y.x),V=_f(ie.floating,y.y);return p?{...I,transform:"translate("+F+"px, "+V+"px)",...eh(ie.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:F,top:V}},[s,p,ie.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:de,refs:ve,elements:ie,floatingStyles:oe}),[y,de,ve,ie,oe])}const Dw=n=>{function o(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:n,fn(s){const{element:l,padding:u}=typeof n=="function"?n(s):n;return l&&o(l)?l.current!=null?Of({element:l.current,padding:u}).fn(s):{}:l?Of({element:l,padding:u}).fn(s):{}}}},Fw=(n,o)=>({...Rw(n),options:[n,o]}),zw=(n,o)=>({...Tw(n),options:[n,o]}),Uw=(n,o)=>({...jw(n),options:[n,o]}),Bw=(n,o)=>({...Nw(n),options:[n,o]}),$w=(n,o)=>({...Ow(n),options:[n,o]}),Vw=(n,o)=>({..._w(n),options:[n,o]}),Ww=(n,o)=>({...Dw(n),options:[n,o]});var Hw="Arrow",th=w.forwardRef((n,o)=>{const{children:s,width:l=10,height:u=5,...d}=n;return E.jsx(gt.svg,{...d,ref:o,width:l,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?s:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});th.displayName=Hw;var Qw=th;function Kw(n){const[o,s]=w.useState(void 0);return Yn(()=>{if(n){s({width:n.offsetWidth,height:n.offsetHeight});const l=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];let f,p;if("borderBoxSize"in d){const m=d.borderBoxSize,g=Array.isArray(m)?m[0]:m;f=g.inlineSize,p=g.blockSize}else f=n.offsetWidth,p=n.offsetHeight;s({width:f,height:p})});return l.observe(n,{box:"border-box"}),()=>l.unobserve(n)}else s(void 0)},[n]),o}var nh="Popper",[rh,oh]=Ti(nh),[pS,sh]=rh(nh),ih="PopperAnchor",lh=w.forwardRef((n,o)=>{const{__scopePopper:s,virtualRef:l,...u}=n,d=sh(ih,s),f=w.useRef(null),p=Wt(o,f),m=w.useRef(null);return w.useEffect(()=>{const g=m.current;m.current=l?.current||f.current,g!==m.current&&d.onAnchorChange(m.current)}),l?null:E.jsx(gt.div,{...u,ref:p})});lh.displayName=ih;var mu="PopperContent",[Yw,Gw]=rh(mu),ah=w.forwardRef((n,o)=>{const{__scopePopper:s,side:l="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:y=0,sticky:x="partial",hideWhenDetached:k=!1,updatePositionStrategy:v="optimized",onPlaced:N,...b}=n,C=sh(mu,s),[A,L]=w.useState(null),D=Wt(o,le=>L(le)),[z,Q]=w.useState(null),W=Kw(z),K=W?.width??0,re=W?.height??0,pe=l+(d!=="center"?"-"+d:""),ce=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ge=Array.isArray(g)?g:[g],X=ge.length>0,de={padding:ce,boundary:ge.filter(Xw),altBoundary:X},{refs:G,floatingStyles:ve,placement:ie,isPositioned:oe,middlewareData:I}=Iw({strategy:"fixed",placement:pe,whileElementsMounted:(...le)=>Pw(...le,{animationFrame:v==="always"}),elements:{reference:C.anchor},middleware:[Fw({mainAxis:u+re,alignmentAxis:f}),m&&zw({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?Uw():void 0,...de}),m&&Bw({...de}),$w({...de,apply:({elements:le,rects:Se,availableWidth:be,availableHeight:ze})=>{const{width:Ct,height:Sn}=Se.reference,kt=le.floating.style;kt.setProperty("--radix-popper-available-width",`${be}px`),kt.setProperty("--radix-popper-available-height",`${ze}px`),kt.setProperty("--radix-popper-anchor-width",`${Ct}px`),kt.setProperty("--radix-popper-anchor-height",`${Sn}px`)}}),z&&Ww({element:z,padding:p}),Zw({arrowWidth:K,arrowHeight:re}),k&&Vw({strategy:"referenceHidden",...de})]}),[F,V]=dh(ie),T=Kn(N);Yn(()=>{oe&&T?.()},[oe,T]);const M=I.arrow?.x,q=I.arrow?.y,J=I.arrow?.centerOffset!==0,[fe,ye]=w.useState();return Yn(()=>{A&&ye(window.getComputedStyle(A).zIndex)},[A]),E.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...ve,transform:oe?ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:E.jsx(Yw,{scope:s,placedSide:F,onArrowChange:Q,arrowX:M,arrowY:q,shouldHideArrow:J,children:E.jsx(gt.div,{"data-side":F,"data-align":V,...b,ref:D,style:{...b.style,animation:oe?void 0:"none"}})})})});ah.displayName=mu;var uh="PopperArrow",qw={top:"bottom",right:"left",bottom:"top",left:"right"},ch=w.forwardRef(function(o,s){const{__scopePopper:l,...u}=o,d=Gw(uh,l),f=qw[d.placedSide];return E.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:E.jsx(Qw,{...u,ref:s,style:{...u.style,display:"block"}})})});ch.displayName=uh;function Xw(n){return n!==null}var Zw=n=>({name:"transformOrigin",options:n,fn(o){const{placement:s,rects:l,middlewareData:u}=o,f=u.arrow?.centerOffset!==0,p=f?0:n.arrowWidth,m=f?0:n.arrowHeight,[g,y]=dh(s),x={start:"0%",center:"50%",end:"100%"}[y],k=(u.arrow?.x??0)+p/2,v=(u.arrow?.y??0)+m/2;let N="",b="";return g==="bottom"?(N=f?x:`${k}px`,b=`${-m}px`):g==="top"?(N=f?x:`${k}px`,b=`${l.floating.height+m}px`):g==="right"?(N=`${-m}px`,b=f?x:`${v}px`):g==="left"&&(N=`${l.floating.width+m}px`,b=f?x:`${v}px`),{data:{x:N,y:b}}}});function dh(n){const[o,s="center"]=n.split("-");return[o,s]}var Jw=lh,ex=ah,tx=ch,[Li]=Ti("Tooltip",[oh]),gu=oh(),fh="TooltipProvider",nx=700,jf="tooltip.open",[rx,ph]=Li(fh),hh=n=>{const{__scopeTooltip:o,delayDuration:s=nx,skipDelayDuration:l=300,disableHoverableContent:u=!1,children:d}=n,f=w.useRef(!0),p=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const g=m.current;return()=>window.clearTimeout(g)},[]),E.jsx(rx,{scope:o,isOpenDelayedRef:f,delayDuration:s,onOpen:w.useCallback(()=>{window.clearTimeout(m.current),f.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>f.current=!0,l)},[l]),isPointerInTransitRef:p,onPointerInTransitChange:w.useCallback(g=>{p.current=g},[]),disableHoverableContent:u,children:d})};hh.displayName=fh;var mh="Tooltip",[hS,Ii]=Li(mh),Va="TooltipTrigger",ox=w.forwardRef((n,o)=>{const{__scopeTooltip:s,...l}=n,u=Ii(Va,s),d=ph(Va,s),f=gu(s),p=w.useRef(null),m=Wt(o,p,u.onTriggerChange),g=w.useRef(!1),y=w.useRef(!1),x=w.useCallback(()=>g.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),E.jsx(Jw,{asChild:!0,...f,children:E.jsx(gt.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...l,ref:m,onPointerMove:Ve(n.onPointerMove,k=>{k.pointerType!=="touch"&&!y.current&&!d.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ve(n.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:Ve(n.onPointerDown,()=>{u.open&&u.onClose(),g.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Ve(n.onFocus,()=>{g.current||u.onOpen()}),onBlur:Ve(n.onBlur,u.onClose),onClick:Ve(n.onClick,u.onClose)})})});ox.displayName=Va;var sx="TooltipPortal",[mS,ix]=Li(sx,{forceMount:void 0}),Qr="TooltipContent",gh=w.forwardRef((n,o)=>{const s=ix(Qr,n.__scopeTooltip),{forceMount:l=s.forceMount,side:u="top",...d}=n,f=Ii(Qr,n.__scopeTooltip);return E.jsx(ou,{present:l||f.open,children:f.disableHoverableContent?E.jsx(vh,{side:u,...d,ref:o}):E.jsx(lx,{side:u,...d,ref:o})})}),lx=w.forwardRef((n,o)=>{const s=Ii(Qr,n.__scopeTooltip),l=ph(Qr,n.__scopeTooltip),u=w.useRef(null),d=Wt(o,u),[f,p]=w.useState(null),{trigger:m,onClose:g}=s,y=u.current,{onPointerInTransitChange:x}=l,k=w.useCallback(()=>{p(null),x(!1)},[x]),v=w.useCallback((N,b)=>{const C=N.currentTarget,A={x:N.clientX,y:N.clientY},L=fx(A,C.getBoundingClientRect()),D=px(A,L),z=hx(b.getBoundingClientRect()),Q=gx([...D,...z]);p(Q),x(!0)},[x]);return w.useEffect(()=>()=>k(),[k]),w.useEffect(()=>{if(m&&y){const N=C=>v(C,y),b=C=>v(C,m);return m.addEventListener("pointerleave",N),y.addEventListener("pointerleave",b),()=>{m.removeEventListener("pointerleave",N),y.removeEventListener("pointerleave",b)}}},[m,y,v,k]),w.useEffect(()=>{if(f){const N=b=>{const C=b.target,A={x:b.clientX,y:b.clientY},L=m?.contains(C)||y?.contains(C),D=!mx(A,f);L?k():D&&(k(),g())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[m,y,f,g,k]),E.jsx(vh,{...n,ref:d})}),[ax,ux]=Li(mh,{isInside:!1}),cx=Xg("TooltipContent"),vh=w.forwardRef((n,o)=>{const{__scopeTooltip:s,children:l,"aria-label":u,onEscapeKeyDown:d,onPointerDownOutside:f,...p}=n,m=Ii(Qr,s),g=gu(s),{onClose:y}=m;return w.useEffect(()=>(document.addEventListener(jf,y),()=>document.removeEventListener(jf,y)),[y]),w.useEffect(()=>{if(m.trigger){const x=k=>{k.target?.contains(m.trigger)&&y()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[m.trigger,y]),E.jsx(ru,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:x=>x.preventDefault(),onDismiss:y,children:E.jsxs(ex,{"data-state":m.stateAttribute,...g,...p,ref:o,style:{...p.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:[E.jsx(cx,{children:l}),E.jsx(ax,{scope:s,isInside:!0,children:E.jsx(Ev,{id:m.contentId,role:"tooltip",children:u||l})})]})})});gh.displayName=Qr;var yh="TooltipArrow",dx=w.forwardRef((n,o)=>{const{__scopeTooltip:s,...l}=n,u=gu(s);return ux(yh,s).isInside?null:E.jsx(tx,{...u,...l,ref:o})});dx.displayName=yh;function fx(n,o){const s=Math.abs(o.top-n.y),l=Math.abs(o.bottom-n.y),u=Math.abs(o.right-n.x),d=Math.abs(o.left-n.x);switch(Math.min(s,l,u,d)){case d:return"left";case u:return"right";case s:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function px(n,o,s=5){const l=[];switch(o){case"top":l.push({x:n.x-s,y:n.y+s},{x:n.x+s,y:n.y+s});break;case"bottom":l.push({x:n.x-s,y:n.y-s},{x:n.x+s,y:n.y-s});break;case"left":l.push({x:n.x+s,y:n.y-s},{x:n.x+s,y:n.y+s});break;case"right":l.push({x:n.x-s,y:n.y-s},{x:n.x-s,y:n.y+s});break}return l}function hx(n){const{top:o,right:s,bottom:l,left:u}=n;return[{x:u,y:o},{x:s,y:o},{x:s,y:l},{x:u,y:l}]}function mx(n,o){const{x:s,y:l}=n;let u=!1;for(let d=0,f=o.length-1;d<o.length;f=d++){const p=o[d],m=o[f],g=p.x,y=p.y,x=m.x,k=m.y;y>l!=k>l&&s<(x-g)*(l-y)/(k-y)+g&&(u=!u)}return u}function gx(n){const o=n.slice();return o.sort((s,l)=>s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0),vx(o)}function vx(n){if(n.length<=1)return n.slice();const o=[];for(let l=0;l<n.length;l++){const u=n[l];for(;o.length>=2;){const d=o[o.length-1],f=o[o.length-2];if((d.x-f.x)*(u.y-f.y)>=(d.y-f.y)*(u.x-f.x))o.pop();else break}o.push(u)}o.pop();const s=[];for(let l=n.length-1;l>=0;l--){const u=n[l];for(;s.length>=2;){const d=s[s.length-1],f=s[s.length-2];if((d.x-f.x)*(u.y-f.y)>=(d.y-f.y)*(u.x-f.x))s.pop();else break}s.push(u)}return s.pop(),o.length===1&&s.length===1&&o[0].x===s[0].x&&o[0].y===s[0].y?o:o.concat(s)}var yx=hh,wh=gh;const wx=yx,xx=w.forwardRef(({className:n,sideOffset:o=4,...s},l)=>E.jsx(wh,{ref:l,sideOffset:o,className:Le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...s}));xx.displayName=wh.displayName;var Ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sx={setTimeout:(n,o)=>setTimeout(n,o),clearTimeout:n=>clearTimeout(n),setInterval:(n,o)=>setInterval(n,o),clearInterval:n=>clearInterval(n)},Ex=class{#e=Sx;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,o){return this.#e.setTimeout(n,o)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,o){return this.#e.setInterval(n,o)}clearInterval(n){this.#e.clearInterval(n)}},dr=new Ex;function bx(n){setTimeout(n,0)}var pr=typeof window>"u"||"Deno"in globalThis;function ht(){}function Cx(n,o){return typeof n=="function"?n(o):n}function Wa(n){return typeof n=="number"&&n>=0&&n!==1/0}function xh(n,o){return Math.max(n+(o||0)-Date.now(),0)}function Qn(n,o){return typeof n=="function"?n(o):n}function At(n,o){return typeof n=="function"?n(o):n}function Af(n,o){const{type:s="all",exact:l,fetchStatus:u,predicate:d,queryKey:f,stale:p}=n;if(f){if(l){if(o.queryHash!==vu(f,o.options))return!1}else if(!Vo(o.queryKey,f))return!1}if(s!=="all"){const m=o.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof p=="boolean"&&o.isStale()!==p||u&&u!==o.state.fetchStatus||d&&!d(o))}function Mf(n,o){const{exact:s,status:l,predicate:u,mutationKey:d}=n;if(d){if(!o.options.mutationKey)return!1;if(s){if($o(o.options.mutationKey)!==$o(d))return!1}else if(!Vo(o.options.mutationKey,d))return!1}return!(l&&o.state.status!==l||u&&!u(o))}function vu(n,o){return(o?.queryKeyHashFn||$o)(n)}function $o(n){return JSON.stringify(n,(o,s)=>Qa(s)?Object.keys(s).sort().reduce((l,u)=>(l[u]=s[u],l),{}):s)}function Vo(n,o){return n===o?!0:typeof n!=typeof o?!1:n&&o&&typeof n=="object"&&typeof o=="object"?Object.keys(o).every(s=>Vo(n[s],o[s])):!1}var kx=Object.prototype.hasOwnProperty;function Sh(n,o,s=0){if(n===o)return n;if(s>500)return o;const l=Lf(n)&&Lf(o);if(!l&&!(Qa(n)&&Qa(o)))return o;const d=(l?n:Object.keys(n)).length,f=l?o:Object.keys(o),p=f.length,m=l?new Array(p):{};let g=0;for(let y=0;y<p;y++){const x=l?y:f[y],k=n[x],v=o[x];if(k===v){m[x]=k,(l?y<d:kx.call(n,x))&&g++;continue}if(k===null||v===null||typeof k!="object"||typeof v!="object"){m[x]=v;continue}const N=Sh(k,v,s+1);m[x]=N,N===k&&g++}return d===p&&g===d?n:m}function Ha(n,o){if(!o||Object.keys(n).length!==Object.keys(o).length)return!1;for(const s in n)if(n[s]!==o[s])return!1;return!0}function Lf(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Qa(n){if(!If(n))return!1;const o=n.constructor;if(o===void 0)return!0;const s=o.prototype;return!(!If(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function If(n){return Object.prototype.toString.call(n)==="[object Object]"}function Px(n){return new Promise(o=>{dr.setTimeout(o,n)})}function Ka(n,o,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,o):s.structuralSharing!==!1?Sh(n,o):o}function Rx(n,o,s=0){const l=[...n,o];return s&&l.length>s?l.slice(1):l}function Tx(n,o,s=0){const l=[o,...n];return s&&l.length>s?l.slice(0,-1):l}var yu=Symbol();function Eh(n,o){return!n.queryFn&&o?.initialPromise?()=>o.initialPromise:!n.queryFn||n.queryFn===yu?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function bh(n,o){return typeof n=="function"?n(...o):!!n}function Nx(n,o,s){let l=!1,u;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(u??=o(),l||(l=!0,u.aborted?s():u.addEventListener("abort",s,{once:!0})),u)}),n}var Ox=class extends Ko{#e;#t;#n;constructor(){super(),this.#n=n=>{if(!pr&&window.addEventListener){const o=()=>n();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(o=>{o(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},wu=new Ox;function Ya(){let n,o;const s=new Promise((u,d)=>{n=u,o=d});s.status="pending",s.catch(()=>{});function l(u){Object.assign(s,u),delete s.resolve,delete s.reject}return s.resolve=u=>{l({status:"fulfilled",value:u}),n(u)},s.reject=u=>{l({status:"rejected",reason:u}),o(u)},s}var _x=bx;function jx(){let n=[],o=0,s=p=>{p()},l=p=>{p()},u=_x;const d=p=>{o?n.push(p):u(()=>{s(p)})},f=()=>{const p=n;n=[],p.length&&u(()=>{l(()=>{p.forEach(m=>{s(m)})})})};return{batch:p=>{let m;o++;try{m=p()}finally{o--,o||f()}return m},batchCalls:p=>(...m)=>{d(()=>{p(...m)})},schedule:d,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{l=p},setScheduler:p=>{u=p}}}var qe=jx(),Ax=class extends Ko{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(!pr&&window.addEventListener){const o=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(s=>{s(n)}))}isOnline(){return this.#e}},bi=new Ax;function Mx(n){return Math.min(1e3*2**n,3e4)}function Ch(n){return(n??"online")==="online"?bi.isOnline():!0}var Ga=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function kh(n){let o=!1,s=0,l;const u=Ya(),d=()=>u.status!=="pending",f=b=>{if(!d()){const C=new Ga(b);k(C),n.onCancel?.(C)}},p=()=>{o=!0},m=()=>{o=!1},g=()=>wu.isFocused()&&(n.networkMode==="always"||bi.isOnline())&&n.canRun(),y=()=>Ch(n.networkMode)&&n.canRun(),x=b=>{d()||(l?.(),u.resolve(b))},k=b=>{d()||(l?.(),u.reject(b))},v=()=>new Promise(b=>{l=C=>{(d()||g())&&b(C)},n.onPause?.()}).then(()=>{l=void 0,d()||n.onContinue?.()}),N=()=>{if(d())return;let b;const C=s===0?n.initialPromise:void 0;try{b=C??n.fn()}catch(A){b=Promise.reject(A)}Promise.resolve(b).then(x).catch(A=>{if(d())return;const L=n.retry??(pr?0:3),D=n.retryDelay??Mx,z=typeof D=="function"?D(s,A):D,Q=L===!0||typeof L=="number"&&s<L||typeof L=="function"&&L(s,A);if(o||!Q){k(A);return}s++,n.onFail?.(s,A),Px(z).then(()=>g()?void 0:v()).then(()=>{o?k(A):N()})})};return{promise:u,status:()=>u.status,cancel:f,continue:()=>(l?.(),u),cancelRetry:p,continueRetry:m,canStart:y,start:()=>(y()?N():v().then(N),u)}}var Ph=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wa(this.gcTime)&&(this.#e=dr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(pr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(dr.clearTimeout(this.#e),this.#e=void 0)}},Lx=class extends Ph{#e;#t;#n;#o;#r;#l;#i;constructor(n){super(),this.#i=!1,this.#l=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#o=n.client,this.#n=this.#o.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#e=Ff(this.options),this.state=n.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(n){if(this.options={...this.#l,...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=Ff(this.options);o.data!==void 0&&(this.setState(Df(o.data,o.dataUpdatedAt)),this.#e=o)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,o){const s=Ka(this.state.data,n,this.options);return this.#s({data:s,type:"success",dataUpdatedAt:o?.updatedAt,manual:o?.manual}),s}setState(n,o){this.#s({type:"setState",state:n,setStateOptions:o})}cancel(n){const o=this.#r?.promise;return this.#r?.cancel(n),o?o.then(ht).catch(ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(n=>At(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yu||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Qn(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!xh(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(o=>o.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(o=>o.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(o=>o!==n),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(n,o){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&o?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(n&&this.setOptions(n),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const s=new AbortController,l=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#i=!0,s.signal)})},u=()=>{const p=Eh(this.options,o),g=(()=>{const y={client:this.#o,queryKey:this.queryKey,meta:this.meta};return l(y),y})();return this.#i=!1,this.options.persister?this.options.persister(p,g,this):p(g)},f=(()=>{const p={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:u};return l(p),p})();this.options.behavior?.onFetch(f,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=kh({initialPromise:o?.initialPromise,fn:f.fetchFn,onCancel:p=>{p instanceof Ga&&p.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(p,m)=>{this.#s({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const p=await this.#r.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#n.config.onSuccess?.(p,this),this.#n.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof Ga){if(p.silent)return this.#r.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#n.config.onError?.(p,this),this.#n.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#s(n){const o=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Rh(s.data,this.options),fetchMeta:n.meta??null};case"success":const l={...s,...Df(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=n.manual?l:void 0,l;case"error":const u=n.error;return{...s,error:u,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=o(this.state),qe.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function Rh(n,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ch(o.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Df(n,o){return{data:n,dataUpdatedAt:o??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ff(n){const o=typeof n.initialData=="function"?n.initialData():n.initialData,s=o!==void 0,l=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:s?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Ix=class extends Ko{constructor(n,o){super(),this.options=o,this.#e=n,this.#s=null,this.#i=Ya(),this.bindMethods(),this.setOptions(o)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#l;#i;#s;#m;#f;#p;#u;#c;#a;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),zf(this.#t,this.options)?this.#d():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qa(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qa(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(n){const o=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof At(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),o._defaulted&&!Ha(this.options,o)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&Uf(this.#t,s,this.options,o)&&this.#d(),this.updateResult(),l&&(this.#t!==s||At(this.options.enabled,this.#t)!==At(o.enabled,this.#t)||Qn(this.options.staleTime,this.#t)!==Qn(o.staleTime,this.#t))&&this.#g();const u=this.#v();l&&(this.#t!==s||At(this.options.enabled,this.#t)!==At(o.enabled,this.#t)||u!==this.#a)&&this.#y(u)}getOptimisticResult(n){const o=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(o,n);return Fx(this,s)&&(this.#o=s,this.#l=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#o}trackResult(n,o){return new Proxy(n,{get:(s,l)=>(this.trackProp(l),o?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(n){this.#h.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const o=this.#e.defaultQueryOptions(n),s=this.#e.getQueryCache().build(this.#e,o);return s.fetch().then(()=>this.createResult(s,o))}fetch(n){return this.#d({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(n){this.#E();let o=this.#t.fetch(this.options,n);return n?.throwOnError||(o=o.catch(ht)),o}#g(){this.#x();const n=Qn(this.options.staleTime,this.#t);if(pr||this.#o.isStale||!Wa(n))return;const s=xh(this.#o.dataUpdatedAt,n)+1;this.#u=dr.setTimeout(()=>{this.#o.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(n){this.#S(),this.#a=n,!(pr||At(this.options.enabled,this.#t)===!1||!Wa(this.#a)||this.#a===0)&&(this.#c=dr.setInterval(()=>{(this.options.refetchIntervalInBackground||wu.isFocused())&&this.#d()},this.#a))}#w(){this.#g(),this.#y(this.#v())}#x(){this.#u&&(dr.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(dr.clearInterval(this.#c),this.#c=void 0)}createResult(n,o){const s=this.#t,l=this.options,u=this.#o,d=this.#r,f=this.#l,m=n!==s?n.state:this.#n,{state:g}=n;let y={...g},x=!1,k;if(o._optimisticResults){const re=this.hasListeners(),pe=!re&&zf(n,o),ce=re&&Uf(n,s,o,l);(pe||ce)&&(y={...y,...Rh(g.data,n.options)}),o._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:v,errorUpdatedAt:N,status:b}=y;k=y.data;let C=!1;if(o.placeholderData!==void 0&&k===void 0&&b==="pending"){let re;u?.isPlaceholderData&&o.placeholderData===f?.placeholderData?(re=u.data,C=!0):re=typeof o.placeholderData=="function"?o.placeholderData(this.#p?.state.data,this.#p):o.placeholderData,re!==void 0&&(b="success",k=Ka(u?.data,re,o),x=!0)}if(o.select&&k!==void 0&&!C)if(u&&k===d?.data&&o.select===this.#m)k=this.#f;else try{this.#m=o.select,k=o.select(k),k=Ka(u?.data,k,o),this.#f=k,this.#s=null}catch(re){this.#s=re}this.#s&&(v=this.#s,k=this.#f,N=Date.now(),b="error");const A=y.fetchStatus==="fetching",L=b==="pending",D=b==="error",z=L&&A,Q=k!==void 0,K={status:b,fetchStatus:y.fetchStatus,isPending:L,isSuccess:b==="success",isError:D,isInitialLoading:z,isLoading:z,data:k,dataUpdatedAt:y.dataUpdatedAt,error:v,errorUpdatedAt:N,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:A,isRefetching:A&&!L,isLoadingError:D&&!Q,isPaused:y.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&Q,isStale:xu(n,o),refetch:this.refetch,promise:this.#i,isEnabled:At(o.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const re=K.data!==void 0,pe=K.status==="error"&&!re,ce=de=>{pe?de.reject(K.error):re&&de.resolve(K.data)},ge=()=>{const de=this.#i=K.promise=Ya();ce(de)},X=this.#i;switch(X.status){case"pending":n.queryHash===s.queryHash&&ce(X);break;case"fulfilled":(pe||K.data!==X.value)&&ge();break;case"rejected":(!pe||K.error!==X.reason)&&ge();break}}return K}updateResult(){const n=this.#o,o=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#l=this.options,this.#r.data!==void 0&&(this.#p=this.#t),Ha(o,n))return;this.#o=o;const s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!this.#h.size)return!0;const d=new Set(u??this.#h);return this.options.throwOnError&&d.add("error"),Object.keys(this.#o).some(f=>{const p=f;return this.#o[p]!==n[p]&&d.has(p)})};this.#b({listeners:s()})}#E(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const o=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(o?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}#b(n){qe.batch(()=>{n.listeners&&this.listeners.forEach(o=>{o(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Dx(n,o){return At(o.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&o.retryOnMount===!1)}function zf(n,o){return Dx(n,o)||n.state.data!==void 0&&qa(n,o,o.refetchOnMount)}function qa(n,o,s){if(At(o.enabled,n)!==!1&&Qn(o.staleTime,n)!=="static"){const l=typeof s=="function"?s(n):s;return l==="always"||l!==!1&&xu(n,o)}return!1}function Uf(n,o,s,l){return(n!==o||At(l.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&xu(n,s)}function xu(n,o){return At(o.enabled,n)!==!1&&n.isStaleByTime(Qn(o.staleTime,n))}function Fx(n,o){return!Ha(n.getCurrentResult(),o)}function Bf(n){return{onFetch:(o,s)=>{const l=o.options,u=o.fetchOptions?.meta?.fetchMore?.direction,d=o.state.data?.pages||[],f=o.state.data?.pageParams||[];let p={pages:[],pageParams:[]},m=0;const g=async()=>{let y=!1;const x=N=>{Nx(N,()=>o.signal,()=>y=!0)},k=Eh(o.options,o.fetchOptions),v=async(N,b,C)=>{if(y)return Promise.reject();if(b==null&&N.pages.length)return Promise.resolve(N);const L=(()=>{const W={client:o.client,queryKey:o.queryKey,pageParam:b,direction:C?"backward":"forward",meta:o.options.meta};return x(W),W})(),D=await k(L),{maxPages:z}=o.options,Q=C?Tx:Rx;return{pages:Q(N.pages,D,z),pageParams:Q(N.pageParams,b,z)}};if(u&&d.length){const N=u==="backward",b=N?zx:$f,C={pages:d,pageParams:f},A=b(l,C);p=await v(C,A,N)}else{const N=n??d.length;do{const b=m===0?f[0]??l.initialPageParam:$f(l,p);if(m>0&&b==null)break;p=await v(p,b),m++}while(m<N)}return p};o.options.persister?o.fetchFn=()=>o.options.persister?.(g,{client:o.client,queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},s):o.fetchFn=g}}}function $f(n,{pages:o,pageParams:s}){const l=o.length-1;return o.length>0?n.getNextPageParam(o[l],o,s[l],s):void 0}function zx(n,{pages:o,pageParams:s}){return o.length>0?n.getPreviousPageParam?.(o[0],o,s[0],s):void 0}var Ux=class extends Ph{#e;#t;#n;#o;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Bx(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(o=>o!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(n){const o=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=kh({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(d,f)=>{this.#r({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#r({type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",u=!this.#o.canStart();try{if(l)o();else{this.#r({type:"pending",variables:n,isPaused:u}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,s);const f=await this.options.onMutate?.(n,s);f!==this.state.context&&this.#r({type:"pending",context:f,variables:n,isPaused:u})}const d=await this.#o.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,s),await this.options.onSuccess?.(d,n,this.state.context,s),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(d,null,n,this.state.context,s),this.#r({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onError?.(d,n,this.state.context,s)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,s)}catch(f){Promise.reject(f)}throw this.#r({type:"error",error:d}),d}finally{this.#n.runNext(this)}}#r(n){const o=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=o(this.state),qe.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Bx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $x=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,o,s){const l=new Ux({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(o),state:s});return this.add(l),l}add(n){this.#e.add(n);const o=pi(n);if(typeof o=="string"){const s=this.#t.get(o);s?s.push(n):this.#t.set(o,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const o=pi(n);if(typeof o=="string"){const s=this.#t.get(o);if(s)if(s.length>1){const l=s.indexOf(n);l!==-1&&s.splice(l,1)}else s[0]===n&&this.#t.delete(o)}}this.notify({type:"removed",mutation:n})}canRun(n){const o=pi(n);if(typeof o=="string"){const l=this.#t.get(o)?.find(u=>u.state.status==="pending");return!l||l===n}else return!0}runNext(n){const o=pi(n);return typeof o=="string"?this.#t.get(o)?.find(l=>l!==n&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){qe.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const o={exact:!0,...n};return this.getAll().find(s=>Mf(o,s))}findAll(n={}){return this.getAll().filter(o=>Mf(n,o))}notify(n){qe.batch(()=>{this.listeners.forEach(o=>{o(n)})})}resumePausedMutations(){const n=this.getAll().filter(o=>o.state.isPaused);return qe.batch(()=>Promise.all(n.map(o=>o.continue().catch(ht))))}};function pi(n){return n.options.scope?.id}var Vx=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,o,s){const l=o.queryKey,u=o.queryHash??vu(l,o);let d=this.get(u);return d||(d=new Lx({client:n,queryKey:l,queryHash:u,options:n.defaultQueryOptions(o),state:s,defaultOptions:n.getQueryDefaults(l)}),this.add(d)),d}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const o=this.#e.get(n.queryHash);o&&(n.destroy(),o===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){qe.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const o={exact:!0,...n};return this.getAll().find(s=>Af(o,s))}findAll(n={}){const o=this.getAll();return Object.keys(n).length>0?o.filter(s=>Af(n,s)):o}notify(n){qe.batch(()=>{this.listeners.forEach(o=>{o(n)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Wx=class{#e;#t;#n;#o;#r;#l;#i;#s;constructor(n={}){this.#e=n.queryCache||new Vx,this.#t=n.mutationCache||new $x,this.#n=n.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#i=wu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bi.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const o=this.defaultQueryOptions({queryKey:n});return this.#e.get(o.queryHash)?.state.data}ensureQueryData(n){const o=this.defaultQueryOptions(n),s=this.#e.build(this,o),l=s.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(Qn(o.staleTime,s))&&this.prefetchQuery(o),Promise.resolve(l))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:o,state:s})=>{const l=s.data;return[o,l]})}setQueryData(n,o,s){const l=this.defaultQueryOptions({queryKey:n}),d=this.#e.get(l.queryHash)?.state.data,f=Cx(o,d);if(f!==void 0)return this.#e.build(this,l).setData(f,{...s,manual:!0})}setQueriesData(n,o,s){return qe.batch(()=>this.#e.findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,o,s)]))}getQueryState(n){const o=this.defaultQueryOptions({queryKey:n});return this.#e.get(o.queryHash)?.state}removeQueries(n){const o=this.#e;qe.batch(()=>{o.findAll(n).forEach(s=>{o.remove(s)})})}resetQueries(n,o){const s=this.#e;return qe.batch(()=>(s.findAll(n).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...n},o)))}cancelQueries(n,o={}){const s={revert:!0,...o},l=qe.batch(()=>this.#e.findAll(n).map(u=>u.cancel(s)));return Promise.all(l).then(ht).catch(ht)}invalidateQueries(n,o={}){return qe.batch(()=>(this.#e.findAll(n).forEach(s=>{s.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},o)))}refetchQueries(n,o={}){const s={...o,cancelRefetch:o.cancelRefetch??!0},l=qe.batch(()=>this.#e.findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let d=u.fetch(void 0,s);return s.throwOnError||(d=d.catch(ht)),u.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(l).then(ht)}fetchQuery(n){const o=this.defaultQueryOptions(n);o.retry===void 0&&(o.retry=!1);const s=this.#e.build(this,o);return s.isStaleByTime(Qn(o.staleTime,s))?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ht).catch(ht)}fetchInfiniteQuery(n){return n.behavior=Bf(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ht).catch(ht)}ensureInfiniteQueryData(n){return n.behavior=Bf(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return bi.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,o){this.#o.set($o(n),{queryKey:n,defaultOptions:o})}getQueryDefaults(n){const o=[...this.#o.values()],s={};return o.forEach(l=>{Vo(n,l.queryKey)&&Object.assign(s,l.defaultOptions)}),s}setMutationDefaults(n,o){this.#r.set($o(n),{mutationKey:n,defaultOptions:o})}getMutationDefaults(n){const o=[...this.#r.values()],s={};return o.forEach(l=>{Vo(n,l.mutationKey)&&Object.assign(s,l.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const o={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return o.queryHash||(o.queryHash=vu(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.queryFn===yu&&(o.enabled=!1),o}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Th=w.createContext(void 0),Hx=n=>{const o=w.useContext(Th);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},Qx=({client:n,children:o})=>(w.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),E.jsx(Th.Provider,{value:n,children:o})),Nh=w.createContext(!1),Kx=()=>w.useContext(Nh);Nh.Provider;function Yx(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Gx=w.createContext(Yx()),qx=()=>w.useContext(Gx),Xx=(n,o,s)=>{const l=s?.state.error&&typeof n.throwOnError=="function"?bh(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||l)&&(o.isReset()||(n.retryOnMount=!1))},Zx=n=>{w.useEffect(()=>{n.clearReset()},[n])},Jx=({result:n,errorResetBoundary:o,throwOnError:s,query:l,suspense:u})=>n.isError&&!o.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||bh(s,[n.error,l])),e1=n=>{if(n.suspense){const s=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>s(l(...u)):s(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},t1=(n,o)=>n.isLoading&&n.isFetching&&!o,n1=(n,o)=>n?.suspense&&o.isPending,Vf=(n,o,s)=>o.fetchOptimistic(n).catch(()=>{s.clearReset()});function r1(n,o,s){const l=Kx(),u=qx(),d=Hx(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=d.getQueryCache().get(f.queryHash);f._optimisticResults=l?"isRestoring":"optimistic",e1(f),Xx(f,u,p),Zx(u);const m=!d.getQueryCache().get(f.queryHash),[g]=w.useState(()=>new o(d,f)),y=g.getOptimisticResult(f),x=!l&&n.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(k=>{const v=x?g.subscribe(qe.batchCalls(k)):ht;return g.updateResult(),v},[g,x]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),w.useEffect(()=>{g.setOptions(f)},[f,g]),n1(f,y))throw Vf(f,g,u);if(Jx({result:y,errorResetBoundary:u,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw y.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,y),f.experimental_prefetchInRender&&!pr&&t1(y,l)&&(m?Vf(f,g,u):p?.promise)?.catch(ht).finally(()=>{g.updateResult()}),f.notifyOnChangeProps?y:g.trackResult(y)}function o1(n,o){return r1(n,Ix)}function Ci(){return Ci=Object.assign?Object.assign.bind():function(n){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(n[l]=s[l])}return n},Ci.apply(this,arguments)}var Hn;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Hn||(Hn={}));const Wf="popstate";function s1(n){n===void 0&&(n={});function o(l,u){let{pathname:d,search:f,hash:p}=l.location;return Xa("",{pathname:d,search:f,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function s(l,u){return typeof u=="string"?u:_h(u)}return l1(o,s,null,n)}function mt(n,o){if(n===!1||n===null||typeof n>"u")throw new Error(o)}function Oh(n,o){if(!n){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function i1(){return Math.random().toString(36).substr(2,8)}function Hf(n,o){return{usr:n.state,key:n.key,idx:o}}function Xa(n,o,s,l){return s===void 0&&(s=null),Ci({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof o=="string"?Di(o):o,{state:s,key:o&&o.key||l||i1()})}function _h(n){let{pathname:o="/",search:s="",hash:l=""}=n;return s&&s!=="?"&&(o+=s.charAt(0)==="?"?s:"?"+s),l&&l!=="#"&&(o+=l.charAt(0)==="#"?l:"#"+l),o}function Di(n){let o={};if(n){let s=n.indexOf("#");s>=0&&(o.hash=n.substr(s),n=n.substr(0,s));let l=n.indexOf("?");l>=0&&(o.search=n.substr(l),n=n.substr(0,l)),n&&(o.pathname=n)}return o}function l1(n,o,s,l){l===void 0&&(l={});let{window:u=document.defaultView,v5Compat:d=!1}=l,f=u.history,p=Hn.Pop,m=null,g=y();g==null&&(g=0,f.replaceState(Ci({},f.state,{idx:g}),""));function y(){return(f.state||{idx:null}).idx}function x(){p=Hn.Pop;let C=y(),A=C==null?null:C-g;g=C,m&&m({action:p,location:b.location,delta:A})}function k(C,A){p=Hn.Push;let L=Xa(b.location,C,A);g=y()+1;let D=Hf(L,g),z=b.createHref(L);try{f.pushState(D,"",z)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;u.location.assign(z)}d&&m&&m({action:p,location:b.location,delta:1})}function v(C,A){p=Hn.Replace;let L=Xa(b.location,C,A);g=y();let D=Hf(L,g),z=b.createHref(L);f.replaceState(D,"",z),d&&m&&m({action:p,location:b.location,delta:0})}function N(C){let A=u.location.origin!=="null"?u.location.origin:u.location.href,L=typeof C=="string"?C:_h(C);return L=L.replace(/ $/,"%20"),mt(A,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,A)}let b={get action(){return p},get location(){return n(u,f)},listen(C){if(m)throw new Error("A history only accepts one active listener");return u.addEventListener(Wf,x),m=C,()=>{u.removeEventListener(Wf,x),m=null}},createHref(C){return o(u,C)},createURL:N,encodeLocation(C){let A=N(C);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:k,replace:v,go(C){return f.go(C)}};return b}var Qf;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Qf||(Qf={}));function a1(n,o,s){return s===void 0&&(s="/"),u1(n,o,s)}function u1(n,o,s,l){let u=typeof o=="string"?Di(o):o,d=Mh(u.pathname||"/",s);if(d==null)return null;let f=jh(n);c1(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=E1(d);p=w1(f[m],g)}return p}function jh(n,o,s,l){o===void 0&&(o=[]),s===void 0&&(s=[]),l===void 0&&(l="");let u=(d,f,p)=>{let m={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};m.relativePath.startsWith("/")&&(mt(m.relativePath.startsWith(l),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(l.length));let g=Wr([l,m.relativePath]),y=s.concat(m);d.children&&d.children.length>0&&(mt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),jh(d.children,o,y,g)),!(d.path==null&&!d.index)&&o.push({path:g,score:v1(g,d.index),routesMeta:y})};return n.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))u(d,f);else for(let m of Ah(d.path))u(d,f,m)}),o}function Ah(n){let o=n.split("/");if(o.length===0)return[];let[s,...l]=o,u=s.endsWith("?"),d=s.replace(/\?$/,"");if(l.length===0)return u?[d,""]:[d];let f=Ah(l.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),u&&p.push(...f),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function c1(n){n.sort((o,s)=>o.score!==s.score?s.score-o.score:y1(o.routesMeta.map(l=>l.childrenIndex),s.routesMeta.map(l=>l.childrenIndex)))}const d1=/^:[\w-]+$/,f1=3,p1=2,h1=1,m1=10,g1=-2,Kf=n=>n==="*";function v1(n,o){let s=n.split("/"),l=s.length;return s.some(Kf)&&(l+=g1),o&&(l+=p1),s.filter(u=>!Kf(u)).reduce((u,d)=>u+(d1.test(d)?f1:d===""?h1:m1),l)}function y1(n,o){return n.length===o.length&&n.slice(0,-1).every((l,u)=>l===o[u])?n[n.length-1]-o[o.length-1]:0}function w1(n,o,s){let{routesMeta:l}=n,u={},d="/",f=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=d==="/"?o:o.slice(d.length)||"/",x=x1({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),k=m.route;if(!x)return null;Object.assign(u,x.params),f.push({params:u,pathname:Wr([d,x.pathname]),pathnameBase:b1(Wr([d,x.pathnameBase])),route:k}),x.pathnameBase!=="/"&&(d=Wr([d,x.pathnameBase]))}return f}function x1(n,o){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,l]=S1(n.path,n.caseSensitive,n.end),u=o.match(s);if(!u)return null;let d=u[0],f=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:l.reduce((g,y,x)=>{let{paramName:k,isOptional:v}=y;if(k==="*"){let b=p[x]||"";f=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const N=p[x];return v&&!N?g[k]=void 0:g[k]=(N||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:n}}function S1(n,o,s){o===void 0&&(o=!1),s===void 0&&(s=!0),Oh(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let l=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m)=>(l.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(l.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,o?void 0:"i"),l]}function E1(n){try{return n.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Oh(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),n}}function Mh(n,o){if(o==="/")return n;if(!n.toLowerCase().startsWith(o.toLowerCase()))return null;let s=o.endsWith("/")?o.length-1:o.length,l=n.charAt(s);return l&&l!=="/"?null:n.slice(s)||"/"}const Wr=n=>n.join("/").replace(/\/\/+/g,"/"),b1=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/");function C1(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Lh=["post","put","patch","delete"];new Set(Lh);const k1=["get",...Lh];new Set(k1);function ki(){return ki=Object.assign?Object.assign.bind():function(n){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(n[l]=s[l])}return n},ki.apply(this,arguments)}const P1=w.createContext(null),R1=w.createContext(null),Ih=w.createContext(null),Fi=w.createContext(null),zi=w.createContext({outlet:null,matches:[],isDataRoute:!1}),Dh=w.createContext(null);function Su(){return w.useContext(Fi)!=null}function Fh(){return Su()||mt(!1),w.useContext(Fi).location}function T1(n,o){return N1(n,o)}function N1(n,o,s,l){Su()||mt(!1);let{navigator:u}=w.useContext(Ih),{matches:d}=w.useContext(zi),f=d[d.length-1],p=f?f.params:{};f&&f.pathname;let m=f?f.pathnameBase:"/";f&&f.route;let g=Fh(),y;if(o){var x;let C=typeof o=="string"?Di(o):o;m==="/"||(x=C.pathname)!=null&&x.startsWith(m)||mt(!1),y=C}else y=g;let k=y.pathname||"/",v=k;if(m!=="/"){let C=m.replace(/^\//,"").split("/");v="/"+k.replace(/^\//,"").split("/").slice(C.length).join("/")}let N=a1(n,{pathname:v}),b=M1(N&&N.map(C=>Object.assign({},C,{params:Object.assign({},p,C.params),pathname:Wr([m,u.encodeLocation?u.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Wr([m,u.encodeLocation?u.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),d,s,l);return o&&b?w.createElement(Fi.Provider,{value:{location:ki({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:Hn.Pop}},b):b}function O1(){let n=F1(),o=C1(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,u={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},o),s?w.createElement("pre",{style:u},s):null,null)}const _1=w.createElement(O1,null);class j1 extends w.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,s){return s.location!==o.location||s.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:s.error,location:s.location,revalidation:o.revalidation||s.revalidation}}componentDidCatch(o,s){console.error("React Router caught the following error during render",o,s)}render(){return this.state.error!==void 0?w.createElement(zi.Provider,{value:this.props.routeContext},w.createElement(Dh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function A1(n){let{routeContext:o,match:s,children:l}=n,u=w.useContext(P1);return u&&u.static&&u.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=s.route.id),w.createElement(zi.Provider,{value:o},l)}function M1(n,o,s,l){var u;if(o===void 0&&(o=[]),s===void 0&&(s=null),l===void 0&&(l=null),n==null){var d;if(!s)return null;if(s.errors)n=s.matches;else if((d=l)!=null&&d.v7_partialHydration&&o.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let f=n,p=(u=s)==null?void 0:u.errors;if(p!=null){let y=f.findIndex(x=>x.route.id&&p?.[x.route.id]!==void 0);y>=0||mt(!1),f=f.slice(0,Math.min(f.length,y+1))}let m=!1,g=-1;if(s&&l&&l.v7_partialHydration)for(let y=0;y<f.length;y++){let x=f[y];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=y),x.route.id){let{loaderData:k,errors:v}=s,N=x.route.loader&&k[x.route.id]===void 0&&(!v||v[x.route.id]===void 0);if(x.route.lazy||N){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((y,x,k)=>{let v,N=!1,b=null,C=null;s&&(v=p&&x.route.id?p[x.route.id]:void 0,b=x.route.errorElement||_1,m&&(g<0&&k===0?(z1("route-fallback"),N=!0,C=null):g===k&&(N=!0,C=x.route.hydrateFallbackElement||null)));let A=o.concat(f.slice(0,k+1)),L=()=>{let D;return v?D=b:N?D=C:x.route.Component?D=w.createElement(x.route.Component,null):x.route.element?D=x.route.element:D=y,w.createElement(A1,{match:x,routeContext:{outlet:y,matches:A,isDataRoute:s!=null},children:D})};return s&&(x.route.ErrorBoundary||x.route.errorElement||k===0)?w.createElement(j1,{location:s.location,revalidation:s.revalidation,component:b,error:v,children:L(),routeContext:{outlet:null,matches:A,isDataRoute:!0}}):L()},null)}var zh=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(zh||{});function L1(n){let o=w.useContext(R1);return o||mt(!1),o}function I1(n){let o=w.useContext(zi);return o||mt(!1),o}function D1(n){let o=I1(),s=o.matches[o.matches.length-1];return s.route.id||mt(!1),s.route.id}function F1(){var n;let o=w.useContext(Dh),s=L1(zh.UseRouteError),l=D1();return o!==void 0?o:(n=s.errors)==null?void 0:n[l]}const Yf={};function z1(n,o,s){Yf[n]||(Yf[n]=!0)}function U1(n,o){n?.v7_startTransition,n?.v7_relativeSplatPath}function Za(n){mt(!1)}function B1(n){let{basename:o="/",children:s=null,location:l,navigationType:u=Hn.Pop,navigator:d,static:f=!1,future:p}=n;Su()&&mt(!1);let m=o.replace(/^\/*/,"/"),g=w.useMemo(()=>({basename:m,navigator:d,static:f,future:ki({v7_relativeSplatPath:!1},p)}),[m,p,d,f]);typeof l=="string"&&(l=Di(l));let{pathname:y="/",search:x="",hash:k="",state:v=null,key:N="default"}=l,b=w.useMemo(()=>{let C=Mh(y,m);return C==null?null:{location:{pathname:C,search:x,hash:k,state:v,key:N},navigationType:u}},[m,y,x,k,v,N,u]);return b==null?null:w.createElement(Ih.Provider,{value:g},w.createElement(Fi.Provider,{children:s,value:b}))}function $1(n){let{children:o,location:s}=n;return T1(Ja(o),s)}new Promise(()=>{});function Ja(n,o){o===void 0&&(o=[]);let s=[];return w.Children.forEach(n,(l,u)=>{if(!w.isValidElement(l))return;let d=[...o,u];if(l.type===w.Fragment){s.push.apply(s,Ja(l.props.children,d));return}l.type!==Za&&mt(!1),!l.props.index||!l.props.children||mt(!1);let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Ja(l.props.children,d)),s.push(f)}),s}const V1="6";try{window.__reactRouterVersion=V1}catch{}const W1="startTransition",Gf=tu[W1];function H1(n){let{basename:o,children:s,future:l,window:u}=n,d=w.useRef();d.current==null&&(d.current=s1({window:u,v5Compat:!0}));let f=d.current,[p,m]=w.useState({action:f.action,location:f.location}),{v7_startTransition:g}=l||{},y=w.useCallback(x=>{g&&Gf?Gf(()=>m(x)):m(x)},[m,g]);return w.useLayoutEffect(()=>f.listen(y),[f,y]),w.useEffect(()=>U1(l),[l]),w.createElement(B1,{basename:o,children:s,location:p.location,navigationType:p.action,navigator:f,future:l})}var qf;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(qf||(qf={}));var Xf;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(Xf||(Xf={}));async function Wo(n,o={}){const s=localStorage.getItem("STUDIO_API_KEY")||"",l={...o.headers,"x-api-key":s,"Content-Type":"application/json"},u=await fetch(n,{...o,headers:l});return u.status===401&&console.error("Unauthorized: Invalid API Key"),u}function Q1({isOpen:n,onClose:o,selectedTable:s,onSelectTable:l}){const[u,d]=w.useState(!0),{data:f=[],isLoading:p}=o1({queryKey:["tables"],queryFn:async()=>{const m=await Wo("/api/tables");if(!m.ok)throw new Error("Failed to fetch tables");return m.json()}});return E.jsxs(E.Fragment,{children:[n&&E.jsx("div",{className:"fixed inset-0 bg-black/50 lg:hidden z-40",onClick:o}),E.jsxs("aside",{className:Le("fixed lg:static inset-y-0 left-0 z-50 w-64 border-r border-sidebar-border bg-sidebar-background transition-transform duration-300 ease-in-out overflow-hidden flex flex-col",!n&&"-translate-x-full lg:translate-x-0"),children:[E.jsx("div",{className:"p-6 border-b border-sidebar-border",children:E.jsx("div",{className:"flex items-center justify-between mb-4",children:E.jsx("h2",{className:"text-sm font-semibold text-sidebar-foreground",children:"Database"})})}),E.jsxs("nav",{className:"flex-1 overflow-auto p-4 space-y-1",children:[E.jsxs("button",{onClick:()=>{d(!u)},className:Le("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-sm font-medium transition-colors duration-200","bg-sidebar-primary/20 text-sidebar-primary"),children:[E.jsx(sy,{className:"w-4 h-4 flex-shrink-0"}),E.jsx("span",{className:"flex-1 text-left truncate",children:"MySQL Database"}),E.jsx(Kv,{className:Le("w-4 h-4 flex-shrink-0 transition-transform duration-200",u?"rotate-0":"-rotate-90")})]}),u&&E.jsxs("div",{className:"ml-2 mt-1 space-y-1",children:[p&&E.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading tables..."}),f.map(m=>E.jsxs("button",{onClick:()=>{l(m),o()},className:Le("w-full flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors duration-200 text-sidebar-foreground hover:bg-sidebar-accent",s===m?"bg-sidebar-primary/20 text-sidebar-primary":""),children:[E.jsx(jp,{className:"w-4 h-4 flex-shrink-0"}),E.jsx("span",{className:"flex-1 text-left truncate",children:m})]},m)),!p&&f.length===0&&E.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No tables found"})]})]}),E.jsx("div",{className:"p-4 border-t border-sidebar-border",children:E.jsx("button",{className:"w-full px-3 py-2 text-sm text-sidebar-foreground hover:bg-sidebar-accent rounded-md transition-colors",children:"Settings"})})]})]})}function K1({children:n,selectedTable:o,onSelectTable:s,view:l,onViewChange:u,dbName:d,schemaColumns:f,onSchemaColumnsChange:p}){const[m,g]=w.useState(!0),y=l==="data",x=typeof window<"u"&&new URLSearchParams(window.location.search).get("export")==="true";return E.jsxs("div",{className:Le("flex bg-background",x?"h-auto overflow-visible":"h-screen overflow-hidden"),children:[y&&E.jsx(Q1,{isOpen:m,onClose:()=>g(!1),selectedTable:o,onSelectTable:s}),E.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[E.jsxs("header",{className:" flex items-center justify-between px-6 py-4 border-b border-border bg-background",children:[E.jsxs("div",{className:"flex items-center gap-4",children:[y&&E.jsx("button",{onClick:()=>g(!m),className:"lg:hidden p-2 hover:bg-secondary rounded-md transition-colors",children:m?E.jsx(Ap,{className:"w-5 h-5"}):E.jsx(py,{className:"w-5 h-5"})}),E.jsxs("h1",{className:"text-xl font-semibold flex items-center gap-2",children:[E.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),d?E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-muted-foreground font-normal",children:"Database:"}),d]}):"Database Studio"]})]}),E.jsxs("div",{className:"print:hidden flex items-center gap-4",children:[l==="schema"&&E.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 bg-secondary rounded-md border border-border",children:[E.jsx(ry,{className:"w-4 h-4 text-muted-foreground"}),E.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4].map(k=>E.jsx("button",{onClick:()=>p(k),className:Le("w-7 h-7 flex items-center justify-center text-xs font-bold rounded transition-all",f===k?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-background hover:text-foreground"),children:k},k))})]}),E.jsxs("div",{className:" flex items-center rounded-md p-1 bg-secondary",children:[E.jsxs("button",{onClick:()=>u("data"),className:Le("flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",l==="data"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-secondary/70"),children:[E.jsx(gy,{className:"w-4 h-4"}),"Data View"]}),E.jsxs("button",{onClick:()=>u("schema"),className:Le("flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",l==="schema"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:bg-secondary/70"),children:[E.jsx(dy,{className:"w-4 h-4"}),"Schema View"]})]})]})]}),E.jsx("div",{className:"flex-1 overflow-auto",children:n})]})]})}const hi=10;function Y1({selectedTable:n}){const[o,s]=w.useState(""),[l,u]=w.useState(null),[d,f]=w.useState(1),[p,m]=w.useState(!1),[g,y]=w.useState(null);if(w.useEffect(()=>{s(""),f(1)},[n]),w.useEffect(()=>{if(!n)return;async function v(){try{m(!0),y(null);const N=await Wo(`/api/table/${n}?page=${d}&limit=${hi}&search=${o}`);if(!N.ok)throw new Error("Failed to fetch table");const b=await N.json();console.log("data+++",b),u(b)}catch(N){y(N.message)}finally{m(!1)}}v()},[n,d,o]),!n)return E.jsx(q1,{title:"No Table Selected",description:"Select a table from the sidebar to view its content and manage records."});if(p)return E.jsx(Zf,{message:"Loading table..."});if(g)return E.jsx(Zf,{message:g});if(!l)return null;const x=Math.max(1,Math.ceil(l.total/hi)),k=(d-1)*hi;return E.jsxs("div",{className:"flex flex-col h-full",children:[E.jsx("div",{className:"px-8 py-6 border-b border-border bg-background",children:E.jsxs("div",{className:"mb-4",children:[E.jsx("h2",{className:"text-2xl font-bold text-foreground",children:l.name}),E.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l.total," rows"]})]})}),E.jsx("div",{className:"flex-1 overflow-auto",children:E.jsxs("table",{className:"w-full text-sm",children:[E.jsx("thead",{className:"sticky top-0 bg-secondary border-b border-border",children:E.jsxs("tr",{children:[l.columns.map(v=>E.jsxs("th",{className:"px-6 py-3 text-left font-semibold whitespace-nowrap",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{children:v.name}),v.key==="PRI"&&E.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-mono bg-primary/10 text-primary",children:"PK"}),v.key==="UNI"&&E.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-mono bg-orange/10 text-orange",children:"U"})]}),E.jsx("p",{className:"text-xs text-muted-foreground font-normal mt-1",children:v.type})]},v.name)),E.jsx("th",{className:"px-6 py-3 w-12"})]})}),E.jsx("tbody",{className:"divide-y divide-border",children:l.rows.length===0?E.jsx("tr",{children:E.jsx("td",{colSpan:l.columns.length+1,className:"px-6 py-12 text-center text-muted-foreground",children:"No data found"})}):l.rows.map((v,N)=>E.jsx("tr",{className:"hover:bg-secondary/50 transition-colors",children:l.columns.map(b=>E.jsx("td",{className:"px-6 py-4 font-mono text-xs",children:E.jsx(G1,{value:v[b.name],type:b.type})},b.name))},v.id??N))})]})}),l.total>0&&E.jsxs("div",{className:"flex items-center justify-between px-8 py-4 border-t border-border bg-background",children:[E.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing"," ",E.jsx("span",{className:"font-semibold text-foreground",children:k+1})," ","to"," ",E.jsx("span",{className:"font-semibold text-foreground",children:Math.min(k+hi,l.total)})," ","of"," ",E.jsx("span",{className:"font-semibold text-foreground",children:l.total})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(mi,{disabled:d===1,onClick:()=>f(1),children:E.jsx(Jv,{className:"w-4 h-4"})}),E.jsx(mi,{disabled:d===1,onClick:()=>f(v=>v-1),children:E.jsx(Gv,{className:"w-4 h-4"})}),E.jsxs("span",{className:"text-sm text-muted-foreground",children:[d," of ",x]}),E.jsx(mi,{disabled:d===x,onClick:()=>f(v=>v+1),children:E.jsx(Xv,{className:"w-4 h-4"})}),E.jsx(mi,{disabled:d===x,onClick:()=>f(x),children:E.jsx(ty,{className:"w-4 h-4"})})]})]})]})}function G1({value:n,type:o}){return n==null?E.jsx("span",{className:"text-muted-foreground italic",children:"null"}):o==="BOOLEAN"?E.jsx("span",{className:Le("inline-flex px-2 py-1 rounded text-xs font-semibold",n?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400"),children:String(n)}):o==="UUID"||o==="ObjectId"?E.jsxs("span",{title:String(n),className:"truncate block max-w-xs text-muted-foreground",children:[String(n).slice(0,8),"..."]}):o==="TIMESTAMP"||o==="DATE"?E.jsx("span",{className:"text-muted-foreground",children:new Date(n).toLocaleString()}):E.jsx("span",{children:String(n)})}function mi({children:n,disabled:o,onClick:s}){return E.jsx("button",{onClick:s,disabled:o,className:"p-2 hover:bg-secondary rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:n})}function Zf({message:n}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("p",{className:"text-muted-foreground",children:n})})}function q1({title:n,description:o,showActions:s=!1}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsxs("div",{className:"text-center max-w-md",children:[E.jsx("div",{className:"w-20 h-20 rounded-lg bg-card border border-border mx-auto mb-6"}),E.jsx("h2",{className:"text-xl font-semibold mb-2",children:n}),E.jsx("p",{className:"text-muted-foreground mb-6",children:o}),s&&E.jsxs("div",{className:"flex gap-3 justify-center",children:[E.jsx("button",{className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 text-sm font-medium",children:"Create Table"}),E.jsx("button",{className:"px-4 py-2 border border-input hover:bg-secondary rounded-md text-sm font-medium",children:"Documentation"})]})]})})}const Jf=[{bg:"bg-blue-500/5",border:"border-blue-500/20",icon:"text-blue-500",headerBg:"bg-blue-500/10"},{bg:"bg-purple-500/5",border:"border-purple-500/20",icon:"text-purple-500",headerBg:"bg-purple-500/10"},{bg:"bg-emerald-500/5",border:"border-emerald-500/20",icon:"text-emerald-500",headerBg:"bg-emerald-500/10"},{bg:"bg-orange-500/5",border:"border-orange-500/20",icon:"text-orange-500",headerBg:"bg-orange-500/10"},{bg:"bg-pink-500/5",border:"border-pink-500/20",icon:"text-pink-500",headerBg:"bg-pink-500/10"},{bg:"bg-indigo-500/5",border:"border-indigo-500/20",icon:"text-indigo-500",headerBg:"bg-indigo-500/10"},{bg:"bg-rose-500/5",border:"border-rose-500/20",icon:"text-rose-500",headerBg:"bg-rose-500/10"},{bg:"bg-amber-500/5",border:"border-amber-500/20",icon:"text-amber-500",headerBg:"bg-amber-500/10"}];function ja({message:n}){return E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("p",{className:"text-muted-foreground",children:n})})}function X1({columns:n=3}){const[o,s]=w.useState([]),[l,u]=w.useState(!0),[d,f]=w.useState(null),p=w.useRef(null),m=new URLSearchParams(window.location.search).get("export")==="true";w.useEffect(()=>{async function k(){try{u(!0),f(null);const v=await Wo("/api/tables");if(!v.ok)throw new Error("Failed to fetch table names");const N=await v.json(),b=await Promise.all(N.map(async C=>{const A=await Wo(`/api/table/${C}/schema`);if(!A.ok)throw new Error(`Failed to fetch schema for ${C}`);return A.json()}));s(b)}catch(v){f(v.message)}finally{u(!1)}}k()},[]);const g=async()=>{window.open("/api/export-pdf","_blank")};if(l)return E.jsx(ja,{message:"Loading schemas..."});if(d)return E.jsx(ja,{message:d});if(o.length===0)return E.jsx(ja,{message:"No table schemas found. Create a table to get started."});const x={1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}[m?1:n]||"grid-cols-1 md:grid-cols-2 lg:grid-cols-3";return E.jsxs("div",{className:"flex flex-col h-full",children:[!m&&E.jsx("div",{className:"px-8 py-6 border-b border-border bg-background flex justify-end",children:E.jsxs("button",{onClick:g,className:"flex items-center gap-2 px-4 py-2 border border-input hover:bg-secondary rounded-md text-sm font-medium",children:[E.jsx(ly,{className:"w-4 h-4"}),"Export to PDF"]})}),E.jsx("div",{ref:p,id:"schema-grid",className:Le("p-8 grid gap-6",x),children:o.map((k,v)=>{const N=Jf[v%Jf.length];return E.jsxs("div",{className:Le("border rounded-xl shadow-sm overflow-hidden transition-all hover:shadow-md hover:-translate-y-1",N.bg,N.border),children:[E.jsxs("div",{className:Le("p-5 border-b flex items-center gap-3",N.headerBg,N.border),children:[E.jsx("div",{className:Le("p-2 rounded-lg bg-background/50 backdrop-blur-sm shadow-sm",N.icon),children:E.jsx(jp,{className:"w-5 h-5"})}),E.jsx("h3",{className:"text-lg font-bold text-foreground tracking-tight",children:k.name})]}),E.jsxs("div",{className:"p-5",children:[E.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[E.jsx("div",{className:"h-px flex-1 bg-border/50"}),E.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground/50",children:"Columns"}),E.jsx("div",{className:"h-px flex-1 bg-border/50"})]}),E.jsx("ul",{className:"space-y-3",children:k.columns.map(b=>E.jsxs("li",{className:"flex items-center justify-between group",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:Le("w-1.5 h-1.5 rounded-full",b.key==="PRI"?"bg-blue-500":b.key==="UNI"?"bg-yellow-500":"bg-muted-foreground/30")}),E.jsx("span",{className:"font-mono text-sm font-medium text-foreground group-hover:text-primary transition-colors whitespace-nowrap overflow-hidden text-ellipsis",title:b.name,children:b.name})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[b.isPrimary&&E.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-yellow-500/10 text-yellow-600 border border-yellow-500/20 uppercase",children:"PK"}),E.jsx("span",{className:"px-2 py-0.5 rounded-md text-[10px] font-mono bg-background/50 border border-border/50 text-muted-foreground uppercase",children:b.type})]})]},b.name))})]})]},k.name)})})]})}function Z1(){const[n,o]=w.useState(null),[s,l]=w.useState("data"),[u,d]=w.useState(""),[f,p]=w.useState(3);w.useEffect(()=>{const y=new URLSearchParams(window.location.search).get("view");(y==="schema"||y==="data")&&l(y);async function x(){try{const v=await(await Wo("/api/database")).json();v.success&&d(v.dbname)}catch(k){console.error("Error fetching db name:",k)}}x()},[]);const m=g=>{o(g)};return E.jsx(K1,{selectedTable:n,onSelectTable:m,view:s,onViewChange:l,dbName:u,schemaColumns:f,onSchemaColumnsChange:p,children:s==="data"?E.jsx(Y1,{selectedTable:n}):E.jsx(X1,{columns:f})})}const J1=()=>{const n=Fh();return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",n.pathname)},[n.pathname]),E.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:E.jsxs("div",{className:"text-center",children:[E.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),E.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),E.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},Uh=w.forwardRef(({className:n,type:o,...s},l)=>E.jsx("input",{type:o,className:Le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:l,...s}));Uh.displayName="Input";var eS=Symbol.for("react.lazy"),Pi=tu[" use ".trim().toString()];function tS(n){return typeof n=="object"&&n!==null&&"then"in n}function Bh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===eS&&"_payload"in n&&tS(n._payload)}function nS(n){const o=oS(n),s=w.forwardRef((l,u)=>{let{children:d,...f}=l;Bh(d)&&typeof Pi=="function"&&(d=Pi(d._payload));const p=w.Children.toArray(d),m=p.find(iS);if(m){const g=m.props.children,y=p.map(x=>x===m?w.Children.count(g)>1?w.Children.only(null):w.isValidElement(g)?g.props.children:null:x);return E.jsx(o,{...f,ref:u,children:w.isValidElement(g)?w.cloneElement(g,void 0,y):null})}return E.jsx(o,{...f,ref:u,children:d})});return s.displayName=`${n}.Slot`,s}var rS=nS("Slot");function oS(n){const o=w.forwardRef((s,l)=>{let{children:u,...d}=s;if(Bh(u)&&typeof Pi=="function"&&(u=Pi(u._payload)),w.isValidElement(u)){const f=aS(u),p=lS(d,u.props);return u.type!==w.Fragment&&(p.ref=l?nu(l,f):f),w.cloneElement(u,p)}return w.Children.count(u)>1?w.Children.only(null):null});return o.displayName=`${n}.SlotClone`,o}var sS=Symbol("radix.slottable");function iS(n){return w.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===sS}function lS(n,o){const s={...o};for(const l in o){const u=n[l],d=o[l];/^on[A-Z]/.test(l)?u&&d?s[l]=(...p)=>{const m=d(...p);return u(...p),m}:u&&(s[l]=u):l==="style"?s[l]={...u,...d}:l==="className"&&(s[l]=[u,d].filter(Boolean).join(" "))}return{...n,...s}}function aS(n){let o=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning;return s?n.ref:(o=Object.getOwnPropertyDescriptor(n,"ref")?.get,s=o&&"isReactWarning"in o&&o.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}const uS=Op("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$h=w.forwardRef(({className:n,variant:o,size:s,asChild:l=!1,...u},d)=>{const f=l?rS:"button";return E.jsx(f,{className:Le(uS({variant:o,size:s,className:n})),ref:d,...u})});$h.displayName="Button";const cS=new Wx,dS=()=>{const[n,o]=w.useState(!1),[s,l]=w.useState(""),[u,d]=w.useState(!1),[f,p]=w.useState(null),[m,g]=w.useState(!0);w.useEffect(()=>{fetch("/api/database",{credentials:"include"}).then(x=>{x.status===401?d(!1):d(!0)}).finally(()=>g(!1))},[]);const y=async()=>{const x=s.trim();if(!x){p("Please enter a license key");return}o(!0),p(null);try{const v=await(await fetch("/api/validate-license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({licenseKey:x})})).json();v.success?(d(!0),window.location.reload()):p(v.message||"Invalid License Key. Please check and try again.")}catch(k){console.error("Validation error:",k),p("Failed to validate license.")}finally{o(!1)}};return u?E.jsx(H1,{children:E.jsxs($1,{children:[E.jsx(Za,{path:"/",element:E.jsx(Z1,{})}),E.jsx(Za,{path:"*",element:E.jsx(J1,{})})]})}):E.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:E.jsxs("div",{className:"w-full max-w-md space-y-6 text-center",children:[E.jsx("div",{className:"inline-flex p-4 rounded-full bg-primary/10 text-primary mb-2",children:E.jsx(uy,{className:"w-8 h-8"})}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"API Key Required"}),E.jsx("p",{className:"text-muted-foreground text-sm",children:"Please enter your license key to access the Database Studio. Use FREE123"})]}),E.jsxs("div",{className:"space-y-4",children:[E.jsxs("div",{className:"flex gap-2",children:[E.jsx(Uh,{type:"password",placeholder:"Enter License Key",value:s,onChange:x=>{l(x.target.value),p(null)},onKeyDown:x=>x.key==="Enter"&&!n&&y(),disabled:n}),E.jsx($h,{onClick:y,disabled:n,children:n?"Validating...":"Connect"})]}),f&&E.jsx("p",{className:"text-destructive text-sm font-medium animate-in fade-in slide-in-from-top-1",children:f})]})]})})},fS=()=>E.jsx(Qx,{client:cS,children:E.jsxs(wx,{children:[E.jsx(Jy,{}),E.jsx(A0,{}),E.jsx(dS,{})]})});t0.createRoot(document.getElementById("root")).render(E.jsx(fS,{}));