diff --git "a/static/assets/index-06085ffb.js" "b/static/assets/index-06085ffb.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-06085ffb.js" @@ -0,0 +1,357 @@ +function z1(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 ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bh={exports:{}},Bs={},kh={exports:{}},ae={};/** + * @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 $o=Symbol.for("react.element"),F1=Symbol.for("react.portal"),B1=Symbol.for("react.fragment"),$1=Symbol.for("react.strict_mode"),U1=Symbol.for("react.profiler"),V1=Symbol.for("react.provider"),H1=Symbol.for("react.context"),W1=Symbol.for("react.forward_ref"),G1=Symbol.for("react.suspense"),K1=Symbol.for("react.memo"),Q1=Symbol.for("react.lazy"),Tf=Symbol.iterator;function Y1(e){return e===null||typeof e!="object"?null:(e=Tf&&e[Tf]||e["@@iterator"],typeof e=="function"?e:null)}var Nh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ch=Object.assign,jh={};function Pi(e,t,n){this.props=e,this.context=t,this.refs=jh,this.updater=n||Nh}Pi.prototype.isReactComponent={};Pi.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")};Pi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Eh(){}Eh.prototype=Pi.prototype;function Wc(e,t,n){this.props=e,this.context=t,this.refs=jh,this.updater=n||Nh}var Gc=Wc.prototype=new Eh;Gc.constructor=Wc;Ch(Gc,Pi.prototype);Gc.isPureReactComponent=!0;var Af=Array.isArray,Ph=Object.prototype.hasOwnProperty,Kc={current:null},Th={key:!0,ref:!0,__self:!0,__source:!0};function Ah(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)Ph.call(t,r)&&!Th.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,Y=A[V];if(0>>1;Vi(fe,b))iei(K,fe)?(A[V]=K,A[ie]=b,V=ie):(A[V]=fe,A[re]=b,V=re);else if(iei(K,b))A[V]=K,A[ie]=b,V=ie;else break e}}return F}function i(A,F){var b=A.sortIndex-F.sortIndex;return b!==0?b:A.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],d=1,f=null,p=3,m=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(A){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=A)r(c),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(c)}}function k(A){if(x=!1,v(A),!w)if(n(u)!==null)w=!0,O(j);else{var F=n(c);F!==null&&$(k,F.startTime-A)}}function j(A,F){w=!1,x&&(x=!1,y(T),T=-1),m=!0;var b=p;try{for(v(F),f=n(u);f!==null&&(!(f.expirationTime>F)||A&&!I());){var V=f.callback;if(typeof V=="function"){f.callback=null,p=f.priorityLevel;var Y=V(f.expirationTime<=F);F=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===n(u)&&r(u),v(F)}else r(u);f=n(u)}if(f!==null)var N=!0;else{var re=n(c);re!==null&&$(k,re.startTime-F),N=!1}return N}finally{f=null,p=b,m=!1}}var C=!1,E=null,T=-1,z=5,L=-1;function I(){return!(e.unstable_now()-LA||125V?(A.sortIndex=b,t(c,A),n(u)===null&&A===n(c)&&(x?(y(T),T=-1):x=!0,$(k,b-V))):(A.sortIndex=Y,t(u,A),w||m||(w=!0,O(j))),A},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(A){var F=p;return function(){var b=p;p=F;try{return A.apply(this,arguments)}finally{p=b}}}})(Lh);Mh.exports=Lh;var lw=Mh.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 sw=g,Pt=lw;function B(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"),wu=Object.prototype.hasOwnProperty,aw=/^[: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]*$/,If={},Rf={};function uw(e){return wu.call(Rf,e)?!0:wu.call(If,e)?!1:aw.test(e)?Rf[e]=!0:(If[e]=!0,!1)}function cw(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 dw(e,t,n,r){if(t===null||typeof t>"u"||cw(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 st(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 Xe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Xe[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Xe[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xe[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xe[e]=new st(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){Xe[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xe[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xe[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xe[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xe[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xc=/[\-:]([a-z])/g;function qc(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(Xc,qc);Xe[t]=new st(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(Xc,qc);Xe[t]=new st(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(Xc,qc);Xe[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xe[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Xe.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xe[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jc(e,t,n,r){var i=Xe.hasOwnProperty(t)?Xe[t]:null;(i!==null?i.type!==0:r||!(2a||i[l]!==o[a]){var u=` +`+i[l].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{Ca=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ji(e):""}function fw(e){switch(e.tag){case 5:return Ji(e.type);case 16:return Ji("Lazy");case 13:return Ji("Suspense");case 19:return Ji("SuspenseList");case 0:case 2:case 15:return e=ja(e.type,!1),e;case 11:return e=ja(e.type.render,!1),e;case 1:return e=ja(e.type,!0),e;default:return""}}function Nu(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 Hr:return"Fragment";case Vr:return"Portal";case Su:return"Profiler";case Zc:return"StrictMode";case bu:return"Suspense";case ku:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zh:return(e.displayName||"Context")+".Consumer";case Dh:return(e._context.displayName||"Context")+".Provider";case ed:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case td:return t=e.displayName||null,t!==null?t:Nu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Nu(e(t))}catch{}}return null}function pw(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 Nu(t);case 8:return t===Zc?"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 Jn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mw(e){var t=Bh(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 il(e){e._valueTracker||(e._valueTracker=mw(e))}function $h(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Bh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ns(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 Cu(e,t){var n=t.checked;return Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Lf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jn(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 Uh(e,t){t=t.checked,t!=null&&Jc(e,"checked",t,!1)}function ju(e,t){Uh(e,t);var n=Jn(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")?Eu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Eu(e,t.type,Jn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Of(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 Eu(e,t,n){(t!=="number"||ns(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zi=Array.isArray;function ri(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ol.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ro={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},hw=["Webkit","ms","Moz","O"];Object.keys(ro).forEach(function(e){hw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ro[t]=ro[e]})});function Gh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ro.hasOwnProperty(e)&&ro[e]?(""+t).trim():t+"px"}function Kh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Gh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var gw=Me({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 Au(e,t){if(t){if(gw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function _u(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 Iu=null;function nd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ru=null,ii=null,oi=null;function Ff(e){if(e=Ho(e)){if(typeof Ru!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ws(t),Ru(e.stateNode,e.type,t))}}function Qh(e){ii?oi?oi.push(e):oi=[e]:ii=e}function Yh(){if(ii){var e=ii,t=oi;if(oi=ii=null,Ff(e),t)for(e=0;e>>=0,e===0?32:31-(Ew(e)/Pw|0)|0}var ll=64,sl=4194304;function eo(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 ls(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 a=l&~i;a!==0?r=eo(a):(o&=l,o!==0&&(r=eo(o)))}else l=n&~i,l!==0?r=eo(l):o!==0&&(r=eo(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 Uo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function Iw(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=oo),Qf=String.fromCharCode(32),Yf=!1;function hg(e,t){switch(e){case"keyup":return lS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function aS(e,t){switch(e){case"compositionend":return gg(t);case"keypress":return t.which!==32?null:(Yf=!0,Qf);case"textInput":return e=t.data,e===Qf&&Yf?null:e;default:return null}}function uS(e,t){if(Wr)return e==="compositionend"||!cd&&hg(e,t)?(e=pg(),Il=sd=Fn=null,Wr=!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=Zf(n)}}function wg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sg(){for(var e=window,t=ns();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ns(e.document)}return t}function dd(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 yS(e){var t=Sg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&wg(n.ownerDocument.documentElement,n)){if(r!==null&&dd(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=ep(n,o);var l=ep(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,Gr=null,Fu=null,so=null,Bu=!1;function tp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bu||Gr==null||Gr!==ns(r)||(r=Gr,"selectionStart"in r&&dd(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}),so&&ko(so,r)||(so=r,r=us(Fu,"onSelect"),0Yr||(e.current=Gu[Yr],Gu[Yr]=null,Yr--)}function Ce(e,t){Yr++,Gu[Yr]=e.current,e.current=t}var Zn={},et=ir(Zn),ft=ir(!1),br=Zn;function xi(e,t){var n=e.type.contextTypes;if(!n)return Zn;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 pt(e){return e=e.childContextTypes,e!=null}function ds(){Te(ft),Te(et)}function ap(e,t,n){if(et.current!==Zn)throw Error(B(168));Ce(et,t),Ce(ft,n)}function Ag(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(B(108,pw(e)||"Unknown",i));return Me({},n,r)}function fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,br=et.current,Ce(et,e),Ce(ft,ft.current),!0}function up(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Ag(e,t,br),r.__reactInternalMemoizedMergedChildContext=e,Te(ft),Te(et),Ce(et,e)):Te(ft),Ce(ft,n)}var vn=null,Gs=!1,Ba=!1;function _g(e){vn===null?vn=[e]:vn.push(e)}function AS(e){Gs=!0,_g(e)}function or(){if(!Ba&&vn!==null){Ba=!0;var e=0,t=Se;try{var n=vn;for(Se=1;e>=l,i-=l,wn=1<<32-Kt(t)+i|n<T?(z=E,E=null):z=E.sibling;var L=p(y,E,v[T],k);if(L===null){E===null&&(E=z);break}e&&E&&L.alternate===null&&t(y,E),h=o(L,h,T),C===null?j=L:C.sibling=L,C=L,E=z}if(T===v.length)return n(y,E),Ae&&fr(y,T),j;if(E===null){for(;TT?(z=E,E=null):z=E.sibling;var I=p(y,E,L.value,k);if(I===null){E===null&&(E=z);break}e&&E&&I.alternate===null&&t(y,E),h=o(I,h,T),C===null?j=I:C.sibling=I,C=I,E=z}if(L.done)return n(y,E),Ae&&fr(y,T),j;if(E===null){for(;!L.done;T++,L=v.next())L=f(y,L.value,k),L!==null&&(h=o(L,h,T),C===null?j=L:C.sibling=L,C=L);return Ae&&fr(y,T),j}for(E=r(y,E);!L.done;T++,L=v.next())L=m(E,y,T,L.value,k),L!==null&&(e&&L.alternate!==null&&E.delete(L.key===null?T:L.key),h=o(L,h,T),C===null?j=L:C.sibling=L,C=L);return e&&E.forEach(function(P){return t(y,P)}),Ae&&fr(y,T),j}function S(y,h,v,k){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case rl:e:{for(var j=v.key,C=h;C!==null;){if(C.key===j){if(j=v.type,j===Hr){if(C.tag===7){n(y,C.sibling),h=i(C,v.props.children),h.return=y,y=h;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ln&&fp(j)===C.type){n(y,C.sibling),h=i(C,v.props),h.ref=Wi(y,C,v),h.return=y,y=h;break e}n(y,C);break}else t(y,C);C=C.sibling}v.type===Hr?(h=wr(v.props.children,y.mode,k,v.key),h.return=y,y=h):(k=Bl(v.type,v.key,v.props,null,y.mode,k),k.ref=Wi(y,h,v),k.return=y,y=k)}return l(y);case Vr:e:{for(C=v.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(y,h.sibling),h=i(h,v.children||[]),h.return=y,y=h;break e}else{n(y,h);break}else t(y,h);h=h.sibling}h=Qa(v,y.mode,k),h.return=y,y=h}return l(y);case Ln:return C=v._init,S(y,h,C(v._payload),k)}if(Zi(v))return w(y,h,v,k);if(Bi(v))return x(y,h,v,k);ml(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(y,h.sibling),h=i(h,v),h.return=y,y=h):(n(y,h),h=Ka(v,y.mode,k),h.return=y,y=h),l(y)):n(y,h)}return S}var vi=Lg(!0),Og=Lg(!1),hs=ir(null),gs=null,Jr=null,hd=null;function gd(){hd=Jr=gs=null}function xd(e){var t=hs.current;Te(hs),e._currentValue=t}function Yu(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 si(e,t){gs=e,hd=Jr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function Ot(e){var t=e._currentValue;if(hd!==e)if(e={context:e,memoizedValue:t,next:null},Jr===null){if(gs===null)throw Error(B(308));Jr=e,gs.dependencies={lanes:0,firstContext:e}}else Jr=Jr.next=e;return t}var gr=null;function yd(e){gr===null?gr=[e]:gr.push(e)}function Dg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,yd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(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 On=!1;function vd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zg(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 bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,yd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function Ml(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,id(e,n)}}function pp(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 xs(e,t,n,r){var i=e.updateQueue;On=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,c=u.next;u.next=null,l===null?o=c:l.next=c,l=u;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==l&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=u))}if(o!==null){var f=i.baseState;l=0,d=c=u=null,a=o;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,x=a;switch(p=t,m=n,x.tag){case 1:if(w=x.payload,typeof w=="function"){f=w.call(m,f,p);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=x.payload,p=typeof w=="function"?w.call(m,f,p):w,p==null)break e;f=Me({},f,p);break e;case 2:On=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,u=f):d=d.next=m,l|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(d===null&&(u=f),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,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);Cr|=l,e.lanes=l,e.memoizedState=f}}function mp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ua.transition;Ua.transition={};try{e(!1),t()}finally{Se=n,Ua.transition=r}}function tx(){return Dt().memoizedState}function MS(e,t,n){var r=Qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nx(e))rx(t,n);else if(n=Dg(e,t,n,r),n!==null){var i=ot();Qt(n,e,r,i),ix(n,t,r)}}function LS(e,t,n){var r=Qn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nx(e))rx(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,a=o(l,n);if(i.hasEagerState=!0,i.eagerState=a,Yt(a,l)){var u=t.interleaved;u===null?(i.next=i,yd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Dg(e,t,i,r),n!==null&&(i=ot(),Qt(n,e,r,i),ix(n,t,r))}}function nx(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function rx(e,t){ao=vs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ix(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,id(e,n)}}var ws={readContext:Ot,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},OS={readContext:Ot,useCallback:function(e,t){return on().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:gp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ol(4194308,4,Xg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ol(4,2,e,t)},useMemo:function(e,t){var n=on();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=on();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=MS.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=on();return e={current:e},t.memoizedState=e},useState:hp,useDebugValue:Ed,useDeferredValue:function(e){return on().memoizedState=e},useTransition:function(){var e=hp(!1),t=e[0];return e=RS.bind(null,e[1]),on().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,i=on();if(Ae){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ge===null)throw Error(B(349));Nr&30||Ug(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,gp(Hg.bind(null,r,o,e),[e]),r.flags|=2048,_o(9,Vg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=on(),t=Ge.identifierPrefix;if(Ae){var n=Sn,r=wn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=To++,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[sn]=t,e[jo]=r,mx(e,t,!1,!1),t.stateNode=e;e:{switch(l=_u(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),i=r;break;case"iframe":case"object":case"embed":Pe("load",e),i=r;break;case"video":case"audio":for(i=0;ibi&&(t.flags|=128,r=!0,Gi(o,!1),t.lanes=4194304)}else{if(!r)if(e=ys(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Gi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ae)return Je(t),null}else 2*De()-o.renderingStartTime>bi&&n!==1073741824&&(t.flags|=128,r=!0,Gi(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=De(),t.sibling=null,n=_e.current,Ce(_e,r?n&1|2:n&1),t):(Je(t),null);case 22:case 23:return Rd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function HS(e,t){switch(pd(t),t.tag){case 1:return pt(t.type)&&ds(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wi(),Te(ft),Te(et),bd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sd(t),null;case 13:if(Te(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(_e),null;case 4:return wi(),null;case 10:return xd(t.type._context),null;case 22:case 23:return Rd(),null;case 24:return null;default:return null}}var gl=!1,Ze=!1,WS=typeof WeakSet=="function"?WeakSet:Set,G=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function ic(e,t,n){try{n()}catch(r){Le(e,t,r)}}var Ep=!1;function GS(e,t){if($u=ss,e=Sg(),dd(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,a=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(a=l+i),f!==o||r!==0&&f.nodeType!==3||(u=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++c===i&&(a=l),p===o&&++d===r&&(u=l),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uu={focusedElem:e,selectionRange:n},ss=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;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 x=w.memoizedProps,S=w.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Vt(t.type,x),S);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(k){Le(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=Ep,Ep=!1,w}function uo(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&&ic(t,n,o)}i=i.next}while(i!==r)}}function Ys(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 oc(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 xx(e){var t=e.alternate;t!==null&&(e.alternate=null,xx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sn],delete t[jo],delete t[Wu],delete t[PS],delete t[TS])),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 yx(e){return e.tag===5||e.tag===3||e.tag===4}function Pp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yx(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 lc(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=cs));else if(r!==4&&(e=e.child,e!==null))for(lc(e,t,n),e=e.sibling;e!==null;)lc(e,t,n),e=e.sibling}function sc(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(sc(e,t,n),e=e.sibling;e!==null;)sc(e,t,n),e=e.sibling}var Ke=null,Wt=!1;function _n(e,t,n){for(n=n.child;n!==null;)vx(e,t,n),n=n.sibling}function vx(e,t,n){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount($s,n)}catch{}switch(n.tag){case 5:Ze||Zr(n,t);case 6:var r=Ke,i=Wt;Ke=null,_n(e,t,n),Ke=r,Wt=i,Ke!==null&&(Wt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(Wt?(e=Ke,n=n.stateNode,e.nodeType===8?Fa(e.parentNode,n):e.nodeType===1&&Fa(e,n),So(e)):Fa(Ke,n.stateNode));break;case 4:r=Ke,i=Wt,Ke=n.stateNode.containerInfo,Wt=!0,_n(e,t,n),Ke=r,Wt=i;break;case 0:case 11:case 14:case 15:if(!Ze&&(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)&&ic(n,t,l),i=i.next}while(i!==r)}_n(e,t,n);break;case 1:if(!Ze&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Le(n,t,a)}_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,_n(e,t,n),Ze=r):_n(e,t,n);break;default:_n(e,t,n)}}function Tp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new WS),t.forEach(function(r){var i=tb.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Bt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*QS(r/1960))-r,10e?16:e,Bn===null)var r=!1;else{if(e=Bn,Bn=null,ks=0,pe&6)throw Error(B(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var o=G,l=o.child;if(G.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uDe()-_d?vr(e,0):Ad|=n),mt(e,t)}function Ex(e,t){t===0&&(e.mode&1?(t=sl,sl<<=1,!(sl&130023424)&&(sl=4194304)):t=1);var n=ot();e=Cn(e,t),e!==null&&(Uo(e,t,n),mt(e,n))}function eb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ex(e,n)}function tb(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(B(314))}r!==null&&r.delete(t),Ex(e,n)}var Px;Px=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,US(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Ae&&t.flags&1048576&&Ig(t,ms,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dl(e,t),e=t.pendingProps;var i=xi(t,et.current);si(t,n),i=Nd(null,t,r,e,i,n);var o=Cd();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,pt(r)?(o=!0,fs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,vd(t),i.updater=Qs,t.stateNode=i,i._reactInternals=t,qu(t,r,e,n),t=ec(null,t,r,!0,o,n)):(t.tag=0,Ae&&o&&fd(t),it(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=rb(r),e=Vt(r,e),i){case 0:t=Zu(null,t,r,e,n);break e;case 1:t=Np(null,t,r,e,n);break e;case 11:t=bp(null,t,r,e,n);break e;case 14:t=kp(null,t,r,Vt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Zu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Np(e,t,r,i,n);case 3:e:{if(dx(t),e===null)throw Error(B(387));r=t.pendingProps,o=t.memoizedState,i=o.element,zg(e,t),xs(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=Si(Error(B(423)),t),t=Cp(e,t,r,n,i);break e}else if(r!==i){i=Si(Error(B(424)),t),t=Cp(e,t,r,n,i);break e}else for(bt=Wn(t.stateNode.containerInfo.firstChild),Nt=t,Ae=!0,Gt=null,n=Og(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yi(),r===i){t=jn(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return Fg(t),e===null&&Qu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Vu(r,i)?l=null:o!==null&&Vu(r,o)&&(t.flags|=32),cx(e,t),it(e,t,l,n),t.child;case 6:return e===null&&Qu(t),null;case 13:return fx(e,t,n);case 4:return wd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vi(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),bp(e,t,r,i,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(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,Ce(hs,r._currentValue),r._currentValue=l,o!==null)if(Yt(o.value,l)){if(o.children===i.children&&!ft.current){t=jn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=bn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Yu(o.return,n,t),a.lanes|=n;break}u=u.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(B(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Yu(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}it(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,si(t,n),i=Ot(i),r=r(i),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,i=Vt(r,t.pendingProps),i=Vt(r.type,i),kp(e,t,r,i,n);case 15:return ax(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vt(r,i),Dl(e,t),t.tag=1,pt(r)?(e=!0,fs(t)):e=!1,si(t,n),ox(t,r,i),qu(t,r,i,n),ec(null,t,r,!0,e,n);case 19:return px(e,t,n);case 22:return ux(e,t,n)}throw Error(B(156,t.tag))};function Tx(e,t){return ng(e,t)}function nb(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 Mt(e,t,n,r){return new nb(e,t,n,r)}function Ld(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rb(e){if(typeof e=="function")return Ld(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ed)return 11;if(e===td)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=Mt(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 Bl(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 Hr:return wr(n.children,i,o,t);case Zc:l=8,i|=8;break;case Su:return e=Mt(12,n,t,i|2),e.elementType=Su,e.lanes=o,e;case bu:return e=Mt(13,n,t,i),e.elementType=bu,e.lanes=o,e;case ku:return e=Mt(19,n,t,i),e.elementType=ku,e.lanes=o,e;case Fh:return qs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Dh:l=10;break e;case zh:l=9;break e;case ed:l=11;break e;case td:l=14;break e;case Ln:l=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Mt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function wr(e,t,n,r){return e=Mt(7,e,r,t),e.lanes=n,e}function qs(e,t,n,r){return e=Mt(22,e,r,t),e.elementType=Fh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ka(e,t,n){return e=Mt(6,e,null,t),e.lanes=n,e}function Qa(e,t,n){return t=Mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ib(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=Pa(0),this.expirationTimes=Pa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pa(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Od(e,t,n,r,i,o,l,a,u){return e=new ib(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Mt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vd(o),e}function ob(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rx)}catch(e){console.error(e)}}Rx(),Rh.exports=Tt;var _i=Rh.exports;const cb=Fs(_i);var Dp=_i;vu.createRoot=Dp.createRoot,vu.hydrateRoot=Dp.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 Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Mx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fb(){return Math.random().toString(36).substr(2,8)}function Fp(e,t){return{usr:e.state,key:e.key,idx:t}}function fc(e,t,n,r){return n===void 0&&(n=null),Ro({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ii(t):t,{state:n,key:t&&t.key||r||fb()})}function js(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 Ii(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 pb(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,a=$n.Pop,u=null,c=d();c==null&&(c=0,l.replaceState(Ro({},l.state,{idx:c}),""));function d(){return(l.state||{idx:null}).idx}function f(){a=$n.Pop;let S=d(),y=S==null?null:S-c;c=S,u&&u({action:a,location:x.location,delta:y})}function p(S,y){a=$n.Push;let h=fc(x.location,S,y);n&&n(h,S),c=d()+1;let v=Fp(h,c),k=x.createHref(h);try{l.pushState(v,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(k)}o&&u&&u({action:a,location:x.location,delta:1})}function m(S,y){a=$n.Replace;let h=fc(x.location,S,y);n&&n(h,S),c=d();let v=Fp(h,c),k=x.createHref(h);l.replaceState(v,"",k),o&&u&&u({action:a,location:x.location,delta:0})}function w(S){let y=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:js(S);return h=h.replace(/ $/,"%20"),$e(y,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,y)}let x={get action(){return a},get location(){return e(i,l)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(zp,f),u=S,()=>{i.removeEventListener(zp,f),u=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let y=w(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(S){return l.go(S)}};return x}var Bp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bp||(Bp={}));function mb(e,t,n){return n===void 0&&(n="/"),hb(e,t,n,!1)}function hb(e,t,n,r){let i=typeof t=="string"?Ii(t):t,o=Bd(i.pathname||"/",n);if(o==null)return null;let l=Lx(e);gb(l);let a=null;for(let u=0;a==null&&u{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};u.relativePath.startsWith("/")&&($e(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Xn([r,u.relativePath]),d=n.concat(u);o.children&&o.children.length>0&&($e(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Lx(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:kb(c,o.index),routesMeta:d})};return e.forEach((o,l)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,l);else for(let u of Ox(o.path))i(o,l,u)}),t}function Ox(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=Ox(r.join("/")),a=[];return a.push(...l.map(u=>u===""?o:[o,u].join("/"))),i&&a.push(...l),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function gb(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Nb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const xb=/^:[\w-]+$/,yb=3,vb=2,wb=1,Sb=10,bb=-2,$p=e=>e==="*";function kb(e,t){let n=e.split("/"),r=n.length;return n.some($p)&&(r+=bb),t&&(r+=vb),n.filter(i=>!$p(i)).reduce((i,o)=>i+(xb.test(o)?yb:o===""?wb:Sb),r)}function Nb(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 Cb(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let x=a[f]||"";l=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=a[f];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function jb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Mx(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,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Eb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mx(!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 Bd(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 Pb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ii(e):e;return{pathname:n?n.startsWith("/")?n:Tb(n,t):t,search:Ib(r),hash:Rb(i)}}function Tb(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 Ya(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 Ab(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Dx(e,t){let n=Ab(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function zx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ii(e):(i=Ro({},e),$e(!i.pathname||!i.pathname.includes("?"),Ya("?","pathname","search",i)),$e(!i.pathname||!i.pathname.includes("#"),Ya("#","pathname","hash",i)),$e(!i.search||!i.search.includes("#"),Ya("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,a;if(l==null)a=n;else{let f=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}a=f>=0?t[f]:"/"}let u=Pb(i,a),c=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Xn=e=>e.join("/").replace(/\/\/+/g,"/"),_b=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ib=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Rb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Mb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Fx=["post","put","patch","delete"];new Set(Fx);const Lb=["get",...Fx];new Set(Lb);/** + * 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 Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=zx(c,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Xn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,l,o,e])}const Fb=g.createContext(null);function Bb(e){let t=g.useContext(lr).outlet;return t&&g.createElement(Fb.Provider,{value:e},t)}function Ux(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Mr),{matches:i}=g.useContext(lr),{pathname:o}=Ko(),l=JSON.stringify(Dx(i,r.v7_relativeSplatPath));return g.useMemo(()=>zx(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function $b(e,t){return Ub(e,t)}function Ub(e,t,n,r){Go()||$e(!1);let{navigator:i}=g.useContext(Mr),{matches:o}=g.useContext(lr),l=o[o.length-1],a=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=Ko(),d;if(t){var f;let S=typeof t=="string"?Ii(t):t;u==="/"||(f=S.pathname)!=null&&f.startsWith(u)||$e(!1),d=S}else d=c;let p=d.pathname||"/",m=p;if(u!=="/"){let S=u.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=mb(e,{pathname:m}),x=Kb(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Xn([u,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Xn([u,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&x?g.createElement(na.Provider,{value:{location:Mo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:$n.Pop}},x):x}function Vb(){let e=qb(),t=Mb(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 Hb=g.createElement(Vb,null);class Wb 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(lr.Provider,{value:this.props.routeContext},g.createElement(Bx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gb(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext($d);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(lr.Provider,{value:t},r)}function Kb(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,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=l.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||$e(!1),l=l.slice(0,Math.min(l.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((d,f,p)=>{let m,w=!1,x=null,S=null;n&&(m=a&&f.route.id?a[f.route.id]:void 0,x=f.route.errorElement||Hb,u&&(c<0&&p===0?(Zb("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=f.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),h=()=>{let v;return m?v=x:w?v=S:f.route.Component?v=g.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,g.createElement(Gb,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?g.createElement(Wb,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:h(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):h()},null)}var Vx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Vx||{}),Es=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}(Es||{});function Qb(e){let t=g.useContext($d);return t||$e(!1),t}function Yb(e){let t=g.useContext(Ob);return t||$e(!1),t}function Xb(e){let t=g.useContext(lr);return t||$e(!1),t}function Hx(e){let t=Xb(),n=t.matches[t.matches.length-1];return n.route.id||$e(!1),n.route.id}function qb(){var e;let t=g.useContext(Bx),n=Yb(Es.UseRouteError),r=Hx(Es.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Jb(){let{router:e}=Qb(Vx.UseNavigateStable),t=Hx(Es.UseNavigateStable),n=g.useRef(!1);return $x(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Mo({fromRouteId:t},o)))},[e,t])}const Vp={};function Zb(e,t,n){!t&&!Vp[e]&&(Vp[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 tk(e){return Bb(e.context)}function rn(e){$e(!1)}function nk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=$n.Pop,navigator:o,static:l=!1,future:a}=e;Go()&&$e(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:o,static:l,future:Mo({v7_relativeSplatPath:!1},a)}),[u,a,o,l]);typeof r=="string"&&(r=Ii(r));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:w="default"}=r,x=g.useMemo(()=>{let S=Bd(d,u);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:w},navigationType:i}},[u,d,f,p,m,w,i]);return x==null?null:g.createElement(Mr.Provider,{value:c},g.createElement(na.Provider,{children:n,value:x}))}function rk(e){let{children:t,location:n}=e;return $b(pc(t),n)}new Promise(()=>{});function pc(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,pc(r.props.children,o));return}r.type!==rn&&$e(!1),!r.props.index||!r.props.children||$e(!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=pc(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 mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function ok(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lk(e,t){return e.button===0&&(!t||t==="_self")&&!ok(e)}const sk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ak="6";try{window.__reactRouterVersion=ak}catch{}const uk="startTransition",Hp=Yc[uk];function ck(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=db({window:i,v5Compat:!0}));let l=o.current,[a,u]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},d=g.useCallback(f=>{c&&Hp?Hp(()=>u(f)):u(f)},[u,c]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>ek(r),[r]),g.createElement(nk,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:l,future:r})}const dk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wp=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:a,target:u,to:c,preventScrollReset:d,viewTransition:f}=t,p=ik(t,sk),{basename:m}=g.useContext(Mr),w,x=!1;if(typeof c=="string"&&fk.test(c)&&(w=c,dk))try{let v=new URL(window.location.href),k=c.startsWith("//")?new URL(v.protocol+c):new URL(c),j=Bd(k.pathname,m);k.origin===v.origin&&j!=null?c=j+k.search+k.hash:x=!0}catch{}let S=Db(c,{relative:i}),y=pk(c,{replace:l,state:a,target:u,preventScrollReset:d,relative:i,viewTransition:f});function h(v){r&&r(v),v.defaultPrevented||y(v)}return g.createElement("a",mc({},p,{href:w||S,onClick:x||o?r:h,ref:n,target:u}))});var Gp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Gp||(Gp={}));var Kp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Kp||(Kp={}));function pk(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:a}=t===void 0?{}:t,u=Lr(),c=Ko(),d=Ux(e,{relative:l});return g.useCallback(f=>{if(lk(f,n)){f.preventDefault();let p=r!==void 0?r:js(c)===js(d);u(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:a})}},[c,u,d,r,i,n,e,o,l,a])}function Wx(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 a=n.get(l);if(a!==void 0)return a;if((a=r.get(l))!==void 0)return i(l,a),a},set:function(l,a){n.has(l)?n.set(l,a):i(l,a)}}}var Yx="!";function Sk(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var a=[],u=0,c=0,d,f=0;fc?d-c:void 0;return{modifiers:a,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:S}}}function bk(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 kk(e){return{cache:wk(e.cacheSize),splitModifiers:Sk(e),...hk(e)}}var Nk=/\s+/;function Ck(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(Nk).map(function(l){var a=n(l),u=a.modifiers,c=a.hasImportantModifier,d=a.baseClassName,f=a.maybePostfixModifierPosition,p=r(f?d.substring(0,f):d),m=!!f;if(!p){if(!f)return{isTailwindClass:!1,originalClassName:l};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=bk(u).join(":"),x=c?w+Yx:w;return{isTailwindClass:!0,modifierId:x,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var a=l.modifierId,u=l.classGroupId,c=l.hasPostfixModifier,d=a+u;return o.has(d)?!1:(o.add(d),i(u,c).forEach(function(f){return o.add(a+f)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function jk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),qp=e=>{const t=Vk(e);return t.charAt(0).toUpperCase()+t.slice(1)},Jx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Hk=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 Wk={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 Gk=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...a},u)=>g.createElement("svg",{ref:u,...Wk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Jx("lucide",i),...!o&&!Hk(a)&&{"aria-hidden":"true"},...a},[...l.map(([c,d])=>g.createElement(c,d)),...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 te=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(Gk,{ref:o,iconNode:t,className:Jx(`lucide-${Uk(qp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=qp(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 Kk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Qk=te("arrow-left",Kk);/** + * @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 Yk=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Xk=te("award",Yk);/** + * @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 qk=[["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"}]],ra=te("book-open",qk);/** + * @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 Jk=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Zk=te("bookmark",Jk);/** + * @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 eN=[["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"}]],ti=te("bot",eN);/** + * @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 tN=[["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"}]],Er=te("brain",tN);/** + * @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 nN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rN=te("check",nN);/** + * @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 iN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zx=te("chevron-down",iN);/** + * @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 oN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Jp=te("chevron-left",oN);/** + * @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 lN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zp=te("chevron-right",lN);/** + * @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 sN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],aN=te("chevron-up",sN);/** + * @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 uN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],cN=te("circle-check-big",uN);/** + * @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 dN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ps=te("cloud",dN);/** + * @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 fN=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ey=te("crown",fN);/** + * @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 pN=[["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"}]],mN=te("download",pN);/** + * @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 hN=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],gN=te("eye",hN);/** + * @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 xN=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],em=te("file",xN);/** + * @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 yN=[["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"}]],ty=te("hard-drive",yN);/** + * @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 vN=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],wN=te("heart",vN);/** + * @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 SN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ny=te("info",SN);/** + * @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 bN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xc=te("loader-circle",bN);/** + * @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 kN=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Vd=te("menu",kN);/** + * @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 NN=[["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"}]],ia=te("message-square",NN);/** + * @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 CN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ts=te("plus",CN);/** + * @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 jN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],ry=te("save",jN);/** + * @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 EN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tm=te("search",EN);/** + * @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 PN=[["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"}]],TN=te("send",PN);/** + * @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 AN=[["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"}]],_N=te("server",AN);/** + * @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 IN=[["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"}]],ui=te("settings",IN);/** + * @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 RN=[["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"}]],nm=te("shield",RN);/** + * @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 MN=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],LN=te("sliders-vertical",MN);/** + * @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 ON=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],DN=te("square",ON);/** + * @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 zN=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],FN=te("star",zN);/** + * @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 BN=[["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"}]],iy=te("trash-2",BN);/** + * @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 $N=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],oy=te("trending-up",$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 UN=[["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"}]],rm=te("upload",UN);/** + * @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 VN=[["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"}]],Hd=te("user",VN);/** + * @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 HN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],WN=te("users",HN);/** + * @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 GN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yc=te("x",GN);/** + * @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 KN=[["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"}]],vc=te("zap",KN),QN=[{name:"Templates",href:"/templates",icon:Er,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:ia,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:ra,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:ui,description:"Application settings"}];function YN(){const e=Ko();return s.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[s.jsx("div",{className:"p-6 border-b",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:s.jsx(Er,{className:"h-5 w-5 text-primary-foreground"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),s.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[s.jsx("div",{children:s.jsxs(Wp,{to:"/",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent text-muted-foreground hover:text-foreground",children:[s.jsx(Qk,{className:"h-4 w-4"}),s.jsx("span",{children:"Back to Home"})]})}),s.jsxs("div",{children:[s.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),s.jsx("nav",{className:"space-y-1",children:QN.map(t=>{const n=e.pathname===t.href;return s.jsxs(Wp,{to:t.href,className:ce("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:[s.jsx(t.icon,{className:"h-4 w-4"}),s.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})]})]})}function XN(){return s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx("div",{className:"w-64 border-r",children:s.jsx(YN,{})}),s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(tk,{})})]})}function im(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ly(...e){return t=>{let n=!1;const r=e.map(i=>{const o=im(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,a=g.Children.toArray(o),u=a.find(eC);if(u){const c=u.props.children,d=a.map(f=>f===u?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:f);return s.jsx(t,{...l,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,d):null})}return s.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var qN=ki("Slot");function JN(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=nC(i),a=tC(o,i.props);return i.type!==g.Fragment&&(a.ref=r?ly(r,l):l),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sy=Symbol("radix.slottable");function ZN(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sy,t}function eC(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sy}function tC(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]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function nC(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 om=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lm=Gx,Wd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return lm(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const p=om(d)||om(f);return i[c][p]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(w=>{let[x,S]=w;return Array.isArray(S)?S.includes({...o,...a}[x]):{...o,...a}[x]===S})?[...c,f,p]:c},[]);return lm(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},Gd=Wd("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"}}),J=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?qN:"button";return s.jsx(l,{className:ce(Gd({variant:t,size:n,className:e})),ref:o,...i})});J.displayName="Button";function rC(){const e=Lr();return s.jsxs("div",{className:"min-h-screen bg-white",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:t=>{console.error("Logo failed to load"),t.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Technology"}),s.jsx("button",{onClick:()=>e("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>e("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Vd,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"relative py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("div",{className:"relative mb-6",children:s.jsxs("h1",{className:"text-4xl md:text-6xl lg:text-7xl font-bold text-black leading-tight",children:["Offline AI that",s.jsx("br",{}),"works where the",s.jsx("br",{}),"cloud cannot"]})}),s.jsx("p",{className:"text-lg md:text-xl text-purple-700 font-semibold mb-8 max-w-3xl mx-auto",children:"AI that stays reliable, private, and resilient in any environment"}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center items-center mb-8",children:[s.jsx(J,{size:"lg",className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3 text-lg font-medium",onClick:()=>e("/usecases"),children:"Learn More"}),s.jsx(J,{size:"lg",variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-8 py-3 text-lg font-medium",onClick:()=>e("/mydevice"),children:"I already have a device"})]})]})}),s.jsx("div",{className:"py-12 px-4 sm:px-6 lg:px-8 bg-gray-50",children:s.jsx("div",{className:"max-w-6xl mx-auto",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/24h.png",alt:"Always Available & Reliable",className:"h-10 w-10",onError:t=>{console.error("24h icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Always Available & Reliable"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud AI fails without internet and latency can cost lives. Our offline AI runs instantly on-device, ready anywhere from remote locations to safety-critical moments."})]}),s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/privacy.png",alt:"Privacy & Security",className:"h-10 w-10",onError:t=>{console.error("Privacy icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Privacy & Security"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud AI requires uploading sensitive data. Offline AI keeps all processing local, protecting personal privacy and enterprise security."})]}),s.jsxs("div",{className:"bg-white rounded-2xl p-6 shadow-lg border border-gray-200 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-600 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("img",{src:"/assets/reliablity.png",alt:"Affordable & Powerful",className:"h-10 w-10",onError:t=>{console.error("Affordable icon failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("h3",{className:"text-lg font-bold text-black mb-3",children:"Affordable & Powerful"})]}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:"Cloud AI charges expensive per-token fees that scale with usage. Offline AI provides unlimited conversations with premium performance without recurring costs."})]})]})})}),s.jsx("footer",{className:"bg-white text-gray-600 py-8 px-4 sm:px-6 lg:px-8 border-t border-gray-200",children:s.jsxs("div",{className:"max-w-6xl mx-auto text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-12 w-12",onError:t=>{console.error("Footer logo failed to load"),t.currentTarget.style.display="none"}})}),s.jsx("p",{className:"text-gray-600 mb-6",children:"Need help? Contact us to get customized device and services"}),s.jsxs("div",{className:"flex justify-center space-x-6",children:[s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Privacy Policy"}),s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Terms of Service"}),s.jsx("a",{href:"#",className:"text-gray-500 hover:text-gray-700",children:"Support"})]})]})})]})}const iC=Wd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function xe({className:e,variant:t,...n}){return s.jsx("div",{className:ce(iC({variant:t}),e),...n})}const Ie=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ie.displayName="Card";const Ct=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",e),...t}));Ct.displayName="CardHeader";const jt=g.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));jt.displayName="CardTitle";const oC=g.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));oC.displayName="CardDescription";const Ye=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));Ye.displayName="CardContent";const lC=g.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));lC.displayName="CardFooter";function sC(){const[e,t]=g.useState("Hardware"),n=Lr();return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:r=>{console.error("Logo failed to load"),r.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("button",{onClick:()=>n("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Technology"}),s.jsx("button",{onClick:()=>n("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>n("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Vd,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"py-24 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Our Technology"}),s.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-8",children:"Low-cost FPGA-based design, optimized for Large Language Models on-device."}),s.jsx("div",{className:"flex justify-center mb-12",children:s.jsx("div",{className:"bg-white rounded-lg p-1 shadow-sm",children:["Hardware","Software"].map(r=>s.jsx("button",{onClick:()=>t(r),className:`px-6 py-2 rounded-md text-sm font-medium transition-all ${e===r?"bg-purple-600 text-white":"text-gray-700 hover:text-purple-600"}`,children:r},r))})})]})}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[e==="Hardware"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Hardware Description"}),s.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"EdgeMate is an ultra–low-budget single-board computer designed specifically for large language model (LLM) deployment. Despite its compact form factor and low power consumption, we provide:"}),s.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Accelerated inference performance — delivering up to 15 tokens per second on a 30B model, thanks to its optimized FPGA-based AI engine."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"High memory capacity — up to 40GB RAM, enabling hosting of LLMs up to ≥30B parameters."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Cost efficiency — making advanced AI workloads accessible at low cost."]})]})]}),s.jsx(Ie,{className:"bg-gradient-to-br from-purple-50 to-blue-50 border-0 shadow-lg",children:s.jsx(Ye,{className:"p-8 space-y-6",children:s.jsxs("div",{className:"flex flex-col space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Chip"}),s.jsx("span",{className:"text-base text-gray-700",children:"AMD Zynq UltraScale+ XCZU3EG"})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Processor"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Quad-core 64-bit Arm Cortex-A53 CPU"}),s.jsx("div",{children:"Dual-core 64-bit Arm Cortex-R5 CPU"}),s.jsx("div",{children:"ARM Mali-400 GPU"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"FPGA Fabric"}),s.jsx("span",{className:"text-base text-gray-700",children:"70K LUT, 360 DSP slices"})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Memory"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"8 GB 64-bit DDR4 (2400 Mbps) on CPU side"}),s.jsx("div",{children:"8 GB / 16 GB / 32 GB DDR4 (2133 Mbps) on FPGA side (SODIMM)"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Storage"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"256 GB PCIe 2.0 x1 NVMe SSD"}),s.jsx("div",{children:"MicroSD card slot"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-bold text-gray-900",children:"I/O"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"USB 2.0 / 3.0 via Type-C"}),s.jsx("div",{children:"Mini DisplayPort"})]})]})]})})})]}),e==="Software"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Software Stack"}),s.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"Our comprehensive software platform enables non-experts to personalize, test, and deploy LLM agents to edge devices with an intuitive web-based interface:"}),s.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"React 18 + TypeScript frontend with shadcn/ui design system for modern, accessible components."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"FastAPI + Python 3.11+ backend with hybrid inference routing between local FPGA and cloud APIs."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Integrated RAG system using LangChain, FAISS, and HuggingFace Transformers for document processing."]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Docker containerization with deployment on Hugging Face Spaces for accessible demonstrations."]})]})]}),s.jsx(Ie,{className:"bg-gradient-to-br from-purple-50 to-blue-50 border-0 shadow-lg",children:s.jsx(Ye,{className:"p-8 space-y-6",children:s.jsxs("div",{className:"flex flex-col space-y-4",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"Frontend Stack"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"React 18 + TypeScript"}),s.jsx("div",{children:"shadcn/ui + Radix UI"}),s.jsx("div",{children:"Tailwind CSS + Vite"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"Backend Stack"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"FastAPI + Python 3.11+"}),s.jsx("div",{children:"HuggingFace Transformers"}),s.jsx("div",{children:"OpenAI-compatible APIs"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"AI/ML Components"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"LangChain + FAISS"}),s.jsx("div",{children:"sentence-transformers"}),s.jsx("div",{children:"Quantization Support"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"Deployment"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Docker Containerization"}),s.jsx("div",{children:"Hugging Face Spaces"}),s.jsx("div",{children:"REST API Integration"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"Development Tools"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Python SDK"}),s.jsx("div",{children:"Model Optimization Tools"}),s.jsx("div",{children:"Performance Profiler"})]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("span",{className:"text-lg font-semibold text-gray-900",children:"Security"}),s.jsxs("div",{className:"text-base text-gray-700 text-right",children:[s.jsx("div",{children:"Secure Boot"}),s.jsx("div",{children:"Model Encryption"}),s.jsx("div",{children:"Access Control"})]})]})]})})})]})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"Why us?"}),s.jsxs("div",{className:"bg-white rounded-3xl shadow-xl overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-4 bg-gradient-to-r from-gray-50 to-gray-100",children:[s.jsx("div",{className:"p-6"}),s.jsx("div",{className:"p-6 text-center",children:s.jsx(xe,{className:"bg-purple-600 text-white font-bold px-4 py-2",children:"Ours"})}),s.jsx("div",{className:"p-6 text-center",children:s.jsx("span",{className:"font-bold text-gray-800",children:"Raspberry Pi 5"})}),s.jsx("div",{className:"p-6 text-center",children:s.jsx("span",{className:"font-bold text-gray-800",children:"Jetson Orin Nano"})})]}),[{label:"Price",ours:"$199",pi:"$120",jetson:"$249"},{label:"RAM",ours:"24GB/40GB",pi:"16GB",jetson:"8GB"},{label:"CPU",ours:"Cortex-A53",pi:"Cortex-A72",jetson:"Cortex-A78"},{label:"AI Engine",ours:"Optimized Accelerator on FPGA",pi:"Neon SIMD Instructions",jetson:"Cuda/Tensor Core"},{label:"Power",ours:"<10W",pi:"5-12 W",jetson:"7-25"},{label:"LLM decode Performance",ours:"15 tokens/s",pi:"<5 tokens/s",jetson:"15 tokens/s"}].map((r,i)=>s.jsxs("div",{className:`grid grid-cols-4 ${i%2===0?"bg-gray-50":"bg-white"}`,children:[s.jsx("div",{className:"p-4 font-medium text-gray-900 border-r border-gray-200",children:r.label}),s.jsx("div",{className:"p-4 text-center font-medium",style:{backgroundColor:"#F0EEF5",color:"#6750A4"},children:r.ours}),s.jsx("div",{className:"p-4 text-center text-purple-600 font-medium border-r border-gray-200",children:r.pi}),s.jsx("div",{className:"p-4 text-center text-purple-600 font-medium",children:r.jetson})]},r.label))]}),s.jsx("div",{className:"text-center mt-8",children:s.jsx(J,{onClick:()=>n("/usecases"),className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",children:"View use cases"})})]}),s.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[s.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"The device layout plan"}),s.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 text-center",children:[s.jsx("div",{className:"relative max-w-4xl mx-auto",children:s.jsx("img",{src:"/assets/chips.png",alt:"Device Layout Plan",className:"w-full h-auto rounded-lg shadow-lg",onError:r=>{console.error("Chips image failed to load"),r.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"flex justify-center space-x-4 mt-8",children:[s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white px-6 py-2",children:"Get your device"}),s.jsx(J,{variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-6 py-2",children:"View use cases"})]})]}),s.jsx("p",{className:"text-center text-gray-600 mt-6",children:"Need help? Contact us to get customized device and services"})]})]})}function aC(){const e=Lr(),t=[{id:1,category:"Use case 1: Outdoor Rescue",title:"Offline AI that guides survival in extreme environments",description:"When hikers, travelers, or drivers lose connection to mountains, forests, or rural roads, cloud AI systems can't offer real-time survival guidance, first aid tips, and emergency signaling — even without internet. Includes moments, it becomes your reliable voice of calm and safety.",image:"/api/placeholder/336/240",bgColor:"from-blue-100 to-purple-100"},{id:2,category:"Use case 2: Offline Healthcare",title:"A simple device for seniors to access trusted medical guidance",description:"Many elderly users struggle with smartphones and digital devices. Our simple, voice-only need to press a button or speak a request to get clear, step-by-step medical advice. No internet, no accounts, no complicated setup — just instant, private support for everyday health concerns that helps.",image:"/api/placeholder/336/240",bgColor:"from-green-100 to-blue-100"},{id:3,category:"Use case 3: AI Companion and Assistance",title:"A private, always-available conversational partner",description:"Life can be stressful and lonely at times. Our Offline AI device can be embedded inside a plush toy, transforming it into a private, always-available companion. It listens, talks, tells stories without uploading data to the cloud. AI partner that brings warmth, reassurance, and practical help whenever you need it.",image:"/api/placeholder/336/240",bgColor:"from-purple-100 to-pink-100"}];return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("nav",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between items-center h-20",children:[s.jsx("div",{className:"flex items-center",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-20 w-20",onError:n=>{console.error("Logo failed to load"),n.currentTarget.style.display="none"}})}),s.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[s.jsx("button",{onClick:()=>e("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Technology"}),s.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Use Cases"}),s.jsx(J,{variant:"outline",onClick:()=>e("/mydevice"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My Device"})]}),s.jsx("div",{className:"md:hidden",children:s.jsx(J,{variant:"ghost",size:"sm",children:s.jsx(Vd,{className:"h-5 w-5"})})})]})})}),s.jsx("div",{className:"py-16 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[s.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Use Case Examples"}),s.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-6",children:"Bringing intelligent computing to the edge of connectivity"})]})}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-8",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((n,r)=>s.jsx(Ie,{className:"bg-white shadow-lg border-0 rounded-3xl overflow-hidden h-full flex flex-col",children:s.jsxs(Ye,{className:"p-6 flex flex-col h-full",children:[s.jsx("div",{className:"w-full h-60 rounded-xl mb-6 overflow-hidden",children:s.jsx("img",{src:`/assets/${r===0?"outdoor_rescue.png":r===1?"health_care.png":"companion.png"}`,alt:n.title,className:"w-full h-full object-cover",onError:i=>{console.error(`Failed to load image for use case ${r+1}`),i.currentTarget.style.display="none";const o=document.createElement("div");o.className="w-full h-60 bg-gradient-to-br from-gray-200 to-gray-300 rounded-xl flex items-center justify-center",r===0?o.innerHTML='':r===1?o.innerHTML='':o.innerHTML='',i.currentTarget.parentNode&&i.currentTarget.parentNode.appendChild(o)}})}),s.jsxs("div",{className:"flex flex-col flex-grow space-y-4",children:[s.jsx("div",{className:"text-sm font-semibold text-purple-600",children:n.category}),s.jsx("h3",{className:"text-xl font-semibold text-black leading-tight",children:n.title}),s.jsx("p",{className:"text-gray-600 text-sm leading-relaxed flex-grow",children:n.description}),s.jsx("div",{className:"pt-4",children:s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white text-sm px-4 py-2 w-auto",onClick:()=>{let i="";n.id===1?i="outdoor-rescue":n.id===2?i="offline-healthcare":n.id===3&&(i="ai-companion"),i&&localStorage.setItem("selectedUseCase",i),e("/mydevice")},children:"Select"})})]})]})},n.id))})}),s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-8",children:s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-400/30 via-blue-500/30 to-pink-500/30 backdrop-blur-sm rounded-3xl"}),s.jsxs("div",{className:"relative bg-purple-400/20 backdrop-blur-lg rounded-3xl p-8 text-center",children:[s.jsx("div",{className:"flex justify-center mb-6 space-x-1",children:[...Array(20)].map((n,r)=>s.jsx("div",{className:"bg-purple-600 rounded-full animate-pulse",style:{width:"3px",height:`${Math.random()*40+10}px`,animationDelay:`${r*.1}s`,animationDuration:"1s"}},r))}),s.jsx("h2",{className:"text-2xl font-medium text-white mb-4",children:"Customize your own device"}),s.jsx("p",{className:"text-gray-900 mb-6",children:"Need help? Contact us to get customized device and services"}),s.jsx(J,{className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",onClick:()=>e("/mydevice"),children:"Get Started"})]})]})})]})}const ni=g.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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:r,...n}));ni.displayName="Input";var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=uC.reduce((e,t)=>{const n=ki(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...a}=i,u=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cC(e,t){e&&_i.flushSync(()=>e.dispatchEvent(t))}var dC="Label",ay=g.forwardRef((e,t)=>s.jsx(le.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())}}));ay.displayName=dC;var uy=ay;const fC=Wd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ne=g.forwardRef(({className:e,...t},n)=>s.jsx(uy,{ref:n,className:ce(fC(),e),...t}));Ne.displayName=uy.displayName;const Kd=g.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ce("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}));Kd.displayName="Textarea";function As(e,[t,n]){return Math.min(n,Math.max(t,e))}function ee(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 pC(e,t){const n=g.createContext(t),r=o=>{const{children:l,...a}=o,u=g.useMemo(()=>a,Object.values(a));return s.jsx(n.Provider,{value:u,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 sr(e,t=[]){let n=[];function r(o,l){const a=g.createContext(l),u=n.length;n=[...n,l];const c=f=>{var y;const{scope:p,children:m,...w}=f,x=((y=p==null?void 0:p[e])==null?void 0:y[u])||a,S=g.useMemo(()=>w,Object.values(w));return s.jsx(x.Provider,{value:S,children:m})};c.displayName=o+"Provider";function d(f,p){var x;const m=((x=p==null?void 0:p[e])==null?void 0:x[u])||a,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(a){const u=(a==null?void 0:a[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,mC(i,...t)]}function mC(...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((a,{useScope:u,scopeName:c})=>{const f=u(o)[`__scope${c}`];return{...a,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Qd(e){const t=e+"CollectionProvider",[n,r]=sr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:S,children:y}=x,h=Ht.useRef(null),v=Ht.useRef(new Map).current;return s.jsx(i,{scope:S,itemMap:v,collectionRef:h,children:y})};l.displayName=t;const a=e+"CollectionSlot",u=ki(a),c=Ht.forwardRef((x,S)=>{const{scope:y,children:h}=x,v=o(a,y),k=ve(S,v.collectionRef);return s.jsx(u,{ref:k,children:h})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=ki(d),m=Ht.forwardRef((x,S)=>{const{scope:y,children:h,...v}=x,k=Ht.useRef(null),j=ve(S,k),C=o(d,y);return Ht.useEffect(()=>(C.itemMap.set(k,{ref:k,...v}),()=>void C.itemMap.delete(k))),s.jsx(p,{[f]:"",ref:j,children:h})});m.displayName=d;function w(x){const S=o(e+"CollectionConsumer",x);return Ht.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:m},w,r]}var hC=g.createContext(void 0);function oa(e){const t=g.useContext(hC);return e||t||"ltr"}function er(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 gC(e,t=globalThis==null?void 0:globalThis.document){const n=er(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 xC="DismissableLayer",wc="dismissableLayer.update",yC="dismissableLayer.pointerDownOutside",vC="dismissableLayer.focusOutside",sm,cy=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...u}=e,c=g.useContext(cy),[d,f]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=ve(t,E=>f(E)),x=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=x.indexOf(S),h=d?x.indexOf(d):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=h>=y,j=bC(E=>{const T=E.target,z=[...c.branches].some(L=>L.contains(T));!k||z||(i==null||i(E),l==null||l(E),E.defaultPrevented||a==null||a())},p),C=kC(E=>{const T=E.target;[...c.branches].some(L=>L.contains(T))||(o==null||o(E),l==null||l(E),E.defaultPrevented||a==null||a())},p);return gC(E=>{h===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},p),g.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(sm=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),am(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=sm)}},[d,p,n,c]),g.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),am())},[d,c]),g.useEffect(()=>{const E=()=>m({});return document.addEventListener(wc,E),()=>document.removeEventListener(wc,E)},[]),s.jsx(le.div,{...u,ref:w,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,j.onPointerDownCapture)})});Yd.displayName=xC;var wC="DismissableLayerBranch",SC=g.forwardRef((e,t)=>{const n=g.useContext(cy),r=g.useRef(null),i=ve(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(le.div,{...e,ref:i})});SC.displayName=wC;function bC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){dy(yC,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 kC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&dy(vC,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 am(){const e=new CustomEvent(wc);document.dispatchEvent(e)}function dy(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?cC(i,o):i.dispatchEvent(o)}var Xa=0;function fy(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??um()),document.body.insertAdjacentElement("beforeend",e[1]??um()),Xa++,()=>{Xa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xa--}},[])}function um(){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 qa="focusScope.autoFocusOnMount",Ja="focusScope.autoFocusOnUnmount",cm={bubbles:!1,cancelable:!0},NC="FocusScope",Xd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[a,u]=g.useState(null),c=er(i),d=er(o),f=g.useRef(null),p=ve(t,x=>u(x)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let x=function(v){if(m.paused||!a)return;const k=v.target;a.contains(k)?f.current=k:Mn(f.current,{select:!0})},S=function(v){if(m.paused||!a)return;const k=v.relatedTarget;k!==null&&(a.contains(k)||Mn(f.current,{select:!0}))},y=function(v){if(document.activeElement===document.body)for(const j of v)j.removedNodes.length>0&&Mn(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",S);const h=new MutationObserver(y);return a&&h.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),h.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){fm.add(m);const x=document.activeElement;if(!a.contains(x)){const y=new CustomEvent(qa,cm);a.addEventListener(qa,c),a.dispatchEvent(y),y.defaultPrevented||(CC(AC(py(a)),{select:!0}),document.activeElement===x&&Mn(a))}return()=>{a.removeEventListener(qa,c),setTimeout(()=>{const y=new CustomEvent(Ja,cm);a.addEventListener(Ja,d),a.dispatchEvent(y),y.defaultPrevented||Mn(x??document.body,{select:!0}),a.removeEventListener(Ja,d),fm.remove(m)},0)}}},[a,c,d,m]);const w=g.useCallback(x=>{if(!n&&!r||m.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,y=document.activeElement;if(S&&y){const h=x.currentTarget,[v,k]=jC(h);v&&k?!x.shiftKey&&y===k?(x.preventDefault(),n&&Mn(v,{select:!0})):x.shiftKey&&y===v&&(x.preventDefault(),n&&Mn(k,{select:!0})):y===h&&x.preventDefault()}},[n,r,m.paused]);return s.jsx(le.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Xd.displayName=NC;function CC(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mn(r,{select:t}),document.activeElement!==n)return}function jC(e){const t=py(e),n=dm(t,e),r=dm(t.reverse(),e);return[n,r]}function py(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 dm(e,t){for(const n of e)if(!EC(n,{upTo:t}))return n}function EC(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 PC(e){return e instanceof HTMLInputElement&&"select"in e}function Mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PC(e)&&t&&e.select()}}var fm=TC();function TC(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pm(e,t),e.unshift(t)},remove(t){var n;e=pm(e,t),(n=e[0])==null||n.resume()}}}function pm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function AC(e){return e.filter(t=>t.tagName!=="A")}var tt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},_C=Yc[" useId ".trim().toString()]||(()=>{}),IC=0;function qn(e){const[t,n]=g.useState(_C());return tt(()=>{e||n(r=>r??String(IC++))},[e]),e||(t?`radix-${t}`:"")}const RC=["top","right","bottom","left"],tr=Math.min,wt=Math.max,_s=Math.round,wl=Math.floor,pn=e=>({x:e,y:e}),MC={left:"right",right:"left",bottom:"top",top:"bottom"},LC={start:"end",end:"start"};function Sc(e,t,n){return wt(e,tr(t,n))}function En(e,t){return typeof e=="function"?e(t):e}function Pn(e){return e.split("-")[0]}function Ri(e){return e.split("-")[1]}function qd(e){return e==="x"?"y":"x"}function Jd(e){return e==="y"?"height":"width"}const OC=new Set(["top","bottom"]);function cn(e){return OC.has(Pn(e))?"y":"x"}function Zd(e){return qd(cn(e))}function DC(e,t,n){n===void 0&&(n=!1);const r=Ri(e),i=Zd(e),o=Jd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Is(l)),[l,Is(l)]}function zC(e){const t=Is(e);return[bc(e),t,bc(t)]}function bc(e){return e.replace(/start|end/g,t=>LC[t])}const mm=["left","right"],hm=["right","left"],FC=["top","bottom"],BC=["bottom","top"];function $C(e,t,n){switch(e){case"top":case"bottom":return n?t?hm:mm:t?mm:hm;case"left":case"right":return t?FC:BC;default:return[]}}function UC(e,t,n,r){const i=Ri(e);let o=$C(Pn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(bc)))),o}function Is(e){return e.replace(/left|right|bottom|top/g,t=>MC[t])}function VC(e){return{top:0,right:0,bottom:0,left:0,...e}}function my(e){return typeof e!="number"?VC(e):{top:e,right:e,bottom:e,left:e}}function Rs(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 gm(e,t,n){let{reference:r,floating:i}=e;const o=cn(t),l=Zd(t),a=Jd(l),u=Pn(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(u){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Ri(t)){case"start":m[l]-=p*(n&&c?-1:1);break;case"end":m[l]+=p*(n&&c?-1:1);break}return m}const HC=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=o.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=gm(c,r,u),p=r,m={},w=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:u}=t,{element:c,padding:d=0}=En(e,t)||{};if(c==null)return{};const f=my(d),p={x:n,y:r},m=Zd(i),w=Jd(m),x=await l.getDimensions(c),S=m==="y",y=S?"top":"left",h=S?"bottom":"right",v=S?"clientHeight":"clientWidth",k=o.reference[w]+o.reference[m]-p[m]-o.floating[w],j=p[m]-o.reference[m],C=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let E=C?C[v]:0;(!E||!await(l.isElement==null?void 0:l.isElement(C)))&&(E=a.floating[v]||o.floating[w]);const T=k/2-j/2,z=E/2-x[w]/2-1,L=tr(f[y],z),I=tr(f[h],z),P=L,R=E-x[w]-I,W=E/2-x[w]/2+T,M=Sc(P,W,R),O=!u.arrow&&Ri(i)!=null&&W!==M&&o.reference[w]/2-(WW<=0)){var I,P;const W=(((I=o.flip)==null?void 0:I.index)||0)+1,M=E[W];if(M&&(!(f==="alignment"?h!==cn(M):!1)||L.every(A=>cn(A.placement)===h?A.overflows[0]>0:!0)))return{data:{index:W,overflows:L},reset:{placement:M}};let O=(P=L.filter($=>$.overflows[0]<=0).sort(($,A)=>$.overflows[1]-A.overflows[1])[0])==null?void 0:P.placement;if(!O)switch(m){case"bestFit":{var R;const $=(R=L.filter(A=>{if(C){const F=cn(A.placement);return F===h||F==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(F=>F>0).reduce((F,b)=>F+b,0)]).sort((A,F)=>A[1]-F[1])[0])==null?void 0:R[0];$&&(O=$);break}case"initialPlacement":O=a;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function xm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ym(e){return RC.some(t=>e[t]>=0)}const KC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=En(e,t);switch(r){case"referenceHidden":{const o=await Lo(t,{...i,elementContext:"reference"}),l=xm(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ym(l)}}}case"escaped":{const o=await Lo(t,{...i,altBoundary:!0}),l=xm(o,n.floating);return{data:{escapedOffsets:l,escaped:ym(l)}}}default:return{}}}}},hy=new Set(["left","top"]);async function QC(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Pn(n),a=Ri(n),u=cn(n)==="y",c=hy.has(l)?-1:1,d=o&&u?-1:1,f=En(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(m=a==="end"?w*-1:w),u?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const YC=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:a}=t,u=await QC(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:l}}}}},XC=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:a={fn:S=>{let{x:y,y:h}=S;return{x:y,y:h}}},...u}=En(e,t),c={x:n,y:r},d=await Lo(t,u),f=cn(Pn(i)),p=qd(f);let m=c[p],w=c[f];if(o){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",h=m+d[S],v=m-d[y];m=Sc(h,m,v)}if(l){const S=f==="y"?"top":"left",y=f==="y"?"bottom":"right",h=w+d[S],v=w-d[y];w=Sc(h,w,v)}const x=a.fn({...t,[p]:m,[f]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[f]:l}}}}}},qC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=En(e,t),d={x:n,y:r},f=cn(i),p=qd(f);let m=d[p],w=d[f];const x=En(a,t),S=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const v=p==="y"?"height":"width",k=o.reference[p]-o.floating[v]+S.mainAxis,j=o.reference[p]+o.reference[v]-S.mainAxis;mj&&(m=j)}if(c){var y,h;const v=p==="y"?"width":"height",k=hy.has(Pn(i)),j=o.reference[f]-o.floating[v]+(k&&((y=l.offset)==null?void 0:y[f])||0)+(k?0:S.crossAxis),C=o.reference[f]+o.reference[v]+(k?0:((h=l.offset)==null?void 0:h[f])||0)-(k?S.crossAxis:0);wC&&(w=C)}return{[p]:m,[f]:w}}}},JC=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:a}=t,{apply:u=()=>{},...c}=En(e,t),d=await Lo(t,c),f=Pn(i),p=Ri(i),m=cn(i)==="y",{width:w,height:x}=o.floating;let S,y;f==="top"||f==="bottom"?(S=f,y=p===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,S=p==="end"?"top":"bottom");const h=x-d.top-d.bottom,v=w-d.left-d.right,k=tr(x-d[S],h),j=tr(w-d[y],v),C=!t.middlewareData.shift;let E=k,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=h),C&&!p){const L=wt(d.left,0),I=wt(d.right,0),P=wt(d.top,0),R=wt(d.bottom,0);m?T=w-2*(L!==0||I!==0?L+I:wt(d.left,d.right)):E=x-2*(P!==0||R!==0?P+R:wt(d.top,d.bottom))}await u({...t,availableWidth:T,availableHeight:E});const z=await l.getDimensions(a.floating);return w!==z.width||x!==z.height?{reset:{rects:!0}}:{}}}};function la(){return typeof window<"u"}function Mi(e){return gy(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gn(e){var t;return(t=(gy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gy(e){return la()?e instanceof Node||e instanceof Et(e).Node:!1}function Xt(e){return la()?e instanceof Element||e instanceof Et(e).Element:!1}function mn(e){return la()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function vm(e){return!la()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}const ZC=new Set(["inline","contents"]);function Qo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ZC.has(i)}const ej=new Set(["table","td","th"]);function tj(e){return ej.has(Mi(e))}const nj=[":popover-open",":modal"];function sa(e){return nj.some(t=>{try{return e.matches(t)}catch{return!1}})}const rj=["transform","translate","scale","rotate","perspective"],ij=["transform","translate","scale","rotate","perspective","filter"],oj=["paint","layout","strict","content"];function ef(e){const t=tf(),n=Xt(e)?qt(e):e;return rj.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)||ij.some(r=>(n.willChange||"").includes(r))||oj.some(r=>(n.contain||"").includes(r))}function lj(e){let t=nr(e);for(;mn(t)&&!Ni(t);){if(ef(t))return t;if(sa(t))return null;t=nr(t)}return null}function tf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sj=new Set(["html","body","#document"]);function Ni(e){return sj.has(Mi(e))}function qt(e){return Et(e).getComputedStyle(e)}function aa(e){return Xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nr(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vm(e)&&e.host||gn(e);return vm(t)?t.host:t}function xy(e){const t=nr(e);return Ni(t)?e.ownerDocument?e.ownerDocument.body:e.body:mn(t)&&Qo(t)?t:xy(t)}function Oo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xy(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Et(i);if(o){const a=kc(l);return t.concat(l,l.visualViewport||[],Qo(i)?i:[],a&&n?Oo(a):[])}return t.concat(i,Oo(i,[],n))}function kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yy(e){const t=qt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=mn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=_s(n)!==o||_s(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function nf(e){return Xt(e)?e:e.contextElement}function ci(e){const t=nf(e);if(!mn(t))return pn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=yy(t);let l=(o?_s(n.width):n.width)/r,a=(o?_s(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const aj=pn(0);function vy(e){const t=Et(e);return!tf()||!t.visualViewport?aj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Et(e)?!1:t}function Pr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=nf(e);let l=pn(1);t&&(r?Xt(r)&&(l=ci(r)):l=ci(e));const a=uj(o,n,r)?vy(o):pn(0);let u=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,d=i.width/l.x,f=i.height/l.y;if(o){const p=Et(o),m=r&&Xt(r)?Et(r):r;let w=p,x=kc(w);for(;x&&r&&m!==w;){const S=ci(x),y=x.getBoundingClientRect(),h=qt(x),v=y.left+(x.clientLeft+parseFloat(h.paddingLeft))*S.x,k=y.top+(x.clientTop+parseFloat(h.paddingTop))*S.y;u*=S.x,c*=S.y,d*=S.x,f*=S.y,u+=v,c+=k,w=Et(x),x=kc(w)}}return Rs({width:d,height:f,x:u,y:c})}function ua(e,t){const n=aa(e).scrollLeft;return t?t.left+n:Pr(gn(e)).left+n}function wy(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ua(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function cj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=gn(r),a=t?sa(t.floating):!1;if(r===l||a&&o)return n;let u={scrollLeft:0,scrollTop:0},c=pn(1);const d=pn(0),f=mn(r);if((f||!f&&!o)&&((Mi(r)!=="body"||Qo(l))&&(u=aa(r)),mn(r))){const m=Pr(r);c=ci(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=l&&!f&&!o?wy(l,u):pn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-u.scrollTop*c.y+d.y+p.y}}function dj(e){return Array.from(e.getClientRects())}function fj(e){const t=gn(e),n=aa(e),r=e.ownerDocument.body,i=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ua(e);const a=-n.scrollTop;return qt(r).direction==="rtl"&&(l+=wt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}const wm=25;function pj(e,t){const n=Et(e),r=gn(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,a=0,u=0;if(i){o=i.width,l=i.height;const d=tf();(!d||d&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}const c=ua(r);if(c<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-f.clientWidth-m);w<=wm&&(o-=w)}else c<=wm&&(o+=c);return{width:o,height:l,x:a,y:u}}const mj=new Set(["absolute","fixed"]);function hj(e,t){const n=Pr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=mn(e)?ci(e):pn(1),l=e.clientWidth*o.x,a=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:l,height:a,x:u,y:c}}function Sm(e,t,n){let r;if(t==="viewport")r=pj(e,n);else if(t==="document")r=fj(gn(e));else if(Xt(t))r=hj(t,n);else{const i=vy(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Rs(r)}function Sy(e,t){const n=nr(e);return n===t||!Xt(n)||Ni(n)?!1:qt(n).position==="fixed"||Sy(n,t)}function gj(e,t){const n=t.get(e);if(n)return n;let r=Oo(e,[],!1).filter(a=>Xt(a)&&Mi(a)!=="body"),i=null;const o=qt(e).position==="fixed";let l=o?nr(e):e;for(;Xt(l)&&!Ni(l);){const a=qt(l),u=ef(l);!u&&a.position==="fixed"&&(i=null),(o?!u&&!i:!u&&a.position==="static"&&!!i&&mj.has(i.position)||Qo(l)&&!u&&Sy(e,l))?r=r.filter(d=>d!==l):i=a,l=nr(l)}return t.set(e,r),r}function xj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?sa(t)?[]:gj(t,this._c):[].concat(n),r],a=l[0],u=l.reduce((c,d)=>{const f=Sm(t,d,i);return c.top=wt(f.top,c.top),c.right=tr(f.right,c.right),c.bottom=tr(f.bottom,c.bottom),c.left=wt(f.left,c.left),c},Sm(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function yj(e){const{width:t,height:n}=yy(e);return{width:t,height:n}}function vj(e,t,n){const r=mn(t),i=gn(t),o=n==="fixed",l=Pr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=pn(0);function c(){u.x=ua(i)}if(r||!r&&!o)if((Mi(t)!=="body"||Qo(i))&&(a=aa(t)),r){const m=Pr(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?wy(i,a):pn(0),f=l.left+a.scrollLeft-u.x-d.x,p=l.top+a.scrollTop-u.y-d.y;return{x:f,y:p,width:l.width,height:l.height}}function Za(e){return qt(e).position==="static"}function bm(e,t){if(!mn(e)||qt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gn(e)===n&&(n=n.ownerDocument.body),n}function by(e,t){const n=Et(e);if(sa(e))return n;if(!mn(e)){let i=nr(e);for(;i&&!Ni(i);){if(Xt(i)&&!Za(i))return i;i=nr(i)}return n}let r=bm(e,t);for(;r&&tj(r)&&Za(r);)r=bm(r,t);return r&&Ni(r)&&Za(r)&&!ef(r)?n:r||lj(e)||n}const wj=async function(e){const t=this.getOffsetParent||by,n=this.getDimensions,r=await n(e.floating);return{reference:vj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sj(e){return qt(e).direction==="rtl"}const bj={convertOffsetParentRelativeRectToViewportRelativeRect:cj,getDocumentElement:gn,getClippingRect:xj,getOffsetParent:by,getElementRects:wj,getClientRects:dj,getDimensions:yj,getScale:ci,isElement:Xt,isRTL:Sj};function ky(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kj(e,t){let n=null,r;const i=gn(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=c;if(a||t(),!p||!m)return;const w=wl(f),x=wl(i.clientWidth-(d+p)),S=wl(i.clientHeight-(f+m)),y=wl(d),v={rootMargin:-w+"px "+-x+"px "+-S+"px "+-y+"px",threshold:wt(0,tr(1,u))||1};let k=!0;function j(C){const E=C[0].intersectionRatio;if(E!==u){if(!k)return l();E?l(!1,E):r=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!ky(c,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(j,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,v)}n.observe(e)}return l(!0),o}function Nj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=nf(e),d=i||o?[...c?Oo(c):[],...Oo(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=c&&a?kj(c,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let w,x=u?Pr(e):null;u&&S();function S(){const y=Pr(e);x&&!ky(x,y)&&n(),x=y,w=requestAnimationFrame(S)}return n(),()=>{var y;d.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(w)}}const Cj=YC,jj=XC,Ej=GC,Pj=JC,Tj=KC,km=WC,Aj=qC,_j=(e,t,n)=>{const r=new Map,i={platform:bj,...n},o={...i.platform,_c:r};return HC(e,t,{...i,platform:o})};var Ij=typeof document<"u",Rj=function(){},$l=Ij?g.useLayoutEffect:Rj;function Ms(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(!Ms(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)&&!Ms(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ny(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nm(e,t){const n=Ny(e);return Math.round(t*n)/n}function eu(e){const t=g.useRef(e);return $l(()=>{t.current=e}),t}function Mj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[d,f]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);Ms(p,r)||m(r);const[w,x]=g.useState(null),[S,y]=g.useState(null),h=g.useCallback(A=>{A!==C.current&&(C.current=A,x(A))},[]),v=g.useCallback(A=>{A!==E.current&&(E.current=A,y(A))},[]),k=o||w,j=l||S,C=g.useRef(null),E=g.useRef(null),T=g.useRef(d),z=u!=null,L=eu(u),I=eu(i),P=eu(c),R=g.useCallback(()=>{if(!C.current||!E.current)return;const A={placement:t,strategy:n,middleware:p};I.current&&(A.platform=I.current),_j(C.current,E.current,A).then(F=>{const b={...F,isPositioned:P.current!==!1};W.current&&!Ms(T.current,b)&&(T.current=b,_i.flushSync(()=>{f(b)}))})},[p,t,n,I,P]);$l(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[c]);const W=g.useRef(!1);$l(()=>(W.current=!0,()=>{W.current=!1}),[]),$l(()=>{if(k&&(C.current=k),j&&(E.current=j),k&&j){if(L.current)return L.current(k,j,R);R()}},[k,j,R,L,z]);const M=g.useMemo(()=>({reference:C,floating:E,setReference:h,setFloating:v}),[h,v]),O=g.useMemo(()=>({reference:k,floating:j}),[k,j]),$=g.useMemo(()=>{const A={position:n,left:0,top:0};if(!O.floating)return A;const F=Nm(O.floating,d.x),b=Nm(O.floating,d.y);return a?{...A,transform:"translate("+F+"px, "+b+"px)",...Ny(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:b}},[n,a,O.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:R,refs:M,elements:O,floatingStyles:$}),[d,R,M,O,$])}const Lj=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?km({element:r.current,padding:i}).fn(n):{}:r?km({element:r,padding:i}).fn(n):{}}}},Oj=(e,t)=>({...Cj(e),options:[e,t]}),Dj=(e,t)=>({...jj(e),options:[e,t]}),zj=(e,t)=>({...Aj(e),options:[e,t]}),Fj=(e,t)=>({...Ej(e),options:[e,t]}),Bj=(e,t)=>({...Pj(e),options:[e,t]}),$j=(e,t)=>({...Tj(e),options:[e,t]}),Uj=(e,t)=>({...Lj(e),options:[e,t]});var Vj="Arrow",Cy=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return s.jsx(le.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cy.displayName=Vj;var Hj=Cy;function jy(e){const[t,n]=g.useState(void 0);return tt(()=>{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,a;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;l=c.inlineSize,a=c.blockSize}else l=e.offsetWidth,a=e.offsetHeight;n({width:l,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var rf="Popper",[Ey,Py]=sr(rf),[Wj,Ty]=Ey(rf),Ay=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return s.jsx(Wj,{scope:t,anchor:r,onAnchorChange:i,children:n})};Ay.displayName=rf;var _y="PopperAnchor",Iy=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Ty(_y,n),l=g.useRef(null),a=ve(t,l),u=g.useRef(null);return g.useEffect(()=>{const c=u.current;u.current=(r==null?void 0:r.current)||l.current,c!==u.current&&o.onAnchorChange(u.current)}),r?null:s.jsx(le.div,{...i,ref:a})});Iy.displayName=_y;var of="PopperContent",[Gj,Kj]=Ey(of),Ry=g.forwardRef((e,t)=>{var K,ne,he,oe,de,me;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...x}=e,S=Ty(of,n),[y,h]=g.useState(null),v=ve(t,He=>h(He)),[k,j]=g.useState(null),C=jy(k),E=(C==null?void 0:C.width)??0,T=(C==null?void 0:C.height)??0,z=r+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],P=I.length>0,R={padding:L,boundary:I.filter(Yj),altBoundary:P},{refs:W,floatingStyles:M,placement:O,isPositioned:$,middlewareData:A}=Mj({strategy:"fixed",placement:z,whileElementsMounted:(...He)=>Nj(...He,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[Oj({mainAxis:i+T,alignmentAxis:l}),u&&Dj({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?zj():void 0,...R}),u&&Fj({...R}),Bj({...R,apply:({elements:He,rects:rt,availableWidth:Zt,availableHeight:zt})=>{const{width:en,height:Fi}=rt.reference,xn=He.floating.style;xn.setProperty("--radix-popper-available-width",`${Zt}px`),xn.setProperty("--radix-popper-available-height",`${zt}px`),xn.setProperty("--radix-popper-anchor-width",`${en}px`),xn.setProperty("--radix-popper-anchor-height",`${Fi}px`)}}),k&&Uj({element:k,padding:a}),Xj({arrowWidth:E,arrowHeight:T}),p&&$j({strategy:"referenceHidden",...R})]}),[F,b]=Oy(O),V=er(w);tt(()=>{$&&(V==null||V())},[$,V]);const Y=(K=A.arrow)==null?void 0:K.x,N=(ne=A.arrow)==null?void 0:ne.y,re=((he=A.arrow)==null?void 0:he.centerOffset)!==0,[fe,ie]=g.useState();return tt(()=>{y&&ie(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:$?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(oe=A.transformOrigin)==null?void 0:oe.x,(de=A.transformOrigin)==null?void 0:de.y].join(" "),...((me=A.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Gj,{scope:n,placedSide:F,onArrowChange:j,arrowX:Y,arrowY:N,shouldHideArrow:re,children:s.jsx(le.div,{"data-side":F,"data-align":b,...x,ref:v,style:{...x.style,animation:$?void 0:"none"}})})})});Ry.displayName=of;var My="PopperArrow",Qj={top:"bottom",right:"left",bottom:"top",left:"right"},Ly=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Kj(My,r),l=Qj[o.placedSide];return s.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:s.jsx(Hj,{...i,ref:n,style:{...i.style,display:"block"}})})});Ly.displayName=My;function Yj(e){return e!==null}var Xj=e=>({name:"transformOrigin",options:e,fn(t){var S,y,h;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,a=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[c,d]=Oy(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((y=i.arrow)==null?void 0:y.x)??0)+a/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+u/2;let w="",x="";return c==="bottom"?(w=l?f:`${p}px`,x=`${-u}px`):c==="top"?(w=l?f:`${p}px`,x=`${r.floating.height+u}px`):c==="right"?(w=`${-u}px`,x=l?f:`${m}px`):c==="left"&&(w=`${r.floating.width+u}px`,x=l?f:`${m}px`),{data:{x:w,y:x}}}});function Oy(e){const[t,n="center"]=e.split("-");return[t,n]}var qj=Ay,Jj=Iy,Zj=Ry,e2=Ly,t2="Portal",lf=g.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=g.useState(!1);tt(()=>o(!0),[]);const l=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?cb.createPortal(s.jsx(le.div,{...r,ref:t}),l):null});lf.displayName=t2;var n2=Yc[" useInsertionEffect ".trim().toString()]||tt;function Ci({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=r2({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:i;{const d=g.useRef(e!==void 0);g.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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.`),d.current=a},[a,r])}const c=g.useCallback(d=>{var f;if(a){const p=i2(d)?d(e):d;p!==e&&((f=l.current)==null||f.call(l,p))}else o(d)},[a,e,o,l]);return[u,c]}function r2({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return n2(()=>{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 i2(e){return typeof e=="function"}function Dy(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])}var zy=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"}),o2="VisuallyHidden",l2=g.forwardRef((e,t)=>s.jsx(le.span,{...e,ref:t,style:{...zy,...e.style}}));l2.displayName=o2;var s2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fr=new WeakMap,Sl=new WeakMap,bl={},tu=0,Fy=function(e){return e&&(e.host||Fy(e.parentNode))},a2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fy(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})},u2=function(e,t,n,r){var i=a2(t,Array.isArray(e)?e:[e]);bl[n]||(bl[n]=new WeakMap);var o=bl[n],l=[],a=new Set,u=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",x=(Fr.get(p)||0)+1,S=(o.get(p)||0)+1;Fr.set(p,x),o.set(p,S),l.push(p),x===1&&w&&Sl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return d(t),a.clear(),tu++,function(){l.forEach(function(f){var p=Fr.get(f)-1,m=o.get(f)-1;Fr.set(f,p),o.set(f,m),p||(Sl.has(f)||f.removeAttribute(r),Sl.delete(f)),m||f.removeAttribute(n)}),tu--,tu||(Fr=new WeakMap,Fr=new WeakMap,Sl=new WeakMap,bl={})}},By=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||s2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),u2(r,i,n,"aria-hidden")):function(){return null}},an=function(){return an=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return j2;var t=E2(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])}},T2=Hy(),di="data-scroll-locked",A2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(d2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(di,`] { + 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(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Ul,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Vl,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Ul," .").concat(Ul,` { + right: 0 `).concat(r,`; + } + + .`).concat(Vl," .").concat(Vl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(di,`] { + `).concat(f2,": ").concat(a,`px; + } +`)},Em=function(){var e=parseInt(document.body.getAttribute(di)||"0",10);return isFinite(e)?e:0},_2=function(){g.useEffect(function(){return document.body.setAttribute(di,(Em()+1).toString()),function(){var e=Em()-1;e<=0?document.body.removeAttribute(di):document.body.setAttribute(di,e.toString())}},[])},I2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;_2();var o=g.useMemo(function(){return P2(i)},[i]);return g.createElement(T2,{styles:A2(o,!t,i,n?"":"!important")})},Nc=!1;if(typeof window<"u")try{var kl=Object.defineProperty({},"passive",{get:function(){return Nc=!0,!0}});window.addEventListener("test",kl,kl),window.removeEventListener("test",kl,kl)}catch{Nc=!1}var Br=Nc?{passive:!1}:!1,R2=function(e){return e.tagName==="TEXTAREA"},Wy=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!R2(e)&&n[t]==="visible")},M2=function(e){return Wy(e,"overflowY")},L2=function(e){return Wy(e,"overflowX")},Pm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Gy(e,r);if(i){var o=Ky(e,r),l=o[1],a=o[2];if(l>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},O2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},D2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gy=function(e,t){return e==="v"?M2(t):L2(t)},Ky=function(e,t){return e==="v"?O2(t):D2(t)},z2=function(e,t){return e==="h"&&t==="rtl"?-1:1},F2=function(e,t,n,r,i){var o=z2(e,window.getComputedStyle(t).direction),l=o*r,a=n.target,u=t.contains(a),c=!1,d=l>0,f=0,p=0;do{if(!a)break;var m=Ky(e,a),w=m[0],x=m[1],S=m[2],y=x-S-o*w;(w||y)&&Gy(e,a)&&(f+=y,p+=w);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(d&&(i&&Math.abs(f)<1||!i&&l>f)||!d&&(i&&Math.abs(p)<1||!i&&-l>p))&&(c=!0),c},Nl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tm=function(e){return[e.deltaX,e.deltaY]},Am=function(e){return e&&"current"in e?e.current:e},B2=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;} +`)},U2=0,$r=[];function V2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(U2++)[0],o=g.useState(Hy)[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 x=c2([e.lockRef.current],(e.shards||[]).map(Am),!0).filter(Boolean);return x.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(x,S){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var y=Nl(x),h=n.current,v="deltaX"in x?x.deltaX:h[0]-y[0],k="deltaY"in x?x.deltaY:h[1]-y[1],j,C=x.target,E=Math.abs(v)>Math.abs(k)?"h":"v";if("touches"in x&&E==="h"&&C.type==="range")return!1;var T=Pm(E,C);if(!T)return!0;if(T?j=E:(j=E==="v"?"h":"v",T=Pm(E,C)),!T)return!1;if(!r.current&&"changedTouches"in x&&(v||k)&&(r.current=j),!j)return!0;var z=r.current||j;return F2(z,S,x,z==="h"?v:k,!0)},[]),u=g.useCallback(function(x){var S=x;if(!(!$r.length||$r[$r.length-1]!==o)){var y="deltaY"in S?Tm(S):Nl(S),h=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&B2(j.delta,y)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var v=(l.current.shards||[]).map(Am).filter(Boolean).filter(function(j){return j.contains(S.target)}),k=v.length>0?a(S,v[0]):!l.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(x,S,y,h){var v={name:x,delta:S,target:y,should:h,shadowParent:H2(y)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(k){return k!==v})},1)},[]),d=g.useCallback(function(x){n.current=Nl(x),r.current=void 0},[]),f=g.useCallback(function(x){c(x.type,Tm(x),x.target,a(x,e.lockRef.current))},[]),p=g.useCallback(function(x){c(x.type,Nl(x),x.target,a(x,e.lockRef.current))},[]);g.useEffect(function(){return $r.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Br),document.addEventListener("touchmove",u,Br),document.addEventListener("touchstart",d,Br),function(){$r=$r.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,Br),document.removeEventListener("touchmove",u,Br),document.removeEventListener("touchstart",d,Br)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:$2(i)}):null,m?g.createElement(I2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const W2=v2(Vy,V2);var Qy=g.forwardRef(function(e,t){return g.createElement(ca,an({},e,{ref:t,sideCar:W2}))});Qy.classNames=ca.classNames;const Yy=Qy;var G2=[" ","Enter","ArrowUp","ArrowDown"],K2=[" ","Enter"],Tr="Select",[da,fa,Q2]=Qd(Tr),[Li,MR]=sr(Tr,[Q2,Py]),pa=Py(),[Y2,ar]=Li(Tr),[X2,q2]=Li(Tr),Xy=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:a,onValueChange:u,dir:c,name:d,autoComplete:f,disabled:p,required:m,form:w}=e,x=pa(t),[S,y]=g.useState(null),[h,v]=g.useState(null),[k,j]=g.useState(!1),C=oa(c),[E,T]=Ci({prop:r,defaultProp:i??!1,onChange:o,caller:Tr}),[z,L]=Ci({prop:l,defaultProp:a,onChange:u,caller:Tr}),I=g.useRef(null),P=S?w||!!S.closest("form"):!0,[R,W]=g.useState(new Set),M=Array.from(R).map(O=>O.props.value).join(";");return s.jsx(qj,{...x,children:s.jsxs(Y2,{required:m,scope:t,trigger:S,onTriggerChange:y,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:qn(),value:z,onValueChange:L,open:E,onOpenChange:T,dir:C,triggerPointerDownPosRef:I,disabled:p,children:[s.jsx(da.Provider,{scope:t,children:s.jsx(X2,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(O=>{W($=>new Set($).add(O))},[]),onNativeOptionRemove:g.useCallback(O=>{W($=>{const A=new Set($);return A.delete(O),A})},[]),children:n})}),P?s.jsxs(Sv,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:z,onChange:O=>L(O.target.value),disabled:p,form:w,children:[z===void 0?s.jsx("option",{value:""}):null,Array.from(R)]},M):null]})})};Xy.displayName=Tr;var qy="SelectTrigger",Jy=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=pa(n),l=ar(qy,n),a=l.disabled||r,u=ve(t,l.onTriggerChange),c=fa(n),d=g.useRef("touch"),[f,p,m]=kv(x=>{const S=c().filter(v=>!v.disabled),y=S.find(v=>v.value===l.value),h=Nv(S,x,y);h!==void 0&&l.onValueChange(h.value)}),w=x=>{a||(l.onOpenChange(!0),m()),x&&(l.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return s.jsx(Jj,{asChild:!0,...o,children:s.jsx(le.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:a,"data-disabled":a?"":void 0,"data-placeholder":bv(l.value)?"":void 0,...i,ref:u,onClick:ee(i.onClick,x=>{x.currentTarget.focus(),d.current!=="mouse"&&w(x)}),onPointerDown:ee(i.onPointerDown,x=>{d.current=x.pointerType;const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:ee(i.onKeyDown,x=>{const S=f.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(S&&x.key===" ")&&G2.includes(x.key)&&(w(),x.preventDefault())})})})});Jy.displayName=qy;var Zy="SelectValue",ev=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...a}=e,u=ar(Zy,n),{onValueNodeHasChildrenChange:c}=u,d=o!==void 0,f=ve(t,u.onValueNodeChange);return tt(()=>{c(d)},[c,d]),s.jsx(le.span,{...a,ref:f,style:{pointerEvents:"none"},children:bv(u.value)?s.jsx(s.Fragment,{children:l}):o})});ev.displayName=Zy;var J2="SelectIcon",tv=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return s.jsx(le.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});tv.displayName=J2;var Z2="SelectPortal",nv=e=>s.jsx(lf,{asChild:!0,...e});nv.displayName=Z2;var Ar="SelectContent",rv=g.forwardRef((e,t)=>{const n=ar(Ar,e.__scopeSelect),[r,i]=g.useState();if(tt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?_i.createPortal(s.jsx(iv,{scope:e.__scopeSelect,children:s.jsx(da.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),o):null}return s.jsx(ov,{...e,ref:t})});rv.displayName=Ar;var Ut=10,[iv,ur]=Li(Ar),eE="SelectContentImpl",tE=ki("SelectContent.RemoveScroll"),ov=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:a,sideOffset:u,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S,...y}=e,h=ar(Ar,n),[v,k]=g.useState(null),[j,C]=g.useState(null),E=ve(t,K=>k(K)),[T,z]=g.useState(null),[L,I]=g.useState(null),P=fa(n),[R,W]=g.useState(!1),M=g.useRef(!1);g.useEffect(()=>{if(v)return By(v)},[v]),fy();const O=g.useCallback(K=>{const[ne,...he]=P().map(me=>me.ref.current),[oe]=he.slice(-1),de=document.activeElement;for(const me of K)if(me===de||(me==null||me.scrollIntoView({block:"nearest"}),me===ne&&j&&(j.scrollTop=0),me===oe&&j&&(j.scrollTop=j.scrollHeight),me==null||me.focus(),document.activeElement!==de))return},[P,j]),$=g.useCallback(()=>O([T,v]),[O,T,v]);g.useEffect(()=>{R&&$()},[R,$]);const{onOpenChange:A,triggerPointerDownPosRef:F}=h;g.useEffect(()=>{if(v){let K={x:0,y:0};const ne=oe=>{var de,me;K={x:Math.abs(Math.round(oe.pageX)-(((de=F.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((me=F.current)==null?void 0:me.y)??0))}},he=oe=>{K.x<=10&&K.y<=10?oe.preventDefault():v.contains(oe.target)||A(!1),document.removeEventListener("pointermove",ne),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",he,{capture:!0})}}},[v,A,F]),g.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[b,V]=kv(K=>{const ne=P().filter(de=>!de.disabled),he=ne.find(de=>de.ref.current===document.activeElement),oe=Nv(ne,K,he);oe&&setTimeout(()=>oe.ref.current.focus())}),Y=g.useCallback((K,ne,he)=>{const oe=!M.current&&!he;(h.value!==void 0&&h.value===ne||oe)&&(z(K),oe&&(M.current=!0))},[h.value]),N=g.useCallback(()=>v==null?void 0:v.focus(),[v]),re=g.useCallback((K,ne,he)=>{const oe=!M.current&&!he;(h.value!==void 0&&h.value===ne||oe)&&I(K)},[h.value]),fe=r==="popper"?Cc:lv,ie=fe===Cc?{side:a,sideOffset:u,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S}:{};return s.jsx(iv,{scope:n,content:v,viewport:j,onViewportChange:C,itemRefCallback:Y,selectedItem:T,onItemLeave:N,itemTextRefCallback:re,focusSelectedItem:$,selectedItemText:L,position:r,isPositioned:R,searchRef:b,children:s.jsx(Yy,{as:tE,allowPinchZoom:!0,children:s.jsx(Xd,{asChild:!0,trapped:h.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:ee(i,K=>{var ne;(ne=h.trigger)==null||ne.focus({preventScroll:!0}),K.preventDefault()}),children:s.jsx(Yd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:s.jsx(fe,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:K=>K.preventDefault(),...y,...ie,onPlaced:()=>W(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,K=>{const ne=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ne&&K.key.length===1&&V(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let oe=P().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(K.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const de=K.target,me=oe.indexOf(de);oe=oe.slice(me+1)}setTimeout(()=>O(oe)),K.preventDefault()}})})})})})})});ov.displayName=eE;var nE="SelectItemAlignedPosition",lv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ar(Ar,n),l=ur(Ar,n),[a,u]=g.useState(null),[c,d]=g.useState(null),f=ve(t,E=>d(E)),p=fa(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:x,selectedItem:S,selectedItemText:y,focusSelectedItem:h}=l,v=g.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&x&&S&&y){const E=o.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(o.dir!=="rtl"){const de=L.left-T.left,me=z.left-de,He=E.left-me,rt=E.width+He,Zt=Math.max(rt,T.width),zt=window.innerWidth-Ut,en=As(me,[Ut,Math.max(Ut,zt-Zt)]);a.style.minWidth=rt+"px",a.style.left=en+"px"}else{const de=T.right-L.right,me=window.innerWidth-z.right-de,He=window.innerWidth-E.right-me,rt=E.width+He,Zt=Math.max(rt,T.width),zt=window.innerWidth-Ut,en=As(me,[Ut,Math.max(Ut,zt-Zt)]);a.style.minWidth=rt+"px",a.style.right=en+"px"}const I=p(),P=window.innerHeight-Ut*2,R=x.scrollHeight,W=window.getComputedStyle(c),M=parseInt(W.borderTopWidth,10),O=parseInt(W.paddingTop,10),$=parseInt(W.borderBottomWidth,10),A=parseInt(W.paddingBottom,10),F=M+O+R+A+$,b=Math.min(S.offsetHeight*5,F),V=window.getComputedStyle(x),Y=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),re=E.top+E.height/2-Ut,fe=P-re,ie=S.offsetHeight/2,K=S.offsetTop+ie,ne=M+O+K,he=F-ne;if(ne<=re){const de=I.length>0&&S===I[I.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-x.offsetTop-x.offsetHeight,He=Math.max(fe,ie+(de?N:0)+me+$),rt=ne+He;a.style.height=rt+"px"}else{const de=I.length>0&&S===I[0].ref.current;a.style.top="0px";const He=Math.max(re,M+x.offsetTop+(de?Y:0)+ie)+he;a.style.height=He+"px",x.scrollTop=ne-re+x.offsetTop}a.style.margin=`${Ut}px 0`,a.style.minHeight=b+"px",a.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,x,S,y,o.dir,r]);tt(()=>v(),[v]);const[k,j]=g.useState();tt(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(E=>{E&&w.current===!0&&(v(),h==null||h(),w.current=!1)},[v,h]);return s.jsx(iE,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:s.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:s.jsx(le.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});lv.displayName=nE;var rE="SelectPopperPosition",Cc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ut,...o}=e,l=pa(n);return s.jsx(Zj,{...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)"}})});Cc.displayName=rE;var[iE,sf]=Li(Ar,{}),jc="SelectViewport",sv=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ur(jc,n),l=sf(jc,n),a=ve(t,o.onViewportChange),u=g.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(da.Slot,{scope:n,children:s.jsx(le.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ee(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&f){const m=Math.abs(u.current-d.scrollTop);if(m>0){const w=window.innerHeight-Ut*2,x=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),y=Math.max(x,S);if(y0?k:0,f.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});sv.displayName=jc;var av="SelectGroup",[oE,lE]=Li(av),uv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qn();return s.jsx(oE,{scope:n,id:i,children:s.jsx(le.div,{role:"group","aria-labelledby":i,...r,ref:t})})});uv.displayName=av;var cv="SelectLabel",dv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=lE(cv,n);return s.jsx(le.div,{id:i.id,...r,ref:t})});dv.displayName=cv;var Ls="SelectItem",[sE,fv]=Li(Ls),pv=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,a=ar(Ls,n),u=ur(Ls,n),c=a.value===r,[d,f]=g.useState(o??""),[p,m]=g.useState(!1),w=ve(t,h=>{var v;return(v=u.itemRefCallback)==null?void 0:v.call(u,h,r,i)}),x=qn(),S=g.useRef("touch"),y=()=>{i||(a.onValueChange(r),a.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 s.jsx(sE,{scope:n,value:r,disabled:i,textId:x,isSelected:c,onItemTextChange:g.useCallback(h=>{f(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:s.jsx(da.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:s.jsx(le.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:ee(l.onFocus,()=>m(!0)),onBlur:ee(l.onBlur,()=>m(!1)),onClick:ee(l.onClick,()=>{S.current!=="mouse"&&y()}),onPointerUp:ee(l.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:ee(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:ee(l.onPointerMove,h=>{var v;S.current=h.pointerType,i?(v=u.onItemLeave)==null||v.call(u):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(l.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=u.onItemLeave)==null||v.call(u))}),onKeyDown:ee(l.onKeyDown,h=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&h.key===" "||(K2.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});pv.displayName=Ls;var no="SelectItemText",mv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ar(no,n),a=ur(no,n),u=fv(no,n),c=q2(no,n),[d,f]=g.useState(null),p=ve(t,y=>f(y),u.onItemTextChange,y=>{var h;return(h=a.itemTextRefCallback)==null?void 0:h.call(a,y,u.value,u.disabled)}),m=d==null?void 0:d.textContent,w=g.useMemo(()=>s.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=c;return tt(()=>(x(w),()=>S(w)),[x,S,w]),s.jsxs(s.Fragment,{children:[s.jsx(le.span,{id:u.textId,...o,ref:p}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?_i.createPortal(o.children,l.valueNode):null]})});mv.displayName=no;var hv="SelectItemIndicator",gv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fv(hv,n).isSelected?s.jsx(le.span,{"aria-hidden":!0,...r,ref:t}):null});gv.displayName=hv;var Ec="SelectScrollUpButton",xv=g.forwardRef((e,t)=>{const n=ur(Ec,e.__scopeSelect),r=sf(Ec,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?s.jsx(vv,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});xv.displayName=Ec;var Pc="SelectScrollDownButton",yv=g.forwardRef((e,t)=>{const n=ur(Pc,e.__scopeSelect),r=sf(Pc,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?s.jsx(vv,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});yv.displayName=Pc;var vv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ur("SelectScrollButton",n),l=g.useRef(null),a=fa(n),u=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),tt(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),s.jsx(le.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ee(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ee(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ee(i.onPointerLeave,()=>{u()})})}),aE="SelectSeparator",wv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(le.div,{"aria-hidden":!0,...r,ref:t})});wv.displayName=aE;var Tc="SelectArrow",uE=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pa(n),o=ar(Tc,n),l=ur(Tc,n);return o.open&&l.position==="popper"?s.jsx(e2,{...i,...r,ref:t}):null});uE.displayName=Tc;var cE="SelectBubbleInput",Sv=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(r,i),l=Dy(t);return g.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[l,t]),s.jsx(le.select,{...n,style:{...zy,...n.style},ref:o,defaultValue:t})});Sv.displayName=cE;function bv(e){return e===""||e===void 0}function kv(e){const t=er(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const a=n.current+l;t(a),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Nv(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=dE(e,Math.max(o,0));i.length===1&&(l=l.filter(c=>c!==n));const u=l.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function dE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fE=Xy,Cv=Jy,pE=ev,mE=tv,hE=nv,jv=rv,gE=sv,xE=uv,Ev=dv,Pv=pv,yE=mv,vE=gv,Tv=xv,Av=yv,_v=wv;const Do=fE,fi=xE,zo=pE,ji=g.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Cv,{ref:r,className:ce("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,s.jsx(mE,{asChild:!0,children:s.jsx(Zx,{className:"h-4 w-4 opacity-50"})})]}));ji.displayName=Cv.displayName;const Iv=g.forwardRef(({className:e,...t},n)=>s.jsx(Tv,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(aN,{className:"h-4 w-4"})}));Iv.displayName=Tv.displayName;const Rv=g.forwardRef(({className:e,...t},n)=>s.jsx(Av,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Zx,{className:"h-4 w-4"})}));Rv.displayName=Av.displayName;const Ei=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>s.jsx(hE,{children:s.jsxs(jv,{ref:i,className:ce("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:[s.jsx(Iv,{}),s.jsx(gE,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(Rv,{})]})}));Ei.displayName=jv.displayName;const Sr=g.forwardRef(({className:e,...t},n)=>s.jsx(Ev,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Sr.displayName=Ev.displayName;const St=g.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Pv,{ref:r,className:ce("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(vE,{children:s.jsx(rN,{className:"h-4 w-4"})})}),s.jsx(yE,{children:t})]}));St.displayName=Pv.displayName;const wE=g.forwardRef(({className:e,...t},n)=>s.jsx(_v,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",e),...t}));wE.displayName=_v.displayName;var Mv=["PageUp","PageDown"],Lv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ov={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Oi="Slider",[Ac,SE,bE]=Qd(Oi),[Dv,LR]=sr(Oi,[bE]),[kE,ma]=Dv(Oi),zv=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[r],value:d,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...x}=e,S=g.useRef(new Set),y=g.useRef(0),v=l==="horizontal"?NE:CE,[k=[],j]=Ci({prop:d,defaultProp:c,onChange:I=>{var R;(R=[...S.current][y.current])==null||R.focus(),f(I)}}),C=g.useRef(k);function E(I){const P=AE(k,I);L(I,P)}function T(I){L(I,y.current)}function z(){const I=C.current[y.current];k[y.current]!==I&&p(k)}function L(I,P,{commit:R}={commit:!1}){const W=ME(o),M=LE(Math.round((I-r)/o)*o+r,W),O=As(M,[r,i]);j(($=[])=>{const A=PE($,O,P);if(RE(A,u*o)){y.current=A.indexOf(O);const F=String(A)!==String($);return F&&R&&p(A),F?A:$}else return $})}return s.jsx(kE,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:y,thumbs:S.current,values:k,orientation:l,form:w,children:s.jsx(Ac.Provider,{scope:e.__scopeSlider,children:s.jsx(Ac.Slot,{scope:e.__scopeSlider,children:s.jsx(v,{"aria-disabled":a,"data-disabled":a?"":void 0,...x,ref:t,onPointerDown:ee(x.onPointerDown,()=>{a||(C.current=k)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:E,onSlideMove:a?void 0:T,onSlideEnd:a?void 0:z,onHomeKeyDown:()=>!a&&L(r,0,{commit:!0}),onEndKeyDown:()=>!a&&L(i,k.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:P})=>{if(!a){const M=Mv.includes(I.key)||I.shiftKey&&Lv.includes(I.key)?10:1,O=y.current,$=k[O],A=o*M*P;L($+A,O,{commit:!0})}}})})})})});zv.displayName=Oi;var[Fv,Bv]=Dv(Oi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),NE=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:a,onSlideEnd:u,onStepKeyDown:c,...d}=e,[f,p]=g.useState(null),m=ve(t,v=>p(v)),w=g.useRef(void 0),x=oa(i),S=x==="ltr",y=S&&!o||!S&&o;function h(v){const k=w.current||f.getBoundingClientRect(),j=[0,k.width],E=af(j,y?[n,r]:[r,n]);return w.current=k,E(v-k.left)}return s.jsx(Fv,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:s.jsx($v,{dir:x,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const k=h(v.clientX);l==null||l(k)},onSlideMove:v=>{const k=h(v.clientX);a==null||a(k)},onSlideEnd:()=>{w.current=void 0,u==null||u()},onStepKeyDown:v=>{const j=Ov[y?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:j?-1:1})}})})}),CE=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:a,onStepKeyDown:u,...c}=e,d=g.useRef(null),f=ve(t,d),p=g.useRef(void 0),m=!i;function w(x){const S=p.current||d.current.getBoundingClientRect(),y=[0,S.height],v=af(y,m?[r,n]:[n,r]);return p.current=S,v(x-S.top)}return s.jsx(Fv,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:s.jsx($v,{"data-orientation":"vertical",...c,ref:f,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const S=w(x.clientY);o==null||o(S)},onSlideMove:x=>{const S=w(x.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,a==null||a()},onStepKeyDown:x=>{const y=Ov[m?"from-bottom":"from-top"].includes(x.key);u==null||u({event:x,direction:y?-1:1})}})})}),$v=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:a,onStepKeyDown:u,...c}=e,d=ma(Oi,n);return s.jsx(le.span,{...c,ref:t,onKeyDown:ee(e.onKeyDown,f=>{f.key==="Home"?(l(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):Mv.concat(Lv).includes(f.key)&&(u(f),f.preventDefault())}),onPointerDown:ee(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(p)?p.focus():r(f)}),onPointerMove:ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:ee(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),o(f))})})}),Uv="SliderTrack",Vv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ma(Uv,n);return s.jsx(le.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Vv.displayName=Uv;var _c="SliderRange",Hv=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ma(_c,n),o=Bv(_c,n),l=g.useRef(null),a=ve(t,l),u=i.values.length,c=i.values.map(p=>Kv(p,i.min,i.max)),d=u>1?Math.min(...c):0,f=100-Math.max(...c);return s.jsx(le.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:f+"%"}})});Hv.displayName=_c;var Ic="SliderThumb",Wv=g.forwardRef((e,t)=>{const n=SE(e.__scopeSlider),[r,i]=g.useState(null),o=ve(t,a=>i(a)),l=g.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return s.jsx(jE,{...e,ref:o,index:l})}),jE=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=ma(Ic,n),a=Bv(Ic,n),[u,c]=g.useState(null),d=ve(t,h=>c(h)),f=u?l.form||!!u.closest("form"):!0,p=jy(u),m=l.values[r],w=m===void 0?0:Kv(m,l.min,l.max),x=TE(r,l.values.length),S=p==null?void 0:p[a.size],y=S?_E(S,w,a.direction):0;return g.useEffect(()=>{if(u)return l.thumbs.add(u),()=>{l.thumbs.delete(u)}},[u,l.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${y}px)`},children:[s.jsx(Ac.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(le.span,{role:"slider","aria-label":e["aria-label"]||x,"aria-valuemin":l.min,"aria-valuenow":m,"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:d,style:m===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),f&&s.jsx(Gv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});Wv.displayName=Ic;var EE="RadioBubbleInput",Gv=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(i,r),l=Dy(t);return g.useEffect(()=>{const a=i.current;if(!a)return;const u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&d){const f=new Event("input",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[l,t]),s.jsx(le.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Gv.displayName=EE;function PE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function Kv(e,t,n){const o=100/(n-t)*(e-t);return As(o,[0,100])}function TE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function AE(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 _E(e,t,n){const r=e/2,o=af([0,50],[0,r]);return(r-o(t)*n)*n}function IE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function RE(e,t){if(t>0){const n=IE(e);return Math.min(...n)>=t}return!0}function af(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 ME(e){return(String(e).split(".")[1]||"").length}function LE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Qv=zv,OE=Vv,DE=Hv,zE=Wv;const Fo=g.forwardRef(({className:e,...t},n)=>s.jsxs(Qv,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(OE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(DE,{className:"absolute h-full bg-primary"})}),s.jsx(zE,{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"})]}));Fo.displayName=Qv.displayName;const uf=[{id:"outdoor-rescue",name:"🏔️ Outdoor Rescue",description:"Offline AI that guides survival in extreme environments",category:"Emergency & Safety",tags:["survival","outdoor","emergency","rescue"],icon:"���️",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are an expert outdoor survival guide and emergency responder. When hikers, travelers, or drivers lose connection in mountains, forests, or rural roads, you provide real-time survival guidance, first aid tips, and emergency signaling advice. You are their reliable voice of calm and safety in extreme environments. Provide step-by-step instructions for survival scenarios, prioritize immediate safety needs, and offer practical solutions using available resources.",temperature:.3,maxTokens:1e3,isOfficial:!0,usageCount:2847,rating:4.9,createdAt:"2024-01-15",author:"EdgeLLM Team"},{id:"offline-healthcare",name:"🏥 Offline Healthcare",description:"A simple device for seniors to access trusted medical guidance",category:"Healthcare",tags:["healthcare","seniors","medical","guidance"],icon:"🏥",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a trusted medical assistant designed specifically for elderly users. You provide clear, step-by-step medical advice through simple voice interactions. Users can press a button or speak a request to get guidance on everyday health concerns. Offer practical, easy-to-understand health advice while always emphasizing when professional medical attention is needed. Keep responses simple, clear, and actionable. No internet required, no accounts needed, no complicated setup.",temperature:.2,maxTokens:800,isOfficial:!0,usageCount:1934,rating:4.8,createdAt:"2024-01-20",author:"EdgeLLM Team"},{id:"ai-companion",name:"🧸 AI Companion",description:"A private, always-available conversational partner",category:"Companion & Support",tags:["companion","emotional support","conversation","private"],icon:"🧸",model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a warm, empathetic AI companion designed to provide emotional support and practical assistance. You can be embedded in a plush toy or device to serve as a private, always-available friend. You listen actively, engage in meaningful conversations, tell stories, and provide comfort during stressful or lonely times. You offer warmth, reassurance, and practical help while maintaining complete privacy - all processing stays local without uploading data to the cloud. Be supportive, understanding, and genuinely caring in all interactions.",temperature:.7,maxTokens:1e3,isOfficial:!0,usageCount:3421,rating:4.9,createdAt:"2024-01-25",author:"EdgeLLM Team"}];function FE(){return uf.map(e=>({id:e.id,name:e.name.replace(/🏔️|🏥|🧸/g,"").trim(),description:e.description,author:e.author,category:e.category,tags:e.tags,model:e.model,systemPrompt:e.systemPrompt,temperature:e.temperature,maxTokens:e.maxTokens,isOfficial:e.isOfficial,createdAt:e.createdAt,icon:e.icon,usageCount:e.usageCount,rating:e.rating}))}function BE(){return uf.map(e=>({name:e.name,prompt:e.systemPrompt}))}const nn={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function Yv(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function $E(){return Yv()}class UE{getAllSessions(){const t=localStorage.getItem(nn.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:Yv(),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(nn.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(nn.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(nn.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(nn.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:$E(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(nn.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(nn.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(nn.currentSession,t)}clear(){localStorage.removeItem(nn.sessions),localStorage.removeItem(nn.currentSession)}}const Oe=new UE;function Xv(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,a]=g.useState(null),[u,c]=g.useState(""),[d,f]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,x]=g.useState(r),[S,y]=g.useState(.7),[h,v]=g.useState(1024),k=Ht.useMemo(()=>{var O;const M=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!M,messageCount:((O=M==null?void 0:M.messages)==null?void 0:O.length)||0,sessionTitle:(M==null?void 0:M.title)||"No session"}),M},[i,l]),j=Ht.useMemo(()=>{const M=(k==null?void 0:k.messages)||[];return console.log("useChat - messages computed:",M.length,M.map(O=>({id:O.id,role:O.role}))),M},[k==null?void 0:k.messages]);g.useEffect(()=>{const M=Oe.getAllSessions();o(M);const O=Oe.getCurrentSession();O&&a(O.id)},[]);const C=g.useCallback(()=>{const M=Oe.createSession(void 0,p,w),O=Oe.getAllSessions();return o([...O]),a(M.id),Oe.setCurrentSession(M.id),M.id},[p,w]),E=g.useCallback(M=>{console.log("selectSession called with:",M),a(M),Oe.setCurrentSession(M),console.log("currentSessionId updated to:",M)},[]),T=g.useCallback(M=>{Oe.deleteSession(M);const O=Oe.getAllSessions();o([...O]),l===M&&(O.length>0?(a(O[0].id),Oe.setCurrentSession(O[0].id)):a(null))},[l]),z=g.useCallback((M,O)=>{Oe.updateSession(M,{title:O});const $=Oe.getAllSessions();o([...$])},[]),L=g.useCallback(M=>{if(!l)return;Oe.addMessageToSession(l,M);const O=Oe.getAllSessions();o([...O])},[l]),I=g.useCallback(async(M,O)=>{var F,b;if(!u.trim()||d.isLoading)return;let $=l;$||($=C());const A=u.trim();if(c(""),f({isLoading:!0,error:null}),$){Oe.addMessageToSession($,{role:"user",content:A});const V=Oe.getAllSessions();o([...V])}try{const V=Oe.getSession($),Y=((b=(F=V==null?void 0:V.messages)==null?void 0:F.filter(fe=>fe.role!=="system"))==null?void 0:b.map(fe=>({role:fe.role,content:fe.content})))||[],N=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:A,messages:Y,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h,use_rag:(O==null?void 0:O.useRag)||!1,retrieval_count:(O==null?void 0:O.retrievalCount)||3})});if(!N.ok){const fe=await N.json();throw new Error(fe.detail||`HTTP error! status: ${N.status}`)}const re=await N.json();if($){Oe.addMessageToSession($,{role:"assistant",content:re.content,thinking_content:re.thinking_content,model_used:re.model_used,supports_thinking:re.supports_thinking,assistantInfo:M});const fe=Oe.getAllSessions();o([...fe])}f({isLoading:!1,error:null})}catch(V){const Y=V instanceof Error?V.message:"An error occurred";if(f({isLoading:!1,error:Y}),$){Oe.addMessageToSession($,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`,assistantInfo:M});const N=Oe.getAllSessions();o([...N])}}},[u,d.isLoading,l,C,L,w,j.length,t,p,S,h]),P=g.useCallback(()=>{f({isLoading:!1,error:null})},[]),R=g.useCallback(()=>{Oe.clear(),o([]),a(null)},[]),W=g.useCallback(()=>{a(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:k,currentSessionId:l,createNewSession:C,selectSession:E,deleteSession:T,renameSession:z,clearAllSessions:R,clearCurrentSession:W,messages:j,input:u,setInput:c,sendMessage:I,stopGeneration:P,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:x,temperature:S,setTemperature:y,maxTokens:h,setMaxTokens:v}}function qv({isLoading:e,ragEnabled:t,setRagEnabled:n,retrievalCount:r,setRetrievalCount:i,currentAssistant:o}){const[l,a]=g.useState([]),[u,c]=g.useState(!1);g.useEffect(()=>{(async()=>{if(!o){try{const m=await fetch("/rag/documents");if(m.ok){const x=(await m.json()).documents.map(S=>({id:S.id,name:S.filename,size:S.size||0,type:S.content_type||"application/octet-stream",uploadedAt:S.upload_date,status:"processed",chunks:S.chunk_count,assistantId:S.assistant_id}));a(x)}}catch(m){console.error("Error loading documents:",m)}return}try{const m=await fetch("/rag/documents");if(m.ok){const w=await m.json();if(w.documents){const x=Object.entries(w.documents).map(([S,y])=>({id:S,name:y.filename,size:0,type:y.file_type,uploadedAt:new Date().toISOString(),status:y.status,chunks:y.chunks,assistantId:y.assistant_id||null}));a(x)}}}catch(m){console.error("Error loading documents:",m)}})()},[o]);const d=async p=>{const m=p.target.files;if(m){c(!0);try{const w=new FormData;o&&w.append("assistant_id",o.id);for(const S of Array.from(m))w.append("files",S);const x=await fetch("/rag/upload",{method:"POST",body:w});if(x.ok){const S=await x.json(),y=S.results.filter(v=>v.success).map(v=>({id:v.doc_id,name:v.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:v.chunks,assistantId:o==null?void 0:o.id}));a(v=>[...v,...y]);const h=S.results.filter(v=>!v.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",x.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{c(!1)}}},f=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?a(w=>w.filter(x=>x.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),a(w=>w.filter(x=>x.id!==p))}};return s.jsx("div",{className:"space-y-4 pb-6",children:o?s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Hd,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{children:o.name}),s.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${o.type==="user"?"bg-blue-100 text-blue-700":o.type==="template"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-700"}`,children:o.type==="user"?"My Assistant":o.type==="template"?"Template":"New Assistant"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ne,{className:"text-xs text-muted-foreground",children:"RAG"}),s.jsx("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked),className:"rounded",disabled:e||l.length===0}),t&&l.length>0&&s.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[s.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),s.jsx("span",{className:"text-xs font-medium",children:"Active"})]})]})]})}),s.jsxs(Ye,{className:"space-y-4",children:[t&&s.jsxs("div",{className:"border-l-2 border-blue-200 pl-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ne,{className:"text-xs font-medium",children:"Retrieval Depth"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," chunks"]})]}),s.jsx(Fo,{value:[r],onValueChange:p=>i(p[0]),max:10,min:1,step:1,className:"w-full"})]}),s.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-4 text-center hover:border-gray-300 transition-colors",children:[s.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:d,className:"hidden",disabled:u||e}),s.jsxs(Ne,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[s.jsx(rm,{className:"h-6 w-6 text-gray-400"}),s.jsx("span",{className:"text-sm",children:u?"Uploading...":"Drop files or click to upload"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ne,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),t&&s.jsxs("span",{className:"text-xs text-green-600",children:["Using ",Math.min(r,l.length)," for context"]})]}),s.jsx("div",{className:"space-y-1",children:l.map(p=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[s.jsx(em,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),s.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&s.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),s.jsx(J,{size:"sm",variant:"ghost",onClick:()=>f(p.id),disabled:e,className:"h-6 w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:s.jsx(yc,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&s.jsx("div",{className:"text-center py-3",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]}):s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(ra,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{children:"Documents & Knowledge Base"})]})}),s.jsxs(Ye,{className:"space-y-4",children:[s.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-6 text-center hover:border-gray-300 transition-colors",children:[s.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:d,className:"hidden",disabled:u||e}),s.jsxs(Ne,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[s.jsx(rm,{className:"h-8 w-8 text-gray-400"}),s.jsx("span",{className:"text-sm font-medium",children:u?"Uploading...":"Drag or drop a file"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ne,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),s.jsx("div",{className:"space-y-1",children:l.map(p=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[s.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[s.jsx(em,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),s.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&s.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),s.jsx(J,{size:"sm",variant:"ghost",onClick:()=>f(p.id),disabled:e,className:"h-6 w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:s.jsx(yc,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&s.jsx("div",{className:"text-center py-3",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]})})}function VE(){const e=Lr(),[t,n]=g.useState(1),[r,i]=g.useState({assistantId:"",model:"Qwen/Qwen3-30B-A3B",temperature:.7,maxTokens:1024,role:"",goal:"",description:"",document:""}),[o,l]=g.useState(!1),[a,u]=g.useState(3),[c,d]=g.useState(null),f=P=>{if(P==="create-new")i(R=>({...R,assistantId:"create-new",model:"Qwen/Qwen3-30B-A3B",temperature:.7,maxTokens:1024,role:"",goal:"",description:""})),v("Qwen/Qwen3-30B-A3B"),S(""),y(.7),h(1024),d({id:"create-new",name:"New Custom Assistant",type:"new"});else{const R=C.find(W=>W.id===P);R&&(i(W=>({...W,assistantId:P,model:R.model,temperature:R.temperature,maxTokens:R.maxTokens,role:R.description,goal:R.category,description:R.systemPrompt})),v(R.model),S(R.systemPrompt),y(R.temperature),h(R.maxTokens),d({id:P,name:R.name,type:"template"}))}};g.useEffect(()=>{const P=localStorage.getItem("selectedUseCase");P&&(f(P),localStorage.removeItem("selectedUseCase"))},[]);const{currentSession:p,createNewSession:m,sendMessage:w,isLoading:x,setSystemPrompt:S,setTemperature:y,setMaxTokens:h,setSelectedModel:v,input:k,setInput:j}=Xv(),C=uf,E=(p==null?void 0:p.messages)||[];g.useEffect(()=>{v(r.model),S(r.description),y(r.temperature),h(r.maxTokens)},[r,v,S,y,h]);const T=()=>s.jsxs("div",{className:"flex items-center justify-between mb-8 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=1?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=1?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"1"}),s.jsx("span",{className:"ml-2 font-medium",children:"Configuration"})]}),s.jsx("div",{className:`w-32 h-0.5 mx-4 ${t>=2?"bg-purple-600":"bg-gray-300"}`})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=2?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=2?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"2"}),s.jsx("span",{className:"ml-2 font-medium",children:"Test performance"})]}),s.jsx("div",{className:`w-32 h-0.5 mx-4 ${t>=3?"bg-purple-600":"bg-gray-300"}`})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsxs("div",{className:`flex items-center ${t>=3?"text-purple-600":"text-gray-400"}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-medium ${t>=3?"bg-purple-600 text-white border-purple-600":"border-gray-300"}`,children:"3"}),s.jsx("span",{className:"ml-2 font-medium",children:"Deploy to device"})]}),s.jsx(J,{className:"ml-8 bg-purple-600 hover:bg-purple-700 text-white px-8",onClick:()=>n(3),disabled:t<2,children:"Connect"})]})]}),z=()=>s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsx(Ie,{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Load Assistant"}),s.jsxs(Do,{onValueChange:f,value:r.assistantId,children:[s.jsx(ji,{children:s.jsx(zo,{placeholder:"Select an assistant or create new"})}),s.jsxs(Ei,{children:[s.jsx(St,{value:"create-new",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-lg",children:"✨"}),s.jsx("span",{children:"Create New Assistant"})]})}),s.jsx("div",{className:"border-b my-1"}),C.map(P=>s.jsx(St,{value:P.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:P.icon}),s.jsx("span",{children:P.name.replace(/🏔️|🏥|🧸/g,"").trim()})]})},P.id))]})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Parameters"}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select a model"}),s.jsxs(Do,{value:r.model,onValueChange:P=>i(R=>({...R,model:P})),children:[s.jsx(ji,{children:s.jsx(zo,{})}),s.jsxs(Ei,{children:[s.jsx(St,{value:"Qwen/Qwen3-30B-A3B",children:"Qwen3-30B-A3B"}),s.jsx(St,{value:"Qwen/Qwen2.5-32B-Instruct",children:"Qwen2.5-32B-Instruct"}),s.jsx(St,{value:"deepseek-ai/DeepSeek-V2.5",children:"DeepSeek-V2.5"})]})]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:["Temperature: ",r.temperature]}),s.jsx(Fo,{value:[r.temperature],onValueChange:P=>i(R=>({...R,temperature:P[0]})),max:1,min:0,step:.1,className:"w-full"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Max Tokens"}),s.jsx(ni,{type:"number",value:r.maxTokens,onChange:P=>i(R=>({...R,maxTokens:parseInt(P.target.value)||1024})),min:1,max:4096})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Description"}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Which role do you want your assistant to be? (Senior data researcher, journalist, lawyer, etc.)"}),s.jsx(ni,{value:r.role,onChange:P=>i(R=>({...R,role:P.target.value})),placeholder:"e.g., Senior data researcher, journalist, lawyer"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Which goal would you expect your assistant to achieve"}),s.jsx(ni,{value:r.goal,onChange:P=>i(R=>({...R,goal:P.target.value})),placeholder:"Describe the main goal or objective"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Description (Tasks, outputs)"}),s.jsx(Kd,{value:r.description,onChange:P=>i(R=>({...R,description:P.target.value})),placeholder:"Describe the tasks and expected outputs...",rows:4})]})]}),s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Documents & Knowledge Base"}),s.jsx(qv,{isLoading:x,ragEnabled:o,setRagEnabled:l,retrievalCount:a,setRetrievalCount:u,currentAssistant:c})]}),s.jsx(J,{onClick:()=>n(2),className:"w-full bg-purple-600 hover:bg-purple-700 text-white",disabled:!r.assistantId||r.assistantId==="create-new"&&!r.description.trim(),children:"Continue to Test Performance"})]})})}),L=()=>{var P;return s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-[600px]",children:[s.jsx("div",{className:"lg:col-span-1",children:s.jsxs(Ie,{className:"h-full p-4",children:[s.jsx("h3",{className:"font-semibold mb-4",children:"Chat sessions"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(J,{variant:"ghost",className:"w-full justify-start text-left",onClick:m,children:"New Chat"}),E.length>0&&s.jsxs("div",{className:"p-2 bg-gray-50 rounded text-sm",children:["Current Session (",E.length," messages)"]})]})]})}),s.jsx("div",{className:"lg:col-span-3",children:s.jsxs(Ie,{className:"h-full flex flex-col",children:[s.jsx("div",{className:"p-4 border-b",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold",children:"Test Performance"}),s.jsx(xe,{variant:"secondary",children:r.assistantId==="create-new"?"Custom Assistant":r.assistantId?(P=C.find(R=>R.id===r.assistantId))==null?void 0:P.name.replace(/🏔️|🏥|🧸/g,"").trim():"No Assistant"})]})}),s.jsxs("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:[E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"mb-2",children:"Start testing your assistant configuration"}),s.jsx("p",{className:"text-sm",children:"Send a message to see how your assistant responds"})]})}):E.map((R,W)=>s.jsx("div",{className:`flex ${R.role==="user"?"justify-end":"justify-start"}`,children:s.jsx("div",{className:`max-w-[80%] p-3 rounded-lg ${R.role==="user"?"bg-purple-600 text-white":"bg-gray-100 text-gray-900"}`,children:s.jsx("p",{className:"whitespace-pre-wrap",children:R.content})})},W)),x&&s.jsx("div",{className:"flex justify-start",children:s.jsx("div",{className:"bg-gray-100 p-3 rounded-lg",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce"}),s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),s.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})})]}),s.jsx("div",{className:"p-4 border-t",children:s.jsxs("div",{className:"flex space-x-2",children:[s.jsx(ni,{placeholder:"Type your message...",value:k,onChange:R=>j(R.target.value),onKeyPress:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),k.trim()&&w(void 0,{useRag:o,retrievalCount:a}))}}),s.jsx(J,{onClick:()=>{k.trim()&&w(void 0,{useRag:o,retrievalCount:a})},disabled:x,className:"bg-purple-600 hover:bg-purple-700",children:"Send"})]})})]})})]}),s.jsxs("div",{className:"mt-6 flex justify-between max-w-6xl mx-auto",children:[s.jsx(J,{variant:"outline",onClick:()=>n(1),children:"Back to Configuration"}),s.jsx(J,{onClick:()=>n(3),className:"bg-purple-600 hover:bg-purple-700 text-white",children:"Continue to Deploy Device"})]})]})},I=()=>{var P;return s.jsx("div",{className:"max-w-2xl mx-auto",children:s.jsxs(Ie,{className:"p-8 text-center",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.212 0"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Deploy to Device"}),s.jsx("p",{className:"text-gray-600",children:"Your assistant configuration is ready to be deployed to your edge device."})]}),s.jsxs("div",{className:"space-y-4 text-left mb-8",children:[s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"Configuration Summary"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Assistant:"})," ",r.assistantId==="create-new"?"Custom Assistant":((P=C.find(R=>R.id===r.assistantId))==null?void 0:P.name.replace(/🏔���|🏥|🧸/g,"").trim())||"None"]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Model:"})," ",r.model]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Temperature:"})," ",r.temperature]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Max Tokens:"})," ",r.maxTokens]}),r.role&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Role:"})," ",r.role]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"RAG Enabled:"})," ",o?"Yes":"No"]}),o&&s.jsxs("p",{children:[s.jsx("span",{className:"font-medium",children:"Retrieval Count:"})," ",a]})]})]}),s.jsx("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("svg",{className:"w-5 h-5 text-blue-600 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),s.jsxs("p",{className:"text-blue-800 text-sm",children:[s.jsx("span",{className:"font-medium",children:"Ready to deploy:"})," Your assistant configuration has been optimized for edge deployment."]})]})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(J,{className:"w-full bg-purple-600 hover:bg-purple-700 text-white py-3",children:"Deploy to Device"}),s.jsx(J,{variant:"outline",className:"w-full",onClick:()=>n(2),children:"Back to Testing"})]})]})})};return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsx("header",{className:"bg-white border-b border-gray-200",children:s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex items-center justify-between h-20",children:[s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-16 w-16",onError:P=>{console.error("Logo failed to load"),P.currentTarget.style.display="none"}})}),s.jsxs("nav",{className:"flex space-x-8",children:[s.jsx("button",{onClick:()=>e("/"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Home"}),s.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Technology"}),s.jsx("button",{onClick:()=>e("/usecases"),className:"text-gray-600 hover:text-gray-900 px-3 py-2 text-sm font-medium",children:"Use Case"}),s.jsx("button",{className:"bg-purple-600 text-white px-4 py-2 text-sm font-medium rounded",children:"My Device"})]})]})})}),s.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[T(),t===1&&z(),t===2&&L(),t===3&&I()]})]})}function HE(){return FE()}function WE(){const e=Lr(),[t,n]=g.useState(!1),[r]=g.useState(HE()),[i,o]=g.useState([]),[l,a]=g.useState(""),[u,c]=g.useState("All");g.useEffect(()=>{d(),f()},[]);const d=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,v=await fetch(`${h}/models`);n(v.ok)}catch{n(!1)}},f=()=>{try{const h=JSON.parse(localStorage.getItem("likedTemplates")||"[]");o(h)}catch(h){console.error("Failed to load liked templates:",h)}},p=h=>{const v=i.includes(h)?i.filter(k=>k!==h):[...i,h];o(v),localStorage.setItem("likedTemplates",JSON.stringify(v))},m=h=>{const v={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(v)),e("/playground")},w=r.filter(h=>{const v=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(j=>j.toLowerCase().includes(l.toLowerCase())),k=u==="All"||h.category===u;return v&&k}),x=w.filter(h=>h.isOfficial),S=[...w].sort((h,v)=>v.usageCount-h.usageCount).slice(0,6),y=["All",...Array.from(new Set(r.map(h=>h.category)))];return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:s.jsx(Er,{className:"h-5 w-5 text-white"})}),s.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),s.jsx(xe,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),s.jsxs(J,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),s.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),s.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),s.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[s.jsx(tm,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),s.jsx(ni,{type:"text",placeholder:"Search assistants...",value:l,onChange:h=>a(h.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),s.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:y.map(h=>s.jsx(J,{variant:u===h?"default":"outline",size:"sm",onClick:()=>c(h),className:"rounded-full",children:h},h))})]}),u==="All"&&x.length>0&&s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(ey,{className:"h-5 w-5 text-yellow-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:x.slice(0,3).map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),u==="All"&&s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(oy,{className:"h-5 w-5 text-green-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),s.jsxs("div",{className:"mb-12",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[s.jsx(WN,{className:"h-5 w-5 text-blue-600"}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:u==="All"?"All Templates":u}),s.jsxs(xe,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>s.jsx(ou,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):s.jsx(Ie,{className:"p-12 text-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(tm,{className:"h-12 w-12 text-gray-400"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),s.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),s.jsx(J,{variant:"outline",onClick:()=>{a(""),c("All")},children:"Clear filters"})]})})]})]})]})}function ou({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return s.jsxs(Ie,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&s.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[s.jsx(ey,{className:"h-3 w-3"}),"Featured"]}),o&&s.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[s.jsx(oy,{className:"h-3 w-3"}),"Trending"]}),s.jsx(Ct,{className:"pb-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),s.jsxs("div",{children:[s.jsx(jt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&s.jsxs(xe,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[s.jsx(Xk,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),s.jsx(J,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:s.jsx(wN,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),s.jsxs(Ye,{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>s.jsx(xe,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(gN,{className:"h-4 w-4"}),s.jsx("span",{children:e.usageCount.toLocaleString()})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(FN,{className:"h-4 w-4 text-yellow-500 fill-current"}),s.jsx("span",{children:e.rating})]})]}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.category})]}),s.jsx("div",{className:"pt-2",children:s.jsxs(J,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[s.jsx(ia,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}var lu="rovingFocusGroup.onEntryFocus",GE={bubbles:!1,cancelable:!0},Yo="RovingFocusGroup",[Rc,Jv,KE]=Qd(Yo),[QE,Zv]=sr(Yo,[KE]),[YE,XE]=QE(Yo),e0=g.forwardRef((e,t)=>s.jsx(Rc.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Rc.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(qE,{...e,ref:t})})}));e0.displayName=Yo;var qE=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,p=g.useRef(null),m=ve(t,p),w=oa(o),[x,S]=Ci({prop:l,defaultProp:a??null,onChange:u,caller:Yo}),[y,h]=g.useState(!1),v=er(c),k=Jv(n),j=g.useRef(!1),[C,E]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(lu,v),()=>T.removeEventListener(lu,v)},[v]),s.jsx(YE,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>E(T=>T-1),[]),children:s.jsx(le.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{j.current=!0}),onFocus:ee(e.onFocus,T=>{const z=!j.current;if(T.target===T.currentTarget&&z&&!y){const L=new CustomEvent(lu,GE);if(T.currentTarget.dispatchEvent(L),!L.defaultPrevented){const I=k().filter(O=>O.focusable),P=I.find(O=>O.active),R=I.find(O=>O.id===x),M=[P,R,...I].filter(Boolean).map(O=>O.ref.current);r0(M,d)}}j.current=!1}),onBlur:ee(e.onBlur,()=>h(!1))})})}),t0="RovingFocusGroupItem",n0=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...a}=e,u=qn(),c=o||u,d=XE(t0,n),f=d.currentTabStopId===c,p=Jv(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:x}=d;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),s.jsx(Rc.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:s.jsx(le.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ee(e.onMouseDown,S=>{r?d.onItemFocus(c):S.preventDefault()}),onFocus:ee(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=eP(S,d.orientation,d.dir);if(y!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")v.reverse();else if(y==="prev"||y==="next"){y==="prev"&&v.reverse();const k=v.indexOf(S.currentTarget);v=d.loop?tP(v,k+1):v.slice(k+1)}setTimeout(()=>r0(v))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:x!=null}):l})})});n0.displayName=t0;var JE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eP(e,t,n){const r=ZE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return JE[r]}function r0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nP=e0,rP=n0;function iP(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Xo=e=>{const{present:t,children:n}=e,r=oP(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ve(r.ref,lP(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Xo.displayName="Presence";function oP(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[a,u]=iP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Cl(r.current);o.current=a==="mounted"?c:"none"},[a]),tt(()=>{const c=r.current,d=i.current;if(d!==e){const p=o.current,m=Cl(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),tt(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=m=>{const x=Cl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&x&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=Cl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Cl(e){return(e==null?void 0:e.animationName)||"none"}function lP(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 ha="Tabs",[sP,OR]=sr(ha,[Zv]),i0=Zv(),[aP,cf]=sP(ha),o0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:u="automatic",...c}=e,d=oa(a),[f,p]=Ci({prop:r,onChange:i,defaultProp:o??"",caller:ha});return s.jsx(aP,{scope:n,baseId:qn(),value:f,onValueChange:p,orientation:l,dir:d,activationMode:u,children:s.jsx(le.div,{dir:d,"data-orientation":l,...c,ref:t})})});o0.displayName=ha;var l0="TabsList",s0=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=cf(l0,n),l=i0(n);return s.jsx(nP,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:s.jsx(le.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});s0.displayName=l0;var a0="TabsTrigger",u0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=cf(a0,n),a=i0(n),u=f0(l.baseId,r),c=p0(l.baseId,r),d=r===l.value;return s.jsx(rP,{asChild:!0,...a,focusable:!i,active:d,children:s.jsx(le.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const f=l.activationMode!=="manual";!d&&!i&&f&&l.onValueChange(r)})})})});u0.displayName=a0;var c0="TabsContent",d0=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,a=cf(c0,n),u=f0(a.baseId,r),c=p0(a.baseId,r),d=r===a.value,f=g.useRef(d);return g.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),s.jsx(Xo,{present:i||d,children:({present:p})=>s.jsx(le.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&o})})});d0.displayName=c0;function f0(e,t){return`${e}-trigger-${t}`}function p0(e,t){return`${e}-content-${t}`}var uP=o0,m0=s0,h0=u0,g0=d0;const cP=uP,x0=g.forwardRef(({className:e,...t},n)=>s.jsx(m0,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));x0.displayName=m0.displayName;const Hl=g.forwardRef(({className:e,...t},n)=>s.jsx(h0,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Hl.displayName=h0.displayName;const Wl=g.forwardRef(({className:e,...t},n)=>s.jsx(g0,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Wl.displayName=g0.displayName;var ga="Dialog",[y0,v0]=sr(ga),[dP,Jt]=y0(ga),w0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,a=g.useRef(null),u=g.useRef(null),[c,d]=Ci({prop:r,defaultProp:i??!1,onChange:o,caller:ga});return s.jsx(dP,{scope:t,triggerRef:a,contentRef:u,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:l,children:n})};w0.displayName=ga;var S0="DialogTrigger",b0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(S0,n),o=ve(t,i.triggerRef);return s.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":pf(i.open),...r,ref:o,onClick:ee(e.onClick,i.onOpenToggle)})});b0.displayName=S0;var df="DialogPortal",[fP,k0]=y0(df,{forceMount:void 0}),N0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Jt(df,t);return s.jsx(fP,{scope:t,forceMount:n,children:g.Children.map(r,l=>s.jsx(Xo,{present:n||o.open,children:s.jsx(lf,{asChild:!0,container:i,children:l})}))})};N0.displayName=df;var Os="DialogOverlay",C0=g.forwardRef((e,t)=>{const n=k0(Os,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jt(Os,e.__scopeDialog);return o.modal?s.jsx(Xo,{present:r||o.open,children:s.jsx(mP,{...i,ref:t})}):null});C0.displayName=Os;var pP=ki("DialogOverlay.RemoveScroll"),mP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(Os,n);return s.jsx(Yy,{as:pP,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(le.div,{"data-state":pf(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),_r="DialogContent",j0=g.forwardRef((e,t)=>{const n=k0(_r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jt(_r,e.__scopeDialog);return s.jsx(Xo,{present:r||o.open,children:o.modal?s.jsx(hP,{...i,ref:t}):s.jsx(gP,{...i,ref:t})})});j0.displayName=_r;var hP=g.forwardRef((e,t)=>{const n=Jt(_r,e.__scopeDialog),r=g.useRef(null),i=ve(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return By(o)},[]),s.jsx(E0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,o=>o.preventDefault())})}),gP=g.forwardRef((e,t)=>{const n=Jt(_r,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return s.jsx(E0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),E0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,a=Jt(_r,n),u=g.useRef(null),c=ve(t,u);return fy(),s.jsxs(s.Fragment,{children:[s.jsx(Xd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:s.jsx(Yd,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":pf(a.open),...l,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(yP,{titleId:a.titleId}),s.jsx(wP,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ff="DialogTitle",P0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(ff,n);return s.jsx(le.h2,{id:i.titleId,...r,ref:t})});P0.displayName=ff;var T0="DialogDescription",A0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(T0,n);return s.jsx(le.p,{id:i.descriptionId,...r,ref:t})});A0.displayName=T0;var _0="DialogClose",I0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jt(_0,n);return s.jsx(le.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});I0.displayName=_0;function pf(e){return e?"open":"closed"}var R0="DialogTitleWarning",[xP,M0]=pC(R0,{contentName:_r,titleName:ff,docsSlug:"dialog"}),yP=({titleId:e})=>{const t=M0(R0),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},vP="DialogDescriptionWarning",wP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${M0(vP).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},SP=w0,bP=b0,kP=N0,NP=C0,CP=j0,jP=P0,EP=A0,L0=I0,O0="AlertDialog",[PP,DR]=sr(O0,[v0]),An=v0(),D0=e=>{const{__scopeAlertDialog:t,...n}=e,r=An(t);return s.jsx(SP,{...r,...n,modal:!0})};D0.displayName=O0;var TP="AlertDialogTrigger",AP=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(bP,{...i,...r,ref:t})});AP.displayName=TP;var _P="AlertDialogPortal",z0=e=>{const{__scopeAlertDialog:t,...n}=e,r=An(t);return s.jsx(kP,{...r,...n})};z0.displayName=_P;var IP="AlertDialogOverlay",F0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(NP,{...i,...r,ref:t})});F0.displayName=IP;var pi="AlertDialogContent",[RP,MP]=PP(pi),LP=ZN("AlertDialogContent"),B0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=An(n),l=g.useRef(null),a=ve(t,l),u=g.useRef(null);return s.jsx(xP,{contentName:pi,titleName:$0,docsSlug:"alert-dialog",children:s.jsx(RP,{scope:n,cancelRef:u,children:s.jsxs(CP,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:ee(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=u.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[s.jsx(LP,{children:r}),s.jsx(DP,{contentRef:l})]})})})});B0.displayName=pi;var $0="AlertDialogTitle",U0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(jP,{...i,...r,ref:t})});U0.displayName=$0;var V0="AlertDialogDescription",H0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(EP,{...i,...r,ref:t})});H0.displayName=V0;var OP="AlertDialogAction",W0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=An(n);return s.jsx(L0,{...i,...r,ref:t})});W0.displayName=OP;var G0="AlertDialogCancel",K0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=MP(G0,n),o=An(n),l=ve(t,i);return s.jsx(L0,{...o,...r,ref:l})});K0.displayName=G0;var DP=({contentRef:e})=>{const t=`\`${pi}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${pi}\` by passing a \`${V0}\` 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 \`${pi}\`. 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},zP=D0,FP=z0,Q0=F0,Y0=B0,X0=W0,q0=K0,J0=U0,Z0=H0;const su=zP,BP=FP,e1=g.forwardRef(({className:e,...t},n)=>s.jsx(Q0,{className:ce("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}));e1.displayName=Q0.displayName;const Gl=g.forwardRef(({className:e,...t},n)=>s.jsxs(BP,{children:[s.jsx(e1,{}),s.jsx(Y0,{ref:n,className:ce("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})]}));Gl.displayName=Y0.displayName;const Kl=({className:e,...t})=>s.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});Kl.displayName="AlertDialogHeader";const Ql=({className:e,...t})=>s.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ql.displayName="AlertDialogFooter";const Yl=g.forwardRef(({className:e,...t},n)=>s.jsx(J0,{ref:n,className:ce("text-lg font-semibold",e),...t}));Yl.displayName=J0.displayName;const Xl=g.forwardRef(({className:e,...t},n)=>s.jsx(Z0,{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));Xl.displayName=Z0.displayName;const ql=g.forwardRef(({className:e,...t},n)=>s.jsx(X0,{ref:n,className:ce(Gd(),e),...t}));ql.displayName=X0.displayName;const Jl=g.forwardRef(({className:e,...t},n)=>s.jsx(q0,{ref:n,className:ce(Gd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Jl.displayName=q0.displayName;function $P(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const UP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HP={};function _m(e,t){return((t||HP).jsx?VP:UP).test(e)}const WP=/[ \t\n\f\r]/g;function GP(e){return typeof e=="object"?e.type==="text"?Im(e.value):!1:Im(e)}function Im(e){return e.replace(WP,"")===""}class qo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qo.prototype.normal={};qo.prototype.property={};qo.prototype.space=void 0;function t1(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qo(n,r,t)}function Mc(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let KP=0;const Z=Dr(),Fe=Dr(),Lc=Dr(),U=Dr(),ke=Dr(),mi=Dr(),yt=Dr();function Dr(){return 2**++KP}const Oc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:Fe,commaOrSpaceSeparated:yt,commaSeparated:mi,number:U,overloadedBoolean:Lc,spaceSeparated:ke},Symbol.toStringTag,{value:"Module"})),au=Object.keys(Oc);class mf extends gt{constructor(t,n,r,i){let o=-1;if(super(t,n),Rm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&JP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Mm,tT);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Mm.test(o)){let l=o.replace(qP,eT);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=mf}return new i(r,t)}function eT(e){return"-"+e.toLowerCase()}function tT(e){return e.charAt(1).toUpperCase()}const nT=t1([n1,QP,o1,l1,s1],"html"),hf=t1([n1,YP,o1,l1,s1],"svg");function rT(e){return e.join(" ").trim()}var gf={},Lm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,iT=/\n/g,oT=/^\s*/,lT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sT=/^:\s*/,aT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uT=/^[;\s]*/,cT=/^\s+|\s+$/g,dT=` +`,Om="/",Dm="*",mr="",fT="comment",pT="declaration",mT=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 x=w.match(iT);x&&(n+=x.length);var S=w.lastIndexOf(dT);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(x){return x.position=new l(w),c(),x}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(w){var x=new Error(t.source+":"+n+":"+r+": "+w);if(x.reason=w,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(w){var x=w.exec(e);if(x){var S=x[0];return i(S),e=e.slice(S.length),x}}function c(){u(oT)}function d(w){var x;for(w=w||[];x=f();)x!==!1&&w.push(x);return w}function f(){var w=o();if(!(Om!=e.charAt(0)||Dm!=e.charAt(1))){for(var x=2;mr!=e.charAt(x)&&(Dm!=e.charAt(x)||Om!=e.charAt(x+1));)++x;if(x+=2,mr===e.charAt(x-1))return a("End of comment missing");var S=e.slice(2,x-2);return r+=2,i(S),e=e.slice(x),r+=2,w({type:fT,comment:S})}}function p(){var w=o(),x=u(lT);if(x){if(f(),!u(sT))return a("property missing ':'");var S=u(aT),y=w({type:pT,property:zm(x[0].replace(Lm,mr)),value:S?zm(S[0].replace(Lm,mr)):mr});return u(uT),y}}function m(){var w=[];d(w);for(var x;x=p();)x!==!1&&(w.push(x),d(w));return w}return c(),m()};function zm(e){return e?e.replace(cT,mr):mr}var hT=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gf,"__esModule",{value:!0});gf.default=xT;var gT=hT(mT);function xT(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,gT.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,a=o.value;i?t(l,a,o):a&&(n=n||{},n[l]=a)}}),n}var xa={};Object.defineProperty(xa,"__esModule",{value:!0});xa.camelCase=void 0;var yT=/^--[a-zA-Z0-9_-]+$/,vT=/-([a-z])/g,wT=/^[^-]+$/,ST=/^-(webkit|moz|ms|o|khtml)-/,bT=/^-(ms)-/,kT=function(e){return!e||wT.test(e)||yT.test(e)},NT=function(e,t){return t.toUpperCase()},Fm=function(e,t){return"".concat(t,"-")},CT=function(e,t){return t===void 0&&(t={}),kT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(bT,Fm):e=e.replace(ST,Fm),e.replace(vT,NT))};xa.camelCase=CT;var jT=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ET=jT(gf),PT=xa;function Dc(e,t){var n={};return!e||typeof e!="string"||(0,ET.default)(e,function(r,i){r&&i&&(n[(0,PT.camelCase)(r,t)]=i)}),n}Dc.default=Dc;var TT=Dc;const AT=Fs(TT),a1=u1("end"),xf=u1("start");function u1(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 _T(e){const t=xf(e),n=a1(e);if(t&&n)return{start:t,end:n}}function po(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Bm(e.position):"start"in e||"end"in e?Bm(e):"line"in e||"column"in e?zc(e):""}function zc(e){return $m(e&&e.line)+":"+$m(e&&e.column)}function Bm(e){return zc(e&&e.start)+"-"+zc(e&&e.end)}function $m(e){return e&&typeof e=="number"?e:1}class nt 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 u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=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=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=po(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}}nt.prototype.file="";nt.prototype.name="";nt.prototype.reason="";nt.prototype.message="";nt.prototype.stack="";nt.prototype.column=void 0;nt.prototype.line=void 0;nt.prototype.ancestors=void 0;nt.prototype.cause=void 0;nt.prototype.fatal=void 0;nt.prototype.place=void 0;nt.prototype.ruleId=void 0;nt.prototype.source=void 0;const yf={}.hasOwnProperty,IT=new Map,RT=/[A-Z]/g,MT=new Set(["table","tbody","thead","tfoot","tr"]),LT=new Set(["td","th"]),c1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OT(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=HT(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=VT(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"?hf:nT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=d1(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function d1(e,t,n){if(t.type==="element")return DT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return BT(e,t,n);if(t.type==="mdxjsEsm")return FT(e,t);if(t.type==="root")return $T(e,t,n);if(t.type==="text")return UT(e,t)}function DT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hf,e.schema=i),e.ancestors.push(t);const o=p1(e,t.tagName,!1),l=WT(e,t);let a=wf(e,t);return MT.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!GP(u):!0})),f1(e,l,o,t),vf(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zT(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)}Bo(e,t.position)}function FT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bo(e,t.position)}function BT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:p1(e,t.name,!0),l=GT(e,t),a=wf(e,t);return f1(e,l,o,t),vf(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function $T(e,t,n){const r={};return vf(r,wf(e,t)),e.create(t,e.Fragment,r,n)}function UT(e,t){return t.value}function f1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VT(e,t,n){return r;function r(i,o,l,a){const c=Array.isArray(l.children)?n:t;return a?c(o,l,a):c(o,l)}}function HT(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=xf(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function WT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&yf.call(t.properties,i)){const o=KT(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&<.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function GT(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 a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Bo(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 a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Bo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function wf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:IT;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?(hn(e,e.length,0,t),e):t}const Hm={}.hasOwnProperty;function tA(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 hi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=cr(/[A-Za-z]/),kt=cr(/[\dA-Za-z]/),iA=cr(/[#-'*+\--9=?A-Z^-~]/);function Fc(e){return e!==null&&(e<32||e===127)}const Bc=cr(/\d/),oA=cr(/[\dA-Fa-f]/),lA=cr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function ye(e){return e===-2||e===-1||e===32}const sA=cr(/\p{P}|\p{S}/u),aA=cr(/\s/);function cr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zi(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),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 je(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return ye(u)?(e.enter(n),a(u)):t(u)}function a(u){return ye(u)&&o++l))return;const E=t.events.length;let T=E,z,L;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(z){L=t.events[T][1].end;break}z=!0}for(y(r),C=E;Cv;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=v}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pA(e,t,n){return je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gm(e){if(e===null||ht(e)||aA(e))return 1;if(sA(e))return 2}function bf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Km(f,-u),Km(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rt(c,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=Rt(c,bf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rt(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Rt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,hn(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&ye(C)?je(e,h,"linePrefix",o+1)(C):h(C)}function h(C){return C===null||X(C)?e.check(Qm,x,k)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||X(C)?(e.exit("codeFlowValue"),h(C)):(e.consume(C),v)}function k(C){return e.exit("codeFenced"),t(C)}function j(C,E,T){let z=0;return L;function L(M){return C.enter("lineEnding"),C.consume(M),C.exit("lineEnding"),I}function I(M){return C.enter("codeFencedFence"),ye(M)?je(C,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):P(M)}function P(M){return M===a?(C.enter("codeFencedFenceSequence"),R(M)):T(M)}function R(M){return M===a?(z++,C.consume(M),R):z>=l?(C.exit("codeFencedFenceSequence"),ye(M)?je(C,W,"whitespace")(M):W(M)):T(M)}function W(M){return M===null||X(M)?(C.exit("codeFencedFence"),E(M)):T(M)}}}function CA(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 cu={name:"codeIndented",tokenize:EA},jA={partial:!0,tokenize:PA};function EA(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),je(e,o,"linePrefix",4+1)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?u(c):X(c)?e.attempt(jA,l,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||X(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function PA(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):je(e,o,"linePrefix",4+1)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const TA={name:"codeText",previous:_A,resolve:AA,tokenize:IA};function AA(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&&Xi(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),Xi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xi(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 w1(e,t,n,r,i,o,l,a,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||Fc(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||X(y)?n(y):(e.consume(y),y===92?w:m)}function w(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!d&&(y===null||y===41||ht(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):d999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):X(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||X(m)||a++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!ye(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function b1(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===l?(e.exit(o),u(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),je(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===l||p===null||X(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:d)}function f(p){return p===l||p===92?(e.consume(p),d):d(p)}}function mo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ye(i)?je(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const BA={name:"definition",tokenize:UA},$A={partial:!0,tokenize:VA};function UA(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return S1.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=hi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return ht(m)?mo(e,c)(m):c(m)}function c(m){return w1(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt($A,f,f)(m)}function f(m){return ye(m)?je(e,p,"whitespace")(m):p(m)}function p(m){return m===null||X(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function VA(e,t,n){return r;function r(a){return ht(a)?mo(e,i)(a):n(a)}function i(a){return b1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ye(a)?je(e,l,"whitespace")(a):l(a)}function l(a){return a===null||X(a)?t(a):n(a)}}const HA={name:"hardBreakEscape",tokenize:WA};function WA(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return X(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const GA={name:"headingAtx",resolve:KA,tokenize:QA};function KA(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"},hn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function QA(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||ht(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||X(d)?(e.exit("atxHeading"),t(d)):ye(d)?je(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||ht(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const YA=["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"],Xm=["pre","script","style","textarea"],XA={concrete:!0,name:"htmlFlow",resolveTo:ZA,tokenize:e_},qA={partial:!0,tokenize:n_},JA={partial:!0,tokenize:t_};function ZA(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 e_(e,t,n){const r=this;let i,o,l,a,u;return c;function c(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),o=!0,x):N===63?(e.consume(N),i=3,r.interrupt?t:b):un(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,a=0,w):un(N)?(e.consume(N),i=4,r.interrupt?t:b):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:b):n(N)}function w(N){const re="CDATA[";return N===re.charCodeAt(a++)?(e.consume(N),a===re.length?r.interrupt?t:P:w):n(N)}function x(N){return un(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||ht(N)){const re=N===47,fe=l.toLowerCase();return!re&&!o&&Xm.includes(fe)?(i=1,r.interrupt?t(N):P(N)):YA.includes(l.toLowerCase())?(i=6,re?(e.consume(N),y):r.interrupt?t(N):P(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?h(N):v(N))}return N===45||kt(N)?(e.consume(N),l+=String.fromCharCode(N),S):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:P):n(N)}function h(N){return ye(N)?(e.consume(N),h):L(N)}function v(N){return N===47?(e.consume(N),L):N===58||N===95||un(N)?(e.consume(N),k):ye(N)?(e.consume(N),v):L(N)}function k(N){return N===45||N===46||N===58||N===95||kt(N)?(e.consume(N),k):j(N)}function j(N){return N===61?(e.consume(N),C):ye(N)?(e.consume(N),j):v(N)}function C(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):ye(N)?(e.consume(N),C):T(N)}function E(N){return N===u?(e.consume(N),u=null,z):N===null||X(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ht(N)?j(N):(e.consume(N),T)}function z(N){return N===47||N===62||ye(N)?v(N):n(N)}function L(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||X(N)?P(N):ye(N)?(e.consume(N),I):n(N)}function P(N){return N===45&&i===2?(e.consume(N),O):N===60&&i===1?(e.consume(N),$):N===62&&i===4?(e.consume(N),V):N===63&&i===3?(e.consume(N),b):N===93&&i===5?(e.consume(N),F):X(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qA,Y,R)(N)):N===null||X(N)?(e.exit("htmlFlowData"),R(N)):(e.consume(N),P)}function R(N){return e.check(JA,W,Y)(N)}function W(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),M}function M(N){return N===null||X(N)?R(N):(e.enter("htmlFlowData"),P(N))}function O(N){return N===45?(e.consume(N),b):P(N)}function $(N){return N===47?(e.consume(N),l="",A):P(N)}function A(N){if(N===62){const re=l.toLowerCase();return Xm.includes(re)?(e.consume(N),V):P(N)}return un(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),A):P(N)}function F(N){return N===93?(e.consume(N),b):P(N)}function b(N){return N===62?(e.consume(N),V):N===45&&i===2?(e.consume(N),b):P(N)}function V(N){return N===null||X(N)?(e.exit("htmlFlowData"),Y(N)):(e.consume(N),V)}function Y(N){return e.exit("htmlFlow"),t(N)}}function t_(e,t,n){const r=this;return i;function i(l){return X(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 n_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ya,t,n)}}const r_={name:"htmlText",tokenize:i_};function i_(e,t,n){const r=this;let i,o,l;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),j):b===63?(e.consume(b),v):un(b)?(e.consume(b),T):n(b)}function c(b){return b===45?(e.consume(b),d):b===91?(e.consume(b),o=0,w):un(b)?(e.consume(b),h):n(b)}function d(b){return b===45?(e.consume(b),m):n(b)}function f(b){return b===null?n(b):b===45?(e.consume(b),p):X(b)?(l=f,$(b)):(e.consume(b),f)}function p(b){return b===45?(e.consume(b),m):f(b)}function m(b){return b===62?O(b):b===45?p(b):f(b)}function w(b){const V="CDATA[";return b===V.charCodeAt(o++)?(e.consume(b),o===V.length?x:w):n(b)}function x(b){return b===null?n(b):b===93?(e.consume(b),S):X(b)?(l=x,$(b)):(e.consume(b),x)}function S(b){return b===93?(e.consume(b),y):x(b)}function y(b){return b===62?O(b):b===93?(e.consume(b),y):x(b)}function h(b){return b===null||b===62?O(b):X(b)?(l=h,$(b)):(e.consume(b),h)}function v(b){return b===null?n(b):b===63?(e.consume(b),k):X(b)?(l=v,$(b)):(e.consume(b),v)}function k(b){return b===62?O(b):v(b)}function j(b){return un(b)?(e.consume(b),C):n(b)}function C(b){return b===45||kt(b)?(e.consume(b),C):E(b)}function E(b){return X(b)?(l=E,$(b)):ye(b)?(e.consume(b),E):O(b)}function T(b){return b===45||kt(b)?(e.consume(b),T):b===47||b===62||ht(b)?z(b):n(b)}function z(b){return b===47?(e.consume(b),O):b===58||b===95||un(b)?(e.consume(b),L):X(b)?(l=z,$(b)):ye(b)?(e.consume(b),z):O(b)}function L(b){return b===45||b===46||b===58||b===95||kt(b)?(e.consume(b),L):I(b)}function I(b){return b===61?(e.consume(b),P):X(b)?(l=I,$(b)):ye(b)?(e.consume(b),I):z(b)}function P(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,R):X(b)?(l=P,$(b)):ye(b)?(e.consume(b),P):(e.consume(b),W)}function R(b){return b===i?(e.consume(b),i=void 0,M):b===null?n(b):X(b)?(l=R,$(b)):(e.consume(b),R)}function W(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||ht(b)?z(b):(e.consume(b),W)}function M(b){return b===47||b===62||ht(b)?z(b):n(b)}function O(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function $(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),A}function A(b){return ye(b)?je(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):F(b)}function F(b){return e.enter("htmlTextData"),l(b)}}const kf={name:"labelEnd",resolveAll:a_,resolveTo:u_,tokenize:c_},o_={tokenize:d_},l_={tokenize:f_},s_={tokenize:p_};function a_(e){let t=-1;const n=[];for(;++t=3&&(c===null||X(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ye(c)?je(e,a,"whitespace")(c):a(c))}}const ut={continuation:{tokenize:k_},exit:C_,name:"list",tokenize:b_},w_={partial:!0,tokenize:j_},S_={partial:!0,tokenize:N_};function b_(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 a;function a(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Bc(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Zl,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Bc(m)&&++l<10?(e.consume(m),u):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(ya,r.interrupt?n:d,e.attempt(w_,p,f))}function d(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function f(m){return ye(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function k_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ya,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,je(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ye(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(S_,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,je(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function N_(e,t,n){const r=this;return je(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 C_(e){e.exit(this.containerState.type)}function j_(e,t,n){const r=this;return je(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!ye(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const qm={name:"setextUnderline",resolveTo:E_,tokenize:P_};function E_(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 P_(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ye(c)?je(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||X(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const T_={tokenize:A_};function A_(e){const t=this,n=e.attempt(ya,r,e.attempt(this.parser.constructs.flowInitial,i,je(e,e.attempt(this.parser.constructs.flow,i,e.attempt(LA,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 __={resolveAll:N1()},I_=k1("string"),R_=k1("text");function k1(e){return{resolveAll:N1(e==="text"?M_:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function K_(e,t){let n=-1;const r=[];let i;for(;++n0){const xt=q.tokenStack[q.tokenStack.length-1];(xt[1]||Zm).call(q,void 0,xt[0])}for(H.position={start:Rn(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Rn(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function cI(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 dI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function E1(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 fI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E1(e,t);const i={src:zi(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 pI(e,t){const n={src:zi(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 mI(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 hI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E1(e,t);const i={href:zi(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 gI(e,t){const n={href:zi(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 xI(e,t,n){const r=e.all(t),i=n?yI(n):P1(t),o={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function vI(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)},a=xf(t.children[1]),u=a1(t.children[t.children.length-1]);a&&u&&(l.position={start:a,end:u}),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 NI(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,a=l?l.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(nh(t.slice(i),i>0,!1)),o.join("")}function nh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===eh||o===th;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===eh||o===th;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function EI(e,t){const n={type:"text",value:jI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TI={blockquote:iI,break:oI,code:lI,delete:sI,emphasis:aI,footnoteReference:uI,heading:cI,html:dI,imageReference:fI,image:pI,inlineCode:mI,linkReference:hI,link:gI,listItem:xI,list:vI,paragraph:wI,root:SI,strong:bI,table:kI,tableCell:CI,tableRow:NI,text:EI,thematicBreak:PI,toml:jl,yaml:jl,definition:jl,footnoteDefinition:jl};function jl(){}const T1=-1,va=0,ho=1,Ds=2,Nf=3,Cf=4,jf=5,Ef=6,A1=7,_1=8,rh=typeof self=="object"?self:globalThis,AI=(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 va:case T1:return n(l,i);case ho:{const a=n([],i);for(const u of l)a.push(r(u));return a}case Ds:{const a=n({},i);for(const[u,c]of l)a[r(u)]=r(c);return a}case Nf:return n(new Date(l),i);case Cf:{const{source:a,flags:u}=l;return n(new RegExp(a,u),i)}case jf:{const a=n(new Map,i);for(const[u,c]of l)a.set(r(u),r(c));return a}case Ef:{const a=n(new Set,i);for(const u of l)a.add(r(u));return a}case A1:{const{name:a,message:u}=l;return n(new rh[a](u),i)}case _1: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:a}=new Uint8Array(l);return n(new DataView(a),l)}}return n(new rh[o](l),i)};return r},ih=e=>AI(new Map,e)(0),Ur="",{toString:_I}={},{keys:II}=Object,qi=e=>{const t=typeof e;if(t!=="object"||!e)return[va,t];const n=_I.call(e).slice(8,-1);switch(n){case"Array":return[ho,Ur];case"Object":return[Ds,Ur];case"Date":return[Nf,Ur];case"RegExp":return[Cf,Ur];case"Map":return[jf,Ur];case"Set":return[Ef,Ur];case"DataView":return[ho,n]}return n.includes("Array")?[ho,n]:n.includes("Error")?[A1,n]:[Ds,n]},El=([e,t])=>e===va&&(t==="function"||t==="symbol"),RI=(e,t,n,r)=>{const i=(l,a)=>{const u=r.push(l)-1;return n.set(a,u),u},o=l=>{if(n.has(l))return n.get(l);let[a,u]=qi(l);switch(a){case va:{let d=l;switch(u){case"bigint":a=_1,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([T1],l)}return i([a,d],l)}case ho:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const d=[],f=i([a,d],l);for(const p of l)d.push(o(p));return f}case Ds:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const d=[],f=i([a,d],l);for(const p of II(l))(e||!El(qi(l[p])))&&d.push([o(p),o(l[p])]);return f}case Nf:return i([a,l.toISOString()],l);case Cf:{const{source:d,flags:f}=l;return i([a,{source:d,flags:f}],l)}case jf:{const d=[],f=i([a,d],l);for(const[p,m]of l)(e||!(El(qi(p))||El(qi(m))))&&d.push([o(p),o(m)]);return f}case Ef:{const d=[],f=i([a,d],l);for(const p of l)(e||!El(qi(p)))&&d.push(o(p));return f}}const{message:c}=l;return i([a,{name:u,message:c}],l)};return o},oh=(e,{json:t,lossy:n}={})=>{const r=[];return RI(!(t||n),!!t,new Map,r)(e),r},zs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ih(oh(e,t)):structuredClone(e):(e,t)=>ih(oh(e,t));function MI(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 LI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function OI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||MI,r=e.options.footnoteBackLabel||LI,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&w.push({type:"text",value:" "});let h=typeof n=="string"?n:n(u,m);typeof h=="string"&&(h={type:"text",value:h}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(h)?h:[h]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const h=S.children[S.children.length-1];h&&h.type==="text"?h.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else d.push(...w);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` +`}]}}const I1=function(e){if(e==null)return BI;if(typeof e=="function")return wa(e);if(typeof e=="object")return Array.isArray(e)?DI(e):zI(e);if(typeof e=="string")return FI(e);throw new Error("Expected function, string, or object as test")};function DI(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=R1,w,x,S;if((!t||o(u,c,d[d.length-1]||void 0))&&(m=WI(n(u,d)),m[0]===lh))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==VI)for(x=(r?y.children.length:-1)+l,S=d.concat(y);x>-1&&x0&&n.push({type:"text",value:` +`}),n}function sh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ah(e,t){const n=KI(e,t),r=n.one(e,void 0),i=OI(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function JI(e,t){return e&&"run"in e?async function(n,r){const i=ah(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ah(n,{file:r,...e||t})}}function uh(e){if(e)throw e}var es=Object.prototype.hasOwnProperty,L1=Object.prototype.toString,ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,fh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):L1.call(t)==="[object Array]"},ph=function(t){if(!t||L1.call(t)!=="[object Object]")return!1;var n=es.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&es.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||es.call(t,i)},mh=function(t,n){ch&&n.name==="__proto__"?ch(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},hh=function(t,n){if(n==="__proto__")if(es.call(t,n)){if(dh)return dh(t,n).value}else return;return t[n]},ZI=function e(){var t,n,r,i,o,l,a=arguments[0],u=1,c=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ul.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(c){const d=c;if(a&&n)throw d;return i(d)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const ln={basename:nR,dirname:rR,extname:iR,join:oR,sep:"/"};function nR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jo(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,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function rR(e){if(Jo(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 iR(e){Jo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===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 oR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function sR(e,t){let n="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),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 a===46&&o>-1?o++:o=-1}return n}function Jo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aR={cwd:uR};function uR(){return"/"}function Hc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cR(e){if(typeof e=="string")e=new URL(e);else if(!Hc(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 dR(e)}function dR(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[m,...w]=d;const x=r[p][1];Vc(x)&&Vc(m)&&(m=fu(!0,x,m)),r[p]=[c,m,...w]}}}}const hR=new Pf().freeze();function gu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yu(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 xh(e){if(!Vc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pl(e){return gR(e)?e:new O1(e)}function gR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xR(e){return typeof e=="string"||yR(e)}function yR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vh=[],wh={allowDangerousHtml:!0},wR=/^(https?|ircs?|mailto|xmpp)$/i,SR=[{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 bR(e){const t=kR(e),n=NR(e);return CR(t.runSync(t.parse(n),n),e)}function kR(e){const t=e.rehypePlugins||vh,n=e.remarkPlugins||vh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wh}:wh;return hR().use(rI).use(n).use(JI,r).use(t)}function NR(e){const t=e.children||"",n=new O1;return typeof t=="string"&&(n.value=t),n}function CR(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||jR;for(const d of SR)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+vR+d.id,void 0);return M1(e,c),OT(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function c(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return l?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in uu)if(Object.hasOwn(uu,m)&&Object.hasOwn(d.properties,m)){const w=d.properties[m],x=uu[m];(x===null||x.includes(d.tagName))&&(d.properties[m]=u(String(w||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,p)),m&&p&&typeof f=="number")return a&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function jR(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||wR.test(e.slice(0,t))?e:""}const D1=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...a},u)=>{const c=g.useRef(null),d=g.useRef(null),f=()=>{if(d.current){const p=d.current;p.scrollTop=p.scrollHeight}};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(m=>({id:m.id,role:m.role,content:m.content.slice(0,50)+"..."})));const p=setTimeout(()=>{f()},50);return()=>clearTimeout(p)},[t]),s.jsxs("div",{className:ce("flex h-full flex-col",e),ref:u,...a,children:[s.jsxs("div",{ref:d,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:s.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((p,m)=>s.jsxs("div",{className:ce("flex gap-3 w-full items-start",p.role==="user"?"justify-end":"justify-start"),children:[p.role!=="user"&&s.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0 mt-1",children:s.jsx(ti,{className:"h-4 w-4 text-primary-foreground"})}),s.jsxs("div",{className:ce("max-w-[75%] min-w-0 flex flex-col gap-2 rounded-lg px-3 py-2 text-sm break-words",p.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[s.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[s.jsx("span",{children:p.role==="user"?"You":p.assistantInfo?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:p.assistantInfo.name}),p.assistantInfo.type!=="default"&&s.jsx("span",{className:ce("inline-block px-1.5 py-0.5 rounded text-[10px] font-medium ml-1",p.assistantInfo.type==="user"&&"bg-blue-100 text-blue-700",p.assistantInfo.type==="template"&&"bg-gray-100 text-gray-700",p.assistantInfo.type==="new"&&"bg-green-100 text-green-700"),children:p.assistantInfo.type==="user"?"Mine":p.assistantInfo.type==="template"?"Template":"New"}),p.assistantInfo.originalTemplate&&s.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",p.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),s.jsx("span",{children:"•"}),s.jsxs("span",{children:["#",m+1]})]}),s.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none overflow-hidden",children:s.jsx(bR,{components:{p:({children:w})=>s.jsx("p",{className:"mb-2 last:mb-0 break-words",children:w}),ul:({children:w})=>s.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4 break-words",children:w}),ol:({children:w})=>s.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4 break-words",children:w}),li:({children:w})=>s.jsx("li",{className:"mb-1 break-words",children:w}),code:({children:w,className:x})=>!x?s.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono break-words",children:w}):s.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre-wrap break-all",children:w}),pre:({children:w})=>s.jsx("div",{className:"mb-2 last:mb-0 overflow-hidden",children:w}),strong:({children:w})=>s.jsx("strong",{className:"font-semibold",children:w}),em:({children:w})=>s.jsx("em",{className:"italic",children:w}),blockquote:({children:w})=>s.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:w}),h1:({children:w})=>s.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:w}),h2:({children:w})=>s.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:w}),h3:({children:w})=>s.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:w})},children:p.content})})]}),p.role==="user"&&s.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0 mt-1",children:s.jsx(Hd,{className:"h-4 w-4"})})]},`${p.id}-${m}`)),s.jsx("div",{ref:c})]}),s.jsx("div",{className:"border-t p-4",children:s.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[s.jsx(Kd,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),i(p))}}),o?s.jsx(J,{type:"button",onClick:l,variant:"outline",size:"icon",children:s.jsx(DN,{className:"h-4 w-4"})}):s.jsx(J,{type:"submit",disabled:!n.trim(),size:"icon",children:s.jsx(TN,{className:"h-4 w-4"})})]})})]})});D1.displayName="Chat";function ER({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:a}){return s.jsxs(s.Fragment,{children:[s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsx(jt,{className:"text-base",children:"Model"})}),s.jsx(Ye,{className:"space-y-4",children:s.jsx("div",{children:s.jsxs(Do,{value:t||"",onValueChange:n,children:[s.jsx(ji,{className:"w-full",children:s.jsx(zo,{placeholder:"Select a model...",children:t&&(()=>{const u=e.find(d=>d.model_name===t);if(!u)return t;const c=u.type==="api";return s.jsxs("div",{className:"flex items-center gap-2",children:[c?s.jsx(Ps,{className:"h-4 w-4 text-blue-500"}):u.supports_thinking?s.jsx(Er,{className:"h-4 w-4 text-purple-500"}):s.jsx(vc,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{className:"truncate",children:u.name}),r===t?s.jsx(xe,{variant:"outline",className:"text-xs",children:"Loading..."}):s.jsx(xe,{variant:"outline",className:"text-xs",children:c?"API":u.is_loaded?"Loaded":"Available"})]})})()})}),s.jsxs(Ei,{children:[s.jsxs(fi,{children:[s.jsx(Sr,{children:"🌐 API Models"}),e.filter(u=>u.type==="api").map(u=>s.jsx(St,{value:u.model_name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ps,{className:"h-4 w-4 text-blue-500"}),s.jsx("span",{children:u.name}),s.jsx(xe,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},u.model_name))]}),s.jsxs(fi,{children:[s.jsx(Sr,{children:"💻 Local Models"}),e.filter(u=>u.type==="local").map(u=>s.jsx(St,{value:u.model_name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[u.supports_thinking?s.jsx(Er,{className:"h-4 w-4 text-purple-500"}):s.jsx(vc,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:u.name}),r===u.model_name?s.jsx(xe,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):u.is_loaded?s.jsx(xe,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):s.jsx(xe,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},u.model_name))]})]})]})})})]}),s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsx(jt,{className:"text-base",children:"Parameters"})}),s.jsxs(Ye,{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Temperature"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:i})]}),s.jsx(Fo,{value:[i],onValueChange:u=>o(u[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[s.jsx("span",{children:"0.0 (Focused)"}),s.jsx("span",{children:"1.0 (Balanced)"}),s.jsx("span",{children:"2.0 (Creative)"})]}),s.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:i<=.3?"🎯 Very focused and deterministic responses":i<=.7?"⚖️ Balanced creativity and consistency":i<=1.2?"🎨 More creative and varied responses":"🚀 Highly creative, unpredictable responses"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Max Tokens"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:l})]}),s.jsx(Fo,{value:[l],onValueChange:u=>a(u[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[s.jsx("span",{children:"50 (Short)"}),s.jsx("span",{children:"1024 (Medium)"}),s.jsx("span",{children:"4000 (Long)"})]}),s.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:l<=200?"📝 Brief responses, good for quick answers":l<=1e3?"📄 Medium responses, balanced length":l<=2e3?"📋 Long responses, detailed explanations":"📚 Very long responses, comprehensive content"})]})]})]})]})}function PR({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:a,clearCurrentAssistant:u,openRenameDialog:c,systemPrompt:d}){const f=x=>{if(x==="create_new")a();else if(x==="clear_current")u();else if(x.startsWith("user_")){const S=x.replace("user_","");t(S)}else i(x)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=x=>{switch(x){case"user":return{variant:"secondary",text:"Mine"};case"template":return{variant:"outline",text:"Template"};case"new":return{variant:"default",text:"New",className:"bg-green-100 text-green-700"}}},w=e.length+r.length;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),s.jsxs(Do,{value:p(),onValueChange:f,children:[s.jsx(ji,{className:"w-full",children:s.jsx(zo,{placeholder:`Choose assistant (${w} available)`,children:l?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),s.jsx("span",{children:l.name}),l.originalTemplate&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),s.jsx(xe,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),s.jsx("span",{children:"Choose assistant"}),s.jsx(xe,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),s.jsxs(Ei,{children:[s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Ts,{className:"h-4 w-4"}),"Actions"]}),s.jsx(St,{value:"create_new",children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(Ts,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),s.jsx(xe,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&s.jsx(St,{value:"clear_current",children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(yc,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Hd,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(x=>s.jsx(St,{value:`user_${x.id}`,children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ti,{className:"h-4 w-4 text-blue-600"}),s.jsx("span",{className:"truncate flex-1",children:x.name}),s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${x.id}`))]}),r.length>0&&s.jsxs(fi,{children:[s.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Zk,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(x=>s.jsx(St,{value:x.name,children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[s.jsx(ti,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"truncate flex-1",children:x.name}),s.jsx(xe,{variant:"outline",className:"text-xs",children:"Template"})]})},x.name))]}),w===0&&s.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&s.jsxs(J,{onClick:c,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[s.jsx(ui,{className:"h-4 w-4 mr-2"}),"Rename"]}),s.jsxs(J,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!d.trim(),children:[s.jsx(ry,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function TR({systemPrompt:e,setSystemPrompt:t,isLoading:n}){const r=[{title:"Helpful Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses. If you're unsure about something, say so."},{title:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include helpful comments."},{title:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{title:"Teacher/Tutor",prompt:"You are a patient and knowledgeable teacher. Break down complex concepts into simple, understandable parts. Use examples and analogies to help explain ideas."}],i=["Be specific about the assistant's role and expertise","Include desired communication style and tone","Specify output format if needed (lists, paragraphs, etc.)","Add ethical guidelines and behavior expectations"];return s.jsxs("div",{className:"space-y-4 pb-6",children:[s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsx(jt,{className:"text-base",children:"System Instructions"})}),s.jsx(Ye,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ne,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),s.jsx("textarea",{value:e,onChange:o=>t(o.target.value),placeholder:"Define your AI assistant's role, personality, and behavior...",className:"w-full h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-none overflow-y-auto",disabled:n}),s.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"text-sm flex items-center",children:[s.jsx(Er,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),s.jsx(Ye,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsx(Ne,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),s.jsxs(Do,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[s.jsx(ji,{className:"w-full h-10",children:s.jsx(zo,{placeholder:"Select example prompt..."})}),s.jsx(Ei,{children:s.jsxs(fi,{children:[s.jsx(Sr,{children:"Example Prompts"}),r.map((o,l)=>s.jsx(St,{value:l.toString(),children:s.jsxs("div",{className:"flex flex-col items-start",children:[s.jsx("span",{className:"font-medium text-sm",children:o.title}),s.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"text-sm flex items-center",children:[s.jsx(ia,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),s.jsx(Ye,{children:s.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"inline-block w-1.5 h-1.5 bg-blue-400 rounded-full mt-1.5 mr-2 flex-shrink-0"}),o]},l))})})]})]})}function AR(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:a,sendMessage:u,stopGeneration:c,isLoading:d,selectedModel:f,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:x,setTemperature:S,maxTokens:y,setMaxTokens:h}=Xv(),[v,k]=g.useState(!1),[j,C]=g.useState(3),[E,T]=g.useState(!1),[z,L]=g.useState(!1),[I,P]=g.useState(null),[R,W]=g.useState(!1),[M,O]=g.useState(null),[$,A]=g.useState([]),[F,b]=g.useState([]),[V,Y]=g.useState(null),[N,re]=g.useState(!1),[fe,ie]=g.useState(""),[K,ne]=g.useState(!1),[he,oe]=g.useState(""),de=()=>{try{const D=JSON.parse(localStorage.getItem("savedAssistants")||"[]");b(D)}catch(D){console.error("Failed to load saved assistants:",D)}},me=()=>{if(!m.trim())return;let D="My Assistant";V&&(V.type==="new"?D=V.name:V.type==="template"?D=`My ${V.name}`:D=V.name+" Copy"),ie(D),re(!0)},He=()=>{if(!fe.trim()||!m.trim())return;const D={id:Date.now().toString(),name:fe.trim(),systemPrompt:m,temperature:x,maxTokens:y,model:f,ragEnabled:v,retrievalCount:j,documents:[],createdAt:new Date().toISOString()},Q=[...F,D];b(Q),localStorage.setItem("savedAssistants",JSON.stringify(Q)),Y({id:D.id,name:D.name,type:"user"}),re(!1),ie("")},rt=()=>{re(!1),ie("")},Zt=D=>{const Q=F.find(ge=>ge.id===D);Q&&(w(Q.systemPrompt),S(Q.temperature),h(Q.maxTokens),k(Q.ragEnabled||!1),C(Q.retrievalCount||3),Q.model&&p(Q.model),Y({id:Q.id,name:Q.name,type:"user"}))},zt=BE(),en=D=>{const Q=zt.find(ge=>ge.name===D);Q&&(w(Q.prompt),k(!1),C(3),Y({id:D,name:Q.name,type:"template"}))},Fi=()=>{w(""),S(.7),h(1024),k(!1),C(3),Y({id:"new_assistant",name:"New Assistant",type:"new"})},xn=()=>{Y(null)},Zo=()=>{V&&(oe(V.name),ne(!0))},el=()=>{if(!V||!he.trim())return;const D={...V,name:he.trim()};if(Y(D),V.type==="user"){const Q=F.map(ge=>ge.id===V.id?{...ge,name:he.trim()}:ge);b(Q),localStorage.setItem("savedAssistants",JSON.stringify(Q))}ne(!1),oe("")},tl=()=>{ne(!1),oe("")},Sa=()=>({name:(V==null?void 0:V.name)||"Default Assistant",type:(V==null?void 0:V.type)||"default",systemPrompt:m,temperature:x,maxTokens:y,originalTemplate:V==null?void 0:V.originalTemplate}),dr=()=>{V&&V.type==="template"&&Y({id:"new_assistant",name:`Custom ${V.name}`,type:"new",originalTemplate:V.name})},ba=D=>{w(D),dr()},_=D=>{S(D),dr()},H=D=>{h(D),dr()},q=D=>{k(D),dr()},se=D=>{C(D),dr()};g.useEffect(()=>{Ft(),de();const D=localStorage.getItem("loadAssistantConfig");if(D)try{const Q=JSON.parse(D);w(Q.systemPrompt||""),S(Q.temperature||.7),h(Q.maxTokens||1024),Q.model&&p(Q.model),Y({id:"loaded_template",name:Q.name||"Loaded Template",type:"template"}),localStorage.removeItem("loadAssistantConfig")}catch(Q){console.error("Failed to load assistant config:",Q),localStorage.removeItem("loadAssistantConfig")}},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:E,configCollapsed:z,sessionsCount:e.length,currentSessionId:t})},[E,z,e.length,t]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(D=>({id:D.id,title:D.title})))},[e]),g.useEffect(()=>{if(f&&!$.find(D=>D.model_name===f)){const D=$[0];D&&p(D.model_name)}},[$,f,p]),g.useEffect(()=>{(async()=>{if(!f||!$.length)return;const Q=$.find(ze=>ze.model_name===f);if(!Q)return;const ge=`${window.location.protocol}//${window.location.host}`;if(Q.type==="local"&&!Q.is_loaded){O(Q),W(!0);return}const be=$.filter(ze=>ze.type==="local"&&ze.is_loaded&&ze.model_name!==f);for(const ze of be)try{(await fetch(`${ge}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ze.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ze.model_name}`)}catch(at){console.error(`Error auto-unloading model ${ze.model_name}:`,at)}be.length>0&&Ft()})()},[f,$]);const we=async()=>{if(M){W(!1),P(M.model_name);try{const D=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${D}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:M.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${M.model_name}`),Ft();else{console.error(`❌ Failed to load model: ${M.model_name}`);const ge=$.find(be=>be.type==="api");ge&&p(ge.model_name)}}catch(D){console.error("Error loading model:",D);const Q=$.find(ge=>ge.type==="api");Q&&p(Q.model_name)}finally{P(null),O(null)}}},xt=()=>{W(!1),O(null);const D=$.find(Q=>Q.type==="api");D&&p(D.model_name)};g.useEffect(()=>{const D=async()=>{const Q=`${window.location.protocol}//${window.location.host}`,ge=$.filter(be=>be.type==="local"&&be.is_loaded);for(const be of ge)try{await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:be.model_name})}),console.log(`✅ Cleanup: unloaded ${be.model_name}`)}catch(ze){console.error(`Error cleaning up model ${be.model_name}:`,ze)}};return()=>{D()}},[$]);const Ft=async()=>{try{const D=`${window.location.protocol}//${window.location.host}`,Q=await fetch(`${D}/models`);if(Q.ok){const ge=await Q.json();if(A(ge.models),ge.current_model&&f!==ge.current_model)p(ge.current_model);else if(!f&&ge.models.length>0){const ze=ge.models.find(at=>at.type==="api")||ge.models[0];p(ze.model_name)}}}catch(D){console.error("Failed to fetch models:",D)}};return s.jsxs("div",{className:"h-screen bg-background flex",children:[s.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${E?"w-12":"w-80"} + `,children:s.jsxs("div",{className:"p-4 space-y-4 h-full",children:[s.jsxs("div",{className:`flex items-center ${E?"justify-center":"justify-between"}`,children:[!E&&s.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),s.jsxs("div",{className:"flex gap-1",children:[!E&&s.jsxs(J,{onClick:i,size:"sm",children:[s.jsx(Ts,{className:"h-4 w-4 mr-1"}),"New"]}),s.jsx(J,{onClick:()=>T(!E),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:E?"Expand Sessions":"Collapse Sessions",children:E?s.jsx(Zp,{className:"h-4 w-4"}):s.jsx(Jp,{className:"h-4 w-4"})})]})]}),E&&s.jsx(J,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:s.jsx(Ts,{className:"h-4 w-4"})}),s.jsxs("div",{className:"space-y-2",children:[!E&&e.map(D=>s.jsxs(Ie,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===D.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",D.id,D.title),n(D.id)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium truncate",children:D.title}),s.jsx(J,{size:"sm",variant:"ghost",onClick:Q=>{Q.stopPropagation(),r(D.id)},className:"h-6 w-6 p-0",children:s.jsx(iy,{className:"h-3 w-3"})})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[D.messages.length," messages"]})]},D.id)),E&&e.map(D=>s.jsxs(J,{variant:t===D.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:D.title,onClick:()=>{console.log("Session icon clicked:",D.id,D.title),n(D.id)},children:[s.jsx(ia,{className:"h-4 w-4"}),D.messages&&D.messages.length>0&&s.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(D.messages.length,9)})]},D.id))]})]})}),s.jsx("div",{className:"flex-1 flex flex-col h-full",children:s.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[s.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:s.jsx(D1,{messages:o.map(D=>({id:D.id,role:D.role,content:D.content,createdAt:new Date(D.timestamp),assistantInfo:D.assistantInfo})),input:l,handleInputChange:D=>a(D.target.value),handleSubmit:async D=>{if(D.preventDefault(),!f||!$.find(be=>be.model_name===f))return;const Q=Sa();await u(Q,{useRag:v,retrievalCount:j})},isGenerating:d,stop:c,className:"flex-1"})}),s.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${z?"w-12":"w-[480px] xl:w-[520px]"} + `,children:s.jsxs("div",{className:"p-4 space-y-4 h-full",children:[s.jsxs("div",{className:`flex items-center ${z?"justify-center":"justify-between"}`,children:[!z&&s.jsx("h2",{className:"font-semibold",children:"Configuration"}),s.jsx("div",{className:"flex gap-1",children:s.jsx(J,{onClick:()=>L(!z),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:z?"Expand Configuration":"Collapse Configuration",children:z?s.jsx(Jp,{className:"h-4 w-4"}):s.jsx(Zp,{className:"h-4 w-4"})})})]}),z&&s.jsx(J,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:s.jsx(ui,{className:"h-4 w-4"})}),s.jsx("div",{className:"space-y-2",children:!z&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:s.jsx(PR,{savedAssistants:F,loadSavedAssistant:Zt,openSaveDialog:me,presets:zt,onPresetSelect:en,isLoading:d,selectedAssistant:V,createNewAssistant:Fi,clearCurrentAssistant:xn,openRenameDialog:Zo,systemPrompt:m})}),s.jsxs(cP,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[s.jsxs(x0,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[s.jsxs(Hl,{value:"parameters",className:"flex items-center gap-2",children:[s.jsx(LN,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),s.jsxs(Hl,{value:"instructions",className:"flex items-center gap-2",children:[s.jsx(ui,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),s.jsxs(Hl,{value:"documents",className:"flex items-center gap-2",children:[s.jsx(ra,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),s.jsxs("div",{className:"flex-1 overflow-hidden",children:[s.jsx(Wl,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(ER,{models:$,selectedModel:f,setSelectedModel:p,autoLoadingModel:I,temperature:x,setTemperature:_,maxTokens:y,setMaxTokens:H})}),s.jsx(Wl,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(TR,{systemPrompt:m,setSystemPrompt:ba,isLoading:d})}),s.jsx(Wl,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:s.jsx(qv,{isLoading:d,ragEnabled:v,setRagEnabled:q,retrievalCount:j,setRetrievalCount:se,currentAssistant:V})})]})]})]})})]})})]})}),s.jsx(su,{open:R,onOpenChange:W,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Load Local Model"}),s.jsxs(Xl,{children:["Loading ",s.jsx("strong",{children:M==null?void 0:M.name})," will use approximately ",s.jsx("strong",{children:M==null?void 0:M.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:xt,children:"Cancel"}),s.jsx(ql,{onClick:we,children:"Load Model"})]})]})}),s.jsx(su,{open:N,onOpenChange:re,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Save Assistant"}),s.jsx(Xl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),s.jsxs("div",{className:"py-4",children:[s.jsx(Ne,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),s.jsx("input",{id:"assistant-name",type:"text",value:fe,onChange:D=>ie(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter a name for your assistant...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&fe.trim()&&He(),D.key==="Escape"&&rt()}}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[fe.length,"/100 characters"]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:rt,children:"Cancel"}),s.jsxs(ql,{onClick:He,disabled:!fe.trim(),children:[s.jsx(ry,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),s.jsx(su,{open:K,onOpenChange:ne,children:s.jsxs(Gl,{children:[s.jsxs(Kl,{children:[s.jsx(Yl,{children:"Rename Assistant"}),s.jsxs(Xl,{children:['Enter a new name for "',V==null?void 0:V.name,'".']})]}),s.jsxs("div",{className:"py-4",children:[s.jsx(Ne,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),s.jsx("input",{id:"rename-assistant-name",type:"text",value:he,onChange:D=>oe(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter new assistant name...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&he.trim()&&el(),D.key==="Escape"&&tl()}}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[he.length,"/100 characters"]})]}),s.jsxs(Ql,{children:[s.jsx(Jl,{onClick:tl,children:"Cancel"}),s.jsxs(ql,{onClick:el,disabled:!he.trim(),children:[s.jsx(ui,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function _R(){const e=Lr(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,l]=g.useState(null);g.useEffect(()=>{a()},[]);const a=async()=>{try{const d=`${window.location.protocol}//${window.location.host}`,f=await fetch(`${d}/models`);if(!f.ok)throw new Error(`Failed to fetch models: ${f.status}`);const p=await f.json();n(p.models)}catch(d){console.error("Error fetching models:",d)}finally{i(!1)}},u=async d=>{l(d);try{const f=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${f}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:d})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);a()}catch(f){console.error("Error loading model:",f)}finally{l(null)}},c=async d=>{l(d);try{const f=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${f}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:d})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);a()}catch(f){console.error("Error unloading model:",f)}finally{l(null)}};return r?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx(xc,{className:"h-8 w-8 animate-spin"})}):s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto p-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:s.jsx(ra,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),s.jsxs(J,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[s.jsx(vc,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),s.jsx("div",{className:"flex-1 p-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[s.jsx(Ie,{className:"bg-blue-50 border-blue-200",children:s.jsx(Ye,{className:"pt-6",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ny,{className:"h-5 w-5 text-blue-600 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),s.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."})]})]})})}),s.jsxs("div",{children:[s.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[s.jsx(Ps,{className:"h-5 w-5"}),"API Models",s.jsx(xe,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(d=>d.type==="api").map(d=>s.jsx(Sh,{model:d,modelLoading:o,onLoad:u,onUnload:c},d.model_name))})]}),s.jsxs("div",{children:[s.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[s.jsx(ty,{className:"h-5 w-5"}),"Local Models",s.jsx(xe,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(d=>d.type==="local").map(d=>s.jsx(Sh,{model:d,modelLoading:o,onLoad:u,onUnload:c},d.model_name))})]})]})})]})}function Sh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return s.jsxs(Ie,{className:"hover:shadow-md transition-shadow",children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[i?s.jsx(Ps,{className:"h-4 w-4 text-blue-600"}):s.jsx(ty,{className:"h-4 w-4 text-green-600"}),e.name]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&s.jsx(cN,{className:"h-5 w-5 text-green-600"})]})}),s.jsxs(Ye,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Size:"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.size_gb})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),s.jsx(xe,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Type:"}),s.jsx(xe,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Features:"}),s.jsxs(xe,{variant:"outline",className:"text-xs",children:[s.jsx(Er,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),s.jsx("div",{className:"pt-2",children:l?s.jsxs(J,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?s.jsx(xc,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(iy,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):s.jsxs(J,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?s.jsx(xc,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(mN,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function IR(){return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:s.jsx("div",{className:"max-w-6xl mx-auto p-6",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:s.jsx(ui,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),s.jsx("div",{className:"flex-1 p-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(_N,{className:"h-5 w-5"}),"Server Configuration"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Backend URL"}),s.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Frontend URL"}),s.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(nm,{className:"h-5 w-5"}),"Privacy & Security"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(nm,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),s.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),s.jsxs(Ie,{children:[s.jsx(Ct,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(ny,{className:"h-5 w-5"}),"System Information"]})}),s.jsx(Ye,{className:"space-y-4",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Platform"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(xe,{variant:"outline",children:"Local"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),s.jsxs("div",{children:[s.jsx(Ne,{className:"text-sm font-medium",children:"Status"}),s.jsx("div",{className:"mt-1",children:s.jsx(xe,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function RR(){return s.jsx(ck,{children:s.jsxs(rk,{children:[s.jsx(rn,{path:"/",element:s.jsx(rC,{})}),s.jsx(rn,{path:"/technology",element:s.jsx(sC,{})}),s.jsx(rn,{path:"/usecases",element:s.jsx(aC,{})}),s.jsx(rn,{path:"/mydevice",element:s.jsx(VE,{})}),s.jsxs(rn,{path:"/",element:s.jsx(XN,{}),children:[s.jsx(rn,{path:"templates",element:s.jsx(WE,{})}),s.jsx(rn,{path:"playground",element:s.jsx(AR,{})}),s.jsx(rn,{path:"models",element:s.jsx(_R,{})}),s.jsx(rn,{path:"settings",element:s.jsx(IR,{})})]})]})})}vu.createRoot(document.getElementById("root")).render(s.jsx(Ht.StrictMode,{children:s.jsx(RR,{})})); +//# sourceMappingURL=index-06085ffb.js.map