function Uv(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cf={exports:{}},hl={},uf={exports:{}},K={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Bo=Symbol.for("react.element"),Vv=Symbol.for("react.portal"),Wv=Symbol.for("react.fragment"),Hv=Symbol.for("react.strict_mode"),Kv=Symbol.for("react.profiler"),Gv=Symbol.for("react.provider"),Yv=Symbol.for("react.context"),Qv=Symbol.for("react.forward_ref"),Xv=Symbol.for("react.suspense"),Zv=Symbol.for("react.memo"),qv=Symbol.for("react.lazy"),uu=Symbol.iterator;function Jv(e){return e===null||typeof e!="object"?null:(e=uu&&e[uu]||e["@@iterator"],typeof e=="function"?e:null)}var df={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ff=Object.assign,pf={};function Lr(e,t,n){this.props=e,this.context=t,this.refs=pf,this.updater=n||df}Lr.prototype.isReactComponent={};Lr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Lr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mf(){}mf.prototype=Lr.prototype;function Ba(e,t,n){this.props=e,this.context=t,this.refs=pf,this.updater=n||df}var Ua=Ba.prototype=new mf;Ua.constructor=Ba;ff(Ua,Lr.prototype);Ua.isPureReactComponent=!0;var du=Array.isArray,hf=Object.prototype.hasOwnProperty,Va={current:null},gf={key:!0,ref:!0,__self:!0,__source:!0};function vf(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)hf.call(t,r)&&!gf.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,P=j[W];if(0>>1;Wo(pe,O))eeo(B,pe)?(j[W]=B,j[ee]=O,W=ee):(j[W]=pe,j[H]=O,W=H);else if(eeo(B,O))j[W]=B,j[ee]=O,W=ee;else break e}}return A}function o(j,A){var O=j.sortIndex-A.sortIndex;return O!==0?O:j.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],u=[],p=1,d=null,h=3,x=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(j){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=j)r(u),A.sortIndex=A.expirationTime,t(c,A);else break;A=n(u)}}function C(j){if(v=!1,y(j),!w)if(n(c)!==null)w=!0,z(N);else{var A=n(u);A!==null&&V(C,A.startTime-j)}}function N(j,A){w=!1,v&&(v=!1,g(_),_=-1),x=!0;var O=h;try{for(y(A),d=n(c);d!==null&&(!(d.expirationTime>A)||j&&!L());){var W=d.callback;if(typeof W=="function"){d.callback=null,h=d.priorityLevel;var P=W(d.expirationTime<=A);A=e.unstable_now(),typeof P=="function"?d.callback=P:d===n(c)&&r(c),y(A)}else r(c);d=n(c)}if(d!==null)var F=!0;else{var H=n(u);H!==null&&V(C,H.startTime-A),F=!1}return F}finally{d=null,h=O,x=!1}}var E=!1,k=null,_=-1,D=5,T=-1;function L(){return!(e.unstable_now()-Tj||125W?(j.sortIndex=O,t(u,j),n(c)===null&&j===n(u)&&(v?(g(_),_=-1):v=!0,V(C,O-W))):(j.sortIndex=P,t(c,j),w||x||(w=!0,z(N))),j},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(j){var A=h;return function(){var O=h;h=A;try{return j.apply(this,arguments)}finally{h=O}}}})(Cf);Sf.exports=Cf;var uy=Sf.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var dy=f,tt=uy;function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ps=Object.prototype.hasOwnProperty,fy=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,pu={},mu={};function py(e){return Ps.call(mu,e)?!0:Ps.call(pu,e)?!1:fy.test(e)?mu[e]=!0:(pu[e]=!0,!1)}function my(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hy(e,t,n,r){if(t===null||typeof t>"u"||my(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ue(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new Ue(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Me[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Me[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Me[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Me[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ka=/[\-:]([a-z])/g;function Ga(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ka,Ga);Me[t]=new Ue(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ka,Ga);Me[t]=new Ue(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ka,Ga);Me[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Me.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Me[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ya(e,t,n,r){var o=Me.hasOwnProperty(t)?Me[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var c=` `+o[l].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=l&&0<=s);break}}}finally{Kl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?oo(e):""}function gy(e){switch(e.tag){case 5:return oo(e.type);case 16:return oo("Lazy");case 13:return oo("Suspense");case 19:return oo("SuspenseList");case 0:case 2:case 15:return e=Gl(e.type,!1),e;case 11:return e=Gl(e.type.render,!1),e;case 1:return e=Gl(e.type,!0),e;default:return""}}function Ms(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case or:return"Fragment";case rr:return"Portal";case _s:return"Profiler";case Qa:return"StrictMode";case bs:return"Suspense";case Rs:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jf:return(e.displayName||"Context")+".Consumer";case kf:return(e._context.displayName||"Context")+".Provider";case Xa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Za:return t=e.displayName||null,t!==null?t:Ms(e.type)||"Memo";case Jt:t=e._payload,e=e._init;try{return Ms(e(t))}catch{}}return null}function vy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ms(t);case 8:return t===Qa?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yy(e){var t=Pf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jo(e){e._valueTracker||(e._valueTracker=yy(e))}function _f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Li(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function As(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function bf(e,t){t=t.checked,t!=null&&Ya(e,"checked",t,!1)}function Ts(e,t){bf(e,t);var n=gn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Os(e,t.type,n):t.hasOwnProperty("defaultValue")&&Os(e,t.type,gn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Os(e,t,n){(t!=="number"||Li(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var io=Array.isArray;function hr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ei.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var co={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xy=["Webkit","ms","Moz","O"];Object.keys(co).forEach(function(e){xy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),co[t]=co[e]})});function Tf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||co.hasOwnProperty(e)&&co[e]?(""+t).trim():t+"px"}function Of(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Tf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var wy=ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ds(e,t){if(t){if(wy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function zs(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $s=null;function qa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fs=null,gr=null,vr=null;function wu(e){if(e=Wo(e)){if(typeof Fs!="function")throw Error(R(280));var t=e.stateNode;t&&(t=wl(t),Fs(e.stateNode,e.type,t))}}function If(e){gr?vr?vr.push(e):vr=[e]:gr=e}function Lf(){if(gr){var e=gr,t=vr;if(vr=gr=null,wu(e),t)for(e=0;e>>=0,e===0?32:31-(My(e)/Ay|0)|0}var ti=64,ni=4194304;function lo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=lo(s):(i&=l,i!==0&&(r=lo(i)))}else l=n&~o,l!==0?r=lo(l):i!==0&&(r=lo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Uo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Ly(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=fo),bu=String.fromCharCode(32),Ru=!1;function np(e,t){switch(e){case"keyup":return ux.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ir=!1;function fx(e,t){switch(e){case"compositionend":return rp(t);case"keypress":return t.which!==32?null:(Ru=!0,bu);case"textInput":return e=t.data,e===bu&&Ru?null:e;default:return null}}function px(e,t){if(ir)return e==="compositionend"||!lc&&np(e,t)?(e=ep(),ki=rc=rn=null,ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ou(n)}}function sp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ap(){for(var e=window,t=Li();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Li(e.document)}return t}function sc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cx(e){var t=ap(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sp(n.ownerDocument.documentElement,n)){if(r!==null&&sc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Iu(n,i);var l=Iu(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,lr=null,Ks=null,mo=null,Gs=!1;function Lu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gs||lr==null||lr!==Li(r)||(r=lr,"selectionStart"in r&&sc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mo&&Eo(mo,r)||(mo=r,r=Vi(Ks,"onSelect"),0cr||(e.current=Js[cr],Js[cr]=null,cr--)}function le(e,t){cr++,Js[cr]=e.current,e.current=t}var vn={},De=Sn(vn),Ke=Sn(!1),Dn=vn;function Er(e,t){var n=e.type.contextTypes;if(!n)return vn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ge(e){return e=e.childContextTypes,e!=null}function Hi(){de(Ke),de(De)}function Vu(e,t,n){if(De.current!==vn)throw Error(R(168));le(De,t),le(Ke,n)}function vp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(R(108,vy(e)||"Unknown",o));return ge({},n,r)}function Ki(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vn,Dn=De.current,le(De,e),le(Ke,Ke.current),!0}function Wu(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=vp(e,t,Dn),r.__reactInternalMemoizedMergedChildContext=e,de(Ke),de(De),le(De,e)):de(Ke),le(Ke,n)}var Dt=null,Sl=!1,ss=!1;function yp(e){Dt===null?Dt=[e]:Dt.push(e)}function Ox(e){Sl=!0,yp(e)}function Cn(){if(!ss&&Dt!==null){ss=!0;var e=0,t=te;try{var n=Dt;for(te=1;e>=l,o-=l,zt=1<<32-vt(t)+o|n<_?(D=k,k=null):D=k.sibling;var T=h(g,k,y[_],C);if(T===null){k===null&&(k=D);break}e&&k&&T.alternate===null&&t(g,k),m=i(T,m,_),E===null?N=T:E.sibling=T,E=T,k=D}if(_===y.length)return n(g,k),fe&&Pn(g,_),N;if(k===null){for(;__?(D=k,k=null):D=k.sibling;var L=h(g,k,T.value,C);if(L===null){k===null&&(k=D);break}e&&k&&L.alternate===null&&t(g,k),m=i(L,m,_),E===null?N=L:E.sibling=L,E=L,k=D}if(T.done)return n(g,k),fe&&Pn(g,_),N;if(k===null){for(;!T.done;_++,T=y.next())T=d(g,T.value,C),T!==null&&(m=i(T,m,_),E===null?N=T:E.sibling=T,E=T);return fe&&Pn(g,_),N}for(k=r(g,k);!T.done;_++,T=y.next())T=x(k,g,_,T.value,C),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?_:T.key),m=i(T,m,_),E===null?N=T:E.sibling=T,E=T);return e&&k.forEach(function(M){return t(g,M)}),fe&&Pn(g,_),N}function S(g,m,y,C){if(typeof y=="object"&&y!==null&&y.type===or&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case qo:e:{for(var N=y.key,E=m;E!==null;){if(E.key===N){if(N=y.type,N===or){if(E.tag===7){n(g,E.sibling),m=o(E,y.props.children),m.return=g,g=m;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Jt&&Gu(N)===E.type){n(g,E.sibling),m=o(E,y.props),m.ref=Jr(g,E,y),m.return=g,g=m;break e}n(g,E);break}else t(g,E);E=E.sibling}y.type===or?(m=In(y.props.children,g.mode,C,y.key),m.return=g,g=m):(C=Ai(y.type,y.key,y.props,null,g.mode,C),C.ref=Jr(g,m,y),C.return=g,g=C)}return l(g);case rr:e:{for(E=y.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(g,m.sibling),m=o(m,y.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=hs(y,g.mode,C),m.return=g,g=m}return l(g);case Jt:return E=y._init,S(g,m,E(y._payload),C)}if(io(y))return w(g,m,y,C);if(Yr(y))return v(g,m,y,C);ci(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,y),m.return=g,g=m):(n(g,m),m=ms(y,g.mode,C),m.return=g,g=m),l(g)):n(g,m)}return S}var _r=Cp(!0),Np=Cp(!1),Qi=Sn(null),Xi=null,fr=null,dc=null;function fc(){dc=fr=Xi=null}function pc(e){var t=Qi.current;de(Qi),e._currentValue=t}function na(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xr(e,t){Xi=e,dc=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(He=!0),e.firstContext=null)}function at(e){var t=e._currentValue;if(dc!==e)if(e={context:e,memoizedValue:t,next:null},fr===null){if(Xi===null)throw Error(R(308));fr=e,Xi.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return t}var Mn=null;function mc(e){Mn===null?Mn=[e]:Mn.push(e)}function kp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,mc(t)):(n.next=o.next,o.next=n),t.interleaved=n,Wt(e,r)}function Wt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var en=!1;function hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jp(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 Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Wt(e,n)}return o=r.interleaved,o===null?(t.next=t,mc(r)):(t.next=o.next,o.next=t),r.interleaved=t,Wt(e,n)}function Ei(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ec(e,n)}}function Yu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Zi(e,t,n,r){var o=e.updateQueue;en=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var c=s,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==l&&(s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=c))}if(i!==null){var d=o.baseState;l=0,p=u=c=null,s=i;do{var h=s.lane,x=s.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:x,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,v=s;switch(h=t,x=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(x,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,h=typeof w=="function"?w.call(x,d,h):w,h==null)break e;d=ge({},d,h);break e;case 2:en=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[s]:h.push(s))}else x={eventTime:x,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(u=p=x,c=d):p=p.next=x,l|=h;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;h=s,s=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(1);if(p===null&&(c=d),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Fn|=l,e.lanes=l,e.memoizedState=d}}function Qu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=cs.transition;cs.transition={};try{e(!1),t()}finally{te=n,cs.transition=r}}function Up(){return ct().memoizedState}function zx(e,t,n){var r=pn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vp(e))Wp(t,n);else if(n=kp(e,t,n,r),n!==null){var o=Fe();yt(n,e,r,o),Hp(n,t,r)}}function $x(e,t,n){var r=pn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vp(e))Wp(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,xt(s,l)){var c=t.interleaved;c===null?(o.next=o,mc(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=kp(e,t,o,r),n!==null&&(o=Fe(),yt(n,e,r,o),Hp(n,t,r))}}function Vp(e){var t=e.alternate;return e===he||t!==null&&t===he}function Wp(e,t){ho=Ji=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ec(e,n)}}var el={readContext:at,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},Fx={readContext:at,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:Zu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_i(4194308,4,Dp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _i(4194308,4,e,t)},useInsertionEffect:function(e,t){return _i(4,2,e,t)},useMemo:function(e,t){var n=Pt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=zx.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:Xu,useDebugValue:Nc,useDeferredValue:function(e){return Pt().memoizedState=e},useTransition:function(){var e=Xu(!1),t=e[0];return e=Dx.bind(null,e[1]),Pt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,o=Pt();if(fe){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),_e===null)throw Error(R(349));$n&30||bp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Zu(Mp.bind(null,r,i,e),[e]),r.flags|=2048,Oo(9,Rp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Pt(),t=_e.identifierPrefix;if(fe){var n=$t,r=zt;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ao++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[_t]=t,e[bo]=r,tm(e,t,!1,!1),t.stateNode=e;e:{switch(l=zs(n,r),n){case"dialog":ue("cancel",e),ue("close",e),o=r;break;case"iframe":case"object":case"embed":ue("load",e),o=r;break;case"video":case"audio":for(o=0;oMr&&(t.flags|=128,r=!0,eo(i,!1),t.lanes=4194304)}else{if(!r)if(e=qi(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),eo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!fe)return Ie(t),null}else 2*ye()-i.renderingStartTime>Mr&&n!==1073741824&&(t.flags|=128,r=!0,eo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ye(),t.sibling=null,n=me.current,le(me,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return bc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xe&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function Yx(e,t){switch(cc(t),t.tag){case 1:return Ge(t.type)&&Hi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return br(),de(Ke),de(De),yc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vc(t),null;case 13:if(de(me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));Pr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(me),null;case 4:return br(),null;case 10:return pc(t.type._context),null;case 22:case 23:return bc(),null;case 24:return null;default:return null}}var di=!1,Le=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,I=null;function pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ve(e,t,r)}else n.current=null}function da(e,t,n){try{n()}catch(r){ve(e,t,r)}}var ad=!1;function Xx(e,t){if(Ys=Bi,e=ap(),sc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,c=-1,u=0,p=0,d=e,h=null;t:for(;;){for(var x;d!==n||o!==0&&d.nodeType!==3||(s=l+o),d!==i||r!==0&&d.nodeType!==3||(c=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(x=d.firstChild)!==null;)h=d,d=x;for(;;){if(d===e)break t;if(h===n&&++u===o&&(s=l),h===i&&++p===r&&(c=l),(x=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=x}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qs={focusedElem:e,selectionRange:n},Bi=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,S=w.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:pt(t.type,v),S);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(C){ve(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return w=ad,ad=!1,w}function go(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&da(t,n,i)}o=o.next}while(o!==r)}}function kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function om(e){var t=e.alternate;t!==null&&(e.alternate=null,om(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_t],delete t[bo],delete t[qs],delete t[Ax],delete t[Tx])),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 im(e){return e.tag===5||e.tag===3||e.tag===4}function cd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||im(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 pa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wi));else if(r!==4&&(e=e.child,e!==null))for(pa(e,t,n),e=e.sibling;e!==null;)pa(e,t,n),e=e.sibling}function ma(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ma(e,t,n),e=e.sibling;e!==null;)ma(e,t,n),e=e.sibling}var be=null,ht=!1;function Xt(e,t,n){for(n=n.child;n!==null;)lm(e,t,n),n=n.sibling}function lm(e,t,n){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(gl,n)}catch{}switch(n.tag){case 5:Le||pr(n,t);case 6:var r=be,o=ht;be=null,Xt(e,t,n),be=r,ht=o,be!==null&&(ht?(e=be,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):be.removeChild(n.stateNode));break;case 18:be!==null&&(ht?(e=be,n=n.stateNode,e.nodeType===8?ls(e.parentNode,n):e.nodeType===1&&ls(e,n),ko(e)):ls(be,n.stateNode));break;case 4:r=be,o=ht,be=n.stateNode.containerInfo,ht=!0,Xt(e,t,n),be=r,ht=o;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&da(n,t,l),o=o.next}while(o!==r)}Xt(e,t,n);break;case 1:if(!Le&&(pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ve(n,t,s)}Xt(e,t,n);break;case 21:Xt(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,Xt(e,t,n),Le=r):Xt(e,t,n);break;default:Xt(e,t,n)}}function ud(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Qx),t.forEach(function(r){var o=i0.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qx(r/1960))-r,10e?16:e,on===null)var r=!1;else{if(e=on,on=null,rl=0,q&6)throw Error(R(331));var o=q;for(q|=4,I=e.current;I!==null;){var i=I,l=i.child;if(I.flags&16){var s=i.deletions;if(s!==null){for(var c=0;cye()-Pc?On(e,0):Ec|=n),Ye(e,t)}function mm(e,t){t===0&&(e.mode&1?(t=ni,ni<<=1,!(ni&130023424)&&(ni=4194304)):t=1);var n=Fe();e=Wt(e,t),e!==null&&(Uo(e,t,n),Ye(e,n))}function o0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mm(e,n)}function i0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),mm(e,n)}var hm;hm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)He=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return He=!1,Kx(e,t,n);He=!!(e.flags&131072)}else He=!1,fe&&t.flags&1048576&&xp(t,Yi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bi(e,t),e=t.pendingProps;var o=Er(t,De.current);xr(t,n),o=wc(null,t,r,e,o,n);var i=Sc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ge(r)?(i=!0,Ki(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,hc(t),o.updater=Nl,t.stateNode=o,o._reactInternals=t,oa(t,r,e,n),t=sa(null,t,r,!0,i,n)):(t.tag=0,fe&&i&&ac(t),ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(bi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=s0(r),e=pt(r,e),o){case 0:t=la(null,t,r,e,n);break e;case 1:t=id(null,t,r,e,n);break e;case 11:t=rd(null,t,r,e,n);break e;case 14:t=od(null,t,r,pt(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:pt(r,o),la(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:pt(r,o),id(e,t,r,o,n);case 3:e:{if(qp(t),e===null)throw Error(R(387));r=t.pendingProps,i=t.memoizedState,o=i.element,jp(e,t),Zi(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Rr(Error(R(423)),t),t=ld(e,t,r,n,o);break e}else if(r!==o){o=Rr(Error(R(424)),t),t=ld(e,t,r,n,o);break e}else for(qe=un(t.stateNode.containerInfo.firstChild),Je=t,fe=!0,gt=null,n=Np(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pr(),r===o){t=Ht(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return Ep(t),e===null&&ta(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Xs(r,o)?l=null:i!==null&&Xs(r,i)&&(t.flags|=32),Zp(e,t),ze(e,t,l,n),t.child;case 6:return e===null&&ta(t),null;case 13:return Jp(e,t,n);case 4:return gc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_r(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:pt(r,o),rd(e,t,r,o,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,le(Qi,r._currentValue),r._currentValue=l,i!==null)if(xt(i.value,l)){if(i.children===o.children&&!Ke.current){t=Ht(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var c=s.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Ft(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),na(i.return,n,t),s.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(R(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),na(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,xr(t,n),o=at(o),r=r(o),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,o=pt(r,t.pendingProps),o=pt(r.type,o),od(e,t,r,o,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:pt(r,o),bi(e,t),t.tag=1,Ge(r)?(e=!0,Ki(t)):e=!1,xr(t,n),Kp(t,r,o),oa(t,r,o,n),sa(null,t,r,!0,e,n);case 19:return em(e,t,n);case 22:return Xp(e,t,n)}throw Error(R(156,t.tag))};function gm(e,t){return Vf(e,t)}function l0(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lt(e,t,n,r){return new l0(e,t,n,r)}function Mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s0(e){if(typeof e=="function")return Mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xa)return 11;if(e===Za)return 14}return 2}function mn(e,t){var n=e.alternate;return n===null?(n=lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ai(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Mc(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case or:return In(n.children,o,i,t);case Qa:l=8,o|=8;break;case _s:return e=lt(12,n,t,o|2),e.elementType=_s,e.lanes=i,e;case bs:return e=lt(13,n,t,o),e.elementType=bs,e.lanes=i,e;case Rs:return e=lt(19,n,t,o),e.elementType=Rs,e.lanes=i,e;case Ef:return El(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kf:l=10;break e;case jf:l=9;break e;case Xa:l=11;break e;case Za:l=14;break e;case Jt:l=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=lt(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function In(e,t,n,r){return e=lt(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=lt(22,e,r,t),e.elementType=Ef,e.lanes=n,e.stateNode={isHidden:!1},e}function ms(e,t,n){return e=lt(6,e,null,t),e.lanes=n,e}function hs(e,t,n){return t=lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function a0(e,t,n,r,o){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=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ac(e,t,n,r,o,i,l,s,c){return e=new a0(e,t,n,s,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=lt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hc(i),e}function c0(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wm)}catch(e){console.error(e)}}wm(),wf.exports=nt;var $r=wf.exports;const m0=af($r);var yd=$r;Es.createRoot=yd.createRoot,Es.hydrateRoot=yd.hydrateRoot;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Sm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function g0(){return Math.random().toString(36).substr(2,8)}function wd(e,t){return{usr:e.state,key:e.key,idx:t}}function xa(e,t,n,r){return n===void 0&&(n=null),Lo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fr(t):t,{state:n,key:t&&t.key||r||g0()})}function ll(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Fr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function v0(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,s=ln.Pop,c=null,u=p();u==null&&(u=0,l.replaceState(Lo({},l.state,{idx:u}),""));function p(){return(l.state||{idx:null}).idx}function d(){s=ln.Pop;let S=p(),g=S==null?null:S-u;u=S,c&&c({action:s,location:v.location,delta:g})}function h(S,g){s=ln.Push;let m=xa(v.location,S,g);n&&n(m,S),u=p()+1;let y=wd(m,u),C=v.createHref(m);try{l.pushState(y,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(C)}i&&c&&c({action:s,location:v.location,delta:1})}function x(S,g){s=ln.Replace;let m=xa(v.location,S,g);n&&n(m,S),u=p();let y=wd(m,u),C=v.createHref(m);l.replaceState(y,"",C),i&&c&&c({action:s,location:v.location,delta:0})}function w(S){let g=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof S=="string"?S:ll(S);return m=m.replace(/ $/,"%20"),Se(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let v={get action(){return s},get location(){return e(o,l)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(xd,d),c=S,()=>{o.removeEventListener(xd,d),c=null}},createHref(S){return t(o,S)},createURL:w,encodeLocation(S){let g=w(S);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:x,go(S){return l.go(S)}};return v}var Sd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sd||(Sd={}));function y0(e,t,n){return n===void 0&&(n="/"),x0(e,t,n,!1)}function x0(e,t,n,r){let o=typeof t=="string"?Fr(t):t,i=Lc(o.pathname||"/",n);if(i==null)return null;let l=Cm(e);w0(l);let s=null;for(let c=0;s==null&&c{let c={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};c.relativePath.startsWith("/")&&(Se(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=hn([r,c.relativePath]),p=n.concat(c);i.children&&i.children.length>0&&(Se(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Cm(i.children,t,p,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:P0(u,i.index),routesMeta:p})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let c of Nm(i.path))o(i,l,c)}),t}function Nm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=Nm(r.join("/")),s=[];return s.push(...l.map(c=>c===""?i:[i,c].join("/"))),o&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function w0(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_0(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const S0=/^:[\w-]+$/,C0=3,N0=2,k0=1,j0=10,E0=-2,Cd=e=>e==="*";function P0(e,t){let n=e.split("/"),r=n.length;return n.some(Cd)&&(r+=E0),t&&(r+=N0),n.filter(o=>!Cd(o)).reduce((o,i)=>o+(S0.test(i)?C0:i===""?k0:j0),r)}function _0(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function b0(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",l=[];for(let s=0;s{let{paramName:h,isOptional:x}=p;if(h==="*"){let v=s[d]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=s[d];return x&&!w?u[h]=void 0:u[h]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function R0(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Sm(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,c)=>(r.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function M0(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Lc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function A0(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Fr(e):e;return{pathname:n?n.startsWith("/")?n:T0(n,t):t,search:L0(r),hash:D0(o)}}function T0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function gs(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function O0(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function km(e,t){let n=O0(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function jm(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Fr(e):(o=Lo({},e),Se(!o.pathname||!o.pathname.includes("?"),gs("?","pathname","search",o)),Se(!o.pathname||!o.pathname.includes("#"),gs("#","pathname","hash",o)),Se(!o.search||!o.search.includes("#"),gs("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}s=d>=0?t[d]:"/"}let c=A0(o,s),u=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const hn=e=>e.join("/").replace(/\/\/+/g,"/"),I0=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),L0=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,D0=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function z0(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Em=["post","put","patch","delete"];new Set(Em);const $0=["get",...Em];new Set($0);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),f.useCallback(function(u,p){if(p===void 0&&(p={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=jm(u,JSON.parse(l),i,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:hn([t,d.pathname])),(p.replace?r.replace:r.push)(d,p.state,p)},[t,r,l,i,e])}const W0=f.createContext(null);function H0(e){let t=f.useContext(Nn).outlet;return t&&f.createElement(W0.Provider,{value:e},t)}function bm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(Xn),{matches:o}=f.useContext(Nn),{pathname:i}=Go(),l=JSON.stringify(km(o,r.v7_relativeSplatPath));return f.useMemo(()=>jm(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function K0(e,t){return G0(e,t)}function G0(e,t,n,r){Ko()||Se(!1);let{navigator:o}=f.useContext(Xn),{matches:i}=f.useContext(Nn),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let u=Go(),p;if(t){var d;let S=typeof t=="string"?Fr(t):t;c==="/"||(d=S.pathname)!=null&&d.startsWith(c)||Se(!1),p=S}else p=u;let h=p.pathname||"/",x=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");x="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=y0(e,{pathname:x}),v=q0(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:hn([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:hn([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?f.createElement(Ml.Provider,{value:{location:Do({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:ln.Pop}},v):v}function Y0(){let e=nw(),t=z0(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:o},n):null,i)}const Q0=f.createElement(Y0,null);class X0 extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(Nn.Provider,{value:this.props.routeContext},f.createElement(Pm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Z0(e){let{routeContext:t,match:n,children:r}=e,o=f.useContext(Dc);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Nn.Provider,{value:t},r)}function q0(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(o=n)==null?void 0:o.errors;if(s!=null){let p=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);p>=0||Se(!1),l=l.slice(0,Math.min(l.length,p+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((p,d,h)=>{let x,w=!1,v=null,S=null;n&&(x=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||Q0,c&&(u<0&&h===0?(ow("route-fallback",!1),w=!0,S=null):u===h&&(w=!0,S=d.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,h+1)),m=()=>{let y;return x?y=v:w?y=S:d.route.Component?y=f.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=p,f.createElement(Z0,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:y})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?f.createElement(X0,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Rm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Rm||{}),sl=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(sl||{});function J0(e){let t=f.useContext(Dc);return t||Se(!1),t}function ew(e){let t=f.useContext(F0);return t||Se(!1),t}function tw(e){let t=f.useContext(Nn);return t||Se(!1),t}function Mm(e){let t=tw(),n=t.matches[t.matches.length-1];return n.route.id||Se(!1),n.route.id}function nw(){var e;let t=f.useContext(Pm),n=ew(sl.UseRouteError),r=Mm(sl.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function rw(){let{router:e}=J0(Rm.UseNavigateStable),t=Mm(sl.UseNavigateStable),n=f.useRef(!1);return _m(()=>{n.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Do({fromRouteId:t},i)))},[e,t])}const kd={};function ow(e,t,n){!t&&!kd[e]&&(kd[e]=!0)}function iw(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function lw(e){return H0(e.context)}function nr(e){Se(!1)}function sw(e){let{basename:t="/",children:n=null,location:r,navigationType:o=ln.Pop,navigator:i,static:l=!1,future:s}=e;Ko()&&Se(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:i,static:l,future:Do({v7_relativeSplatPath:!1},s)}),[c,s,i,l]);typeof r=="string"&&(r=Fr(r));let{pathname:p="/",search:d="",hash:h="",state:x=null,key:w="default"}=r,v=f.useMemo(()=>{let S=Lc(p,c);return S==null?null:{location:{pathname:S,search:d,hash:h,state:x,key:w},navigationType:o}},[c,p,d,h,x,w,o]);return v==null?null:f.createElement(Xn.Provider,{value:u},f.createElement(Ml.Provider,{children:n,value:v}))}function aw(e){let{children:t,location:n}=e;return K0(wa(t),n)}new Promise(()=>{});function wa(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,o)=>{if(!f.isValidElement(r))return;let i=[...t,o];if(r.type===f.Fragment){n.push.apply(n,wa(r.props.children,i));return}r.type!==nr&&Se(!1),!r.props.index||!r.props.children||Se(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=wa(r.props.children,i)),n.push(l)}),n}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function uw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dw(e,t){return e.button===0&&(!t||t==="_self")&&!uw(e)}const fw=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],pw="6";try{window.__reactRouterVersion=pw}catch{}const mw="startTransition",jd=Ha[mw];function hw(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=h0({window:o,v5Compat:!0}));let l=i.current,[s,c]=f.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},p=f.useCallback(d=>{u&&jd?jd(()=>c(d)):c(d)},[c,u]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.useEffect(()=>iw(r),[r]),f.createElement(sw,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const gw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bn=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,h=cw(t,fw),{basename:x}=f.useContext(Xn),w,v=!1;if(typeof u=="string"&&vw.test(u)&&(w=u,gw))try{let y=new URL(window.location.href),C=u.startsWith("//")?new URL(y.protocol+u):new URL(u),N=Lc(C.pathname,x);C.origin===y.origin&&N!=null?u=N+C.search+C.hash:v=!0}catch{}let S=B0(u,{relative:o}),g=yw(u,{replace:l,state:s,target:c,preventScrollReset:p,relative:o,viewTransition:d});function m(y){r&&r(y),y.defaultPrevented||g(y)}return f.createElement("a",Sa({},h,{href:w||S,onClick:v||i?r:m,ref:n,target:c}))});var Ed;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ed||(Ed={}));var Pd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pd||(Pd={}));function yw(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s}=t===void 0?{}:t,c=U0(),u=Go(),p=bm(e,{relative:l});return f.useCallback(d=>{if(dw(d,n)){d.preventDefault();let h=r!==void 0?r:ll(u)===ll(p);c(e,{replace:h,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[u,c,p,r,o,n,e,i,l,s])}function Am(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return o(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):o(l,s)}}}var Lm="!";function Ew(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var s=[],c=0,u=0,p,d=0;du?p-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:S}}}function Pw(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function _w(e){return{cache:jw(e.cacheSize),splitModifiers:Ew(e),...ww(e)}}var bw=/\s+/;function Rw(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(bw).map(function(l){var s=n(l),c=s.modifiers,u=s.hasImportantModifier,p=s.baseClassName,d=s.maybePostfixModifierPosition,h=r(d?p.substring(0,d):p),x=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:l};if(h=r(p),!h)return{isTailwindClass:!1,originalClassName:l};x=!1}var w=Pw(c).join(":"),v=u?w+Lm:w;return{isTailwindClass:!0,modifierId:v,classGroupId:h,originalClassName:l,hasPostfixModifier:x}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,c=l.classGroupId,u=l.hasPostfixModifier,p=s+c;return i.has(p)?!1:(i.add(p),o(c,u).forEach(function(d){return i.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function Mw(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yw=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Md=e=>{const t=Yw(e);return t.charAt(0).toUpperCase()+t.slice(1)},$m=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Qw=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Xw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zw=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...s},c)=>f.createElement("svg",{ref:c,...Xw,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$m("lucide",o),...!i&&!Qw(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,p])=>f.createElement(u,p)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(Zw,{ref:i,iconNode:t,className:$m(`lucide-${Gw(Md(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Md(e),n};/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Jw=Z("arrow-right",qw);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e1=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ar=Z("book-open",e1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t1=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Fm=Z("bot",t1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n1=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Bt=Z("brain",n1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o1=Z("check",r1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$c=Z("chevron-down",i1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],s1=Z("chevron-up",l1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a1=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],c1=Z("circle-check-big",a1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const u1=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Sr=Z("cloud",u1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const d1=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],f1=Z("code",d1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Bm=Z("cpu",p1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const m1=[["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"}]],Um=Z("download",m1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h1=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Vm=Z("hard-drive",h1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],v1=Z("history",g1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],x1=Z("house",y1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Wm=Z("info",w1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Hm=Z("loader-circle",S1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Un=Z("message-square",C1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],k1=Z("palette",N1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],E1=Z("panel-left-close",j1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],_1=Z("panel-left-open",P1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],R1=Z("plus",b1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],A1=Z("rotate-ccw",M1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],O1=Z("send",T1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],L1=Z("server",I1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Fc=Z("settings",D1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z1=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],$1=Z("share",z1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ka=Z("shield",F1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],U1=Z("square",B1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Km=Z("trash-2",V1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],H1=Z("triangle-alert",W1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],G1=Z("upload",K1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Q1=Z("user",Y1);/** * @license lucide-react v0.542.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const X1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],zo=Z("zap",X1),Z1=[{name:"Home",href:"/",icon:x1,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:Un,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:Ar,description:"Browse and manage models"},{name:"Assistants",href:"/assistants",icon:Fm,description:"Custom AI assistants",badge:"Preview"}],q1=[{name:"Completions",href:"/completions",icon:zo,description:"Text completion endpoint"},{name:"Fine-tuning",href:"/fine-tuning",icon:Bt,description:"Train custom models"},{name:"Settings",href:"/settings",icon:Fc,description:"Application settings"}];function J1(){const e=Go();return a.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:a.jsx(Bt,{className:"h-5 w-5 text-primary-foreground"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),a.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),a.jsx("nav",{className:"space-y-1",children:Z1.map(t=>{const n=e.pathname===t.href;return a.jsxs(bn,{to:t.href,className:X("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx(t.icon,{className:"h-4 w-4"}),a.jsx("div",{className:"flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[t.name,t.badge&&a.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-blue-100 text-blue-700 rounded-full",children:t.badge})]})})]},t.name)})})]}),a.jsxs("div",{className:"px-3",children:[a.jsx("h2",{className:"mb-2 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Advanced"}),a.jsx("nav",{className:"space-y-1",children:q1.map(t=>{const n=e.pathname===t.href;return a.jsxs(bn,{to:t.href,className:X("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx(t.icon,{className:"h-4 w-4"}),t.name]},t.name)})})]})]})]})}function eS(){return a.jsxs("div",{className:"flex h-screen bg-background",children:[a.jsx("div",{className:"w-64 border-r",children:a.jsx(J1,{})}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(lw,{})})]})}const ke=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:X("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ke.displayName="Card";const $e=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:X("flex flex-col space-y-1.5 p-6",e),...t}));$e.displayName="CardHeader";const We=f.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:X("text-2xl font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";const tS=f.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:X("text-sm text-muted-foreground",e),...t}));tS.displayName="CardDescription";const Pe=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:X("p-6 pt-0",e),...t}));Pe.displayName="CardContent";const nS=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:X("flex items-center p-6 pt-0",e),...t}));nS.displayName="CardFooter";function Ad(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gm(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Ad(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:i,...l}=r,s=f.Children.toArray(i),c=s.find(lS);if(c){const u=c.props.children,p=s.map(d=>d===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,p):null})}return a.jsx(t,{...l,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var rS=Tr("Slot");function oS(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const l=aS(o),s=sS(i,o.props);return o.type!==f.Fragment&&(s.ref=r?Gm(r,l):l),f.cloneElement(o,s)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ym=Symbol("radix.slottable");function iS(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ym,t}function lS(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ym}function sS(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const c=i(...s);return o(...s),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function aS(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Td=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Od=Tm,Bc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Od(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const p=n==null?void 0:n[u],d=i==null?void 0:i[u];if(p===null)return null;const h=Td(p)||Td(d);return o[u][h]}),s=n&&Object.entries(n).reduce((u,p)=>{let[d,h]=p;return h===void 0||(u[d]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,p)=>{let{class:d,className:h,...x}=p;return Object.entries(x).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...i,...s}[v]):{...i,...s}[v]===S})?[...u,d,h]:u},[]);return Od(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},Uc=Bc("inline-flex items-center justify-center 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",{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"}}),oe=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const l=r?rS:"button";return a.jsx(l,{className:X(Uc({variant:t,size:n,className:e})),ref:i,...o})});oe.displayName="Button";const cS=[{icon:Bt,title:"Local AI Models",description:"Run powerful language models locally on your machine with full privacy control.",color:"text-blue-500"},{icon:Un,title:"Interactive Chat",description:"Playground interface for testing prompts and exploring model capabilities.",color:"text-green-500"},{icon:ka,title:"Privacy First",description:"Your data never leaves your machine. Complete privacy and security guaranteed.",color:"text-purple-500"},{icon:zo,title:"High Performance",description:"Optimized for speed with model caching and efficient resource management.",color:"text-yellow-500"}],uS=[{title:"Start Chatting",description:"Jump into the playground and start experimenting",href:"/playground",icon:Un,primary:!0},{title:"Browse Models",description:"Explore available models and their capabilities",href:"/models",icon:Ar,primary:!1},{title:"View Settings",description:"Configure your application preferences",href:"/settings",icon:Bm,primary:!1}];function dS(){return a.jsx("div",{className:"min-h-screen bg-background",children:a.jsxs("div",{className:"container mx-auto px-4 py-8",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsx("div",{className:"w-16 h-16 bg-primary rounded-2xl flex items-center justify-center",children:a.jsx(Bt,{className:"h-8 w-8 text-primary-foreground"})})}),a.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Edge LLM"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto mb-8",children:"Your local AI companion. Run powerful language models on your own hardware with complete privacy and control."}),a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsx(bn,{to:"/playground",children:a.jsxs(oe,{size:"lg",children:[a.jsx(Un,{className:"h-5 w-5 mr-2"}),"Start Chatting"]})}),a.jsx(bn,{to:"/models",children:a.jsxs(oe,{variant:"outline",size:"lg",children:[a.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Browse Models"]})})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:cS.map((e,t)=>a.jsx(ke,{className:"text-center",children:a.jsxs(Pe,{className:"pt-6",children:[a.jsx(e.icon,{className:`h-12 w-12 mx-auto mb-4 ${e.color}`}),a.jsx("h3",{className:"font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})},t))}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:uS.map((e,t)=>a.jsx(ke,{className:"hover:shadow-lg transition-shadow",children:a.jsxs(Pe,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx(e.icon,{className:"h-6 w-6 text-primary"}),a.jsx("h3",{className:"font-semibold",children:e.title})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e.description}),a.jsx(bn,{to:e.href,children:a.jsxs(oe,{variant:e.primary?"default":"outline",className:"w-full",children:["Get Started",a.jsx(Jw,{className:"h-4 w-4 ml-2"})]})})]})},t))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{children:"Getting Started"})}),a.jsxs(Pe,{children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"1"}),a.jsx("h4",{className:"font-medium",children:"Browse Available Models"})]}),a.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Check out our model catalog to see what's available for your use case."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"2"}),a.jsx("h4",{className:"font-medium",children:"Load a Model"})]}),a.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Select and load a model that fits your hardware and requirements."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"3"}),a.jsx("h4",{className:"font-medium",children:"Start Chatting"})]}),a.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Go to the playground and start experimenting with prompts."})]})]}),a.jsx("div",{className:"pt-4 border-t",children:a.jsx(bn,{to:"/playground",children:a.jsxs(oe,{className:"w-full md:w-auto",children:[a.jsx(Un,{className:"h-4 w-4 mr-2"}),"Open Playground"]})})})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{children:"System Status"})}),a.jsxs(Pe,{children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm",children:"Backend Status"}),a.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-green-600",children:[a.jsx("div",{className:"w-2 h-2 bg-green-600 rounded-full"}),"Online"]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm",children:"Models Loaded"}),a.jsx("span",{className:"text-sm font-medium",children:"Ready"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm",children:"Memory Usage"}),a.jsx("span",{className:"text-sm font-medium",children:"Optimized"})]})]}),a.jsx("div",{className:"pt-4 border-t",children:a.jsx(bn,{to:"/settings",children:a.jsxs(oe,{variant:"outline",className:"w-full md:w-auto",children:[a.jsx(Bm,{className:"h-4 w-4 mr-2"}),"View Settings"]})})})]})]})]})]})})}function al(e,[t,n]){return Math.min(n,Math.max(t,e))}function Q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function fS(e,t){const n=f.createContext(t),r=i=>{const{children:l,...s}=i,c=f.useMemo(()=>s,Object.values(s));return a.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function o(i){const l=f.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function kn(e,t=[]){let n=[];function r(i,l){const s=f.createContext(l),c=n.length;n=[...n,l];const u=d=>{var g;const{scope:h,children:x,...w}=d,v=((g=h==null?void 0:h[e])==null?void 0:g[c])||s,S=f.useMemo(()=>w,Object.values(w));return a.jsx(v.Provider,{value:S,children:x})};u.displayName=i+"Provider";function p(d,h){var v;const x=((v=h==null?void 0:h[e])==null?void 0:v[c])||s,w=f.useContext(x);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,p]}const o=()=>{const i=n.map(l=>f.createContext(l));return function(s){const c=(s==null?void 0:s[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,pS(o,...t)]}function pS(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...s,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ae=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},mS=Ha[" useInsertionEffect ".trim().toString()]||Ae;function Or({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=hS({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:o;{const p=f.useRef(e!==void 0);f.useEffect(()=>{const d=p.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"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.`),p.current=s},[s,r])}const u=f.useCallback(p=>{var d;if(s){const h=gS(p)?p(e):p;h!==e&&((d=l.current)==null||d.call(l,h))}else i(p)},[s,e,i,l]);return[c,u]}function hS({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return mS(()=>{i.current=t},[t]),f.useEffect(()=>{var l;o.current!==n&&((l=i.current)==null||l.call(i,n),o.current=n)},[n,o]),[n,r,i]}function gS(e){return typeof e=="function"}var vS=f.createContext(void 0);function Qm(e){const t=f.useContext(vS);return e||t||"ltr"}function Vc(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Wc(e){const[t,n]=f.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var yS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],G=yS.reduce((e,t)=>{const n=Tr(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:l,...s}=o,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xS(e,t){e&&$r.flushSync(()=>e.dispatchEvent(t))}function Xm(e){const t=e+"CollectionProvider",[n,r]=kn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:S,children:g}=v,m=mt.useRef(null),y=mt.useRef(new Map).current;return a.jsx(o,{scope:S,itemMap:y,collectionRef:m,children:g})};l.displayName=t;const s=e+"CollectionSlot",c=Tr(s),u=mt.forwardRef((v,S)=>{const{scope:g,children:m}=v,y=i(s,g),C=J(S,y.collectionRef);return a.jsx(c,{ref:C,children:m})});u.displayName=s;const p=e+"CollectionItemSlot",d="data-radix-collection-item",h=Tr(p),x=mt.forwardRef((v,S)=>{const{scope:g,children:m,...y}=v,C=mt.useRef(null),N=J(S,C),E=i(p,g);return mt.useEffect(()=>(E.itemMap.set(C,{ref:C,...y}),()=>void E.itemMap.delete(C))),a.jsx(h,{[d]:"",ref:N,children:m})});x.displayName=p;function w(v){const S=i(e+"CollectionConsumer",v);return mt.useCallback(()=>{const m=S.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((E,k)=>y.indexOf(E.ref.current)-y.indexOf(k.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:x},w,r]}var Zm=["PageUp","PageDown"],qm=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Jm={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Br="Slider",[ja,wS,SS]=Xm(Br),[eh,Wj]=kn(Br,[SS]),[CS,Al]=eh(Br),th=f.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:p,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:x=!1,form:w,...v}=e,S=f.useRef(new Set),g=f.useRef(0),y=l==="horizontal"?NS:kS,[C=[],N]=Or({prop:p,defaultProp:u,onChange:L=>{var U;(U=[...S.current][g.current])==null||U.focus(),d(L)}}),E=f.useRef(C);function k(L){const M=bS(C,L);T(L,M)}function _(L){T(L,g.current)}function D(){const L=E.current[g.current];C[g.current]!==L&&h(C)}function T(L,M,{commit:U}={commit:!1}){const b=TS(i),$=OS(Math.round((L-r)/i)*i+r,b),z=al($,[r,o]);N((V=[])=>{const j=PS(V,z,M);if(AS(j,c*i)){g.current=j.indexOf(z);const A=String(j)!==String(V);return A&&U&&h(j),A?j:V}else return V})}return a.jsx(CS,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:w,children:a.jsx(ja.Provider,{scope:e.__scopeSlider,children:a.jsx(ja.Slot,{scope:e.__scopeSlider,children:a.jsx(y,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:t,onPointerDown:Q(v.onPointerDown,()=>{s||(E.current=C)}),min:r,max:o,inverted:x,onSlideStart:s?void 0:k,onSlideMove:s?void 0:_,onSlideEnd:s?void 0:D,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(o,C.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:M})=>{if(!s){const $=Zm.includes(L.key)||L.shiftKey&&qm.includes(L.key)?10:1,z=g.current,V=C[z],j=i*$*M;T(V+j,z,{commit:!0})}}})})})})});th.displayName=Br;var[nh,rh]=eh(Br,{startEdge:"left",endEdge:"right",size:"width",direction:1}),NS=f.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:c,onStepKeyDown:u,...p}=e,[d,h]=f.useState(null),x=J(t,y=>h(y)),w=f.useRef(void 0),v=Qm(o),S=v==="ltr",g=S&&!i||!S&&i;function m(y){const C=w.current||d.getBoundingClientRect(),N=[0,C.width],k=Hc(N,g?[n,r]:[r,n]);return w.current=C,k(y-C.left)}return a.jsx(nh,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:a.jsx(oh,{dir:v,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:y=>{const C=m(y.clientX);l==null||l(C)},onSlideMove:y=>{const C=m(y.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,c==null||c()},onStepKeyDown:y=>{const N=Jm[g?"from-left":"from-right"].includes(y.key);u==null||u({event:y,direction:N?-1:1})}})})}),kS=f.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:c,...u}=e,p=f.useRef(null),d=J(t,p),h=f.useRef(void 0),x=!o;function w(v){const S=h.current||p.current.getBoundingClientRect(),g=[0,S.height],y=Hc(g,x?[r,n]:[n,r]);return h.current=S,y(v-S.top)}return a.jsx(nh,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:a.jsx(oh,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=w(v.clientY);i==null||i(S)},onSlideMove:v=>{const S=w(v.clientY);l==null||l(S)},onSlideEnd:()=>{h.current=void 0,s==null||s()},onStepKeyDown:v=>{const g=Jm[x?"from-bottom":"from-top"].includes(v.key);c==null||c({event:v,direction:g?-1:1})}})})}),oh=f.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:c,...u}=e,p=Al(Br,n);return a.jsx(G.span,{...u,ref:t,onKeyDown:Q(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Zm.concat(qm).includes(d.key)&&(c(d),d.preventDefault())}),onPointerDown:Q(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),p.thumbs.has(h)?h.focus():r(d)}),onPointerMove:Q(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:Q(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),i(d))})})}),ih="SliderTrack",lh=f.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Al(ih,n);return a.jsx(G.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});lh.displayName=ih;var Ea="SliderRange",sh=f.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Al(Ea,n),i=rh(Ea,n),l=f.useRef(null),s=J(t,l),c=o.values.length,u=o.values.map(h=>uh(h,o.min,o.max)),p=c>1?Math.min(...u):0,d=100-Math.max(...u);return a.jsx(G.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:p+"%",[i.endEdge]:d+"%"}})});sh.displayName=Ea;var Pa="SliderThumb",ah=f.forwardRef((e,t)=>{const n=wS(e.__scopeSlider),[r,o]=f.useState(null),i=J(t,s=>o(s)),l=f.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return a.jsx(jS,{...e,ref:i,index:l})}),jS=f.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,l=Al(Pa,n),s=rh(Pa,n),[c,u]=f.useState(null),p=J(t,m=>u(m)),d=c?l.form||!!c.closest("form"):!0,h=Wc(c),x=l.values[r],w=x===void 0?0:uh(x,l.min,l.max),v=_S(r,l.values.length),S=h==null?void 0:h[s.size],g=S?RS(S,w,s.direction):0;return f.useEffect(()=>{if(c)return l.thumbs.add(c),()=>{l.thumbs.delete(c)}},[c,l.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${g}px)`},children:[a.jsx(ja.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(G.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:p,style:x===void 0?{display:"none"}:e.style,onFocus:Q(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&a.jsx(ch,{name:o??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});ah.displayName=Pa;var ES="RadioBubbleInput",ch=f.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=f.useRef(null),i=J(o,r),l=Vc(t);return f.useEffect(()=>{const s=o.current;if(!s)return;const c=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==t&&p){const d=new Event("input",{bubbles:!0});p.call(s,t),s.dispatchEvent(d)}},[l,t]),a.jsx(G.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});ch.displayName=ES;function PS(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function uh(e,t,n){const i=100/(n-t)*(e-t);return al(i,[0,100])}function _S(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function bS(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function RS(e,t,n){const r=e/2,i=Hc([0,50],[0,r]);return(r-i(t)*n)*n}function MS(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function AS(e,t){if(t>0){const n=MS(e);return Math.min(...n)>=t}return!0}function Hc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function TS(e){return(String(e).split(".")[1]||"").length}function OS(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var dh=th,IS=lh,LS=sh,DS=ah;const _a=f.forwardRef(({className:e,...t},n)=>a.jsxs(dh,{ref:n,className:X("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(IS,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(LS,{className:"absolute h-full bg-primary"})}),a.jsx(DS,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));_a.displayName=dh.displayName;var zS="Label",fh=f.forwardRef((e,t)=>a.jsx(G.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));fh.displayName=zS;var ph=fh;const $S=Bc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ce=f.forwardRef(({className:e,...t},n)=>a.jsx(ph,{ref:n,className:X($S(),e),...t}));Ce.displayName=ph.displayName;const FS=Bc("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function xe({className:e,variant:t,...n}){return a.jsx("div",{className:X(FS({variant:t}),e),...n})}function Vn(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function BS(e,t=globalThis==null?void 0:globalThis.document){const n=Vn(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var US="DismissableLayer",ba="dismissableLayer.update",VS="dismissableLayer.pointerDownOutside",WS="dismissableLayer.focusOutside",Id,mh=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kc=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=e,u=f.useContext(mh),[p,d]=f.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=f.useState({}),w=J(t,k=>d(k)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(S),m=p?v.indexOf(p):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=g,N=GS(k=>{const _=k.target,D=[...u.branches].some(T=>T.contains(_));!C||D||(o==null||o(k),l==null||l(k),k.defaultPrevented||s==null||s())},h),E=YS(k=>{const _=k.target;[...u.branches].some(T=>T.contains(_))||(i==null||i(k),l==null||l(k),k.defaultPrevented||s==null||s())},h);return BS(k=>{m===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&s&&(k.preventDefault(),s()))},h),f.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Id=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Ld(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Id)}},[p,h,n,u]),f.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Ld())},[p,u]),f.useEffect(()=>{const k=()=>x({});return document.addEventListener(ba,k),()=>document.removeEventListener(ba,k)},[]),a.jsx(G.div,{...c,ref:w,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:Q(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Q(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Q(e.onPointerDownCapture,N.onPointerDownCapture)})});Kc.displayName=US;var HS="DismissableLayerBranch",KS=f.forwardRef((e,t)=>{const n=f.useContext(mh),r=f.useRef(null),o=J(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(G.div,{...e,ref:o})});KS.displayName=HS;function GS(e,t=globalThis==null?void 0:globalThis.document){const n=Vn(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){hh(VS,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function YS(e,t=globalThis==null?void 0:globalThis.document){const n=Vn(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&hh(WS,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ld(){const e=new CustomEvent(ba);document.dispatchEvent(e)}function hh(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xS(o,i):o.dispatchEvent(i)}var vs=0;function gh(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dd()),document.body.insertAdjacentElement("beforeend",e[1]??Dd()),vs++,()=>{vs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vs--}},[])}function Dd(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ys="focusScope.autoFocusOnMount",xs="focusScope.autoFocusOnUnmount",zd={bubbles:!1,cancelable:!0},QS="FocusScope",Gc=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[s,c]=f.useState(null),u=Vn(o),p=Vn(i),d=f.useRef(null),h=J(t,v=>c(v)),x=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let v=function(y){if(x.paused||!s)return;const C=y.target;s.contains(C)?d.current=C:qt(d.current,{select:!0})},S=function(y){if(x.paused||!s)return;const C=y.relatedTarget;C!==null&&(s.contains(C)||qt(d.current,{select:!0}))},g=function(y){if(document.activeElement===document.body)for(const N of y)N.removedNodes.length>0&&qt(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const m=new MutationObserver(g);return s&&m.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),m.disconnect()}}},[r,s,x.paused]),f.useEffect(()=>{if(s){Fd.add(x);const v=document.activeElement;if(!s.contains(v)){const g=new CustomEvent(ys,zd);s.addEventListener(ys,u),s.dispatchEvent(g),g.defaultPrevented||(XS(tC(vh(s)),{select:!0}),document.activeElement===v&&qt(s))}return()=>{s.removeEventListener(ys,u),setTimeout(()=>{const g=new CustomEvent(xs,zd);s.addEventListener(xs,p),s.dispatchEvent(g),g.defaultPrevented||qt(v??document.body,{select:!0}),s.removeEventListener(xs,p),Fd.remove(x)},0)}}},[s,u,p,x]);const w=f.useCallback(v=>{if(!n&&!r||x.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(S&&g){const m=v.currentTarget,[y,C]=ZS(m);y&&C?!v.shiftKey&&g===C?(v.preventDefault(),n&&qt(y,{select:!0})):v.shiftKey&&g===y&&(v.preventDefault(),n&&qt(C,{select:!0})):g===m&&v.preventDefault()}},[n,r,x.paused]);return a.jsx(G.div,{tabIndex:-1,...l,ref:h,onKeyDown:w})});Gc.displayName=QS;function XS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}function ZS(e){const t=vh(e),n=$d(t,e),r=$d(t.reverse(),e);return[n,r]}function vh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $d(e,t){for(const n of e)if(!qS(n,{upTo:t}))return n}function qS(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function JS(e){return e instanceof HTMLInputElement&&"select"in e}function qt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JS(e)&&t&&e.select()}}var Fd=eC();function eC(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Bd(e,t),e.unshift(t)},remove(t){var n;e=Bd(e,t),(n=e[0])==null||n.resume()}}}function Bd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tC(e){return e.filter(t=>t.tagName!=="A")}var nC=Ha[" useId ".trim().toString()]||(()=>{}),rC=0;function Ln(e){const[t,n]=f.useState(nC());return Ae(()=>{e||n(r=>r??String(rC++))},[e]),e||(t?`radix-${t}`:"")}const oC=["top","right","bottom","left"],yn=Math.min,Ze=Math.max,cl=Math.round,hi=Math.floor,Tt=e=>({x:e,y:e}),iC={left:"right",right:"left",bottom:"top",top:"bottom"},lC={start:"end",end:"start"};function Ra(e,t,n){return Ze(e,yn(t,n))}function Kt(e,t){return typeof e=="function"?e(t):e}function Gt(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function Yc(e){return e==="x"?"y":"x"}function Qc(e){return e==="y"?"height":"width"}const sC=new Set(["top","bottom"]);function Rt(e){return sC.has(Gt(e))?"y":"x"}function Xc(e){return Yc(Rt(e))}function aC(e,t,n){n===void 0&&(n=!1);const r=Ur(e),o=Xc(e),i=Qc(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ul(l)),[l,ul(l)]}function cC(e){const t=ul(e);return[Ma(e),t,Ma(t)]}function Ma(e){return e.replace(/start|end/g,t=>lC[t])}const Ud=["left","right"],Vd=["right","left"],uC=["top","bottom"],dC=["bottom","top"];function fC(e,t,n){switch(e){case"top":case"bottom":return n?t?Vd:Ud:t?Ud:Vd;case"left":case"right":return t?uC:dC;default:return[]}}function pC(e,t,n,r){const o=Ur(e);let i=fC(Gt(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Ma)))),i}function ul(e){return e.replace(/left|right|bottom|top/g,t=>iC[t])}function mC(e){return{top:0,right:0,bottom:0,left:0,...e}}function yh(e){return typeof e!="number"?mC(e):{top:e,right:e,bottom:e,left:e}}function dl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Wd(e,t,n){let{reference:r,floating:o}=e;const i=Rt(t),l=Xc(t),s=Qc(l),c=Gt(t),u=i==="y",p=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let x;switch(c){case"top":x={x:p,y:r.y-o.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:d};break;case"left":x={x:r.x-o.width,y:d};break;default:x={x:r.x,y:r.y}}switch(Ur(t)){case"start":x[l]-=h*(n&&u?-1:1);break;case"end":x[l]+=h*(n&&u?-1:1);break}return x}const hC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:d}=Wd(u,r,c),h=r,x={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:c}=t,{element:u,padding:p=0}=Kt(e,t)||{};if(u==null)return{};const d=yh(p),h={x:n,y:r},x=Xc(o),w=Qc(x),v=await l.getDimensions(u),S=x==="y",g=S?"top":"left",m=S?"bottom":"right",y=S?"clientHeight":"clientWidth",C=i.reference[w]+i.reference[x]-h[x]-i.floating[w],N=h[x]-i.reference[x],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let k=E?E[y]:0;(!k||!await(l.isElement==null?void 0:l.isElement(E)))&&(k=s.floating[y]||i.floating[w]);const _=C/2-N/2,D=k/2-v[w]/2-1,T=yn(d[g],D),L=yn(d[m],D),M=T,U=k-v[w]-L,b=k/2-v[w]/2+_,$=Ra(M,b,U),z=!c.arrow&&Ur(o)!=null&&b!==$&&i.reference[w]/2-(bb<=0)){var L,M;const b=(((L=i.flip)==null?void 0:L.index)||0)+1,$=k[b];if($&&(!(d==="alignment"?m!==Rt($):!1)||T.every(j=>Rt(j.placement)===m?j.overflows[0]>0:!0)))return{data:{index:b,overflows:T},reset:{placement:$}};let z=(M=T.filter(V=>V.overflows[0]<=0).sort((V,j)=>V.overflows[1]-j.overflows[1])[0])==null?void 0:M.placement;if(!z)switch(x){case"bestFit":{var U;const V=(U=T.filter(j=>{if(E){const A=Rt(j.placement);return A===m||A==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(A=>A>0).reduce((A,O)=>A+O,0)]).sort((j,A)=>j[1]-A[1])[0])==null?void 0:U[0];V&&(z=V);break}case"initialPlacement":z=s;break}if(o!==z)return{reset:{placement:z}}}return{}}}};function Hd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kd(e){return oC.some(t=>e[t]>=0)}const yC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Kt(e,t);switch(r){case"referenceHidden":{const i=await $o(t,{...o,elementContext:"reference"}),l=Hd(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Kd(l)}}}case"escaped":{const i=await $o(t,{...o,altBoundary:!0}),l=Hd(i,n.floating);return{data:{escapedOffsets:l,escaped:Kd(l)}}}default:return{}}}}},xh=new Set(["left","top"]);async function xC(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=Gt(n),s=Ur(n),c=Rt(n)==="y",u=xh.has(l)?-1:1,p=i&&c?-1:1,d=Kt(t,e);let{mainAxis:h,crossAxis:x,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(x=s==="end"?w*-1:w),c?{x:x*p,y:h*u}:{x:h*u,y:x*p}}const wC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,c=await xC(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},SC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:g,y:m}=S;return{x:g,y:m}}},...c}=Kt(e,t),u={x:n,y:r},p=await $o(t,c),d=Rt(Gt(o)),h=Yc(d);let x=u[h],w=u[d];if(i){const S=h==="y"?"top":"left",g=h==="y"?"bottom":"right",m=x+p[S],y=x-p[g];x=Ra(m,x,y)}if(l){const S=d==="y"?"top":"left",g=d==="y"?"bottom":"right",m=w+p[S],y=w-p[g];w=Ra(m,w,y)}const v=s.fn({...t,[h]:x,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[d]:l}}}}}},CC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:c=!0,crossAxis:u=!0}=Kt(e,t),p={x:n,y:r},d=Rt(o),h=Yc(d);let x=p[h],w=p[d];const v=Kt(s,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=h==="y"?"height":"width",C=i.reference[h]-i.floating[y]+S.mainAxis,N=i.reference[h]+i.reference[y]-S.mainAxis;xN&&(x=N)}if(u){var g,m;const y=h==="y"?"width":"height",C=xh.has(Gt(o)),N=i.reference[d]-i.floating[y]+(C&&((g=l.offset)==null?void 0:g[d])||0)+(C?0:S.crossAxis),E=i.reference[d]+i.reference[y]+(C?0:((m=l.offset)==null?void 0:m[d])||0)-(C?S.crossAxis:0);wE&&(w=E)}return{[h]:x,[d]:w}}}},NC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:c=()=>{},...u}=Kt(e,t),p=await $o(t,u),d=Gt(o),h=Ur(o),x=Rt(o)==="y",{width:w,height:v}=i.floating;let S,g;d==="top"||d==="bottom"?(S=d,g=h===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,S=h==="end"?"top":"bottom");const m=v-p.top-p.bottom,y=w-p.left-p.right,C=yn(v-p[S],m),N=yn(w-p[g],y),E=!t.middlewareData.shift;let k=C,_=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=m),E&&!h){const T=Ze(p.left,0),L=Ze(p.right,0),M=Ze(p.top,0),U=Ze(p.bottom,0);x?_=w-2*(T!==0||L!==0?T+L:Ze(p.left,p.right)):k=v-2*(M!==0||U!==0?M+U:Ze(p.top,p.bottom))}await c({...t,availableWidth:_,availableHeight:k});const D=await l.getDimensions(s.floating);return w!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function Tl(){return typeof window<"u"}function Vr(e){return wh(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function It(e){var t;return(t=(wh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wh(e){return Tl()?e instanceof Node||e instanceof et(e).Node:!1}function wt(e){return Tl()?e instanceof Element||e instanceof et(e).Element:!1}function Ot(e){return Tl()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Gd(e){return!Tl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const kC=new Set(["inline","contents"]);function Yo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kC.has(o)}const jC=new Set(["table","td","th"]);function EC(e){return jC.has(Vr(e))}const PC=[":popover-open",":modal"];function Ol(e){return PC.some(t=>{try{return e.matches(t)}catch{return!1}})}const _C=["transform","translate","scale","rotate","perspective"],bC=["transform","translate","scale","rotate","perspective","filter"],RC=["paint","layout","strict","content"];function Zc(e){const t=qc(),n=wt(e)?St(e):e;return _C.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bC.some(r=>(n.willChange||"").includes(r))||RC.some(r=>(n.contain||"").includes(r))}function MC(e){let t=xn(e);for(;Ot(t)&&!Ir(t);){if(Zc(t))return t;if(Ol(t))return null;t=xn(t)}return null}function qc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AC=new Set(["html","body","#document"]);function Ir(e){return AC.has(Vr(e))}function St(e){return et(e).getComputedStyle(e)}function Il(e){return wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xn(e){if(Vr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gd(e)&&e.host||It(e);return Gd(t)?t.host:t}function Sh(e){const t=xn(e);return Ir(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&Yo(t)?t:Sh(t)}function Fo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Sh(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=et(o);if(i){const s=Aa(l);return t.concat(l,l.visualViewport||[],Yo(o)?o:[],s&&n?Fo(s):[])}return t.concat(o,Fo(o,[],n))}function Aa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ch(e){const t=St(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ot(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=cl(n)!==i||cl(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Jc(e){return wt(e)?e:e.contextElement}function Cr(e){const t=Jc(e);if(!Ot(t))return Tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ch(t);let l=(i?cl(n.width):n.width)/r,s=(i?cl(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const TC=Tt(0);function Nh(e){const t=et(e);return!qc()||!t.visualViewport?TC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function Wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Jc(e);let l=Tt(1);t&&(r?wt(r)&&(l=Cr(r)):l=Cr(e));const s=OC(i,n,r)?Nh(i):Tt(0);let c=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,p=o.width/l.x,d=o.height/l.y;if(i){const h=et(i),x=r&&wt(r)?et(r):r;let w=h,v=Aa(w);for(;v&&r&&x!==w;){const S=Cr(v),g=v.getBoundingClientRect(),m=St(v),y=g.left+(v.clientLeft+parseFloat(m.paddingLeft))*S.x,C=g.top+(v.clientTop+parseFloat(m.paddingTop))*S.y;c*=S.x,u*=S.y,p*=S.x,d*=S.y,c+=y,u+=C,w=et(v),v=Aa(w)}}return dl({width:p,height:d,x:c,y:u})}function Ll(e,t){const n=Il(e).scrollLeft;return t?t.left+n:Wn(It(e)).left+n}function kh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ll(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function IC(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=It(r),s=t?Ol(t.floating):!1;if(r===l||s&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Tt(1);const p=Tt(0),d=Ot(r);if((d||!d&&!i)&&((Vr(r)!=="body"||Yo(l))&&(c=Il(r)),Ot(r))){const x=Wn(r);u=Cr(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const h=l&&!d&&!i?kh(l,c):Tt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+p.x+h.x,y:n.y*u.y-c.scrollTop*u.y+p.y+h.y}}function LC(e){return Array.from(e.getClientRects())}function DC(e){const t=It(e),n=Il(e),r=e.ownerDocument.body,o=Ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ll(e);const s=-n.scrollTop;return St(r).direction==="rtl"&&(l+=Ze(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}const Yd=25;function zC(e,t){const n=et(e),r=It(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,c=0;if(o){i=o.width,l=o.height;const p=qc();(!p||p&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}const u=Ll(r);if(u<=0){const p=r.ownerDocument,d=p.body,h=getComputedStyle(d),x=p.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-x);w<=Yd&&(i-=w)}else u<=Yd&&(i+=u);return{width:i,height:l,x:s,y:c}}const $C=new Set(["absolute","fixed"]);function FC(e,t){const n=Wn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ot(e)?Cr(e):Tt(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:l,height:s,x:c,y:u}}function Qd(e,t,n){let r;if(t==="viewport")r=zC(e,n);else if(t==="document")r=DC(It(e));else if(wt(t))r=FC(t,n);else{const o=Nh(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return dl(r)}function jh(e,t){const n=xn(e);return n===t||!wt(n)||Ir(n)?!1:St(n).position==="fixed"||jh(n,t)}function BC(e,t){const n=t.get(e);if(n)return n;let r=Fo(e,[],!1).filter(s=>wt(s)&&Vr(s)!=="body"),o=null;const i=St(e).position==="fixed";let l=i?xn(e):e;for(;wt(l)&&!Ir(l);){const s=St(l),c=Zc(l);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&$C.has(o.position)||Yo(l)&&!c&&jh(e,l))?r=r.filter(p=>p!==l):o=s,l=xn(l)}return t.set(e,r),r}function UC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Ol(t)?[]:BC(t,this._c):[].concat(n),r],s=l[0],c=l.reduce((u,p)=>{const d=Qd(t,p,o);return u.top=Ze(d.top,u.top),u.right=yn(d.right,u.right),u.bottom=yn(d.bottom,u.bottom),u.left=Ze(d.left,u.left),u},Qd(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VC(e){const{width:t,height:n}=Ch(e);return{width:t,height:n}}function WC(e,t,n){const r=Ot(t),o=It(t),i=n==="fixed",l=Wn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Tt(0);function u(){c.x=Ll(o)}if(r||!r&&!i)if((Vr(t)!=="body"||Yo(o))&&(s=Il(t)),r){const x=Wn(t,!0,i,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else o&&u();i&&!r&&o&&u();const p=o&&!r&&!i?kh(o,s):Tt(0),d=l.left+s.scrollLeft-c.x-p.x,h=l.top+s.scrollTop-c.y-p.y;return{x:d,y:h,width:l.width,height:l.height}}function ws(e){return St(e).position==="static"}function Xd(e,t){if(!Ot(e)||St(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return It(e)===n&&(n=n.ownerDocument.body),n}function Eh(e,t){const n=et(e);if(Ol(e))return n;if(!Ot(e)){let o=xn(e);for(;o&&!Ir(o);){if(wt(o)&&!ws(o))return o;o=xn(o)}return n}let r=Xd(e,t);for(;r&&EC(r)&&ws(r);)r=Xd(r,t);return r&&Ir(r)&&ws(r)&&!Zc(r)?n:r||MC(e)||n}const HC=async function(e){const t=this.getOffsetParent||Eh,n=this.getDimensions,r=await n(e.floating);return{reference:WC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KC(e){return St(e).direction==="rtl"}const GC={convertOffsetParentRelativeRectToViewportRelativeRect:IC,getDocumentElement:It,getClippingRect:UC,getOffsetParent:Eh,getElementRects:HC,getClientRects:LC,getDimensions:VC,getScale:Cr,isElement:wt,isRTL:KC};function Ph(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YC(e,t){let n=null,r;const o=It(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:p,top:d,width:h,height:x}=u;if(s||t(),!h||!x)return;const w=hi(d),v=hi(o.clientWidth-(p+h)),S=hi(o.clientHeight-(d+x)),g=hi(p),y={rootMargin:-w+"px "+-v+"px "+-S+"px "+-g+"px",threshold:Ze(0,yn(1,c))||1};let C=!0;function N(E){const k=E[0].intersectionRatio;if(k!==c){if(!C)return l();k?l(!1,k):r=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!Ph(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,y)}n.observe(e)}return l(!0),i}function QC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Jc(e),p=o||i?[...u?Fo(u):[],...Fo(t)]:[];p.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&s?YC(u,n):null;let h=-1,x=null;l&&(x=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let w,v=c?Wn(e):null;c&&S();function S(){const g=Wn(e);v&&!Ph(v,g)&&n(),v=g,w=requestAnimationFrame(S)}return n(),()=>{var g;p.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(w)}}const XC=wC,ZC=SC,qC=vC,JC=NC,eN=yC,Zd=gC,tN=CC,nN=(e,t,n)=>{const r=new Map,o={platform:GC,...n},i={...o.platform,_c:r};return hC(e,t,{...o,platform:i})};var rN=typeof document<"u",oN=function(){},Ti=rN?f.useLayoutEffect:oN;function fl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!fl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function _h(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qd(e,t){const n=_h(e);return Math.round(t*n)/n}function Ss(e){const t=f.useRef(e);return Ti(()=>{t.current=e}),t}function iN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[p,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,x]=f.useState(r);fl(h,r)||x(r);const[w,v]=f.useState(null),[S,g]=f.useState(null),m=f.useCallback(j=>{j!==E.current&&(E.current=j,v(j))},[]),y=f.useCallback(j=>{j!==k.current&&(k.current=j,g(j))},[]),C=i||w,N=l||S,E=f.useRef(null),k=f.useRef(null),_=f.useRef(p),D=c!=null,T=Ss(c),L=Ss(o),M=Ss(u),U=f.useCallback(()=>{if(!E.current||!k.current)return;const j={placement:t,strategy:n,middleware:h};L.current&&(j.platform=L.current),nN(E.current,k.current,j).then(A=>{const O={...A,isPositioned:M.current!==!1};b.current&&!fl(_.current,O)&&(_.current=O,$r.flushSync(()=>{d(O)}))})},[h,t,n,L,M]);Ti(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[u]);const b=f.useRef(!1);Ti(()=>(b.current=!0,()=>{b.current=!1}),[]),Ti(()=>{if(C&&(E.current=C),N&&(k.current=N),C&&N){if(T.current)return T.current(C,N,U);U()}},[C,N,U,T,D]);const $=f.useMemo(()=>({reference:E,floating:k,setReference:m,setFloating:y}),[m,y]),z=f.useMemo(()=>({reference:C,floating:N}),[C,N]),V=f.useMemo(()=>{const j={position:n,left:0,top:0};if(!z.floating)return j;const A=qd(z.floating,p.x),O=qd(z.floating,p.y);return s?{...j,transform:"translate("+A+"px, "+O+"px)",..._h(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:O}},[n,s,z.floating,p.x,p.y]);return f.useMemo(()=>({...p,update:U,refs:$,elements:z,floatingStyles:V}),[p,U,$,z,V])}const lN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Zd({element:r.current,padding:o}).fn(n):{}:r?Zd({element:r,padding:o}).fn(n):{}}}},sN=(e,t)=>({...XC(e),options:[e,t]}),aN=(e,t)=>({...ZC(e),options:[e,t]}),cN=(e,t)=>({...tN(e),options:[e,t]}),uN=(e,t)=>({...qC(e),options:[e,t]}),dN=(e,t)=>({...JC(e),options:[e,t]}),fN=(e,t)=>({...eN(e),options:[e,t]}),pN=(e,t)=>({...lN(e),options:[e,t]});var mN="Arrow",bh=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return a.jsx(G.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});bh.displayName=mN;var hN=bh,eu="Popper",[Rh,Mh]=kn(eu),[gN,Ah]=Rh(eu),Th=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return a.jsx(gN,{scope:t,anchor:r,onAnchorChange:o,children:n})};Th.displayName=eu;var Oh="PopperAnchor",Ih=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Ah(Oh,n),l=f.useRef(null),s=J(t,l),c=f.useRef(null);return f.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||l.current,u!==c.current&&i.onAnchorChange(c.current)}),r?null:a.jsx(G.div,{...o,ref:s})});Ih.displayName=Oh;var tu="PopperContent",[vN,yN]=Rh(tu),Lh=f.forwardRef((e,t)=>{var B,se,Te,ie,ne,re;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:w,...v}=e,S=Ah(tu,n),[g,m]=f.useState(null),y=J(t,Qe=>m(Qe)),[C,N]=f.useState(null),E=Wc(C),k=(E==null?void 0:E.width)??0,_=(E==null?void 0:E.height)??0,D=r+(i!=="center"?"-"+i:""),T=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},L=Array.isArray(u)?u:[u],M=L.length>0,U={padding:T,boundary:L.filter(wN),altBoundary:M},{refs:b,floatingStyles:$,placement:z,isPositioned:V,middlewareData:j}=iN({strategy:"fixed",placement:D,whileElementsMounted:(...Qe)=>QC(...Qe,{animationFrame:x==="always"}),elements:{reference:S.anchor},middleware:[sN({mainAxis:o+_,alignmentAxis:l}),c&&aN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?cN():void 0,...U}),c&&uN({...U}),dN({...U,apply:({elements:Qe,rects:Nt,availableWidth:Hr,availableHeight:Kr})=>{const{width:Gr,height:Bv}=Nt.reference,Xo=Qe.floating.style;Xo.setProperty("--radix-popper-available-width",`${Hr}px`),Xo.setProperty("--radix-popper-available-height",`${Kr}px`),Xo.setProperty("--radix-popper-anchor-width",`${Gr}px`),Xo.setProperty("--radix-popper-anchor-height",`${Bv}px`)}}),C&&pN({element:C,padding:s}),SN({arrowWidth:k,arrowHeight:_}),h&&fN({strategy:"referenceHidden",...U})]}),[A,O]=$h(z),W=Vn(w);Ae(()=>{V&&(W==null||W())},[V,W]);const P=(B=j.arrow)==null?void 0:B.x,F=(se=j.arrow)==null?void 0:se.y,H=((Te=j.arrow)==null?void 0:Te.centerOffset)!==0,[pe,ee]=f.useState();return Ae(()=>{g&&ee(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:V?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(ie=j.transformOrigin)==null?void 0:ie.x,(ne=j.transformOrigin)==null?void 0:ne.y].join(" "),...((re=j.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(vN,{scope:n,placedSide:A,onArrowChange:N,arrowX:P,arrowY:F,shouldHideArrow:H,children:a.jsx(G.div,{"data-side":A,"data-align":O,...v,ref:y,style:{...v.style,animation:V?void 0:"none"}})})})});Lh.displayName=tu;var Dh="PopperArrow",xN={top:"bottom",right:"left",bottom:"top",left:"right"},zh=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=yN(Dh,r),l=xN[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(hN,{...o,ref:n,style:{...o.style,display:"block"}})})});zh.displayName=Dh;function wN(e){return e!==null}var SN=e=>({name:"transformOrigin",options:e,fn(t){var S,g,m;const{placement:n,rects:r,middlewareData:o}=t,l=((S=o.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[u,p]=$h(n),d={start:"0%",center:"50%",end:"100%"}[p],h=(((g=o.arrow)==null?void 0:g.x)??0)+s/2,x=(((m=o.arrow)==null?void 0:m.y)??0)+c/2;let w="",v="";return u==="bottom"?(w=l?d:`${h}px`,v=`${-c}px`):u==="top"?(w=l?d:`${h}px`,v=`${r.floating.height+c}px`):u==="right"?(w=`${-c}px`,v=l?d:`${x}px`):u==="left"&&(w=`${r.floating.width+c}px`,v=l?d:`${x}px`),{data:{x:w,y:v}}}});function $h(e){const[t,n="center"]=e.split("-");return[t,n]}var CN=Th,NN=Ih,kN=Lh,jN=zh,EN="Portal",nu=f.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=f.useState(!1);Ae(()=>i(!0),[]);const l=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?m0.createPortal(a.jsx(G.div,{...r,ref:t}),l):null});nu.displayName=EN;var Fh=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"}),PN="VisuallyHidden",_N=f.forwardRef((e,t)=>a.jsx(G.span,{...e,ref:t,style:{...Fh,...e.style}}));_N.displayName=PN;var bN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jn=new WeakMap,gi=new WeakMap,vi={},Cs=0,Bh=function(e){return e&&(e.host||Bh(e.parentNode))},RN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},MN=function(e,t,n,r){var o=RN(t,Array.isArray(e)?e:[e]);vi[n]||(vi[n]=new WeakMap);var i=vi[n],l=[],s=new Set,c=new Set(o),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};o.forEach(u);var p=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))p(h);else try{var x=h.getAttribute(r),w=x!==null&&x!=="false",v=(Jn.get(h)||0)+1,S=(i.get(h)||0)+1;Jn.set(h,v),i.set(h,S),l.push(h),v===1&&w&&gi.set(h,!0),S===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return p(t),s.clear(),Cs++,function(){l.forEach(function(d){var h=Jn.get(d)-1,x=i.get(d)-1;Jn.set(d,h),i.set(d,x),h||(gi.has(d)||d.removeAttribute(r),gi.delete(d)),x||d.removeAttribute(n)}),Cs--,Cs||(Jn=new WeakMap,Jn=new WeakMap,gi=new WeakMap,vi={})}},Uh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||bN(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),MN(r,o,n,"aria-hidden")):function(){return null}},bt=function(){return bt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return YN;var t=QN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ZN=Kh(),Nr="data-scroll-locked",qN=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(TN,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body[`).concat(Nr,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(i,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Oi,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(Ii,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(Oi," .").concat(Oi,` { right: 0 `).concat(r,`; } .`).concat(Ii," .").concat(Ii,` { margin-right: 0 `).concat(r,`; } body[`).concat(Nr,`] { `).concat(ON,": ").concat(s,`px; } `)},tf=function(){var e=parseInt(document.body.getAttribute(Nr)||"0",10);return isFinite(e)?e:0},JN=function(){f.useEffect(function(){return document.body.setAttribute(Nr,(tf()+1).toString()),function(){var e=tf()-1;e<=0?document.body.removeAttribute(Nr):document.body.setAttribute(Nr,e.toString())}},[])},ek=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;JN();var i=f.useMemo(function(){return XN(o)},[o]);return f.createElement(ZN,{styles:qN(i,!t,o,n?"":"!important")})},Ta=!1;if(typeof window<"u")try{var yi=Object.defineProperty({},"passive",{get:function(){return Ta=!0,!0}});window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{Ta=!1}var er=Ta?{passive:!1}:!1,tk=function(e){return e.tagName==="TEXTAREA"},Gh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tk(e)&&n[t]==="visible")},nk=function(e){return Gh(e,"overflowY")},rk=function(e){return Gh(e,"overflowX")},nf=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Yh(e,r);if(o){var i=Qh(e,r),l=i[1],s=i[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ok=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ik=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Yh=function(e,t){return e==="v"?nk(t):rk(t)},Qh=function(e,t){return e==="v"?ok(t):ik(t)},lk=function(e,t){return e==="h"&&t==="rtl"?-1:1},sk=function(e,t,n,r,o){var i=lk(e,window.getComputedStyle(t).direction),l=i*r,s=n.target,c=t.contains(s),u=!1,p=l>0,d=0,h=0;do{if(!s)break;var x=Qh(e,s),w=x[0],v=x[1],S=x[2],g=v-S-i*w;(w||g)&&Yh(e,s)&&(d+=g,h+=w);var m=s.parentNode;s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(p&&(o&&Math.abs(d)<1||!o&&l>d)||!p&&(o&&Math.abs(h)<1||!o&&-l>h))&&(u=!0),u},xi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rf=function(e){return[e.deltaX,e.deltaY]},of=function(e){return e&&"current"in e?e.current:e},ak=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ck=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},uk=0,tr=[];function dk(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(uk++)[0],i=f.useState(Kh)[0],l=f.useRef(e);f.useEffect(function(){l.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=AN([e.lockRef.current],(e.shards||[]).map(of),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=f.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var g=xi(v),m=n.current,y="deltaX"in v?v.deltaX:m[0]-g[0],C="deltaY"in v?v.deltaY:m[1]-g[1],N,E=v.target,k=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in v&&k==="h"&&E.type==="range")return!1;var _=nf(k,E);if(!_)return!0;if(_?N=k:(N=k==="v"?"h":"v",_=nf(k,E)),!_)return!1;if(!r.current&&"changedTouches"in v&&(y||C)&&(r.current=N),!N)return!0;var D=r.current||N;return sk(D,S,v,D==="h"?y:C,!0)},[]),c=f.useCallback(function(v){var S=v;if(!(!tr.length||tr[tr.length-1]!==i)){var g="deltaY"in S?rf(S):xi(S),m=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&ak(N.delta,g)})[0];if(m&&m.should){S.cancelable&&S.preventDefault();return}if(!m){var y=(l.current.shards||[]).map(of).filter(Boolean).filter(function(N){return N.contains(S.target)}),C=y.length>0?s(S,y[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=f.useCallback(function(v,S,g,m){var y={name:v,delta:S,target:g,should:m,shadowParent:fk(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),p=f.useCallback(function(v){n.current=xi(v),r.current=void 0},[]),d=f.useCallback(function(v){u(v.type,rf(v),v.target,s(v,e.lockRef.current))},[]),h=f.useCallback(function(v){u(v.type,xi(v),v.target,s(v,e.lockRef.current))},[]);f.useEffect(function(){return tr.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,er),document.addEventListener("touchmove",c,er),document.addEventListener("touchstart",p,er),function(){tr=tr.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,er),document.removeEventListener("touchmove",c,er),document.removeEventListener("touchstart",p,er)}},[]);var x=e.removeScrollBar,w=e.inert;return f.createElement(f.Fragment,null,w?f.createElement(i,{styles:ck(o)}):null,x?f.createElement(ek,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pk=BN(Hh,dk);var Xh=f.forwardRef(function(e,t){return f.createElement(Dl,bt({},e,{ref:t,sideCar:pk}))});Xh.classNames=Dl.classNames;const Zh=Xh;var mk=[" ","Enter","ArrowUp","ArrowDown"],hk=[" ","Enter"],Hn="Select",[zl,$l,gk]=Xm(Hn),[Wr,Hj]=kn(Hn,[gk,Mh]),Fl=Mh(),[vk,jn]=Wr(Hn),[yk,xk]=Wr(Hn),qh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:l,defaultValue:s,onValueChange:c,dir:u,name:p,autoComplete:d,disabled:h,required:x,form:w}=e,v=Fl(t),[S,g]=f.useState(null),[m,y]=f.useState(null),[C,N]=f.useState(!1),E=Qm(u),[k,_]=Or({prop:r,defaultProp:o??!1,onChange:i,caller:Hn}),[D,T]=Or({prop:l,defaultProp:s,onChange:c,caller:Hn}),L=f.useRef(null),M=S?w||!!S.closest("form"):!0,[U,b]=f.useState(new Set),$=Array.from(U).map(z=>z.props.value).join(";");return a.jsx(CN,{...v,children:a.jsxs(vk,{required:x,scope:t,trigger:S,onTriggerChange:g,valueNode:m,onValueNodeChange:y,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Ln(),value:D,onValueChange:T,open:k,onOpenChange:_,dir:E,triggerPointerDownPosRef:L,disabled:h,children:[a.jsx(zl.Provider,{scope:t,children:a.jsx(yk,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(z=>{b(V=>new Set(V).add(z))},[]),onNativeOptionRemove:f.useCallback(z=>{b(V=>{const j=new Set(V);return j.delete(z),j})},[]),children:n})}),M?a.jsxs(Ng,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:d,value:D,onChange:z=>T(z.target.value),disabled:h,form:w,children:[D===void 0?a.jsx("option",{value:""}):null,Array.from(U)]},$):null]})})};qh.displayName=Hn;var Jh="SelectTrigger",eg=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Fl(n),l=jn(Jh,n),s=l.disabled||r,c=J(t,l.onTriggerChange),u=$l(n),p=f.useRef("touch"),[d,h,x]=jg(v=>{const S=u().filter(y=>!y.disabled),g=S.find(y=>y.value===l.value),m=Eg(S,v,g);m!==void 0&&l.onValueChange(m.value)}),w=v=>{s||(l.onOpenChange(!0),x()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return a.jsx(NN,{asChild:!0,...i,children:a.jsx(G.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":kg(l.value)?"":void 0,...o,ref:c,onClick:Q(o.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&w(v)}),onPointerDown:Q(o.onPointerDown,v=>{p.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:Q(o.onKeyDown,v=>{const S=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(S&&v.key===" ")&&mk.includes(v.key)&&(w(),v.preventDefault())})})})});eg.displayName=Jh;var tg="SelectValue",ng=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...s}=e,c=jn(tg,n),{onValueNodeHasChildrenChange:u}=c,p=i!==void 0,d=J(t,c.onValueNodeChange);return Ae(()=>{u(p)},[u,p]),a.jsx(G.span,{...s,ref:d,style:{pointerEvents:"none"},children:kg(c.value)?a.jsx(a.Fragment,{children:l}):i})});ng.displayName=tg;var wk="SelectIcon",rg=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return a.jsx(G.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});rg.displayName=wk;var Sk="SelectPortal",og=e=>a.jsx(nu,{asChild:!0,...e});og.displayName=Sk;var Kn="SelectContent",ig=f.forwardRef((e,t)=>{const n=jn(Kn,e.__scopeSelect),[r,o]=f.useState();if(Ae(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?$r.createPortal(a.jsx(lg,{scope:e.__scopeSelect,children:a.jsx(zl.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(sg,{...e,ref:t})});ig.displayName=Kn;var ft=10,[lg,En]=Wr(Kn),Ck="SelectContentImpl",Nk=Tr("SelectContent.RemoveScroll"),sg=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:l,side:s,sideOffset:c,align:u,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:x,sticky:w,hideWhenDetached:v,avoidCollisions:S,...g}=e,m=jn(Kn,n),[y,C]=f.useState(null),[N,E]=f.useState(null),k=J(t,B=>C(B)),[_,D]=f.useState(null),[T,L]=f.useState(null),M=$l(n),[U,b]=f.useState(!1),$=f.useRef(!1);f.useEffect(()=>{if(y)return Uh(y)},[y]),gh();const z=f.useCallback(B=>{const[se,...Te]=M().map(re=>re.ref.current),[ie]=Te.slice(-1),ne=document.activeElement;for(const re of B)if(re===ne||(re==null||re.scrollIntoView({block:"nearest"}),re===se&&N&&(N.scrollTop=0),re===ie&&N&&(N.scrollTop=N.scrollHeight),re==null||re.focus(),document.activeElement!==ne))return},[M,N]),V=f.useCallback(()=>z([_,y]),[z,_,y]);f.useEffect(()=>{U&&V()},[U,V]);const{onOpenChange:j,triggerPointerDownPosRef:A}=m;f.useEffect(()=>{if(y){let B={x:0,y:0};const se=ie=>{var ne,re;B={x:Math.abs(Math.round(ie.pageX)-(((ne=A.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((re=A.current)==null?void 0:re.y)??0))}},Te=ie=>{B.x<=10&&B.y<=10?ie.preventDefault():y.contains(ie.target)||j(!1),document.removeEventListener("pointermove",se),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",Te,{capture:!0})}}},[y,j,A]),f.useEffect(()=>{const B=()=>j(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[j]);const[O,W]=jg(B=>{const se=M().filter(ne=>!ne.disabled),Te=se.find(ne=>ne.ref.current===document.activeElement),ie=Eg(se,B,Te);ie&&setTimeout(()=>ie.ref.current.focus())}),P=f.useCallback((B,se,Te)=>{const ie=!$.current&&!Te;(m.value!==void 0&&m.value===se||ie)&&(D(B),ie&&($.current=!0))},[m.value]),F=f.useCallback(()=>y==null?void 0:y.focus(),[y]),H=f.useCallback((B,se,Te)=>{const ie=!$.current&&!Te;(m.value!==void 0&&m.value===se||ie)&&L(B)},[m.value]),pe=r==="popper"?Oa:ag,ee=pe===Oa?{side:s,sideOffset:c,align:u,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:x,sticky:w,hideWhenDetached:v,avoidCollisions:S}:{};return a.jsx(lg,{scope:n,content:y,viewport:N,onViewportChange:E,itemRefCallback:P,selectedItem:_,onItemLeave:F,itemTextRefCallback:H,focusSelectedItem:V,selectedItemText:T,position:r,isPositioned:U,searchRef:O,children:a.jsx(Zh,{as:Nk,allowPinchZoom:!0,children:a.jsx(Gc,{asChild:!0,trapped:m.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:Q(o,B=>{var se;(se=m.trigger)==null||se.focus({preventScroll:!0}),B.preventDefault()}),children:a.jsx(Kc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:a.jsx(pe,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:B=>B.preventDefault(),...g,...ee,onPlaced:()=>b(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Q(g.onKeyDown,B=>{const se=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!se&&B.key.length===1&&W(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let ie=M().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(B.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const ne=B.target,re=ie.indexOf(ne);ie=ie.slice(re+1)}setTimeout(()=>z(ie)),B.preventDefault()}})})})})})})});sg.displayName=Ck;var kk="SelectItemAlignedPosition",ag=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=jn(Kn,n),l=En(Kn,n),[s,c]=f.useState(null),[u,p]=f.useState(null),d=J(t,k=>p(k)),h=$l(n),x=f.useRef(!1),w=f.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:g,focusSelectedItem:m}=l,y=f.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&v&&S&&g){const k=i.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),T=g.getBoundingClientRect();if(i.dir!=="rtl"){const ne=T.left-_.left,re=D.left-ne,Qe=k.left-re,Nt=k.width+Qe,Hr=Math.max(Nt,_.width),Kr=window.innerWidth-ft,Gr=al(re,[ft,Math.max(ft,Kr-Hr)]);s.style.minWidth=Nt+"px",s.style.left=Gr+"px"}else{const ne=_.right-T.right,re=window.innerWidth-D.right-ne,Qe=window.innerWidth-k.right-re,Nt=k.width+Qe,Hr=Math.max(Nt,_.width),Kr=window.innerWidth-ft,Gr=al(re,[ft,Math.max(ft,Kr-Hr)]);s.style.minWidth=Nt+"px",s.style.right=Gr+"px"}const L=h(),M=window.innerHeight-ft*2,U=v.scrollHeight,b=window.getComputedStyle(u),$=parseInt(b.borderTopWidth,10),z=parseInt(b.paddingTop,10),V=parseInt(b.borderBottomWidth,10),j=parseInt(b.paddingBottom,10),A=$+z+U+j+V,O=Math.min(S.offsetHeight*5,A),W=window.getComputedStyle(v),P=parseInt(W.paddingTop,10),F=parseInt(W.paddingBottom,10),H=k.top+k.height/2-ft,pe=M-H,ee=S.offsetHeight/2,B=S.offsetTop+ee,se=$+z+B,Te=A-se;if(se<=H){const ne=L.length>0&&S===L[L.length-1].ref.current;s.style.bottom="0px";const re=u.clientHeight-v.offsetTop-v.offsetHeight,Qe=Math.max(pe,ee+(ne?F:0)+re+V),Nt=se+Qe;s.style.height=Nt+"px"}else{const ne=L.length>0&&S===L[0].ref.current;s.style.top="0px";const Qe=Math.max(H,$+v.offsetTop+(ne?P:0)+ee)+Te;s.style.height=Qe+"px",v.scrollTop=se-H+v.offsetTop}s.style.margin=`${ft}px 0`,s.style.minHeight=O+"px",s.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[h,i.trigger,i.valueNode,s,u,v,S,g,i.dir,r]);Ae(()=>y(),[y]);const[C,N]=f.useState();Ae(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const E=f.useCallback(k=>{k&&w.current===!0&&(y(),m==null||m(),w.current=!1)},[y,m]);return a.jsx(Ek,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:x,onScrollButtonChange:E,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:a.jsx(G.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ag.displayName=kk;var jk="SelectPopperPosition",Oa=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ft,...i}=e,l=Fl(n);return a.jsx(kN,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oa.displayName=jk;var[Ek,ru]=Wr(Kn,{}),Ia="SelectViewport",cg=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=En(Ia,n),l=ru(Ia,n),s=J(t,i.onViewportChange),c=f.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(zl.Slot,{scope:n,children:a.jsx(G.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Q(o.onScroll,u=>{const p=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=l;if(h!=null&&h.current&&d){const x=Math.abs(c.current-p.scrollTop);if(x>0){const w=window.innerHeight-ft*2,v=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),g=Math.max(v,S);if(g0?C:0,d.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});cg.displayName=Ia;var ug="SelectGroup",[Pk,_k]=Wr(ug),dg=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ln();return a.jsx(Pk,{scope:n,id:o,children:a.jsx(G.div,{role:"group","aria-labelledby":o,...r,ref:t})})});dg.displayName=ug;var fg="SelectLabel",pg=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_k(fg,n);return a.jsx(G.div,{id:o.id,...r,ref:t})});pg.displayName=fg;var pl="SelectItem",[bk,mg]=Wr(pl),hg=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,s=jn(pl,n),c=En(pl,n),u=s.value===r,[p,d]=f.useState(i??""),[h,x]=f.useState(!1),w=J(t,m=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,m,r,o)}),v=Ln(),S=f.useRef("touch"),g=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(bk,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:f.useCallback(m=>{d(y=>y||((m==null?void 0:m.textContent)??"").trim())},[]),children:a.jsx(zl.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:a.jsx(G.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:w,onFocus:Q(l.onFocus,()=>x(!0)),onBlur:Q(l.onBlur,()=>x(!1)),onClick:Q(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:Q(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:Q(l.onPointerDown,m=>{S.current=m.pointerType}),onPointerMove:Q(l.onPointerMove,m=>{var y;S.current=m.pointerType,o?(y=c.onItemLeave)==null||y.call(c):S.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Q(l.onPointerLeave,m=>{var y;m.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Q(l.onKeyDown,m=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(hk.includes(m.key)&&g(),m.key===" "&&m.preventDefault())})})})})});hg.displayName=pl;var ao="SelectItemText",gg=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,l=jn(ao,n),s=En(ao,n),c=mg(ao,n),u=xk(ao,n),[p,d]=f.useState(null),h=J(t,g=>d(g),c.onItemTextChange,g=>{var m;return(m=s.itemTextRefCallback)==null?void 0:m.call(s,g,c.value,c.disabled)}),x=p==null?void 0:p.textContent,w=f.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=u;return Ae(()=>(v(w),()=>S(w)),[v,S,w]),a.jsxs(a.Fragment,{children:[a.jsx(G.span,{id:c.textId,...i,ref:h}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren?$r.createPortal(i.children,l.valueNode):null]})});gg.displayName=ao;var vg="SelectItemIndicator",yg=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return mg(vg,n).isSelected?a.jsx(G.span,{"aria-hidden":!0,...r,ref:t}):null});yg.displayName=vg;var La="SelectScrollUpButton",xg=f.forwardRef((e,t)=>{const n=En(La,e.__scopeSelect),r=ru(La,e.__scopeSelect),[o,i]=f.useState(!1),l=J(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?a.jsx(Sg,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});xg.displayName=La;var Da="SelectScrollDownButton",wg=f.forwardRef((e,t)=>{const n=En(Da,e.__scopeSelect),r=ru(Da,e.__scopeSelect),[o,i]=f.useState(!1),l=J(t,r.onScrollButtonChange);return Ae(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?a.jsx(Sg,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});wg.displayName=Da;var Sg=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=En("SelectScrollButton",n),l=f.useRef(null),s=$l(n),c=f.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),Ae(()=>{var p;const u=s().find(d=>d.ref.current===document.activeElement);(p=u==null?void 0:u.ref.current)==null||p.scrollIntoView({block:"nearest"})},[s]),a.jsx(G.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Q(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Q(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Q(o.onPointerLeave,()=>{c()})})}),Rk="SelectSeparator",Cg=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(G.div,{"aria-hidden":!0,...r,ref:t})});Cg.displayName=Rk;var za="SelectArrow",Mk=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fl(n),i=jn(za,n),l=En(za,n);return i.open&&l.position==="popper"?a.jsx(jN,{...o,...r,ref:t}):null});Mk.displayName=za;var Ak="SelectBubbleInput",Ng=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),i=J(r,o),l=Vc(t);return f.useEffect(()=>{const s=o.current;if(!s)return;const c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==t&&p){const d=new Event("change",{bubbles:!0});p.call(s,t),s.dispatchEvent(d)}},[l,t]),a.jsx(G.select,{...n,style:{...Fh,...n.style},ref:i,defaultValue:t})});Ng.displayName=Ak;function kg(e){return e===""||e===void 0}function jg(e){const t=Vn(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(l=>{const s=n.current+l;t(s),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(s)},[t]),i=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Eg(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=Tk(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const c=l.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Tk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ok=qh,Pg=eg,Ik=ng,Lk=rg,Dk=og,_g=ig,zk=cg,$k=dg,bg=pg,Rg=hg,Fk=gg,Bk=yg,Mg=xg,Ag=wg,Tg=Cg;const Uk=Ok,lf=$k,Vk=Ik,Og=f.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Pg,{ref:r,className:X("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(Lk,{asChild:!0,children:a.jsx($c,{className:"h-4 w-4 opacity-50"})})]}));Og.displayName=Pg.displayName;const Ig=f.forwardRef(({className:e,...t},n)=>a.jsx(Mg,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(s1,{className:"h-4 w-4"})}));Ig.displayName=Mg.displayName;const Lg=f.forwardRef(({className:e,...t},n)=>a.jsx(Ag,{ref:n,className:X("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx($c,{className:"h-4 w-4"})}));Lg.displayName=Ag.displayName;const Dg=f.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>a.jsx(Dk,{children:a.jsxs(_g,{ref:o,className:X("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(Ig,{}),a.jsx(zk,{className:X("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(Lg,{})]})}));Dg.displayName=_g.displayName;const $a=f.forwardRef(({className:e,...t},n)=>a.jsx(bg,{ref:n,className:X("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$a.displayName=bg.displayName;const Fa=f.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Rg,{ref:r,className:X("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Bk,{children:a.jsx(o1,{className:"h-4 w-4"})})}),a.jsx(Fk,{children:t})]}));Fa.displayName=Rg.displayName;const Wk=f.forwardRef(({className:e,...t},n)=>a.jsx(Tg,{ref:n,className:X("-mx-1 my-1 h-px bg-muted",e),...t}));Wk.displayName=Tg.displayName;function Hk(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Qo=e=>{const{present:t,children:n}=e,r=Kk(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=J(r.ref,Gk(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Qo.displayName="Presence";function Kk(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),l=e?"mounted":"unmounted",[s,c]=Hk(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=wi(r.current);i.current=s==="mounted"?u:"none"},[s]),Ae(()=>{const u=r.current,p=o.current;if(p!==e){const h=i.current,x=wi(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(p&&h!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ae(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,d=x=>{const v=wi(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(c("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},h=x=>{x.target===t&&(i.current=wi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function wi(e){return(e==null?void 0:e.animationName)||"none"}function Gk(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bl="Collapsible",[Yk,Kj]=kn(Bl),[Qk,ou]=Yk(Bl),zg=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:l,...s}=e,[c,u]=Or({prop:r,defaultProp:o??!1,onChange:l,caller:Bl});return a.jsx(Qk,{scope:n,disabled:i,contentId:Ln(),open:c,onOpenToggle:f.useCallback(()=>u(p=>!p),[u]),children:a.jsx(G.div,{"data-state":lu(c),"data-disabled":i?"":void 0,...s,ref:t})})});zg.displayName=Bl;var $g="CollapsibleTrigger",Fg=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ou($g,n);return a.jsx(G.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":lu(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Q(e.onClick,o.onOpenToggle)})});Fg.displayName=$g;var iu="CollapsibleContent",Bg=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ou(iu,e.__scopeCollapsible);return a.jsx(Qo,{present:n||o.open,children:({present:i})=>a.jsx(Xk,{...r,ref:t,present:i})})});Bg.displayName=iu;var Xk=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,l=ou(iu,n),[s,c]=f.useState(r),u=f.useRef(null),p=J(t,u),d=f.useRef(0),h=d.current,x=f.useRef(0),w=x.current,v=l.open||s,S=f.useRef(v),g=f.useRef(void 0);return f.useEffect(()=>{const m=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(m)},[]),Ae(()=>{const m=u.current;if(m){g.current=g.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const y=m.getBoundingClientRect();d.current=y.height,x.current=y.width,S.current||(m.style.transitionDuration=g.current.transitionDuration,m.style.animationName=g.current.animationName),c(r)}},[l.open,r]),a.jsx(G.div,{"data-state":lu(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!v,...i,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:v&&o})});function lu(e){return e?"open":"closed"}var Zk=zg;const qk=Zk,Jk=Fg,ej=Bg;var Ul="Dialog",[Ug,Vg]=kn(Ul),[tj,Ct]=Ug(Ul),Wg=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,s=f.useRef(null),c=f.useRef(null),[u,p]=Or({prop:r,defaultProp:o??!1,onChange:i,caller:Ul});return a.jsx(tj,{scope:t,triggerRef:s,contentRef:c,contentId:Ln(),titleId:Ln(),descriptionId:Ln(),open:u,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(d=>!d),[p]),modal:l,children:n})};Wg.displayName=Ul;var Hg="DialogTrigger",Kg=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Hg,n),i=J(t,o.triggerRef);return a.jsx(G.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cu(o.open),...r,ref:i,onClick:Q(e.onClick,o.onOpenToggle)})});Kg.displayName=Hg;var su="DialogPortal",[nj,Gg]=Ug(su,{forceMount:void 0}),Yg=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ct(su,t);return a.jsx(nj,{scope:t,forceMount:n,children:f.Children.map(r,l=>a.jsx(Qo,{present:n||i.open,children:a.jsx(nu,{asChild:!0,container:o,children:l})}))})};Yg.displayName=su;var ml="DialogOverlay",Qg=f.forwardRef((e,t)=>{const n=Gg(ml,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(ml,e.__scopeDialog);return i.modal?a.jsx(Qo,{present:r||i.open,children:a.jsx(oj,{...o,ref:t})}):null});Qg.displayName=ml;var rj=Tr("DialogOverlay.RemoveScroll"),oj=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(ml,n);return a.jsx(Zh,{as:rj,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(G.div,{"data-state":cu(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Gn="DialogContent",Xg=f.forwardRef((e,t)=>{const n=Gg(Gn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(Gn,e.__scopeDialog);return a.jsx(Qo,{present:r||i.open,children:i.modal?a.jsx(ij,{...o,ref:t}):a.jsx(lj,{...o,ref:t})})});Xg.displayName=Gn;var ij=f.forwardRef((e,t)=>{const n=Ct(Gn,e.__scopeDialog),r=f.useRef(null),o=J(t,n.contentRef,r);return f.useEffect(()=>{const i=r.current;if(i)return Uh(i)},[]),a.jsx(Zg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&i.preventDefault()}),onFocusOutside:Q(e.onFocusOutside,i=>i.preventDefault())})}),lj=f.forwardRef((e,t)=>{const n=Ct(Gn,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return a.jsx(Zg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Zg=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,s=Ct(Gn,n),c=f.useRef(null),u=J(t,c);return gh(),a.jsxs(a.Fragment,{children:[a.jsx(Gc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(Kc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":cu(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(aj,{titleId:s.titleId}),a.jsx(uj,{contentRef:c,descriptionId:s.descriptionId})]})]})}),au="DialogTitle",qg=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(au,n);return a.jsx(G.h2,{id:o.titleId,...r,ref:t})});qg.displayName=au;var Jg="DialogDescription",ev=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Jg,n);return a.jsx(G.p,{id:o.descriptionId,...r,ref:t})});ev.displayName=Jg;var tv="DialogClose",nv=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(tv,n);return a.jsx(G.button,{type:"button",...r,ref:t,onClick:Q(e.onClick,()=>o.onOpenChange(!1))})});nv.displayName=tv;function cu(e){return e?"open":"closed"}var rv="DialogTitleWarning",[sj,ov]=fS(rv,{contentName:Gn,titleName:au,docsSlug:"dialog"}),aj=({titleId:e})=>{const t=ov(rv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cj="DialogDescriptionWarning",uj=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ov(cj).contentName}}.`;return f.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},dj=Wg,fj=Kg,pj=Yg,mj=Qg,hj=Xg,gj=qg,vj=ev,iv=nv,lv="AlertDialog",[yj,Gj]=kn(lv,[Vg]),Qt=Vg(),sv=e=>{const{__scopeAlertDialog:t,...n}=e,r=Qt(t);return a.jsx(dj,{...r,...n,modal:!0})};sv.displayName=lv;var xj="AlertDialogTrigger",wj=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qt(n);return a.jsx(fj,{...o,...r,ref:t})});wj.displayName=xj;var Sj="AlertDialogPortal",av=e=>{const{__scopeAlertDialog:t,...n}=e,r=Qt(t);return a.jsx(pj,{...r,...n})};av.displayName=Sj;var Cj="AlertDialogOverlay",cv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qt(n);return a.jsx(mj,{...o,...r,ref:t})});cv.displayName=Cj;var kr="AlertDialogContent",[Nj,kj]=yj(kr),jj=iS("AlertDialogContent"),uv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Qt(n),l=f.useRef(null),s=J(t,l),c=f.useRef(null);return a.jsx(sj,{contentName:kr,titleName:dv,docsSlug:"alert-dialog",children:a.jsx(Nj,{scope:n,cancelRef:c,children:a.jsxs(hj,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:Q(o.onOpenAutoFocus,u=>{var p;u.preventDefault(),(p=c.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(jj,{children:r}),a.jsx(Pj,{contentRef:l})]})})})});uv.displayName=kr;var dv="AlertDialogTitle",fv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qt(n);return a.jsx(gj,{...o,...r,ref:t})});fv.displayName=dv;var pv="AlertDialogDescription",mv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qt(n);return a.jsx(vj,{...o,...r,ref:t})});mv.displayName=pv;var Ej="AlertDialogAction",hv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Qt(n);return a.jsx(iv,{...o,...r,ref:t})});hv.displayName=Ej;var gv="AlertDialogCancel",vv=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=kj(gv,n),i=Qt(n),l=J(t,o);return a.jsx(iv,{...i,...r,ref:l})});vv.displayName=gv;var Pj=({contentRef:e})=>{const t=`\`${kr}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${kr}\` by passing a \`${pv}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${kr}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},_j=sv,bj=av,yv=cv,xv=uv,wv=hv,Sv=vv,Cv=fv,Nv=mv;const Rj=_j,Mj=bj,kv=f.forwardRef(({className:e,...t},n)=>a.jsx(yv,{className:X("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));kv.displayName=yv.displayName;const jv=f.forwardRef(({className:e,...t},n)=>a.jsxs(Mj,{children:[a.jsx(kv,{}),a.jsx(xv,{ref:n,className:X("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));jv.displayName=xv.displayName;const Ev=({className:e,...t})=>a.jsx("div",{className:X("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ev.displayName="AlertDialogHeader";const Pv=({className:e,...t})=>a.jsx("div",{className:X("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Pv.displayName="AlertDialogFooter";const _v=f.forwardRef(({className:e,...t},n)=>a.jsx(Cv,{ref:n,className:X("text-lg font-semibold",e),...t}));_v.displayName=Cv.displayName;const bv=f.forwardRef(({className:e,...t},n)=>a.jsx(Nv,{ref:n,className:X("text-sm text-muted-foreground",e),...t}));bv.displayName=Nv.displayName;const Rv=f.forwardRef(({className:e,...t},n)=>a.jsx(wv,{ref:n,className:X(Uc(),e),...t}));Rv.displayName=wv.displayName;const Mv=f.forwardRef(({className:e,...t},n)=>a.jsx(Sv,{ref:n,className:X(Uc({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Mv.displayName=Sv.displayName;const Av=f.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:X("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Av.displayName="Textarea";const Tv=f.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:o,isGenerating:i,stop:l,...s},c)=>{const u=f.useRef(null),p=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return f.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),p()},[t]),a.jsxs("div",{className:X("flex h-full flex-col",e),ref:c,...s,children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:a.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,h)=>a.jsxs("div",{className:X("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:a.jsx(Fm,{className:"h-4 w-4 text-primary-foreground"})}),a.jsxs("div",{className:X("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[a.jsxs("div",{className:"text-xs opacity-70",children:[d.role==="user"?"You":"Assistant"," • #",h+1]}),a.jsx("div",{className:"leading-relaxed",children:d.content})]}),d.role==="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:a.jsx(Q1,{className:"h-4 w-4"})})]},`${d.id}-${h}`)),a.jsx("div",{ref:u})]}),a.jsx("div",{className:"border-t p-4",children:a.jsxs("form",{onSubmit:o,className:"flex gap-2",children:[a.jsx(Av,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),o(d))}}),i?a.jsx(oe,{type:"button",onClick:l,variant:"outline",size:"icon",children:a.jsx(U1,{className:"h-4 w-4"})}):a.jsx(oe,{type:"submit",disabled:!n.trim(),size:"icon",children:a.jsx(O1,{className:"h-4 w-4"})})]})})]})});Tv.displayName="Chat";const jt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function Ov(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function Aj(){return Ov()}class Tj{getAllSessions(){const t=localStorage.getItem(jt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const o={id:Ov(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},i=this.getAllSessions();return i.unshift(o),localStorage.setItem(jt.sessions,JSON.stringify(i)),o}updateSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);o!==-1&&(r[o]={...r[o],...n,updatedAt:Date.now()},localStorage.setItem(jt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(o=>o.id!==t);localStorage.setItem(jt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(jt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);if(o!==-1){const i={...n,id:Aj(),timestamp:Date.now()};r[o].messages.push(i),r[o].updatedAt=Date.now(),localStorage.setItem(jt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(jt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(jt.currentSession,t)}clear(){localStorage.removeItem(jt.sessions),localStorage.removeItem(jt.currentSession)}}const ce=new Tj;function Oj(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[o,i]=f.useState([]),[l,s]=f.useState(null),[c,u]=f.useState(""),[p,d]=f.useState({isLoading:!1,error:null}),[h,x]=f.useState(n),[w,v]=f.useState(r),[S,g]=f.useState(.7),[m,y]=f.useState(1024),C=mt.useMemo(()=>{var $;const b=o.find(z=>z.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!b,messageCount:(($=b==null?void 0:b.messages)==null?void 0:$.length)||0}),b},[o,l]),N=mt.useMemo(()=>{const b=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",b.length,b.map($=>({id:$.id,role:$.role}))),b},[C==null?void 0:C.messages]);f.useEffect(()=>{const b=ce.getAllSessions();i(b);const $=ce.getCurrentSession();$?s($.id):b.length>0&&(s(b[0].id),ce.setCurrentSession(b[0].id))},[]);const E=f.useCallback(()=>{const b=ce.createSession(void 0,h,w),$=ce.getAllSessions();return i([...$]),s(b.id),ce.setCurrentSession(b.id),b.id},[h,w]),k=f.useCallback(b=>{s(b),ce.setCurrentSession(b)},[]),_=f.useCallback(b=>{ce.deleteSession(b);const $=ce.getAllSessions();i([...$]),l===b&&($.length>0?(s($[0].id),ce.setCurrentSession($[0].id)):s(null))},[l]),D=f.useCallback((b,$)=>{ce.updateSession(b,{title:$});const z=ce.getAllSessions();i([...z])},[]),T=f.useCallback(b=>{if(!l)return;ce.addMessageToSession(l,b);const $=ce.getAllSessions();i([...$])},[l]),L=f.useCallback(async()=>{var j,A;if(!c.trim()||p.isLoading)return;let b=l;b||(b=E());const $=c.trim();if(u(""),d({isLoading:!0,error:null}),b){ce.addMessageToSession(b,{role:"user",content:$});const O=ce.getAllSessions();i([...O])}const z=ce.getSession(b),V=(z==null?void 0:z.messages)&&z.messages.length>1;if(w&&!V&&b){ce.addMessageToSession(b,{role:"system",content:w});const O=ce.getAllSessions();i([...O])}try{const O=ce.getSession(b),W=((A=(j=O==null?void 0:O.messages)==null?void 0:j.filter(H=>H.role!=="system"))==null?void 0:A.map(H=>({role:H.role,content:H.content})))||[],P=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:$,messages:W,system_prompt:w||null,model_name:h,temperature:S,max_new_tokens:m})});if(!P.ok){const H=await P.json();throw new Error(H.detail||`HTTP error! status: ${P.status}`)}const F=await P.json();if(b){ce.addMessageToSession(b,{role:"assistant",content:F.content,thinking_content:F.thinking_content,model_used:F.model_used,supports_thinking:F.supports_thinking});const H=ce.getAllSessions();i([...H])}d({isLoading:!1,error:null})}catch(O){const W=O instanceof Error?O.message:"An error occurred";if(d({isLoading:!1,error:W}),b){ce.addMessageToSession(b,{role:"assistant",content:`Sorry, I encountered an error: ${W}`});const P=ce.getAllSessions();i([...P])}}},[c,p.isLoading,l,E,T,w,N.length,t,h,S,m]),M=f.useCallback(()=>{d({isLoading:!1,error:null})},[]),U=f.useCallback(()=>{ce.clear(),i([]),s(null)},[]);return{sessions:o,currentSession:C,currentSessionId:l,createNewSession:E,selectSession:k,deleteSession:_,renameSession:D,clearAllSessions:U,messages:N,input:c,setInput:u,sendMessage:L,stopGeneration:M,isLoading:p.isLoading,error:p.error,selectedModel:h,setSelectedModel:x,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:m,setMaxTokens:y}}function Ij(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:o,deleteSession:i,messages:l,input:s,setInput:c,sendMessage:u,stopGeneration:p,isLoading:d,selectedModel:h,setSelectedModel:x,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:m,setMaxTokens:y}=Oj(),[C,N]=f.useState(!1),[E,k]=f.useState(!1),[_,D]=f.useState(null),[T,L]=f.useState(!1),[M,U]=f.useState(null),[b,$]=f.useState([]),z=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Technical Writer",prompt:"You are a technical writer. Create clear, comprehensive documentation and explanations. Use proper formatting and structure your responses logically."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{name:"Research Assistant",prompt:"You are a research assistant. Provide detailed, well-researched responses with clear reasoning. Cite sources when relevant and present information objectively."},{name:"Teacher",prompt:"You are an experienced teacher. Explain concepts clearly, use examples, and break down complex topics into understandable parts. Be encouraging and patient."}],V=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];f.useEffect(()=>{O()},[]),f.useEffect(()=>{if(h&&!b.find(P=>P.model_name===h)){const P=b[0];P&&x(P.model_name)}},[b,h,x]),f.useEffect(()=>{(async()=>{if(!h||!b.length)return;const F=b.find(ee=>ee.model_name===h);if(!F)return;const H=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";if(F.type==="local"&&!F.is_loaded){U(F),L(!0);return}const pe=b.filter(ee=>ee.type==="local"&&ee.is_loaded&&ee.model_name!==h);for(const ee of pe)try{(await fetch(`${H}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ee.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ee.model_name}`)}catch(B){console.error(`Error auto-unloading model ${ee.model_name}:`,B)}pe.length>0&&O()})()},[h,b]);const j=async()=>{if(M){L(!1),D(M.model_name);try{const P=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";if((await fetch(`${P}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:M.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${M.model_name}`),O();else{console.error(`❌ Failed to load model: ${M.model_name}`);const H=b.find(pe=>pe.type==="api");H&&x(H.model_name)}}catch(P){console.error("Error loading model:",P);const F=b.find(H=>H.type==="api");F&&x(F.model_name)}finally{D(null),U(null)}}},A=()=>{L(!1),U(null);const P=b.find(F=>F.type==="api");P&&x(P.model_name)};f.useEffect(()=>{const P=async()=>{const F=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",H=b.filter(pe=>pe.type==="local"&&pe.is_loaded);for(const pe of H)try{await fetch(`${F}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:pe.model_name})}),console.log(`✅ Cleanup: unloaded ${pe.model_name}`)}catch(ee){console.error(`Error cleaning up model ${pe.model_name}:`,ee)}};return()=>{P()}},[b]);const O=async()=>{try{const P=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",F=await fetch(`${P}/models`);if(F.ok){const H=await F.json();if($(H.models),H.current_model&&h!==H.current_model)x(H.current_model);else if(!h&&H.models.length>0){const ee=H.models.find(B=>B.type==="api")||H.models[0];x(ee.model_name)}}}catch(P){console.error("Failed to fetch models:",P)}},W=P=>{c(P)};return a.jsxs("div",{className:"min-h-screen bg-background flex",children:[a.jsx("div",{className:` ${C?"translate-x-0":"-translate-x-full"} fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out lg:translate-x-0 lg:static lg:inset-0 `,children:a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),a.jsxs(oe,{onClick:r,size:"sm",children:[a.jsx(R1,{className:"h-4 w-4 mr-1"}),"New"]})]}),a.jsx("div",{className:"space-y-2",children:e.map(P=>a.jsxs(ke,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===P.id?"bg-accent border-primary":""}`,onClick:()=>o(P.id),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:P.title}),a.jsx(oe,{size:"sm",variant:"ghost",onClick:F=>{F.stopPropagation(),i(P.id)},className:"h-6 w-6 p-0",children:a.jsx(Km,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[P.messages.length," messages"]})]},P.id))})]})}),C&&a.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>N(!1)}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsxs("div",{className:"flex h-14 items-center px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>N(!C),className:"lg:hidden",children:C?a.jsx(E1,{className:"h-4 w-4"}):a.jsx(_1,{className:"h-4 w-4"})}),a.jsx(Un,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&a.jsxs(xe,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[a.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>N(!C),className:"hidden lg:flex flex-shrink-0",children:[a.jsx(v1,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),a.jsxs(oe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx(f1,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"View code"}),a.jsx("span",{className:"sm:hidden",children:"Code"})]}),a.jsxs(oe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx(G1,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),a.jsxs(oe,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx($1,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[a.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&a.jsx("div",{className:"p-6 border-b",children:a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{className:"text-base",children:"Start with a sample prompt"})}),a.jsx(Pe,{children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:V.map((P,F)=>a.jsx(oe,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>W(P.prompt),disabled:d,children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:P.title}),a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:P.description})]})},F))})})]})}),a.jsx(Tv,{messages:l.map(P=>({id:P.id,role:P.role,content:P.content,createdAt:new Date(P.timestamp)})),input:s,handleInputChange:P=>c(P.target.value),handleSubmit:async P=>{P.preventDefault(),!(!h||!b.find(F=>F.model_name===h))&&await u()},isGenerating:d,stop:p,className:"flex-1"})]}),a.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:a.jsxs("div",{className:"p-4 space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fc,{className:"h-4 w-4"}),a.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{className:"text-sm",children:"Model Selection"})}),a.jsxs(Pe,{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-xs font-medium mb-2",children:"Active Model"}),a.jsxs(Uk,{value:h||"",onValueChange:x,children:[a.jsx(Og,{className:"w-full",children:a.jsx(Vk,{placeholder:"Select a model...",children:h&&(()=>{const P=b.find(H=>H.model_name===h);if(!P)return h;const F=P.type==="api";return a.jsxs("div",{className:"flex items-center gap-2",children:[F?a.jsx(Sr,{className:"h-4 w-4 text-blue-500"}):P.supports_thinking?a.jsx(Bt,{className:"h-4 w-4 text-purple-500"}):a.jsx(zo,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{className:"truncate",children:P.name}),_===h?a.jsx(xe,{variant:"outline",className:"text-xs",children:"Loading..."}):a.jsx(xe,{variant:"outline",className:"text-xs",children:F?"API":P.is_loaded?"Loaded":"Available"})]})})()})}),a.jsxs(Dg,{children:[a.jsxs(lf,{children:[a.jsx($a,{children:"🌐 API Models"}),b.filter(P=>P.type==="api").map(P=>a.jsx(Fa,{value:P.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Sr,{className:"h-4 w-4 text-blue-500"}),a.jsx("span",{children:P.name}),a.jsx(xe,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},P.model_name))]}),a.jsxs(lf,{children:[a.jsx($a,{children:"💻 Local Models"}),b.filter(P=>P.type==="local").map(P=>a.jsx(Fa,{value:P.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[P.supports_thinking?a.jsx(Bt,{className:"h-4 w-4 text-purple-500"}):a.jsx(zo,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{children:P.name}),_===P.model_name?a.jsx(xe,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):P.is_loaded?a.jsx(xe,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):a.jsx(xe,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},P.model_name))]})]})]})]}),a.jsx("div",{className:"pt-2 border-t",children:a.jsx(oe,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:a.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[a.jsx(Ar,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{className:"text-sm",children:"Parameters"})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs(Ce,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),a.jsx(_a,{value:[S],onValueChange:P=>g(P[0]),min:0,max:2,step:.01,className:"mt-2",disabled:d}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),a.jsxs("div",{children:[a.jsxs(Ce,{className:"text-xs font-medium",children:["Max Tokens: ",m]}),a.jsx(_a,{value:[m],onValueChange:P=>y(P[0]),min:100,max:4096,step:100,className:"mt-2",disabled:d})]})]})]}),a.jsx(ke,{children:a.jsxs(qk,{open:E,onOpenChange:k,children:[a.jsx($e,{children:a.jsx(Jk,{asChild:!0,children:a.jsxs(oe,{variant:"ghost",className:"w-full justify-between p-0",disabled:d,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Un,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&a.jsx(xe,{variant:"secondary",className:"text-xs",children:"Custom"})]}),a.jsx($c,{className:`h-4 w-4 transition-transform ${E?"transform rotate-180":""}`})]})})}),a.jsx(ej,{children:a.jsxs(Pe,{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),a.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:z.map(P=>a.jsx(oe,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>v(P.prompt),disabled:d,children:P.name},P.name))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(Ce,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&a.jsxs(oe,{variant:"ghost",size:"sm",onClick:()=>v(""),className:"h-6 px-2 text-xs",disabled:d,children:[a.jsx(A1,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),a.jsx("textarea",{id:"system-prompt",value:w,onChange:P=>v(P.target.value),placeholder:"Enter custom system prompt to define how the model should behave...",className:"w-full min-h-[80px] text-xs p-2 border rounded-md bg-background",disabled:d}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),a.jsx(Rj,{open:T,onOpenChange:L,children:a.jsxs(jv,{children:[a.jsxs(Ev,{children:[a.jsxs(_v,{className:"flex items-center gap-2",children:[a.jsx(Um,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),a.jsx(bv,{asChild:!0,children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{children:["You're about to load ",a.jsx("strong",{children:M==null?void 0:M.name})," locally."]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(H1,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),a.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Storage:"})," ",M==null?void 0:M.size_gb]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"RAM:"})," ~",M==null?void 0:M.size_gb," (while running)"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:a.jsxs("div",{className:"text-sm text-blue-700",children:[a.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),a.jsx("p",{className:"mt-1",children:M==null?void 0:M.description}),(M==null?void 0:M.supports_thinking)&&a.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[a.jsx(Bt,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),a.jsxs(Pv,{children:[a.jsx(Mv,{onClick:A,children:"Cancel"}),a.jsx(Rv,{onClick:j,children:"Load Model"})]})]})})]})}function Lj(){const[e,t]=f.useState([]),[n,r]=f.useState(!0),[o,i]=f.useState(null);f.useEffect(()=>{l()},[]);const l=async()=>{try{const u=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",p=await fetch(`${u}/models`);if(p.ok){const d=await p.json();t(d.models)}}catch(u){console.error("Failed to fetch models:",u)}finally{r(!1)}},s=async u=>{i(u);try{const p=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";(await fetch(`${p}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(p){console.error("Failed to load model:",p)}finally{i(null)}},c=async u=>{try{const p=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";(await fetch(`${p}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(p){console.error("Failed to unload model:",p)}};return n?a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b",children:a.jsx("div",{className:"flex h-14 items-center px-6",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ar,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]})})}),a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Hm,{className:"h-8 w-8 animate-spin"})})]}):a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b",children:a.jsxs("div",{className:"flex h-14 items-center px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ar,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(oe,{variant:"outline",size:"sm",onClick:l,children:"Refresh"})})]})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsx(ke,{className:"bg-blue-50 border-blue-200",children:a.jsx(Pe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Wm,{className:"h-5 w-5 text-blue-600 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Load models to use them in the playground. Models are cached locally for faster access. Each model requires significant storage space and initial download time."})]})]})})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[a.jsx(Sr,{className:"h-5 w-5"}),"API Models",a.jsx(xe,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(u=>u.type==="api").map(u=>a.jsx(sf,{model:u,modelLoading:o,onLoad:s,onUnload:c},u.model_name))})]}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[a.jsx(Vm,{className:"h-5 w-5"}),"Local Models",a.jsx(xe,{variant:"outline",className:"text-xs",children:"Privacy-First"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(u=>u.type==="local").map(u=>a.jsx(sf,{model:u,modelLoading:o,onLoad:s,onUnload:c},u.model_name))})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{children:"Model Statistics"})}),a.jsx(Pe,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Available Models"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(u=>u.is_loaded).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(u=>u.supports_thinking).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function sf({model:e,modelLoading:t,onLoad:n,onUnload:r}){const o=e.type==="api";return a.jsxs(ke,{className:"relative",children:[a.jsx($e,{children:a.jsx("div",{className:"flex items-start justify-between",children:a.jsxs("div",{className:"flex items-center gap-3",children:[o?a.jsx(Sr,{className:"h-6 w-6 text-blue-500"}):e.supports_thinking?a.jsx(Bt,{className:"h-6 w-6 text-blue-500"}):a.jsx(zo,{className:"h-6 w-6 text-green-500"}),a.jsxs("div",{children:[a.jsx(We,{className:"text-lg",children:e.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[o?a.jsxs(xe,{variant:"default",className:"bg-blue-600",children:[a.jsx(Sr,{className:"h-3 w-3 mr-1"}),"API Model"]}):a.jsxs(xe,{variant:e.supports_thinking?"default":"secondary",children:[a.jsx(Vm,{className:"h-3 w-3 mr-1"}),e.supports_thinking?"Thinking Model":"Instruction Model"]}),e.is_loaded&&a.jsxs(xe,{variant:"outline",className:"text-green-600 border-green-600",children:[a.jsx(c1,{className:"h-3 w-3 mr-1"}),o?"Ready":"Loaded"]})]})]})]})})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),a.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[a.jsxs("span",{children:["Size: ",e.size_gb]}),!o&&a.jsx("span",{children:"Format: Safetensors"}),o&&a.jsx("span",{children:"Type: Cloud API"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Capabilities"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(xe,{variant:"outline",className:"text-xs",children:"Text Generation"}),a.jsx(xe,{variant:"outline",className:"text-xs",children:"Conversation"}),a.jsx(xe,{variant:"outline",className:"text-xs",children:"Code"}),e.supports_thinking&&a.jsx(xe,{variant:"outline",className:"text-xs",children:"Reasoning"}),o&&e.model_name.includes("vl")&&a.jsx(xe,{variant:"outline",className:"text-xs",children:"Vision"})]})]}),a.jsx("div",{className:"pt-2 border-t",children:e.is_loaded?a.jsxs("div",{className:"flex gap-2",children:[!o&&a.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>r(e.model_name),className:"flex-1",children:[a.jsx(Km,{className:"h-4 w-4 mr-2"}),"Unload"]}),a.jsx(oe,{size:"sm",className:"flex-1",asChild:!0,children:a.jsx("a",{href:"/playground",children:"Use in Playground"})})]}):a.jsx(oe,{onClick:()=>n(e.model_name),disabled:t===e.model_name,className:"w-full",size:"sm",children:t===e.model_name?a.jsxs(a.Fragment,{children:[a.jsx(Hm,{className:"h-4 w-4 mr-2 animate-spin"}),o?"Connecting...":"Loading..."]}):a.jsxs(a.Fragment,{children:[o?a.jsx(Sr,{className:"h-4 w-4 mr-2"}):a.jsx(Um,{className:"h-4 w-4 mr-2"}),o?"Connect":"Load Model"]})})})]})]})}var Vl="Switch",[Dj,Yj]=kn(Vl),[zj,$j]=Dj(Vl),Iv=f.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:l,disabled:s,value:c="on",onCheckedChange:u,form:p,...d}=e,[h,x]=f.useState(null),w=J(t,y=>x(y)),v=f.useRef(!1),S=h?p||!!h.closest("form"):!0,[g,m]=Or({prop:o,defaultProp:i??!1,onChange:u,caller:Vl});return a.jsxs(zj,{scope:n,checked:g,disabled:s,children:[a.jsx(G.button,{type:"button",role:"switch","aria-checked":g,"aria-required":l,"data-state":$v(g),"data-disabled":s?"":void 0,disabled:s,value:c,...d,ref:w,onClick:Q(e.onClick,y=>{m(C=>!C),S&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),S&&a.jsx(zv,{control:h,bubbles:!v.current,name:r,value:c,checked:g,required:l,disabled:s,form:p,style:{transform:"translateX(-100%)"}})]})});Iv.displayName=Vl;var Lv="SwitchThumb",Dv=f.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=$j(Lv,n);return a.jsx(G.span,{"data-state":$v(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Dv.displayName=Lv;var Fj="SwitchBubbleInput",zv=f.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const l=f.useRef(null),s=J(l,i),c=Vc(n),u=Wc(t);return f.useEffect(()=>{const p=l.current;if(!p)return;const d=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&x){const w=new Event("click",{bubbles:r});x.call(p,n),p.dispatchEvent(w)}},[c,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});zv.displayName=Fj;function $v(e){return e?"checked":"unchecked"}var Fv=Iv,Bj=Dv;const Et=f.forwardRef(({className:e,...t},n)=>a.jsx(Fv,{className:X("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:a.jsx(Bj,{className:X("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Et.displayName=Fv.displayName;function Uj(){return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b",children:a.jsx("div",{className:"flex h-14 items-center px-6",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fc,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs(ke,{children:[a.jsx($e,{children:a.jsxs(We,{className:"flex items-center gap-2",children:[a.jsx(L1,{className:"h-5 w-5"}),"Server Configuration"]})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Backend URL"}),a.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Frontend URL"}),a.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]}),a.jsx("div",{className:"pt-2 border-t",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Auto-connect on startup"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically connect to backend when app starts"})]}),a.jsx(Et,{defaultChecked:!0})]})})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsxs(We,{className:"flex items-center gap-2",children:[a.jsx(Bt,{className:"h-5 w-5"}),"Model Preferences"]})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Auto-load last used model"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically load the last used model on startup"})]}),a.jsx(Et,{})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Show model thinking process"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Display thinking content for supported models"})]}),a.jsx(Et,{defaultChecked:!0})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Confirm model loading"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Show confirmation dialog before downloading models"})]}),a.jsx(Et,{defaultChecked:!0})]})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsxs(We,{className:"flex items-center gap-2",children:[a.jsx(k1,{className:"h-5 w-5"}),"Interface"]})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Dark mode"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Use dark theme for the interface"})]}),a.jsx(Et,{})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Compact mode"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Use smaller spacing for more content"})]}),a.jsx(Et,{})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Show sample prompts"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Display quick start prompts in playground"})]}),a.jsx(Et,{defaultChecked:!0})]})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsxs(We,{className:"flex items-center gap-2",children:[a.jsx(ka,{className:"h-5 w-5"}),"Privacy & Data"]})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(ka,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),a.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Save conversation history"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Store conversations locally for reference"})]}),a.jsx(Et,{})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Save system prompts"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Remember custom system prompts"})]}),a.jsx(Et,{defaultChecked:!0})]})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsxs(We,{className:"flex items-center gap-2",children:[a.jsx(Wm,{className:"h-5 w-5"}),"System Information"]})}),a.jsxs(Pe,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Platform"}),a.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[a.jsx(xe,{variant:"outline",children:"Local"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),a.jsxs("div",{children:[a.jsx(Ce,{className:"text-sm font-medium",children:"Version"}),a.jsx("div",{className:"mt-1",children:a.jsx(xe,{variant:"outline",children:"v1.0.0"})})]})]}),a.jsx("div",{className:"pt-2 border-t",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Storage Location"}),a.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:"~/.edge-llm/models/"})]}),a.jsx(oe,{variant:"outline",size:"sm",children:"Open Folder"})]})})]})]}),a.jsxs(ke,{children:[a.jsx($e,{children:a.jsx(We,{children:"Actions"})}),a.jsx(Pe,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(oe,{variant:"outline",children:"Export Settings"}),a.jsx(oe,{variant:"outline",children:"Import Settings"}),a.jsx(oe,{variant:"outline",children:"Reset to Defaults"})]})})]})]})})]})}function Vj(){return a.jsx(hw,{children:a.jsx(aw,{children:a.jsxs(nr,{path:"/",element:a.jsx(eS,{}),children:[a.jsx(nr,{index:!0,element:a.jsx(dS,{})}),a.jsx(nr,{path:"playground",element:a.jsx(Ij,{})}),a.jsx(nr,{path:"models",element:a.jsx(Lj,{})}),a.jsx(nr,{path:"settings",element:a.jsx(Uj,{})})]})})})}Es.createRoot(document.getElementById("root")).render(a.jsx(mt.StrictMode,{children:a.jsx(Vj,{})})); //# sourceMappingURL=index-0ba1003b.js.map