diff --git "a/static/assets/index-b709415f.js" "b/static/assets/index-b709415f.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-b709415f.js" @@ -0,0 +1,325 @@ +function a1(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ml=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vh={exports:{}},ys={},Hh={exports:{}},Z={};/** + * @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 Io=Symbol.for("react.element"),u1=Symbol.for("react.portal"),c1=Symbol.for("react.fragment"),d1=Symbol.for("react.strict_mode"),f1=Symbol.for("react.profiler"),p1=Symbol.for("react.provider"),h1=Symbol.for("react.context"),m1=Symbol.for("react.forward_ref"),g1=Symbol.for("react.suspense"),y1=Symbol.for("react.memo"),v1=Symbol.for("react.lazy"),tf=Symbol.iterator;function x1(e){return e===null||typeof e!="object"?null:(e=tf&&e[tf]||e["@@iterator"],typeof e=="function"?e:null)}var Wh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kh=Object.assign,Gh={};function Si(e,t,n){this.props=e,this.context=t,this.refs=Gh,this.updater=n||Wh}Si.prototype.isReactComponent={};Si.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")};Si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yh(){}Yh.prototype=Si.prototype;function gc(e,t,n){this.props=e,this.context=t,this.refs=Gh,this.updater=n||Wh}var yc=gc.prototype=new Yh;yc.constructor=gc;Kh(yc,Si.prototype);yc.isPureReactComponent=!0;var nf=Array.isArray,Qh=Object.prototype.hasOwnProperty,vc={current:null},qh={key:!0,ref:!0,__self:!0,__source:!0};function Xh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)Qh.call(t,r)&&!qh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,A=_[G];if(0>>1;Gi(de,k))Qi(K,de)?(_[G]=K,_[Q]=k,G=Q):(_[G]=de,_[Y]=k,G=Y);else if(Qi(K,k))_[G]=K,_[Q]=k,G=Q;else break e}}return z}function i(_,z){var k=_.sortIndex-z.sortIndex;return k!==0?k:_.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],f=1,d=null,h=3,p=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(_){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=_)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function b(_){if(y=!1,x(_),!w)if(n(a)!==null)w=!0,U(N);else{var z=n(u);z!==null&&H(b,z.startTime-_)}}function N(_,z){w=!1,y&&(y=!1,m(R),R=-1),p=!0;var k=h;try{for(x(z),d=n(a);d!==null&&(!(d.expirationTime>z)||_&&!M());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var A=G(d.expirationTime<=z);z=e.unstable_now(),typeof A=="function"?d.callback=A:d===n(a)&&r(a),x(z)}else r(a);d=n(a)}if(d!==null)var C=!0;else{var Y=n(u);Y!==null&&H(b,Y.startTime-z),C=!1}return C}finally{d=null,h=k,p=!1}}var E=!1,j=null,R=-1,B=5,O=-1;function M(){return!(e.unstable_now()-O_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(_){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var k=h;h=z;try{return _()}finally{h=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var k=h;h=_;try{return z()}finally{h=k}},e.unstable_scheduleCallback=function(_,z,k){var G=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0G?(_.sortIndex=k,t(u,_),n(a)===null&&_===n(u)&&(y?(m(R),R=-1):y=!0,H(b,k-G))):(_.sortIndex=A,t(a,_),w||p||(w=!0,U(N))),_},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(_){var z=h;return function(){var k=h;h=z;try{return _.apply(this,arguments)}finally{h=k}}}})(nm);tm.exports=nm;var R1=tm.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 T1=g,wt=R1;function L(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"),Wa=Object.prototype.hasOwnProperty,A1=/^[: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]*$/,of={},lf={};function I1(e){return Wa.call(lf,e)?!0:Wa.call(of,e)?!1:A1.test(e)?lf[e]=!0:(of[e]=!0,!1)}function M1(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 O1(e,t,n,r){if(t===null||typeof t>"u"||M1(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 nt(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new nt(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){He[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sc=/[\-:]([a-z])/g;function kc(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(Sc,kc);He[t]=new nt(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(Sc,kc);He[t]=new nt(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(Sc,kc);He[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cc(e,t,n,r){var i=He.hasOwnProperty(t)?He[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{Zs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ki(e):""}function L1(e){switch(e.tag){case 5:return Ki(e.type);case 16:return Ki("Lazy");case 13:return Ki("Suspense");case 19:return Ki("SuspenseList");case 0:case 2:case 15:return e=ea(e.type,!1),e;case 11:return e=ea(e.type.render,!1),e;case 1:return e=ea(e.type,!0),e;default:return""}}function Qa(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 $r:return"Fragment";case Br:return"Portal";case Ka:return"Profiler";case bc:return"StrictMode";case Ga:return"Suspense";case Ya:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case om:return(e.displayName||"Context")+".Consumer";case im:return(e._context.displayName||"Context")+".Provider";case Ec:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nc:return t=e.displayName||null,t!==null?t:Qa(e.type)||"Memo";case Rn:t=e._payload,e=e._init;try{return Qa(e(t))}catch{}}return null}function D1(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 Qa(t);case 8:return t===bc?"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 Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z1(e){var t=sm(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 i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.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 Ko(e){e._valueTracker||(e._valueTracker=z1(e))}function am(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ol(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 qa(e,t){var n=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function af(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(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 um(e,t){t=t.checked,t!=null&&Cc(e,"checked",t,!1)}function Xa(e,t){um(e,t);var n=Kn(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")?Ja(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ja(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uf(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 Ja(e,t,n){(t!=="number"||Ol(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gi=Array.isArray;function Jr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Go.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function co(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={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},F1=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){F1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function pm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function hm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var B1=Pe({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 tu(e,t){if(t){if(B1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function nu(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 ru=null;function jc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var iu=null,Zr=null,ei=null;function ff(e){if(e=Lo(e)){if(typeof iu!="function")throw Error(L(280));var t=e.stateNode;t&&(t=ks(t),iu(e.stateNode,e.type,t))}}function mm(e){Zr?ei?ei.push(e):ei=[e]:Zr=e}function gm(){if(Zr){var e=Zr,t=ei;if(ei=Zr=null,ff(e),t)for(e=0;e>>=0,e===0?32:31-(X1(e)/J1|0)|0}var Yo=64,Qo=4194304;function Yi(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 Fl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Yi(s):(o&=l,o!==0&&(r=Yi(o)))}else l=n&~i,l!==0?r=Yi(l):o!==0&&(r=Yi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&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 Mo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function nw(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=Zi),Sf=String.fromCharCode(32),kf=!1;function Lm(e,t){switch(e){case"keyup":return Rw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ur=!1;function Aw(e,t){switch(e){case"compositionend":return Dm(t);case"keypress":return t.which!==32?null:(kf=!0,Sf);case"textInput":return e=t.data,e===Sf&&kf?null:e;default:return null}}function Iw(e,t){if(Ur)return e==="compositionend"||!Oc&&Lm(e,t)?(e=Mm(),wl=Ac=Mn=null,Ur=!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=Nf(n)}}function $m(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$m(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Um(){for(var e=window,t=Ol();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ol(e.document)}return t}function Lc(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 Uw(e){var t=Um(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$m(n.ownerDocument.documentElement,n)){if(r!==null&&Lc(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 i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=jf(n,o);var l=jf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>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,Vr=null,cu=null,to=null,du=!1;function Pf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;du||Vr==null||Vr!==Ol(r)||(r=Vr,"selectionStart"in r&&Lc(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}),to&&yo(to,r)||(to=r,r=Ul(cu,"onSelect"),0Kr||(e.current=yu[Kr],yu[Kr]=null,Kr--)}function ve(e,t){Kr++,yu[Kr]=e.current,e.current=t}var Gn={},Qe=Xn(Gn),st=Xn(!1),yr=Gn;function di(e,t){var n=e.type.contextTypes;if(!n)return Gn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function at(e){return e=e.childContextTypes,e!=null}function Hl(){Ce(st),Ce(Qe)}function Of(e,t,n){if(Qe.current!==Gn)throw Error(L(168));ve(Qe,t),ve(st,n)}function Xm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(L(108,D1(e)||"Unknown",i));return Pe({},n,r)}function Wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gn,yr=Qe.current,ve(Qe,e),ve(st,st.current),!0}function Lf(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Xm(e,t,yr),r.__reactInternalMemoizedMergedChildContext=e,Ce(st),Ce(Qe),ve(Qe,e)):Ce(st),ve(st,n)}var cn=null,Cs=!1,ha=!1;function Jm(e){cn===null?cn=[e]:cn.push(e)}function eS(e){Cs=!0,Jm(e)}function Jn(){if(!ha&&cn!==null){ha=!0;var e=0,t=he;try{var n=cn;for(he=1;e>=l,i-=l,dn=1<<32-Ft(t)+i|n<R?(B=j,j=null):B=j.sibling;var O=h(m,j,x[R],b);if(O===null){j===null&&(j=B);break}e&&j&&O.alternate===null&&t(m,j),v=o(O,v,R),E===null?N=O:E.sibling=O,E=O,j=B}if(R===x.length)return n(m,j),be&&lr(m,R),N;if(j===null){for(;RR?(B=j,j=null):B=j.sibling;var M=h(m,j,O.value,b);if(M===null){j===null&&(j=B);break}e&&j&&M.alternate===null&&t(m,j),v=o(M,v,R),E===null?N=M:E.sibling=M,E=M,j=B}if(O.done)return n(m,j),be&&lr(m,R),N;if(j===null){for(;!O.done;R++,O=x.next())O=d(m,O.value,b),O!==null&&(v=o(O,v,R),E===null?N=O:E.sibling=O,E=O);return be&&lr(m,R),N}for(j=r(m,j);!O.done;R++,O=x.next())O=p(j,m,R,O.value,b),O!==null&&(e&&O.alternate!==null&&j.delete(O.key===null?R:O.key),v=o(O,v,R),E===null?N=O:E.sibling=O,E=O);return e&&j.forEach(function(P){return t(m,P)}),be&&lr(m,R),N}function S(m,v,x,b){if(typeof x=="object"&&x!==null&&x.type===$r&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Wo:e:{for(var N=x.key,E=v;E!==null;){if(E.key===N){if(N=x.type,N===$r){if(E.tag===7){n(m,E.sibling),v=i(E,x.props.children),v.return=m,m=v;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Rn&&Ff(N)===E.type){n(m,E.sibling),v=i(E,x.props),v.ref=Fi(m,E,x),v.return=m,m=v;break e}n(m,E);break}else t(m,E);E=E.sibling}x.type===$r?(v=mr(x.props.children,m.mode,b,x.key),v.return=m,m=v):(b=Pl(x.type,x.key,x.props,null,m.mode,b),b.ref=Fi(m,v,x),b.return=m,m=b)}return l(m);case Br:e:{for(E=x.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(m,v.sibling),v=i(v,x.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=ka(x,m.mode,b),v.return=m,m=v}return l(m);case Rn:return E=x._init,S(m,v,E(x._payload),b)}if(Gi(x))return w(m,v,x,b);if(Mi(x))return y(m,v,x,b);nl(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(m,v.sibling),v=i(v,x),v.return=m,m=v):(n(m,v),v=Sa(x,m.mode,b),v.return=m,m=v),l(m)):n(m,v)}return S}var pi=ng(!0),rg=ng(!1),Yl=Xn(null),Ql=null,Qr=null,Bc=null;function $c(){Bc=Qr=Ql=null}function Uc(e){var t=Yl.current;Ce(Yl),e._currentValue=t}function wu(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 ni(e,t){Ql=e,Bc=Qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(Bc!==e)if(e={context:e,memoizedValue:t,next:null},Qr===null){if(Ql===null)throw Error(L(308));Qr=e,Ql.dependencies={lanes:0,firstContext:e}}else Qr=Qr.next=e;return t}var dr=null;function Vc(e){dr===null?dr=[e]:dr.push(e)}function ig(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Vc(t)):(n.next=i.next,i.next=n),t.interleaved=n,yn(e,r)}function yn(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 Tn=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function og(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 pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,yn(e,n)}return i=r.interleaved,i===null?(t.next=t,Vc(r)):(t.next=i.next,i.next=t),r.interleaved=t,yn(e,n)}function kl(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,_c(e,n)}}function Bf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=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};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 ql(e,t,n,r){var i=e.updateQueue;Tn=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,f=u=a=null,s=o;do{var h=s.lane,p=s.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(h=t,p=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){d=w.call(p,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,h=typeof w=="function"?w.call(p,d,h):w,h==null)break e;d=Pe({},d,h);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,a=d):f=f.next=p,l|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);wr|=l,e.lanes=l,e.memoizedState=d}}function $f(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ga.transition;ga.transition={};try{e(!1),t()}finally{he=n,ga.transition=r}}function kg(){return Rt().memoizedState}function iS(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cg(e))bg(t,n);else if(n=ig(e,t,n,r),n!==null){var i=et();Bt(n,e,r,i),Eg(n,t,r)}}function oS(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cg(e))bg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,$t(s,l)){var a=t.interleaved;a===null?(i.next=i,Vc(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=ig(e,t,i,r),n!==null&&(i=et(),Bt(n,e,r,i),Eg(n,t,r))}}function Cg(e){var t=e.alternate;return e===je||t!==null&&t===je}function bg(e,t){no=Jl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Eg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_c(e,n)}}var Zl={readContext:_t,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},lS={readContext:_t,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:Vf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bl(4194308,4,yg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return bl(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();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=iS.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:Uf,useDebugValue:Jc,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=Uf(!1),t=e[0];return e=rS.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=Yt();if(be){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),$e===null)throw Error(L(349));xr&30||ug(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Vf(dg.bind(null,r,o,e),[e]),r.flags|=2048,Eo(9,cg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Yt(),t=$e.identifierPrefix;if(be){var n=fn,r=dn;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,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[qt]=t,e[wo]=r,Og(e,t,!1,!1),t.stateNode=e;e:{switch(l=nu(n,r),n){case"dialog":ke("cancel",e),ke("close",e),i=r;break;case"iframe":case"object":case"embed":ke("load",e),i=r;break;case"video":case"audio":for(i=0;igi&&(t.flags|=128,r=!0,Bi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!be)return Ge(t),null}else 2*Re()-o.renderingStartTime>gi&&n!==1073741824&&(t.flags|=128,r=!0,Bi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Re(),t.sibling=null,n=Ne.current,ve(Ne,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return id(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function hS(e,t){switch(zc(t),t.tag){case 1:return at(t.type)&&Hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Ce(st),Ce(Qe),Gc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kc(t),null;case 13:if(Ce(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Ne),null;case 4:return hi(),null;case 10:return Uc(t.type._context),null;case 22:case 23:return id(),null;case 24:return null;default:return null}}var il=!1,Ye=!1,mS=typeof WeakSet=="function"?WeakSet:Set,W=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function _u(e,t,n){try{n()}catch(r){_e(e,t,r)}}var ep=!1;function gS(e,t){if(fu=Bl,e=Um(),Lc(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 i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===i&&(s=l),h===o&&++f===r&&(a=l),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(pu={focusedElem:e,selectionRange:n},Bl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;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 y=w.memoizedProps,S=w.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ot(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(b){_e(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=ep,ep=!1,w}function ro(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&_u(t,n,o)}i=i.next}while(i!==r)}}function Ns(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 Ru(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 zg(e){var t=e.alternate;t!==null&&(e.alternate=null,zg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[wo],delete t[gu],delete t[Jw],delete t[Zw])),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 Fg(e){return e.tag===5||e.tag===3||e.tag===4}function tp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fg(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 Tu(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=Vl));else if(r!==4&&(e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}function Au(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(Au(e,t,n),e=e.sibling;e!==null;)Au(e,t,n),e=e.sibling}var Ue=null,Dt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)Bg(e,t,n),n=n.sibling}function Bg(e,t,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(vs,n)}catch{}switch(n.tag){case 5:Ye||qr(n,t);case 6:var r=Ue,i=Dt;Ue=null,Nn(e,t,n),Ue=r,Dt=i,Ue!==null&&(Dt?(e=Ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ue.removeChild(n.stateNode));break;case 18:Ue!==null&&(Dt?(e=Ue,n=n.stateNode,e.nodeType===8?pa(e.parentNode,n):e.nodeType===1&&pa(e,n),mo(e)):pa(Ue,n.stateNode));break;case 4:r=Ue,i=Dt,Ue=n.stateNode.containerInfo,Dt=!0,Nn(e,t,n),Ue=r,Dt=i;break;case 0:case 11:case 14:case 15:if(!Ye&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&_u(n,t,l),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Ye&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){_e(n,t,s)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,Nn(e,t,n),Ye=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function np(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mS),t.forEach(function(r){var i=ES.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vS(r/1960))-r,10e?16:e,On===null)var r=!1;else{if(e=On,On=null,ns=0,ue&6)throw Error(L(331));var i=ue;for(ue|=4,W=e.current;W!==null;){var o=W,l=o.child;if(W.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aRe()-nd?hr(e,0):td|=n),ut(e,t)}function Yg(e,t){t===0&&(e.mode&1?(t=Qo,Qo<<=1,!(Qo&130023424)&&(Qo=4194304)):t=1);var n=et();e=yn(e,t),e!==null&&(Mo(e,t,n),ut(e,n))}function bS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yg(e,n)}function ES(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),Yg(e,n)}var Qg;Qg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,fS(e,t,n);lt=!!(e.flags&131072)}else lt=!1,be&&t.flags&1048576&&Zm(t,Gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;El(e,t),e=t.pendingProps;var i=di(t,Qe.current);ni(t,n),i=Qc(null,t,r,e,i,n);var o=qc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(r)?(o=!0,Wl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Hc(t),i.updater=Es,t.stateNode=i,i._reactInternals=t,ku(t,r,e,n),t=Eu(null,t,r,!0,o,n)):(t.tag=0,be&&o&&Dc(t),Je(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(El(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=jS(r),e=Ot(r,e),i){case 0:t=bu(null,t,r,e,n);break e;case 1:t=Xf(null,t,r,e,n);break e;case 11:t=Qf(null,t,r,e,n);break e;case 14:t=qf(null,t,r,Ot(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),bu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),Xf(e,t,r,i,n);case 3:e:{if(Ag(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,i=o.element,og(e,t),ql(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(L(423)),t),t=Jf(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(L(424)),t),t=Jf(e,t,r,n,i);break e}else for(gt=Bn(t.stateNode.containerInfo.firstChild),vt=t,be=!0,zt=null,n=rg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fi(),r===i){t=vn(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return lg(t),e===null&&xu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,hu(r,i)?l=null:o!==null&&hu(r,o)&&(t.flags|=32),Tg(e,t),Je(e,t,l,n),t.child;case 6:return e===null&&xu(t),null;case 13:return Ig(e,t,n);case 4:return Wc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),Qf(e,t,r,i,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,ve(Yl,r._currentValue),r._currentValue=l,o!==null)if($t(o.value,l)){if(o.children===i.children&&!st.current){t=vn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=pn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),wu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(L(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),wu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Je(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ni(t,n),i=_t(i),r=r(i),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,i=Ot(r,t.pendingProps),i=Ot(r.type,i),qf(e,t,r,i,n);case 15:return _g(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ot(r,i),El(e,t),t.tag=1,at(r)?(e=!0,Wl(t)):e=!1,ni(t,n),Ng(t,r,i),ku(t,r,i,n),Eu(null,t,r,!0,e,n);case 19:return Mg(e,t,n);case 22:return Rg(e,t,n)}throw Error(L(156,t.tag))};function qg(e,t){return Cm(e,t)}function NS(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 jt(e,t,n,r){return new NS(e,t,n,r)}function ld(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jS(e){if(typeof e=="function")return ld(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ec)return 11;if(e===Nc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=jt(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 Pl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")ld(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case $r:return mr(n.children,i,o,t);case bc:l=8,i|=8;break;case Ka:return e=jt(12,n,t,i|2),e.elementType=Ka,e.lanes=o,e;case Ga:return e=jt(13,n,t,i),e.elementType=Ga,e.lanes=o,e;case Ya:return e=jt(19,n,t,i),e.elementType=Ya,e.lanes=o,e;case lm:return Ps(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case im:l=10;break e;case om:l=9;break e;case Ec:l=11;break e;case Nc:l=14;break e;case Rn:l=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=jt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function mr(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function Ps(e,t,n,r){return e=jt(22,e,r,t),e.elementType=lm,e.lanes=n,e.stateNode={isHidden:!1},e}function Sa(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function ka(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PS(e,t,n,r,i){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=na(0),this.expirationTimes=na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sd(e,t,n,r,i,o,l,s,a){return e=new PS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hc(o),e}function _S(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ey)}catch(e){console.error(e)}}ey(),em.exports=St;var bi=em.exports;const MS=gs(bi);var cp=bi;Ha.createRoot=cp.createRoot,Ha.hydrateRoot=cp.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 jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ty(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function LS(){return Math.random().toString(36).substr(2,8)}function fp(e,t){return{usr:e.state,key:e.key,idx:t}}function Du(e,t,n,r){return n===void 0&&(n=null),jo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ei(t):t,{state:n,key:t&&t.key||r||LS()})}function os(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 Ei(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 DS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Ln.Pop,a=null,u=f();u==null&&(u=0,l.replaceState(jo({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Ln.Pop;let S=f(),m=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:m})}function h(S,m){s=Ln.Push;let v=Du(y.location,S,m);n&&n(v,S),u=f()+1;let x=fp(v,u),b=y.createHref(v);try{l.pushState(x,"",b)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(b)}o&&a&&a({action:s,location:y.location,delta:1})}function p(S,m){s=Ln.Replace;let v=Du(y.location,S,m);n&&n(v,S),u=f();let x=fp(v,u),b=y.createHref(v);l.replaceState(x,"",b),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let m=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof S=="string"?S:os(S);return v=v.replace(/ $/,"%20"),Me(m,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,m)}let y={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(dp,d),a=S,()=>{i.removeEventListener(dp,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let m=w(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:p,go(S){return l.go(S)}};return y}var pp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pp||(pp={}));function zS(e,t,n){return n===void 0&&(n="/"),FS(e,t,n,!1)}function FS(e,t,n,r){let i=typeof t=="string"?Ei(t):t,o=dd(i.pathname||"/",n);if(o==null)return null;let l=ny(e);BS(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Me(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Wn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Me(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ny(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:GS(u,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of ry(o.path))i(o,l,a)}),t}function ry(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=ry(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function BS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:YS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const $S=/^:[\w-]+$/,US=3,VS=2,HS=1,WS=10,KS=-2,hp=e=>e==="*";function GS(e,t){let n=e.split("/"),r=n.length;return n.some(hp)&&(r+=KS),t&&(r+=VS),n.filter(i=>!hp(i)).reduce((i,o)=>i+($S.test(o)?US:o===""?HS:WS),r)}function YS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function QS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let y=s[d]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[d];return p&&!w?u[h]=void 0:u[h]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function qS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ty(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function XS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ty(!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 dd(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 JS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ei(e):e;return{pathname:n?n.startsWith("/")?n:ZS(n,t):t,search:nk(r),hash:rk(i)}}function ZS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Ca(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 ek(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function iy(e,t){let n=ek(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function oy(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ei(e):(i=jo({},e),Me(!i.pathname||!i.pathname.includes("?"),Ca("?","pathname","search",i)),Me(!i.pathname||!i.pathname.includes("#"),Ca("#","pathname","hash",i)),Me(!i.search||!i.search.includes("#"),Ca("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.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;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let a=JS(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Wn=e=>e.join("/").replace(/\/\/+/g,"/"),tk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ik(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ly=["post","put","patch","delete"];new Set(ly);const ok=["get",...ly];new Set(ok);/** + * 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 Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=oy(u,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Wn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const ck=g.createContext(null);function dk(e){let t=g.useContext(Zn).outlet;return t&&g.createElement(ck.Provider,{value:e},t)}function uy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Rr),{matches:i}=g.useContext(Zn),{pathname:o}=Fo(),l=JSON.stringify(iy(i,r.v7_relativeSplatPath));return g.useMemo(()=>oy(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function fk(e,t){return pk(e,t)}function pk(e,t,n,r){zo()||Me(!1);let{navigator:i}=g.useContext(Rr),{matches:o}=g.useContext(Zn),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Fo(),f;if(t){var d;let S=typeof t=="string"?Ei(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Me(!1),f=S}else f=u;let h=f.pathname||"/",p=h;if(a!=="/"){let S=a.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=zS(e,{pathname:p}),y=vk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Wn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Wn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?g.createElement(Is.Provider,{value:{location:Po({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ln.Pop}},y):y}function hk(){let e=kk(),t=ik(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,o)}const mk=g.createElement(hk,null);class gk extends g.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?g.createElement(Zn.Provider,{value:this.props.routeContext},g.createElement(sy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yk(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(fd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Zn.Provider,{value:t},r)}function vk(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let f=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||Me(!1),l=l.slice(0,Math.min(l.length,f+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,d,h)=>{let p,w=!1,y=null,S=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||mk,a&&(u<0&&h===0?(bk("route-fallback",!1),w=!0,S=null):u===h&&(w=!0,S=d.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,h+1)),v=()=>{let x;return p?x=y:w?x=S:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,g.createElement(yk,{match:d,routeContext:{outlet:f,matches:m,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(gk,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var cy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(cy||{}),ls=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}(ls||{});function xk(e){let t=g.useContext(fd);return t||Me(!1),t}function wk(e){let t=g.useContext(lk);return t||Me(!1),t}function Sk(e){let t=g.useContext(Zn);return t||Me(!1),t}function dy(e){let t=Sk(),n=t.matches[t.matches.length-1];return n.route.id||Me(!1),n.route.id}function kk(){var e;let t=g.useContext(sy),n=wk(ls.UseRouteError),r=dy(ls.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Ck(){let{router:e}=xk(cy.UseNavigateStable),t=dy(ls.UseNavigateStable),n=g.useRef(!1);return ay(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Po({fromRouteId:t},o)))},[e,t])}const gp={};function bk(e,t,n){!t&&!gp[e]&&(gp[e]=!0)}function Ek(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 Nk(e){return dk(e.context)}function Fr(e){Me(!1)}function jk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ln.Pop,navigator:o,static:l=!1,future:s}=e;zo()&&Me(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:o,static:l,future:Po({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Ei(r));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:w="default"}=r,y=g.useMemo(()=>{let S=dd(f,a);return S==null?null:{location:{pathname:S,search:d,hash:h,state:p,key:w},navigationType:i}},[a,f,d,h,p,w,i]);return y==null?null:g.createElement(Rr.Provider,{value:u},g.createElement(Is.Provider,{children:n,value:y}))}function Pk(e){let{children:t,location:n}=e;return fk(zu(t),n)}new Promise(()=>{});function zu(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let o=[...t,i];if(r.type===g.Fragment){n.push.apply(n,zu(r.props.children,o));return}r.type!==Fr&&Me(!1),!r.props.index||!r.props.children||Me(!1);let l={id:r.props.id||o.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=zu(r.props.children,o)),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 Fu(){return Fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Rk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Tk(e,t){return e.button===0&&(!t||t==="_self")&&!Rk(e)}const Ak=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ik="6";try{window.__reactRouterVersion=Ik}catch{}const Mk="startTransition",yp=wc[Mk];function Ok(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=OS({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=g.useCallback(d=>{u&&yp?yp(()=>a(d)):a(d)},[a,u]);return g.useLayoutEffect(()=>l.listen(f),[l,f]),g.useEffect(()=>Ek(r),[r]),g.createElement(jk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const Lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ar=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:f,viewTransition:d}=t,h=_k(t,Ak),{basename:p}=g.useContext(Rr),w,y=!1;if(typeof u=="string"&&Dk.test(u)&&(w=u,Lk))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=dd(b.pathname,p);b.origin===x.origin&&N!=null?u=N+b.search+b.hash:y=!0}catch{}let S=sk(u,{relative:i}),m=zk(u,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function v(x){r&&r(x),x.defaultPrevented||m(x)}return g.createElement("a",Fu({},h,{href:w||S,onClick:y||o?r:v,ref:n,target:a}))});var vp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vp||(vp={}));var xp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(xp||(xp={}));function zk(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=ak(),u=Fo(),f=uy(e,{relative:l});return g.useCallback(d=>{if(Tk(d,n)){d.preventDefault();let h=r!==void 0?r:os(u)===os(f);a(e,{replace:h,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,f,r,i,n,e,o,l,s])}function fy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=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 i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var gy="!";function Kk(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,f,d=0;du?f-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function Gk(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var i=r[0]==="[";i?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function Yk(e){return{cache:Wk(e.cacheSize),splitModifiers:Kk(e),...Bk(e)}}var Qk=/\s+/;function qk(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(Qk).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,h=r(d?f.substring(0,d):f),p=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:l};if(h=r(f),!h)return{isTailwindClass:!1,originalClassName:l};p=!1}var w=Gk(a).join(":"),y=u?w+gy:w;return{isTailwindClass:!0,modifierId:y,classGroupId:h,originalClassName:l,hasPostfixModifier:p}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,f=s+a;return o.has(f)?!1:(o.add(f),i(a,u).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function Xk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Cp=e=>{const t=hC(e);return t.charAt(0).toUpperCase()+t.slice(1)},xy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),mC=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 gC={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 yC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...gC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xy("lucide",i),...!o&&!mC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,f])=>g.createElement(u,f)),...Array.isArray(o)?o:[o]]));/** + * @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 le=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(yC,{ref:o,iconNode:t,className:xy(`lucide-${pC(Cp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Cp(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 vC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xC=le("arrow-right",vC);/** + * @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 wC=[["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"}]],yi=le("book-open",wC);/** + * @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 SC=[["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"}]],wy=le("bot",SC);/** + * @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 kC=[["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"}]],hn=le("brain",kC);/** + * @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 CC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bC=le("check",CC);/** + * @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 EC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hd=le("chevron-down",EC);/** + * @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 NC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jC=le("chevron-up",NC);/** + * @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 PC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],_C=le("circle-check-big",PC);/** + * @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 RC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ii=le("cloud",RC);/** + * @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 TC=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],AC=le("code",TC);/** + * @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 IC=[["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"}]],Sy=le("cpu",IC);/** + * @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 MC=[["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"}]],ky=le("download",MC);/** + * @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 OC=[["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"}]],Cy=le("hard-drive",OC);/** + * @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 LC=[["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"}]],DC=le("history",LC);/** + * @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 zC=[["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"}]],FC=le("house",zC);/** + * @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 BC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],by=le("info",BC);/** + * @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 $C=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ey=le("loader-circle",$C);/** + * @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 UC=[["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"}]],kr=le("message-square",UC);/** + * @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 VC=[["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"}]],HC=le("palette",VC);/** + * @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 WC=[["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"}]],KC=le("panel-left-close",WC);/** + * @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 GC=[["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"}]],YC=le("panel-left-open",GC);/** + * @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 QC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qC=le("plus",QC);/** + * @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 XC=[["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"}]],JC=le("rotate-ccw",XC);/** + * @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 ZC=[["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"}]],eb=le("send",ZC);/** + * @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 tb=[["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"}]],nb=le("server",tb);/** + * @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 rb=[["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"}]],md=le("settings",rb);/** + * @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 ib=[["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"}]],ob=le("share",ib);/** + * @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 lb=[["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"}]],Uu=le("shield",lb);/** + * @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 sb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ab=le("square",sb);/** + * @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 ub=[["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"}]],Ny=le("trash-2",ub);/** + * @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 cb=[["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"}]],db=le("triangle-alert",cb);/** + * @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 fb=[["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"}]],pb=le("upload",fb);/** + * @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 hb=[["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"}]],mb=le("user",hb);/** + * @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 gb=[["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"}]],_o=le("zap",gb),yb=[{name:"Home",href:"/",icon:FC,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:kr,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:yi,description:"Browse and manage models"},{name:"Assistants",href:"/assistants",icon:wy,description:"Custom AI assistants",badge:"Preview"}],vb=[{name:"Completions",href:"/completions",icon:_o,description:"Text completion endpoint"},{name:"Fine-tuning",href:"/fine-tuning",icon:hn,description:"Train custom models"},{name:"Settings",href:"/settings",icon:md,description:"Application settings"}];function xb(){const e=Fo();return c.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[c.jsx("div",{className:"p-6 border-b",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:c.jsx(hn,{className:"h-5 w-5 text-primary-foreground"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),c.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),c.jsx("nav",{className:"space-y-1",children:yb.map(t=>{const n=e.pathname===t.href;return c.jsxs(ar,{to:t.href,className:oe("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:[c.jsx(t.icon,{className:"h-4 w-4"}),c.jsx("div",{className:"flex-1",children:c.jsxs("div",{className:"flex items-center gap-2",children:[t.name,t.badge&&c.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-blue-100 text-blue-700 rounded-full",children:t.badge})]})})]},t.name)})})]}),c.jsxs("div",{className:"px-3",children:[c.jsx("h2",{className:"mb-2 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Advanced"}),c.jsx("nav",{className:"space-y-1",children:vb.map(t=>{const n=e.pathname===t.href;return c.jsxs(ar,{to:t.href,className:oe("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:[c.jsx(t.icon,{className:"h-4 w-4"}),t.name]},t.name)})})]})]})]})}function wb(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(xb,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(Nk,{})})]})}const De=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));De.displayName="Card";const Ze=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:oe("flex flex-col space-y-1.5 p-6",e),...t}));Ze.displayName="CardHeader";const ot=g.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));ot.displayName="CardTitle";const Sb=g.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:oe("text-sm text-muted-foreground",e),...t}));Sb.displayName="CardDescription";const Be=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:oe("p-6 pt-0",e),...t}));Be.displayName="CardContent";const kb=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:oe("flex items-center p-6 pt-0",e),...t}));kb.displayName="CardFooter";function bp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=bp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=g.Children.toArray(o),a=s.find(Nb);if(a){const u=a.props.children,f=s.map(d=>d===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...l,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,f):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Cb=vi("Slot");function bb(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=Pb(i),s=jb(o,i.props);return i.type!==g.Fragment&&(s.ref=r?jy(r,l):l),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Py=Symbol("radix.slottable");function Eb(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Py,t}function Nb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Py}function jb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Pb(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Ep=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Np=py,gd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Np(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],d=o==null?void 0:o[u];if(f===null)return null;const h=Ep(f)||Ep(d);return i[u][h]}),s=n&&Object.entries(n).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...u,d,h]:u},[]);return Np(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},yd=gd("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"}}),me=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Cb:"button";return c.jsx(l,{className:oe(yd({variant:t,size:n,className:e})),ref:o,...i})});me.displayName="Button";const _b=[{icon:hn,title:"Local AI Models",description:"Run powerful language models locally on your machine with full privacy control.",color:"text-blue-500"},{icon:kr,title:"Interactive Chat",description:"Playground interface for testing prompts and exploring model capabilities.",color:"text-green-500"},{icon:Uu,title:"Privacy First",description:"Your data never leaves your machine. Complete privacy and security guaranteed.",color:"text-purple-500"},{icon:_o,title:"High Performance",description:"Optimized for speed with model caching and efficient resource management.",color:"text-yellow-500"}],Rb=[{title:"Start Chatting",description:"Jump into the playground and start experimenting",href:"/playground",icon:kr,primary:!0},{title:"Browse Models",description:"Explore available models and their capabilities",href:"/models",icon:yi,primary:!1},{title:"View Settings",description:"Configure your application preferences",href:"/settings",icon:Sy,primary:!1}];function Tb(){return c.jsx("div",{className:"min-h-screen bg-background",children:c.jsxs("div",{className:"container mx-auto px-4 py-8",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("div",{className:"flex items-center justify-center mb-4",children:c.jsx("div",{className:"w-16 h-16 bg-primary rounded-2xl flex items-center justify-center",children:c.jsx(hn,{className:"h-8 w-8 text-primary-foreground"})})}),c.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Edge LLM"}),c.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."}),c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsx(ar,{to:"/playground",children:c.jsxs(me,{size:"lg",children:[c.jsx(kr,{className:"h-5 w-5 mr-2"}),"Start Chatting"]})}),c.jsx(ar,{to:"/models",children:c.jsxs(me,{variant:"outline",size:"lg",children:[c.jsx(yi,{className:"h-5 w-5 mr-2"}),"Browse Models"]})})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:_b.map((e,t)=>c.jsx(De,{className:"text-center",children:c.jsxs(Be,{className:"pt-6",children:[c.jsx(e.icon,{className:`h-12 w-12 mx-auto mb-4 ${e.color}`}),c.jsx("h3",{className:"font-semibold mb-2",children:e.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})},t))}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:Rb.map((e,t)=>c.jsx(De,{className:"hover:shadow-lg transition-shadow",children:c.jsxs(Be,{className:"pt-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsx(e.icon,{className:"h-6 w-6 text-primary"}),c.jsx("h3",{className:"font-semibold",children:e.title})]}),c.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e.description}),c.jsx(ar,{to:e.href,children:c.jsxs(me,{variant:e.primary?"default":"outline",className:"w-full",children:["Get Started",c.jsx(xC,{className:"h-4 w-4 ml-2"})]})})]})},t))}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{children:"Getting Started"})}),c.jsxs(Be,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"1"}),c.jsx("h4",{className:"font-medium",children:"Browse Available Models"})]}),c.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."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"2"}),c.jsx("h4",{className:"font-medium",children:"Load a Model"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Select and load a model that fits your hardware and requirements."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"3"}),c.jsx("h4",{className:"font-medium",children:"Start Chatting"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Go to the playground and start experimenting with prompts."})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(ar,{to:"/playground",children:c.jsxs(me,{className:"w-full md:w-auto",children:[c.jsx(kr,{className:"h-4 w-4 mr-2"}),"Open Playground"]})})})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{children:"System Status"})}),c.jsxs(Be,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Backend Status"}),c.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-green-600",children:[c.jsx("div",{className:"w-2 h-2 bg-green-600 rounded-full"}),"Online"]})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Models Loaded"}),c.jsx("span",{className:"text-sm font-medium",children:"Ready"})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Memory Usage"}),c.jsx("span",{className:"text-sm font-medium",children:"Optimized"})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(ar,{to:"/settings",children:c.jsxs(me,{variant:"outline",className:"w-full md:w-auto",children:[c.jsx(Sy,{className:"h-4 w-4 mr-2"}),"View Settings"]})})})]})]})]})]})})}function ss(e,[t,n]){return Math.min(n,Math.max(t,e))}function ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Ab(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,a=g.useMemo(()=>s,Object.values(s));return c.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function er(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=d=>{var m;const{scope:h,children:p,...w}=d,y=((m=h==null?void 0:h[e])==null?void 0:m[a])||s,S=g.useMemo(()=>w,Object.values(w));return c.jsx(y.Provider,{value:S,children:p})};u.displayName=o+"Provider";function f(d,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[a])||s,w=g.useContext(p);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,Ib(i,...t)]}function Ib(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var We=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Mb=wc[" useInsertionEffect ".trim().toString()]||We;function xi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=Ob({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const d=f.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.`),f.current=s},[s,r])}const u=g.useCallback(f=>{var d;if(s){const h=Lb(f)?f(e):f;h!==e&&((d=l.current)==null||d.call(l,h))}else o(f)},[s,e,o,l]);return[a,u]}function Ob({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return Mb(()=>{o.current=t},[t]),g.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function Lb(e){return typeof e=="function"}var Db=g.createContext(void 0);function _y(e){const t=g.useContext(Db);return e||t||"ltr"}function vd(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function xd(e){const[t,n]=g.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;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 zb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ee=zb.reduce((e,t)=>{const n=vi(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fb(e,t){e&&bi.flushSync(()=>e.dispatchEvent(t))}function Ry(e){const t=e+"CollectionProvider",[n,r]=er(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:m}=y,v=Lt.useRef(null),x=Lt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:x,collectionRef:v,children:m})};l.displayName=t;const s=e+"CollectionSlot",a=vi(s),u=Lt.forwardRef((y,S)=>{const{scope:m,children:v}=y,x=o(s,m),b=ce(S,x.collectionRef);return c.jsx(a,{ref:b,children:v})});u.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=vi(f),p=Lt.forwardRef((y,S)=>{const{scope:m,children:v,...x}=y,b=Lt.useRef(null),N=ce(S,b),E=o(f,m);return Lt.useEffect(()=>(E.itemMap.set(b,{ref:b,...x}),()=>void E.itemMap.delete(b))),c.jsx(h,{[d]:"",ref:N,children:v})});p.displayName=f;function w(y){const S=o(e+"CollectionConsumer",y);return Lt.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((E,j)=>x.indexOf(E.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:p},w,r]}var Ty=["PageUp","PageDown"],Ay=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Iy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ni="Slider",[Vu,Bb,$b]=Ry(Ni),[My,qA]=er(Ni,[$b]),[Ub,Ms]=My(Ni),Oy=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:w,...y}=e,S=g.useRef(new Set),m=g.useRef(0),x=l==="horizontal"?Vb:Hb,[b=[],N]=xi({prop:f,defaultProp:u,onChange:M=>{var V;(V=[...S.current][m.current])==null||V.focus(),d(M)}}),E=g.useRef(b);function j(M){const P=Qb(b,M);O(M,P)}function R(M){O(M,m.current)}function B(){const M=E.current[m.current];b[m.current]!==M&&h(b)}function O(M,P,{commit:V}={commit:!1}){const T=Zb(o),D=eE(Math.round((M-r)/o)*o+r,T),U=ss(D,[r,i]);N((H=[])=>{const _=Gb(H,U,P);if(Jb(_,a*o)){m.current=_.indexOf(U);const z=String(_)!==String(H);return z&&V&&h(_),z?_:H}else return H})}return c.jsx(Ub,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:m,thumbs:S.current,values:b,orientation:l,form:w,children:c.jsx(Vu.Provider,{scope:e.__scopeSlider,children:c.jsx(Vu.Slot,{scope:e.__scopeSlider,children:c.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:ie(y.onPointerDown,()=>{s||(E.current=b)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:j,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:B,onHomeKeyDown:()=>!s&&O(r,0,{commit:!0}),onEndKeyDown:()=>!s&&O(i,b.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:P})=>{if(!s){const D=Ty.includes(M.key)||M.shiftKey&&Ay.includes(M.key)?10:1,U=m.current,H=b[U],_=o*D*P;O(H+_,U,{commit:!0})}}})})})})});Oy.displayName=Ni;var[Ly,Dy]=My(Ni,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Vb=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[d,h]=g.useState(null),p=ce(t,x=>h(x)),w=g.useRef(void 0),y=_y(i),S=y==="ltr",m=S&&!o||!S&&o;function v(x){const b=w.current||d.getBoundingClientRect(),N=[0,b.width],j=wd(N,m?[n,r]:[r,n]);return w.current=b,j(x-b.left)}return c.jsx(Ly,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:c.jsx(zy,{dir:y,"data-orientation":"horizontal",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const b=v(x.clientX);l==null||l(b)},onSlideMove:x=>{const b=v(x.clientX);s==null||s(b)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=Iy[m?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),Hb=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=g.useRef(null),d=ce(t,f),h=g.useRef(void 0),p=!i;function w(y){const S=h.current||f.current.getBoundingClientRect(),m=[0,S.height],x=wd(m,p?[r,n]:[n,r]);return h.current=S,x(y-S.top)}return c.jsx(Ly,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:c.jsx(zy,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);o==null||o(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{h.current=void 0,s==null||s()},onStepKeyDown:y=>{const m=Iy[p?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:m?-1:1})}})})}),zy=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=Ms(Ni,n);return c.jsx(ee.span,{...u,ref:t,onKeyDown:ie(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Ty.concat(Ay).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:ie(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(h)?h.focus():r(d)}),onPointerMove:ie(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:ie(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),o(d))})})}),Fy="SliderTrack",By=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Ms(Fy,n);return c.jsx(ee.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});By.displayName=Fy;var Hu="SliderRange",$y=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Ms(Hu,n),o=Dy(Hu,n),l=g.useRef(null),s=ce(t,l),a=i.values.length,u=i.values.map(h=>Hy(h,i.min,i.max)),f=a>1?Math.min(...u):0,d=100-Math.max(...u);return c.jsx(ee.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});$y.displayName=Hu;var Wu="SliderThumb",Uy=g.forwardRef((e,t)=>{const n=Bb(e.__scopeSlider),[r,i]=g.useState(null),o=ce(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(Wb,{...e,ref:o,index:l})}),Wb=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Ms(Wu,n),s=Dy(Wu,n),[a,u]=g.useState(null),f=ce(t,v=>u(v)),d=a?l.form||!!a.closest("form"):!0,h=xd(a),p=l.values[r],w=p===void 0?0:Hy(p,l.min,l.max),y=Yb(r,l.values.length),S=h==null?void 0:h[s.size],m=S?qb(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${m}px)`},children:[c.jsx(Vu.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(ee.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":p,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:f,style:p===void 0?{display:"none"}:e.style,onFocus:ie(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&c.jsx(Vy,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:p},r)]})});Uy.displayName=Wu;var Kb="RadioBubbleInput",Vy=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ce(i,r),l=vd(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(ee.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Vy.displayName=Kb;function Gb(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function Hy(e,t,n){const o=100/(n-t)*(e-t);return ss(o,[0,100])}function Yb(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Qb(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function qb(e,t,n){const r=e/2,o=wd([0,50],[0,r]);return(r-o(t)*n)*n}function Xb(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Jb(e,t){if(t>0){const n=Xb(e);return Math.min(...n)>=t}return!0}function wd(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 Zb(e){return(String(e).split(".")[1]||"").length}function eE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Wy=Oy,tE=By,nE=$y,rE=Uy;const Ku=g.forwardRef(({className:e,...t},n)=>c.jsxs(Wy,{ref:n,className:oe("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(tE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(nE,{className:"absolute h-full bg-primary"})}),c.jsx(rE,{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"})]}));Ku.displayName=Wy.displayName;var iE="Label",Ky=g.forwardRef((e,t)=>c.jsx(ee.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ky.displayName=iE;var Gy=Ky;const oE=gd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oe=g.forwardRef(({className:e,...t},n)=>c.jsx(Gy,{ref:n,className:oe(oE(),e),...t}));Oe.displayName=Gy.displayName;const lE=gd("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 Ae({className:e,variant:t,...n}){return c.jsx("div",{className:oe(lE({variant:t}),e),...n})}function Cr(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function sE(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var aE="DismissableLayer",Gu="dismissableLayer.update",uE="dismissableLayer.pointerDownOutside",cE="dismissableLayer.focusOutside",jp,Yy=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(Yy),[f,d]=g.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),w=ce(t,j=>d(j)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(S),v=f?y.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=m,N=pE(j=>{const R=j.target,B=[...u.branches].some(O=>O.contains(R));!b||B||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},h),E=hE(j=>{const R=j.target;[...u.branches].some(O=>O.contains(R))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},h);return sE(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},h),g.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Pp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jp)}},[f,h,n,u]),g.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Pp())},[f,u]),g.useEffect(()=>{const j=()=>p({});return document.addEventListener(Gu,j),()=>document.removeEventListener(Gu,j)},[]),c.jsx(ee.div,{...a,ref:w,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,N.onPointerDownCapture)})});Sd.displayName=aE;var dE="DismissableLayerBranch",fE=g.forwardRef((e,t)=>{const n=g.useContext(Yy),r=g.useRef(null),i=ce(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(ee.div,{...e,ref:i})});fE.displayName=dE;function pE(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Qy(uE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hE(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Qy(cE,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Pp(){const e=new CustomEvent(Gu);document.dispatchEvent(e)}function Qy(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Fb(i,o):i.dispatchEvent(o)}var ba=0;function qy(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_p()),document.body.insertAdjacentElement("beforeend",e[1]??_p()),ba++,()=>{ba===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ba--}},[])}function _p(){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 Ea="focusScope.autoFocusOnMount",Na="focusScope.autoFocusOnUnmount",Rp={bubbles:!1,cancelable:!0},mE="FocusScope",kd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=g.useState(null),u=Cr(i),f=Cr(o),d=g.useRef(null),h=ce(t,y=>a(y)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(x){if(p.paused||!s)return;const b=x.target;s.contains(b)?d.current=b:_n(d.current,{select:!0})},S=function(x){if(p.paused||!s)return;const b=x.relatedTarget;b!==null&&(s.contains(b)||_n(d.current,{select:!0}))},m=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&_n(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const v=new MutationObserver(m);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,p.paused]),g.useEffect(()=>{if(s){Ap.add(p);const y=document.activeElement;if(!s.contains(y)){const m=new CustomEvent(Ea,Rp);s.addEventListener(Ea,u),s.dispatchEvent(m),m.defaultPrevented||(gE(SE(Xy(s)),{select:!0}),document.activeElement===y&&_n(s))}return()=>{s.removeEventListener(Ea,u),setTimeout(()=>{const m=new CustomEvent(Na,Rp);s.addEventListener(Na,f),s.dispatchEvent(m),m.defaultPrevented||_n(y??document.body,{select:!0}),s.removeEventListener(Na,f),Ap.remove(p)},0)}}},[s,u,f,p]);const w=g.useCallback(y=>{if(!n&&!r||p.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(S&&m){const v=y.currentTarget,[x,b]=yE(v);x&&b?!y.shiftKey&&m===b?(y.preventDefault(),n&&_n(x,{select:!0})):y.shiftKey&&m===x&&(y.preventDefault(),n&&_n(b,{select:!0})):m===v&&y.preventDefault()}},[n,r,p.paused]);return c.jsx(ee.div,{tabIndex:-1,...l,ref:h,onKeyDown:w})});kd.displayName=mE;function gE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_n(r,{select:t}),document.activeElement!==n)return}function yE(e){const t=Xy(e),n=Tp(t,e),r=Tp(t.reverse(),e);return[n,r]}function Xy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tp(e,t){for(const n of e)if(!vE(n,{upTo:t}))return n}function vE(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 xE(e){return e instanceof HTMLInputElement&&"select"in e}function _n(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xE(e)&&t&&e.select()}}var Ap=wE();function wE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ip(e,t),e.unshift(t)},remove(t){var n;e=Ip(e,t),(n=e[0])==null||n.resume()}}}function Ip(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function SE(e){return e.filter(t=>t.tagName!=="A")}var kE=wc[" useId ".trim().toString()]||(()=>{}),CE=0;function gr(e){const[t,n]=g.useState(kE());return We(()=>{e||n(r=>r??String(CE++))},[e]),e||(t?`radix-${t}`:"")}const bE=["top","right","bottom","left"],Yn=Math.min,mt=Math.max,as=Math.round,al=Math.floor,nn=e=>({x:e,y:e}),EE={left:"right",right:"left",bottom:"top",top:"bottom"},NE={start:"end",end:"start"};function Yu(e,t,n){return mt(e,Yn(t,n))}function xn(e,t){return typeof e=="function"?e(t):e}function wn(e){return e.split("-")[0]}function ji(e){return e.split("-")[1]}function Cd(e){return e==="x"?"y":"x"}function bd(e){return e==="y"?"height":"width"}const jE=new Set(["top","bottom"]);function Zt(e){return jE.has(wn(e))?"y":"x"}function Ed(e){return Cd(Zt(e))}function PE(e,t,n){n===void 0&&(n=!1);const r=ji(e),i=Ed(e),o=bd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=us(l)),[l,us(l)]}function _E(e){const t=us(e);return[Qu(e),t,Qu(t)]}function Qu(e){return e.replace(/start|end/g,t=>NE[t])}const Mp=["left","right"],Op=["right","left"],RE=["top","bottom"],TE=["bottom","top"];function AE(e,t,n){switch(e){case"top":case"bottom":return n?t?Op:Mp:t?Mp:Op;case"left":case"right":return t?RE:TE;default:return[]}}function IE(e,t,n,r){const i=ji(e);let o=AE(wn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Qu)))),o}function us(e){return e.replace(/left|right|bottom|top/g,t=>EE[t])}function ME(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jy(e){return typeof e!="number"?ME(e):{top:e,right:e,bottom:e,left:e}}function cs(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Lp(e,t,n){let{reference:r,floating:i}=e;const o=Zt(t),l=Ed(t),s=bd(l),a=wn(t),u=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(a){case"top":p={x:f,y:r.y-i.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ji(t)){case"start":p[l]-=h*(n&&u?-1:1);break;case"end":p[l]+=h*(n&&u?-1:1);break}return p}const OE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=Lp(u,r,a),h=r,p={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=xn(e,t)||{};if(u==null)return{};const d=Jy(f),h={x:n,y:r},p=Ed(i),w=bd(p),y=await l.getDimensions(u),S=p==="y",m=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",b=o.reference[w]+o.reference[p]-h[p]-o.floating[w],N=h[p]-o.reference[p],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=E?E[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(E)))&&(j=s.floating[x]||o.floating[w]);const R=b/2-N/2,B=j/2-y[w]/2-1,O=Yn(d[m],B),M=Yn(d[v],B),P=O,V=j-y[w]-M,T=j/2-y[w]/2+R,D=Yu(P,T,V),U=!a.arrow&&ji(i)!=null&&T!==D&&o.reference[w]/2-(TT<=0)){var M,P;const T=(((M=o.flip)==null?void 0:M.index)||0)+1,D=j[T];if(D&&(!(d==="alignment"?v!==Zt(D):!1)||O.every(_=>Zt(_.placement)===v?_.overflows[0]>0:!0)))return{data:{index:T,overflows:O},reset:{placement:D}};let U=(P=O.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:P.placement;if(!U)switch(p){case"bestFit":{var V;const H=(V=O.filter(_=>{if(E){const z=Zt(_.placement);return z===v||z==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((_,z)=>_[1]-z[1])[0])==null?void 0:V[0];H&&(U=H);break}case"initialPlacement":U=s;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function Dp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zp(e){return bE.some(t=>e[t]>=0)}const zE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xn(e,t);switch(r){case"referenceHidden":{const o=await Ro(t,{...i,elementContext:"reference"}),l=Dp(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:zp(l)}}}case"escaped":{const o=await Ro(t,{...i,altBoundary:!0}),l=Dp(o,n.floating);return{data:{escapedOffsets:l,escaped:zp(l)}}}default:return{}}}}},Zy=new Set(["left","top"]);async function FE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=wn(n),s=ji(n),a=Zt(n)==="y",u=Zy.has(l)?-1:1,f=o&&a?-1:1,d=xn(t,e);let{mainAxis:h,crossAxis:p,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"&&(p=s==="end"?w*-1:w),a?{x:p*f,y:h*u}:{x:h*u,y:p*f}}const BE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await FE(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},$E=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:m,y:v}=S;return{x:m,y:v}}},...a}=xn(e,t),u={x:n,y:r},f=await Ro(t,a),d=Zt(wn(i)),h=Cd(d);let p=u[h],w=u[d];if(o){const S=h==="y"?"top":"left",m=h==="y"?"bottom":"right",v=p+f[S],x=p-f[m];p=Yu(v,p,x)}if(l){const S=d==="y"?"top":"left",m=d==="y"?"bottom":"right",v=w+f[S],x=w-f[m];w=Yu(v,w,x)}const y=s.fn({...t,[h]:p,[d]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[d]:l}}}}}},UE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=xn(e,t),f={x:n,y:r},d=Zt(i),h=Cd(d);let p=f[h],w=f[d];const y=xn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=h==="y"?"height":"width",b=o.reference[h]-o.floating[x]+S.mainAxis,N=o.reference[h]+o.reference[x]-S.mainAxis;pN&&(p=N)}if(u){var m,v;const x=h==="y"?"width":"height",b=Zy.has(wn(i)),N=o.reference[d]-o.floating[x]+(b&&((m=l.offset)==null?void 0:m[d])||0)+(b?0:S.crossAxis),E=o.reference[d]+o.reference[x]+(b?0:((v=l.offset)==null?void 0:v[d])||0)-(b?S.crossAxis:0);wE&&(w=E)}return{[h]:p,[d]:w}}}},VE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=xn(e,t),f=await Ro(t,u),d=wn(i),h=ji(i),p=Zt(i)==="y",{width:w,height:y}=o.floating;let S,m;d==="top"||d==="bottom"?(S=d,m=h===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,S=h==="end"?"top":"bottom");const v=y-f.top-f.bottom,x=w-f.left-f.right,b=Yn(y-f[S],v),N=Yn(w-f[m],x),E=!t.middlewareData.shift;let j=b,R=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),E&&!h){const O=mt(f.left,0),M=mt(f.right,0),P=mt(f.top,0),V=mt(f.bottom,0);p?R=w-2*(O!==0||M!==0?O+M:mt(f.left,f.right)):j=y-2*(P!==0||V!==0?P+V:mt(f.top,f.bottom))}await a({...t,availableWidth:R,availableHeight:j});const B=await l.getDimensions(s.floating);return w!==B.width||y!==B.height?{reset:{rects:!0}}:{}}}};function Os(){return typeof window<"u"}function Pi(e){return ev(e)?(e.nodeName||"").toLowerCase():"#document"}function xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){var t;return(t=(ev(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ev(e){return Os()?e instanceof Node||e instanceof xt(e).Node:!1}function Ut(e){return Os()?e instanceof Element||e instanceof xt(e).Element:!1}function rn(e){return Os()?e instanceof HTMLElement||e instanceof xt(e).HTMLElement:!1}function Fp(e){return!Os()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xt(e).ShadowRoot}const HE=new Set(["inline","contents"]);function Bo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!HE.has(i)}const WE=new Set(["table","td","th"]);function KE(e){return WE.has(Pi(e))}const GE=[":popover-open",":modal"];function Ls(e){return GE.some(t=>{try{return e.matches(t)}catch{return!1}})}const YE=["transform","translate","scale","rotate","perspective"],QE=["transform","translate","scale","rotate","perspective","filter"],qE=["paint","layout","strict","content"];function Nd(e){const t=jd(),n=Ut(e)?Vt(e):e;return YE.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)||QE.some(r=>(n.willChange||"").includes(r))||qE.some(r=>(n.contain||"").includes(r))}function XE(e){let t=Qn(e);for(;rn(t)&&!wi(t);){if(Nd(t))return t;if(Ls(t))return null;t=Qn(t)}return null}function jd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const JE=new Set(["html","body","#document"]);function wi(e){return JE.has(Pi(e))}function Vt(e){return xt(e).getComputedStyle(e)}function Ds(e){return Ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qn(e){if(Pi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fp(e)&&e.host||ln(e);return Fp(t)?t.host:t}function tv(e){const t=Qn(e);return wi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rn(t)&&Bo(t)?t:tv(t)}function To(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=tv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=xt(i);if(o){const s=qu(l);return t.concat(l,l.visualViewport||[],Bo(i)?i:[],s&&n?To(s):[])}return t.concat(i,To(i,[],n))}function qu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=rn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=as(n)!==o||as(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Pd(e){return Ut(e)?e:e.contextElement}function oi(e){const t=Pd(e);if(!rn(t))return nn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=nv(t);let l=(o?as(n.width):n.width)/r,s=(o?as(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const ZE=nn(0);function rv(e){const t=xt(e);return!jd()||!t.visualViewport?ZE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xt(e)?!1:t}function br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Pd(e);let l=nn(1);t&&(r?Ut(r)&&(l=oi(r)):l=oi(e));const s=eN(o,n,r)?rv(o):nn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const h=xt(o),p=r&&Ut(r)?xt(r):r;let w=h,y=qu(w);for(;y&&r&&p!==w;){const S=oi(y),m=y.getBoundingClientRect(),v=Vt(y),x=m.left+(y.clientLeft+parseFloat(v.paddingLeft))*S.x,b=m.top+(y.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,f*=S.x,d*=S.y,a+=x,u+=b,w=xt(y),y=qu(w)}}return cs({width:f,height:d,x:a,y:u})}function zs(e,t){const n=Ds(e).scrollLeft;return t?t.left+n:br(ln(e)).left+n}function iv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-zs(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function tN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ln(r),s=t?Ls(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=nn(1);const f=nn(0),d=rn(r);if((d||!d&&!o)&&((Pi(r)!=="body"||Bo(l))&&(a=Ds(r)),rn(r))){const p=br(r);u=oi(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const h=l&&!d&&!o?iv(l,a):nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-a.scrollTop*u.y+f.y+h.y}}function nN(e){return Array.from(e.getClientRects())}function rN(e){const t=ln(e),n=Ds(e),r=e.ownerDocument.body,i=mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+zs(e);const s=-n.scrollTop;return Vt(r).direction==="rtl"&&(l+=mt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const Bp=25;function iN(e,t){const n=xt(e),r=ln(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const f=jd();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=zs(r);if(u<=0){const f=r.ownerDocument,d=f.body,h=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-p);w<=Bp&&(o-=w)}else u<=Bp&&(o+=u);return{width:o,height:l,x:s,y:a}}const oN=new Set(["absolute","fixed"]);function lN(e,t){const n=br(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=rn(e)?oi(e):nn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function $p(e,t,n){let r;if(t==="viewport")r=iN(e,n);else if(t==="document")r=rN(ln(e));else if(Ut(t))r=lN(t,n);else{const i=rv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return cs(r)}function ov(e,t){const n=Qn(e);return n===t||!Ut(n)||wi(n)?!1:Vt(n).position==="fixed"||ov(n,t)}function sN(e,t){const n=t.get(e);if(n)return n;let r=To(e,[],!1).filter(s=>Ut(s)&&Pi(s)!=="body"),i=null;const o=Vt(e).position==="fixed";let l=o?Qn(e):e;for(;Ut(l)&&!wi(l);){const s=Vt(l),a=Nd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&oN.has(i.position)||Bo(l)&&!a&&ov(e,l))?r=r.filter(f=>f!==l):i=s,l=Qn(l)}return t.set(e,r),r}function aN(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Ls(t)?[]:sN(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const d=$p(t,f,i);return u.top=mt(d.top,u.top),u.right=Yn(d.right,u.right),u.bottom=Yn(d.bottom,u.bottom),u.left=mt(d.left,u.left),u},$p(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function uN(e){const{width:t,height:n}=nv(e);return{width:t,height:n}}function cN(e,t,n){const r=rn(t),i=ln(t),o=n==="fixed",l=br(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=nn(0);function u(){a.x=zs(i)}if(r||!r&&!o)if((Pi(t)!=="body"||Bo(i))&&(s=Ds(t)),r){const p=br(t,!0,o,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?iv(i,s):nn(0),d=l.left+s.scrollLeft-a.x-f.x,h=l.top+s.scrollTop-a.y-f.y;return{x:d,y:h,width:l.width,height:l.height}}function ja(e){return Vt(e).position==="static"}function Up(e,t){if(!rn(e)||Vt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ln(e)===n&&(n=n.ownerDocument.body),n}function lv(e,t){const n=xt(e);if(Ls(e))return n;if(!rn(e)){let i=Qn(e);for(;i&&!wi(i);){if(Ut(i)&&!ja(i))return i;i=Qn(i)}return n}let r=Up(e,t);for(;r&&KE(r)&&ja(r);)r=Up(r,t);return r&&wi(r)&&ja(r)&&!Nd(r)?n:r||XE(e)||n}const dN=async function(e){const t=this.getOffsetParent||lv,n=this.getDimensions,r=await n(e.floating);return{reference:cN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fN(e){return Vt(e).direction==="rtl"}const pN={convertOffsetParentRelativeRectToViewportRelativeRect:tN,getDocumentElement:ln,getClippingRect:aN,getOffsetParent:lv,getElementRects:dN,getClientRects:nN,getDimensions:uN,getScale:oi,isElement:Ut,isRTL:fN};function sv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hN(e,t){let n=null,r;const i=ln(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:p}=u;if(s||t(),!h||!p)return;const w=al(d),y=al(i.clientWidth-(f+h)),S=al(i.clientHeight-(d+p)),m=al(f),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-m+"px",threshold:mt(0,Yn(1,a))||1};let b=!0;function N(E){const j=E[0].intersectionRatio;if(j!==a){if(!b)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!sv(u,e.getBoundingClientRect())&&l(),b=!1}try{n=new IntersectionObserver(N,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),o}function mN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Pd(e),f=i||o?[...u?To(u):[],...To(t)]:[];f.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=u&&s?hN(u,n):null;let h=-1,p=null;l&&(p=new ResizeObserver(m=>{let[v]=m;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),u&&!a&&p.observe(u),p.observe(t));let w,y=a?br(e):null;a&&S();function S(){const m=br(e);y&&!sv(y,m)&&n(),y=m,w=requestAnimationFrame(S)}return n(),()=>{var m;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,a&&cancelAnimationFrame(w)}}const gN=BE,yN=$E,vN=DE,xN=VE,wN=zE,Vp=LE,SN=UE,kN=(e,t,n)=>{const r=new Map,i={platform:pN,...n},o={...i.platform,_c:r};return OE(e,t,{...i,platform:o})};var CN=typeof document<"u",bN=function(){},_l=CN?g.useLayoutEffect:bN;function ds(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,i;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(!ds(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ds(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function av(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hp(e,t){const n=av(e);return Math.round(t*n)/n}function Pa(e){const t=g.useRef(e);return _l(()=>{t.current=e}),t}function EN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=g.useState(r);ds(h,r)||p(r);const[w,y]=g.useState(null),[S,m]=g.useState(null),v=g.useCallback(_=>{_!==E.current&&(E.current=_,y(_))},[]),x=g.useCallback(_=>{_!==j.current&&(j.current=_,m(_))},[]),b=o||w,N=l||S,E=g.useRef(null),j=g.useRef(null),R=g.useRef(f),B=a!=null,O=Pa(a),M=Pa(i),P=Pa(u),V=g.useCallback(()=>{if(!E.current||!j.current)return;const _={placement:t,strategy:n,middleware:h};M.current&&(_.platform=M.current),kN(E.current,j.current,_).then(z=>{const k={...z,isPositioned:P.current!==!1};T.current&&!ds(R.current,k)&&(R.current=k,bi.flushSync(()=>{d(k)}))})},[h,t,n,M,P]);_l(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[u]);const T=g.useRef(!1);_l(()=>(T.current=!0,()=>{T.current=!1}),[]),_l(()=>{if(b&&(E.current=b),N&&(j.current=N),b&&N){if(O.current)return O.current(b,N,V);V()}},[b,N,V,O,B]);const D=g.useMemo(()=>({reference:E,floating:j,setReference:v,setFloating:x}),[v,x]),U=g.useMemo(()=>({reference:b,floating:N}),[b,N]),H=g.useMemo(()=>{const _={position:n,left:0,top:0};if(!U.floating)return _;const z=Hp(U.floating,f.x),k=Hp(U.floating,f.y);return s?{..._,transform:"translate("+z+"px, "+k+"px)",...av(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,U.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:V,refs:D,elements:U,floatingStyles:H}),[f,V,D,U,H])}const NN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Vp({element:r.current,padding:i}).fn(n):{}:r?Vp({element:r,padding:i}).fn(n):{}}}},jN=(e,t)=>({...gN(e),options:[e,t]}),PN=(e,t)=>({...yN(e),options:[e,t]}),_N=(e,t)=>({...SN(e),options:[e,t]}),RN=(e,t)=>({...vN(e),options:[e,t]}),TN=(e,t)=>({...xN(e),options:[e,t]}),AN=(e,t)=>({...wN(e),options:[e,t]}),IN=(e,t)=>({...NN(e),options:[e,t]});var MN="Arrow",uv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(ee.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});uv.displayName=MN;var ON=uv,_d="Popper",[cv,dv]=er(_d),[LN,fv]=cv(_d),pv=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return c.jsx(LN,{scope:t,anchor:r,onAnchorChange:i,children:n})};pv.displayName=_d;var hv="PopperAnchor",mv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=fv(hv,n),l=g.useRef(null),s=ce(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:c.jsx(ee.div,{...i,ref:s})});mv.displayName=hv;var Rd="PopperContent",[DN,zN]=cv(Rd),gv=g.forwardRef((e,t)=>{var K,re,Ee,se,ae,pe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:w,...y}=e,S=fv(Rd,n),[m,v]=g.useState(null),x=ce(t,Xe=>v(Xe)),[b,N]=g.useState(null),E=xd(b),j=(E==null?void 0:E.width)??0,R=(E==null?void 0:E.height)??0,B=r+(o!=="center"?"-"+o:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},M=Array.isArray(u)?u:[u],P=M.length>0,V={padding:O,boundary:M.filter(BN),altBoundary:P},{refs:T,floatingStyles:D,placement:U,isPositioned:H,middlewareData:_}=EN({strategy:"fixed",placement:B,whileElementsMounted:(...Xe)=>mN(...Xe,{animationFrame:p==="always"}),elements:{reference:S.anchor},middleware:[jN({mainAxis:i+R,alignmentAxis:l}),a&&PN({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?_N():void 0,...V}),a&&RN({...V}),TN({...V,apply:({elements:Xe,rects:Ct,availableWidth:Cn,availableHeight:bn})=>{const{width:En,height:qs}=Ct.reference,ir=Xe.floating.style;ir.setProperty("--radix-popper-available-width",`${Cn}px`),ir.setProperty("--radix-popper-available-height",`${bn}px`),ir.setProperty("--radix-popper-anchor-width",`${En}px`),ir.setProperty("--radix-popper-anchor-height",`${qs}px`)}}),b&&IN({element:b,padding:s}),$N({arrowWidth:j,arrowHeight:R}),h&&AN({strategy:"referenceHidden",...V})]}),[z,k]=xv(U),G=Cr(w);We(()=>{H&&(G==null||G())},[H,G]);const A=(K=_.arrow)==null?void 0:K.x,C=(re=_.arrow)==null?void 0:re.y,Y=((Ee=_.arrow)==null?void 0:Ee.centerOffset)!==0,[de,Q]=g.useState();return We(()=>{m&&Q(window.getComputedStyle(m).zIndex)},[m]),c.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:H?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(se=_.transformOrigin)==null?void 0:se.x,(ae=_.transformOrigin)==null?void 0:ae.y].join(" "),...((pe=_.hide)==null?void 0:pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(DN,{scope:n,placedSide:z,onArrowChange:N,arrowX:A,arrowY:C,shouldHideArrow:Y,children:c.jsx(ee.div,{"data-side":z,"data-align":k,...y,ref:x,style:{...y.style,animation:H?void 0:"none"}})})})});gv.displayName=Rd;var yv="PopperArrow",FN={top:"bottom",right:"left",bottom:"top",left:"right"},vv=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=zN(yv,r),l=FN[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(ON,{...i,ref:n,style:{...i.style,display:"block"}})})});vv.displayName=yv;function BN(e){return e!==null}var $N=e=>({name:"transformOrigin",options:e,fn(t){var S,m,v;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=xv(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?d:`${h}px`,y=`${-a}px`):u==="top"?(w=l?d:`${h}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?d:`${p}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?d:`${p}px`),{data:{x:w,y}}}});function xv(e){const[t,n="center"]=e.split("-");return[t,n]}var UN=pv,VN=mv,HN=gv,WN=vv,KN="Portal",Td=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);We(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?MS.createPortal(c.jsx(ee.div,{...r,ref:t}),l):null});Td.displayName=KN;var wv=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"}),GN="VisuallyHidden",YN=g.forwardRef((e,t)=>c.jsx(ee.span,{...e,ref:t,style:{...wv,...e.style}}));YN.displayName=GN;var QN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Or=new WeakMap,ul=new WeakMap,cl={},_a=0,Sv=function(e){return e&&(e.host||Sv(e.parentNode))},qN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sv(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})},XN=function(e,t,n,r){var i=qN(t,Array.isArray(e)?e:[e]);cl[n]||(cl[n]=new WeakMap);var o=cl[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var f=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))f(h);else try{var p=h.getAttribute(r),w=p!==null&&p!=="false",y=(Or.get(h)||0)+1,S=(o.get(h)||0)+1;Or.set(h,y),o.set(h,S),l.push(h),y===1&&w&&ul.set(h,!0),S===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return f(t),s.clear(),_a++,function(){l.forEach(function(d){var h=Or.get(d)-1,p=o.get(d)-1;Or.set(d,h),o.set(d,p),h||(ul.has(d)||d.removeAttribute(r),ul.delete(d)),p||d.removeAttribute(n)}),_a--,_a||(Or=new WeakMap,Or=new WeakMap,ul=new WeakMap,cl={})}},kv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||QN(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),XN(r,i,n,"aria-hidden")):function(){return null}},Xt=function(){return Xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return h2;var t=m2(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])}},y2=Nv(),li="data-scroll-locked",v2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(ZN,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(li,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`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(Rl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Tl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Rl," .").concat(Rl,` { + right: 0 `).concat(r,`; + } + + .`).concat(Tl," .").concat(Tl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(li,`] { + `).concat(e2,": ").concat(s,`px; + } +`)},Gp=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},x2=function(){g.useEffect(function(){return document.body.setAttribute(li,(Gp()+1).toString()),function(){var e=Gp()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},w2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;x2();var o=g.useMemo(function(){return g2(i)},[i]);return g.createElement(y2,{styles:v2(o,!t,i,n?"":"!important")})},Xu=!1;if(typeof window<"u")try{var dl=Object.defineProperty({},"passive",{get:function(){return Xu=!0,!0}});window.addEventListener("test",dl,dl),window.removeEventListener("test",dl,dl)}catch{Xu=!1}var Lr=Xu?{passive:!1}:!1,S2=function(e){return e.tagName==="TEXTAREA"},jv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!S2(e)&&n[t]==="visible")},k2=function(e){return jv(e,"overflowY")},C2=function(e){return jv(e,"overflowX")},Yp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Pv(e,r);if(i){var o=_v(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},b2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Pv=function(e,t){return e==="v"?k2(t):C2(t)},_v=function(e,t){return e==="v"?b2(t):E2(t)},N2=function(e,t){return e==="h"&&t==="rtl"?-1:1},j2=function(e,t,n,r,i){var o=N2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,f=l>0,d=0,h=0;do{if(!s)break;var p=_v(e,s),w=p[0],y=p[1],S=p[2],m=y-S-o*w;(w||m)&&Pv(e,s)&&(d+=m,h+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(h)<1||!i&&-l>h))&&(u=!0),u},fl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qp=function(e){return[e.deltaX,e.deltaY]},qp=function(e){return e&&"current"in e?e.current:e},P2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_2=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},R2=0,Dr=[];function T2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(R2++)[0],o=g.useState(Nv)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=JN([e.lockRef.current],(e.shards||[]).map(qp),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var m=fl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-m[0],b="deltaY"in y?y.deltaY:v[1]-m[1],N,E=y.target,j=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in y&&j==="h"&&E.type==="range")return!1;var R=Yp(j,E);if(!R)return!0;if(R?N=j:(N=j==="v"?"h":"v",R=Yp(j,E)),!R)return!1;if(!r.current&&"changedTouches"in y&&(x||b)&&(r.current=N),!N)return!0;var B=r.current||N;return j2(B,S,y,B==="h"?x:b,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Dr.length||Dr[Dr.length-1]!==o)){var m="deltaY"in S?Qp(S):fl(S),v=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&P2(N.delta,m)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(qp).filter(Boolean).filter(function(N){return N.contains(S.target)}),b=x.length>0?s(S,x[0]):!l.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(y,S,m,v){var x={name:y,delta:S,target:m,should:v,shadowParent:A2(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),f=g.useCallback(function(y){n.current=fl(y),r.current=void 0},[]),d=g.useCallback(function(y){u(y.type,Qp(y),y.target,s(y,e.lockRef.current))},[]),h=g.useCallback(function(y){u(y.type,fl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Dr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",a,Lr),document.addEventListener("touchmove",a,Lr),document.addEventListener("touchstart",f,Lr),function(){Dr=Dr.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Lr),document.removeEventListener("touchmove",a,Lr),document.removeEventListener("touchstart",f,Lr)}},[]);var p=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:_2(i)}):null,p?g.createElement(w2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function A2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const I2=s2(Ev,T2);var Rv=g.forwardRef(function(e,t){return g.createElement(Fs,Xt({},e,{ref:t,sideCar:I2}))});Rv.classNames=Fs.classNames;const Tv=Rv;var M2=[" ","Enter","ArrowUp","ArrowDown"],O2=[" ","Enter"],Er="Select",[Bs,$s,L2]=Ry(Er),[_i,XA]=er(Er,[L2,dv]),Us=dv(),[D2,tr]=_i(Er),[z2,F2]=_i(Er),Av=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:f,autoComplete:d,disabled:h,required:p,form:w}=e,y=Us(t),[S,m]=g.useState(null),[v,x]=g.useState(null),[b,N]=g.useState(!1),E=_y(u),[j,R]=xi({prop:r,defaultProp:i??!1,onChange:o,caller:Er}),[B,O]=xi({prop:l,defaultProp:s,onChange:a,caller:Er}),M=g.useRef(null),P=S?w||!!S.closest("form"):!0,[V,T]=g.useState(new Set),D=Array.from(V).map(U=>U.props.value).join(";");return c.jsx(UN,{...y,children:c.jsxs(D2,{required:p,scope:t,trigger:S,onTriggerChange:m,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:b,onValueNodeHasChildrenChange:N,contentId:gr(),value:B,onValueChange:O,open:j,onOpenChange:R,dir:E,triggerPointerDownPosRef:M,disabled:h,children:[c.jsx(Bs.Provider,{scope:t,children:c.jsx(z2,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(U=>{T(H=>new Set(H).add(U))},[]),onNativeOptionRemove:g.useCallback(U=>{T(H=>{const _=new Set(H);return _.delete(U),_})},[]),children:n})}),P?c.jsxs(rx,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:B,onChange:U=>O(U.target.value),disabled:h,form:w,children:[B===void 0?c.jsx("option",{value:""}):null,Array.from(V)]},D):null]})})};Av.displayName=Er;var Iv="SelectTrigger",Mv=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Us(n),l=tr(Iv,n),s=l.disabled||r,a=ce(t,l.onTriggerChange),u=$s(n),f=g.useRef("touch"),[d,h,p]=ox(y=>{const S=u().filter(x=>!x.disabled),m=S.find(x=>x.value===l.value),v=lx(S,y,m);v!==void 0&&l.onValueChange(v.value)}),w=y=>{s||(l.onOpenChange(!0),p()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return c.jsx(VN,{asChild:!0,...o,children:c.jsx(ee.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":ix(l.value)?"":void 0,...i,ref:a,onClick:ie(i.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&w(y)}),onPointerDown:ie(i.onPointerDown,y=>{f.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:ie(i.onKeyDown,y=>{const S=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(S&&y.key===" ")&&M2.includes(y.key)&&(w(),y.preventDefault())})})})});Mv.displayName=Iv;var Ov="SelectValue",Lv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=tr(Ov,n),{onValueNodeHasChildrenChange:u}=a,f=o!==void 0,d=ce(t,a.onValueNodeChange);return We(()=>{u(f)},[u,f]),c.jsx(ee.span,{...s,ref:d,style:{pointerEvents:"none"},children:ix(a.value)?c.jsx(c.Fragment,{children:l}):o})});Lv.displayName=Ov;var B2="SelectIcon",Dv=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(ee.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Dv.displayName=B2;var $2="SelectPortal",zv=e=>c.jsx(Td,{asChild:!0,...e});zv.displayName=$2;var Nr="SelectContent",Fv=g.forwardRef((e,t)=>{const n=tr(Nr,e.__scopeSelect),[r,i]=g.useState();if(We(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?bi.createPortal(c.jsx(Bv,{scope:e.__scopeSelect,children:c.jsx(Bs.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx($v,{...e,ref:t})});Fv.displayName=Nr;var Mt=10,[Bv,nr]=_i(Nr),U2="SelectContentImpl",V2=vi("SelectContent.RemoveScroll"),$v=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:y,avoidCollisions:S,...m}=e,v=tr(Nr,n),[x,b]=g.useState(null),[N,E]=g.useState(null),j=ce(t,K=>b(K)),[R,B]=g.useState(null),[O,M]=g.useState(null),P=$s(n),[V,T]=g.useState(!1),D=g.useRef(!1);g.useEffect(()=>{if(x)return kv(x)},[x]),qy();const U=g.useCallback(K=>{const[re,...Ee]=P().map(pe=>pe.ref.current),[se]=Ee.slice(-1),ae=document.activeElement;for(const pe of K)if(pe===ae||(pe==null||pe.scrollIntoView({block:"nearest"}),pe===re&&N&&(N.scrollTop=0),pe===se&&N&&(N.scrollTop=N.scrollHeight),pe==null||pe.focus(),document.activeElement!==ae))return},[P,N]),H=g.useCallback(()=>U([R,x]),[U,R,x]);g.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:_,triggerPointerDownPosRef:z}=v;g.useEffect(()=>{if(x){let K={x:0,y:0};const re=se=>{var ae,pe;K={x:Math.abs(Math.round(se.pageX)-(((ae=z.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(se.pageY)-(((pe=z.current)==null?void 0:pe.y)??0))}},Ee=se=>{K.x<=10&&K.y<=10?se.preventDefault():x.contains(se.target)||_(!1),document.removeEventListener("pointermove",re),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[x,_,z]),g.useEffect(()=>{const K=()=>_(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[_]);const[k,G]=ox(K=>{const re=P().filter(ae=>!ae.disabled),Ee=re.find(ae=>ae.ref.current===document.activeElement),se=lx(re,K,Ee);se&&setTimeout(()=>se.ref.current.focus())}),A=g.useCallback((K,re,Ee)=>{const se=!D.current&&!Ee;(v.value!==void 0&&v.value===re||se)&&(B(K),se&&(D.current=!0))},[v.value]),C=g.useCallback(()=>x==null?void 0:x.focus(),[x]),Y=g.useCallback((K,re,Ee)=>{const se=!D.current&&!Ee;(v.value!==void 0&&v.value===re||se)&&M(K)},[v.value]),de=r==="popper"?Ju:Uv,Q=de===Ju?{side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return c.jsx(Bv,{scope:n,content:x,viewport:N,onViewportChange:E,itemRefCallback:A,selectedItem:R,onItemLeave:C,itemTextRefCallback:Y,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:V,searchRef:k,children:c.jsx(Tv,{as:V2,allowPinchZoom:!0,children:c.jsx(kd,{asChild:!0,trapped:v.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:ie(i,K=>{var re;(re=v.trigger)==null||re.focus({preventScroll:!0}),K.preventDefault()}),children:c.jsx(Sd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(de,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:K=>K.preventDefault(),...m,...Q,onPlaced:()=>T(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,K=>{const re=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!re&&K.key.length===1&&G(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let se=P().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(K.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ae=K.target,pe=se.indexOf(ae);se=se.slice(pe+1)}setTimeout(()=>U(se)),K.preventDefault()}})})})})})})});$v.displayName=U2;var H2="SelectItemAlignedPosition",Uv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=tr(Nr,n),l=nr(Nr,n),[s,a]=g.useState(null),[u,f]=g.useState(null),d=ce(t,j=>f(j)),h=$s(n),p=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:m,focusSelectedItem:v}=l,x=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&y&&S&&m){const j=o.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),B=o.valueNode.getBoundingClientRect(),O=m.getBoundingClientRect();if(o.dir!=="rtl"){const ae=O.left-R.left,pe=B.left-ae,Xe=j.left-pe,Ct=j.width+Xe,Cn=Math.max(Ct,R.width),bn=window.innerWidth-Mt,En=ss(pe,[Mt,Math.max(Mt,bn-Cn)]);s.style.minWidth=Ct+"px",s.style.left=En+"px"}else{const ae=R.right-O.right,pe=window.innerWidth-B.right-ae,Xe=window.innerWidth-j.right-pe,Ct=j.width+Xe,Cn=Math.max(Ct,R.width),bn=window.innerWidth-Mt,En=ss(pe,[Mt,Math.max(Mt,bn-Cn)]);s.style.minWidth=Ct+"px",s.style.right=En+"px"}const M=h(),P=window.innerHeight-Mt*2,V=y.scrollHeight,T=window.getComputedStyle(u),D=parseInt(T.borderTopWidth,10),U=parseInt(T.paddingTop,10),H=parseInt(T.borderBottomWidth,10),_=parseInt(T.paddingBottom,10),z=D+U+V+_+H,k=Math.min(S.offsetHeight*5,z),G=window.getComputedStyle(y),A=parseInt(G.paddingTop,10),C=parseInt(G.paddingBottom,10),Y=j.top+j.height/2-Mt,de=P-Y,Q=S.offsetHeight/2,K=S.offsetTop+Q,re=D+U+K,Ee=z-re;if(re<=Y){const ae=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const pe=u.clientHeight-y.offsetTop-y.offsetHeight,Xe=Math.max(de,Q+(ae?C:0)+pe+H),Ct=re+Xe;s.style.height=Ct+"px"}else{const ae=M.length>0&&S===M[0].ref.current;s.style.top="0px";const Xe=Math.max(Y,D+y.offsetTop+(ae?A:0)+Q)+Ee;s.style.height=Xe+"px",y.scrollTop=re-Y+y.offsetTop}s.style.margin=`${Mt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,u,y,S,m,o.dir,r]);We(()=>x(),[x]);const[b,N]=g.useState();We(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const E=g.useCallback(j=>{j&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return c.jsx(K2,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:c.jsx(ee.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Uv.displayName=H2;var W2="SelectPopperPosition",Ju=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Mt,...o}=e,l=Us(n);return c.jsx(HN,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ju.displayName=W2;var[K2,Ad]=_i(Nr,{}),Zu="SelectViewport",Vv=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=nr(Zu,n),l=Ad(Zu,n),s=ce(t,o.onViewportChange),a=g.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(Bs.Slot,{scope:n,children:c.jsx(ee.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ie(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=l;if(h!=null&&h.current&&d){const p=Math.abs(a.current-f.scrollTop);if(p>0){const w=window.innerHeight-Mt*2,y=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),m=Math.max(y,S);if(m0?b:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});Vv.displayName=Zu;var Hv="SelectGroup",[G2,Y2]=_i(Hv),Wv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gr();return c.jsx(G2,{scope:n,id:i,children:c.jsx(ee.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Wv.displayName=Hv;var Kv="SelectLabel",Gv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y2(Kv,n);return c.jsx(ee.div,{id:i.id,...r,ref:t})});Gv.displayName=Kv;var fs="SelectItem",[Q2,Yv]=_i(fs),Qv=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=tr(fs,n),a=nr(fs,n),u=s.value===r,[f,d]=g.useState(o??""),[h,p]=g.useState(!1),w=ce(t,v=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,v,r,i)}),y=gr(),S=g.useRef("touch"),m=()=>{i||(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 c.jsx(Q2,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:g.useCallback(v=>{d(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Bs.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:c.jsx(ee.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:ie(l.onFocus,()=>p(!0)),onBlur:ie(l.onBlur,()=>p(!1)),onClick:ie(l.onClick,()=>{S.current!=="mouse"&&m()}),onPointerUp:ie(l.onPointerUp,()=>{S.current==="mouse"&&m()}),onPointerDown:ie(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:ie(l.onPointerMove,v=>{var x;S.current=v.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:ie(l.onKeyDown,v=>{var b;((b=a.searchRef)==null?void 0:b.current)!==""&&v.key===" "||(O2.includes(v.key)&&m(),v.key===" "&&v.preventDefault())})})})})});Qv.displayName=fs;var qi="SelectItemText",qv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=tr(qi,n),s=nr(qi,n),a=Yv(qi,n),u=F2(qi,n),[f,d]=g.useState(null),h=ce(t,m=>d(m),a.onItemTextChange,m=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,m,a.value,a.disabled)}),p=f==null?void 0:f.textContent,w=g.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:p},a.value),[a.disabled,a.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return We(()=>(y(w),()=>S(w)),[y,S,w]),c.jsxs(c.Fragment,{children:[c.jsx(ee.span,{id:a.textId,...o,ref:h}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?bi.createPortal(o.children,l.valueNode):null]})});qv.displayName=qi;var Xv="SelectItemIndicator",Jv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Yv(Xv,n).isSelected?c.jsx(ee.span,{"aria-hidden":!0,...r,ref:t}):null});Jv.displayName=Xv;var ec="SelectScrollUpButton",Zv=g.forwardRef((e,t)=>{const n=nr(ec,e.__scopeSelect),r=Ad(ec,e.__scopeSelect),[i,o]=g.useState(!1),l=ce(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(tx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Zv.displayName=ec;var tc="SelectScrollDownButton",ex=g.forwardRef((e,t)=>{const n=nr(tc,e.__scopeSelect),r=Ad(tc,e.__scopeSelect),[i,o]=g.useState(!1),l=ce(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,f=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(tx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});ex.displayName=tc;var tx=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=nr("SelectScrollButton",n),l=g.useRef(null),s=$s(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),We(()=>{var f;const u=s().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),c.jsx(ee.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ie(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ie(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ie(i.onPointerLeave,()=>{a()})})}),q2="SelectSeparator",nx=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(ee.div,{"aria-hidden":!0,...r,ref:t})});nx.displayName=q2;var nc="SelectArrow",X2=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Us(n),o=tr(nc,n),l=nr(nc,n);return o.open&&l.position==="popper"?c.jsx(WN,{...i,...r,ref:t}):null});X2.displayName=nc;var J2="SelectBubbleInput",rx=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ce(r,i),l=vd(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(ee.select,{...n,style:{...wv,...n.style},ref:o,defaultValue:t})});rx.displayName=J2;function ix(e){return e===""||e===void 0}function ox(e){const t=Cr(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function lx(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Z2(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function Z2(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ej=Av,sx=Mv,tj=Lv,nj=Dv,rj=zv,ax=Fv,ij=Vv,oj=Wv,ux=Gv,cx=Qv,lj=qv,sj=Jv,dx=Zv,fx=ex,px=nx;const aj=ej,Xp=oj,uj=tj,hx=g.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(sx,{ref:r,className:oe("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,c.jsx(nj,{asChild:!0,children:c.jsx(hd,{className:"h-4 w-4 opacity-50"})})]}));hx.displayName=sx.displayName;const mx=g.forwardRef(({className:e,...t},n)=>c.jsx(dx,{ref:n,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(jC,{className:"h-4 w-4"})}));mx.displayName=dx.displayName;const gx=g.forwardRef(({className:e,...t},n)=>c.jsx(fx,{ref:n,className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(hd,{className:"h-4 w-4"})}));gx.displayName=fx.displayName;const yx=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(rj,{children:c.jsxs(ax,{ref:i,className:oe("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:[c.jsx(mx,{}),c.jsx(ij,{className:oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(gx,{})]})}));yx.displayName=ax.displayName;const rc=g.forwardRef(({className:e,...t},n)=>c.jsx(ux,{ref:n,className:oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));rc.displayName=ux.displayName;const ic=g.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(cx,{ref:r,className:oe("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(sj,{children:c.jsx(bC,{className:"h-4 w-4"})})}),c.jsx(lj,{children:t})]}));ic.displayName=cx.displayName;const cj=g.forwardRef(({className:e,...t},n)=>c.jsx(px,{ref:n,className:oe("-mx-1 my-1 h-px bg-muted",e),...t}));cj.displayName=px.displayName;function dj(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var $o=e=>{const{present:t,children:n}=e,r=fj(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ce(r.ref,pj(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};$o.displayName="Presence";function fj(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=dj(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=pl(r.current);o.current=s==="mounted"?u:"none"},[s]),We(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,p=pl(u);e?a("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),We(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=p=>{const y=pl(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},h=p=>{p.target===t&&(o.current=pl(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function pl(e){return(e==null?void 0:e.animationName)||"none"}function pj(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vs="Collapsible",[hj,JA]=er(Vs),[mj,Id]=hj(Vs),vx=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=e,[a,u]=xi({prop:r,defaultProp:i??!1,onChange:l,caller:Vs});return c.jsx(mj,{scope:n,disabled:o,contentId:gr(),open:a,onOpenToggle:g.useCallback(()=>u(f=>!f),[u]),children:c.jsx(ee.div,{"data-state":Od(a),"data-disabled":o?"":void 0,...s,ref:t})})});vx.displayName=Vs;var xx="CollapsibleTrigger",wx=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Id(xx,n);return c.jsx(ee.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Od(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ie(e.onClick,i.onOpenToggle)})});wx.displayName=xx;var Md="CollapsibleContent",Sx=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Id(Md,e.__scopeCollapsible);return c.jsx($o,{present:n||i.open,children:({present:o})=>c.jsx(gj,{...r,ref:t,present:o})})});Sx.displayName=Md;var gj=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=Id(Md,n),[s,a]=g.useState(r),u=g.useRef(null),f=ce(t,u),d=g.useRef(0),h=d.current,p=g.useRef(0),w=p.current,y=l.open||s,S=g.useRef(y),m=g.useRef(void 0);return g.useEffect(()=>{const v=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(v)},[]),We(()=>{const v=u.current;if(v){m.current=m.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();d.current=x.height,p.current=x.width,S.current||(v.style.transitionDuration=m.current.transitionDuration,v.style.animationName=m.current.animationName),a(r)}},[l.open,r]),c.jsx(ee.div,{"data-state":Od(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:y&&i})});function Od(e){return e?"open":"closed"}var yj=vx;const vj=yj,xj=wx,wj=Sx;var Hs="Dialog",[kx,Cx]=er(Hs),[Sj,Ht]=kx(Hs),bx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,f]=xi({prop:r,defaultProp:i??!1,onChange:o,caller:Hs});return c.jsx(Sj,{scope:t,triggerRef:s,contentRef:a,contentId:gr(),titleId:gr(),descriptionId:gr(),open:u,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};bx.displayName=Hs;var Ex="DialogTrigger",Nx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ht(Ex,n),o=ce(t,i.triggerRef);return c.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":zd(i.open),...r,ref:o,onClick:ie(e.onClick,i.onOpenToggle)})});Nx.displayName=Ex;var Ld="DialogPortal",[kj,jx]=kx(Ld,{forceMount:void 0}),Px=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Ht(Ld,t);return c.jsx(kj,{scope:t,forceMount:n,children:g.Children.map(r,l=>c.jsx($o,{present:n||o.open,children:c.jsx(Td,{asChild:!0,container:i,children:l})}))})};Px.displayName=Ld;var ps="DialogOverlay",_x=g.forwardRef((e,t)=>{const n=jx(ps,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ht(ps,e.__scopeDialog);return o.modal?c.jsx($o,{present:r||o.open,children:c.jsx(bj,{...i,ref:t})}):null});_x.displayName=ps;var Cj=vi("DialogOverlay.RemoveScroll"),bj=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ht(ps,n);return c.jsx(Tv,{as:Cj,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(ee.div,{"data-state":zd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jr="DialogContent",Rx=g.forwardRef((e,t)=>{const n=jx(jr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Ht(jr,e.__scopeDialog);return c.jsx($o,{present:r||o.open,children:o.modal?c.jsx(Ej,{...i,ref:t}):c.jsx(Nj,{...i,ref:t})})});Rx.displayName=jr;var Ej=g.forwardRef((e,t)=>{const n=Ht(jr,e.__scopeDialog),r=g.useRef(null),i=ce(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return kv(o)},[]),c.jsx(Tx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,o=>o.preventDefault())})}),Nj=g.forwardRef((e,t)=>{const n=Ht(jr,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return c.jsx(Tx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Tx=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Ht(jr,n),a=g.useRef(null),u=ce(t,a);return qy(),c.jsxs(c.Fragment,{children:[c.jsx(kd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(Sd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":zd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Pj,{titleId:s.titleId}),c.jsx(Rj,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Dd="DialogTitle",Ax=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ht(Dd,n);return c.jsx(ee.h2,{id:i.titleId,...r,ref:t})});Ax.displayName=Dd;var Ix="DialogDescription",Mx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ht(Ix,n);return c.jsx(ee.p,{id:i.descriptionId,...r,ref:t})});Mx.displayName=Ix;var Ox="DialogClose",Lx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ht(Ox,n);return c.jsx(ee.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>i.onOpenChange(!1))})});Lx.displayName=Ox;function zd(e){return e?"open":"closed"}var Dx="DialogTitleWarning",[jj,zx]=Ab(Dx,{contentName:jr,titleName:Dd,docsSlug:"dialog"}),Pj=({titleId:e})=>{const t=zx(Dx),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 g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},_j="DialogDescriptionWarning",Rj=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zx(_j).contentName}}.`;return g.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tj=bx,Aj=Nx,Ij=Px,Mj=_x,Oj=Rx,Lj=Ax,Dj=Mx,Fx=Lx,Bx="AlertDialog",[zj,ZA]=er(Bx,[Cx]),kn=Cx(),$x=e=>{const{__scopeAlertDialog:t,...n}=e,r=kn(t);return c.jsx(Tj,{...r,...n,modal:!0})};$x.displayName=Bx;var Fj="AlertDialogTrigger",Bj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return c.jsx(Aj,{...i,...r,ref:t})});Bj.displayName=Fj;var $j="AlertDialogPortal",Ux=e=>{const{__scopeAlertDialog:t,...n}=e,r=kn(t);return c.jsx(Ij,{...r,...n})};Ux.displayName=$j;var Uj="AlertDialogOverlay",Vx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return c.jsx(Mj,{...i,...r,ref:t})});Vx.displayName=Uj;var si="AlertDialogContent",[Vj,Hj]=zj(si),Wj=Eb("AlertDialogContent"),Hx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=kn(n),l=g.useRef(null),s=ce(t,l),a=g.useRef(null);return c.jsx(jj,{contentName:si,titleName:Wx,docsSlug:"alert-dialog",children:c.jsx(Vj,{scope:n,cancelRef:a,children:c.jsxs(Oj,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:ie(i.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=a.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(Wj,{children:r}),c.jsx(Gj,{contentRef:l})]})})})});Hx.displayName=si;var Wx="AlertDialogTitle",Kx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return c.jsx(Lj,{...i,...r,ref:t})});Kx.displayName=Wx;var Gx="AlertDialogDescription",Yx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return c.jsx(Dj,{...i,...r,ref:t})});Yx.displayName=Gx;var Kj="AlertDialogAction",Qx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=kn(n);return c.jsx(Fx,{...i,...r,ref:t})});Qx.displayName=Kj;var qx="AlertDialogCancel",Xx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Hj(qx,n),o=kn(n),l=ce(t,i);return c.jsx(Fx,{...o,...r,ref:l})});Xx.displayName=qx;var Gj=({contentRef:e})=>{const t=`\`${si}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${si}\` by passing a \`${Gx}\` 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 \`${si}\`. 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 g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Yj=$x,Qj=Ux,Jx=Vx,Zx=Hx,e0=Qx,t0=Xx,n0=Kx,r0=Yx;const qj=Yj,Xj=Qj,i0=g.forwardRef(({className:e,...t},n)=>c.jsx(Jx,{className:oe("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}));i0.displayName=Jx.displayName;const o0=g.forwardRef(({className:e,...t},n)=>c.jsxs(Xj,{children:[c.jsx(i0,{}),c.jsx(Zx,{ref:n,className:oe("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})]}));o0.displayName=Zx.displayName;const l0=({className:e,...t})=>c.jsx("div",{className:oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});l0.displayName="AlertDialogHeader";const s0=({className:e,...t})=>c.jsx("div",{className:oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});s0.displayName="AlertDialogFooter";const a0=g.forwardRef(({className:e,...t},n)=>c.jsx(n0,{ref:n,className:oe("text-lg font-semibold",e),...t}));a0.displayName=n0.displayName;const u0=g.forwardRef(({className:e,...t},n)=>c.jsx(r0,{ref:n,className:oe("text-sm text-muted-foreground",e),...t}));u0.displayName=r0.displayName;const c0=g.forwardRef(({className:e,...t},n)=>c.jsx(e0,{ref:n,className:oe(yd(),e),...t}));c0.displayName=e0.displayName;const d0=g.forwardRef(({className:e,...t},n)=>c.jsx(t0,{ref:n,className:oe(yd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));d0.displayName=t0.displayName;const f0=g.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:oe("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}));f0.displayName="Textarea";function Jj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Zj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tP={};function Jp(e,t){return((t||tP).jsx?eP:Zj).test(e)}const nP=/[ \t\n\f\r]/g;function rP(e){return typeof e=="object"?e.type==="text"?Zp(e.value):!1:Zp(e)}function Zp(e){return e.replace(nP,"")===""}class Uo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function p0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uo(n,r,t)}function oc(e){return e.toLowerCase()}class dt{constructor(t,n){this.attribute=n,this.property=t}}dt.prototype.attribute="";dt.prototype.booleanish=!1;dt.prototype.boolean=!1;dt.prototype.commaOrSpaceSeparated=!1;dt.prototype.commaSeparated=!1;dt.prototype.defined=!1;dt.prototype.mustUseProperty=!1;dt.prototype.number=!1;dt.prototype.overloadedBoolean=!1;dt.prototype.property="";dt.prototype.spaceSeparated=!1;dt.prototype.space=void 0;let iP=0;const J=Ar(),Te=Ar(),lc=Ar(),F=Ar(),ye=Ar(),ai=Ar(),pt=Ar();function Ar(){return 2**++iP}const sc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Te,commaOrSpaceSeparated:pt,commaSeparated:ai,number:F,overloadedBoolean:lc,spaceSeparated:ye},Symbol.toStringTag,{value:"Module"})),Ia=Object.keys(sc);class Fd extends dt{constructor(t,n,r,i){let o=-1;if(super(t,n),eh(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&uP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(th,fP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!th.test(o)){let l=o.replace(aP,dP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Fd}return new i(r,t)}function dP(e){return"-"+e.toLowerCase()}function fP(e){return e.charAt(1).toUpperCase()}const pP=p0([h0,oP,y0,v0,x0],"html"),Bd=p0([h0,lP,y0,v0,x0],"svg");function hP(e){return e.join(" ").trim()}var $d={},nh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,mP=/\n/g,gP=/^\s*/,yP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vP=/^:\s*/,xP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wP=/^[;\s]*/,SP=/^\s+|\s+$/g,kP=` +`,rh="/",ih="*",ur="",CP="comment",bP="declaration",EP=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var y=w.match(mP);y&&(n+=y.length);var S=w.lastIndexOf(kP);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return i(S),e=e.slice(S.length),y}}function u(){a(gP)}function f(w){var y;for(w=w||[];y=d();)y!==!1&&w.push(y);return w}function d(){var w=o();if(!(rh!=e.charAt(0)||ih!=e.charAt(1))){for(var y=2;ur!=e.charAt(y)&&(ih!=e.charAt(y)||rh!=e.charAt(y+1));)++y;if(y+=2,ur===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,i(S),e=e.slice(y),r+=2,w({type:CP,comment:S})}}function h(){var w=o(),y=a(yP);if(y){if(d(),!a(vP))return s("property missing ':'");var S=a(xP),m=w({type:bP,property:oh(y[0].replace(nh,ur)),value:S?oh(S[0].replace(nh,ur)):ur});return a(wP),m}}function p(){var w=[];f(w);for(var y;y=h();)y!==!1&&(w.push(y),f(w));return w}return u(),p()};function oh(e){return e?e.replace(SP,ur):ur}var NP=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($d,"__esModule",{value:!0});$d.default=PP;var jP=NP(EP);function PP(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,jP.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.camelCase=void 0;var _P=/^--[a-zA-Z0-9_-]+$/,RP=/-([a-z])/g,TP=/^[^-]+$/,AP=/^-(webkit|moz|ms|o|khtml)-/,IP=/^-(ms)-/,MP=function(e){return!e||TP.test(e)||_P.test(e)},OP=function(e,t){return t.toUpperCase()},lh=function(e,t){return"".concat(t,"-")},LP=function(e,t){return t===void 0&&(t={}),MP(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(IP,lh):e=e.replace(AP,lh),e.replace(RP,OP))};Ws.camelCase=LP;var DP=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zP=DP($d),FP=Ws;function ac(e,t){var n={};return!e||typeof e!="string"||(0,zP.default)(e,function(r,i){r&&i&&(n[(0,FP.camelCase)(r,t)]=i)}),n}ac.default=ac;var BP=ac;const $P=gs(BP),w0=S0("end"),Ud=S0("start");function S0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function UP(e){const t=Ud(e),n=w0(e);if(t&&n)return{start:t,end:n}}function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sh(e.position):"start"in e||"end"in e?sh(e):"line"in e||"column"in e?uc(e):""}function uc(e){return ah(e&&e.line)+":"+ah(e&&e.column)}function sh(e){return uc(e&&e.start)+"-"+uc(e&&e.end)}function ah(e){return e&&typeof e=="number"?e:1}class qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=lo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Vd={}.hasOwnProperty,VP=new Map,HP=/[A-Z]/g,WP=new Set(["table","tbody","thead","tfoot","tr"]),KP=new Set(["td","th"]),k0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=t_(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=e_(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Bd:pP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=C0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function C0(e,t,n){if(t.type==="element")return YP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XP(e,t,n);if(t.type==="mdxjsEsm")return qP(e,t);if(t.type==="root")return JP(e,t,n);if(t.type==="text")return ZP(e,t)}function YP(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Bd,e.schema=i),e.ancestors.push(t);const o=E0(e,t.tagName,!1),l=n_(e,t);let s=Wd(e,t);return WP.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!rP(a):!0})),b0(e,l,o,t),Hd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function QP(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ao(e,t.position)}function qP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ao(e,t.position)}function XP(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Bd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:E0(e,t.name,!0),l=r_(e,t),s=Wd(e,t);return b0(e,l,o,t),Hd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function JP(e,t,n){const r={};return Hd(r,Wd(e,t)),e.create(t,e.Fragment,r,n)}function ZP(e,t){return t.value}function b0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function e_(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function t_(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=Ud(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function n_(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vd.call(t.properties,i)){const o=i_(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&KP.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function r_(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Ao(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Ao(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:VP;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(on(e,e.length,0,t),e):t}const dh={}.hasOwnProperty;function f_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=rr(/[A-Za-z]/),yt=rr(/[\dA-Za-z]/),m_=rr(/[#-'*+\--9=?A-Z^-~]/);function cc(e){return e!==null&&(e<32||e===127)}const dc=rr(/\d/),g_=rr(/[\dA-Fa-f]/),y_=rr(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function ct(e){return e!==null&&(e<0||e===32)}function fe(e){return e===-2||e===-1||e===32}const v_=rr(/\p{P}|\p{S}/u),x_=rr(/\s/);function rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ti(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return fe(a)?(e.enter(n),s(a)):t(a)}function s(a){return fe(a)&&o++l))return;const j=t.events.length;let R=j,B,O;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){O=t.events[R][1].end;break}B=!0}for(m(r),E=j;Ex;){const N=n[b];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function b_(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ph(e){if(e===null||ct(e)||x_(e))return 1;if(v_(e))return 2}function Gd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};hh(d,-a),hh(h,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Nt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Nt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=Nt(u,Gd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Nt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Nt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,on(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&fe(E)?xe(e,v,"linePrefix",o+1)(E):v(E)}function v(E){return E===null||q(E)?e.check(mh,y,b)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||q(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),x)}function b(E){return e.exit("codeFenced"),t(E)}function N(E,j,R){let B=0;return O;function O(D){return E.enter("lineEnding"),E.consume(D),E.exit("lineEnding"),M}function M(D){return E.enter("codeFencedFence"),fe(D)?xe(E,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):P(D)}function P(D){return D===s?(E.enter("codeFencedFenceSequence"),V(D)):R(D)}function V(D){return D===s?(B++,E.consume(D),V):B>=l?(E.exit("codeFencedFenceSequence"),fe(D)?xe(E,T,"whitespace")(D):T(D)):R(D)}function T(D){return D===null||q(D)?(E.exit("codeFencedFence"),j(D)):R(D)}}}function L_(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Oa={name:"codeIndented",tokenize:z_},D_={partial:!0,tokenize:F_};function z_(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),xe(e,o,"linePrefix",4+1)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):q(u)?e.attempt(D_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||q(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function F_(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):q(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):xe(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):q(l)?i(l):n(l)}}const B_={name:"codeText",previous:U_,resolve:$_,tokenize:V_};function $_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Hi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function A0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(m){return m===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(m),e.exit(o),h):m===null||m===32||m===41||cc(m)?n(m):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(m))}function h(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(s),h(m)):m===null||m===60||q(m)?n(m):(e.consume(m),m===92?w:p)}function w(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function y(m){return!f&&(m===null||m===41||ct(m))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(m)):f999||p===null||p===91||p===93&&!a||p===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||q(p)||s++>999?(e.exit("chunkString"),f(p)):(e.consume(p),a||(a=!fe(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function M0(e,t,n,r,i,o){let l;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),l=h===40?41:h,a):n(h)}function a(h){return h===l?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===l?(e.exit(o),a(l)):h===null?n(h):q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===l||h===null||q(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:f)}function d(h){return h===l||h===92?(e.consume(h),f):f(h)}}function so(e,t){let n;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):fe(i)?xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const X_={name:"definition",tokenize:Z_},J_={partial:!0,tokenize:eR};function Z_(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return I0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return ct(p)?so(e,u)(p):u(p)}function u(p){return A0(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(J_,d,d)(p)}function d(p){return fe(p)?xe(e,h,"whitespace")(p):h(p)}function h(p){return p===null||q(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function eR(e,t,n){return r;function r(s){return ct(s)?so(e,i)(s):n(s)}function i(s){return M0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return fe(s)?xe(e,l,"whitespace")(s):l(s)}function l(s){return s===null||q(s)?t(s):n(s)}}const tR={name:"hardBreakEscape",tokenize:nR};function nR(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return q(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const rR={name:"headingAtx",resolve:iR,tokenize:oR};function iR(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function oR(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||ct(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||q(f)?(e.exit("atxHeading"),t(f)):fe(f)?xe(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||ct(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const lR=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],yh=["pre","script","style","textarea"],sR={concrete:!0,name:"htmlFlow",resolveTo:cR,tokenize:dR},aR={partial:!0,tokenize:pR},uR={partial:!0,tokenize:fR};function cR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dR(e,t,n){const r=this;let i,o,l,s,a;return u;function u(C){return f(C)}function f(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),o=!0,y):C===63?(e.consume(C),i=3,r.interrupt?t:k):Jt(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function h(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,s=0,w):Jt(C)?(e.consume(C),i=4,r.interrupt?t:k):n(C)}function p(C){return C===45?(e.consume(C),r.interrupt?t:k):n(C)}function w(C){const Y="CDATA[";return C===Y.charCodeAt(s++)?(e.consume(C),s===Y.length?r.interrupt?t:P:w):n(C)}function y(C){return Jt(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function S(C){if(C===null||C===47||C===62||ct(C)){const Y=C===47,de=l.toLowerCase();return!Y&&!o&&yh.includes(de)?(i=1,r.interrupt?t(C):P(C)):lR.includes(l.toLowerCase())?(i=6,Y?(e.consume(C),m):r.interrupt?t(C):P(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?v(C):x(C))}return C===45||yt(C)?(e.consume(C),l+=String.fromCharCode(C),S):n(C)}function m(C){return C===62?(e.consume(C),r.interrupt?t:P):n(C)}function v(C){return fe(C)?(e.consume(C),v):O(C)}function x(C){return C===47?(e.consume(C),O):C===58||C===95||Jt(C)?(e.consume(C),b):fe(C)?(e.consume(C),x):O(C)}function b(C){return C===45||C===46||C===58||C===95||yt(C)?(e.consume(C),b):N(C)}function N(C){return C===61?(e.consume(C),E):fe(C)?(e.consume(C),N):x(C)}function E(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,j):fe(C)?(e.consume(C),E):R(C)}function j(C){return C===a?(e.consume(C),a=null,B):C===null||q(C)?n(C):(e.consume(C),j)}function R(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||ct(C)?N(C):(e.consume(C),R)}function B(C){return C===47||C===62||fe(C)?x(C):n(C)}function O(C){return C===62?(e.consume(C),M):n(C)}function M(C){return C===null||q(C)?P(C):fe(C)?(e.consume(C),M):n(C)}function P(C){return C===45&&i===2?(e.consume(C),U):C===60&&i===1?(e.consume(C),H):C===62&&i===4?(e.consume(C),G):C===63&&i===3?(e.consume(C),k):C===93&&i===5?(e.consume(C),z):q(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(aR,A,V)(C)):C===null||q(C)?(e.exit("htmlFlowData"),V(C)):(e.consume(C),P)}function V(C){return e.check(uR,T,A)(C)}function T(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),D}function D(C){return C===null||q(C)?V(C):(e.enter("htmlFlowData"),P(C))}function U(C){return C===45?(e.consume(C),k):P(C)}function H(C){return C===47?(e.consume(C),l="",_):P(C)}function _(C){if(C===62){const Y=l.toLowerCase();return yh.includes(Y)?(e.consume(C),G):P(C)}return Jt(C)&&l.length<8?(e.consume(C),l+=String.fromCharCode(C),_):P(C)}function z(C){return C===93?(e.consume(C),k):P(C)}function k(C){return C===62?(e.consume(C),G):C===45&&i===2?(e.consume(C),k):P(C)}function G(C){return C===null||q(C)?(e.exit("htmlFlowData"),A(C)):(e.consume(C),G)}function A(C){return e.exit("htmlFlow"),t(C)}}function fR(e,t,n){const r=this;return i;function i(l){return q(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function pR(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ks,t,n)}}const hR={name:"htmlText",tokenize:mR};function mR(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),N):k===63?(e.consume(k),x):Jt(k)?(e.consume(k),R):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,w):Jt(k)?(e.consume(k),v):n(k)}function f(k){return k===45?(e.consume(k),p):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):q(k)?(l=d,H(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),p):d(k)}function p(k){return k===62?U(k):k===45?h(k):d(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(o++)?(e.consume(k),o===G.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):q(k)?(l=y,H(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),m):y(k)}function m(k){return k===62?U(k):k===93?(e.consume(k),m):y(k)}function v(k){return k===null||k===62?U(k):q(k)?(l=v,H(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),b):q(k)?(l=x,H(k)):(e.consume(k),x)}function b(k){return k===62?U(k):x(k)}function N(k){return Jt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||yt(k)?(e.consume(k),E):j(k)}function j(k){return q(k)?(l=j,H(k)):fe(k)?(e.consume(k),j):U(k)}function R(k){return k===45||yt(k)?(e.consume(k),R):k===47||k===62||ct(k)?B(k):n(k)}function B(k){return k===47?(e.consume(k),U):k===58||k===95||Jt(k)?(e.consume(k),O):q(k)?(l=B,H(k)):fe(k)?(e.consume(k),B):U(k)}function O(k){return k===45||k===46||k===58||k===95||yt(k)?(e.consume(k),O):M(k)}function M(k){return k===61?(e.consume(k),P):q(k)?(l=M,H(k)):fe(k)?(e.consume(k),M):B(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,V):q(k)?(l=P,H(k)):fe(k)?(e.consume(k),P):(e.consume(k),T)}function V(k){return k===i?(e.consume(k),i=void 0,D):k===null?n(k):q(k)?(l=V,H(k)):(e.consume(k),V)}function T(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ct(k)?B(k):(e.consume(k),T)}function D(k){return k===47||k===62||ct(k)?B(k):n(k)}function U(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return fe(k)?xe(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return e.enter("htmlTextData"),l(k)}}const Yd={name:"labelEnd",resolveAll:xR,resolveTo:wR,tokenize:SR},gR={tokenize:kR},yR={tokenize:CR},vR={tokenize:bR};function xR(e){let t=-1;const n=[];for(;++t=3&&(u===null||q(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),fe(u)?xe(e,s,"whitespace")(u):s(u))}}const rt={continuation:{tokenize:MR},exit:LR,name:"list",tokenize:IR},TR={partial:!0,tokenize:DR},AR={partial:!0,tokenize:OR};function IR(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(p){const w=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:dc(p)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Al,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return dc(p)&&++l<10?(e.consume(p),a):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ks,r.interrupt?n:f,e.attempt(TR,h,d))}function f(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function d(p){return fe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function MR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ks,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!fe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(AR,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(rt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function OR(e,t,n){const r=this;return xe(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function LR(e){e.exit(this.containerState.type)}function DR(e,t,n){const r=this;return xe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const vh={name:"setextUnderline",resolveTo:zR,tokenize:FR};function zR(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function FR(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),fe(u)?xe(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||q(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const BR={tokenize:$R};function $R(e){const t=this,n=e.attempt(Ks,r,e.attempt(this.parser.constructs.flowInitial,i,xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(K_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const UR={resolveAll:L0()},VR=O0("string"),HR=O0("text");function O0(e){return{resolveAll:L0(e==="text"?WR:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(f){return u(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=i[f];let h=-1;if(d)for(;++h-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function iT(e,t){let n=-1;const r=[];let i;for(;++n0){const Tt=X.tokenStack[X.tokenStack.length-1];(Tt[1]||wh).call(X,void 0,Tt[0])}for($.position={start:Pn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Pn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function ST(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function F0(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function CT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return F0(e,t);const i={src:Ti(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function bT(e,t){const n={src:Ti(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ET(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function NT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return F0(e,t);const i={href:Ti(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function jT(e,t){const n={href:Ti(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function PT(e,t,n){const r=e.all(t),i=n?_T(n):B0(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function RT(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ud(t.children[1]),a=w0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function OT(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Ch(t.slice(i),i>0,!1)),o.join("")}function Ch(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Sh||o===kh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Sh||o===kh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function zT(e,t){const n={type:"text",value:DT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const BT={blockquote:mT,break:gT,code:yT,delete:vT,emphasis:xT,footnoteReference:wT,heading:ST,html:kT,imageReference:CT,image:bT,inlineCode:ET,linkReference:NT,link:jT,listItem:PT,list:RT,paragraph:TT,root:AT,strong:IT,table:MT,tableCell:LT,tableRow:OT,text:zT,thematicBreak:FT,toml:hl,yaml:hl,definition:hl,footnoteDefinition:hl};function hl(){}const $0=-1,Gs=0,ao=1,hs=2,Qd=3,qd=4,Xd=5,Jd=6,U0=7,V0=8,bh=typeof self=="object"?self:globalThis,$T=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Gs:case $0:return n(l,i);case ao:{const s=n([],i);for(const a of l)s.push(r(a));return s}case hs:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case Qd:return n(new Date(l),i);case qd:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case Xd:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case Jd:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case U0:{const{name:s,message:a}=l;return n(new bh[s](a),i)}case V0:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new bh[o](l),i)};return r},Eh=e=>$T(new Map,e)(0),zr="",{toString:UT}={},{keys:VT}=Object,Wi=e=>{const t=typeof e;if(t!=="object"||!e)return[Gs,t];const n=UT.call(e).slice(8,-1);switch(n){case"Array":return[ao,zr];case"Object":return[hs,zr];case"Date":return[Qd,zr];case"RegExp":return[qd,zr];case"Map":return[Xd,zr];case"Set":return[Jd,zr];case"DataView":return[ao,n]}return n.includes("Array")?[ao,n]:n.includes("Error")?[U0,n]:[hs,n]},ml=([e,t])=>e===Gs&&(t==="function"||t==="symbol"),HT=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Wi(l);switch(s){case Gs:{let f=l;switch(a){case"bigint":s=V0,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([$0],l)}return i([s,f],l)}case ao:{if(a){let h=l;return a==="DataView"?h=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(h=new Uint8Array(l)),i([a,[...h]],l)}const f=[],d=i([s,f],l);for(const h of l)f.push(o(h));return d}case hs:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([s,f],l);for(const h of VT(l))(e||!ml(Wi(l[h])))&&f.push([o(h),o(l[h])]);return d}case Qd:return i([s,l.toISOString()],l);case qd:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case Xd:{const f=[],d=i([s,f],l);for(const[h,p]of l)(e||!(ml(Wi(h))||ml(Wi(p))))&&f.push([o(h),o(p)]);return d}case Jd:{const f=[],d=i([s,f],l);for(const h of l)(e||!ml(Wi(h)))&&f.push(o(h));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Nh=(e,{json:t,lossy:n}={})=>{const r=[];return HT(!(t||n),!!t,new Map,r)(e),r},ms=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Eh(Nh(e,t)):structuredClone(e):(e,t)=>Eh(Nh(e,t));function WT(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function KT(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GT(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||WT,r=e.options.footnoteBackLabel||KT,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let v=typeof n=="string"?n:n(a,p);typeof v=="string"&&(v={type:"text",value:v}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else f.push(...w);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,m),s.push(m)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ms(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const H0=function(e){if(e==null)return XT;if(typeof e=="function")return Ys(e);if(typeof e=="object")return Array.isArray(e)?YT(e):QT(e);if(typeof e=="string")return qT(e);throw new Error("Expected function, string, or object as test")};function YT(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=W0,w,y,S;if((!t||o(a,u,f[f.length-1]||void 0))&&(p=nA(n(a,f)),p[0]===jh))return p;if("children"in a&&a.children){const m=a;if(m.children&&p[0]!==eA)for(y=(r?m.children.length:-1)+l,S=f.concat(m);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function Ph(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _h(e,t){const n=iA(e,t),r=n.one(e,void 0),i=GT(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function uA(e,t){return e&&"run"in e?async function(n,r){const i=_h(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _h(n,{file:r,...e||t})}}function Rh(e){if(e)throw e}var Il=Object.prototype.hasOwnProperty,G0=Object.prototype.toString,Th=Object.defineProperty,Ah=Object.getOwnPropertyDescriptor,Ih=function(t){return typeof Array.isArray=="function"?Array.isArray(t):G0.call(t)==="[object Array]"},Mh=function(t){if(!t||G0.call(t)!=="[object Object]")return!1;var n=Il.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Il.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Il.call(t,i)},Oh=function(t,n){Th&&n.name==="__proto__"?Th(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Lh=function(t,n){if(n==="__proto__")if(Il.call(t,n)){if(Ah)return Ah(t,n).value}else return;return t[n]},cA=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const Qt={basename:pA,dirname:hA,extname:mA,join:gA,sep:"/"};function pA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function hA(e){if(Vo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mA(e){Vo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function gA(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vA(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function Vo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xA={cwd:wA};function wA(){return"/"}function mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SA(e){if(typeof e=="string")e=new URL(e);else if(!mc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kA(e)}function kA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...w]=f;const y=r[h][1];hc(y)&&hc(p)&&(p=Da(!0,y,p)),r[h]=[u,p,...w]}}}}const NA=new Zd().freeze();function $a(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ua(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Va(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zh(e){if(!hc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gl(e){return jA(e)?e:new Y0(e)}function jA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function PA(e){return typeof e=="string"||_A(e)}function _A(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Bh=[],$h={allowDangerousHtml:!0},TA=/^(https?|ircs?|mailto|xmpp)$/i,AA=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function IA(e){const t=MA(e),n=OA(e);return LA(t.runSync(t.parse(n),n),e)}function MA(e){const t=e.rehypePlugins||Bh,n=e.remarkPlugins||Bh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$h}:$h;return NA().use(hT).use(n).use(uA,r).use(t)}function OA(e){const t=e.children||"",n=new Y0;return typeof t=="string"&&(n.value=t),n}function LA(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||DA;for(const f of AA)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+RA+f.id,void 0);return K0(e,u),GP(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,h){if(f.type==="raw"&&h&&typeof d=="number")return l?h.children.splice(d,1):h.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Ma)if(Object.hasOwn(Ma,p)&&Object.hasOwn(f.properties,p)){const w=f.properties[p],y=Ma[p];(y===null||y.includes(f.tagName))&&(f.properties[p]=a(String(w||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,h)),p&&h&&typeof d=="number")return s&&f.children?h.children.splice(d,1,...f.children):h.children.splice(d,1),d}}}function DA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||TA.test(e.slice(0,t))?e:""}const Q0=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=g.useRef(null),f=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),c.jsxs("div",{className:oe("flex h-full flex-col",e),ref:a,...s,children:[c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:c.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,h)=>c.jsxs("div",{className:oe("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:c.jsx(wy,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:oe("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:[c.jsxs("div",{className:"text-xs opacity-70",children:[d.role==="user"?"You":"Assistant"," • #",h+1]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(IA,{components:{p:({children:p})=>c.jsx("p",{className:"mb-2 last:mb-0",children:p}),ul:({children:p})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:p}),ol:({children:p})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:p}),li:({children:p})=>c.jsx("li",{className:"mb-1",children:p}),code:({children:p,className:w})=>!w?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:p}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:p}),pre:({children:p})=>c.jsx("div",{className:"mb-2 last:mb-0",children:p}),strong:({children:p})=>c.jsx("strong",{className:"font-semibold",children:p}),em:({children:p})=>c.jsx("em",{className:"italic",children:p}),blockquote:({children:p})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:p}),h1:({children:p})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:p}),h2:({children:p})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:p}),h3:({children:p})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:p})},children:d.content})})]}),d.role==="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:c.jsx(mb,{className:"h-4 w-4"})})]},`${d.id}-${h}`)),c.jsx("div",{ref:u})]}),c.jsx("div",{className:"border-t p-4",children:c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(f0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?c.jsx(me,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(ab,{className:"h-4 w-4"})}):c.jsx(me,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(eb,{className:"h-4 w-4"})})]})})]})});Q0.displayName="Chat";const Kt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function q0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function zA(){return q0()}class FA{getAllSessions(){const t=localStorage.getItem(Kt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:q0(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},o=this.getAllSessions();return o.unshift(i),localStorage.setItem(Kt.sessions,JSON.stringify(o)),i}updateSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);i!==-1&&(r[i]={...r[i],...n,updatedAt:Date.now()},localStorage.setItem(Kt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Kt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Kt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:zA(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Kt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Kt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Kt.currentSession,t)}clear(){localStorage.removeItem(Kt.sessions),localStorage.removeItem(Kt.currentSession)}}const Se=new FA;function BA(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[f,d]=g.useState({isLoading:!1,error:null}),[h,p]=g.useState(n),[w,y]=g.useState(r),[S,m]=g.useState(.7),[v,x]=g.useState(1024),b=Lt.useMemo(()=>{var D;const T=i.find(U=>U.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!T,messageCount:((D=T==null?void 0:T.messages)==null?void 0:D.length)||0}),T},[i,l]),N=Lt.useMemo(()=>{const T=(b==null?void 0:b.messages)||[];return console.log("useChat - messages computed:",T.length,T.map(D=>({id:D.id,role:D.role}))),T},[b==null?void 0:b.messages]);g.useEffect(()=>{const T=Se.getAllSessions();o(T);const D=Se.getCurrentSession();D?s(D.id):T.length>0&&(s(T[0].id),Se.setCurrentSession(T[0].id))},[]);const E=g.useCallback(()=>{const T=Se.createSession(void 0,h,w),D=Se.getAllSessions();return o([...D]),s(T.id),Se.setCurrentSession(T.id),T.id},[h,w]),j=g.useCallback(T=>{s(T),Se.setCurrentSession(T)},[]),R=g.useCallback(T=>{Se.deleteSession(T);const D=Se.getAllSessions();o([...D]),l===T&&(D.length>0?(s(D[0].id),Se.setCurrentSession(D[0].id)):s(null))},[l]),B=g.useCallback((T,D)=>{Se.updateSession(T,{title:D});const U=Se.getAllSessions();o([...U])},[]),O=g.useCallback(T=>{if(!l)return;Se.addMessageToSession(l,T);const D=Se.getAllSessions();o([...D])},[l]),M=g.useCallback(async()=>{var _,z;if(!a.trim()||f.isLoading)return;let T=l;T||(T=E());const D=a.trim();if(u(""),d({isLoading:!0,error:null}),T){Se.addMessageToSession(T,{role:"user",content:D});const k=Se.getAllSessions();o([...k])}const U=Se.getSession(T),H=(U==null?void 0:U.messages)&&U.messages.length>1;if(w&&!H&&T){Se.addMessageToSession(T,{role:"system",content:w});const k=Se.getAllSessions();o([...k])}try{const k=Se.getSession(T),G=((z=(_=k==null?void 0:k.messages)==null?void 0:_.filter(Y=>Y.role!=="system"))==null?void 0:z.map(Y=>({role:Y.role,content:Y.content})))||[],A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:G,system_prompt:w||null,model_name:h,temperature:S,max_new_tokens:v})});if(!A.ok){const Y=await A.json();throw new Error(Y.detail||`HTTP error! status: ${A.status}`)}const C=await A.json();if(T){Se.addMessageToSession(T,{role:"assistant",content:C.content,thinking_content:C.thinking_content,model_used:C.model_used,supports_thinking:C.supports_thinking});const Y=Se.getAllSessions();o([...Y])}d({isLoading:!1,error:null})}catch(k){const G=k instanceof Error?k.message:"An error occurred";if(d({isLoading:!1,error:G}),T){Se.addMessageToSession(T,{role:"assistant",content:`Sorry, I encountered an error: ${G}`});const A=Se.getAllSessions();o([...A])}}},[a,f.isLoading,l,E,O,w,N.length,t,h,S,v]),P=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),V=g.useCallback(()=>{Se.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:b,currentSessionId:l,createNewSession:E,selectSession:j,deleteSession:R,renameSession:B,clearAllSessions:V,messages:N,input:a,setInput:u,sendMessage:M,stopGeneration:P,isLoading:f.isLoading,error:f.error,selectedModel:h,setSelectedModel:p,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}}function $A(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:f,isLoading:d,selectedModel:h,setSelectedModel:p,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}=BA(),[b,N]=g.useState(!1),[E,j]=g.useState(!1),[R,B]=g.useState(null),[O,M]=g.useState(!1),[P,V]=g.useState(null),[T,D]=g.useState([]),U=[{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."}],H=[{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."}];g.useEffect(()=>{k()},[]),g.useEffect(()=>{if(h&&!T.find(A=>A.model_name===h)){const A=T[0];A&&p(A.model_name)}},[T,h,p]),g.useEffect(()=>{(async()=>{if(!h||!T.length)return;const C=T.find(Q=>Q.model_name===h);if(!C)return;const Y=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";if(C.type==="local"&&!C.is_loaded){V(C),M(!0);return}const de=T.filter(Q=>Q.type==="local"&&Q.is_loaded&&Q.model_name!==h);for(const Q of de)try{(await fetch(`${Y}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Q.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Q.model_name}`)}catch(K){console.error(`Error auto-unloading model ${Q.model_name}:`,K)}de.length>0&&k()})()},[h,T]);const _=async()=>{if(P){M(!1),B(P.model_name);try{const A=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";if((await fetch(`${A}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:P.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${P.model_name}`),k();else{console.error(`❌ Failed to load model: ${P.model_name}`);const Y=T.find(de=>de.type==="api");Y&&p(Y.model_name)}}catch(A){console.error("Error loading model:",A);const C=T.find(Y=>Y.type==="api");C&&p(C.model_name)}finally{B(null),V(null)}}},z=()=>{M(!1),V(null);const A=T.find(C=>C.type==="api");A&&p(A.model_name)};g.useEffect(()=>{const A=async()=>{const C=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",Y=T.filter(de=>de.type==="local"&&de.is_loaded);for(const de of Y)try{await fetch(`${C}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:de.model_name})}),console.log(`✅ Cleanup: unloaded ${de.model_name}`)}catch(Q){console.error(`Error cleaning up model ${de.model_name}:`,Q)}};return()=>{A()}},[T]);const k=async()=>{try{const A=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",C=await fetch(`${A}/models`);if(C.ok){const Y=await C.json();if(D(Y.models),Y.current_model&&h!==Y.current_model)p(Y.current_model);else if(!h&&Y.models.length>0){const Q=Y.models.find(K=>K.type==="api")||Y.models[0];p(Q.model_name)}}}catch(A){console.error("Failed to fetch models:",A)}},G=A=>{a(A)};return c.jsxs("div",{className:"min-h-screen bg-background flex",children:[c.jsx("div",{className:` + ${b?"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:c.jsxs("div",{className:"p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs(me,{onClick:r,size:"sm",children:[c.jsx(qC,{className:"h-4 w-4 mr-1"}),"New"]})]}),c.jsx("div",{className:"space-y-2",children:e.map(A=>c.jsxs(De,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===A.id?"bg-accent border-primary":""}`,onClick:()=>i(A.id),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:A.title}),c.jsx(me,{size:"sm",variant:"ghost",onClick:C=>{C.stopPropagation(),o(A.id)},className:"h-6 w-6 p-0",children:c.jsx(Ny,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[A.messages.length," messages"]})]},A.id))})]})}),b&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>N(!1)}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(me,{variant:"ghost",size:"sm",onClick:()=>N(!b),className:"lg:hidden",children:b?c.jsx(KC,{className:"h-4 w-4"}):c.jsx(YC,{className:"h-4 w-4"})}),c.jsx(kr,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&c.jsxs(Ae,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[c.jsxs(me,{variant:"outline",size:"sm",onClick:()=>N(!b),className:"hidden lg:flex flex-shrink-0",children:[c.jsx(DC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),c.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(AC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"View code"}),c.jsx("span",{className:"sm:hidden",children:"Code"})]}),c.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(pb,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),c.jsxs(me,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(ob,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&c.jsx("div",{className:"p-6 border-b",children:c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{className:"text-base",children:"Start with a sample prompt"})}),c.jsx(Be,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:H.map((A,C)=>c.jsx(me,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>G(A.prompt),disabled:d,children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:A.title}),c.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:A.description})]})},C))})})]})}),c.jsx(Q0,{messages:l.map(A=>({id:A.id,role:A.role,content:A.content,createdAt:new Date(A.timestamp)})),input:s,handleInputChange:A=>a(A.target.value),handleSubmit:async A=>{A.preventDefault(),!(!h||!T.find(C=>C.model_name===h))&&await u()},isGenerating:d,stop:f,className:"flex-1"})]}),c.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:c.jsxs("div",{className:"p-4 space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(md,{className:"h-4 w-4"}),c.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{className:"text-sm",children:"Model Selection"})}),c.jsxs(Be,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-xs font-medium mb-2",children:"Active Model"}),c.jsxs(aj,{value:h||"",onValueChange:p,children:[c.jsx(hx,{className:"w-full",children:c.jsx(uj,{placeholder:"Select a model...",children:h&&(()=>{const A=T.find(Y=>Y.model_name===h);if(!A)return h;const C=A.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[C?c.jsx(ii,{className:"h-4 w-4 text-blue-500"}):A.supports_thinking?c.jsx(hn,{className:"h-4 w-4 text-purple-500"}):c.jsx(_o,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:A.name}),R===h?c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(Ae,{variant:"outline",className:"text-xs",children:C?"API":A.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(yx,{children:[c.jsxs(Xp,{children:[c.jsx(rc,{children:"🌐 API Models"}),T.filter(A=>A.type==="api").map(A=>c.jsx(ic,{value:A.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ii,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:A.name}),c.jsx(Ae,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},A.model_name))]}),c.jsxs(Xp,{children:[c.jsx(rc,{children:"💻 Local Models"}),T.filter(A=>A.type==="local").map(A=>c.jsx(ic,{value:A.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[A.supports_thinking?c.jsx(hn,{className:"h-4 w-4 text-purple-500"}):c.jsx(_o,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:A.name}),R===A.model_name?c.jsx(Ae,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):A.is_loaded?c.jsx(Ae,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):c.jsx(Ae,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},A.model_name))]})]})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsx(me,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:c.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{className:"text-sm",children:"Parameters"})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Oe,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),c.jsx(Ku,{value:[S],onValueChange:A=>m(A[0]),min:0,max:2,step:.01,className:"mt-2",disabled:d}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),c.jsxs("div",{children:[c.jsxs(Oe,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),c.jsx(Ku,{value:[v],onValueChange:A=>x(A[0]),min:100,max:4096,step:100,className:"mt-2",disabled:d})]})]})]}),c.jsx(De,{children:c.jsxs(vj,{open:E,onOpenChange:j,children:[c.jsx(Ze,{children:c.jsx(xj,{asChild:!0,children:c.jsxs(me,{variant:"ghost",className:"w-full justify-between p-0",disabled:d,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(kr,{className:"h-4 w-4"}),c.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&c.jsx(Ae,{variant:"secondary",className:"text-xs",children:"Custom"})]}),c.jsx(hd,{className:`h-4 w-4 transition-transform ${E?"transform rotate-180":""}`})]})})}),c.jsx(wj,{children:c.jsxs(Be,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),c.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:U.map(A=>c.jsx(me,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>y(A.prompt),disabled:d,children:A.name},A.name))})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx(Oe,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&c.jsxs(me,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-6 px-2 text-xs",disabled:d,children:[c.jsx(JC,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),c.jsx("textarea",{id:"system-prompt",value:w,onChange:A=>y(A.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}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),c.jsx(qj,{open:O,onOpenChange:M,children:c.jsxs(o0,{children:[c.jsxs(l0,{children:[c.jsxs(a0,{className:"flex items-center gap-2",children:[c.jsx(ky,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),c.jsx(u0,{asChild:!0,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["You're about to load ",c.jsx("strong",{children:P==null?void 0:P.name})," locally."]}),c.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(db,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),c.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Storage:"})," ",P==null?void 0:P.size_gb]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"RAM:"})," ~",P==null?void 0:P.size_gb," (while running)"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),c.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:c.jsxs("div",{className:"text-sm text-blue-700",children:[c.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),c.jsx("p",{className:"mt-1",children:P==null?void 0:P.description}),(P==null?void 0:P.supports_thinking)&&c.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[c.jsx(hn,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),c.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."})]})})]}),c.jsxs(s0,{children:[c.jsx(d0,{onClick:z,children:"Cancel"}),c.jsx(c0,{onClick:_,children:"Load Model"})]})]})})]})}function UA(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[i,o]=g.useState(null);g.useEffect(()=>{l()},[]);const l=async()=>{try{const u=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"",f=await fetch(`${u}/models`);if(f.ok){const d=await f.json();t(d.models)}}catch(u){console.error("Failed to fetch models:",u)}finally{r(!1)}},s=async u=>{o(u);try{const f=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";(await fetch(`${f}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(f){console.error("Failed to load model:",f)}finally{o(null)}},a=async u=>{try{const f=window.location.hostname==="localhost"?`${window.location.protocol}//${window.location.host}`:"";(await fetch(`${f}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(f){console.error("Failed to unload model:",f)}};return n?c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]})})}),c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx(Ey,{className:"h-8 w-8 animate-spin"})})]}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(me,{variant:"outline",size:"sm",onClick:l,children:"Refresh"})})]})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsx(De,{className:"bg-blue-50 border-blue-200",children:c.jsx(Be,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(by,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),c.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."})]})]})})}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(ii,{className:"h-5 w-5"}),"API Models",c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(u=>u.type==="api").map(u=>c.jsx(Uh,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(Cy,{className:"h-5 w-5"}),"Local Models",c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Privacy-First"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(u=>u.type==="local").map(u=>c.jsx(Uh,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{children:"Model Statistics"})}),c.jsx(Be,{children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Available Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(u=>u.is_loaded).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(u=>u.supports_thinking).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function Uh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api";return c.jsxs(De,{className:"relative",children:[c.jsx(Ze,{children:c.jsx("div",{className:"flex items-start justify-between",children:c.jsxs("div",{className:"flex items-center gap-3",children:[i?c.jsx(ii,{className:"h-6 w-6 text-blue-500"}):e.supports_thinking?c.jsx(hn,{className:"h-6 w-6 text-blue-500"}):c.jsx(_o,{className:"h-6 w-6 text-green-500"}),c.jsxs("div",{children:[c.jsx(ot,{className:"text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[i?c.jsxs(Ae,{variant:"default",className:"bg-blue-600",children:[c.jsx(ii,{className:"h-3 w-3 mr-1"}),"API Model"]}):c.jsxs(Ae,{variant:e.supports_thinking?"default":"secondary",children:[c.jsx(Cy,{className:"h-3 w-3 mr-1"}),e.supports_thinking?"Thinking Model":"Instruction Model"]}),e.is_loaded&&c.jsxs(Ae,{variant:"outline",className:"text-green-600 border-green-600",children:[c.jsx(_C,{className:"h-3 w-3 mr-1"}),i?"Ready":"Loaded"]})]})]})]})})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{children:["Size: ",e.size_gb]}),!i&&c.jsx("span",{children:"Format: Safetensors"}),i&&c.jsx("span",{children:"Type: Cloud API"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Capabilities"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Text Generation"}),c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Conversation"}),c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Code"}),e.supports_thinking&&c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Reasoning"}),i&&e.model_name.includes("vl")&&c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Vision"})]})]}),c.jsx("div",{className:"pt-2 border-t",children:e.is_loaded?c.jsxs("div",{className:"flex gap-2",children:[!i&&c.jsxs(me,{variant:"outline",size:"sm",onClick:()=>r(e.model_name),className:"flex-1",children:[c.jsx(Ny,{className:"h-4 w-4 mr-2"}),"Unload"]}),c.jsx(me,{size:"sm",className:"flex-1",asChild:!0,children:c.jsx("a",{href:"/playground",children:"Use in Playground"})})]}):c.jsx(me,{onClick:()=>n(e.model_name),disabled:t===e.model_name,className:"w-full",size:"sm",children:t===e.model_name?c.jsxs(c.Fragment,{children:[c.jsx(Ey,{className:"h-4 w-4 mr-2 animate-spin"}),i?"Connecting...":"Loading..."]}):c.jsxs(c.Fragment,{children:[i?c.jsx(ii,{className:"h-4 w-4 mr-2"}):c.jsx(ky,{className:"h-4 w-4 mr-2"}),i?"Connect":"Load Model"]})})})]})]})}var Qs="Switch",[VA,eI]=er(Qs),[HA,WA]=VA(Qs),X0=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:s,value:a="on",onCheckedChange:u,form:f,...d}=e,[h,p]=g.useState(null),w=ce(t,x=>p(x)),y=g.useRef(!1),S=h?f||!!h.closest("form"):!0,[m,v]=xi({prop:i,defaultProp:o??!1,onChange:u,caller:Qs});return c.jsxs(HA,{scope:n,checked:m,disabled:s,children:[c.jsx(ee.button,{type:"button",role:"switch","aria-checked":m,"aria-required":l,"data-state":t1(m),"data-disabled":s?"":void 0,disabled:s,value:a,...d,ref:w,onClick:ie(e.onClick,x=>{v(b=>!b),S&&(y.current=x.isPropagationStopped(),y.current||x.stopPropagation())})}),S&&c.jsx(e1,{control:h,bubbles:!y.current,name:r,value:a,checked:m,required:l,disabled:s,form:f,style:{transform:"translateX(-100%)"}})]})});X0.displayName=Qs;var J0="SwitchThumb",Z0=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=WA(J0,n);return c.jsx(ee.span,{"data-state":t1(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});Z0.displayName=J0;var KA="SwitchBubbleInput",e1=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=g.useRef(null),s=ce(l,o),a=vd(n),u=xd(t);return g.useEffect(()=>{const f=l.current;if(!f)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&p){const w=new Event("click",{bubbles:r});p.call(f,n),f.dispatchEvent(w)}},[a,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});e1.displayName=KA;function t1(e){return e?"checked":"unchecked"}var n1=X0,GA=Z0;const Gt=g.forwardRef(({className:e,...t},n)=>c.jsx(n1,{className:oe("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:c.jsx(GA,{className:oe("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")})}));Gt.displayName=n1.displayName;function YA(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(md,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs(ot,{className:"flex items-center gap-2",children:[c.jsx(nb,{className:"h-5 w-5"}),"Server Configuration"]})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Backend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Frontend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Auto-connect on startup"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically connect to backend when app starts"})]}),c.jsx(Gt,{defaultChecked:!0})]})})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs(ot,{className:"flex items-center gap-2",children:[c.jsx(hn,{className:"h-5 w-5"}),"Model Preferences"]})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Auto-load last used model"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically load the last used model on startup"})]}),c.jsx(Gt,{})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Show model thinking process"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Display thinking content for supported models"})]}),c.jsx(Gt,{defaultChecked:!0})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Confirm model loading"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Show confirmation dialog before downloading models"})]}),c.jsx(Gt,{defaultChecked:!0})]})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs(ot,{className:"flex items-center gap-2",children:[c.jsx(HC,{className:"h-5 w-5"}),"Interface"]})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Dark mode"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Use dark theme for the interface"})]}),c.jsx(Gt,{})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Compact mode"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Use smaller spacing for more content"})]}),c.jsx(Gt,{})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Show sample prompts"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Display quick start prompts in playground"})]}),c.jsx(Gt,{defaultChecked:!0})]})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs(ot,{className:"flex items-center gap-2",children:[c.jsx(Uu,{className:"h-5 w-5"}),"Privacy & Data"]})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Uu,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),c.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Save conversation history"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Store conversations locally for reference"})]}),c.jsx(Gt,{})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Save system prompts"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Remember custom system prompts"})]}),c.jsx(Gt,{defaultChecked:!0})]})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsxs(ot,{className:"flex items-center gap-2",children:[c.jsx(by,{className:"h-5 w-5"}),"System Information"]})}),c.jsxs(Be,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Platform"}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx(Ae,{variant:"outline",children:"Local"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),c.jsxs("div",{children:[c.jsx(Oe,{className:"text-sm font-medium",children:"Version"}),c.jsx("div",{className:"mt-1",children:c.jsx(Ae,{variant:"outline",children:"v1.0.0"})})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium",children:"Storage Location"}),c.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:"~/.edge-llm/models/"})]}),c.jsx(me,{variant:"outline",size:"sm",children:"Open Folder"})]})})]})]}),c.jsxs(De,{children:[c.jsx(Ze,{children:c.jsx(ot,{children:"Actions"})}),c.jsx(Be,{children:c.jsxs("div",{className:"flex gap-2",children:[c.jsx(me,{variant:"outline",children:"Export Settings"}),c.jsx(me,{variant:"outline",children:"Import Settings"}),c.jsx(me,{variant:"outline",children:"Reset to Defaults"})]})})]})]})})]})}function QA(){return c.jsx(Ok,{children:c.jsx(Pk,{children:c.jsxs(Fr,{path:"/",element:c.jsx(wb,{}),children:[c.jsx(Fr,{index:!0,element:c.jsx(Tb,{})}),c.jsx(Fr,{path:"playground",element:c.jsx($A,{})}),c.jsx(Fr,{path:"models",element:c.jsx(UA,{})}),c.jsx(Fr,{path:"settings",element:c.jsx(YA,{})})]})})})}Ha.createRoot(document.getElementById("root")).render(c.jsx(Lt.StrictMode,{children:c.jsx(QA,{})})); +//# sourceMappingURL=index-b709415f.js.map