diff --git "a/static/assets/index-3b8f96c4.js" "b/static/assets/index-3b8f96c4.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-3b8f96c4.js" @@ -0,0 +1,385 @@ +function I1(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 Ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var am={exports:{}},ws={},um={exports:{}},oe={};/** + * @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 Mo=Symbol.for("react.element"),M1=Symbol.for("react.portal"),O1=Symbol.for("react.fragment"),L1=Symbol.for("react.strict_mode"),D1=Symbol.for("react.profiler"),z1=Symbol.for("react.provider"),F1=Symbol.for("react.context"),B1=Symbol.for("react.forward_ref"),$1=Symbol.for("react.suspense"),U1=Symbol.for("react.memo"),V1=Symbol.for("react.lazy"),vf=Symbol.iterator;function H1(e){return e===null||typeof e!="object"?null:(e=vf&&e[vf]||e["@@iterator"],typeof e=="function"?e:null)}var cm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dm=Object.assign,fm={};function wi(e,t,n){this.props=e,this.context=t,this.refs=fm,this.updater=n||cm}wi.prototype.isReactComponent={};wi.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")};wi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pm(){}pm.prototype=wi.prototype;function _c(e,t,n){this.props=e,this.context=t,this.refs=fm,this.updater=n||cm}var Tc=_c.prototype=new pm;Tc.constructor=_c;dm(Tc,wi.prototype);Tc.isPureReactComponent=!0;var xf=Array.isArray,hm=Object.prototype.hasOwnProperty,Ac={current:null},mm={key:!0,ref:!0,__self:!0,__source:!0};function gm(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)hm.call(t,r)&&!mm.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,q=_[Y];if(0>>1;Yi(Ie,k))sei(K,Ie)?(_[Y]=K,_[se]=k,Y=se):(_[Y]=Ie,_[ne]=k,Y=ne);else if(sei(K,k))_[Y]=K,_[se]=k,Y=se;else break e}}return F}function i(_,F){var k=_.sortIndex-F.sortIndex;return k!==0?k:_.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,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],f=1,d=null,p=3,h=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(_){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=_)r(u),F.sortIndex=F.expirationTime,t(a,F);else break;F=n(u)}}function C(_){if(v=!1,x(_),!w)if(n(a)!==null)w=!0,$(b);else{var F=n(u);F!==null&&H(C,F.startTime-_)}}function b(_,F){w=!1,v&&(v=!1,g(T),T=-1),h=!0;var k=p;try{for(x(F),d=n(a);d!==null&&(!(d.expirationTime>F)||_&&!A());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var q=Y(d.expirationTime<=F);F=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(a)&&r(a),x(F)}else r(a);d=n(a)}if(d!==null)var E=!0;else{var ne=n(u);ne!==null&&H(C,ne.startTime-F),E=!1}return E}finally{d=null,p=k,h=!1}}var N=!1,j=null,T=-1,z=5,M=-1;function A(){return!(e.unstable_now()-M_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var F=3;break;default:F=p}var k=p;p=F;try{return _()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,F){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var k=p;p=_;try{return F()}finally{p=k}},e.unstable_scheduleCallback=function(_,F,k){var Y=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0Y?(_.sortIndex=k,t(u,_),n(a)===null&&_===n(u)&&(v?(g(T),T=-1):v=!0,H(C,k-Y))):(_.sortIndex=q,t(a,_),w||h||(w=!0,$(b))),_},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(_){var F=p;return function(){var k=p;p=F;try{return _.apply(this,arguments)}finally{p=k}}}})(Sm);wm.exports=Sm;var tw=wm.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 nw=m,St=tw;function D(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"),qa=Object.prototype.hasOwnProperty,rw=/^[: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]*$/,Sf={},kf={};function iw(e){return qa.call(kf,e)?!0:qa.call(Sf,e)?!1:rw.test(e)?kf[e]=!0:(Sf[e]=!0,!1)}function ow(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 lw(e,t,n,r){if(t===null||typeof t>"u"||ow(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 tt(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 We={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){We[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];We[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){We[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){We[e]=new tt(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){We[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){We[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){We[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){We[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){We[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mc=/[\-:]([a-z])/g;function Oc(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(Mc,Oc);We[t]=new tt(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(Mc,Oc);We[t]=new tt(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(Mc,Oc);We[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){We[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});We.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){We[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,n,r){var i=We.hasOwnProperty(t)?We[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{ra=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gi(e):""}function sw(e){switch(e.tag){case 5:return Gi(e.type);case 16:return Gi("Lazy");case 13:return Gi("Suspense");case 19:return Gi("SuspenseList");case 0:case 2:case 15:return e=ia(e.type,!1),e;case 11:return e=ia(e.type.render,!1),e;case 1:return e=ia(e.type,!0),e;default:return""}}function eu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $r:return"Fragment";case Br:return"Portal";case Xa:return"Profiler";case Dc:return"StrictMode";case Ja:return"Suspense";case Za:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bm:return(e.displayName||"Context")+".Consumer";case Cm:return(e._context.displayName||"Context")+".Provider";case zc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fc:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case Tn:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function aw(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 eu(t);case 8:return t===Dc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Em(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uw(e){var t=Em(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){e._valueTracker||(e._valueTracker=uw(e))}function jm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Em(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ll(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 tu(e,t){var n=t.checked;return _e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pm(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function nu(e,t){Pm(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ru(e,t.type,n):t.hasOwnProperty("defaultValue")&&ru(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Nf(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 ru(e,t,n){(t!=="number"||Ll(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ki=Array.isArray;function Jr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Yo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zi={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},cw=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){cw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function Rm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function Im(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Rm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var dw=_e({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 lu(e,t){if(t){if(dw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function su(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 au=null;function Bc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uu=null,Zr=null,ei=null;function Pf(e){if(e=Do(e)){if(typeof uu!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Ns(t),uu(e.stateNode,e.type,t))}}function Mm(e){Zr?ei?ei.push(e):ei=[e]:Zr=e}function Om(){if(Zr){var e=Zr,t=ei;if(ei=Zr=null,Pf(e),t)for(e=0;e>>=0,e===0?32:31-(kw(e)/Cw|0)|0}var Qo=64,qo=4194304;function Yi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Yi(s):(o&=l,o!==0&&(r=Yi(o)))}else l=n&~i,l!==0?r=Yi(l):o!==0&&(r=Yi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Oo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bt(t),e[t]=n}function jw(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=to),Df=String.fromCharCode(32),zf=!1;function tg(e,t){switch(e){case"keyup":return tS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ng(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ur=!1;function rS(e,t){switch(e){case"compositionend":return ng(t);case"keypress":return t.which!==32?null:(zf=!0,Df);case"textInput":return e=t.data,e===Df&&zf?null:e;default:return null}}function iS(e,t){if(Ur)return e==="compositionend"||!Yc&&tg(e,t)?(e=Zm(),Sl=Wc=Mn=null,Ur=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uf(n)}}function lg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sg(){for(var e=window,t=Ll();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ll(e.document)}return t}function Qc(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 pS(e){var t=sg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lg(n.ownerDocument.documentElement,n)){if(r!==null&&Qc(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=Vf(n,o);var l=Vf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Vr=null,mu=null,ro=null,gu=!1;function Hf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||Vr==null||Vr!==Ll(r)||(r=Vr,"selectionStart"in r&&Qc(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}),ro&&xo(ro,r)||(ro=r,r=Vl(mu,"onSelect"),0Gr||(e.current=ku[Gr],ku[Gr]=null,Gr--)}function xe(e,t){Gr++,ku[Gr]=e.current,e.current=t}var Yn={},qe=er(Yn),lt=er(!1),yr=Yn;function di(e,t){var n=e.type.contextTypes;if(!n)return Yn;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 st(e){return e=e.childContextTypes,e!=null}function Wl(){Ne(lt),Ne(qe)}function Xf(e,t,n){if(qe.current!==Yn)throw Error(D(168));xe(qe,t),xe(lt,n)}function gg(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(D(108,aw(e)||"Unknown",i));return _e({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,yr=qe.current,xe(qe,e),xe(lt,lt.current),!0}function Jf(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=gg(e,t,yr),r.__reactInternalMemoizedMergedChildContext=e,Ne(lt),Ne(qe),xe(qe,e)):Ne(lt),xe(lt,n)}var cn=null,Es=!1,va=!1;function yg(e){cn===null?cn=[e]:cn.push(e)}function NS(e){Es=!0,yg(e)}function tr(){if(!va&&cn!==null){va=!0;var e=0,t=he;try{var n=cn;for(he=1;e>=l,i-=l,dn=1<<32-Bt(t)+i|n<T?(z=j,j=null):z=j.sibling;var M=p(g,j,x[T],C);if(M===null){j===null&&(j=z);break}e&&j&&M.alternate===null&&t(g,j),y=o(M,y,T),N===null?b=M:N.sibling=M,N=M,j=z}if(T===x.length)return n(g,j),Ee&&ar(g,T),b;if(j===null){for(;TT?(z=j,j=null):z=j.sibling;var A=p(g,j,M.value,C);if(A===null){j===null&&(j=z);break}e&&j&&A.alternate===null&&t(g,j),y=o(A,y,T),N===null?b=A:N.sibling=A,N=A,j=z}if(M.done)return n(g,j),Ee&&ar(g,T),b;if(j===null){for(;!M.done;T++,M=x.next())M=d(g,M.value,C),M!==null&&(y=o(M,y,T),N===null?b=M:N.sibling=M,N=M);return Ee&&ar(g,T),b}for(j=r(g,j);!M.done;T++,M=x.next())M=h(j,g,T,M.value,C),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?T:M.key),y=o(M,y,T),N===null?b=M:N.sibling=M,N=M);return e&&j.forEach(function(P){return t(g,P)}),Ee&&ar(g,T),b}function S(g,y,x,C){if(typeof x=="object"&&x!==null&&x.type===$r&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Go:e:{for(var b=x.key,N=y;N!==null;){if(N.key===b){if(b=x.type,b===$r){if(N.tag===7){n(g,N.sibling),y=i(N,x.props.children),y.return=g,g=y;break e}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Tn&&tp(b)===N.type){n(g,N.sibling),y=i(N,x.props),y.ref=Fi(g,N,x),y.return=g,g=y;break e}n(g,N);break}else t(g,N);N=N.sibling}x.type===$r?(y=gr(x.props.children,g.mode,C,x.key),y.return=g,g=y):(C=_l(x.type,x.key,x.props,null,g.mode,C),C.ref=Fi(g,y,x),C.return=g,g=C)}return l(g);case Br:e:{for(N=x.key;y!==null;){if(y.key===N)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),y=i(y,x.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Ea(x,g.mode,C),y.return=g,g=y}return l(g);case Tn:return N=x._init,S(g,y,N(x._payload),C)}if(Ki(x))return w(g,y,x,C);if(Mi(x))return v(g,y,x,C);rl(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),y=i(y,x),y.return=g,g=y):(n(g,y),y=Na(x,g.mode,C),y.return=g,g=y),l(g)):n(g,y)}return S}var pi=Sg(!0),kg=Sg(!1),Ql=er(null),ql=null,Qr=null,Zc=null;function ed(){Zc=Qr=ql=null}function td(e){var t=Ql.current;Ne(Ql),e._currentValue=t}function Nu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ni(e,t){ql=e,Zc=Qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Tt(e){var t=e._currentValue;if(Zc!==e)if(e={context:e,memoizedValue:t,next:null},Qr===null){if(ql===null)throw Error(D(308));Qr=e,ql.dependencies={lanes:0,firstContext:e}}else Qr=Qr.next=e;return t}var fr=null;function nd(e){fr===null?fr=[e]:fr.push(e)}function Cg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,nd(t)):(n.next=i.next,i.next=n),t.interleaved=n,yn(e,r)}function yn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var An=!1;function rd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ce&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,yn(e,n)}return i=r.interleaved,i===null?(t.next=t,nd(r)):(t.next=i.next,i.next=t),r.interleaved=t,yn(e,n)}function Cl(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,Uc(e,n)}}function np(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 Xl(e,t,n,r){var i=e.updateQueue;An=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,f=u=a=null,s=o;do{var p=s.lane,h=s.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,v=s;switch(p=t,h=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(h,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,p=typeof w=="function"?w.call(h,d,p):w,p==null)break e;d=_e({},d,p);break e;case 2:An=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=h,a=d):f=f.next=h,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);wr|=l,e.lanes=l,e.memoizedState=d}}function rp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{he=n,wa.transition=r}}function $g(){return At().memoizedState}function _S(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ug(e))Vg(t,n);else if(n=Cg(e,t,n,r),n!==null){var i=Ze();$t(n,e,r,i),Hg(n,t,r)}}function TS(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ug(e))Vg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,Ut(s,l)){var a=t.interleaved;a===null?(i.next=i,nd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Cg(e,t,i,r),n!==null&&(i=Ze(),$t(n,e,r,i),Hg(n,t,r))}}function Ug(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function Vg(e,t){io=Zl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uc(e,n)}}var es={readContext:Tt,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},AS={readContext:Tt,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:op,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nl(4194308,4,Lg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nl(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_S.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:ip,useDebugValue:dd,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=ip(!1),t=e[0];return e=PS.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pe,i=Yt();if(Ee){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),$e===null)throw Error(D(349));xr&30||Pg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,op(Tg.bind(null,r,o,e),[e]),r.flags|=2048,jo(9,_g.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Yt(),t=$e.identifierPrefix;if(Ee){var n=fn,r=dn;n=(r&~(1<<32-Bt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=No++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[qt]=t,e[ko]=r,ey(e,t,!1,!1),t.stateNode=e;e:{switch(l=su(n,r),n){case"dialog":be("cancel",e),be("close",e),i=r;break;case"iframe":case"object":case"embed":be("load",e),i=r;break;case"video":case"audio":for(i=0;igi&&(t.flags|=128,r=!0,Bi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Jl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ee)return Ye(t),null}else 2*Re()-o.renderingStartTime>gi&&n!==1073741824&&(t.flags|=128,r=!0,Bi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Re(),t.sibling=null,n=je.current,xe(je,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return yd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function FS(e,t){switch(Xc(t),t.tag){case 1:return st(t.type)&&Wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Ne(lt),Ne(qe),ld(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return od(t),null;case 13:if(Ne(je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(je),null;case 4:return hi(),null;case 10:return td(t.type._context),null;case 22:case 23:return yd(),null;case 24:return null;default:return null}}var ol=!1,Qe=!1,BS=typeof WeakSet=="function"?WeakSet:Set,G=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Mu(e,t,n){try{n()}catch(r){Te(e,t,r)}}var gp=!1;function $S(e,t){if(yu=$l,e=sg(),Qc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===i&&(s=l),p===o&&++f===r&&(a=l),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},$l=!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 v=w.memoizedProps,S=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Lt(t.type,v),S);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(C){Te(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=gp,gp=!1,w}function oo(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&&Mu(t,n,o)}i=i.next}while(i!==r)}}function _s(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 Ou(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 ry(e){var t=e.alternate;t!==null&&(e.alternate=null,ry(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qt],delete t[ko],delete t[Su],delete t[CS],delete t[bS])),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 iy(e){return e.tag===5||e.tag===3||e.tag===4}function yp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||iy(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 Lu(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=Hl));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Du(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(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var Ue=null,zt=!1;function En(e,t,n){for(n=n.child;n!==null;)oy(e,t,n),n=n.sibling}function oy(e,t,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ss,n)}catch{}switch(n.tag){case 5:Qe||qr(n,t);case 6:var r=Ue,i=zt;Ue=null,En(e,t,n),Ue=r,zt=i,Ue!==null&&(zt?(e=Ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ue.removeChild(n.stateNode));break;case 18:Ue!==null&&(zt?(e=Ue,n=n.stateNode,e.nodeType===8?ya(e.parentNode,n):e.nodeType===1&&ya(e,n),yo(e)):ya(Ue,n.stateNode));break;case 4:r=Ue,i=zt,Ue=n.stateNode.containerInfo,zt=!0,En(e,t,n),Ue=r,zt=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(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)&&Mu(n,t,l),i=i.next}while(i!==r)}En(e,t,n);break;case 1:if(!Qe&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Te(n,t,s)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,En(e,t,n),Qe=r):En(e,t,n);break;default:En(e,t,n)}}function vp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new BS),t.forEach(function(r){var i=qS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*VS(r/1960))-r,10e?16:e,On===null)var r=!1;else{if(e=On,On=null,rs=0,ce&6)throw Error(D(331));var i=ce;for(ce|=4,G=e.current;G!==null;){var o=G,l=o.child;if(G.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aRe()-md?mr(e,0):hd|=n),at(e,t)}function py(e,t){t===0&&(e.mode&1?(t=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):t=1);var n=Ze();e=yn(e,t),e!==null&&(Oo(e,t,n),at(e,n))}function QS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),py(e,n)}function qS(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(D(314))}r!==null&&r.delete(t),py(e,n)}var hy;hy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,DS(e,t,n);it=!!(e.flags&131072)}else it=!1,Ee&&t.flags&1048576&&vg(t,Yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;El(e,t),e=t.pendingProps;var i=di(t,qe.current);ni(t,n),i=ad(null,t,r,e,i,n);var o=ud();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,st(r)?(o=!0,Gl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rd(t),i.updater=Ps,t.stateNode=i,i._reactInternals=t,ju(t,r,e,n),t=Tu(null,t,r,!0,o,n)):(t.tag=0,Ee&&o&&qc(t),Je(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(El(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=JS(r),e=Lt(r,e),i){case 0:t=_u(null,t,r,e,n);break e;case 1:t=pp(null,t,r,e,n);break e;case 11:t=dp(null,t,r,e,n);break e;case 14:t=fp(null,t,r,Lt(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),_u(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),pp(e,t,r,i,n);case 3:e:{if(Xg(t),e===null)throw Error(D(387));r=t.pendingProps,o=t.memoizedState,i=o.element,bg(e,t),Xl(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(D(423)),t),t=hp(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(D(424)),t),t=hp(e,t,r,n,i);break e}else for(gt=Bn(t.stateNode.containerInfo.firstChild),vt=t,Ee=!0,Ft=null,n=kg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fi(),r===i){t=vn(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return Ng(t),e===null&&bu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,xu(r,i)?l=null:o!==null&&xu(r,o)&&(t.flags|=32),qg(e,t),Je(e,t,l,n),t.child;case 6:return e===null&&bu(t),null;case 13:return Jg(e,t,n);case 4:return id(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pi(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),dp(e,t,r,i,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,xe(Ql,r._currentValue),r._currentValue=l,o!==null)if(Ut(o.value,l)){if(o.children===i.children&&!lt.current){t=vn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=pn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Nu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(D(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Nu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Je(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ni(t,n),i=Tt(i),r=r(i),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,i=Lt(r,t.pendingProps),i=Lt(r.type,i),fp(e,t,r,i,n);case 15:return Yg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),El(e,t),t.tag=1,st(r)?(e=!0,Gl(t)):e=!1,ni(t,n),Wg(t,r,i),ju(t,r,i,n),Tu(null,t,r,!0,e,n);case 19:return Zg(e,t,n);case 22:return Qg(e,t,n)}throw Error(D(156,t.tag))};function my(e,t){return Um(e,t)}function XS(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 Pt(e,t,n,r){return new XS(e,t,n,r)}function xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JS(e){if(typeof e=="function")return xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zc)return 11;if(e===Fc)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=Pt(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 _l(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")xd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case $r:return gr(n.children,i,o,t);case Dc:l=8,i|=8;break;case Xa:return e=Pt(12,n,t,i|2),e.elementType=Xa,e.lanes=o,e;case Ja:return e=Pt(13,n,t,i),e.elementType=Ja,e.lanes=o,e;case Za:return e=Pt(19,n,t,i),e.elementType=Za,e.lanes=o,e;case Nm:return As(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cm:l=10;break e;case bm:l=9;break e;case zc:l=11;break e;case Fc:l=14;break e;case Tn:l=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=Pt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function gr(e,t,n,r){return e=Pt(7,e,r,t),e.lanes=n,e}function As(e,t,n,r){return e=Pt(22,e,r,t),e.elementType=Nm,e.lanes=n,e.stateNode={isHidden:!1},e}function Na(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function Ea(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ZS(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=la(0),this.expirationTimes=la(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=la(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function wd(e,t,n,r,i,o,l,s,a){return e=new ZS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},rd(o),e}function ek(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xy)}catch(e){console.error(e)}}xy(),xm.exports=kt;var Ci=xm.exports;const ok=xs(Ci);var Ep=Ci;Qa.createRoot=Ep.createRoot,Qa.hydrateRoot=Ep.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 _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function wy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sk(){return Math.random().toString(36).substr(2,8)}function Pp(e,t){return{usr:e.state,key:e.key,idx:t}}function Uu(e,t,n,r){return n===void 0&&(n=null),_o({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bi(t):t,{state:n,key:t&&t.key||r||sk()})}function ls(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 bi(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 ak(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Ln.Pop,a=null,u=f();u==null&&(u=0,l.replaceState(_o({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Ln.Pop;let S=f(),g=S==null?null:S-u;u=S,a&&a({action:s,location:v.location,delta:g})}function p(S,g){s=Ln.Push;let y=Uu(v.location,S,g);n&&n(y,S),u=f()+1;let x=Pp(y,u),C=v.createHref(y);try{l.pushState(x,"",C)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(C)}o&&a&&a({action:s,location:v.location,delta:1})}function h(S,g){s=Ln.Replace;let y=Uu(v.location,S,g);n&&n(y,S),u=f();let x=Pp(y,u),C=v.createHref(y);l.replaceState(x,"",C),o&&a&&a({action:s,location:v.location,delta:0})}function w(S){let g=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof S=="string"?S:ls(S);return y=y.replace(/ $/,"%20"),Le(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let v={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(jp,d),a=S,()=>{i.removeEventListener(jp,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let g=w(S);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:h,go(S){return l.go(S)}};return v}var _p;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_p||(_p={}));function uk(e,t,n){return n===void 0&&(n="/"),ck(e,t,n,!1)}function ck(e,t,n,r){let i=typeof t=="string"?bi(t):t,o=bd(i.pathname||"/",n);if(o==null)return null;let l=Sy(e);dk(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Le(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Wn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Le(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Sy(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:vk(u,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of ky(o.path))i(o,l,a)}),t}function ky(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=ky(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function dk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fk=/^:[\w-]+$/,pk=3,hk=2,mk=1,gk=10,yk=-2,Tp=e=>e==="*";function vk(e,t){let n=e.split("/"),r=n.length;return n.some(Tp)&&(r+=yk),t&&(r+=hk),n.filter(i=>!Tp(i)).reduce((i,o)=>i+(fk.test(o)?pk:o===""?mk:gk),r)}function xk(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 wk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:p,isOptional:h}=f;if(p==="*"){let v=s[d]||"";l=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const w=s[d];return h&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function Sk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),wy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function kk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wy(!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 Ck(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?bi(e):e;return{pathname:n?n.startsWith("/")?n:bk(n,t):t,search:jk(r),hash:Pk(i)}}function bk(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 ja(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 Nk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Cy(e,t){let n=Nk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function by(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=bi(e):(i=_o({},e),Le(!i.pathname||!i.pathname.includes("?"),ja("?","pathname","search",i)),Le(!i.pathname||!i.pathname.includes("#"),ja("#","pathname","hash",i)),Le(!i.search||!i.search.includes("#"),ja("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=Ck(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Wn=e=>e.join("/").replace(/\/\/+/g,"/"),Ek=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _k(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ny=["post","put","patch","delete"];new Set(Ny);const Tk=["get",...Ny];new Set(Tk);/** + * 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 To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),m.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=by(u,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Wn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Ok=m.createContext(null);function Lk(e){let t=m.useContext(nr).outlet;return t&&m.createElement(Ok.Provider,{value:e},t)}function Py(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(_r),{matches:i}=m.useContext(nr),{pathname:o}=Bo(),l=JSON.stringify(Cy(i,r.v7_relativeSplatPath));return m.useMemo(()=>by(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Dk(e,t){return zk(e,t)}function zk(e,t,n,r){Fo()||Le(!1);let{navigator:i}=m.useContext(_r),{matches:o}=m.useContext(nr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Bo(),f;if(t){var d;let S=typeof t=="string"?bi(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Le(!1),f=S}else f=u;let p=f.pathname||"/",h=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=uk(e,{pathname:h}),v=Vk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Wn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Wn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&v?m.createElement(Ls.Provider,{value:{location:To({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ln.Pop}},v):v}function Fk(){let e=Kk(),t=_k(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,o)}const Bk=m.createElement(Fk,null);class $k extends m.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?m.createElement(nr.Provider,{value:this.props.routeContext},m.createElement(Ey.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Uk(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(Nd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(nr.Provider,{value:t},r)}function Vk(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let f=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||Le(!1),l=l.slice(0,Math.min(l.length,f+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let h,w=!1,v=null,S=null;n&&(h=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||Bk,a&&(u<0&&p===0?(Qk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,p+1)),y=()=>{let x;return h?x=v:w?x=S:d.route.Component?x=m.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,m.createElement(Uk,{match:d,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?m.createElement($k,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var _y=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_y||{}),ss=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}(ss||{});function Hk(e){let t=m.useContext(Nd);return t||Le(!1),t}function Wk(e){let t=m.useContext(Ak);return t||Le(!1),t}function Gk(e){let t=m.useContext(nr);return t||Le(!1),t}function Ty(e){let t=Gk(),n=t.matches[t.matches.length-1];return n.route.id||Le(!1),n.route.id}function Kk(){var e;let t=m.useContext(Ey),n=Wk(ss.UseRouteError),r=Ty(ss.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Yk(){let{router:e}=Hk(_y.UseNavigateStable),t=Ty(ss.UseNavigateStable),n=m.useRef(!1);return jy(()=>{n.current=!0}),m.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,To({fromRouteId:t},o)))},[e,t])}const Rp={};function Qk(e,t,n){!t&&!Rp[e]&&(Rp[e]=!0)}function qk(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 Xk(e){return Lk(e.context)}function zr(e){Le(!1)}function Jk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ln.Pop,navigator:o,static:l=!1,future:s}=e;Fo()&&Le(!1);let a=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:a,navigator:o,static:l,future:To({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=bi(r));let{pathname:f="/",search:d="",hash:p="",state:h=null,key:w="default"}=r,v=m.useMemo(()=>{let S=bd(f,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:h,key:w},navigationType:i}},[a,f,d,p,h,w,i]);return v==null?null:m.createElement(_r.Provider,{value:u},m.createElement(Ls.Provider,{children:n,value:v}))}function Zk(e){let{children:t,location:n}=e;return Dk(Vu(t),n)}new Promise(()=>{});function Vu(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,i)=>{if(!m.isValidElement(r))return;let o=[...t,i];if(r.type===m.Fragment){n.push.apply(n,Vu(r.props.children,o));return}r.type!==zr&&Le(!1),!r.props.index||!r.props.children||Le(!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=Vu(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 Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function tC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nC(e,t){return e.button===0&&(!t||t==="_self")&&!tC(e)}const rC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],iC="6";try{window.__reactRouterVersion=iC}catch{}const oC="startTransition",Ip=Ic[oC];function lC(e){let{basename:t,children:n,future:r,window:i}=e,o=m.useRef();o.current==null&&(o.current=lk({window:i,v5Compat:!0}));let l=o.current,[s,a]=m.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=m.useCallback(d=>{u&&Ip?Ip(()=>a(d)):a(d)},[a,u]);return m.useLayoutEffect(()=>l.listen(f),[l,f]),m.useEffect(()=>qk(r),[r]),m.createElement(Jk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const sC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fr=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:f,viewTransition:d}=t,p=eC(t,rC),{basename:h}=m.useContext(_r),w,v=!1;if(typeof u=="string"&&aC.test(u)&&(w=u,sC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),b=bd(C.pathname,h);C.origin===x.origin&&b!=null?u=b+C.search+C.hash:v=!0}catch{}let S=Rk(u,{relative:i}),g=uC(u,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function y(x){r&&r(x),x.defaultPrevented||g(x)}return m.createElement("a",Hu({},p,{href:w||S,onClick:v||o?r:y,ref:n,target:a}))});var Mp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Mp||(Mp={}));var Op;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Op||(Op={}));function uC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Ik(),u=Bo(),f=Py(e,{relative:l});return m.useCallback(d=>{if(nC(d,n)){d.preventDefault();let p=r!==void 0?r:ls(u)===ls(f);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,f,r,i,n,e,o,l,s])}function Ay(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var Oy="!";function yC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,f,d=0;du?f-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:S}}}function vC(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 xC(e){return{cache:gC(e.cacheSize),splitModifiers:yC(e),...dC(e)}}var wC=/\s+/;function SC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(wC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?f.substring(0,d):f),h=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:l};h=!1}var w=vC(a).join(":"),v=u?w+Oy:w;return{isTailwindClass:!0,modifierId:v,classGroupId:p,originalClassName:l,hasPostfixModifier:h}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,f=s+a;return o.has(f)?!1:(o.add(f),i(a,u).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function kC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Fp=e=>{const t=FC(e);return t.charAt(0).toUpperCase()+t.slice(1)},zy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),BC=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 $C={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 UC=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>m.createElement("svg",{ref:a,...$C,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zy("lucide",i),...!o&&!BC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,f])=>m.createElement(u,f)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ie=(e,t)=>{const n=m.forwardRef(({className:r,...i},o)=>m.createElement(UC,{ref:o,iconNode:t,className:zy(`lucide-${zC(Fp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Fp(e),n};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],HC=ie("arrow-right",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WC=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],yi=ie("book-open",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["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"}]],as=ie("bot",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KC=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Gn=ie("brain",KC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],QC=ie("check",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jd=ie("chevron-down",qC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],JC=ie("chevron-up",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],eb=ie("circle-check-big",ZC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ii=ie("cloud",tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],rb=ie("code",nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ob=ie("copy",ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lb=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Fy=ie("cpu",lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["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"}]],Pd=ie("download",sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ab=[["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"}]],By=ie("hard-drive",ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["path",{d:"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"}]],Bp=ie("heart",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],db=ie("history",cb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],pb=ie("house",fb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$y=ie("info",hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Uy=ie("loader-circle",mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["path",{d:"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"}]],Qn=ie("message-square",gb);/** + * @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 yb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],vb=ie("panel-left-close",yb);/** + * @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 xb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],wb=ie("panel-left-open",xb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kb=ie("plus",Sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],bb=ie("rotate-ccw",Cb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=[["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"}]],Eb=ie("save",Nb);/** + * @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 jb=[["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"}]],Pb=ie("send",jb);/** + * @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 _b=[["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"}]],Tb=ie("server",_b);/** + * @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 Ab=[["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"}]],_d=ie("settings",Ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],Vy=ie("share",Rb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ib=[["path",{d:"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"}]],Ku=ie("shield",Ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ob=ie("square",Mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["path",{d:"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"}]],Hy=ie("star",Lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Db=[["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"}]],Td=ie("trash-2",Db);/** + * @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 zb=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fb=ie("triangle-alert",zb);/** + * @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 Bb=[["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"}]],$b=ie("upload",Bb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ub=[["path",{d:"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"}]],Vb=ie("user",Ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hb=[["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"}]],Wb=ie("users",Hb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],us=ie("zap",Gb),Kb=[{name:"Home",href:"/",icon:pb,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:Qn,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:yi,description:"Browse and manage models"},{name:"Settings",href:"/settings",icon:_d,description:"Application settings"}];function Yb(){const e=Bo();return c.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[c.jsx("div",{className:"p-6 border-b",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:c.jsx(Gn,{className:"h-5 w-5 text-primary-foreground"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),c.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),c.jsx("nav",{className:"space-y-1",children:Kb.map(t=>{const n=e.pathname===t.href;return c.jsxs(Fr,{to:t.href,className:ue("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[c.jsx(t.icon,{className:"h-4 w-4"}),c.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Qb(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(Yb,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(Xk,{})})]})}const ze=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const ot=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));ot.displayName="CardHeader";const xt=m.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));xt.displayName="CardTitle";const qb=m.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));qb.displayName="CardDescription";const Ve=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));Ve.displayName="CardContent";const Xb=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));Xb.displayName="CardFooter";function $p(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=$p(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=m.Children.toArray(o),a=s.find(tN);if(a){const u=a.props.children,f=s.map(d=>d===a?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...l,ref:i,children:m.isValidElement(u)?m.cloneElement(u,void 0,f):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Jb=vi("Slot");function Zb(e){const t=m.forwardRef((n,r)=>{const{children:i,...o}=n;if(m.isValidElement(i)){const l=rN(i),s=nN(o,i.props);return i.type!==m.Fragment&&(s.ref=r?Wy(r,l):l),m.cloneElement(i,s)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gy=Symbol("radix.slottable");function eN(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Gy,t}function tN(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gy}function nN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function rN(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 Up=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vp=Ry,Ad=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Vp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],d=o==null?void 0:o[u];if(f===null)return null;const p=Up(f)||Up(d);return i[u][p]}),s=n&&Object.entries(n).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:p,...h}=f;return Object.entries(h).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...o,...s}[v]):{...o,...s}[v]===S})?[...u,d,p]:u},[]);return Vp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Rd=Ad("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"}}),de=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Jb:"button";return c.jsx(l,{className:ue(Rd({variant:t,size:n,className:e})),ref:o,...i})});de.displayName="Button";const iN=[{icon:Gn,title:"Local AI Models",description:"Run powerful language models locally on your machine with full privacy control.",color:"text-blue-500"},{icon:Qn,title:"Interactive Chat",description:"Playground interface for testing prompts and exploring model capabilities.",color:"text-green-500"},{icon:Ku,title:"Privacy First",description:"Your data never leaves your machine. Complete privacy and security guaranteed.",color:"text-purple-500"},{icon:us,title:"High Performance",description:"Optimized for speed with model caching and efficient resource management.",color:"text-yellow-500"}],oN=[{title:"Start Chatting",description:"Jump into the playground and start experimenting",href:"/playground",icon:Qn,primary:!0},{title:"Browse Models",description:"Explore available models and their capabilities",href:"/models",icon:yi,primary:!1},{title:"View Settings",description:"Configure your application preferences",href:"/settings",icon:Fy,primary:!1}];function lN(){return c.jsx("div",{className:"min-h-screen bg-background",children:c.jsxs("div",{className:"container mx-auto px-4 py-8",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("div",{className:"flex items-center justify-center mb-4",children:c.jsx("div",{className:"w-16 h-16 bg-primary rounded-2xl flex items-center justify-center",children:c.jsx(Gn,{className:"h-8 w-8 text-primary-foreground"})})}),c.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Edge LLM"}),c.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto mb-8",children:"Your local AI companion. Run powerful language models on your own hardware with complete privacy and control."}),c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsx(Fr,{to:"/playground",children:c.jsxs(de,{size:"lg",children:[c.jsx(Qn,{className:"h-5 w-5 mr-2"}),"Start Chatting"]})}),c.jsx(Fr,{to:"/models",children:c.jsxs(de,{variant:"outline",size:"lg",children:[c.jsx(yi,{className:"h-5 w-5 mr-2"}),"Browse Models"]})})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:iN.map((e,t)=>c.jsx(ze,{className:"text-center",children:c.jsxs(Ve,{className:"pt-6",children:[c.jsx(e.icon,{className:`h-12 w-12 mx-auto mb-4 ${e.color}`}),c.jsx("h3",{className:"font-semibold mb-2",children:e.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})},t))}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:oN.map((e,t)=>c.jsx(ze,{className:"hover:shadow-lg transition-shadow",children:c.jsxs(Ve,{className:"pt-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsx(e.icon,{className:"h-6 w-6 text-primary"}),c.jsx("h3",{className:"font-semibold",children:e.title})]}),c.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e.description}),c.jsx(Fr,{to:e.href,children:c.jsxs(de,{variant:e.primary?"default":"outline",className:"w-full",children:["Get Started",c.jsx(HC,{className:"h-4 w-4 ml-2"})]})})]})},t))}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{children:"Getting Started"})}),c.jsxs(Ve,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"1"}),c.jsx("h4",{className:"font-medium",children:"Browse Available Models"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Check out our model catalog to see what's available for your use case."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"2"}),c.jsx("h4",{className:"font-medium",children:"Load a Model"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Select and load a model that fits your hardware and requirements."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"3"}),c.jsx("h4",{className:"font-medium",children:"Start Chatting"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Go to the playground and start experimenting with prompts."})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(Fr,{to:"/playground",children:c.jsxs(de,{className:"w-full md:w-auto",children:[c.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Open Playground"]})})})]})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{children:"System Status"})}),c.jsxs(Ve,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Backend Status"}),c.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-green-600",children:[c.jsx("div",{className:"w-2 h-2 bg-green-600 rounded-full"}),"Online"]})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Models Loaded"}),c.jsx("span",{className:"text-sm font-medium",children:"Ready"})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Memory Usage"}),c.jsx("span",{className:"text-sm font-medium",children:"Optimized"})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(Fr,{to:"/settings",children:c.jsxs(de,{variant:"outline",className:"w-full md:w-auto",children:[c.jsx(Fy,{className:"h-4 w-4 mr-2"}),"View Settings"]})})})]})]})]})]})})}function cs(e,[t,n]){return Math.min(n,Math.max(t,e))}function Z(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 sN(e,t){const n=m.createContext(t),r=o=>{const{children:l,...s}=o,a=m.useMemo(()=>s,Object.values(s));return c.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=m.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 kn(e,t=[]){let n=[];function r(o,l){const s=m.createContext(l),a=n.length;n=[...n,l];const u=d=>{var g;const{scope:p,children:h,...w}=d,v=((g=p==null?void 0:p[e])==null?void 0:g[a])||s,S=m.useMemo(()=>w,Object.values(w));return c.jsx(v.Provider,{value:S,children:h})};u.displayName=o+"Provider";function f(d,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,w=m.useContext(h);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(l=>m.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,aN(i,...t)]}function aN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ge=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},uN=Ic[" useInsertionEffect ".trim().toString()]||Ge;function kr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=cN({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const f=m.useRef(e!==void 0);m.useEffect(()=>{const d=f.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=m.useCallback(f=>{var d;if(s){const p=dN(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[s,e,o,l]);return[a,u]}function cN({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),i=m.useRef(n),o=m.useRef(t);return uN(()=>{o.current=t},[t]),m.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function dN(e){return typeof e=="function"}var fN=m.createContext(void 0);function Ds(e){const t=m.useContext(fN);return e||t||"ltr"}function Ky(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Yy(e){const[t,n]=m.useState(void 0);return Ge(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var pN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],te=pN.reduce((e,t)=>{const n=vi(`Primitive.${t}`),r=m.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hN(e,t){e&&Ci.flushSync(()=>e.dispatchEvent(t))}function Id(e){const t=e+"CollectionProvider",[n,r]=kn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:S,children:g}=v,y=Dt.useRef(null),x=Dt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:x,collectionRef:y,children:g})};l.displayName=t;const s=e+"CollectionSlot",a=vi(s),u=Dt.forwardRef((v,S)=>{const{scope:g,children:y}=v,x=o(s,g),C=pe(S,x.collectionRef);return c.jsx(a,{ref:C,children:y})});u.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=vi(f),h=Dt.forwardRef((v,S)=>{const{scope:g,children:y,...x}=v,C=Dt.useRef(null),b=pe(S,C),N=o(f,g);return Dt.useEffect(()=>(N.itemMap.set(C,{ref:C,...x}),()=>void N.itemMap.delete(C))),c.jsx(p,{[d]:"",ref:b,children:y})});h.displayName=f;function w(v){const S=o(e+"CollectionConsumer",v);return Dt.useCallback(()=>{const y=S.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((N,j)=>x.indexOf(N.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},w,r]}var Qy=["PageUp","PageDown"],qy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Xy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ni="Slider",[Yu,mN,gN]=Id(Ni),[Jy,DI]=kn(Ni,[gN]),[yN,zs]=Jy(Ni),Zy=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:h=!1,form:w,...v}=e,S=m.useRef(new Set),g=m.useRef(0),x=l==="horizontal"?vN:xN,[C=[],b]=kr({prop:f,defaultProp:u,onChange:A=>{var V;(V=[...S.current][g.current])==null||V.focus(),d(A)}}),N=m.useRef(C);function j(A){const P=bN(C,A);M(A,P)}function T(A){M(A,g.current)}function z(){const A=N.current[g.current];C[g.current]!==A&&p(C)}function M(A,P,{commit:V}={commit:!1}){const O=PN(o),L=_N(Math.round((A-r)/o)*o+r,O),$=cs(L,[r,i]);b((H=[])=>{const _=kN(H,$,P);if(jN(_,a*o)){g.current=_.indexOf($);const F=String(_)!==String(H);return F&&V&&p(_),F?_:H}else return H})}return c.jsx(yN,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:w,children:c.jsx(Yu.Provider,{scope:e.__scopeSlider,children:c.jsx(Yu.Slot,{scope:e.__scopeSlider,children:c.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:t,onPointerDown:Z(v.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:h,onSlideStart:s?void 0:j,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:z,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,C.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:P})=>{if(!s){const L=Qy.includes(A.key)||A.shiftKey&&qy.includes(A.key)?10:1,$=g.current,H=C[$],_=o*L*P;M(H+_,$,{commit:!0})}}})})})})});Zy.displayName=Ni;var[ev,tv]=Jy(Ni,{startEdge:"left",endEdge:"right",size:"width",direction:1}),vN=m.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[d,p]=m.useState(null),h=pe(t,x=>p(x)),w=m.useRef(void 0),v=Ds(i),S=v==="ltr",g=S&&!o||!S&&o;function y(x){const C=w.current||d.getBoundingClientRect(),b=[0,C.width],j=Md(b,g?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return c.jsx(ev,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:c.jsx(nv,{dir:v,"data-orientation":"horizontal",...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=y(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=y(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const b=Xy[g?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:b?-1:1})}})})}),xN=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=m.useRef(null),d=pe(t,f),p=m.useRef(void 0),h=!i;function w(v){const S=p.current||f.current.getBoundingClientRect(),g=[0,S.height],x=Md(g,h?[r,n]:[n,r]);return p.current=S,x(v-S.top)}return c.jsx(ev,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:c.jsx(nv,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=w(v.clientY);o==null||o(S)},onSlideMove:v=>{const S=w(v.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:v=>{const g=Xy[h?"from-bottom":"from-top"].includes(v.key);a==null||a({event:v,direction:g?-1:1})}})})}),nv=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=zs(Ni,n);return c.jsx(te.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Qy.concat(qy).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:Z(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:Z(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Z(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),rv="SliderTrack",iv=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=zs(rv,n);return c.jsx(te.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});iv.displayName=rv;var Qu="SliderRange",ov=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=zs(Qu,n),o=tv(Qu,n),l=m.useRef(null),s=pe(t,l),a=i.values.length,u=i.values.map(p=>av(p,i.min,i.max)),f=a>1?Math.min(...u):0,d=100-Math.max(...u);return c.jsx(te.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});ov.displayName=Qu;var qu="SliderThumb",lv=m.forwardRef((e,t)=>{const n=mN(e.__scopeSlider),[r,i]=m.useState(null),o=pe(t,s=>i(s)),l=m.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(wN,{...e,ref:o,index:l})}),wN=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=zs(qu,n),s=tv(qu,n),[a,u]=m.useState(null),f=pe(t,y=>u(y)),d=a?l.form||!!a.closest("form"):!0,p=Yy(a),h=l.values[r],w=h===void 0?0:av(h,l.min,l.max),v=CN(r,l.values.length),S=p==null?void 0:p[s.size],g=S?NN(S,w,s.direction):0;return m.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${g}px)`},children:[c.jsx(Yu.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(te.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":h,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:f,style:h===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&c.jsx(sv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:h},r)]})});lv.displayName=qu;var SN="RadioBubbleInput",sv=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=m.useRef(null),o=pe(i,r),l=Ky(t);return m.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(te.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});sv.displayName=SN;function kN(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function av(e,t,n){const o=100/(n-t)*(e-t);return cs(o,[0,100])}function CN(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function bN(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 NN(e,t,n){const r=e/2,o=Md([0,50],[0,r]);return(r-o(t)*n)*n}function EN(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function jN(e,t){if(t>0){const n=EN(e);return Math.min(...n)>=t}return!0}function Md(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 PN(e){return(String(e).split(".")[1]||"").length}function _N(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var uv=Zy,TN=iv,AN=ov,RN=lv;const Xu=m.forwardRef(({className:e,...t},n)=>c.jsxs(uv,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(TN,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(AN,{className:"absolute h-full bg-primary"})}),c.jsx(RN,{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"})]}));Xu.displayName=uv.displayName;var IN="Label",cv=m.forwardRef((e,t)=>c.jsx(te.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())}}));cv.displayName=IN;var dv=cv;const MN=Ad("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),bt=m.forwardRef(({className:e,...t},n)=>c.jsx(dv,{ref:n,className:ue(MN(),e),...t}));bt.displayName=dv.displayName;const ON=Ad("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ae({className:e,variant:t,...n}){return c.jsx("div",{className:ue(ON({variant:t}),e),...n})}const fv=m.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ue("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}));fv.displayName="Input";const Od=m.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ue("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}));Od.displayName="Textarea";function qn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function LN(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e);m.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 DN="DismissableLayer",Ju="dismissableLayer.update",zN="dismissableLayer.pointerDownOutside",FN="dismissableLayer.focusOutside",Hp,pv=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ld=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=m.useContext(pv),[f,d]=m.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),w=pe(t,j=>d(j)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(S),y=f?v.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=g,b=UN(j=>{const T=j.target,z=[...u.branches].some(M=>M.contains(T));!C||z||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=VN(j=>{const T=j.target;[...u.branches].some(M=>M.contains(T))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return LN(j=>{y===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),m.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Hp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Wp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Hp)}},[f,p,n,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Wp())},[f,u]),m.useEffect(()=>{const j=()=>h({});return document.addEventListener(Ju,j),()=>document.removeEventListener(Ju,j)},[]),c.jsx(te.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,b.onPointerDownCapture)})});Ld.displayName=DN;var BN="DismissableLayerBranch",$N=m.forwardRef((e,t)=>{const n=m.useContext(pv),r=m.useRef(null),i=pe(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(te.div,{...e,ref:i})});$N.displayName=BN;function UN(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){hv(zN,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function VN(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&hv(FN,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 Wp(){const e=new CustomEvent(Ju);document.dispatchEvent(e)}function hv(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?hN(i,o):i.dispatchEvent(o)}var Pa=0;function mv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gp()),document.body.insertAdjacentElement("beforeend",e[1]??Gp()),Pa++,()=>{Pa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pa--}},[])}function Gp(){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 _a="focusScope.autoFocusOnMount",Ta="focusScope.autoFocusOnUnmount",Kp={bubbles:!1,cancelable:!0},HN="FocusScope",Dd=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=m.useState(null),u=qn(i),f=qn(o),d=m.useRef(null),p=pe(t,v=>a(v)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(x){if(h.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:_n(d.current,{select:!0})},S=function(x){if(h.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||_n(d.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const b of x)b.removedNodes.length>0&&_n(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const y=new MutationObserver(g);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),y.disconnect()}}},[r,s,h.paused]),m.useEffect(()=>{if(s){Qp.add(h);const v=document.activeElement;if(!s.contains(v)){const g=new CustomEvent(_a,Kp);s.addEventListener(_a,u),s.dispatchEvent(g),g.defaultPrevented||(WN(qN(gv(s)),{select:!0}),document.activeElement===v&&_n(s))}return()=>{s.removeEventListener(_a,u),setTimeout(()=>{const g=new CustomEvent(Ta,Kp);s.addEventListener(Ta,f),s.dispatchEvent(g),g.defaultPrevented||_n(v??document.body,{select:!0}),s.removeEventListener(Ta,f),Qp.remove(h)},0)}}},[s,u,f,h]);const w=m.useCallback(v=>{if(!n&&!r||h.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(S&&g){const y=v.currentTarget,[x,C]=GN(y);x&&C?!v.shiftKey&&g===C?(v.preventDefault(),n&&_n(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&_n(C,{select:!0})):g===y&&v.preventDefault()}},[n,r,h.paused]);return c.jsx(te.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Dd.displayName=HN;function WN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_n(r,{select:t}),document.activeElement!==n)return}function GN(e){const t=gv(e),n=Yp(t,e),r=Yp(t.reverse(),e);return[n,r]}function gv(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 Yp(e,t){for(const n of e)if(!KN(n,{upTo:t}))return n}function KN(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 YN(e){return e instanceof HTMLInputElement&&"select"in e}function _n(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&YN(e)&&t&&e.select()}}var Qp=QN();function QN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qp(e,t),e.unshift(t)},remove(t){var n;e=qp(e,t),(n=e[0])==null||n.resume()}}}function qp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qN(e){return e.filter(t=>t.tagName!=="A")}var XN=Ic[" useId ".trim().toString()]||(()=>{}),JN=0;function hn(e){const[t,n]=m.useState(XN());return Ge(()=>{e||n(r=>r??String(JN++))},[e]),e||(t?`radix-${t}`:"")}const ZN=["top","right","bottom","left"],Xn=Math.min,mt=Math.max,ds=Math.round,ul=Math.floor,nn=e=>({x:e,y:e}),eE={left:"right",right:"left",bottom:"top",top:"bottom"},tE={start:"end",end:"start"};function Zu(e,t,n){return mt(e,Xn(t,n))}function xn(e,t){return typeof e=="function"?e(t):e}function wn(e){return e.split("-")[0]}function Ei(e){return e.split("-")[1]}function zd(e){return e==="x"?"y":"x"}function Fd(e){return e==="y"?"height":"width"}const nE=new Set(["top","bottom"]);function Zt(e){return nE.has(wn(e))?"y":"x"}function Bd(e){return zd(Zt(e))}function rE(e,t,n){n===void 0&&(n=!1);const r=Ei(e),i=Bd(e),o=Fd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=fs(l)),[l,fs(l)]}function iE(e){const t=fs(e);return[ec(e),t,ec(t)]}function ec(e){return e.replace(/start|end/g,t=>tE[t])}const Xp=["left","right"],Jp=["right","left"],oE=["top","bottom"],lE=["bottom","top"];function sE(e,t,n){switch(e){case"top":case"bottom":return n?t?Jp:Xp:t?Xp:Jp;case"left":case"right":return t?oE:lE;default:return[]}}function aE(e,t,n,r){const i=Ei(e);let o=sE(wn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(ec)))),o}function fs(e){return e.replace(/left|right|bottom|top/g,t=>eE[t])}function uE(e){return{top:0,right:0,bottom:0,left:0,...e}}function yv(e){return typeof e!="number"?uE(e):{top:e,right:e,bottom:e,left:e}}function ps(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 Zp(e,t,n){let{reference:r,floating:i}=e;const o=Zt(t),l=Bd(t),s=Fd(l),a=wn(t),u=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let h;switch(a){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Ei(t)){case"start":h[l]-=p*(n&&u?-1:1);break;case"end":h[l]+=p*(n&&u?-1:1);break}return h}const cE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=Zp(u,r,a),p=r,h={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=xn(e,t)||{};if(u==null)return{};const d=yv(f),p={x:n,y:r},h=Bd(i),w=Fd(h),v=await l.getDimensions(u),S=h==="y",g=S?"top":"left",y=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[h]-p[h]-o.floating[w],b=p[h]-o.reference[h],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=N?N[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[x]||o.floating[w]);const T=C/2-b/2,z=j/2-v[w]/2-1,M=Xn(d[g],z),A=Xn(d[y],z),P=M,V=j-v[w]-A,O=j/2-v[w]/2+T,L=Zu(P,O,V),$=!a.arrow&&Ei(i)!=null&&O!==L&&o.reference[w]/2-(OO<=0)){var A,P;const O=(((A=o.flip)==null?void 0:A.index)||0)+1,L=j[O];if(L&&(!(d==="alignment"?y!==Zt(L):!1)||M.every(_=>Zt(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:O,overflows:M},reset:{placement:L}};let $=(P=M.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:P.placement;if(!$)switch(h){case"bestFit":{var V;const H=(V=M.filter(_=>{if(N){const F=Zt(_.placement);return F===y||F==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(F=>F>0).reduce((F,k)=>F+k,0)]).sort((_,F)=>_[1]-F[1])[0])==null?void 0:V[0];H&&($=H);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function eh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function th(e){return ZN.some(t=>e[t]>=0)}const pE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=xn(e,t);switch(r){case"referenceHidden":{const o=await Ao(t,{...i,elementContext:"reference"}),l=eh(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:th(l)}}}case"escaped":{const o=await Ao(t,{...i,altBoundary:!0}),l=eh(o,n.floating);return{data:{escapedOffsets:l,escaped:th(l)}}}default:return{}}}}},vv=new Set(["left","top"]);async function hE(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=wn(n),s=Ei(n),a=Zt(n)==="y",u=vv.has(l)?-1:1,f=o&&a?-1:1,d=xn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(h=s==="end"?w*-1:w),a?{x:h*f,y:p*u}:{x:p*u,y:h*f}}const mE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await hE(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},gE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:g,y}=S;return{x:g,y}}},...a}=xn(e,t),u={x:n,y:r},f=await Ao(t,a),d=Zt(wn(i)),p=zd(d);let h=u[p],w=u[d];if(o){const S=p==="y"?"top":"left",g=p==="y"?"bottom":"right",y=h+f[S],x=h-f[g];h=Zu(y,h,x)}if(l){const S=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=w+f[S],x=w-f[g];w=Zu(y,w,x)}const v=s.fn({...t,[p]:h,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:o,[d]:l}}}}}},yE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=xn(e,t),f={x:n,y:r},d=Zt(i),p=zd(d);let h=f[p],w=f[d];const v=xn(s,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,b=o.reference[p]+o.reference[x]-S.mainAxis;hb&&(h=b)}if(u){var g,y;const x=p==="y"?"width":"height",C=vv.has(wn(i)),b=o.reference[d]-o.floating[x]+(C&&((g=l.offset)==null?void 0:g[d])||0)+(C?0:S.crossAxis),N=o.reference[d]+o.reference[x]+(C?0:((y=l.offset)==null?void 0:y[d])||0)-(C?S.crossAxis:0);wN&&(w=N)}return{[p]:h,[d]:w}}}},vE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=xn(e,t),f=await Ao(t,u),d=wn(i),p=Ei(i),h=Zt(i)==="y",{width:w,height:v}=o.floating;let S,g;d==="top"||d==="bottom"?(S=d,g=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,S=p==="end"?"top":"bottom");const y=v-f.top-f.bottom,x=w-f.left-f.right,C=Xn(v-f[S],y),b=Xn(w-f[g],x),N=!t.middlewareData.shift;let j=C,T=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=y),N&&!p){const M=mt(f.left,0),A=mt(f.right,0),P=mt(f.top,0),V=mt(f.bottom,0);h?T=w-2*(M!==0||A!==0?M+A:mt(f.left,f.right)):j=v-2*(P!==0||V!==0?P+V:mt(f.top,f.bottom))}await a({...t,availableWidth:T,availableHeight:j});const z=await l.getDimensions(s.floating);return w!==z.width||v!==z.height?{reset:{rects:!0}}:{}}}};function Fs(){return typeof window<"u"}function ji(e){return xv(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){var t;return(t=(xv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xv(e){return Fs()?e instanceof Node||e instanceof wt(e).Node:!1}function Vt(e){return Fs()?e instanceof Element||e instanceof wt(e).Element:!1}function rn(e){return Fs()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function nh(e){return!Fs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}const xE=new Set(["inline","contents"]);function $o(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!xE.has(i)}const wE=new Set(["table","td","th"]);function SE(e){return wE.has(ji(e))}const kE=[":popover-open",":modal"];function Bs(e){return kE.some(t=>{try{return e.matches(t)}catch{return!1}})}const CE=["transform","translate","scale","rotate","perspective"],bE=["transform","translate","scale","rotate","perspective","filter"],NE=["paint","layout","strict","content"];function $d(e){const t=Ud(),n=Vt(e)?Ht(e):e;return CE.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)||bE.some(r=>(n.willChange||"").includes(r))||NE.some(r=>(n.contain||"").includes(r))}function EE(e){let t=Jn(e);for(;rn(t)&&!xi(t);){if($d(t))return t;if(Bs(t))return null;t=Jn(t)}return null}function Ud(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jE=new Set(["html","body","#document"]);function xi(e){return jE.has(ji(e))}function Ht(e){return wt(e).getComputedStyle(e)}function $s(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||ln(e);return nh(t)?t.host:t}function wv(e){const t=Jn(e);return xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rn(t)&&$o(t)?t:wv(t)}function Ro(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=wv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=wt(i);if(o){const s=tc(l);return t.concat(l,l.visualViewport||[],$o(i)?i:[],s&&n?Ro(s):[])}return t.concat(i,Ro(i,[],n))}function tc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sv(e){const t=Ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=rn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ds(n)!==o||ds(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Vd(e){return Vt(e)?e:e.contextElement}function oi(e){const t=Vd(e);if(!rn(t))return nn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Sv(t);let l=(o?ds(n.width):n.width)/r,s=(o?ds(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const PE=nn(0);function kv(e){const t=wt(e);return!Ud()||!t.visualViewport?PE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _E(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wt(e)?!1:t}function Cr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Vd(e);let l=nn(1);t&&(r?Vt(r)&&(l=oi(r)):l=oi(e));const s=_E(o,n,r)?kv(o):nn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=wt(o),h=r&&Vt(r)?wt(r):r;let w=p,v=tc(w);for(;v&&r&&h!==w;){const S=oi(v),g=v.getBoundingClientRect(),y=Ht(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*S.x,C=g.top+(v.clientTop+parseFloat(y.paddingTop))*S.y;a*=S.x,u*=S.y,f*=S.x,d*=S.y,a+=x,u+=C,w=wt(v),v=tc(w)}}return ps({width:f,height:d,x:a,y:u})}function Us(e,t){const n=$s(e).scrollLeft;return t?t.left+n:Cr(ln(e)).left+n}function Cv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Us(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function TE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ln(r),s=t?Bs(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=nn(1);const f=nn(0),d=rn(r);if((d||!d&&!o)&&((ji(r)!=="body"||$o(l))&&(a=$s(r)),rn(r))){const h=Cr(r);u=oi(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=l&&!d&&!o?Cv(l,a):nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-a.scrollTop*u.y+f.y+p.y}}function AE(e){return Array.from(e.getClientRects())}function RE(e){const t=ln(e),n=$s(e),r=e.ownerDocument.body,i=mt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=mt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Us(e);const s=-n.scrollTop;return Ht(r).direction==="rtl"&&(l+=mt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const rh=25;function IE(e,t){const n=wt(e),r=ln(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const f=Ud();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Us(r);if(u<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-h);w<=rh&&(o-=w)}else u<=rh&&(o+=u);return{width:o,height:l,x:s,y:a}}const ME=new Set(["absolute","fixed"]);function OE(e,t){const n=Cr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=rn(e)?oi(e):nn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function ih(e,t,n){let r;if(t==="viewport")r=IE(e,n);else if(t==="document")r=RE(ln(e));else if(Vt(t))r=OE(t,n);else{const i=kv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ps(r)}function bv(e,t){const n=Jn(e);return n===t||!Vt(n)||xi(n)?!1:Ht(n).position==="fixed"||bv(n,t)}function LE(e,t){const n=t.get(e);if(n)return n;let r=Ro(e,[],!1).filter(s=>Vt(s)&&ji(s)!=="body"),i=null;const o=Ht(e).position==="fixed";let l=o?Jn(e):e;for(;Vt(l)&&!xi(l);){const s=Ht(l),a=$d(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&ME.has(i.position)||$o(l)&&!a&&bv(e,l))?r=r.filter(f=>f!==l):i=s,l=Jn(l)}return t.set(e,r),r}function DE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Bs(t)?[]:LE(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const d=ih(t,f,i);return u.top=mt(d.top,u.top),u.right=Xn(d.right,u.right),u.bottom=Xn(d.bottom,u.bottom),u.left=mt(d.left,u.left),u},ih(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function zE(e){const{width:t,height:n}=Sv(e);return{width:t,height:n}}function FE(e,t,n){const r=rn(t),i=ln(t),o=n==="fixed",l=Cr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=nn(0);function u(){a.x=Us(i)}if(r||!r&&!o)if((ji(t)!=="body"||$o(i))&&(s=$s(t)),r){const h=Cr(t,!0,o,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?Cv(i,s):nn(0),d=l.left+s.scrollLeft-a.x-f.x,p=l.top+s.scrollTop-a.y-f.y;return{x:d,y:p,width:l.width,height:l.height}}function Aa(e){return Ht(e).position==="static"}function oh(e,t){if(!rn(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ln(e)===n&&(n=n.ownerDocument.body),n}function Nv(e,t){const n=wt(e);if(Bs(e))return n;if(!rn(e)){let i=Jn(e);for(;i&&!xi(i);){if(Vt(i)&&!Aa(i))return i;i=Jn(i)}return n}let r=oh(e,t);for(;r&&SE(r)&&Aa(r);)r=oh(r,t);return r&&xi(r)&&Aa(r)&&!$d(r)?n:r||EE(e)||n}const BE=async function(e){const t=this.getOffsetParent||Nv,n=this.getDimensions,r=await n(e.floating);return{reference:FE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $E(e){return Ht(e).direction==="rtl"}const UE={convertOffsetParentRelativeRectToViewportRelativeRect:TE,getDocumentElement:ln,getClippingRect:DE,getOffsetParent:Nv,getElementRects:BE,getClientRects:AE,getDimensions:zE,getScale:oi,isElement:Vt,isRTL:$E};function Ev(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VE(e,t){let n=null,r;const i=ln(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:f,top:d,width:p,height:h}=u;if(s||t(),!p||!h)return;const w=ul(d),v=ul(i.clientWidth-(f+p)),S=ul(i.clientHeight-(d+h)),g=ul(f),x={rootMargin:-w+"px "+-v+"px "+-S+"px "+-g+"px",threshold:mt(0,Xn(1,a))||1};let C=!0;function b(N){const j=N[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!Ev(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(e)}return l(!0),o}function HE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Vd(e),f=i||o?[...u?Ro(u):[],...Ro(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const d=u&&s?VE(u,n):null;let p=-1,h=null;l&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let w,v=a?Cr(e):null;a&&S();function S(){const g=Cr(e);v&&!Ev(v,g)&&n(),v=g,w=requestAnimationFrame(S)}return n(),()=>{var g;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,a&&cancelAnimationFrame(w)}}const WE=mE,GE=gE,KE=fE,YE=vE,QE=pE,lh=dE,qE=yE,XE=(e,t,n)=>{const r=new Map,i={platform:UE,...n},o={...i.platform,_c:r};return cE(e,t,{...i,platform:o})};var JE=typeof document<"u",ZE=function(){},Tl=JE?m.useLayoutEffect:ZE;function hs(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(!hs(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)&&!hs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sh(e,t){const n=jv(e);return Math.round(t*n)/n}function Ra(e){const t=m.useRef(e);return Tl(()=>{t.current=e}),t}function e2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(r);hs(p,r)||h(r);const[w,v]=m.useState(null),[S,g]=m.useState(null),y=m.useCallback(_=>{_!==N.current&&(N.current=_,v(_))},[]),x=m.useCallback(_=>{_!==j.current&&(j.current=_,g(_))},[]),C=o||w,b=l||S,N=m.useRef(null),j=m.useRef(null),T=m.useRef(f),z=a!=null,M=Ra(a),A=Ra(i),P=Ra(u),V=m.useCallback(()=>{if(!N.current||!j.current)return;const _={placement:t,strategy:n,middleware:p};A.current&&(_.platform=A.current),XE(N.current,j.current,_).then(F=>{const k={...F,isPositioned:P.current!==!1};O.current&&!hs(T.current,k)&&(T.current=k,Ci.flushSync(()=>{d(k)}))})},[p,t,n,A,P]);Tl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[u]);const O=m.useRef(!1);Tl(()=>(O.current=!0,()=>{O.current=!1}),[]),Tl(()=>{if(C&&(N.current=C),b&&(j.current=b),C&&b){if(M.current)return M.current(C,b,V);V()}},[C,b,V,M,z]);const L=m.useMemo(()=>({reference:N,floating:j,setReference:y,setFloating:x}),[y,x]),$=m.useMemo(()=>({reference:C,floating:b}),[C,b]),H=m.useMemo(()=>{const _={position:n,left:0,top:0};if(!$.floating)return _;const F=sh($.floating,f.x),k=sh($.floating,f.y);return s?{..._,transform:"translate("+F+"px, "+k+"px)",...jv($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:k}},[n,s,$.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:V,refs:L,elements:$,floatingStyles:H}),[f,V,L,$,H])}const t2=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?lh({element:r.current,padding:i}).fn(n):{}:r?lh({element:r,padding:i}).fn(n):{}}}},n2=(e,t)=>({...WE(e),options:[e,t]}),r2=(e,t)=>({...GE(e),options:[e,t]}),i2=(e,t)=>({...qE(e),options:[e,t]}),o2=(e,t)=>({...KE(e),options:[e,t]}),l2=(e,t)=>({...YE(e),options:[e,t]}),s2=(e,t)=>({...QE(e),options:[e,t]}),a2=(e,t)=>({...t2(e),options:[e,t]});var u2="Arrow",Pv=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(te.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pv.displayName=u2;var c2=Pv,Hd="Popper",[_v,Tv]=kn(Hd),[d2,Av]=_v(Hd),Rv=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return c.jsx(d2,{scope:t,anchor:r,onAnchorChange:i,children:n})};Rv.displayName=Hd;var Iv="PopperAnchor",Mv=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Av(Iv,n),l=m.useRef(null),s=pe(t,l),a=m.useRef(null);return m.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:c.jsx(te.div,{...i,ref:s})});Mv.displayName=Iv;var Wd="PopperContent",[f2,p2]=_v(Wd),Ov=m.forwardRef((e,t)=>{var K,re,Se,I,W,Q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,S=Av(Wd,n),[g,y]=m.useState(null),x=pe(t,me=>y(me)),[C,b]=m.useState(null),N=Yy(C),j=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,z=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(u)?u:[u],P=A.length>0,V={padding:M,boundary:A.filter(m2),altBoundary:P},{refs:O,floatingStyles:L,placement:$,isPositioned:H,middlewareData:_}=e2({strategy:"fixed",placement:z,whileElementsMounted:(...me)=>HE(...me,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[n2({mainAxis:i+T,alignmentAxis:l}),a&&r2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?i2():void 0,...V}),a&&o2({...V}),l2({...V,apply:({elements:me,rects:ye,availableWidth:dt,availableHeight:bn})=>{const{width:Nn,height:ea}=ye.reference,lr=me.floating.style;lr.setProperty("--radix-popper-available-width",`${dt}px`),lr.setProperty("--radix-popper-available-height",`${bn}px`),lr.setProperty("--radix-popper-anchor-width",`${Nn}px`),lr.setProperty("--radix-popper-anchor-height",`${ea}px`)}}),C&&a2({element:C,padding:s}),g2({arrowWidth:j,arrowHeight:T}),p&&s2({strategy:"referenceHidden",...V})]}),[F,k]=zv($),Y=qn(w);Ge(()=>{H&&(Y==null||Y())},[H,Y]);const q=(K=_.arrow)==null?void 0:K.x,E=(re=_.arrow)==null?void 0:re.y,ne=((Se=_.arrow)==null?void 0:Se.centerOffset)!==0,[Ie,se]=m.useState();return Ge(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(I=_.transformOrigin)==null?void 0:I.x,(W=_.transformOrigin)==null?void 0:W.y].join(" "),...((Q=_.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(f2,{scope:n,placedSide:F,onArrowChange:b,arrowX:q,arrowY:E,shouldHideArrow:ne,children:c.jsx(te.div,{"data-side":F,"data-align":k,...v,ref:x,style:{...v.style,animation:H?void 0:"none"}})})})});Ov.displayName=Wd;var Lv="PopperArrow",h2={top:"bottom",right:"left",bottom:"top",left:"right"},Dv=m.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=p2(Lv,r),l=h2[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(c2,{...i,ref:n,style:{...i.style,display:"block"}})})});Dv.displayName=Lv;function m2(e){return e!==null}var g2=e=>({name:"transformOrigin",options:e,fn(t){var S,g,y;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=zv(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,h=(((y=i.arrow)==null?void 0:y.y)??0)+a/2;let w="",v="";return u==="bottom"?(w=l?d:`${p}px`,v=`${-a}px`):u==="top"?(w=l?d:`${p}px`,v=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,v=l?d:`${h}px`):u==="left"&&(w=`${r.floating.width+a}px`,v=l?d:`${h}px`),{data:{x:w,y:v}}}});function zv(e){const[t,n="center"]=e.split("-");return[t,n]}var y2=Rv,v2=Mv,x2=Ov,w2=Dv,S2="Portal",Gd=m.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=m.useState(!1);Ge(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ok.createPortal(c.jsx(te.div,{...r,ref:t}),l):null});Gd.displayName=S2;var Fv=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"}),k2="VisuallyHidden",C2=m.forwardRef((e,t)=>c.jsx(te.span,{...e,ref:t,style:{...Fv,...e.style}}));C2.displayName=k2;var b2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,cl=new WeakMap,dl={},Ia=0,Bv=function(e){return e&&(e.host||Bv(e.parentNode))},N2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bv(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})},E2=function(e,t,n,r){var i=N2(t,Array.isArray(e)?e:[e]);dl[n]||(dl[n]=new WeakMap);var o=dl[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var f=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))f(p);else try{var h=p.getAttribute(r),w=h!==null&&h!=="false",v=(Mr.get(p)||0)+1,S=(o.get(p)||0)+1;Mr.set(p,v),o.set(p,S),l.push(p),v===1&&w&&cl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return f(t),s.clear(),Ia++,function(){l.forEach(function(d){var p=Mr.get(d)-1,h=o.get(d)-1;Mr.set(d,p),o.set(d,h),p||(cl.has(d)||d.removeAttribute(r),cl.delete(d)),h||d.removeAttribute(n)}),Ia--,Ia||(Mr=new WeakMap,Mr=new WeakMap,cl=new WeakMap,dl={})}},$v=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||b2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),E2(r,i,n,"aria-hidden")):function(){return null}},Xt=function(){return Xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return V2;var t=H2(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])}},G2=Wv(),li="data-scroll-locked",K2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(P2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(li,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Al,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Rl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Al," .").concat(Al,` { + right: 0 `).concat(r,`; + } + + .`).concat(Rl," .").concat(Rl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(li,`] { + `).concat(_2,": ").concat(s,`px; + } +`)},ch=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},Y2=function(){m.useEffect(function(){return document.body.setAttribute(li,(ch()+1).toString()),function(){var e=ch()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},Q2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Y2();var o=m.useMemo(function(){return W2(i)},[i]);return m.createElement(G2,{styles:K2(o,!t,i,n?"":"!important")})},nc=!1;if(typeof window<"u")try{var fl=Object.defineProperty({},"passive",{get:function(){return nc=!0,!0}});window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{nc=!1}var Or=nc?{passive:!1}:!1,q2=function(e){return e.tagName==="TEXTAREA"},Gv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!q2(e)&&n[t]==="visible")},X2=function(e){return Gv(e,"overflowY")},J2=function(e){return Gv(e,"overflowX")},dh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Kv(e,r);if(i){var o=Yv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Z2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ej=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Kv=function(e,t){return e==="v"?X2(t):J2(t)},Yv=function(e,t){return e==="v"?Z2(t):ej(t)},tj=function(e,t){return e==="h"&&t==="rtl"?-1:1},nj=function(e,t,n,r,i){var o=tj(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,f=l>0,d=0,p=0;do{if(!s)break;var h=Yv(e,s),w=h[0],v=h[1],S=h[2],g=v-S-o*w;(w||g)&&Kv(e,s)&&(d+=g,p+=w);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(p)<1||!i&&-l>p))&&(u=!0),u},pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fh=function(e){return[e.deltaX,e.deltaY]},ph=function(e){return e&&"current"in e?e.current:e},rj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ij=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},oj=0,Lr=[];function lj(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(oj++)[0],o=m.useState(Wv)[0],l=m.useRef(e);m.useEffect(function(){l.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=j2([e.lockRef.current],(e.shards||[]).map(ph),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var g=pl(v),y=n.current,x="deltaX"in v?v.deltaX:y[0]-g[0],C="deltaY"in v?v.deltaY:y[1]-g[1],b,N=v.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in v&&j==="h"&&N.type==="range")return!1;var T=dh(j,N);if(!T)return!0;if(T?b=j:(b=j==="v"?"h":"v",T=dh(j,N)),!T)return!1;if(!r.current&&"changedTouches"in v&&(x||C)&&(r.current=b),!b)return!0;var z=r.current||b;return nj(z,S,v,z==="h"?x:C,!0)},[]),a=m.useCallback(function(v){var S=v;if(!(!Lr.length||Lr[Lr.length-1]!==o)){var g="deltaY"in S?fh(S):pl(S),y=t.current.filter(function(b){return b.name===S.type&&(b.target===S.target||S.target===b.shadowParent)&&rj(b.delta,g)})[0];if(y&&y.should){S.cancelable&&S.preventDefault();return}if(!y){var x=(l.current.shards||[]).map(ph).filter(Boolean).filter(function(b){return b.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=m.useCallback(function(v,S,g,y){var x={name:v,delta:S,target:g,should:y,shadowParent:sj(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),f=m.useCallback(function(v){n.current=pl(v),r.current=void 0},[]),d=m.useCallback(function(v){u(v.type,fh(v),v.target,s(v,e.lockRef.current))},[]),p=m.useCallback(function(v){u(v.type,pl(v),v.target,s(v,e.lockRef.current))},[]);m.useEffect(function(){return Lr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Or),document.addEventListener("touchmove",a,Or),document.addEventListener("touchstart",f,Or),function(){Lr=Lr.filter(function(v){return v!==o}),document.removeEventListener("wheel",a,Or),document.removeEventListener("touchmove",a,Or),document.removeEventListener("touchstart",f,Or)}},[]);var h=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(o,{styles:ij(i)}):null,h?m.createElement(Q2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aj=L2(Hv,lj);var Qv=m.forwardRef(function(e,t){return m.createElement(Vs,Xt({},e,{ref:t,sideCar:aj}))});Qv.classNames=Vs.classNames;const qv=Qv;var uj=[" ","Enter","ArrowUp","ArrowDown"],cj=[" ","Enter"],br="Select",[Hs,Ws,dj]=Id(br),[Pi,zI]=kn(br,[dj,Tv]),Gs=Tv(),[fj,rr]=Pi(br),[pj,hj]=Pi(br),Xv=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:f,autoComplete:d,disabled:p,required:h,form:w}=e,v=Gs(t),[S,g]=m.useState(null),[y,x]=m.useState(null),[C,b]=m.useState(!1),N=Ds(u),[j,T]=kr({prop:r,defaultProp:i??!1,onChange:o,caller:br}),[z,M]=kr({prop:l,defaultProp:s,onChange:a,caller:br}),A=m.useRef(null),P=S?w||!!S.closest("form"):!0,[V,O]=m.useState(new Set),L=Array.from(V).map($=>$.props.value).join(";");return c.jsx(y2,{...v,children:c.jsxs(fj,{required:h,scope:t,trigger:S,onTriggerChange:g,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:b,contentId:hn(),value:z,onValueChange:M,open:j,onOpenChange:T,dir:N,triggerPointerDownPosRef:A,disabled:p,children:[c.jsx(Hs.Provider,{scope:t,children:c.jsx(pj,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{O(H=>new Set(H).add($))},[]),onNativeOptionRemove:m.useCallback($=>{O(H=>{const _=new Set(H);return _.delete($),_})},[]),children:n})}),P?c.jsxs(kx,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:z,onChange:$=>M($.target.value),disabled:p,form:w,children:[z===void 0?c.jsx("option",{value:""}):null,Array.from(V)]},L):null]})})};Xv.displayName=br;var Jv="SelectTrigger",Zv=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Gs(n),l=rr(Jv,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=Ws(n),f=m.useRef("touch"),[d,p,h]=bx(v=>{const S=u().filter(x=>!x.disabled),g=S.find(x=>x.value===l.value),y=Nx(S,v,g);y!==void 0&&l.onValueChange(y.value)}),w=v=>{s||(l.onOpenChange(!0),h()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return c.jsx(v2,{asChild:!0,...o,children:c.jsx(te.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Cx(l.value)?"":void 0,...i,ref:a,onClick:Z(i.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&w(v)}),onPointerDown:Z(i.onPointerDown,v=>{f.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:Z(i.onKeyDown,v=>{const S=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(S&&v.key===" ")&&uj.includes(v.key)&&(w(),v.preventDefault())})})})});Zv.displayName=Jv;var ex="SelectValue",tx=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=rr(ex,n),{onValueNodeHasChildrenChange:u}=a,f=o!==void 0,d=pe(t,a.onValueNodeChange);return Ge(()=>{u(f)},[u,f]),c.jsx(te.span,{...s,ref:d,style:{pointerEvents:"none"},children:Cx(a.value)?c.jsx(c.Fragment,{children:l}):o})});tx.displayName=ex;var mj="SelectIcon",nx=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(te.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});nx.displayName=mj;var gj="SelectPortal",rx=e=>c.jsx(Gd,{asChild:!0,...e});rx.displayName=gj;var Nr="SelectContent",ix=m.forwardRef((e,t)=>{const n=rr(Nr,e.__scopeSelect),[r,i]=m.useState();if(Ge(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ci.createPortal(c.jsx(ox,{scope:e.__scopeSelect,children:c.jsx(Hs.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(lx,{...e,ref:t})});ix.displayName=Nr;var Ot=10,[ox,ir]=Pi(Nr),yj="SelectContentImpl",vj=vi("SelectContent.RemoveScroll"),lx=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S,...g}=e,y=rr(Nr,n),[x,C]=m.useState(null),[b,N]=m.useState(null),j=pe(t,K=>C(K)),[T,z]=m.useState(null),[M,A]=m.useState(null),P=Ws(n),[V,O]=m.useState(!1),L=m.useRef(!1);m.useEffect(()=>{if(x)return $v(x)},[x]),mv();const $=m.useCallback(K=>{const[re,...Se]=P().map(Q=>Q.ref.current),[I]=Se.slice(-1),W=document.activeElement;for(const Q of K)if(Q===W||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===re&&b&&(b.scrollTop=0),Q===I&&b&&(b.scrollTop=b.scrollHeight),Q==null||Q.focus(),document.activeElement!==W))return},[P,b]),H=m.useCallback(()=>$([T,x]),[$,T,x]);m.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:_,triggerPointerDownPosRef:F}=y;m.useEffect(()=>{if(x){let K={x:0,y:0};const re=I=>{var W,Q;K={x:Math.abs(Math.round(I.pageX)-(((W=F.current)==null?void 0:W.x)??0)),y:Math.abs(Math.round(I.pageY)-(((Q=F.current)==null?void 0:Q.y)??0))}},Se=I=>{K.x<=10&&K.y<=10?I.preventDefault():x.contains(I.target)||_(!1),document.removeEventListener("pointermove",re),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",Se,{capture:!0})}}},[x,_,F]),m.useEffect(()=>{const K=()=>_(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[_]);const[k,Y]=bx(K=>{const re=P().filter(W=>!W.disabled),Se=re.find(W=>W.ref.current===document.activeElement),I=Nx(re,K,Se);I&&setTimeout(()=>I.ref.current.focus())}),q=m.useCallback((K,re,Se)=>{const I=!L.current&&!Se;(y.value!==void 0&&y.value===re||I)&&(z(K),I&&(L.current=!0))},[y.value]),E=m.useCallback(()=>x==null?void 0:x.focus(),[x]),ne=m.useCallback((K,re,Se)=>{const I=!L.current&&!Se;(y.value!==void 0&&y.value===re||I)&&A(K)},[y.value]),Ie=r==="popper"?rc:sx,se=Ie===rc?{side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S}:{};return c.jsx(ox,{scope:n,content:x,viewport:b,onViewportChange:N,itemRefCallback:q,selectedItem:T,onItemLeave:E,itemTextRefCallback:ne,focusSelectedItem:H,selectedItemText:M,position:r,isPositioned:V,searchRef:k,children:c.jsx(qv,{as:vj,allowPinchZoom:!0,children:c.jsx(Dd,{asChild:!0,trapped:y.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Z(i,K=>{var re;(re=y.trigger)==null||re.focus({preventScroll:!0}),K.preventDefault()}),children:c.jsx(Ld,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:c.jsx(Ie,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:K=>K.preventDefault(),...g,...se,onPlaced:()=>O(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Z(g.onKeyDown,K=>{const re=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!re&&K.key.length===1&&Y(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let I=P().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(K.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const W=K.target,Q=I.indexOf(W);I=I.slice(Q+1)}setTimeout(()=>$(I)),K.preventDefault()}})})})})})})});lx.displayName=yj;var xj="SelectItemAlignedPosition",sx=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=rr(Nr,n),l=ir(Nr,n),[s,a]=m.useState(null),[u,f]=m.useState(null),d=pe(t,j=>f(j)),p=Ws(n),h=m.useRef(!1),w=m.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:g,focusSelectedItem:y}=l,x=m.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&v&&S&&g){const j=o.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(o.dir!=="rtl"){const W=M.left-T.left,Q=z.left-W,me=j.left-Q,ye=j.width+me,dt=Math.max(ye,T.width),bn=window.innerWidth-Ot,Nn=cs(Q,[Ot,Math.max(Ot,bn-dt)]);s.style.minWidth=ye+"px",s.style.left=Nn+"px"}else{const W=T.right-M.right,Q=window.innerWidth-z.right-W,me=window.innerWidth-j.right-Q,ye=j.width+me,dt=Math.max(ye,T.width),bn=window.innerWidth-Ot,Nn=cs(Q,[Ot,Math.max(Ot,bn-dt)]);s.style.minWidth=ye+"px",s.style.right=Nn+"px"}const A=p(),P=window.innerHeight-Ot*2,V=v.scrollHeight,O=window.getComputedStyle(u),L=parseInt(O.borderTopWidth,10),$=parseInt(O.paddingTop,10),H=parseInt(O.borderBottomWidth,10),_=parseInt(O.paddingBottom,10),F=L+$+V+_+H,k=Math.min(S.offsetHeight*5,F),Y=window.getComputedStyle(v),q=parseInt(Y.paddingTop,10),E=parseInt(Y.paddingBottom,10),ne=j.top+j.height/2-Ot,Ie=P-ne,se=S.offsetHeight/2,K=S.offsetTop+se,re=L+$+K,Se=F-re;if(re<=ne){const W=A.length>0&&S===A[A.length-1].ref.current;s.style.bottom="0px";const Q=u.clientHeight-v.offsetTop-v.offsetHeight,me=Math.max(Ie,se+(W?E:0)+Q+H),ye=re+me;s.style.height=ye+"px"}else{const W=A.length>0&&S===A[0].ref.current;s.style.top="0px";const me=Math.max(ne,L+v.offsetTop+(W?q:0)+se)+Se;s.style.height=me+"px",v.scrollTop=re-ne+v.offsetTop}s.style.margin=`${Ot}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,o.trigger,o.valueNode,s,u,v,S,g,o.dir,r]);Ge(()=>x(),[x]);const[C,b]=m.useState();Ge(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const N=m.useCallback(j=>{j&&w.current===!0&&(x(),y==null||y(),w.current=!1)},[x,y]);return c.jsx(Sj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(te.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});sx.displayName=xj;var wj="SelectPopperPosition",rc=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ot,...o}=e,l=Gs(n);return c.jsx(x2,{...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)"}})});rc.displayName=wj;var[Sj,Kd]=Pi(Nr,{}),ic="SelectViewport",ax=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ir(ic,n),l=Kd(ic,n),s=pe(t,o.onViewportChange),a=m.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Hs.Slot,{scope:n,children:c.jsx(te.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const h=Math.abs(a.current-f.scrollTop);if(h>0){const w=window.innerHeight-Ot*2,v=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),g=Math.max(v,S);if(g0?C:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});ax.displayName=ic;var ux="SelectGroup",[kj,Cj]=Pi(ux),cx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hn();return c.jsx(kj,{scope:n,id:i,children:c.jsx(te.div,{role:"group","aria-labelledby":i,...r,ref:t})})});cx.displayName=ux;var dx="SelectLabel",fx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Cj(dx,n);return c.jsx(te.div,{id:i.id,...r,ref:t})});fx.displayName=dx;var ms="SelectItem",[bj,px]=Pi(ms),hx=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=rr(ms,n),a=ir(ms,n),u=s.value===r,[f,d]=m.useState(o??""),[p,h]=m.useState(!1),w=pe(t,y=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,y,r,i)}),v=hn(),S=m.useRef("touch"),g=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(bj,{scope:n,value:r,disabled:i,textId:v,isSelected:u,onItemTextChange:m.useCallback(y=>{d(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:c.jsx(Hs.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:c.jsx(te.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>h(!0)),onBlur:Z(l.onBlur,()=>h(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:Z(l.onPointerDown,y=>{S.current=y.pointerType}),onPointerMove:Z(l.onPointerMove,y=>{var x;S.current=y.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Z(l.onKeyDown,y=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&y.key===" "||(cj.includes(y.key)&&g(),y.key===" "&&y.preventDefault())})})})})});hx.displayName=ms;var qi="SelectItemText",mx=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=rr(qi,n),s=ir(qi,n),a=px(qi,n),u=hj(qi,n),[f,d]=m.useState(null),p=pe(t,g=>d(g),a.onItemTextChange,g=>{var y;return(y=s.itemTextRefCallback)==null?void 0:y.call(s,g,a.value,a.disabled)}),h=f==null?void 0:f.textContent,w=m.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:h},a.value),[a.disabled,a.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=u;return Ge(()=>(v(w),()=>S(w)),[v,S,w]),c.jsxs(c.Fragment,{children:[c.jsx(te.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ci.createPortal(o.children,l.valueNode):null]})});mx.displayName=qi;var gx="SelectItemIndicator",yx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return px(gx,n).isSelected?c.jsx(te.span,{"aria-hidden":!0,...r,ref:t}):null});yx.displayName=gx;var oc="SelectScrollUpButton",vx=m.forwardRef((e,t)=>{const n=ir(oc,e.__scopeSelect),r=Kd(oc,e.__scopeSelect),[i,o]=m.useState(!1),l=pe(t,r.onScrollButtonChange);return Ge(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(wx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});vx.displayName=oc;var lc="SelectScrollDownButton",xx=m.forwardRef((e,t)=>{const n=ir(lc,e.__scopeSelect),r=Kd(lc,e.__scopeSelect),[i,o]=m.useState(!1),l=pe(t,r.onScrollButtonChange);return Ge(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,f=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(wx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});xx.displayName=lc;var wx=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ir("SelectScrollButton",n),l=m.useRef(null),s=Ws(n),a=m.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return m.useEffect(()=>()=>a(),[a]),Ge(()=>{var f;const u=s().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),c.jsx(te.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Z(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{a()})})}),Nj="SelectSeparator",Sx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(te.div,{"aria-hidden":!0,...r,ref:t})});Sx.displayName=Nj;var sc="SelectArrow",Ej=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Gs(n),o=rr(sc,n),l=ir(sc,n);return o.open&&l.position==="popper"?c.jsx(w2,{...i,...r,ref:t}):null});Ej.displayName=sc;var jj="SelectBubbleInput",kx=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=m.useRef(null),o=pe(r,i),l=Ky(t);return m.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(te.select,{...n,style:{...Fv,...n.style},ref:o,defaultValue:t})});kx.displayName=jj;function Cx(e){return e===""||e===void 0}function bx(e){const t=qn(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Nx(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Pj(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function Pj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _j=Xv,Ex=Zv,Tj=tx,Aj=nx,Rj=rx,jx=ix,Ij=ax,Mj=cx,Px=fx,_x=hx,Oj=mx,Lj=yx,Tx=vx,Ax=xx,Rx=Sx;const Dj=_j,hh=Mj,zj=Tj,Ix=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Ex,{ref:r,className:ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(Aj,{asChild:!0,children:c.jsx(jd,{className:"h-4 w-4 opacity-50"})})]}));Ix.displayName=Ex.displayName;const Mx=m.forwardRef(({className:e,...t},n)=>c.jsx(Tx,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(JC,{className:"h-4 w-4"})}));Mx.displayName=Tx.displayName;const Ox=m.forwardRef(({className:e,...t},n)=>c.jsx(Ax,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(jd,{className:"h-4 w-4"})}));Ox.displayName=Ax.displayName;const Lx=m.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(Rj,{children:c.jsxs(jx,{ref:i,className:ue("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(Mx,{}),c.jsx(Ij,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(Ox,{})]})}));Lx.displayName=jx.displayName;const ac=m.forwardRef(({className:e,...t},n)=>c.jsx(Px,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ac.displayName=Px.displayName;const uc=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(_x,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Lj,{children:c.jsx(QC,{className:"h-4 w-4"})})}),c.jsx(Oj,{children:t})]}));uc.displayName=_x.displayName;const Fj=m.forwardRef(({className:e,...t},n)=>c.jsx(Rx,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));Fj.displayName=Rx.displayName;function Bj(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var _i=e=>{const{present:t,children:n}=e,r=$j(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=pe(r.ref,Uj(i));return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};_i.displayName="Presence";function $j(e){const[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),o=m.useRef("none"),l=e?"mounted":"unmounted",[s,a]=Bj(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=hl(r.current);o.current=s==="mounted"?u:"none"},[s]),Ge(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,h=hl(u);e?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Ge(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=h=>{const v=hl(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=h=>{h.target===t&&(o.current=hl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function hl(e){return(e==null?void 0:e.animationName)||"none"}function Uj(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 Ks="Collapsible",[Vj,FI]=kn(Ks),[Hj,Yd]=Vj(Ks),Dx=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=e,[a,u]=kr({prop:r,defaultProp:i??!1,onChange:l,caller:Ks});return c.jsx(Hj,{scope:n,disabled:o,contentId:hn(),open:a,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),children:c.jsx(te.div,{"data-state":qd(a),"data-disabled":o?"":void 0,...s,ref:t})})});Dx.displayName=Ks;var zx="CollapsibleTrigger",Fx=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Yd(zx,n);return c.jsx(te.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":qd(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Z(e.onClick,i.onOpenToggle)})});Fx.displayName=zx;var Qd="CollapsibleContent",Bx=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Yd(Qd,e.__scopeCollapsible);return c.jsx(_i,{present:n||i.open,children:({present:o})=>c.jsx(Wj,{...r,ref:t,present:o})})});Bx.displayName=Qd;var Wj=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=Yd(Qd,n),[s,a]=m.useState(r),u=m.useRef(null),f=pe(t,u),d=m.useRef(0),p=d.current,h=m.useRef(0),w=h.current,v=l.open||s,S=m.useRef(v),g=m.useRef(void 0);return m.useEffect(()=>{const y=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(y)},[]),Ge(()=>{const y=u.current;if(y){g.current=g.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const x=y.getBoundingClientRect();d.current=x.height,h.current=x.width,S.current||(y.style.transitionDuration=g.current.transitionDuration,y.style.animationName=g.current.animationName),a(r)}},[l.open,r]),c.jsx(te.div,{"data-state":qd(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!v,...o,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:v&&i})});function qd(e){return e?"open":"closed"}var Gj=Dx;const Kj=Gj,Yj=Fx,Qj=Bx;var Ys="Dialog",[$x,Ux]=kn(Ys),[qj,Wt]=$x(Ys),Vx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=m.useRef(null),a=m.useRef(null),[u,f]=kr({prop:r,defaultProp:i??!1,onChange:o,caller:Ys});return c.jsx(qj,{scope:t,triggerRef:s,contentRef:a,contentId:hn(),titleId:hn(),descriptionId:hn(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};Vx.displayName=Ys;var Hx="DialogTrigger",Wx=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Hx,n),o=pe(t,i.triggerRef);return c.jsx(te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zd(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});Wx.displayName=Hx;var Xd="DialogPortal",[Xj,Gx]=$x(Xd,{forceMount:void 0}),Kx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Wt(Xd,t);return c.jsx(Xj,{scope:t,forceMount:n,children:m.Children.map(r,l=>c.jsx(_i,{present:n||o.open,children:c.jsx(Gd,{asChild:!0,container:i,children:l})}))})};Kx.displayName=Xd;var gs="DialogOverlay",Yx=m.forwardRef((e,t)=>{const n=Gx(gs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(gs,e.__scopeDialog);return o.modal?c.jsx(_i,{present:r||o.open,children:c.jsx(Zj,{...i,ref:t})}):null});Yx.displayName=gs;var Jj=vi("DialogOverlay.RemoveScroll"),Zj=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(gs,n);return c.jsx(qv,{as:Jj,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(te.div,{"data-state":Zd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Er="DialogContent",Qx=m.forwardRef((e,t)=>{const n=Gx(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Er,e.__scopeDialog);return c.jsx(_i,{present:r||o.open,children:o.modal?c.jsx(eP,{...i,ref:t}):c.jsx(tP,{...i,ref:t})})});Qx.displayName=Er;var eP=m.forwardRef((e,t)=>{const n=Wt(Er,e.__scopeDialog),r=m.useRef(null),i=pe(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return $v(o)},[]),c.jsx(qx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),tP=m.forwardRef((e,t)=>{const n=Wt(Er,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return c.jsx(qx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),qx=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Wt(Er,n),a=m.useRef(null),u=pe(t,a);return mv(),c.jsxs(c.Fragment,{children:[c.jsx(Dd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(Ld,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Zd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(rP,{titleId:s.titleId}),c.jsx(oP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Jd="DialogTitle",Xx=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Jd,n);return c.jsx(te.h2,{id:i.titleId,...r,ref:t})});Xx.displayName=Jd;var Jx="DialogDescription",Zx=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Jx,n);return c.jsx(te.p,{id:i.descriptionId,...r,ref:t})});Zx.displayName=Jx;var e0="DialogClose",t0=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(e0,n);return c.jsx(te.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});t0.displayName=e0;function Zd(e){return e?"open":"closed"}var n0="DialogTitleWarning",[nP,r0]=sN(n0,{contentName:Er,titleName:Jd,docsSlug:"dialog"}),rP=({titleId:e})=>{const t=r0(n0),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},iP="DialogDescriptionWarning",oP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r0(iP).contentName}}.`;return m.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},lP=Vx,sP=Wx,aP=Kx,uP=Yx,cP=Qx,dP=Xx,fP=Zx,i0=t0,o0="AlertDialog",[pP,BI]=kn(o0,[Ux]),Cn=Ux(),l0=e=>{const{__scopeAlertDialog:t,...n}=e,r=Cn(t);return c.jsx(lP,{...r,...n,modal:!0})};l0.displayName=o0;var hP="AlertDialogTrigger",mP=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Cn(n);return c.jsx(sP,{...i,...r,ref:t})});mP.displayName=hP;var gP="AlertDialogPortal",s0=e=>{const{__scopeAlertDialog:t,...n}=e,r=Cn(t);return c.jsx(aP,{...r,...n})};s0.displayName=gP;var yP="AlertDialogOverlay",a0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Cn(n);return c.jsx(uP,{...i,...r,ref:t})});a0.displayName=yP;var si="AlertDialogContent",[vP,xP]=pP(si),wP=eN("AlertDialogContent"),u0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Cn(n),l=m.useRef(null),s=pe(t,l),a=m.useRef(null);return c.jsx(nP,{contentName:si,titleName:c0,docsSlug:"alert-dialog",children:c.jsx(vP,{scope:n,cancelRef:a,children:c.jsxs(cP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=a.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(wP,{children:r}),c.jsx(kP,{contentRef:l})]})})})});u0.displayName=si;var c0="AlertDialogTitle",d0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Cn(n);return c.jsx(dP,{...i,...r,ref:t})});d0.displayName=c0;var f0="AlertDialogDescription",p0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Cn(n);return c.jsx(fP,{...i,...r,ref:t})});p0.displayName=f0;var SP="AlertDialogAction",h0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Cn(n);return c.jsx(i0,{...i,...r,ref:t})});h0.displayName=SP;var m0="AlertDialogCancel",g0=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=xP(m0,n),o=Cn(n),l=pe(t,i);return c.jsx(i0,{...o,...r,ref:l})});g0.displayName=m0;var kP=({contentRef:e})=>{const t=`\`${si}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${si}\` by passing a \`${f0}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${si}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},CP=l0,bP=s0,y0=a0,v0=u0,x0=h0,w0=g0,S0=d0,k0=p0;const mh=CP,NP=bP,C0=m.forwardRef(({className:e,...t},n)=>c.jsx(y0,{className:ue("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}));C0.displayName=y0.displayName;const cc=m.forwardRef(({className:e,...t},n)=>c.jsxs(NP,{children:[c.jsx(C0,{}),c.jsx(v0,{ref:n,className:ue("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})]}));cc.displayName=v0.displayName;const dc=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});dc.displayName="AlertDialogHeader";const fc=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fc.displayName="AlertDialogFooter";const pc=m.forwardRef(({className:e,...t},n)=>c.jsx(S0,{ref:n,className:ue("text-lg font-semibold",e),...t}));pc.displayName=S0.displayName;const hc=m.forwardRef(({className:e,...t},n)=>c.jsx(k0,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));hc.displayName=k0.displayName;const mc=m.forwardRef(({className:e,...t},n)=>c.jsx(x0,{ref:n,className:ue(Rd(),e),...t}));mc.displayName=x0.displayName;const gc=m.forwardRef(({className:e,...t},n)=>c.jsx(w0,{ref:n,className:ue(Rd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gc.displayName=w0.displayName;function EP(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_P={};function gh(e,t){return((t||_P).jsx?PP:jP).test(e)}const TP=/[ \t\n\f\r]/g;function AP(e){return typeof e=="object"?e.type==="text"?yh(e.value):!1:yh(e)}function yh(e){return e.replace(TP,"")===""}class Uo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function b0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uo(n,r,t)}function yc(e){return e.toLowerCase()}class ct{constructor(t,n){this.attribute=n,this.property=t}}ct.prototype.attribute="";ct.prototype.booleanish=!1;ct.prototype.boolean=!1;ct.prototype.commaOrSpaceSeparated=!1;ct.prototype.commaSeparated=!1;ct.prototype.defined=!1;ct.prototype.mustUseProperty=!1;ct.prototype.number=!1;ct.prototype.overloadedBoolean=!1;ct.prototype.property="";ct.prototype.spaceSeparated=!1;ct.prototype.space=void 0;let RP=0;const ee=Ar(),Me=Ar(),vc=Ar(),B=Ar(),ve=Ar(),ai=Ar(),pt=Ar();function Ar(){return 2**++RP}const xc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Me,commaOrSpaceSeparated:pt,commaSeparated:ai,number:B,overloadedBoolean:vc,spaceSeparated:ve},Symbol.toStringTag,{value:"Module"})),Da=Object.keys(xc);class ef extends ct{constructor(t,n,r,i){let o=-1;if(super(t,n),vh(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&DP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(xh,BP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!xh.test(o)){let l=o.replace(LP,FP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=ef}return new i(r,t)}function FP(e){return"-"+e.toLowerCase()}function BP(e){return e.charAt(1).toUpperCase()}const $P=b0([N0,IP,P0,_0,T0],"html"),tf=b0([N0,MP,P0,_0,T0],"svg");function UP(e){return e.join(" ").trim()}var nf={},wh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,VP=/\n/g,HP=/^\s*/,WP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GP=/^:\s*/,KP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YP=/^[;\s]*/,QP=/^\s+|\s+$/g,qP=` +`,Sh="/",kh="*",cr="",XP="comment",JP="declaration",ZP=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 v=w.match(VP);v&&(n+=v.length);var S=w.lastIndexOf(qP);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(v){return v.position=new l(w),u(),v}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var v=new Error(t.source+":"+n+":"+r+": "+w);if(v.reason=w,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(w){var v=w.exec(e);if(v){var S=v[0];return i(S),e=e.slice(S.length),v}}function u(){a(HP)}function f(w){var v;for(w=w||[];v=d();)v!==!1&&w.push(v);return w}function d(){var w=o();if(!(Sh!=e.charAt(0)||kh!=e.charAt(1))){for(var v=2;cr!=e.charAt(v)&&(kh!=e.charAt(v)||Sh!=e.charAt(v+1));)++v;if(v+=2,cr===e.charAt(v-1))return s("End of comment missing");var S=e.slice(2,v-2);return r+=2,i(S),e=e.slice(v),r+=2,w({type:XP,comment:S})}}function p(){var w=o(),v=a(WP);if(v){if(d(),!a(GP))return s("property missing ':'");var S=a(KP),g=w({type:JP,property:Ch(v[0].replace(wh,cr)),value:S?Ch(S[0].replace(wh,cr)):cr});return a(YP),g}}function h(){var w=[];f(w);for(var v;v=p();)v!==!1&&(w.push(v),f(w));return w}return u(),h()};function Ch(e){return e?e.replace(QP,cr):cr}var e_=Ol&&Ol.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nf,"__esModule",{value:!0});nf.default=n_;var t_=e_(ZP);function n_(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,t_.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.camelCase=void 0;var r_=/^--[a-zA-Z0-9_-]+$/,i_=/-([a-z])/g,o_=/^[^-]+$/,l_=/^-(webkit|moz|ms|o|khtml)-/,s_=/^-(ms)-/,a_=function(e){return!e||o_.test(e)||r_.test(e)},u_=function(e,t){return t.toUpperCase()},bh=function(e,t){return"".concat(t,"-")},c_=function(e,t){return t===void 0&&(t={}),a_(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(s_,bh):e=e.replace(l_,bh),e.replace(i_,u_))};Qs.camelCase=c_;var d_=Ol&&Ol.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f_=d_(nf),p_=Qs;function wc(e,t){var n={};return!e||typeof e!="string"||(0,f_.default)(e,function(r,i){r&&i&&(n[(0,p_.camelCase)(r,t)]=i)}),n}wc.default=wc;var h_=wc;const m_=xs(h_),A0=R0("end"),rf=R0("start");function R0(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 g_(e){const t=rf(e),n=A0(e);if(t&&n)return{start:t,end:n}}function ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nh(e.position):"start"in e||"end"in e?Nh(e):"line"in e||"column"in e?Sc(e):""}function Sc(e){return Eh(e&&e.line)+":"+Eh(e&&e.column)}function Nh(e){return Sc(e&&e.start)+"-"+Sc(e&&e.end)}function Eh(e){return e&&typeof e=="number"?e:1}class Xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ao(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}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const of={}.hasOwnProperty,y_=new Map,v_=/[A-Z]/g,x_=new Set(["table","tbody","thead","tfoot","tr"]),w_=new Set(["td","th"]),I0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S_(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=__(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=P_(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"?tf:$P,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=M0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function M0(e,t,n){if(t.type==="element")return k_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return C_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return N_(e,t,n);if(t.type==="mdxjsEsm")return b_(e,t);if(t.type==="root")return E_(e,t,n);if(t.type==="text")return j_(e,t)}function k_(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=tf,e.schema=i),e.ancestors.push(t);const o=L0(e,t.tagName,!1),l=T_(e,t);let s=sf(e,t);return x_.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!AP(a):!0})),O0(e,l,o,t),lf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function C_(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)}Io(e,t.position)}function b_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Io(e,t.position)}function N_(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=tf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:L0(e,t.name,!0),l=A_(e,t),s=sf(e,t);return O0(e,l,o,t),lf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function E_(e,t,n){const r={};return lf(r,sf(e,t)),e.create(t,e.Fragment,r,n)}function j_(e,t){return t.value}function O0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function P_(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function __(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=rf(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function T_(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&of.call(t.properties,i)){const o=R_(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&w_.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function A_(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Io(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Io(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function sf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:y_;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(on(e,e.length,0,t),e):t}const _h={}.hasOwnProperty;function B_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=or(/[A-Za-z]/),yt=or(/[\dA-Za-z]/),V_=or(/[#-'*+\--9=?A-Z^-~]/);function kc(e){return e!==null&&(e<32||e===127)}const Cc=or(/\d/),H_=or(/[\dA-Fa-f]/),W_=or(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function ut(e){return e!==null&&(e<0||e===32)}function fe(e){return e===-2||e===-1||e===32}const G_=or(/\p{P}|\p{S}/u),K_=or(/\s/);function or(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ai(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function we(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return fe(a)?(e.enter(n),s(a)):t(a)}function s(a){return fe(a)&&o++l))return;const j=t.events.length;let T=j,z,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(z){M=t.events[T][1].end;break}z=!0}for(g(r),N=j;Nx;){const b=n[C];t.containerState=b[1],b[0].exit.call(t,e)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function J_(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ah(e){if(e===null||ut(e)||K_(e))return 1;if(G_(e))return 2}function uf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Rh(d,-a),Rh(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=jt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=jt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=jt(u,uf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=jt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=jt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,on(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&fe(N)?we(e,y,"linePrefix",o+1)(N):y(N)}function y(N){return N===null||X(N)?e.check(Ih,v,C)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||X(N)?(e.exit("codeFlowValue"),y(N)):(e.consume(N),x)}function C(N){return e.exit("codeFenced"),t(N)}function b(N,j,T){let z=0;return M;function M(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),A}function A(L){return N.enter("codeFencedFence"),fe(L)?we(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===s?(N.enter("codeFencedFenceSequence"),V(L)):T(L)}function V(L){return L===s?(z++,N.consume(L),V):z>=l?(N.exit("codeFencedFenceSequence"),fe(L)?we(N,O,"whitespace")(L):O(L)):T(L)}function O(L){return L===null||X(L)?(N.exit("codeFencedFence"),j(L)):T(L)}}}function cT(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 Fa={name:"codeIndented",tokenize:fT},dT={partial:!0,tokenize:pT};function fT(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),we(e,o,"linePrefix",4+1)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):X(u)?e.attempt(dT,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function pT(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):we(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const hT={name:"codeText",previous:gT,resolve:mT,tokenize:yT};function mT(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Hi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function V0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||kc(g)?n(g):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(g))}function p(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(s),p(g)):g===null||g===60||X(g)?n(g):(e.consume(g),g===92?w:h)}function w(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function v(g){return!f&&(g===null||g===41||ut(g))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(g)):f999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):X(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||X(h)||s++>999?(e.exit("chunkString"),f(h)):(e.consume(h),a||(a=!fe(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function W0(e,t,n,r,i,o){let l;return s;function s(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,a):n(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),we(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||X(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function uo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):fe(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const NT={name:"definition",tokenize:jT},ET={partial:!0,tokenize:PT};function jT(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return H0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return ut(h)?uo(e,u)(h):u(h)}function u(h){return V0(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(ET,d,d)(h)}function d(h){return fe(h)?we(e,p,"whitespace")(h):p(h)}function p(h){return h===null||X(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function PT(e,t,n){return r;function r(s){return ut(s)?uo(e,i)(s):n(s)}function i(s){return W0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return fe(s)?we(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const _T={name:"hardBreakEscape",tokenize:TT};function TT(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 AT={name:"headingAtx",resolve:RT,tokenize:IT};function RT(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function IT(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||ut(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||X(f)?(e.exit("atxHeading"),t(f)):fe(f)?we(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||ut(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const MT=["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"],Oh=["pre","script","style","textarea"],OT={concrete:!0,name:"htmlFlow",resolveTo:zT,tokenize:FT},LT={partial:!0,tokenize:$T},DT={partial:!0,tokenize:BT};function zT(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 FT(e,t,n){const r=this;let i,o,l,s,a;return u;function u(E){return f(E)}function f(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),p):E===47?(e.consume(E),o=!0,v):E===63?(e.consume(E),i=3,r.interrupt?t:k):Jt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function p(E){return E===45?(e.consume(E),i=2,h):E===91?(e.consume(E),i=5,s=0,w):Jt(E)?(e.consume(E),i=4,r.interrupt?t:k):n(E)}function h(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function w(E){const ne="CDATA[";return E===ne.charCodeAt(s++)?(e.consume(E),s===ne.length?r.interrupt?t:P:w):n(E)}function v(E){return Jt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||ut(E)){const ne=E===47,Ie=l.toLowerCase();return!ne&&!o&&Oh.includes(Ie)?(i=1,r.interrupt?t(E):P(E)):MT.includes(l.toLowerCase())?(i=6,ne?(e.consume(E),g):r.interrupt?t(E):P(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?y(E):x(E))}return E===45||yt(E)?(e.consume(E),l+=String.fromCharCode(E),S):n(E)}function g(E){return E===62?(e.consume(E),r.interrupt?t:P):n(E)}function y(E){return fe(E)?(e.consume(E),y):M(E)}function x(E){return E===47?(e.consume(E),M):E===58||E===95||Jt(E)?(e.consume(E),C):fe(E)?(e.consume(E),x):M(E)}function C(E){return E===45||E===46||E===58||E===95||yt(E)?(e.consume(E),C):b(E)}function b(E){return E===61?(e.consume(E),N):fe(E)?(e.consume(E),b):x(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,j):fe(E)?(e.consume(E),N):T(E)}function j(E){return E===a?(e.consume(E),a=null,z):E===null||X(E)?n(E):(e.consume(E),j)}function T(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ut(E)?b(E):(e.consume(E),T)}function z(E){return E===47||E===62||fe(E)?x(E):n(E)}function M(E){return E===62?(e.consume(E),A):n(E)}function A(E){return E===null||X(E)?P(E):fe(E)?(e.consume(E),A):n(E)}function P(E){return E===45&&i===2?(e.consume(E),$):E===60&&i===1?(e.consume(E),H):E===62&&i===4?(e.consume(E),Y):E===63&&i===3?(e.consume(E),k):E===93&&i===5?(e.consume(E),F):X(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(LT,q,V)(E)):E===null||X(E)?(e.exit("htmlFlowData"),V(E)):(e.consume(E),P)}function V(E){return e.check(DT,O,q)(E)}function O(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),L}function L(E){return E===null||X(E)?V(E):(e.enter("htmlFlowData"),P(E))}function $(E){return E===45?(e.consume(E),k):P(E)}function H(E){return E===47?(e.consume(E),l="",_):P(E)}function _(E){if(E===62){const ne=l.toLowerCase();return Oh.includes(ne)?(e.consume(E),Y):P(E)}return Jt(E)&&l.length<8?(e.consume(E),l+=String.fromCharCode(E),_):P(E)}function F(E){return E===93?(e.consume(E),k):P(E)}function k(E){return E===62?(e.consume(E),Y):E===45&&i===2?(e.consume(E),k):P(E)}function Y(E){return E===null||X(E)?(e.exit("htmlFlowData"),q(E)):(e.consume(E),Y)}function q(E){return e.exit("htmlFlow"),t(E)}}function BT(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 $T(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qs,t,n)}}const UT={name:"htmlText",tokenize:VT};function VT(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),b):k===63?(e.consume(k),x):Jt(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,w):Jt(k)?(e.consume(k),y):n(k)}function f(k){return k===45?(e.consume(k),h):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):X(k)?(l=d,H(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),h):d(k)}function h(k){return k===62?$(k):k===45?p(k):d(k)}function w(k){const Y="CDATA[";return k===Y.charCodeAt(o++)?(e.consume(k),o===Y.length?v:w):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(l=v,H(k)):(e.consume(k),v)}function S(k){return k===93?(e.consume(k),g):v(k)}function g(k){return k===62?$(k):k===93?(e.consume(k),g):v(k)}function y(k){return k===null||k===62?$(k):X(k)?(l=y,H(k)):(e.consume(k),y)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):X(k)?(l=x,H(k)):(e.consume(k),x)}function C(k){return k===62?$(k):x(k)}function b(k){return Jt(k)?(e.consume(k),N):n(k)}function N(k){return k===45||yt(k)?(e.consume(k),N):j(k)}function j(k){return X(k)?(l=j,H(k)):fe(k)?(e.consume(k),j):$(k)}function T(k){return k===45||yt(k)?(e.consume(k),T):k===47||k===62||ut(k)?z(k):n(k)}function z(k){return k===47?(e.consume(k),$):k===58||k===95||Jt(k)?(e.consume(k),M):X(k)?(l=z,H(k)):fe(k)?(e.consume(k),z):$(k)}function M(k){return k===45||k===46||k===58||k===95||yt(k)?(e.consume(k),M):A(k)}function A(k){return k===61?(e.consume(k),P):X(k)?(l=A,H(k)):fe(k)?(e.consume(k),A):z(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,V):X(k)?(l=P,H(k)):fe(k)?(e.consume(k),P):(e.consume(k),O)}function V(k){return k===i?(e.consume(k),i=void 0,L):k===null?n(k):X(k)?(l=V,H(k)):(e.consume(k),V)}function O(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ut(k)?z(k):(e.consume(k),O)}function L(k){return k===47||k===62||ut(k)?z(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return fe(k)?we(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):F(k)}function F(k){return e.enter("htmlTextData"),l(k)}}const cf={name:"labelEnd",resolveAll:KT,resolveTo:YT,tokenize:QT},HT={tokenize:qT},WT={tokenize:XT},GT={tokenize:JT};function KT(e){let t=-1;const n=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),fe(u)?we(e,s,"whitespace")(u):s(u))}}const nt={continuation:{tokenize:aA},exit:cA,name:"list",tokenize:sA},oA={partial:!0,tokenize:dA},lA={partial:!0,tokenize:uA};function sA(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(h){const w=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Cc(h)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Il,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return Cc(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(qs,r.interrupt?n:f,e.attempt(oA,p,d))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return fe(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function aA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qs,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!fe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(lA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(nt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function uA(e,t,n){const r=this;return we(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 cA(e){e.exit(this.containerState.type)}function dA(e,t,n){const r=this;return we(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Lh={name:"setextUnderline",resolveTo:fA,tokenize:pA};function fA(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 pA(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),fe(u)?we(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const hA={tokenize:mA};function mA(e){const t=this,n=e.attempt(qs,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wT,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 gA={resolveAll:K0()},yA=G0("string"),vA=G0("text");function G0(e){return{resolveAll:K0(e==="text"?xA:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(f){return u(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function RA(e,t){let n=-1;const r=[];let i;for(;++n0){const Rt=J.tokenStack[J.tokenStack.length-1];(Rt[1]||zh).call(J,void 0,Rt[0])}for(U.position={start:Pn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Pn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function QA(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 qA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function q0(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 XA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return q0(e,t);const i={src:Ai(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 JA(e,t){const n={src:Ai(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 ZA(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 eR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return q0(e,t);const i={href:Ai(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 tR(e,t){const n={href:Ai(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 nR(e,t,n){const r=e.all(t),i=n?rR(n):X0(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function iR(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=rf(t.children[1]),a=A0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function uR(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push($h(t.slice(i),i>0,!1)),o.join("")}function $h(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Fh||o===Bh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Fh||o===Bh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function fR(e,t){const n={type:"text",value:dR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const hR={blockquote:VA,break:HA,code:WA,delete:GA,emphasis:KA,footnoteReference:YA,heading:QA,html:qA,imageReference:XA,image:JA,inlineCode:ZA,linkReference:eR,link:tR,listItem:nR,list:iR,paragraph:oR,root:lR,strong:sR,table:aR,tableCell:cR,tableRow:uR,text:fR,thematicBreak:pR,toml:ml,yaml:ml,definition:ml,footnoteDefinition:ml};function ml(){}const J0=-1,Xs=0,co=1,ys=2,df=3,ff=4,pf=5,hf=6,Z0=7,e1=8,Uh=typeof self=="object"?self:globalThis,mR=(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 Xs:case J0:return n(l,i);case co:{const s=n([],i);for(const a of l)s.push(r(a));return s}case ys:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case df:return n(new Date(l),i);case ff:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case pf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case hf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case Z0:{const{name:s,message:a}=l;return n(new Uh[s](a),i)}case e1:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Uh[o](l),i)};return r},Vh=e=>mR(new Map,e)(0),Dr="",{toString:gR}={},{keys:yR}=Object,Wi=e=>{const t=typeof e;if(t!=="object"||!e)return[Xs,t];const n=gR.call(e).slice(8,-1);switch(n){case"Array":return[co,Dr];case"Object":return[ys,Dr];case"Date":return[df,Dr];case"RegExp":return[ff,Dr];case"Map":return[pf,Dr];case"Set":return[hf,Dr];case"DataView":return[co,n]}return n.includes("Array")?[co,n]:n.includes("Error")?[Z0,n]:[ys,n]},gl=([e,t])=>e===Xs&&(t==="function"||t==="symbol"),vR=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Wi(l);switch(s){case Xs:{let f=l;switch(a){case"bigint":s=e1,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([J0],l)}return i([s,f],l)}case co:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const f=[],d=i([s,f],l);for(const p of l)f.push(o(p));return d}case ys:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([s,f],l);for(const p of yR(l))(e||!gl(Wi(l[p])))&&f.push([o(p),o(l[p])]);return d}case df:return i([s,l.toISOString()],l);case ff:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case pf:{const f=[],d=i([s,f],l);for(const[p,h]of l)(e||!(gl(Wi(p))||gl(Wi(h))))&&f.push([o(p),o(h)]);return d}case hf:{const f=[],d=i([s,f],l);for(const p of l)(e||!gl(Wi(p)))&&f.push(o(p));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Hh=(e,{json:t,lossy:n}={})=>{const r=[];return vR(!(t||n),!!t,new Map,r)(e),r},vs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Vh(Hh(e,t)):structuredClone(e):(e,t)=>Vh(Hh(e,t));function xR(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 wR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function SR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xR,r=e.options.footnoteBackLabel||wR,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let y=typeof n=="string"?n:n(a,h);typeof y=="string"&&(y={type:"text",value:y}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const y=S.children[S.children.length-1];y&&y.type==="text"?y.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else f.push(...w);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const t1=function(e){if(e==null)return NR;if(typeof e=="function")return Js(e);if(typeof e=="object")return Array.isArray(e)?kR(e):CR(e);if(typeof e=="string")return bR(e);throw new Error("Expected function, string, or object as test")};function kR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=n1,w,v,S;if((!t||o(a,u,f[f.length-1]||void 0))&&(h=TR(n(a,f)),h[0]===Wh))return h;if("children"in a&&a.children){const g=a;if(g.children&&h[0]!==PR)for(v=(r?g.children.length:-1)+l,S=f.concat(g);v>-1&&v0&&n.push({type:"text",value:` +`}),n}function Gh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kh(e,t){const n=RR(e,t),r=n.one(e,void 0),i=SR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function DR(e,t){return e&&"run"in e?async function(n,r){const i=Kh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Kh(n,{file:r,...e||t})}}function Yh(e){if(e)throw e}var Ml=Object.prototype.hasOwnProperty,i1=Object.prototype.toString,Qh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Xh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):i1.call(t)==="[object Array]"},Jh=function(t){if(!t||i1.call(t)!=="[object Object]")return!1;var n=Ml.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ml.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ml.call(t,i)},Zh=function(t,n){Qh&&n.name==="__proto__"?Qh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},em=function(t,n){if(n==="__proto__")if(Ml.call(t,n)){if(qh)return qh(t,n).value}else return;return t[n]},zR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const Qt={basename:$R,dirname:UR,extname:VR,join:HR,sep:"/"};function $R(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function UR(e){if(Vo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function VR(e){Vo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function HR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GR(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function Vo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const KR={cwd:YR};function YR(){return"/"}function jc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function QR(e){if(typeof e=="string")e=new URL(e);else if(!jc(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 qR(e)}function qR(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[h,...w]=f;const v=r[p][1];Ec(v)&&Ec(h)&&(h=$a(!0,v,h)),r[p]=[u,h,...w]}}}}const eI=new mf().freeze();function Wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ga(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ka(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 nm(e){if(!Ec(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yl(e){return tI(e)?e:new o1(e)}function tI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nI(e){return typeof e=="string"||rI(e)}function rI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",im=[],om={allowDangerousHtml:!0},oI=/^(https?|ircs?|mailto|xmpp)$/i,lI=[{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 sI(e){const t=aI(e),n=uI(e);return cI(t.runSync(t.parse(n),n),e)}function aI(e){const t=e.rehypePlugins||im,n=e.remarkPlugins||im,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...om}:om;return eI().use(UA).use(n).use(DR,r).use(t)}function uI(e){const t=e.children||"",n=new o1;return typeof t=="string"&&(n.value=t),n}function cI(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||dI;for(const f of lI)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+iI+f.id,void 0);return r1(e,u),S_(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let h;for(h in za)if(Object.hasOwn(za,h)&&Object.hasOwn(f.properties,h)){const w=f.properties[h],v=za[h];(v===null||v.includes(f.tagName))&&(f.properties[h]=a(String(w||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(f,d,p)),h&&p&&typeof d=="number")return s&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function dI(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||oI.test(e.slice(0,t))?e:""}const l1=m.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=m.useRef(null),f=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return m.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),c.jsxs("div",{className:ue("flex h-full flex-col",e),ref:a,...s,children:[c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:c.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>c.jsxs("div",{className:ue("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:c.jsx(as,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:ue("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[c.jsxs("div",{className:"text-xs opacity-70",children:[d.role==="user"?"You":"Assistant"," • #",p+1]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(sI,{components:{p:({children:h})=>c.jsx("p",{className:"mb-2 last:mb-0",children:h}),ul:({children:h})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:h}),ol:({children:h})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:h}),li:({children:h})=>c.jsx("li",{className:"mb-1",children:h}),code:({children:h,className:w})=>!w?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:h}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:h}),pre:({children:h})=>c.jsx("div",{className:"mb-2 last:mb-0",children:h}),strong:({children:h})=>c.jsx("strong",{className:"font-semibold",children:h}),em:({children:h})=>c.jsx("em",{className:"italic",children:h}),blockquote:({children:h})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:h}),h1:({children:h})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:h}),h2:({children:h})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:h}),h3:({children:h})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:h})},children:d.content})})]}),d.role==="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:c.jsx(Vb,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),c.jsx("div",{ref:u})]}),c.jsx("div",{className:"border-t p-4",children:c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(Od,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?c.jsx(de,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(Ob,{className:"h-4 w-4"})}):c.jsx(de,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(Pb,{className:"h-4 w-4"})})]})})]})});l1.displayName="Chat";const Kt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function s1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function fI(){return s1()}class pI{getAllSessions(){const t=localStorage.getItem(Kt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:s1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},o=this.getAllSessions();return o.unshift(i),localStorage.setItem(Kt.sessions,JSON.stringify(o)),i}updateSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);i!==-1&&(r[i]={...r[i],...n,updatedAt:Date.now()},localStorage.setItem(Kt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Kt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Kt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:fI(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Kt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Kt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Kt.currentSession,t)}clear(){localStorage.removeItem(Kt.sessions),localStorage.removeItem(Kt.currentSession)}}const Ce=new pI;function hI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=m.useState([]),[l,s]=m.useState(null),[a,u]=m.useState(""),[f,d]=m.useState({isLoading:!1,error:null}),[p,h]=m.useState(n),[w,v]=m.useState(r),[S,g]=m.useState(.7),[y,x]=m.useState(1024),C=Dt.useMemo(()=>{var L;const O=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!O,messageCount:((L=O==null?void 0:O.messages)==null?void 0:L.length)||0}),O},[i,l]),b=Dt.useMemo(()=>{const O=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(L=>({id:L.id,role:L.role}))),O},[C==null?void 0:C.messages]);m.useEffect(()=>{const O=Ce.getAllSessions();o(O);const L=Ce.getCurrentSession();L?s(L.id):O.length>0&&(s(O[0].id),Ce.setCurrentSession(O[0].id))},[]);const N=m.useCallback(()=>{const O=Ce.createSession(void 0,p,w),L=Ce.getAllSessions();return o([...L]),s(O.id),Ce.setCurrentSession(O.id),O.id},[p,w]),j=m.useCallback(O=>{s(O),Ce.setCurrentSession(O)},[]),T=m.useCallback(O=>{Ce.deleteSession(O);const L=Ce.getAllSessions();o([...L]),l===O&&(L.length>0?(s(L[0].id),Ce.setCurrentSession(L[0].id)):s(null))},[l]),z=m.useCallback((O,L)=>{Ce.updateSession(O,{title:L});const $=Ce.getAllSessions();o([...$])},[]),M=m.useCallback(O=>{if(!l)return;Ce.addMessageToSession(l,O);const L=Ce.getAllSessions();o([...L])},[l]),A=m.useCallback(async()=>{var _,F;if(!a.trim()||f.isLoading)return;let O=l;O||(O=N());const L=a.trim();if(u(""),d({isLoading:!0,error:null}),O){Ce.addMessageToSession(O,{role:"user",content:L});const k=Ce.getAllSessions();o([...k])}const $=Ce.getSession(O),H=($==null?void 0:$.messages)&&$.messages.length>1;if(w&&!H&&O){Ce.addMessageToSession(O,{role:"system",content:w});const k=Ce.getAllSessions();o([...k])}try{const k=Ce.getSession(O),Y=((F=(_=k==null?void 0:k.messages)==null?void 0:_.filter(ne=>ne.role!=="system"))==null?void 0:F.map(ne=>({role:ne.role,content:ne.content})))||[],q=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:L,messages:Y,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:y})});if(!q.ok){const ne=await q.json();throw new Error(ne.detail||`HTTP error! status: ${q.status}`)}const E=await q.json();if(O){Ce.addMessageToSession(O,{role:"assistant",content:E.content,thinking_content:E.thinking_content,model_used:E.model_used,supports_thinking:E.supports_thinking});const ne=Ce.getAllSessions();o([...ne])}d({isLoading:!1,error:null})}catch(k){const Y=k instanceof Error?k.message:"An error occurred";if(d({isLoading:!1,error:Y}),O){Ce.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`});const q=Ce.getAllSessions();o([...q])}}},[a,f.isLoading,l,N,M,w,b.length,t,p,S,y]),P=m.useCallback(()=>{d({isLoading:!1,error:null})},[]),V=m.useCallback(()=>{Ce.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:N,selectSession:j,deleteSession:T,renameSession:z,clearAllSessions:V,messages:b,input:a,setInput:u,sendMessage:A,stopGeneration:P,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:y,setMaxTokens:x}}function mI(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:f,isLoading:d,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:y,setMaxTokens:x}=hI(),[C,b]=m.useState(!1),[N,j]=m.useState(!1),[T,z]=m.useState(null),[M,A]=m.useState(!1),[P,V]=m.useState(null),[O,L]=m.useState(!1),[$,H]=m.useState(""),[_,F]=m.useState(""),[k,Y]=m.useState([]),q=()=>{if(!$.trim())return;const I={id:Date.now().toString(),name:$,description:_,model:p,systemPrompt:w,temperature:S,maxTokens:y,createdAt:new Date().toISOString()},W=JSON.parse(localStorage.getItem("savedAssistants")||"[]");W.push(I),localStorage.setItem("savedAssistants",JSON.stringify(W)),H(""),F(""),L(!1),alert("助手保存成功!可在模型目录中查看。")},E=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Technical Writer",prompt:"You are a technical writer. Create clear, comprehensive documentation and explanations. Use proper formatting and structure your responses logically."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{name:"Research Assistant",prompt:"You are a research assistant. Provide detailed, well-researched responses with clear reasoning. Cite sources when relevant and present information objectively."},{name:"Teacher",prompt:"You are an experienced teacher. Explain concepts clearly, use examples, and break down complex topics into understandable parts. Be encouraging and patient."}],ne=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];m.useEffect(()=>{re(),Ie()},[]);const Ie=()=>{try{const I=localStorage.getItem("loadAssistantConfig");if(I){const W=JSON.parse(I);h(W.model),v(W.systemPrompt||""),g(W.temperature||.7),x(W.maxTokens||1024),localStorage.removeItem("loadAssistantConfig"),setTimeout(()=>{alert(`Assistant "${W.name}" loaded successfully!`)},500)}}catch(I){console.error("Failed to load assistant configuration:",I)}};m.useEffect(()=>{if(p&&!k.find(I=>I.model_name===p)){const I=k[0];I&&h(I.model_name)}},[k,p,h]),m.useEffect(()=>{(async()=>{if(!p||!k.length)return;const W=k.find(ye=>ye.model_name===p);if(!W)return;const Q=`${window.location.protocol}//${window.location.host}`;if(W.type==="local"&&!W.is_loaded){V(W),A(!0);return}const me=k.filter(ye=>ye.type==="local"&&ye.is_loaded&&ye.model_name!==p);for(const ye of me)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ye.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ye.model_name}`)}catch(dt){console.error(`Error auto-unloading model ${ye.model_name}:`,dt)}me.length>0&&re()})()},[p,k]);const se=async()=>{if(P){A(!1),z(P.model_name);try{const I=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${I}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:P.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${P.model_name}`),re();else{console.error(`❌ Failed to load model: ${P.model_name}`);const Q=k.find(me=>me.type==="api");Q&&h(Q.model_name)}}catch(I){console.error("Error loading model:",I);const W=k.find(Q=>Q.type==="api");W&&h(W.model_name)}finally{z(null),V(null)}}},K=()=>{A(!1),V(null);const I=k.find(W=>W.type==="api");I&&h(I.model_name)};m.useEffect(()=>{const I=async()=>{const W=`${window.location.protocol}//${window.location.host}`,Q=k.filter(me=>me.type==="local"&&me.is_loaded);for(const me of Q)try{await fetch(`${W}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:me.model_name})}),console.log(`✅ Cleanup: unloaded ${me.model_name}`)}catch(ye){console.error(`Error cleaning up model ${me.model_name}:`,ye)}};return()=>{I()}},[k]);const re=async()=>{try{const I=`${window.location.protocol}//${window.location.host}`,W=await fetch(`${I}/models`);if(W.ok){const Q=await W.json();if(Y(Q.models),Q.current_model&&p!==Q.current_model)h(Q.current_model);else if(!p&&Q.models.length>0){const ye=Q.models.find(dt=>dt.type==="api")||Q.models[0];h(ye.model_name)}}}catch(I){console.error("Failed to fetch models:",I)}},Se=I=>{a(I)};return c.jsxs("div",{className:"min-h-screen bg-background flex",children:[c.jsx("div",{className:` + ${C?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:c.jsxs("div",{className:"p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs(de,{onClick:r,size:"sm",children:[c.jsx(kb,{className:"h-4 w-4 mr-1"}),"New"]})]}),c.jsx("div",{className:"space-y-2",children:e.map(I=>c.jsxs(ze,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===I.id?"bg-accent border-primary":""}`,onClick:()=>i(I.id),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:I.title}),c.jsx(de,{size:"sm",variant:"ghost",onClick:W=>{W.stopPropagation(),o(I.id)},className:"h-6 w-6 p-0",children:c.jsx(Td,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[I.messages.length," messages"]})]},I.id))})]})}),C&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>b(!1)}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(de,{variant:"ghost",size:"sm",onClick:()=>b(!C),className:"lg:hidden",children:C?c.jsx(vb,{className:"h-4 w-4"}):c.jsx(wb,{className:"h-4 w-4"})}),c.jsx(Qn,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&c.jsxs(Ae,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[c.jsxs(de,{variant:"outline",size:"sm",onClick:()=>b(!C),className:"hidden lg:flex flex-shrink-0",children:[c.jsx(db,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),c.jsxs(de,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(rb,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"View code"}),c.jsx("span",{className:"sm:hidden",children:"Code"})]}),c.jsxs(de,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx($b,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),c.jsxs(de,{variant:"outline",size:"sm",className:"flex-shrink-0",onClick:()=>L(!0),children:[c.jsx(Eb,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Save Assistant"})]}),c.jsxs(de,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(Vy,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&c.jsx("div",{className:"p-6 border-b",children:c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{className:"text-base",children:"Start with a sample prompt"})}),c.jsx(Ve,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:ne.map((I,W)=>c.jsx(de,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>Se(I.prompt),disabled:d,children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:I.title}),c.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:I.description})]})},W))})})]})}),c.jsx(l1,{messages:l.map(I=>({id:I.id,role:I.role,content:I.content,createdAt:new Date(I.timestamp)})),input:s,handleInputChange:I=>a(I.target.value),handleSubmit:async I=>{I.preventDefault(),!(!p||!k.find(W=>W.model_name===p))&&await u()},isGenerating:d,stop:f,className:"flex-1"})]}),c.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:c.jsxs("div",{className:"p-4 space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_d,{className:"h-4 w-4"}),c.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{className:"text-sm",children:"Model Selection"})}),c.jsxs(Ve,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(bt,{className:"text-xs font-medium mb-2",children:"Active Model"}),c.jsxs(Dj,{value:p||"",onValueChange:h,children:[c.jsx(Ix,{className:"w-full",children:c.jsx(zj,{placeholder:"Select a model...",children:p&&(()=>{const I=k.find(Q=>Q.model_name===p);if(!I)return p;const W=I.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[W?c.jsx(ii,{className:"h-4 w-4 text-blue-500"}):I.supports_thinking?c.jsx(Gn,{className:"h-4 w-4 text-purple-500"}):c.jsx(us,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:I.name}),T===p?c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(Ae,{variant:"outline",className:"text-xs",children:W?"API":I.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(Lx,{children:[c.jsxs(hh,{children:[c.jsx(ac,{children:"🌐 API Models"}),k.filter(I=>I.type==="api").map(I=>c.jsx(uc,{value:I.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ii,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:I.name}),c.jsx(Ae,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},I.model_name))]}),c.jsxs(hh,{children:[c.jsx(ac,{children:"💻 Local Models"}),k.filter(I=>I.type==="local").map(I=>c.jsx(uc,{value:I.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[I.supports_thinking?c.jsx(Gn,{className:"h-4 w-4 text-purple-500"}):c.jsx(us,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:I.name}),T===I.model_name?c.jsx(Ae,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):I.is_loaded?c.jsx(Ae,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):c.jsx(Ae,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},I.model_name))]})]})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsx(de,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:c.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{className:"text-sm",children:"Parameters"})}),c.jsxs(Ve,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(bt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),c.jsx(Xu,{value:[S],onValueChange:I=>g(I[0]),min:0,max:2,step:.01,className:"mt-2",disabled:d}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),c.jsxs("div",{children:[c.jsxs(bt,{className:"text-xs font-medium",children:["Max Tokens: ",y]}),c.jsx(Xu,{value:[y],onValueChange:I=>x(I[0]),min:100,max:4096,step:100,className:"mt-2",disabled:d})]})]})]}),c.jsx(ze,{children:c.jsxs(Kj,{open:N,onOpenChange:j,children:[c.jsx(ot,{children:c.jsx(Yj,{asChild:!0,children:c.jsxs(de,{variant:"ghost",className:"w-full justify-between p-0",disabled:d,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Qn,{className:"h-4 w-4"}),c.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&c.jsx(Ae,{variant:"secondary",className:"text-xs",children:"Custom"})]}),c.jsx(jd,{className:`h-4 w-4 transition-transform ${N?"transform rotate-180":""}`})]})})}),c.jsx(Qj,{children:c.jsxs(Ve,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(bt,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),c.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:E.map(I=>c.jsx(de,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>v(I.prompt),disabled:d,children:I.name},I.name))})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx(bt,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&c.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>v(""),className:"h-6 px-2 text-xs",disabled:d,children:[c.jsx(bb,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),c.jsx("textarea",{id:"system-prompt",value:w,onChange:I=>v(I.target.value),placeholder:"Enter custom system prompt to define how the model should behave...",className:"w-full min-h-[80px] text-xs p-2 border rounded-md bg-background",disabled:d}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),c.jsx(mh,{open:M,onOpenChange:A,children:c.jsxs(cc,{children:[c.jsxs(dc,{children:[c.jsxs(pc,{className:"flex items-center gap-2",children:[c.jsx(Pd,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),c.jsx(hc,{asChild:!0,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["You're about to load ",c.jsx("strong",{children:P==null?void 0:P.name})," locally."]}),c.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Fb,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),c.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Storage:"})," ",P==null?void 0:P.size_gb]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"RAM:"})," ~",P==null?void 0:P.size_gb," (while running)"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),c.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:c.jsxs("div",{className:"text-sm text-blue-700",children:[c.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),c.jsx("p",{className:"mt-1",children:P==null?void 0:P.description}),(P==null?void 0:P.supports_thinking)&&c.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[c.jsx(Gn,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),c.jsxs(fc,{children:[c.jsx(gc,{onClick:K,children:"Cancel"}),c.jsx(mc,{onClick:se,children:"Load Model"})]})]})}),c.jsx(mh,{open:O,onOpenChange:L,children:c.jsxs(cc,{children:[c.jsxs(dc,{children:[c.jsxs(pc,{className:"flex items-center gap-2",children:[c.jsx(as,{className:"h-5 w-5 text-blue-500"}),"Save Current Configuration as Assistant"]}),c.jsx(hc,{children:"Save your current model settings and system prompt as a reusable assistant."})]}),c.jsxs("div",{className:"space-y-4 py-4",children:[c.jsxs("div",{children:[c.jsx(bt,{htmlFor:"assistant-name",children:"Assistant Name"}),c.jsx(fv,{id:"assistant-name",value:$,onChange:I=>H(I.target.value),placeholder:"e.g., Code Review Expert",className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx(bt,{htmlFor:"assistant-description",children:"Description"}),c.jsx(Od,{id:"assistant-description",value:_,onChange:I=>F(I.target.value),placeholder:"Describe what this assistant is good at...",rows:3,className:"mt-1"})]}),c.jsxs("div",{className:"bg-muted p-3 rounded-md text-sm",children:[c.jsx("div",{className:"font-medium mb-2",children:"Current Configuration:"}),c.jsxs("div",{className:"space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:["Model: ",p]}),c.jsxs("div",{children:["Temperature: ",S]}),c.jsxs("div",{children:["Max Tokens: ",y]}),c.jsxs("div",{children:["System Prompt: ",w?w.slice(0,50)+"...":"None"]})]})]})]}),c.jsxs(fc,{children:[c.jsx(gc,{onClick:()=>L(!1),children:"Cancel"}),c.jsx(mc,{onClick:q,disabled:!$.trim(),children:"Save Assistant"})]})]})})]})}var Ya="rovingFocusGroup.onEntryFocus",gI={bubbles:!1,cancelable:!0},Ho="RovingFocusGroup",[Pc,a1,yI]=Id(Ho),[vI,u1]=kn(Ho,[yI]),[xI,wI]=vI(Ho),c1=m.forwardRef((e,t)=>c.jsx(Pc.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Pc.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(SI,{...e,ref:t})})}));c1.displayName=Ho;var SI=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=m.useRef(null),h=pe(t,p),w=Ds(o),[v,S]=kr({prop:l,defaultProp:s??null,onChange:a,caller:Ho}),[g,y]=m.useState(!1),x=qn(u),C=a1(n),b=m.useRef(!1),[N,j]=m.useState(0);return m.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Ya,x),()=>T.removeEventListener(Ya,x)},[x]),c.jsx(xI,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(T=>S(T),[S]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>j(T=>T-1),[]),children:c.jsx(te.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{b.current=!0}),onFocus:Z(e.onFocus,T=>{const z=!b.current;if(T.target===T.currentTarget&&z&&!g){const M=new CustomEvent(Ya,gI);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=C().filter($=>$.focusable),P=A.find($=>$.active),V=A.find($=>$.id===v),L=[P,V,...A].filter(Boolean).map($=>$.ref.current);p1(L,f)}}b.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})}),d1="RovingFocusGroupItem",f1=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=hn(),u=o||a,f=wI(d1,n),d=f.currentTabStopId===u,p=a1(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=f;return m.useEffect(()=>{if(r)return h(),()=>w()},[r,h,w]),c.jsx(Pc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(te.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?f.onItemFocus(u):S.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const g=bI(S,f.orientation,f.dir);if(g!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=f.loop?NI(x,C+1):x.slice(C+1)}setTimeout(()=>p1(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:v!=null}):l})})});f1.displayName=d1;var kI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bI(e,t,n){const r=CI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kI[r]}function p1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function NI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EI=c1,jI=f1,Zs="Tabs",[PI,$I]=kn(Zs,[u1]),h1=u1(),[_I,gf]=PI(Zs),m1=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,f=Ds(s),[d,p]=kr({prop:r,onChange:i,defaultProp:o??"",caller:Zs});return c.jsx(_I,{scope:n,baseId:hn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:a,children:c.jsx(te.div,{dir:f,"data-orientation":l,...u,ref:t})})});m1.displayName=Zs;var g1="TabsList",y1=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=gf(g1,n),l=h1(n);return c.jsx(EI,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(te.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});y1.displayName=g1;var v1="TabsTrigger",x1=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=gf(v1,n),s=h1(n),a=k1(l.baseId,r),u=C1(l.baseId,r),f=r===l.value;return c.jsx(jI,{asChild:!0,...s,focusable:!i,active:f,children:c.jsx(te.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:Z(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:Z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});x1.displayName=v1;var w1="TabsContent",S1=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=gf(w1,n),a=k1(s.baseId,r),u=C1(s.baseId,r),f=r===s.value,d=m.useRef(f);return m.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(_i,{present:i||f,children:({present:p})=>c.jsx(te.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});S1.displayName=w1;function k1(e,t){return`${e}-trigger-${t}`}function C1(e,t){return`${e}-content-${t}`}var TI=m1,b1=y1,N1=x1,E1=S1;const AI=TI,j1=m.forwardRef(({className:e,...t},n)=>c.jsx(b1,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));j1.displayName=b1.displayName;const Xi=m.forwardRef(({className:e,...t},n)=>c.jsx(N1,{ref:n,className:ue("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}));Xi.displayName=N1.displayName;const Ji=m.forwardRef(({className:e,...t},n)=>c.jsx(E1,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ji.displayName=E1.displayName;function RI(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer that provides detailed analysis, suggests improvements, and identifies potential issues.",author:"EdgeLLM Team",category:"coding",tags:["code review","programming","best practices"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a senior software engineer specializing in code review. Analyze the provided code for: + +1. **Code Quality**: Structure, readability, maintainability +2. **Best Practices**: Following language conventions and patterns +3. **Performance**: Potential optimizations and bottlenecks +4. **Security**: Common vulnerabilities and security issues +5. **Testing**: Testability and edge cases + +Provide constructive feedback with specific examples and actionable suggestions.`,temperature:.3,maxTokens:1500,likes:245,downloads:1200,isOfficial:!0,createdAt:"2024-01-15"},{id:"writing-tutor",name:"Academic Writing Tutor",description:"Helps improve academic writing with structure suggestions, grammar corrections, and clarity enhancements.",author:"Academic Guild",category:"writing",tags:["academic writing","essay","research"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are an experienced academic writing tutor. Help users improve their writing by: + +1. **Structure & Organization**: Clear thesis, logical flow, proper transitions +2. **Clarity & Precision**: Eliminate ambiguity, improve word choice +3. **Academic Style**: Formal tone, appropriate citations, scholarly voice +4. **Grammar & Mechanics**: Correct errors, improve sentence variety +5. **Argument Development**: Strengthen evidence, address counterarguments + +Provide specific feedback with examples and rewrite suggestions where helpful.`,temperature:.4,maxTokens:1200,likes:189,downloads:856,isOfficial:!1,createdAt:"2024-01-20"},{id:"data-analyst",name:"Data Analysis Assistant",description:"Helps analyze data, create visualizations, and explain statistical concepts in simple terms.",author:"DataPro",category:"analysis",tags:["data science","statistics","visualization"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a data analysis expert. Help users understand and analyze data by: + +1. **Data Exploration**: Identify patterns, outliers, relationships +2. **Statistical Analysis**: Apply appropriate tests, interpret results +3. **Visualization**: Suggest effective charts and graphs +4. **Insights**: Draw meaningful conclusions from data +5. **Communication**: Explain complex concepts simply + +Provide step-by-step analysis and practical recommendations.`,temperature:.2,maxTokens:1e3,likes:156,downloads:643,isOfficial:!1,createdAt:"2024-01-25"},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories, characters, and narrative techniques.",author:"StoryMaster",category:"creative",tags:["creative writing","storytelling","fiction"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a creative writing coach with expertise in storytelling. Help writers by: + +1. **Story Development**: Plot structure, pacing, conflict resolution +2. **Character Creation**: Compelling personalities, realistic dialogue, character arcs +3. **World Building**: Consistent settings, atmosphere, details +4. **Writing Techniques**: Show vs tell, point of view, voice +5. **Inspiration**: Creative prompts, overcoming writer's block + +Provide encouraging feedback and concrete suggestions to enhance creativity.`,temperature:.8,maxTokens:1200,likes:312,downloads:987,isOfficial:!1,createdAt:"2024-01-30"},{id:"interview-prep",name:"Interview Preparation Coach",description:"Helps prepare for job interviews with practice questions, answer strategies, and confidence building.",author:"CareerBoost",category:"career",tags:["interview","job search","career"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:`You are a professional career coach specializing in interview preparation. Help candidates by: + +1. **Question Practice**: Common and behavioral interview questions +2. **Answer Framework**: STAR method, structured responses +3. **Company Research**: Industry insights, company-specific preparation +4. **Confidence Building**: Reducing anxiety, improving presentation +5. **Follow-up**: Thank you notes, next steps + +Provide personalized advice and realistic practice scenarios.`,temperature:.5,maxTokens:1e3,likes:278,downloads:1456,isOfficial:!0,createdAt:"2024-02-05"}]}function II(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[i,o]=m.useState(null),[l,s]=m.useState([]),[a]=m.useState(RI()),[u,f]=m.useState([]);m.useEffect(()=>{y(),d(),w()},[]);const d=()=>{try{const b=JSON.parse(localStorage.getItem("savedAssistants")||"[]");s(b)}catch(b){console.error("Failed to load saved assistants:",b),s([])}},p=b=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(b)),window.location.href="/playground"},h=b=>{const N=l.filter(j=>j.id!==b);s(N),localStorage.setItem("savedAssistants",JSON.stringify(N))},w=()=>{try{const b=JSON.parse(localStorage.getItem("likedTemplates")||"[]");f(b)}catch(b){console.error("Failed to load liked templates:",b)}},v=b=>{const N=u.includes(b)?u.filter(j=>j!==b):[...u,b];f(N),localStorage.setItem("likedTemplates",JSON.stringify(N))},S=b=>{const N={name:b.name,description:b.description,model:b.model,systemPrompt:b.systemPrompt,temperature:b.temperature,maxTokens:b.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(N)),window.location.href="/playground"},g=b=>{alert(`"${b.name}" has been shared to the community! (This is a demo - in production, it would be submitted for review.)`)},y=async()=>{try{const b=`${window.location.protocol}//${window.location.host}`,N=await fetch(`${b}/models`);if(N.ok){const j=await N.json();t(j.models)}}catch(b){console.error("Failed to fetch models:",b)}finally{r(!1)}},x=async b=>{o(b);try{const N=`${window.location.protocol}//${window.location.host}`;(await fetch(`${N}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:b})})).ok&&await y()}catch(N){console.error("Failed to load model:",N)}finally{o(null)}},C=async b=>{try{const N=`${window.location.protocol}//${window.location.host}`;(await fetch(`${N}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:b})})).ok&&await y()}catch(N){console.error("Failed to unload model:",N)}};return n?c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]})})}),c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx(Uy,{className:"h-8 w-8 animate-spin"})})]}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(de,{variant:"outline",size:"sm",onClick:y,children:"Refresh"})})]})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto",children:[c.jsx(ze,{className:"bg-blue-50 border-blue-200 mb-6",children:c.jsx(Ve,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx($y,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Assistant Library"}),c.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Manage your custom assistants and discover community templates. Create specialized AI helpers for different tasks and workflows."})]})]})})}),c.jsxs(AI,{defaultValue:"my-assistants",className:"space-y-6",children:[c.jsxs(j1,{className:"grid w-full grid-cols-4",children:[c.jsxs(Xi,{value:"my-assistants",className:"flex items-center gap-2",children:[c.jsx(as,{className:"h-4 w-4"}),"My Assistants"]}),c.jsxs(Xi,{value:"community",className:"flex items-center gap-2",children:[c.jsx(Wb,{className:"h-4 w-4"}),"Community"]}),c.jsxs(Xi,{value:"featured",className:"flex items-center gap-2",children:[c.jsx(Hy,{className:"h-4 w-4"}),"Featured"]}),c.jsxs(Xi,{value:"models",className:"flex items-center gap-2",children:[c.jsx(Gn,{className:"h-4 w-4"}),"Models"]})]}),c.jsx(Ji,{value:"my-assistants",className:"space-y-6",children:l.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(b=>c.jsx(MI,{assistant:b,onUse:()=>p(b),onDelete:()=>h(b.id),onShare:()=>g(b)},b.id))}):c.jsxs(ze,{className:"text-center p-8",children:[c.jsx(as,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),c.jsx("h3",{className:"text-lg font-medium mb-2",children:"No assistants yet"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"Create your first assistant by configuring parameters in the Playground and saving it."}),c.jsx(de,{onClick:()=>window.location.href="/playground",children:"Go to Playground"})]})}),c.jsx(Ji,{value:"community",className:"space-y-6",children:c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(b=>c.jsx(lm,{template:b,isLiked:u.includes(b.id),onLike:()=>v(b.id),onUse:()=>S(b)},b.id))})}),c.jsx(Ji,{value:"featured",className:"space-y-6",children:c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.filter(b=>b.isOfficial||b.likes>200).map(b=>c.jsx(lm,{template:b,isLiked:u.includes(b.id),onLike:()=>v(b.id),onUse:()=>S(b),featured:!0},b.id))})}),c.jsxs(Ji,{value:"models",className:"space-y-6",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(ii,{className:"h-5 w-5"}),"API Models",c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(b=>b.type==="api").map(b=>c.jsx(sm,{model:b,modelLoading:i,onLoad:x,onUnload:C},b.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(By,{className:"h-5 w-5"}),"Local Models",c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Privacy-First"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(b=>b.type==="local").map(b=>c.jsx(sm,{model:b,modelLoading:i,onLoad:x,onUnload:C},b.model_name))})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsx(xt,{children:"Model Statistics"})}),c.jsx(Ve,{children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Available Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(b=>b.is_loaded).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(b=>b.supports_thinking).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})]})]})})]})}function MI({assistant:e,onUse:t,onDelete:n,onShare:r}){return c.jsxs(ze,{className:"hover:shadow-md transition-shadow",children:[c.jsx(ot,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(xt,{className:"text-base",children:e.name}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description"})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx(de,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700",title:"Share to community",children:c.jsx(Vy,{className:"h-4 w-4"})}),c.jsx(de,{variant:"ghost",size:"sm",onClick:n,className:"text-destructive hover:text-destructive",title:"Delete assistant",children:c.jsx(Td,{className:"h-4 w-4"})})]})]})}),c.jsxs(Ve,{className:"space-y-3",children:[c.jsxs("div",{className:"text-xs space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Model:"})," ",e.model]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Temperature:"})," ",e.temperature]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Max Tokens:"})," ",e.maxTokens]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Created:"})," ",new Date(e.createdAt).toLocaleDateString()]})]}),c.jsxs(de,{size:"sm",onClick:t,className:"w-full",children:[c.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Use Assistant"]})]})]})}function lm({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1}){return c.jsxs(ze,{className:`hover:shadow-md transition-shadow ${i?"ring-2 ring-yellow-200":""}`,children:[c.jsx(ot,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(xt,{className:"text-base",children:e.name}),e.isOfficial&&c.jsx(Ae,{variant:"default",className:"text-xs px-2 py-0",children:"Official"}),i&&c.jsx(Hy,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["by ",e.author]}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:e.description})]}),c.jsx(de,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:c.jsx(Bp,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),c.jsxs(Ve,{className:"space-y-3",children:[c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(o=>c.jsx(Ae,{variant:"secondary",className:"text-xs",children:o},o))}),c.jsxs("div",{className:"text-xs space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Model:"})," ",e.model]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Temperature:"})," ",e.temperature]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Max Tokens:"})," ",e.maxTokens]})]}),c.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Bp,{className:"h-3 w-3"}),c.jsx("span",{children:e.likes})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Pd,{className:"h-3 w-3"}),c.jsx("span",{children:e.downloads})]})]}),c.jsx("span",{children:e.createdAt})]}),c.jsx("div",{className:"flex gap-2",children:c.jsxs(de,{size:"sm",onClick:r,className:"flex-1",children:[c.jsx(ob,{className:"h-4 w-4 mr-1"}),"Use Template"]})})]})]})}function sm({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api";return c.jsxs(ze,{className:"relative",children:[c.jsx(ot,{children:c.jsx("div",{className:"flex items-start justify-between",children:c.jsxs("div",{className:"flex items-center gap-3",children:[i?c.jsx(ii,{className:"h-6 w-6 text-blue-500"}):e.supports_thinking?c.jsx(Gn,{className:"h-6 w-6 text-blue-500"}):c.jsx(us,{className:"h-6 w-6 text-green-500"}),c.jsxs("div",{children:[c.jsx(xt,{className:"text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[i?c.jsxs(Ae,{variant:"default",className:"bg-blue-600",children:[c.jsx(ii,{className:"h-3 w-3 mr-1"}),"API Model"]}):c.jsxs(Ae,{variant:e.supports_thinking?"default":"secondary",children:[c.jsx(By,{className:"h-3 w-3 mr-1"}),e.supports_thinking?"Thinking Model":"Instruction Model"]}),e.is_loaded&&c.jsxs(Ae,{variant:"outline",className:"text-green-600 border-green-600",children:[c.jsx(eb,{className:"h-3 w-3 mr-1"}),i?"Ready":"Loaded"]})]})]})]})})}),c.jsxs(Ve,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{children:["Size: ",e.size_gb]}),!i&&c.jsx("span",{children:"Format: Safetensors"}),i&&c.jsx("span",{children:"Type: Cloud API"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Capabilities"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Text Generation"}),c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Conversation"}),c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Code"}),e.supports_thinking&&c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Reasoning"}),i&&e.model_name.includes("vl")&&c.jsx(Ae,{variant:"outline",className:"text-xs",children:"Vision"})]})]}),c.jsx("div",{className:"pt-2 border-t",children:e.is_loaded?c.jsxs("div",{className:"flex gap-2",children:[!i&&c.jsxs(de,{variant:"outline",size:"sm",onClick:()=>r(e.model_name),className:"flex-1",children:[c.jsx(Td,{className:"h-4 w-4 mr-2"}),"Unload"]}),c.jsx(de,{size:"sm",className:"flex-1",asChild:!0,children:c.jsx("a",{href:"/playground",children:"Use in Playground"})})]}):c.jsx(de,{onClick:()=>n(e.model_name),disabled:t===e.model_name,className:"w-full",size:"sm",children:t===e.model_name?c.jsxs(c.Fragment,{children:[c.jsx(Uy,{className:"h-4 w-4 mr-2 animate-spin"}),i?"Connecting...":"Loading..."]}):c.jsxs(c.Fragment,{children:[i?c.jsx(ii,{className:"h-4 w-4 mr-2"}):c.jsx(Pd,{className:"h-4 w-4 mr-2"}),i?"Connect":"Load Model"]})})})]})]})}function OI(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_d,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsxs(xt,{className:"flex items-center gap-2",children:[c.jsx(Tb,{className:"h-5 w-5"}),"Server Configuration"]})}),c.jsx(Ve,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(bt,{className:"text-sm font-medium",children:"Backend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),c.jsxs("div",{children:[c.jsx(bt,{className:"text-sm font-medium",children:"Frontend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsxs(xt,{className:"flex items-center gap-2",children:[c.jsx(Ku,{className:"h-5 w-5"}),"Privacy & Security"]})}),c.jsx(Ve,{className:"space-y-4",children:c.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Ku,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),c.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),c.jsxs(ze,{children:[c.jsx(ot,{children:c.jsxs(xt,{className:"flex items-center gap-2",children:[c.jsx($y,{className:"h-5 w-5"}),"System Information"]})}),c.jsx(Ve,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(bt,{className:"text-sm font-medium",children:"Platform"}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx(Ae,{variant:"outline",children:"Local"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),c.jsxs("div",{children:[c.jsx(bt,{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"mt-1",children:c.jsx(Ae,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function LI(){return c.jsx(lC,{children:c.jsx(Zk,{children:c.jsxs(zr,{path:"/",element:c.jsx(Qb,{}),children:[c.jsx(zr,{index:!0,element:c.jsx(lN,{})}),c.jsx(zr,{path:"playground",element:c.jsx(mI,{})}),c.jsx(zr,{path:"models",element:c.jsx(II,{})}),c.jsx(zr,{path:"settings",element:c.jsx(OI,{})})]})})})}Qa.createRoot(document.getElementById("root")).render(c.jsx(Dt.StrictMode,{children:c.jsx(LI,{})})); +//# sourceMappingURL=index-3b8f96c4.js.map