diff --git "a/static/assets/index-6f63b786.js" "b/static/assets/index-6f63b786.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-6f63b786.js" @@ -0,0 +1,432 @@ +function W1(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 s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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 Bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yh={exports:{}},jl={},vh={exports:{}},le={};/** + * @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 Lo=Symbol.for("react.element"),G1=Symbol.for("react.portal"),K1=Symbol.for("react.fragment"),Y1=Symbol.for("react.strict_mode"),Q1=Symbol.for("react.profiler"),q1=Symbol.for("react.provider"),X1=Symbol.for("react.context"),J1=Symbol.for("react.forward_ref"),Z1=Symbol.for("react.suspense"),ew=Symbol.for("react.memo"),tw=Symbol.for("react.lazy"),Tf=Symbol.iterator;function nw(e){return e===null||typeof e!="object"?null:(e=Tf&&e[Tf]||e["@@iterator"],typeof e=="function"?e:null)}var wh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sh=Object.assign,kh={};function Si(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||wh}Si.prototype.isReactComponent={};Si.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bh(){}bh.prototype=Si.prototype;function Bc(e,t,n){this.props=e,this.context=t,this.refs=kh,this.updater=n||wh}var $c=Bc.prototype=new bh;$c.constructor=Bc;Sh($c,Si.prototype);$c.isPureReactComponent=!0;var _f=Array.isArray,Nh=Object.prototype.hasOwnProperty,Uc={current:null},Ch={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)Nh.call(t,r)&&!Ch.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,q=_[Y];if(0>>1;Yi(Oe,k))uei(K,Oe)?(_[Y]=K,_[ue]=k,Y=ue):(_[Y]=Oe,_[ie]=k,Y=ie);else if(uei(K,k))_[Y]=K,_[ue]=k,Y=ue;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 s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],c=[],d=1,f=null,p=3,m=!1,w=!1,h=!1,S=typeof setTimeout=="function"?setTimeout:null,x=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 v(_){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=_)r(c),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(c)}}function b(_){if(h=!1,v(_),!w)if(n(u)!==null)w=!0,$(j);else{var F=n(c);F!==null&&H(b,F.startTime-_)}}function j(_,F){w=!1,h&&(h=!1,x(T),T=-1),m=!0;var k=p;try{for(v(F),f=n(u);f!==null&&(!(f.expirationTime>F)||_&&!I());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var q=Y(f.expirationTime<=F);F=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(u)&&r(u),v(F)}else r(u);f=n(u)}if(f!==null)var N=!0;else{var ie=n(c);ie!==null&&H(b,ie.startTime-F),N=!1}return N}finally{f=null,p=k,m=!1}}var C=!1,E=null,T=-1,D=5,A=-1;function I(){return!(e.unstable_now()-A_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},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(c,_),n(u)===null&&_===n(c)&&(h?(x(T),T=-1):h=!0,H(b,k-Y))):(_.sortIndex=q,t(u,_),w||m||(w=!0,$(j))),_},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(_){var F=p;return function(){var k=p;p=F;try{return _.apply(this,arguments)}finally{p=k}}}})(_h);Th.exports=_h;var pw=Th.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 mw=g,bt=pw;function z(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"),au=Object.prototype.hasOwnProperty,hw=/^[: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]*$/,Rf={},Mf={};function gw(e){return au.call(Mf,e)?!0:au.call(Rf,e)?!1:hw.test(e)?Mf[e]=!0:(Rf[e]=!0,!1)}function xw(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 yw(e,t,n,r){if(t===null||typeof t>"u"||xw(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 it(e,t,n,r,i,o,s){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=s}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new it(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){Ge[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wc=/[\-:]([a-z])/g;function Gc(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(Wc,Gc);Ge[t]=new it(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(Wc,Gc);Ge[t]=new it(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(Wc,Gc);Ge[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Kc(e,t,n,r){var i=Ge.hasOwnProperty(t)?Ge[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var u=` +`+i[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{pa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ki(e):""}function vw(e){switch(e.tag){case 5:return Ki(e.type);case 16:return Ki("Lazy");case 13:return Ki("Suspense");case 19:return Ki("SuspenseList");case 0:case 2:case 15:return e=ma(e.type,!1),e;case 11:return e=ma(e.type.render,!1),e;case 1:return e=ma(e.type,!0),e;default:return""}}function fu(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 Ur:return"Fragment";case $r:return"Portal";case uu:return"Profiler";case Yc:return"StrictMode";case cu:return"Suspense";case du:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mh:return(e.displayName||"Context")+".Consumer";case Rh:return(e._context.displayName||"Context")+".Provider";case Qc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qc:return t=e.displayName||null,t!==null?t:fu(e.type)||"Memo";case Mn:t=e._payload,e=e._init;try{return fu(e(t))}catch{}}return null}function ww(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 fu(t);case 8:return t===Yc?"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 qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sw(e){var t=Lh(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(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qo(e){e._valueTracker||(e._valueTracker=Sw(e))}function Dh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function $s(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 pu(e,t){var n=t.checked;return Ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Lf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qn(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 zh(e,t){t=t.checked,t!=null&&Kc(e,"checked",t,!1)}function mu(e,t){zh(e,t);var n=qn(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")?hu(e,t.type,n):t.hasOwnProperty("defaultValue")&&hu(e,t.type,qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Df(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 hu(e,t,n){(t!=="number"||$s(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yi=Array.isArray;function ei(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Xo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ji={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},kw=["Webkit","ms","Moz","O"];Object.keys(Ji).forEach(function(e){kw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ji[t]=Ji[e]})});function Uh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ji.hasOwnProperty(e)&&Ji[e]?(""+t).trim():t+"px"}function Vh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Uh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var bw=Ie({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 yu(e,t){if(t){if(bw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function vu(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 wu=null;function Xc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Su=null,ti=null,ni=null;function Bf(e){if(e=Fo(e)){if(typeof Su!="function")throw Error(z(280));var t=e.stateNode;t&&(t=_l(t),Su(e.stateNode,e.type,t))}}function Hh(e){ti?ni?ni.push(e):ni=[e]:ti=e}function Wh(){if(ti){var e=ti,t=ni;if(ni=ti=null,Bf(e),t)for(e=0;e>>=0,e===0?32:31-(Mw(e)/Ow|0)|0}var Jo=64,Zo=4194304;function Qi(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 Ws(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Qi(l):(o&=s,o!==0&&(r=Qi(o)))}else s=n&~i,s!==0?r=Qi(s):o!==0&&(r=Qi(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 Do(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function Fw(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=eo),Qf=String.fromCharCode(32),qf=!1;function dg(e,t){switch(e){case"keyup":return pS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function hS(e,t){switch(e){case"compositionend":return fg(t);case"keypress":return t.which!==32?null:(qf=!0,Qf);case"textInput":return e=t.data,e===Qf&&qf?null:e;default:return null}}function gS(e,t){if(Vr)return e==="compositionend"||!od&&dg(e,t)?(e=ug(),Ns=nd=zn=null,Vr=!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=ep(n)}}function gg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xg(){for(var e=window,t=$s();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$s(e.document)}return t}function sd(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 CS(e){var t=xg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gg(n.ownerDocument.documentElement,n)){if(r!==null&&sd(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=tp(n,o);var s=tp(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,Hr=null,Eu=null,no=null,Pu=!1;function np(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pu||Hr==null||Hr!==$s(r)||(r=Hr,"selectionStart"in r&&sd(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}),no&&yo(no,r)||(no=r,r=Ys(Eu,"onSelect"),0Kr||(e.current=Mu[Kr],Mu[Kr]=null,Kr--)}function Se(e,t){Kr++,Mu[Kr]=e.current,e.current=t}var Xn={},Je=nr(Xn),at=nr(!1),wr=Xn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Xn;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 ut(e){return e=e.childContextTypes,e!=null}function qs(){Pe(at),Pe(Je)}function up(e,t,n){if(Je.current!==Xn)throw Error(z(168));Se(Je,t),Se(at,n)}function jg(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(z(108,ww(e)||"Unknown",i));return Ie({},n,r)}function Xs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,wr=Je.current,Se(Je,e),Se(at,at.current),!0}function cp(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=jg(e,t,wr),r.__reactInternalMemoizedMergedChildContext=e,Pe(at),Pe(Je),Se(Je,e)):Pe(at),Se(at,n)}var pn=null,Il=!1,Pa=!1;function Eg(e){pn===null?pn=[e]:pn.push(e)}function DS(e){Il=!0,Eg(e)}function rr(){if(!Pa&&pn!==null){Pa=!0;var e=0,t=ge;try{var n=pn;for(ge=1;e>=s,i-=s,mn=1<<32-$t(t)+i|n<T?(D=E,E=null):D=E.sibling;var A=p(x,E,v[T],b);if(A===null){E===null&&(E=D);break}e&&E&&A.alternate===null&&t(x,E),y=o(A,y,T),C===null?j=A:C.sibling=A,C=A,E=D}if(T===v.length)return n(x,E),Ae&&cr(x,T),j;if(E===null){for(;TT?(D=E,E=null):D=E.sibling;var I=p(x,E,A.value,b);if(I===null){E===null&&(E=D);break}e&&E&&I.alternate===null&&t(x,E),y=o(I,y,T),C===null?j=I:C.sibling=I,C=I,E=D}if(A.done)return n(x,E),Ae&&cr(x,T),j;if(E===null){for(;!A.done;T++,A=v.next())A=f(x,A.value,b),A!==null&&(y=o(A,y,T),C===null?j=A:C.sibling=A,C=A);return Ae&&cr(x,T),j}for(E=r(x,E);!A.done;T++,A=v.next())A=m(E,x,T,A.value,b),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?T:A.key),y=o(A,y,T),C===null?j=A:C.sibling=A,C=A);return e&&E.forEach(function(P){return t(x,P)}),Ae&&cr(x,T),j}function S(x,y,v,b){if(typeof v=="object"&&v!==null&&v.type===Ur&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Qo:e:{for(var j=v.key,C=y;C!==null;){if(C.key===j){if(j=v.type,j===Ur){if(C.tag===7){n(x,C.sibling),y=i(C,v.props.children),y.return=x,x=y;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Mn&&pp(j)===C.type){n(x,C.sibling),y=i(C,v.props),y.ref=Bi(x,C,v),y.return=x,x=y;break e}n(x,C);break}else t(x,C);C=C.sibling}v.type===Ur?(y=vr(v.props.children,x.mode,b,v.key),y.return=x,x=y):(b=Is(v.type,v.key,v.props,null,x.mode,b),b.ref=Bi(x,y,v),b.return=x,x=b)}return s(x);case $r:e:{for(C=v.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(x,y.sibling),y=i(y,v.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=La(v,x.mode,b),y.return=x,x=y}return s(x);case Mn:return C=v._init,S(x,y,C(v._payload),b)}if(Yi(v))return w(x,y,v,b);if(Oi(v))return h(x,y,v,b);ss(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,v),y.return=x,x=y):(n(x,y),y=Oa(v,x.mode,b),y.return=x,x=y),s(x)):n(x,y)}return S}var mi=_g(!0),Ig=_g(!1),el=nr(null),tl=null,qr=null,cd=null;function dd(){cd=qr=tl=null}function fd(e){var t=el.current;Pe(el),e._currentValue=t}function Du(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 ii(e,t){tl=e,cd=qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(cd!==e)if(e={context:e,memoizedValue:t,next:null},qr===null){if(tl===null)throw Error(z(308));qr=e,tl.dependencies={lanes:0,firstContext:e}}else qr=qr.next=e;return t}var mr=null;function pd(e){mr===null?mr=[e]:mr.push(e)}function Rg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,pd(t)):(n.next=i.next,i.next=n),t.interleaved=n,wn(e,r)}function wn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var On=!1;function md(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mg(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 gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,wn(e,n)}return i=r.interleaved,i===null?(t.next=t,pd(r)):(t.next=i.next,i.next=t),r.interleaved=t,wn(e,n)}function js(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,Zc(e,n)}}function mp(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 s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,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 nl(e,t,n,r){var i=e.updateQueue;On=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,s===null?o=c:s.next=c,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(o!==null){var f=i.baseState;s=0,d=c=u=null,l=o;do{var p=l.lane,m=l.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,h=l;switch(p=t,m=n,h.tag){case 1:if(w=h.payload,typeof w=="function"){f=w.call(m,f,p);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=h.payload,p=typeof w=="function"?w.call(m,f,p):w,p==null)break e;f=Ie({},f,p);break e;case 2:On=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=m,u=f):d=d.next=m,s|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(d===null&&(u=f),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);br|=s,e.lanes=s,e.memoizedState=f}}function hp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ta.transition;Ta.transition={};try{e(!1),t()}finally{ge=n,Ta.transition=r}}function Xg(){return It().memoizedState}function $S(e,t,n){var r=Kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jg(e))Zg(t,n);else if(n=Rg(e,t,n,r),n!==null){var i=nt();Ut(n,e,r,i),ex(n,t,r)}}function US(e,t,n){var r=Kn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jg(e))Zg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Vt(l,s)){var u=t.interleaved;u===null?(i.next=i,pd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Rg(e,t,i,r),n!==null&&(i=nt(),Ut(n,e,r,i),ex(n,t,r))}}function Jg(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Zg(e,t){ro=il=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ex(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zc(e,n)}}var ol={readContext:_t,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},VS={readContext:_t,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:xp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ps(4194308,4,Gg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var n=qt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qt();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,_e,e),[r.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:gp,useDebugValue:kd,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=gp(!1),t=e[0];return e=BS.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,i=qt();if(Ae){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ve===null)throw Error(z(349));kr&30||zg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,xp(Bg.bind(null,r,o,e),[e]),r.flags|=2048,jo(9,Fg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=qt(),t=Ve.identifierPrefix;if(Ae){var n=hn,r=mn;n=(r&~(1<<32-$t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=No++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Jt]=t,e[So]=r,cx(e,t,!1,!1),t.stateNode=e;e:{switch(s=vu(n,r),n){case"dialog":je("cancel",e),je("close",e),i=r;break;case"iframe":case"object":case"embed":je("load",e),i=r;break;case"video":case"audio":for(i=0;ixi&&(t.flags|=128,r=!0,$i(o,!1),t.lanes=4194304)}else{if(!r)if(e=rl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$i(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ae)return Qe(t),null}else 2*Me()-o.renderingStartTime>xi&&n!==1073741824&&(t.flags|=128,r=!0,$i(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Me(),t.sibling=null,n=Te.current,Se(Te,r?n&1|2:n&1),t):(Qe(t),null);case 22:case 23:return Pd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xt&1073741824&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function XS(e,t){switch(ad(t),t.tag){case 1:return ut(t.type)&&qs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Pe(at),Pe(Je),xd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gd(t),null;case 13:if(Pe(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(Te),null;case 4:return hi(),null;case 10:return fd(t.type._context),null;case 22:case 23:return Pd(),null;case 24:return null;default:return null}}var as=!1,qe=!1,JS=typeof WeakSet=="function"?WeakSet:Set,G=null;function Xr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Gu(e,t,n){try{n()}catch(r){Re(e,t,r)}}var Pp=!1;function ZS(e,t){if(Au=Gs,e=xg(),sd(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 s=0,l=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(l=s+i),f!==o||r!==0&&f.nodeType!==3||(u=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++c===i&&(l=s),p===o&&++d===r&&(u=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tu={focusedElem:e,selectionRange:n},Gs=!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 h=w.memoizedProps,S=w.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?h:Dt(t.type,h),S);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(b){Re(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=Pp,Pp=!1,w}function io(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&&Gu(t,n,o)}i=i.next}while(i!==r)}}function Ol(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 Ku(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 px(e){var t=e.alternate;t!==null&&(e.alternate=null,px(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jt],delete t[So],delete t[Ru],delete t[OS],delete t[LS])),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 mx(e){return e.tag===5||e.tag===3||e.tag===4}function Ap(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mx(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 Yu(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=Qs));else if(r!==4&&(e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}function Qu(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(Qu(e,t,n),e=e.sibling;e!==null;)Qu(e,t,n),e=e.sibling}var He=null,Ft=!1;function Tn(e,t,n){for(n=n.child;n!==null;)hx(e,t,n),n=n.sibling}function hx(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(El,n)}catch{}switch(n.tag){case 5:qe||Xr(n,t);case 6:var r=He,i=Ft;He=null,Tn(e,t,n),He=r,Ft=i,He!==null&&(Ft?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Ft?(e=He,n=n.stateNode,e.nodeType===8?Ea(e.parentNode,n):e.nodeType===1&&Ea(e,n),go(e)):Ea(He,n.stateNode));break;case 4:r=He,i=Ft,He=n.stateNode.containerInfo,Ft=!0,Tn(e,t,n),He=r,Ft=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,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Gu(n,t,s),i=i.next}while(i!==r)}Tn(e,t,n);break;case 1:if(!qe&&(Xr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Re(n,t,l)}Tn(e,t,n);break;case 21:Tn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,Tn(e,t,n),qe=r):Tn(e,t,n);break;default:Tn(e,t,n)}}function Tp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JS),t.forEach(function(r){var i=ak.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Mt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*tk(r/1960))-r,10e?16:e,Fn===null)var r=!1;else{if(e=Fn,Fn=null,al=0,pe&6)throw Error(z(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var o=G,s=o.child;if(G.flags&16){var l=o.deletions;if(l!==null){for(var u=0;uMe()-jd?yr(e,0):Cd|=n),ct(e,t)}function bx(e,t){t===0&&(e.mode&1?(t=Zo,Zo<<=1,!(Zo&130023424)&&(Zo=4194304)):t=1);var n=nt();e=wn(e,t),e!==null&&(Do(e,t,n),ct(e,n))}function lk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bx(e,n)}function ak(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(z(314))}r!==null&&r.delete(t),bx(e,n)}var Nx;Nx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,QS(e,t,n);lt=!!(e.flags&131072)}else lt=!1,Ae&&t.flags&1048576&&Pg(t,Zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;As(e,t),e=t.pendingProps;var i=fi(t,Je.current);ii(t,n),i=vd(null,t,r,e,i,n);var o=wd();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,ut(r)?(o=!0,Xs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,md(t),i.updater=Ml,t.stateNode=i,i._reactInternals=t,Fu(t,r,e,n),t=Uu(null,t,r,!0,o,n)):(t.tag=0,Ae&&o&&ld(t),et(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(As(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ck(r),e=Dt(r,e),i){case 0:t=$u(null,t,r,e,n);break e;case 1:t=Cp(null,t,r,e,n);break e;case 11:t=bp(null,t,r,e,n);break e;case 14:t=Np(null,t,r,Dt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),$u(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),Cp(e,t,r,i,n);case 3:e:{if(lx(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Mg(e,t),nl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=gi(Error(z(423)),t),t=jp(e,t,r,n,i);break e}else if(r!==i){i=gi(Error(z(424)),t),t=jp(e,t,r,n,i);break e}else for(vt=Hn(t.stateNode.containerInfo.firstChild),St=t,Ae=!0,Bt=null,n=Ig(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pi(),r===i){t=Sn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Og(t),e===null&&Lu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,_u(r,i)?s=null:o!==null&&_u(r,o)&&(t.flags|=32),sx(e,t),et(e,t,s,n),t.child;case 6:return e===null&&Lu(t),null;case 13:return ax(e,t,n);case 4:return hd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mi(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),bp(e,t,r,i,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Se(el,r._currentValue),r._currentValue=s,o!==null)if(Vt(o.value,s)){if(o.children===i.children&&!at.current){t=Sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=gn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Du(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(z(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Du(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ii(t,n),i=_t(i),r=r(i),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,i=Dt(r,t.pendingProps),i=Dt(r.type,i),Np(e,t,r,i,n);case 15:return ix(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),As(e,t),t.tag=1,ut(r)?(e=!0,Xs(t)):e=!1,ii(t,n),tx(t,r,i),Fu(t,r,i,n),Uu(null,t,r,!0,e,n);case 19:return ux(e,t,n);case 22:return ox(e,t,n)}throw Error(z(156,t.tag))};function Cx(e,t){return Jh(e,t)}function uk(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 At(e,t,n,r){return new uk(e,t,n,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ck(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qc)return 11;if(e===qc)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=At(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 Is(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Td(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ur:return vr(n.children,i,o,t);case Yc:s=8,i|=8;break;case uu:return e=At(12,n,t,i|2),e.elementType=uu,e.lanes=o,e;case cu:return e=At(13,n,t,i),e.elementType=cu,e.lanes=o,e;case du:return e=At(19,n,t,i),e.elementType=du,e.lanes=o,e;case Oh:return Dl(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rh:s=10;break e;case Mh:s=9;break e;case Qc:s=11;break e;case qc:s=14;break e;case Mn:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=At(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function vr(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Dl(e,t,n,r){return e=At(22,e,r,t),e.elementType=Oh,e.lanes=n,e.stateNode={isHidden:!1},e}function Oa(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function La(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dk(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=ga(0),this.expirationTimes=ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _d(e,t,n,r,i,o,s,l,u){return e=new dk(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=At(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},md(o),e}function fk(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ax)}catch(e){console.error(e)}}Ax(),Ah.exports=Nt;var Ni=Ah.exports;const xk=Cl(Ni);var zp=Ni;lu.createRoot=zp.createRoot,lu.hydrateRoot=zp.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 Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Tx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vk(){return Math.random().toString(36).substr(2,8)}function Bp(e,t){return{usr:e.state,key:e.key,idx:t}}function ec(e,t,n,r){return n===void 0&&(n=null),Po({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ci(t):t,{state:n,key:t&&t.key||r||vk()})}function dl(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 Ci(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 wk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=Bn.Pop,u=null,c=d();c==null&&(c=0,s.replaceState(Po({},s.state,{idx:c}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=Bn.Pop;let S=d(),x=S==null?null:S-c;c=S,u&&u({action:l,location:h.location,delta:x})}function p(S,x){l=Bn.Push;let y=ec(h.location,S,x);n&&n(y,S),c=d()+1;let v=Bp(y,c),b=h.createHref(y);try{s.pushState(v,"",b)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(b)}o&&u&&u({action:l,location:h.location,delta:1})}function m(S,x){l=Bn.Replace;let y=ec(h.location,S,x);n&&n(y,S),c=d();let v=Bp(y,c),b=h.createHref(y);s.replaceState(v,"",b),o&&u&&u({action:l,location:h.location,delta:0})}function w(S){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof S=="string"?S:dl(S);return y=y.replace(/ $/,"%20"),ze(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let h={get action(){return l},get location(){return e(i,s)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(Fp,f),u=S,()=>{i.removeEventListener(Fp,f),u=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let x=w(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(S){return s.go(S)}};return h}var $p;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($p||($p={}));function Sk(e,t,n){return n===void 0&&(n="/"),kk(e,t,n,!1)}function kk(e,t,n,r){let i=typeof t=="string"?Ci(t):t,o=Od(i.pathname||"/",n);if(o==null)return null;let s=_x(e);bk(s);let l=null;for(let u=0;l==null&&u{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};u.relativePath.startsWith("/")&&(ze(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Qn([r,u.relativePath]),d=n.concat(u);o.children&&o.children.length>0&&(ze(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),_x(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Tk(c,o.index),routesMeta:d})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let u of Ix(o.path))i(o,s,u)}),t}function Ix(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 s=Ix(r.join("/")),l=[];return l.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...s),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function bk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_k(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Nk=/^:[\w-]+$/,Ck=3,jk=2,Ek=1,Pk=10,Ak=-2,Up=e=>e==="*";function Tk(e,t){let n=e.split("/"),r=n.length;return n.some(Up)&&(r+=Ak),t&&(r+=jk),n.filter(i=>!Up(i)).reduce((i,o)=>i+(Nk.test(o)?Ck:o===""?Ek:Pk),r)}function _k(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 Ik(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",s=[];for(let l=0;l{let{paramName:p,isOptional:m}=d;if(p==="*"){let h=l[f]||"";s=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}const w=l[f];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:e}}function Rk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Tx(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,(s,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Mk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tx(!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 Od(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 Ok(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ci(e):e;return{pathname:n?n.startsWith("/")?n:Lk(n,t):t,search:Fk(r),hash:Bk(i)}}function Lk(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 Da(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 Dk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Rx(e,t){let n=Dk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Mx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ci(e):(i=Po({},e),ze(!i.pathname||!i.pathname.includes("?"),Da("?","pathname","search",i)),ze(!i.pathname||!i.pathname.includes("#"),Da("#","pathname","hash",i)),ze(!i.search||!i.search.includes("#"),Da("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(s==null)l=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}l=f>=0?t[f]:"/"}let u=Ok(i,l),c=s&&s!=="/"&&s.endsWith("/"),d=(o||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Qn=e=>e.join("/").replace(/\/\/+/g,"/"),zk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Fk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Bk=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 Ox=["post","put","patch","delete"];new Set(Ox);const Uk=["get",...Ox];new Set(Uk);/** + * 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 Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),g.useCallback(function(c,d){if(d===void 0&&(d={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let f=Mx(c,JSON.parse(s),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Qn([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,o,e])}const Kk=g.createContext(null);function Yk(e){let t=g.useContext(ir).outlet;return t&&g.createElement(Kk.Provider,{value:e},t)}function zx(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Ir),{matches:i}=g.useContext(ir),{pathname:o}=Uo(),s=JSON.stringify(Rx(i,r.v7_relativeSplatPath));return g.useMemo(()=>Mx(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function Qk(e,t){return qk(e,t)}function qk(e,t,n,r){$o()||ze(!1);let{navigator:i}=g.useContext(Ir),{matches:o}=g.useContext(ir),s=o[o.length-1],l=s?s.params:{};s&&s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let c=Uo(),d;if(t){var f;let S=typeof t=="string"?Ci(t):t;u==="/"||(f=S.pathname)!=null&&f.startsWith(u)||ze(!1),d=S}else d=c;let p=d.pathname||"/",m=p;if(u!=="/"){let S=u.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=Sk(e,{pathname:m}),h=tb(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Qn([u,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Qn([u,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&h?g.createElement(Ul.Provider,{value:{location:Ao({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Bn.Pop}},h):h}function Xk(){let e=ob(),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 g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,o)}const Jk=g.createElement(Xk,null);class Zk extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(ir.Provider,{value:this.props.routeContext},g.createElement(Lx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eb(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Ld);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(ir.Provider,{value:t},r)}function tb(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 s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||ze(!1),s=s.slice(0,Math.min(s.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((d,f,p)=>{let m,w=!1,h=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,h=f.route.errorElement||Jk,u&&(c<0&&p===0?(lb("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=f.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,p+1)),y=()=>{let v;return m?v=h:w?v=S:f.route.Component?v=g.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,g.createElement(eb,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?g.createElement(Zk,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var Fx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Fx||{}),fl=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}(fl||{});function nb(e){let t=g.useContext(Ld);return t||ze(!1),t}function rb(e){let t=g.useContext(Vk);return t||ze(!1),t}function ib(e){let t=g.useContext(ir);return t||ze(!1),t}function Bx(e){let t=ib(),n=t.matches[t.matches.length-1];return n.route.id||ze(!1),n.route.id}function ob(){var e;let t=g.useContext(Lx),n=rb(fl.UseRouteError),r=Bx(fl.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sb(){let{router:e}=nb(Fx.UseNavigateStable),t=Bx(fl.UseNavigateStable),n=g.useRef(!1);return Dx(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ao({fromRouteId:t},o)))},[e,t])}const Hp={};function lb(e,t,n){!t&&!Hp[e]&&(Hp[e]=!0)}function ab(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 ub(e){return Yk(e.context)}function Qt(e){ze(!1)}function cb(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Bn.Pop,navigator:o,static:s=!1,future:l}=e;$o()&&ze(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:o,static:s,future:Ao({v7_relativeSplatPath:!1},l)}),[u,l,o,s]);typeof r=="string"&&(r=Ci(r));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:w="default"}=r,h=g.useMemo(()=>{let S=Od(d,u);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:w},navigationType:i}},[u,d,f,p,m,w,i]);return h==null?null:g.createElement(Ir.Provider,{value:c},g.createElement(Ul.Provider,{children:n,value:h}))}function db(e){let{children:t,location:n}=e;return Qk(tc(t),n)}new Promise(()=>{});function tc(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let o=[...t,i];if(r.type===g.Fragment){n.push.apply(n,tc(r.props.children,o));return}r.type!==Qt&&ze(!1),!r.props.index||!r.props.children||ze(!1);let s={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&&(s.children=tc(r.props.children,o)),n.push(s)}),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 nc(){return nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function pb(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mb(e,t){return e.button===0&&(!t||t==="_self")&&!pb(e)}const hb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gb="6";try{window.__reactRouterVersion=gb}catch{}const xb="startTransition",Wp=Hc[xb];function yb(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=yk({window:i,v5Compat:!0}));let s=o.current,[l,u]=g.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},d=g.useCallback(f=>{c&&Wp?Wp(()=>u(f)):u(f)},[u,c]);return g.useLayoutEffect(()=>s.listen(d),[s,d]),g.useEffect(()=>ab(r),[r]),g.createElement(cb,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const vb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sb=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:l,target:u,to:c,preventScrollReset:d,viewTransition:f}=t,p=fb(t,hb),{basename:m}=g.useContext(Ir),w,h=!1;if(typeof c=="string"&&wb.test(c)&&(w=c,vb))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),j=Od(b.pathname,m);b.origin===v.origin&&j!=null?c=j+b.search+b.hash:h=!0}catch{}let S=Hk(c,{relative:i}),x=kb(c,{replace:s,state:l,target:u,preventScrollReset:d,relative:i,viewTransition:f});function y(v){r&&r(v),v.defaultPrevented||x(v)}return g.createElement("a",nc({},p,{href:w||S,onClick:h||o?r:y,ref:n,target:u}))});var Gp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Gp||(Gp={}));var Kp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Kp||(Kp={}));function kb(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,viewTransition:l}=t===void 0?{}:t,u=Wk(),c=Uo(),d=zx(e,{relative:s});return g.useCallback(f=>{if(mb(f,n)){f.preventDefault();let p=r!==void 0?r:dl(c)===dl(d);u(e,{replace:p,state:i,preventScrollReset:o,relative:s,viewTransition:l})}},[c,u,d,r,i,n,e,o,s,l])}function $x(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(s){var l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set:function(s,l){n.has(s)?n.set(s,l):i(s,l)}}}var Wx="!";function Tb(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(s){for(var l=[],u=0,c=0,d,f=0;fc?d-c:void 0;return{modifiers:l,hasImportantModifier:w,baseClassName:h,maybePostfixModifierPosition:S}}}function _b(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 Ib(e){return{cache:Ab(e.cacheSize),splitModifiers:Tb(e),...Nb(e)}}var Rb=/\s+/;function Mb(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(Rb).map(function(s){var l=n(s),u=l.modifiers,c=l.hasImportantModifier,d=l.baseClassName,f=l.maybePostfixModifierPosition,p=r(f?d.substring(0,f):d),m=!!f;if(!p){if(!f)return{isTailwindClass:!1,originalClassName:s};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:s};m=!1}var w=_b(u).join(":"),h=c?w+Wx:w;return{isTailwindClass:!0,modifierId:h,classGroupId:p,originalClassName:s,hasPostfixModifier:m}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var l=s.modifierId,u=s.classGroupId,c=s.hasPostfixModifier,d=l+u;return o.has(d)?!1:(o.add(d),i(u,c).forEach(function(f){return o.add(l+f)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(" ")}function Ob(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Xp=e=>{const t=Jb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Zb=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 eN={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 tN=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},u)=>g.createElement("svg",{ref:u,...eN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yx("lucide",i),...!o&&!Zb(l)&&{"aria-hidden":"true"},...l},[...s.map(([c,d])=>g.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ee=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(tN,{ref:o,iconNode:t,className:Yx(`lucide-${Xb(Xp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Xp(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 nN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rN=ee("arrow-left",nN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],za=ee("arrow-right",iN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oN=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Qx=ee("award",oN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["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"}]],Vl=ee("book-open",sN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["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"}]],dt=ee("bot",lN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aN=[["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"}]],on=ee("brain",aN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cN=ee("check",uN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zd=ee("chevron-down",dN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pN=ee("chevron-up",fN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],hN=ee("circle-check-big",mN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],pl=ee("cloud",gN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xN=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],yN=ee("code",xN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vN=[["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"}]],Fd=ee("copy",vN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wN=[["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"}]],SN=ee("cpu",wN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kN=[["path",{d:"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"}]],Hl=ee("download",kN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bN=[["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"}]],qx=ee("hard-drive",bN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NN=[["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"}]],Zr=ee("heart",NN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CN=[["path",{d:"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"}]],Xx=ee("history",CN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jN=[["path",{d:"M15 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"}]],EN=ee("house",jN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bd=ee("info",PN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],oc=ee("loader-circle",AN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TN=[["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"}]],kn=ee("message-square",TN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _N=[["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"}]],Jx=ee("panel-left-close",_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 IN=[["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"}]],Zx=ee("panel-left-open",IN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xr=ee("plus",RN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MN=[["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"}]],ON=ee("rotate-ccw",MN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LN=[["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"}]],ey=ee("save",LN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DN=[["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"}]],zN=ee("send",DN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FN=[["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"}]],BN=ee("server",FN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $N=[["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"}]],Vo=ee("settings",$N);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UN=[["path",{d:"M12 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"}]],ty=ee("share",UN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VN=[["path",{d:"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"}]],sc=ee("shield",VN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HN=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],To=ee("sparkles",HN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],GN=ee("square",WN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KN=[["path",{d:"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"}]],ny=ee("star",KN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YN=[["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"}]],Wl=ee("trash-2",YN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],qN=ee("trending-up",QN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XN=[["path",{d:"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"}]],JN=ee("triangle-alert",XN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZN=[["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"}]],eC=ee("upload",ZN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tC=[["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"}]],ry=ee("user",tC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nC=[["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"}]],_o=ee("users",nC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],iC=ee("wrench",rC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oC=[["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"}]],yi=ee("zap",oC),sC=[{name:"Home",href:"/",icon:EN,description:"Overview and getting started"},{name:"Chat",href:"/chat",icon:kn,description:"Chat with your AI assistants"},{name:"Assistant Builder",href:"/assistant-builder",icon:iC,description:"Create and customize AI assistants"},{name:"My Assistants",href:"/assistants",icon:dt,description:"Manage your saved assistants"},{name:"Community",href:"/community",icon:_o,description:"Discover community templates"},{name:"Models",href:"/models",icon:Vl,description:"Manage AI models"},{name:"Settings",href:"/settings",icon:Vo,description:"Application settings"}];function lC(){const e=Uo();return a.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:a.jsx(on,{className:"h-5 w-5 text-primary-foreground"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),a.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:a.jsxs("div",{children:[a.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),a.jsx("nav",{className:"space-y-1",children:sC.map(t=>{const n=e.pathname===t.href;return a.jsxs(Sb,{to:t.href,className:de("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx(t.icon,{className:"h-4 w-4"}),a.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function aC(){return a.jsxs("div",{className:"flex h-screen bg-background",children:[a.jsx("div",{className:"w-64 border-r",children:a.jsx(lC,{})}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(ub,{})})]})}const se=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));se.displayName="Card";const Xe=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("flex flex-col space-y-1.5 p-6",e),...t}));Xe.displayName="CardHeader";const tt=g.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:de("text-2xl font-semibold leading-none tracking-tight",e),...t}));tt.displayName="CardTitle";const uC=g.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:de("text-sm text-muted-foreground",e),...t}));uC.displayName="CardDescription";const fe=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("p-6 pt-0",e),...t}));fe.displayName="CardContent";const cC=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:de("flex items-center p-6 pt-0",e),...t}));cC.displayName="CardFooter";function Jp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Jp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...s}=r,l=g.Children.toArray(o),u=l.find(mC);if(u){const c=u.props.children,d=l.map(f=>f===u?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:f);return a.jsx(t,{...s,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,d):null})}return a.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var dC=vi("Slot");function fC(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const s=gC(i),l=hC(o,i.props);return i.type!==g.Fragment&&(l.ref=r?iy(r,s):s),g.cloneElement(i,l)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oy=Symbol("radix.slottable");function pC(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=oy,t}function mC(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oy}function hC(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]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function gC(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 Zp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,em=Ux,$d=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return em(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const p=Zp(d)||Zp(f);return i[c][p]}),l=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(w=>{let[h,S]=w;return Array.isArray(S)?S.includes({...o,...l}[h]):{...o,...l}[h]===S})?[...c,f,p]:c},[]);return em(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Ud=$d("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"}}),Z=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?dC:"button";return a.jsx(s,{className:de(Ud({variant:t,size:n,className:e})),ref:o,...i})});Z.displayName="Button";const xC=$d("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 Ee({className:e,variant:t,...n}){return a.jsx("div",{className:de(xC({variant:t}),e),...n})}function yC(){const[e,t]=g.useState({models:0,assistants:0,isOnline:!1});g.useEffect(()=>{n(),r()},[]);const n=()=>{try{const l=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(u=>({...u,assistants:l.length}))}catch(l){console.error("Failed to load stats:",l)}},r=async()=>{try{const l=`${window.location.protocol}//${window.location.host}`,u=await fetch(`${l}/models`);if(u.ok){const c=await u.json();t(d=>{var f;return{...d,models:((f=c.models)==null?void 0:f.length)||0,isOnline:!0}})}}catch(l){console.error("System check failed:",l),t(u=>({...u,isOnline:!1}))}},i=[{title:"Quick Start",subtitle:"New to AI assistants?",description:"Start with pre-built templates from our community",icon:kn,href:"/community",color:"bg-blue-600",primary:!0,badge:"Recommended",steps:["Browse templates","Select one that fits","Start chatting immediately"]},{title:"Custom Assistant",subtitle:"Need something specific?",description:"Create your own AI assistant with custom instructions",icon:dt,href:"/assistant-builder",color:"bg-purple-600",primary:!0,badge:"Advanced",steps:["Define your assistant","Set parameters","Test and refine"]},{title:"Quick Chat",subtitle:"Already have assistants?",description:"Jump directly into conversations with your saved assistants",icon:yi,href:"/chat",color:"bg-green-600",primary:!0,badge:"Fast",steps:["Select assistant","Start conversation","Get instant results"]}],o=[{title:"Manage Models",description:"Configure AI models and settings",icon:Vl,href:"/models",color:"bg-gray-600"},{title:"My Assistants",description:"View and organize your saved assistants",icon:_o,href:"/assistants",color:"bg-orange-600"}],s=[{icon:sc,title:"Privacy First",description:"Local processing with complete data control"},{icon:yi,title:"High Performance",description:"Optimized for speed and efficiency"},{icon:SN,title:"Local & Cloud",description:"Run models locally or access cloud APIs"},{icon:on,title:"Advanced Models",description:"Support for latest AI capabilities"}];return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-100 border-b",children:a.jsx("div",{className:"max-w-6xl mx-auto px-6 py-16",children:a.jsxs("div",{className:"text-center space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[a.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center",children:a.jsx(on,{className:"h-7 w-7 text-white"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Edge LLM"}),a.jsx(Ee,{variant:e.isOnline?"default":"secondary",className:"text-xs",children:e.isOnline?"Online":"Offline"})]})]}),a.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Professional AI platform for local and cloud language models. Complete privacy, advanced features, industrial-grade performance."}),a.jsxs("div",{className:"flex items-center justify-center gap-4 pt-4",children:[a.jsxs(Z,{size:"lg",onClick:()=>window.location.href="/community",className:"flex items-center gap-2",children:[a.jsx(kn,{className:"h-5 w-5"}),"Get Started",a.jsx(za,{className:"h-4 w-4"})]}),a.jsxs(Z,{size:"lg",variant:"outline",onClick:()=>window.location.href="/assistant-builder",children:[a.jsx(dt,{className:"h-5 w-5 mr-2"}),"Create Assistant"]})]})]})})}),a.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-12 space-y-12",children:[a.jsxs("section",{children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h2",{className:"text-2xl font-semibold mb-3",children:"Choose Your Path"}),a.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Select the workflow that best matches your experience level and needs"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-8",children:i.map(l=>a.jsxs(se,{className:"hover:shadow-xl transition-all duration-300 cursor-pointer hover:-translate-y-2 border-2 border-transparent hover:border-blue-200 relative overflow-hidden",onClick:()=>window.location.href=l.href,children:[a.jsx("div",{className:"absolute top-4 right-4",children:a.jsx(Ee,{className:"bg-white text-gray-700 border border-gray-200 shadow-sm",children:l.badge})}),a.jsxs(fe,{className:"p-8 text-center space-y-6",children:[a.jsx("div",{className:`w-16 h-16 ${l.color} rounded-2xl flex items-center justify-center mx-auto`,children:a.jsx(l.icon,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-xl mb-1",children:l.title}),a.jsx("p",{className:"text-sm text-blue-600 font-medium mb-3",children:l.subtitle}),a.jsx("p",{className:"text-gray-600 text-sm leading-relaxed mb-4",children:l.description})]}),a.jsx("div",{className:"space-y-2 text-left",children:l.steps.map((u,c)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx("div",{className:"w-5 h-5 bg-gray-100 rounded-full flex items-center justify-center text-xs font-medium",children:c+1}),a.jsx("span",{children:u})]},c))}),a.jsxs(Z,{className:"w-full",size:"lg",children:["Get Started",a.jsx(za,{className:"h-4 w-4 ml-2"})]})]})]},l.title))}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:o.map(l=>a.jsx(se,{className:"hover:shadow-md transition-all duration-200 cursor-pointer hover:-translate-y-1",onClick:()=>window.location.href=l.href,children:a.jsxs(fe,{className:"p-4 flex items-center gap-4",children:[a.jsx("div",{className:`w-12 h-12 ${l.color} rounded-lg flex items-center justify-center`,children:a.jsx(l.icon,{className:"h-6 w-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-base",children:l.title}),a.jsx("p",{className:"text-sm text-gray-600",children:l.description})]}),a.jsx(za,{className:"h-5 w-5 text-gray-400"})]})},l.title))})]}),a.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(se,{children:a.jsxs(fe,{className:"p-6 text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-blue-600 mb-2",children:e.models}),a.jsx("div",{className:"text-sm text-gray-600",children:"Available Models"})]})}),a.jsx(se,{children:a.jsxs(fe,{className:"p-6 text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-purple-600 mb-2",children:e.assistants}),a.jsx("div",{className:"text-sm text-gray-600",children:"My Assistants"})]})}),a.jsx(se,{children:a.jsxs(fe,{className:"p-6 text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-green-600 mb-2",children:"5"}),a.jsx("div",{className:"text-sm text-gray-600",children:"Community Templates"})]})})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-6 text-center",children:"Core Features"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:s.map(l=>a.jsx(se,{className:"text-center",children:a.jsxs(fe,{className:"p-6 space-y-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mx-auto",children:a.jsx(l.icon,{className:"h-6 w-6 text-gray-700"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold",children:l.title}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]})]})},l.title))})]}),a.jsx("section",{className:"bg-gradient-to-r from-blue-50 to-purple-50 rounded-2xl p-8 border border-blue-200",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-xl flex items-center justify-center mx-auto mb-4",children:a.jsx(To,{className:"h-6 w-6 text-white"})}),a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"New to AI Assistants?"}),a.jsxs("p",{className:"text-gray-600 mb-6 max-w-2xl mx-auto",children:["We recommend starting with our ",a.jsx("strong",{children:"Community Templates"})," to see what's possible, then try creating your own custom assistant when you're ready."]}),a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsxs(Z,{size:"lg",onClick:()=>window.location.href="/community",children:[a.jsx(_o,{className:"h-4 w-4 mr-2"}),"Browse Templates"]}),a.jsxs(Z,{size:"lg",variant:"outline",onClick:()=>window.location.href="/assistant-builder",children:[a.jsx(dt,{className:"h-4 w-4 mr-2"}),"Create Assistant"]})]})]})})]})]})}function ml(e,[t,n]){return Math.min(n,Math.max(t,e))}function te(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 vC(e,t){const n=g.createContext(t),r=o=>{const{children:s,...l}=o,u=g.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=g.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function jn(e,t=[]){let n=[];function r(o,s){const l=g.createContext(s),u=n.length;n=[...n,s];const c=f=>{var x;const{scope:p,children:m,...w}=f,h=((x=p==null?void 0:p[e])==null?void 0:x[u])||l,S=g.useMemo(()=>w,Object.values(w));return a.jsx(h.Provider,{value:S,children:m})};c.displayName=o+"Provider";function d(f,p){var h;const m=((h=p==null?void 0:p[e])==null?void 0:h[u])||l,w=g.useContext(m);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const i=()=>{const o=n.map(s=>g.createContext(s));return function(l){const u=(l==null?void 0:l[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,wC(i,...t)]}function wC(...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 s=r.reduce((l,{useScope:u,scopeName:c})=>{const f=u(o)[`__scope${c}`];return{...l,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ke=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},SC=Hc[" useInsertionEffect ".trim().toString()]||Ke;function Cr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=kC({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const d=g.useRef(e!==void 0);g.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const c=g.useCallback(d=>{var f;if(l){const p=bC(d)?d(e):d;p!==e&&((f=s.current)==null||f.call(s,p))}else o(d)},[l,e,o,s]);return[u,c]}function kC({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return SC(()=>{o.current=t},[t]),g.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function bC(e){return typeof e=="function"}var NC=g.createContext(void 0);function Gl(e){const t=g.useContext(NC);return e||t||"ltr"}function sy(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ly(e){const[t,n]=g.useState(void 0);return Ke(()=>{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 s,l;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var CC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=CC.reduce((e,t)=>{const n=vi(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:s,...l}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jC(e,t){e&&Ni.flushSync(()=>e.dispatchEvent(t))}function Vd(e){const t=e+"CollectionProvider",[n,r]=jn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:S,children:x}=h,y=zt.useRef(null),v=zt.useRef(new Map).current;return a.jsx(i,{scope:S,itemMap:v,collectionRef:y,children:x})};s.displayName=t;const l=e+"CollectionSlot",u=vi(l),c=zt.forwardRef((h,S)=>{const{scope:x,children:y}=h,v=o(l,x),b=he(S,v.collectionRef);return a.jsx(u,{ref:b,children:y})});c.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=vi(d),m=zt.forwardRef((h,S)=>{const{scope:x,children:y,...v}=h,b=zt.useRef(null),j=he(S,b),C=o(d,x);return zt.useEffect(()=>(C.itemMap.set(b,{ref:b,...v}),()=>void C.itemMap.delete(b))),a.jsx(p,{[f]:"",ref:j,children:y})});m.displayName=d;function w(h){const S=o(e+"CollectionConsumer",h);return zt.useCallback(()=>{const y=S.collectionRef.current;if(!y)return[];const v=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:s,Slot:c,ItemSlot:m},w,r]}var ay=["PageUp","PageDown"],uy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],cy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ji="Slider",[lc,EC,PC]=Vd(ji),[dy,QR]=jn(ji,[PC]),[AC,Kl]=dy(ji),fy=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[r],value:d,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...h}=e,S=g.useRef(new Set),x=g.useRef(0),v=s==="horizontal"?TC:_C,[b=[],j]=Cr({prop:d,defaultProp:c,onChange:I=>{var V;(V=[...S.current][x.current])==null||V.focus(),f(I)}}),C=g.useRef(b);function E(I){const P=LC(b,I);A(I,P)}function T(I){A(I,x.current)}function D(){const I=C.current[x.current];b[x.current]!==I&&p(b)}function A(I,P,{commit:V}={commit:!1}){const O=BC(o),L=$C(Math.round((I-r)/o)*o+r,O),$=ml(L,[r,i]);j((H=[])=>{const _=MC(H,$,P);if(FC(_,u*o)){x.current=_.indexOf($);const F=String(_)!==String(H);return F&&V&&p(_),F?_:H}else return H})}return a.jsx(AC,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:x,thumbs:S.current,values:b,orientation:s,form:w,children:a.jsx(lc.Provider,{scope:e.__scopeSlider,children:a.jsx(lc.Slot,{scope:e.__scopeSlider,children:a.jsx(v,{"aria-disabled":l,"data-disabled":l?"":void 0,...h,ref:t,onPointerDown:te(h.onPointerDown,()=>{l||(C.current=b)}),min:r,max:i,inverted:m,onSlideStart:l?void 0:E,onSlideMove:l?void 0:T,onSlideEnd:l?void 0:D,onHomeKeyDown:()=>!l&&A(r,0,{commit:!0}),onEndKeyDown:()=>!l&&A(i,b.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:P})=>{if(!l){const L=ay.includes(I.key)||I.shiftKey&&uy.includes(I.key)?10:1,$=x.current,H=b[$],_=o*L*P;A(H+_,$,{commit:!0})}}})})})})});fy.displayName=ji;var[py,my]=dy(ji,{startEdge:"left",endEdge:"right",size:"width",direction:1}),TC=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:s,onSlideMove:l,onSlideEnd:u,onStepKeyDown:c,...d}=e,[f,p]=g.useState(null),m=he(t,v=>p(v)),w=g.useRef(void 0),h=Gl(i),S=h==="ltr",x=S&&!o||!S&&o;function y(v){const b=w.current||f.getBoundingClientRect(),j=[0,b.width],E=Hd(j,x?[n,r]:[r,n]);return w.current=b,E(v-b.left)}return a.jsx(py,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:a.jsx(hy,{dir:h,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const b=y(v.clientX);s==null||s(b)},onSlideMove:v=>{const b=y(v.clientX);l==null||l(b)},onSlideEnd:()=>{w.current=void 0,u==null||u()},onStepKeyDown:v=>{const j=cy[x?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:j?-1:1})}})})}),_C=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...c}=e,d=g.useRef(null),f=he(t,d),p=g.useRef(void 0),m=!i;function w(h){const S=p.current||d.current.getBoundingClientRect(),x=[0,S.height],v=Hd(x,m?[r,n]:[n,r]);return p.current=S,v(h-S.top)}return a.jsx(py,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:a.jsx(hy,{"data-orientation":"vertical",...c,ref:f,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const S=w(h.clientY);o==null||o(S)},onSlideMove:h=>{const S=w(h.clientY);s==null||s(S)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:h=>{const x=cy[m?"from-bottom":"from-top"].includes(h.key);u==null||u({event:h,direction:x?-1:1})}})})}),hy=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...c}=e,d=Kl(ji,n);return a.jsx(re.span,{...c,ref:t,onKeyDown:te(e.onKeyDown,f=>{f.key==="Home"?(s(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):ay.concat(uy).includes(f.key)&&(u(f),f.preventDefault())}),onPointerDown:te(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(p)?p.focus():r(f)}),onPointerMove:te(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:te(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),o(f))})})}),gy="SliderTrack",xy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Kl(gy,n);return a.jsx(re.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});xy.displayName=gy;var ac="SliderRange",yy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Kl(ac,n),o=my(ac,n),s=g.useRef(null),l=he(t,s),u=i.values.length,c=i.values.map(p=>Sy(p,i.min,i.max)),d=u>1?Math.min(...c):0,f=100-Math.max(...c);return a.jsx(re.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:l,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:f+"%"}})});yy.displayName=ac;var uc="SliderThumb",vy=g.forwardRef((e,t)=>{const n=EC(e.__scopeSlider),[r,i]=g.useState(null),o=he(t,l=>i(l)),s=g.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return a.jsx(IC,{...e,ref:o,index:s})}),IC=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,s=Kl(uc,n),l=my(uc,n),[u,c]=g.useState(null),d=he(t,y=>c(y)),f=u?s.form||!!u.closest("form"):!0,p=ly(u),m=s.values[r],w=m===void 0?0:Sy(m,s.min,s.max),h=OC(r,s.values.length),S=p==null?void 0:p[l.size],x=S?DC(S,w,l.direction):0;return g.useEffect(()=>{if(u)return s.thumbs.add(u),()=>{s.thumbs.delete(u)}},[u,s.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${w}% + ${x}px)`},children:[a.jsx(lc.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(re.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:te(e.onFocus,()=>{s.valueIndexToChangeRef.current=r})})}),f&&a.jsx(wy,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:m},r)]})});vy.displayName=uc;var RC="RadioBubbleInput",wy=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=he(i,r),s=sy(t);return g.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&d){const f=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[s,t]),a.jsx(re.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});wy.displayName=RC;function MC(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function Sy(e,t,n){const o=100/(n-t)*(e-t);return ml(o,[0,100])}function OC(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function LC(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 DC(e,t,n){const r=e/2,o=Hd([0,50],[0,r]);return(r-o(t)*n)*n}function zC(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function FC(e,t){if(t>0){const n=zC(e);return Math.min(...n)>=t}return!0}function Hd(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 BC(e){return(String(e).split(".")[1]||"").length}function $C(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var ky=fy,UC=xy,VC=yy,HC=vy;const Io=g.forwardRef(({className:e,...t},n)=>a.jsxs(ky,{ref:n,className:de("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(UC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(VC,{className:"absolute h-full bg-primary"})}),a.jsx(HC,{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"})]}));Io.displayName=ky.displayName;var WC="Label",by=g.forwardRef((e,t)=>a.jsx(re.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())}}));by.displayName=WC;var Ny=by;const GC=$d("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ue=g.forwardRef(({className:e,...t},n)=>a.jsx(Ny,{ref:n,className:de(GC(),e),...t}));Ue.displayName=Ny.displayName;const hl=g.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:de("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}));hl.displayName="Input";const Yl=g.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:de("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}));Yl.displayName="Textarea";function Jn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function KC(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var YC="DismissableLayer",cc="dismissableLayer.update",QC="dismissableLayer.pointerDownOutside",qC="dismissableLayer.focusOutside",tm,Cy=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,c=g.useContext(Cy),[d,f]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=he(t,E=>f(E)),h=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(S),y=d?h.indexOf(d):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,b=y>=x,j=ZC(E=>{const T=E.target,D=[...c.branches].some(A=>A.contains(T));!b||D||(i==null||i(E),s==null||s(E),E.defaultPrevented||l==null||l())},p),C=ej(E=>{const T=E.target;[...c.branches].some(A=>A.contains(T))||(o==null||o(E),s==null||s(E),E.defaultPrevented||l==null||l())},p);return KC(E=>{y===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},p),g.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tm=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),nm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=tm)}},[d,p,n,c]),g.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),nm())},[d,c]),g.useEffect(()=>{const E=()=>m({});return document.addEventListener(cc,E),()=>document.removeEventListener(cc,E)},[]),a.jsx(re.div,{...u,ref:w,style:{pointerEvents:v?b?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,C.onFocusCapture),onBlurCapture:te(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,j.onPointerDownCapture)})});Wd.displayName=YC;var XC="DismissableLayerBranch",JC=g.forwardRef((e,t)=>{const n=g.useContext(Cy),r=g.useRef(null),i=he(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(re.div,{...e,ref:i})});JC.displayName=XC;function ZC(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){jy(QC,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ej(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&jy(qC,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 nm(){const e=new CustomEvent(cc);document.dispatchEvent(e)}function jy(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?jC(i,o):i.dispatchEvent(o)}var Fa=0;function Ey(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rm()),document.body.insertAdjacentElement("beforeend",e[1]??rm()),Fa++,()=>{Fa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Fa--}},[])}function rm(){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 Ba="focusScope.autoFocusOnMount",$a="focusScope.autoFocusOnUnmount",im={bubbles:!1,cancelable:!0},tj="FocusScope",Gd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[l,u]=g.useState(null),c=Jn(i),d=Jn(o),f=g.useRef(null),p=he(t,h=>u(h)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let h=function(v){if(m.paused||!l)return;const b=v.target;l.contains(b)?f.current=b:Rn(f.current,{select:!0})},S=function(v){if(m.paused||!l)return;const b=v.relatedTarget;b!==null&&(l.contains(b)||Rn(f.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const j of v)j.removedNodes.length>0&&Rn(l)};document.addEventListener("focusin",h),document.addEventListener("focusout",S);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",S),y.disconnect()}}},[r,l,m.paused]),g.useEffect(()=>{if(l){sm.add(m);const h=document.activeElement;if(!l.contains(h)){const x=new CustomEvent(Ba,im);l.addEventListener(Ba,c),l.dispatchEvent(x),x.defaultPrevented||(nj(lj(Py(l)),{select:!0}),document.activeElement===h&&Rn(l))}return()=>{l.removeEventListener(Ba,c),setTimeout(()=>{const x=new CustomEvent($a,im);l.addEventListener($a,d),l.dispatchEvent(x),x.defaultPrevented||Rn(h??document.body,{select:!0}),l.removeEventListener($a,d),sm.remove(m)},0)}}},[l,c,d,m]);const w=g.useCallback(h=>{if(!n&&!r||m.paused)return;const S=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(S&&x){const y=h.currentTarget,[v,b]=rj(y);v&&b?!h.shiftKey&&x===b?(h.preventDefault(),n&&Rn(v,{select:!0})):h.shiftKey&&x===v&&(h.preventDefault(),n&&Rn(b,{select:!0})):x===y&&h.preventDefault()}},[n,r,m.paused]);return a.jsx(re.div,{tabIndex:-1,...s,ref:p,onKeyDown:w})});Gd.displayName=tj;function nj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rn(r,{select:t}),document.activeElement!==n)return}function rj(e){const t=Py(e),n=om(t,e),r=om(t.reverse(),e);return[n,r]}function Py(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function om(e,t){for(const n of e)if(!ij(n,{upTo:t}))return n}function ij(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 oj(e){return e instanceof HTMLInputElement&&"select"in e}function Rn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&oj(e)&&t&&e.select()}}var sm=sj();function sj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lm(e,t),e.unshift(t)},remove(t){var n;e=lm(e,t),(n=e[0])==null||n.resume()}}}function lm(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lj(e){return e.filter(t=>t.tagName!=="A")}var aj=Hc[" useId ".trim().toString()]||(()=>{}),uj=0;function xn(e){const[t,n]=g.useState(aj());return Ke(()=>{e||n(r=>r??String(uj++))},[e]),e||(t?`radix-${t}`:"")}const cj=["top","right","bottom","left"],Zn=Math.min,yt=Math.max,gl=Math.round,fs=Math.floor,sn=e=>({x:e,y:e}),dj={left:"right",right:"left",bottom:"top",top:"bottom"},fj={start:"end",end:"start"};function dc(e,t,n){return yt(e,Zn(t,n))}function bn(e,t){return typeof e=="function"?e(t):e}function Nn(e){return e.split("-")[0]}function Ei(e){return e.split("-")[1]}function Kd(e){return e==="x"?"y":"x"}function Yd(e){return e==="y"?"height":"width"}const pj=new Set(["top","bottom"]);function tn(e){return pj.has(Nn(e))?"y":"x"}function Qd(e){return Kd(tn(e))}function mj(e,t,n){n===void 0&&(n=!1);const r=Ei(e),i=Qd(e),o=Yd(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=xl(s)),[s,xl(s)]}function hj(e){const t=xl(e);return[fc(e),t,fc(t)]}function fc(e){return e.replace(/start|end/g,t=>fj[t])}const am=["left","right"],um=["right","left"],gj=["top","bottom"],xj=["bottom","top"];function yj(e,t,n){switch(e){case"top":case"bottom":return n?t?um:am:t?am:um;case"left":case"right":return t?gj:xj;default:return[]}}function vj(e,t,n,r){const i=Ei(e);let o=yj(Nn(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(fc)))),o}function xl(e){return e.replace(/left|right|bottom|top/g,t=>dj[t])}function wj(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ay(e){return typeof e!="number"?wj(e):{top:e,right:e,bottom:e,left:e}}function yl(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 cm(e,t,n){let{reference:r,floating:i}=e;const o=tn(t),s=Qd(t),l=Yd(s),u=Nn(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[l]/2-i[l]/2;let m;switch(u){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Ei(t)){case"start":m[s]-=p*(n&&c?-1:1);break;case"end":m[s]+=p*(n&&c?-1:1);break}return m}const Sj=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=cm(c,r,u),p=r,m={},w=0;for(let h=0;h({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:u}=t,{element:c,padding:d=0}=bn(e,t)||{};if(c==null)return{};const f=Ay(d),p={x:n,y:r},m=Qd(i),w=Yd(m),h=await s.getDimensions(c),S=m==="y",x=S?"top":"left",y=S?"bottom":"right",v=S?"clientHeight":"clientWidth",b=o.reference[w]+o.reference[m]-p[m]-o.floating[w],j=p[m]-o.reference[m],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=C?C[v]:0;(!E||!await(s.isElement==null?void 0:s.isElement(C)))&&(E=l.floating[v]||o.floating[w]);const T=b/2-j/2,D=E/2-h[w]/2-1,A=Zn(f[x],D),I=Zn(f[y],D),P=A,V=E-h[w]-I,O=E/2-h[w]/2+T,L=dc(P,O,V),$=!u.arrow&&Ei(i)!=null&&O!==L&&o.reference[w]/2-(OO<=0)){var I,P;const O=(((I=o.flip)==null?void 0:I.index)||0)+1,L=E[O];if(L&&(!(f==="alignment"?y!==tn(L):!1)||A.every(_=>tn(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:O,overflows:A},reset:{placement:L}};let $=(P=A.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:P.placement;if(!$)switch(m){case"bestFit":{var V;const H=(V=A.filter(_=>{if(C){const F=tn(_.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":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function dm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fm(e){return cj.some(t=>e[t]>=0)}const Nj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bn(e,t);switch(r){case"referenceHidden":{const o=await Ro(t,{...i,elementContext:"reference"}),s=dm(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fm(s)}}}case"escaped":{const o=await Ro(t,{...i,altBoundary:!0}),s=dm(o,n.floating);return{data:{escapedOffsets:s,escaped:fm(s)}}}default:return{}}}}},Ty=new Set(["left","top"]);async function Cj(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Nn(n),l=Ei(n),u=tn(n)==="y",c=Ty.has(s)?-1:1,d=o&&u?-1:1,f=bn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof w=="number"&&(m=l==="end"?w*-1:w),u?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const jj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=t,u=await Cj(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},Ej=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:s=!1,limiter:l={fn:S=>{let{x,y}=S;return{x,y}}},...u}=bn(e,t),c={x:n,y:r},d=await Ro(t,u),f=tn(Nn(i)),p=Kd(f);let m=c[p],w=c[f];if(o){const S=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=m+d[S],v=m-d[x];m=dc(y,m,v)}if(s){const S=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=w+d[S],v=w-d[x];w=dc(y,w,v)}const h=l.fn({...t,[p]:m,[f]:w});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:o,[f]:s}}}}}},Pj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=bn(e,t),d={x:n,y:r},f=tn(i),p=Kd(f);let m=d[p],w=d[f];const h=bn(l,t),S=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const v=p==="y"?"height":"width",b=o.reference[p]-o.floating[v]+S.mainAxis,j=o.reference[p]+o.reference[v]-S.mainAxis;mj&&(m=j)}if(c){var x,y;const v=p==="y"?"width":"height",b=Ty.has(Nn(i)),j=o.reference[f]-o.floating[v]+(b&&((x=s.offset)==null?void 0:x[f])||0)+(b?0:S.crossAxis),C=o.reference[f]+o.reference[v]+(b?0:((y=s.offset)==null?void 0:y[f])||0)-(b?S.crossAxis:0);wC&&(w=C)}return{[p]:m,[f]:w}}}},Aj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:l}=t,{apply:u=()=>{},...c}=bn(e,t),d=await Ro(t,c),f=Nn(i),p=Ei(i),m=tn(i)==="y",{width:w,height:h}=o.floating;let S,x;f==="top"||f==="bottom"?(S=f,x=p===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,S=p==="end"?"top":"bottom");const y=h-d.top-d.bottom,v=w-d.left-d.right,b=Zn(h-d[S],y),j=Zn(w-d[x],v),C=!t.middlewareData.shift;let E=b,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),C&&!p){const A=yt(d.left,0),I=yt(d.right,0),P=yt(d.top,0),V=yt(d.bottom,0);m?T=w-2*(A!==0||I!==0?A+I:yt(d.left,d.right)):E=h-2*(P!==0||V!==0?P+V:yt(d.top,d.bottom))}await u({...t,availableWidth:T,availableHeight:E});const D=await s.getDimensions(l.floating);return w!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function Ql(){return typeof window<"u"}function Pi(e){return _y(e)?(e.nodeName||"").toLowerCase():"#document"}function kt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function un(e){var t;return(t=(_y(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _y(e){return Ql()?e instanceof Node||e instanceof kt(e).Node:!1}function Ht(e){return Ql()?e instanceof Element||e instanceof kt(e).Element:!1}function ln(e){return Ql()?e instanceof HTMLElement||e instanceof kt(e).HTMLElement:!1}function pm(e){return!Ql()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kt(e).ShadowRoot}const Tj=new Set(["inline","contents"]);function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Tj.has(i)}const _j=new Set(["table","td","th"]);function Ij(e){return _j.has(Pi(e))}const Rj=[":popover-open",":modal"];function ql(e){return Rj.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mj=["transform","translate","scale","rotate","perspective"],Oj=["transform","translate","scale","rotate","perspective","filter"],Lj=["paint","layout","strict","content"];function qd(e){const t=Xd(),n=Ht(e)?Wt(e):e;return Mj.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)||Oj.some(r=>(n.willChange||"").includes(r))||Lj.some(r=>(n.contain||"").includes(r))}function Dj(e){let t=er(e);for(;ln(t)&&!wi(t);){if(qd(t))return t;if(ql(t))return null;t=er(t)}return null}function Xd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zj=new Set(["html","body","#document"]);function wi(e){return zj.has(Pi(e))}function Wt(e){return kt(e).getComputedStyle(e)}function Xl(e){return Ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if(Pi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pm(e)&&e.host||un(e);return pm(t)?t.host:t}function Iy(e){const t=er(e);return wi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ln(t)&&Ho(t)?t:Iy(t)}function Mo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Iy(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=kt(i);if(o){const l=pc(s);return t.concat(s,s.visualViewport||[],Ho(i)?i:[],l&&n?Mo(l):[])}return t.concat(i,Mo(i,[],n))}function pc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ry(e){const t=Wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ln(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=gl(n)!==o||gl(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Jd(e){return Ht(e)?e:e.contextElement}function si(e){const t=Jd(e);if(!ln(t))return sn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ry(t);let s=(o?gl(n.width):n.width)/r,l=(o?gl(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Fj=sn(0);function My(e){const t=kt(e);return!Xd()||!t.visualViewport?Fj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kt(e)?!1:t}function jr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Jd(e);let s=sn(1);t&&(r?Ht(r)&&(s=si(r)):s=si(e));const l=Bj(o,n,r)?My(o):sn(0);let u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const p=kt(o),m=r&&Ht(r)?kt(r):r;let w=p,h=pc(w);for(;h&&r&&m!==w;){const S=si(h),x=h.getBoundingClientRect(),y=Wt(h),v=x.left+(h.clientLeft+parseFloat(y.paddingLeft))*S.x,b=x.top+(h.clientTop+parseFloat(y.paddingTop))*S.y;u*=S.x,c*=S.y,d*=S.x,f*=S.y,u+=v,c+=b,w=kt(h),h=pc(w)}}return yl({width:d,height:f,x:u,y:c})}function Jl(e,t){const n=Xl(e).scrollLeft;return t?t.left+n:jr(un(e)).left+n}function Oy(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jl(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function $j(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=un(r),l=t?ql(t.floating):!1;if(r===s||l&&o)return n;let u={scrollLeft:0,scrollTop:0},c=sn(1);const d=sn(0),f=ln(r);if((f||!f&&!o)&&((Pi(r)!=="body"||Ho(s))&&(u=Xl(r)),ln(r))){const m=jr(r);c=si(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=s&&!f&&!o?Oy(s,u):sn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-u.scrollTop*c.y+d.y+p.y}}function Uj(e){return Array.from(e.getClientRects())}function Vj(e){const t=un(e),n=Xl(e),r=e.ownerDocument.body,i=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jl(e);const l=-n.scrollTop;return Wt(r).direction==="rtl"&&(s+=yt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}const mm=25;function Hj(e,t){const n=kt(e),r=un(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;const d=Xd();(!d||d&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const c=Jl(r);if(c<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-f.clientWidth-m);w<=mm&&(o-=w)}else c<=mm&&(o+=c);return{width:o,height:s,x:l,y:u}}const Wj=new Set(["absolute","fixed"]);function Gj(e,t){const n=jr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ln(e)?si(e):sn(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:s,height:l,x:u,y:c}}function hm(e,t,n){let r;if(t==="viewport")r=Hj(e,n);else if(t==="document")r=Vj(un(e));else if(Ht(t))r=Gj(t,n);else{const i=My(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yl(r)}function Ly(e,t){const n=er(e);return n===t||!Ht(n)||wi(n)?!1:Wt(n).position==="fixed"||Ly(n,t)}function Kj(e,t){const n=t.get(e);if(n)return n;let r=Mo(e,[],!1).filter(l=>Ht(l)&&Pi(l)!=="body"),i=null;const o=Wt(e).position==="fixed";let s=o?er(e):e;for(;Ht(s)&&!wi(s);){const l=Wt(s),u=qd(s);!u&&l.position==="fixed"&&(i=null),(o?!u&&!i:!u&&l.position==="static"&&!!i&&Wj.has(i.position)||Ho(s)&&!u&&Ly(e,s))?r=r.filter(d=>d!==s):i=l,s=er(s)}return t.set(e,r),r}function Yj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?ql(t)?[]:Kj(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((c,d)=>{const f=hm(t,d,i);return c.top=yt(f.top,c.top),c.right=Zn(f.right,c.right),c.bottom=Zn(f.bottom,c.bottom),c.left=yt(f.left,c.left),c},hm(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Qj(e){const{width:t,height:n}=Ry(e);return{width:t,height:n}}function qj(e,t,n){const r=ln(t),i=un(t),o=n==="fixed",s=jr(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=sn(0);function c(){u.x=Jl(i)}if(r||!r&&!o)if((Pi(t)!=="body"||Ho(i))&&(l=Xl(t)),r){const m=jr(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?Oy(i,l):sn(0),f=s.left+l.scrollLeft-u.x-d.x,p=s.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}function Ua(e){return Wt(e).position==="static"}function gm(e,t){if(!ln(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return un(e)===n&&(n=n.ownerDocument.body),n}function Dy(e,t){const n=kt(e);if(ql(e))return n;if(!ln(e)){let i=er(e);for(;i&&!wi(i);){if(Ht(i)&&!Ua(i))return i;i=er(i)}return n}let r=gm(e,t);for(;r&&Ij(r)&&Ua(r);)r=gm(r,t);return r&&wi(r)&&Ua(r)&&!qd(r)?n:r||Dj(e)||n}const Xj=async function(e){const t=this.getOffsetParent||Dy,n=this.getDimensions,r=await n(e.floating);return{reference:qj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jj(e){return Wt(e).direction==="rtl"}const Zj={convertOffsetParentRelativeRectToViewportRelativeRect:$j,getDocumentElement:un,getClippingRect:Yj,getOffsetParent:Dy,getElementRects:Xj,getClientRects:Uj,getDimensions:Qj,getScale:si,isElement:Ht,isRTL:Jj};function zy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e2(e,t){let n=null,r;const i=un(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=c;if(l||t(),!p||!m)return;const w=fs(f),h=fs(i.clientWidth-(d+p)),S=fs(i.clientHeight-(f+m)),x=fs(d),v={rootMargin:-w+"px "+-h+"px "+-S+"px "+-x+"px",threshold:yt(0,Zn(1,u))||1};let b=!0;function j(C){const E=C[0].intersectionRatio;if(E!==u){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!zy(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(j,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,v)}n.observe(e)}return s(!0),o}function t2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=Jd(e),d=i||o?[...c?Mo(c):[],...Mo(t)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=c&&l?e2(c,n):null;let p=-1,m=null;s&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let w,h=u?jr(e):null;u&&S();function S(){const x=jr(e);h&&!zy(h,x)&&n(),h=x,w=requestAnimationFrame(S)}return n(),()=>{var x;d.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,u&&cancelAnimationFrame(w)}}const n2=jj,r2=Ej,i2=bj,o2=Aj,s2=Nj,xm=kj,l2=Pj,a2=(e,t,n)=>{const r=new Map,i={platform:Zj,...n},o={...i.platform,_c:r};return Sj(e,t,{...i,platform:o})};var u2=typeof document<"u",c2=function(){},Rs=u2?g.useLayoutEffect:c2;function vl(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(!vl(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)&&!vl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Fy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(e,t){const n=Fy(e);return Math.round(t*n)/n}function Va(e){const t=g.useRef(e);return Rs(()=>{t.current=e}),t}function d2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[d,f]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);vl(p,r)||m(r);const[w,h]=g.useState(null),[S,x]=g.useState(null),y=g.useCallback(_=>{_!==C.current&&(C.current=_,h(_))},[]),v=g.useCallback(_=>{_!==E.current&&(E.current=_,x(_))},[]),b=o||w,j=s||S,C=g.useRef(null),E=g.useRef(null),T=g.useRef(d),D=u!=null,A=Va(u),I=Va(i),P=Va(c),V=g.useCallback(()=>{if(!C.current||!E.current)return;const _={placement:t,strategy:n,middleware:p};I.current&&(_.platform=I.current),a2(C.current,E.current,_).then(F=>{const k={...F,isPositioned:P.current!==!1};O.current&&!vl(T.current,k)&&(T.current=k,Ni.flushSync(()=>{f(k)}))})},[p,t,n,I,P]);Rs(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[c]);const O=g.useRef(!1);Rs(()=>(O.current=!0,()=>{O.current=!1}),[]),Rs(()=>{if(b&&(C.current=b),j&&(E.current=j),b&&j){if(A.current)return A.current(b,j,V);V()}},[b,j,V,A,D]);const L=g.useMemo(()=>({reference:C,floating:E,setReference:y,setFloating:v}),[y,v]),$=g.useMemo(()=>({reference:b,floating:j}),[b,j]),H=g.useMemo(()=>{const _={position:n,left:0,top:0};if(!$.floating)return _;const F=ym($.floating,d.x),k=ym($.floating,d.y);return l?{..._,transform:"translate("+F+"px, "+k+"px)",...Fy($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:k}},[n,l,$.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:V,refs:L,elements:$,floatingStyles:H}),[d,V,L,$,H])}const f2=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?xm({element:r.current,padding:i}).fn(n):{}:r?xm({element:r,padding:i}).fn(n):{}}}},p2=(e,t)=>({...n2(e),options:[e,t]}),m2=(e,t)=>({...r2(e),options:[e,t]}),h2=(e,t)=>({...l2(e),options:[e,t]}),g2=(e,t)=>({...i2(e),options:[e,t]}),x2=(e,t)=>({...o2(e),options:[e,t]}),y2=(e,t)=>({...s2(e),options:[e,t]}),v2=(e,t)=>({...f2(e),options:[e,t]});var w2="Arrow",By=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return a.jsx(re.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});By.displayName=w2;var S2=By,Zd="Popper",[$y,Uy]=jn(Zd),[k2,Vy]=$y(Zd),Hy=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return a.jsx(k2,{scope:t,anchor:r,onAnchorChange:i,children:n})};Hy.displayName=Zd;var Wy="PopperAnchor",Gy=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Vy(Wy,n),s=g.useRef(null),l=he(t,s),u=g.useRef(null);return g.useEffect(()=>{const c=u.current;u.current=(r==null?void 0:r.current)||s.current,c!==u.current&&o.onAnchorChange(u.current)}),r?null:a.jsx(re.div,{...i,ref:l})});Gy.displayName=Wy;var ef="PopperContent",[b2,N2]=$y(ef),Ky=g.forwardRef((e,t)=>{var K,oe,be,M,W,Q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...h}=e,S=Vy(ef,n),[x,y]=g.useState(null),v=he(t,xe=>y(xe)),[b,j]=g.useState(null),C=ly(b),E=(C==null?void 0:C.width)??0,T=(C==null?void 0:C.height)??0,D=r+(o!=="center"?"-"+o:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],P=I.length>0,V={padding:A,boundary:I.filter(j2),altBoundary:P},{refs:O,floatingStyles:L,placement:$,isPositioned:H,middlewareData:_}=d2({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>t2(...xe,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[p2({mainAxis:i+T,alignmentAxis:s}),u&&m2({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?h2():void 0,...V}),u&&g2({...V}),x2({...V,apply:({elements:xe,rects:ve,availableWidth:mt,availableHeight:Pn})=>{const{width:An,height:ca}=ve.reference,ar=xe.floating.style;ar.setProperty("--radix-popper-available-width",`${mt}px`),ar.setProperty("--radix-popper-available-height",`${Pn}px`),ar.setProperty("--radix-popper-anchor-width",`${An}px`),ar.setProperty("--radix-popper-anchor-height",`${ca}px`)}}),b&&v2({element:b,padding:l}),E2({arrowWidth:E,arrowHeight:T}),p&&y2({strategy:"referenceHidden",...V})]}),[F,k]=qy($),Y=Jn(w);Ke(()=>{H&&(Y==null||Y())},[H,Y]);const q=(K=_.arrow)==null?void 0:K.x,N=(oe=_.arrow)==null?void 0:oe.y,ie=((be=_.arrow)==null?void 0:be.centerOffset)!==0,[Oe,ue]=g.useState();return Ke(()=>{x&&ue(window.getComputedStyle(x).zIndex)},[x]),a.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[(M=_.transformOrigin)==null?void 0:M.x,(W=_.transformOrigin)==null?void 0:W.y].join(" "),...((Q=_.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(b2,{scope:n,placedSide:F,onArrowChange:j,arrowX:q,arrowY:N,shouldHideArrow:ie,children:a.jsx(re.div,{"data-side":F,"data-align":k,...h,ref:v,style:{...h.style,animation:H?void 0:"none"}})})})});Ky.displayName=ef;var Yy="PopperArrow",C2={top:"bottom",right:"left",bottom:"top",left:"right"},Qy=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=N2(Yy,r),s=C2[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]: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:a.jsx(S2,{...i,ref:n,style:{...i.style,display:"block"}})})});Qy.displayName=Yy;function j2(e){return e!==null}var E2=e=>({name:"transformOrigin",options:e,fn(t){var S,x,y;const{placement:n,rects:r,middlewareData:i}=t,s=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,d]=qy(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=i.arrow)==null?void 0:x.x)??0)+l/2,m=(((y=i.arrow)==null?void 0:y.y)??0)+u/2;let w="",h="";return c==="bottom"?(w=s?f:`${p}px`,h=`${-u}px`):c==="top"?(w=s?f:`${p}px`,h=`${r.floating.height+u}px`):c==="right"?(w=`${-u}px`,h=s?f:`${m}px`):c==="left"&&(w=`${r.floating.width+u}px`,h=s?f:`${m}px`),{data:{x:w,y:h}}}});function qy(e){const[t,n="center"]=e.split("-");return[t,n]}var P2=Hy,A2=Gy,T2=Ky,_2=Qy,I2="Portal",tf=g.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,o]=g.useState(!1);Ke(()=>o(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?xk.createPortal(a.jsx(re.div,{...r,ref:t}),s):null});tf.displayName=I2;var Xy=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"}),R2="VisuallyHidden",M2=g.forwardRef((e,t)=>a.jsx(re.span,{...e,ref:t,style:{...Xy,...e.style}}));M2.displayName=R2;var O2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dr=new WeakMap,ps=new WeakMap,ms={},Ha=0,Jy=function(e){return e&&(e.host||Jy(e.parentNode))},L2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Jy(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})},D2=function(e,t,n,r){var i=L2(t,Array.isArray(e)?e:[e]);ms[n]||(ms[n]=new WeakMap);var o=ms[n],s=[],l=new Set,u=new Set(i),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))d(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",h=(Dr.get(p)||0)+1,S=(o.get(p)||0)+1;Dr.set(p,h),o.set(p,S),s.push(p),h===1&&w&&ps.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),l.clear(),Ha++,function(){s.forEach(function(f){var p=Dr.get(f)-1,m=o.get(f)-1;Dr.set(f,p),o.set(f,m),p||(ps.has(f)||f.removeAttribute(r),ps.delete(f)),m||f.removeAttribute(n)}),Ha--,Ha||(Dr=new WeakMap,Dr=new WeakMap,ps=new WeakMap,ms={})}},Zy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||O2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),D2(r,i,n,"aria-hidden")):function(){return null}},Zt=function(){return Zt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return eE;var t=tE(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])}},rE=rv(),li="data-scroll-locked",iE=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(F2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(l,"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(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Ms,` { + right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(Os,` { + margin-right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(Ms," .").concat(Ms,` { + right: 0 `).concat(r,`; + } + + .`).concat(Os," .").concat(Os,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(li,`] { + `).concat(B2,": ").concat(l,`px; + } +`)},Sm=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},oE=function(){g.useEffect(function(){return document.body.setAttribute(li,(Sm()+1).toString()),function(){var e=Sm()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},sE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;oE();var o=g.useMemo(function(){return nE(i)},[i]);return g.createElement(rE,{styles:iE(o,!t,i,n?"":"!important")})},mc=!1;if(typeof window<"u")try{var hs=Object.defineProperty({},"passive",{get:function(){return mc=!0,!0}});window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{mc=!1}var zr=mc?{passive:!1}:!1,lE=function(e){return e.tagName==="TEXTAREA"},iv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lE(e)&&n[t]==="visible")},aE=function(e){return iv(e,"overflowY")},uE=function(e){return iv(e,"overflowX")},km=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=ov(e,r);if(i){var o=sv(e,r),s=o[1],l=o[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ov=function(e,t){return e==="v"?aE(t):uE(t)},sv=function(e,t){return e==="v"?cE(t):dE(t)},fE=function(e,t){return e==="h"&&t==="rtl"?-1:1},pE=function(e,t,n,r,i){var o=fE(e,window.getComputedStyle(t).direction),s=o*r,l=n.target,u=t.contains(l),c=!1,d=s>0,f=0,p=0;do{if(!l)break;var m=sv(e,l),w=m[0],h=m[1],S=m[2],x=h-S-o*w;(w||x)&&ov(e,l)&&(f+=x,p+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(d&&(i&&Math.abs(f)<1||!i&&s>f)||!d&&(i&&Math.abs(p)<1||!i&&-s>p))&&(c=!0),c},gs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bm=function(e){return[e.deltaX,e.deltaY]},Nm=function(e){return e&&"current"in e?e.current:e},mE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hE=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},gE=0,Fr=[];function xE(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(gE++)[0],o=g.useState(rv)[0],s=g.useRef(e);g.useEffect(function(){s.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var h=z2([e.lockRef.current],(e.shards||[]).map(Nm),!0).filter(Boolean);return h.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(h,S){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!s.current.allowPinchZoom;var x=gs(h),y=n.current,v="deltaX"in h?h.deltaX:y[0]-x[0],b="deltaY"in h?h.deltaY:y[1]-x[1],j,C=h.target,E=Math.abs(v)>Math.abs(b)?"h":"v";if("touches"in h&&E==="h"&&C.type==="range")return!1;var T=km(E,C);if(!T)return!0;if(T?j=E:(j=E==="v"?"h":"v",T=km(E,C)),!T)return!1;if(!r.current&&"changedTouches"in h&&(v||b)&&(r.current=j),!j)return!0;var D=r.current||j;return pE(D,S,h,D==="h"?v:b,!0)},[]),u=g.useCallback(function(h){var S=h;if(!(!Fr.length||Fr[Fr.length-1]!==o)){var x="deltaY"in S?bm(S):gs(S),y=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&mE(j.delta,x)})[0];if(y&&y.should){S.cancelable&&S.preventDefault();return}if(!y){var v=(s.current.shards||[]).map(Nm).filter(Boolean).filter(function(j){return j.contains(S.target)}),b=v.length>0?l(S,v[0]):!s.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(h,S,x,y){var v={name:h,delta:S,target:x,should:y,shadowParent:yE(x)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(b){return b!==v})},1)},[]),d=g.useCallback(function(h){n.current=gs(h),r.current=void 0},[]),f=g.useCallback(function(h){c(h.type,bm(h),h.target,l(h,e.lockRef.current))},[]),p=g.useCallback(function(h){c(h.type,gs(h),h.target,l(h,e.lockRef.current))},[]);g.useEffect(function(){return Fr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,zr),document.addEventListener("touchmove",u,zr),document.addEventListener("touchstart",d,zr),function(){Fr=Fr.filter(function(h){return h!==o}),document.removeEventListener("wheel",u,zr),document.removeEventListener("touchmove",u,zr),document.removeEventListener("touchstart",d,zr)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:hE(i)}):null,m?g.createElement(sE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vE=K2(nv,xE);var lv=g.forwardRef(function(e,t){return g.createElement(Zl,Zt({},e,{ref:t,sideCar:vE}))});lv.classNames=Zl.classNames;const av=lv;var wE=[" ","Enter","ArrowUp","ArrowDown"],SE=[" ","Enter"],Er="Select",[ea,ta,kE]=Vd(Er),[Ai,qR]=jn(Er,[kE,Uy]),na=Uy(),[bE,or]=Ai(Er),[NE,CE]=Ai(Er),uv=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:l,onValueChange:u,dir:c,name:d,autoComplete:f,disabled:p,required:m,form:w}=e,h=na(t),[S,x]=g.useState(null),[y,v]=g.useState(null),[b,j]=g.useState(!1),C=Gl(c),[E,T]=Cr({prop:r,defaultProp:i??!1,onChange:o,caller:Er}),[D,A]=Cr({prop:s,defaultProp:l,onChange:u,caller:Er}),I=g.useRef(null),P=S?w||!!S.closest("form"):!0,[V,O]=g.useState(new Set),L=Array.from(V).map($=>$.props.value).join(";");return a.jsx(P2,{...h,children:a.jsxs(bE,{required:m,scope:t,trigger:S,onTriggerChange:x,valueNode:y,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:j,contentId:xn(),value:D,onValueChange:A,open:E,onOpenChange:T,dir:C,triggerPointerDownPosRef:I,disabled:p,children:[a.jsx(ea.Provider,{scope:t,children:a.jsx(NE,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback($=>{O(H=>new Set(H).add($))},[]),onNativeOptionRemove:g.useCallback($=>{O(H=>{const _=new Set(H);return _.delete($),_})},[]),children:n})}),P?a.jsxs(Mv,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:$=>A($.target.value),disabled:p,form:w,children:[D===void 0?a.jsx("option",{value:""}):null,Array.from(V)]},L):null]})})};uv.displayName=Er;var cv="SelectTrigger",dv=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=na(n),s=or(cv,n),l=s.disabled||r,u=he(t,s.onTriggerChange),c=ta(n),d=g.useRef("touch"),[f,p,m]=Lv(h=>{const S=c().filter(v=>!v.disabled),x=S.find(v=>v.value===s.value),y=Dv(S,h,x);y!==void 0&&s.onValueChange(y.value)}),w=h=>{l||(s.onOpenChange(!0),m()),h&&(s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return a.jsx(A2,{asChild:!0,...o,children:a.jsx(re.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ov(s.value)?"":void 0,...i,ref:u,onClick:te(i.onClick,h=>{h.currentTarget.focus(),d.current!=="mouse"&&w(h)}),onPointerDown:te(i.onPointerDown,h=>{d.current=h.pointerType;const S=h.target;S.hasPointerCapture(h.pointerId)&&S.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:te(i.onKeyDown,h=>{const S=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(S&&h.key===" ")&&wE.includes(h.key)&&(w(),h.preventDefault())})})})});dv.displayName=cv;var fv="SelectValue",pv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...l}=e,u=or(fv,n),{onValueNodeHasChildrenChange:c}=u,d=o!==void 0,f=he(t,u.onValueNodeChange);return Ke(()=>{c(d)},[c,d]),a.jsx(re.span,{...l,ref:f,style:{pointerEvents:"none"},children:Ov(u.value)?a.jsx(a.Fragment,{children:s}):o})});pv.displayName=fv;var jE="SelectIcon",mv=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return a.jsx(re.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});mv.displayName=jE;var EE="SelectPortal",hv=e=>a.jsx(tf,{asChild:!0,...e});hv.displayName=EE;var Pr="SelectContent",gv=g.forwardRef((e,t)=>{const n=or(Pr,e.__scopeSelect),[r,i]=g.useState();if(Ke(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ni.createPortal(a.jsx(xv,{scope:e.__scopeSelect,children:a.jsx(ea.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(yv,{...e,ref:t})});gv.displayName=Pr;var Lt=10,[xv,sr]=Ai(Pr),PE="SelectContentImpl",AE=vi("SelectContent.RemoveScroll"),yv=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:S,...x}=e,y=or(Pr,n),[v,b]=g.useState(null),[j,C]=g.useState(null),E=he(t,K=>b(K)),[T,D]=g.useState(null),[A,I]=g.useState(null),P=ta(n),[V,O]=g.useState(!1),L=g.useRef(!1);g.useEffect(()=>{if(v)return Zy(v)},[v]),Ey();const $=g.useCallback(K=>{const[oe,...be]=P().map(Q=>Q.ref.current),[M]=be.slice(-1),W=document.activeElement;for(const Q of K)if(Q===W||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===oe&&j&&(j.scrollTop=0),Q===M&&j&&(j.scrollTop=j.scrollHeight),Q==null||Q.focus(),document.activeElement!==W))return},[P,j]),H=g.useCallback(()=>$([T,v]),[$,T,v]);g.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:_,triggerPointerDownPosRef:F}=y;g.useEffect(()=>{if(v){let K={x:0,y:0};const oe=M=>{var W,Q;K={x:Math.abs(Math.round(M.pageX)-(((W=F.current)==null?void 0:W.x)??0)),y:Math.abs(Math.round(M.pageY)-(((Q=F.current)==null?void 0:Q.y)??0))}},be=M=>{K.x<=10&&K.y<=10?M.preventDefault():v.contains(M.target)||_(!1),document.removeEventListener("pointermove",oe),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",be,{capture:!0})}}},[v,_,F]),g.useEffect(()=>{const K=()=>_(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[_]);const[k,Y]=Lv(K=>{const oe=P().filter(W=>!W.disabled),be=oe.find(W=>W.ref.current===document.activeElement),M=Dv(oe,K,be);M&&setTimeout(()=>M.ref.current.focus())}),q=g.useCallback((K,oe,be)=>{const M=!L.current&&!be;(y.value!==void 0&&y.value===oe||M)&&(D(K),M&&(L.current=!0))},[y.value]),N=g.useCallback(()=>v==null?void 0:v.focus(),[v]),ie=g.useCallback((K,oe,be)=>{const M=!L.current&&!be;(y.value!==void 0&&y.value===oe||M)&&I(K)},[y.value]),Oe=r==="popper"?hc:vv,ue=Oe===hc?{side:l,sideOffset:u,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:S}:{};return a.jsx(xv,{scope:n,content:v,viewport:j,onViewportChange:C,itemRefCallback:q,selectedItem:T,onItemLeave:N,itemTextRefCallback:ie,focusSelectedItem:H,selectedItemText:A,position:r,isPositioned:V,searchRef:k,children:a.jsx(av,{as:AE,allowPinchZoom:!0,children:a.jsx(Gd,{asChild:!0,trapped:y.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:te(i,K=>{var oe;(oe=y.trigger)==null||oe.focus({preventScroll:!0}),K.preventDefault()}),children:a.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(Oe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:K=>K.preventDefault(),...x,...ue,onPlaced:()=>O(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:te(x.onKeyDown,K=>{const oe=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!oe&&K.key.length===1&&Y(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let M=P().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(K.key)&&(M=M.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const W=K.target,Q=M.indexOf(W);M=M.slice(Q+1)}setTimeout(()=>$(M)),K.preventDefault()}})})})})})})});yv.displayName=PE;var TE="SelectItemAlignedPosition",vv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=or(Pr,n),s=sr(Pr,n),[l,u]=g.useState(null),[c,d]=g.useState(null),f=he(t,E=>d(E)),p=ta(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:h,selectedItem:S,selectedItemText:x,focusSelectedItem:y}=s,v=g.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&c&&h&&S&&x){const E=o.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),D=o.valueNode.getBoundingClientRect(),A=x.getBoundingClientRect();if(o.dir!=="rtl"){const W=A.left-T.left,Q=D.left-W,xe=E.left-Q,ve=E.width+xe,mt=Math.max(ve,T.width),Pn=window.innerWidth-Lt,An=ml(Q,[Lt,Math.max(Lt,Pn-mt)]);l.style.minWidth=ve+"px",l.style.left=An+"px"}else{const W=T.right-A.right,Q=window.innerWidth-D.right-W,xe=window.innerWidth-E.right-Q,ve=E.width+xe,mt=Math.max(ve,T.width),Pn=window.innerWidth-Lt,An=ml(Q,[Lt,Math.max(Lt,Pn-mt)]);l.style.minWidth=ve+"px",l.style.right=An+"px"}const I=p(),P=window.innerHeight-Lt*2,V=h.scrollHeight,O=window.getComputedStyle(c),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(h),q=parseInt(Y.paddingTop,10),N=parseInt(Y.paddingBottom,10),ie=E.top+E.height/2-Lt,Oe=P-ie,ue=S.offsetHeight/2,K=S.offsetTop+ue,oe=L+$+K,be=F-oe;if(oe<=ie){const W=I.length>0&&S===I[I.length-1].ref.current;l.style.bottom="0px";const Q=c.clientHeight-h.offsetTop-h.offsetHeight,xe=Math.max(Oe,ue+(W?N:0)+Q+H),ve=oe+xe;l.style.height=ve+"px"}else{const W=I.length>0&&S===I[0].ref.current;l.style.top="0px";const xe=Math.max(ie,L+h.offsetTop+(W?q:0)+ue)+be;l.style.height=xe+"px",h.scrollTop=oe-ie+h.offsetTop}l.style.margin=`${Lt}px 0`,l.style.minHeight=k+"px",l.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,l,c,h,S,x,o.dir,r]);Ke(()=>v(),[v]);const[b,j]=g.useState();Ke(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(E=>{E&&w.current===!0&&(v(),y==null||y(),w.current=!1)},[v,y]);return a.jsx(IE,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:a.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:a.jsx(re.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});vv.displayName=TE;var _E="SelectPopperPosition",hc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Lt,...o}=e,s=na(n);return a.jsx(T2,{...s,...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)"}})});hc.displayName=_E;var[IE,nf]=Ai(Pr,{}),gc="SelectViewport",wv=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=sr(gc,n),s=nf(gc,n),l=he(t,o.onViewportChange),u=g.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(ea.Slot,{scope:n,children:a.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:te(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&f){const m=Math.abs(u.current-d.scrollTop);if(m>0){const w=window.innerHeight-Lt*2,h=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),x=Math.max(h,S);if(x0?b:0,f.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});wv.displayName=gc;var Sv="SelectGroup",[RE,ME]=Ai(Sv),kv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=xn();return a.jsx(RE,{scope:n,id:i,children:a.jsx(re.div,{role:"group","aria-labelledby":i,...r,ref:t})})});kv.displayName=Sv;var bv="SelectLabel",Nv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ME(bv,n);return a.jsx(re.div,{id:i.id,...r,ref:t})});Nv.displayName=bv;var wl="SelectItem",[OE,Cv]=Ai(wl),jv=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,l=or(wl,n),u=sr(wl,n),c=l.value===r,[d,f]=g.useState(o??""),[p,m]=g.useState(!1),w=he(t,y=>{var v;return(v=u.itemRefCallback)==null?void 0:v.call(u,y,r,i)}),h=xn(),S=g.useRef("touch"),x=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(OE,{scope:n,value:r,disabled:i,textId:h,isSelected:c,onItemTextChange:g.useCallback(y=>{f(v=>v||((y==null?void 0:y.textContent)??"").trim())},[]),children:a.jsx(ea.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:a.jsx(re.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:te(s.onFocus,()=>m(!0)),onBlur:te(s.onBlur,()=>m(!1)),onClick:te(s.onClick,()=>{S.current!=="mouse"&&x()}),onPointerUp:te(s.onPointerUp,()=>{S.current==="mouse"&&x()}),onPointerDown:te(s.onPointerDown,y=>{S.current=y.pointerType}),onPointerMove:te(s.onPointerMove,y=>{var v;S.current=y.pointerType,i?(v=u.onItemLeave)==null||v.call(u):S.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(s.onPointerLeave,y=>{var v;y.currentTarget===document.activeElement&&((v=u.onItemLeave)==null||v.call(u))}),onKeyDown:te(s.onKeyDown,y=>{var b;((b=u.searchRef)==null?void 0:b.current)!==""&&y.key===" "||(SE.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});jv.displayName=wl;var Xi="SelectItemText",Ev=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=or(Xi,n),l=sr(Xi,n),u=Cv(Xi,n),c=CE(Xi,n),[d,f]=g.useState(null),p=he(t,x=>f(x),u.onItemTextChange,x=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,x,u.value,u.disabled)}),m=d==null?void 0:d.textContent,w=g.useMemo(()=>a.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:S}=c;return Ke(()=>(h(w),()=>S(w)),[h,S,w]),a.jsxs(a.Fragment,{children:[a.jsx(re.span,{id:u.textId,...o,ref:p}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ni.createPortal(o.children,s.valueNode):null]})});Ev.displayName=Xi;var Pv="SelectItemIndicator",Av=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cv(Pv,n).isSelected?a.jsx(re.span,{"aria-hidden":!0,...r,ref:t}):null});Av.displayName=Pv;var xc="SelectScrollUpButton",Tv=g.forwardRef((e,t)=>{const n=sr(xc,e.__scopeSelect),r=nf(xc,e.__scopeSelect),[i,o]=g.useState(!1),s=he(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?a.jsx(Iv,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});Tv.displayName=xc;var yc="SelectScrollDownButton",_v=g.forwardRef((e,t)=>{const n=sr(yc,e.__scopeSelect),r=nf(yc,e.__scopeSelect),[i,o]=g.useState(!1),s=he(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?a.jsx(Iv,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});_v.displayName=yc;var Iv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=sr("SelectScrollButton",n),s=g.useRef(null),l=ta(n),u=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),Ke(()=>{var d;const c=l().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(re.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:te(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:te(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:te(i.onPointerLeave,()=>{u()})})}),LE="SelectSeparator",Rv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(re.div,{"aria-hidden":!0,...r,ref:t})});Rv.displayName=LE;var vc="SelectArrow",DE=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=na(n),o=or(vc,n),s=sr(vc,n);return o.open&&s.position==="popper"?a.jsx(_2,{...i,...r,ref:t}):null});DE.displayName=vc;var zE="SelectBubbleInput",Mv=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=he(r,i),s=sy(t);return g.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[s,t]),a.jsx(re.select,{...n,style:{...Xy,...n.style},ref:o,defaultValue:t})});Mv.displayName=zE;function Ov(e){return e===""||e===void 0}function Lv(e){const t=Jn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(s=>{const l=n.current+s;t(l),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Dv(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=FE(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function FE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BE=uv,zv=dv,$E=pv,UE=mv,VE=hv,Fv=gv,HE=wv,WE=kv,Bv=Nv,$v=jv,GE=Ev,KE=Av,Uv=Tv,Vv=_v,Hv=Rv;const Wv=BE,Cm=WE,Gv=$E,rf=g.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(zv,{ref:r,className:de("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(UE,{asChild:!0,children:a.jsx(zd,{className:"h-4 w-4 opacity-50"})})]}));rf.displayName=zv.displayName;const Kv=g.forwardRef(({className:e,...t},n)=>a.jsx(Uv,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(pN,{className:"h-4 w-4"})}));Kv.displayName=Uv.displayName;const Yv=g.forwardRef(({className:e,...t},n)=>a.jsx(Vv,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(zd,{className:"h-4 w-4"})}));Yv.displayName=Vv.displayName;const of=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>a.jsx(VE,{children:a.jsxs(Fv,{ref:i,className:de("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(Kv,{}),a.jsx(HE,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(Yv,{})]})}));of.displayName=Fv.displayName;const wc=g.forwardRef(({className:e,...t},n)=>a.jsx(Bv,{ref:n,className:de("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));wc.displayName=Bv.displayName;const Sl=g.forwardRef(({className:e,children:t,...n},r)=>a.jsxs($v,{ref:r,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(KE,{children:a.jsx(cN,{className:"h-4 w-4"})})}),a.jsx(GE,{children:t})]}));Sl.displayName=$v.displayName;const YE=g.forwardRef(({className:e,...t},n)=>a.jsx(Hv,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));YE.displayName=Hv.displayName;function QE(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Ti=e=>{const{present:t,children:n}=e,r=qE(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=he(r.ref,XE(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Ti.displayName="Presence";function qE(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),s=e?"mounted":"unmounted",[l,u]=QE(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=xs(r.current);o.current=l==="mounted"?c:"none"},[l]),Ke(()=>{const c=r.current,d=i.current;if(d!==e){const p=o.current,m=xs(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Ke(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=m=>{const h=xs(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=xs(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function xs(e){return(e==null?void 0:e.animationName)||"none"}function XE(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 ra="Collapsible",[JE,XR]=jn(ra),[ZE,sf]=JE(ra),Qv=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...l}=e,[u,c]=Cr({prop:r,defaultProp:i??!1,onChange:s,caller:ra});return a.jsx(ZE,{scope:n,disabled:o,contentId:xn(),open:u,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),children:a.jsx(re.div,{"data-state":af(u),"data-disabled":o?"":void 0,...l,ref:t})})});Qv.displayName=ra;var qv="CollapsibleTrigger",Xv=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=sf(qv,n);return a.jsx(re.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":af(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:te(e.onClick,i.onOpenToggle)})});Xv.displayName=qv;var lf="CollapsibleContent",Jv=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=sf(lf,e.__scopeCollapsible);return a.jsx(Ti,{present:n||i.open,children:({present:o})=>a.jsx(eP,{...r,ref:t,present:o})})});Jv.displayName=lf;var eP=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=sf(lf,n),[l,u]=g.useState(r),c=g.useRef(null),d=he(t,c),f=g.useRef(0),p=f.current,m=g.useRef(0),w=m.current,h=s.open||l,S=g.useRef(h),x=g.useRef(void 0);return g.useEffect(()=>{const y=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(y)},[]),Ke(()=>{const y=c.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const v=y.getBoundingClientRect();f.current=v.height,m.current=v.width,S.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),u(r)}},[s.open,r]),a.jsx(re.div,{"data-state":af(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!h,...o,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:h&&i})});function af(e){return e?"open":"closed"}var tP=Qv;const nP=tP,rP=Xv,iP=Jv;var ia="Dialog",[Zv,e0]=jn(ia),[oP,Gt]=Zv(ia),t0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,l=g.useRef(null),u=g.useRef(null),[c,d]=Cr({prop:r,defaultProp:i??!1,onChange:o,caller:ia});return a.jsx(oP,{scope:t,triggerRef:l,contentRef:u,contentId:xn(),titleId:xn(),descriptionId:xn(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:s,children:n})};t0.displayName=ia;var n0="DialogTrigger",r0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Gt(n0,n),o=he(t,i.triggerRef);return a.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":df(i.open),...r,ref:o,onClick:te(e.onClick,i.onOpenToggle)})});r0.displayName=n0;var uf="DialogPortal",[sP,i0]=Zv(uf,{forceMount:void 0}),o0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Gt(uf,t);return a.jsx(sP,{scope:t,forceMount:n,children:g.Children.map(r,s=>a.jsx(Ti,{present:n||o.open,children:a.jsx(tf,{asChild:!0,container:i,children:s})}))})};o0.displayName=uf;var kl="DialogOverlay",s0=g.forwardRef((e,t)=>{const n=i0(kl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Gt(kl,e.__scopeDialog);return o.modal?a.jsx(Ti,{present:r||o.open,children:a.jsx(aP,{...i,ref:t})}):null});s0.displayName=kl;var lP=vi("DialogOverlay.RemoveScroll"),aP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Gt(kl,n);return a.jsx(av,{as:lP,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(re.div,{"data-state":df(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ar="DialogContent",l0=g.forwardRef((e,t)=>{const n=i0(Ar,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Gt(Ar,e.__scopeDialog);return a.jsx(Ti,{present:r||o.open,children:o.modal?a.jsx(uP,{...i,ref:t}):a.jsx(cP,{...i,ref:t})})});l0.displayName=Ar;var uP=g.forwardRef((e,t)=>{const n=Gt(Ar,e.__scopeDialog),r=g.useRef(null),i=he(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Zy(o)},[]),a.jsx(a0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&o.preventDefault()}),onFocusOutside:te(e.onFocusOutside,o=>o.preventDefault())})}),cP=g.forwardRef((e,t)=>{const n=Gt(Ar,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return a.jsx(a0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),a0=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,l=Gt(Ar,n),u=g.useRef(null),c=he(t,u);return Ey(),a.jsxs(a.Fragment,{children:[a.jsx(Gd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:a.jsx(Wd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":df(l.open),...s,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(fP,{titleId:l.titleId}),a.jsx(mP,{contentRef:u,descriptionId:l.descriptionId})]})]})}),cf="DialogTitle",u0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Gt(cf,n);return a.jsx(re.h2,{id:i.titleId,...r,ref:t})});u0.displayName=cf;var c0="DialogDescription",d0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Gt(c0,n);return a.jsx(re.p,{id:i.descriptionId,...r,ref:t})});d0.displayName=c0;var f0="DialogClose",p0=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Gt(f0,n);return a.jsx(re.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>i.onOpenChange(!1))})});p0.displayName=f0;function df(e){return e?"open":"closed"}var m0="DialogTitleWarning",[dP,h0]=vC(m0,{contentName:Ar,titleName:cf,docsSlug:"dialog"}),fP=({titleId:e})=>{const t=h0(m0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pP="DialogDescriptionWarning",mP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${h0(pP).contentName}}.`;return g.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},hP=t0,gP=r0,xP=o0,yP=s0,vP=l0,wP=u0,SP=d0,g0=p0,x0="AlertDialog",[kP,JR]=jn(x0,[e0]),En=e0(),y0=e=>{const{__scopeAlertDialog:t,...n}=e,r=En(t);return a.jsx(hP,{...r,...n,modal:!0})};y0.displayName=x0;var bP="AlertDialogTrigger",NP=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return a.jsx(gP,{...i,...r,ref:t})});NP.displayName=bP;var CP="AlertDialogPortal",v0=e=>{const{__scopeAlertDialog:t,...n}=e,r=En(t);return a.jsx(xP,{...r,...n})};v0.displayName=CP;var jP="AlertDialogOverlay",w0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return a.jsx(yP,{...i,...r,ref:t})});w0.displayName=jP;var ai="AlertDialogContent",[EP,PP]=kP(ai),AP=pC("AlertDialogContent"),S0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=En(n),s=g.useRef(null),l=he(t,s),u=g.useRef(null);return a.jsx(dP,{contentName:ai,titleName:k0,docsSlug:"alert-dialog",children:a.jsx(EP,{scope:n,cancelRef:u,children:a.jsxs(vP,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:te(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=u.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[a.jsx(AP,{children:r}),a.jsx(_P,{contentRef:s})]})})})});S0.displayName=ai;var k0="AlertDialogTitle",b0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return a.jsx(wP,{...i,...r,ref:t})});b0.displayName=k0;var N0="AlertDialogDescription",C0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return a.jsx(SP,{...i,...r,ref:t})});C0.displayName=N0;var TP="AlertDialogAction",j0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=En(n);return a.jsx(g0,{...i,...r,ref:t})});j0.displayName=TP;var E0="AlertDialogCancel",P0=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=PP(E0,n),o=En(n),s=he(t,i);return a.jsx(g0,{...o,...r,ref:s})});P0.displayName=E0;var _P=({contentRef:e})=>{const t=`\`${ai}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ai}\` by passing a \`${N0}\` 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 \`${ai}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},IP=y0,RP=v0,A0=w0,T0=S0,_0=j0,I0=P0,R0=b0,M0=C0;const jm=IP,MP=RP,O0=g.forwardRef(({className:e,...t},n)=>a.jsx(A0,{className:de("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}));O0.displayName=A0.displayName;const Sc=g.forwardRef(({className:e,...t},n)=>a.jsxs(MP,{children:[a.jsx(O0,{}),a.jsx(T0,{ref:n,className:de("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})]}));Sc.displayName=T0.displayName;const kc=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col space-y-2 text-center sm:text-left",e),...t});kc.displayName="AlertDialogHeader";const bc=({className:e,...t})=>a.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bc.displayName="AlertDialogFooter";const Nc=g.forwardRef(({className:e,...t},n)=>a.jsx(R0,{ref:n,className:de("text-lg font-semibold",e),...t}));Nc.displayName=R0.displayName;const Cc=g.forwardRef(({className:e,...t},n)=>a.jsx(M0,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));Cc.displayName=M0.displayName;const jc=g.forwardRef(({className:e,...t},n)=>a.jsx(_0,{ref:n,className:de(Ud(),e),...t}));jc.displayName=_0.displayName;const Ec=g.forwardRef(({className:e,...t},n)=>a.jsx(I0,{ref:n,className:de(Ud({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ec.displayName=I0.displayName;function OP(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zP={};function Em(e,t){return((t||zP).jsx?DP:LP).test(e)}const FP=/[ \t\n\f\r]/g;function BP(e){return typeof e=="object"?e.type==="text"?Pm(e.value):!1:Pm(e)}function Pm(e){return e.replace(FP,"")===""}class Wo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Wo.prototype.normal={};Wo.prototype.property={};Wo.prototype.space=void 0;function L0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Wo(n,r,t)}function Pc(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let $P=0;const ne=Mr(),Le=Mr(),Ac=Mr(),B=Mr(),we=Mr(),ui=Mr(),gt=Mr();function Mr(){return 2**++$P}const Tc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ne,booleanish:Le,commaOrSpaceSeparated:gt,commaSeparated:ui,number:B,overloadedBoolean:Ac,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),Ya=Object.keys(Tc);class ff extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Am(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&GP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Tm,QP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Tm.test(o)){let s=o.replace(WP,YP);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ff}return new i(r,t)}function YP(e){return"-"+e.toLowerCase()}function QP(e){return e.charAt(1).toUpperCase()}const qP=L0([D0,UP,B0,$0,U0],"html"),pf=L0([D0,VP,B0,$0,U0],"svg");function XP(e){return e.join(" ").trim()}var mf={},_m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,JP=/\n/g,ZP=/^\s*/,eA=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tA=/^:\s*/,nA=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,rA=/^[;\s]*/,iA=/^\s+|\s+$/g,oA=` +`,Im="/",Rm="*",fr="",sA="comment",lA="declaration",aA=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 h=w.match(JP);h&&(n+=h.length);var S=w.lastIndexOf(oA);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(h){return h.position=new s(w),c(),h}}function s(w){this.start=w,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(w){var h=new Error(t.source+":"+n+":"+r+": "+w);if(h.reason=w,h.filename=t.source,h.line=n,h.column=r,h.source=e,!t.silent)throw h}function u(w){var h=w.exec(e);if(h){var S=h[0];return i(S),e=e.slice(S.length),h}}function c(){u(ZP)}function d(w){var h;for(w=w||[];h=f();)h!==!1&&w.push(h);return w}function f(){var w=o();if(!(Im!=e.charAt(0)||Rm!=e.charAt(1))){for(var h=2;fr!=e.charAt(h)&&(Rm!=e.charAt(h)||Im!=e.charAt(h+1));)++h;if(h+=2,fr===e.charAt(h-1))return l("End of comment missing");var S=e.slice(2,h-2);return r+=2,i(S),e=e.slice(h),r+=2,w({type:sA,comment:S})}}function p(){var w=o(),h=u(eA);if(h){if(f(),!u(tA))return l("property missing ':'");var S=u(nA),x=w({type:lA,property:Mm(h[0].replace(_m,fr)),value:S?Mm(S[0].replace(_m,fr)):fr});return u(rA),x}}function m(){var w=[];d(w);for(var h;h=p();)h!==!1&&(w.push(h),d(w));return w}return c(),m()};function Mm(e){return e?e.replace(iA,fr):fr}var uA=Bs&&Bs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mf,"__esModule",{value:!0});mf.default=dA;var cA=uA(aA);function dA(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,cA.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,l=o.value;i?t(s,l,o):l&&(n=n||{},n[s]=l)}}),n}var oa={};Object.defineProperty(oa,"__esModule",{value:!0});oa.camelCase=void 0;var fA=/^--[a-zA-Z0-9_-]+$/,pA=/-([a-z])/g,mA=/^[^-]+$/,hA=/^-(webkit|moz|ms|o|khtml)-/,gA=/^-(ms)-/,xA=function(e){return!e||mA.test(e)||fA.test(e)},yA=function(e,t){return t.toUpperCase()},Om=function(e,t){return"".concat(t,"-")},vA=function(e,t){return t===void 0&&(t={}),xA(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(gA,Om):e=e.replace(hA,Om),e.replace(pA,yA))};oa.camelCase=vA;var wA=Bs&&Bs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},SA=wA(mf),kA=oa;function _c(e,t){var n={};return!e||typeof e!="string"||(0,SA.default)(e,function(r,i){r&&i&&(n[(0,kA.camelCase)(r,t)]=i)}),n}_c.default=_c;var bA=_c;const NA=Cl(bA),V0=H0("end"),hf=H0("start");function H0(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 CA(e){const t=hf(e),n=V0(e);if(t&&n)return{start:t,end:n}}function lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Lm(e.position):"start"in e||"end"in e?Lm(e):"line"in e||"column"in e?Ic(e):""}function Ic(e){return Dm(e&&e.line)+":"+Dm(e&&e.column)}function Lm(e){return Ic(e&&e.start)+"-"+Ic(e&&e.end)}function Dm(e){return e&&typeof e=="number"?e:1}class Ze extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!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&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=lo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&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}}Ze.prototype.file="";Ze.prototype.name="";Ze.prototype.reason="";Ze.prototype.message="";Ze.prototype.stack="";Ze.prototype.column=void 0;Ze.prototype.line=void 0;Ze.prototype.ancestors=void 0;Ze.prototype.cause=void 0;Ze.prototype.fatal=void 0;Ze.prototype.place=void 0;Ze.prototype.ruleId=void 0;Ze.prototype.source=void 0;const gf={}.hasOwnProperty,jA=new Map,EA=/[A-Z]/g,PA=new Set(["table","tbody","thead","tfoot","tr"]),AA=new Set(["td","th"]),W0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TA(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=zA(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=DA(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"?pf:qP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=G0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function G0(e,t,n){if(t.type==="element")return _A(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return IA(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MA(e,t,n);if(t.type==="mdxjsEsm")return RA(e,t);if(t.type==="root")return OA(e,t,n);if(t.type==="text")return LA(e,t)}function _A(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=pf,e.schema=i),e.ancestors.push(t);const o=Y0(e,t.tagName,!1),s=FA(e,t);let l=yf(e,t);return PA.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!BP(u):!0})),K0(e,s,o,t),xf(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function IA(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)}Oo(e,t.position)}function RA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Oo(e,t.position)}function MA(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=pf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Y0(e,t.name,!0),s=BA(e,t),l=yf(e,t);return K0(e,s,o,t),xf(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function OA(e,t,n){const r={};return xf(r,yf(e,t)),e.create(t,e.Fragment,r,n)}function LA(e,t){return t.value}function K0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function DA(e,t,n){return r;function r(i,o,s,l){const c=Array.isArray(s.children)?n:t;return l?c(o,s,l):c(o,s)}}function zA(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),u=hf(r);return t(i,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function FA(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&gf.call(t.properties,i)){const o=$A(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&AA.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function BA(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 s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Oo(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 l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Oo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function yf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:jA;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(an(e,e.length,0,t),e):t}const Bm={}.hasOwnProperty;function QA(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 ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=lr(/[A-Za-z]/),wt=lr(/[\dA-Za-z]/),JA=lr(/[#-'*+\--9=?A-Z^-~]/);function Rc(e){return e!==null&&(e<32||e===127)}const Mc=lr(/\d/),ZA=lr(/[\dA-Fa-f]/),eT=lr(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function me(e){return e===-2||e===-1||e===32}const tT=lr(/\p{P}|\p{S}/u),nT=lr(/\s/);function lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ii(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return me(u)?(e.enter(n),l(u)):t(u)}function l(u){return me(u)&&o++s))return;const E=t.events.length;let T=E,D,A;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){A=t.events[T][1].end;break}D=!0}for(x(r),C=E;Cv;){const j=n[b];t.containerState=j[1],j[0].exit.call(t,e)}n.length=v}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lT(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Um(e){if(e===null||ft(e)||nT(e))return 1;if(tT(e))return 2}function wf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Vm(f,-u),Vm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Pt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Pt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Pt(c,wf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Pt(c,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Pt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,an(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&me(C)?ke(e,y,"linePrefix",o+1)(C):y(C)}function y(C){return C===null||X(C)?e.check(Hm,h,b)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||X(C)?(e.exit("codeFlowValue"),y(C)):(e.consume(C),v)}function b(C){return e.exit("codeFenced"),t(C)}function j(C,E,T){let D=0;return A;function A(L){return C.enter("lineEnding"),C.consume(L),C.exit("lineEnding"),I}function I(L){return C.enter("codeFencedFence"),me(L)?ke(C,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===l?(C.enter("codeFencedFenceSequence"),V(L)):T(L)}function V(L){return L===l?(D++,C.consume(L),V):D>=s?(C.exit("codeFencedFenceSequence"),me(L)?ke(C,O,"whitespace")(L):O(L)):T(L)}function O(L){return L===null||X(L)?(C.exit("codeFencedFence"),E(L)):T(L)}}}function vT(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const qa={name:"codeIndented",tokenize:ST},wT={partial:!0,tokenize:kT};function ST(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ke(e,o,"linePrefix",4+1)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):X(c)?e.attempt(wT,s,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||X(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function kT(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):X(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",4+1)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):X(s)?i(s):n(s)}}const bT={name:"codeText",previous:CT,resolve:NT,tokenize:jT};function NT(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&&Wi(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),Wi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wi(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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function t1(e,t,n,r,i,o,s,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||Rc(x)?n(x):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(l),p(x)):x===null||x===60||X(x)?n(x):(e.consume(x),x===92?w:m)}function w(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function h(x){return!d&&(x===null||x===41||ft(x))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(x)):d999||m===null||m===91||m===93&&!u||m===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):X(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||X(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!me(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function r1(e,t,n,r,i,o){let s;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,u):n(p)}function u(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),u(s)):p===null?n(p):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===s||p===null||X(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:d)}function f(p){return p===s||p===92?(e.consume(p),d):d(p)}}function ao(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):me(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const MT={name:"definition",tokenize:LT},OT={partial:!0,tokenize:DT};function LT(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),s(m)}function s(m){return n1.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return ft(m)?ao(e,c)(m):c(m)}function c(m){return t1(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(OT,f,f)(m)}function f(m){return me(m)?ke(e,p,"whitespace")(m):p(m)}function p(m){return m===null||X(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function DT(e,t,n){return r;function r(l){return ft(l)?ao(e,i)(l):n(l)}function i(l){return r1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return me(l)?ke(e,s,"whitespace")(l):s(l)}function s(l){return l===null||X(l)?t(l):n(l)}}const zT={name:"hardBreakEscape",tokenize:FT};function FT(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 BT={name:"headingAtx",resolve:$T,tokenize:UT};function $T(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"},an(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function UT(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ft(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||X(d)?(e.exit("atxHeading"),t(d)):me(d)?ke(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||ft(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const VT=["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"],Gm=["pre","script","style","textarea"],HT={concrete:!0,name:"htmlFlow",resolveTo:KT,tokenize:YT},WT={partial:!0,tokenize:qT},GT={partial:!0,tokenize:QT};function KT(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 YT(e,t,n){const r=this;let i,o,s,l,u;return c;function c(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),o=!0,h):N===63?(e.consume(N),i=3,r.interrupt?t:k):en(N)?(e.consume(N),s=String.fromCharCode(N),S):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,l=0,w):en(N)?(e.consume(N),i=4,r.interrupt?t:k):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:k):n(N)}function w(N){const ie="CDATA[";return N===ie.charCodeAt(l++)?(e.consume(N),l===ie.length?r.interrupt?t:P:w):n(N)}function h(N){return en(N)?(e.consume(N),s=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||ft(N)){const ie=N===47,Oe=s.toLowerCase();return!ie&&!o&&Gm.includes(Oe)?(i=1,r.interrupt?t(N):P(N)):VT.includes(s.toLowerCase())?(i=6,ie?(e.consume(N),x):r.interrupt?t(N):P(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?y(N):v(N))}return N===45||wt(N)?(e.consume(N),s+=String.fromCharCode(N),S):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:P):n(N)}function y(N){return me(N)?(e.consume(N),y):A(N)}function v(N){return N===47?(e.consume(N),A):N===58||N===95||en(N)?(e.consume(N),b):me(N)?(e.consume(N),v):A(N)}function b(N){return N===45||N===46||N===58||N===95||wt(N)?(e.consume(N),b):j(N)}function j(N){return N===61?(e.consume(N),C):me(N)?(e.consume(N),j):v(N)}function C(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):me(N)?(e.consume(N),C):T(N)}function E(N){return N===u?(e.consume(N),u=null,D):N===null||X(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ft(N)?j(N):(e.consume(N),T)}function D(N){return N===47||N===62||me(N)?v(N):n(N)}function A(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||X(N)?P(N):me(N)?(e.consume(N),I):n(N)}function P(N){return N===45&&i===2?(e.consume(N),$):N===60&&i===1?(e.consume(N),H):N===62&&i===4?(e.consume(N),Y):N===63&&i===3?(e.consume(N),k):N===93&&i===5?(e.consume(N),F):X(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(WT,q,V)(N)):N===null||X(N)?(e.exit("htmlFlowData"),V(N)):(e.consume(N),P)}function V(N){return e.check(GT,O,q)(N)}function O(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),L}function L(N){return N===null||X(N)?V(N):(e.enter("htmlFlowData"),P(N))}function $(N){return N===45?(e.consume(N),k):P(N)}function H(N){return N===47?(e.consume(N),s="",_):P(N)}function _(N){if(N===62){const ie=s.toLowerCase();return Gm.includes(ie)?(e.consume(N),Y):P(N)}return en(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),_):P(N)}function F(N){return N===93?(e.consume(N),k):P(N)}function k(N){return N===62?(e.consume(N),Y):N===45&&i===2?(e.consume(N),k):P(N)}function Y(N){return N===null||X(N)?(e.exit("htmlFlowData"),q(N)):(e.consume(N),Y)}function q(N){return e.exit("htmlFlow"),t(N)}}function QT(e,t,n){const r=this;return i;function i(s){return X(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function qT(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(sa,t,n)}}const XT={name:"htmlText",tokenize:JT};function JT(e,t,n){const r=this;let i,o,s;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),j):k===63?(e.consume(k),v):en(k)?(e.consume(k),T):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),o=0,w):en(k)?(e.consume(k),y):n(k)}function d(k){return k===45?(e.consume(k),m):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),p):X(k)?(s=f,H(k)):(e.consume(k),f)}function p(k){return k===45?(e.consume(k),m):f(k)}function m(k){return k===62?$(k):k===45?p(k):f(k)}function w(k){const Y="CDATA[";return k===Y.charCodeAt(o++)?(e.consume(k),o===Y.length?h:w):n(k)}function h(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(s=h,H(k)):(e.consume(k),h)}function S(k){return k===93?(e.consume(k),x):h(k)}function x(k){return k===62?$(k):k===93?(e.consume(k),x):h(k)}function y(k){return k===null||k===62?$(k):X(k)?(s=y,H(k)):(e.consume(k),y)}function v(k){return k===null?n(k):k===63?(e.consume(k),b):X(k)?(s=v,H(k)):(e.consume(k),v)}function b(k){return k===62?$(k):v(k)}function j(k){return en(k)?(e.consume(k),C):n(k)}function C(k){return k===45||wt(k)?(e.consume(k),C):E(k)}function E(k){return X(k)?(s=E,H(k)):me(k)?(e.consume(k),E):$(k)}function T(k){return k===45||wt(k)?(e.consume(k),T):k===47||k===62||ft(k)?D(k):n(k)}function D(k){return k===47?(e.consume(k),$):k===58||k===95||en(k)?(e.consume(k),A):X(k)?(s=D,H(k)):me(k)?(e.consume(k),D):$(k)}function A(k){return k===45||k===46||k===58||k===95||wt(k)?(e.consume(k),A):I(k)}function I(k){return k===61?(e.consume(k),P):X(k)?(s=I,H(k)):me(k)?(e.consume(k),I):D(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)?(s=P,H(k)):me(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)?(s=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||ft(k)?D(k):(e.consume(k),O)}function L(k){return k===47||k===62||ft(k)?D(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 me(k)?ke(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):F(k)}function F(k){return e.enter("htmlTextData"),s(k)}}const Sf={name:"labelEnd",resolveAll:n_,resolveTo:r_,tokenize:i_},ZT={tokenize:o_},e_={tokenize:s_},t_={tokenize:l_};function n_(e){let t=-1;const n=[];for(;++t=3&&(c===null||X(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),me(c)?ke(e,l,"whitespace")(c):l(c))}}const ot={continuation:{tokenize:x_},exit:v_,name:"list",tokenize:g_},m_={partial:!0,tokenize:w_},h_={partial:!0,tokenize:y_};function g_(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,s=0;return l;function l(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Mc(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ls,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Mc(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(sa,r.interrupt?n:d,e.attempt(m_,p,f))}function d(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function f(m){return me(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function x_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sa,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!me(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(h_,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ot,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function y_(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function v_(e){e.exit(this.containerState.type)}function w_(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const s=r.events[r.events.length-1];return!me(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Km={name:"setextUnderline",resolveTo:S_,tokenize:k_};function S_(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 s={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",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function k_(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),me(c)?ke(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||X(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const b_={tokenize:N_};function N_(e){const t=this,n=e.attempt(sa,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(AT,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 C_={resolveAll:o1()},j_=i1("string"),E_=i1("text");function i1(e){return{resolveAll:o1(e==="text"?P_:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(d){return c(d)?o(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function $_(e,t){let n=-1;const r=[];let i;for(;++n0){const Rt=J.tokenStack[J.tokenStack.length-1];(Rt[1]||Qm).call(J,void 0,Rt[0])}for(U.position={start:In(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:In(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},ye=-1;++ye1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function iI(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 oI(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function a1(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 s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a1(e,t);const i={src:Ii(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 lI(e,t){const n={src:Ii(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 aI(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 uI(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return a1(e,t);const i={href:Ii(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 cI(e,t){const n={href:Ii(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 dI(e,t,n){const r=e.all(t),i=n?fI(n):u1(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l1}function pI(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 s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=hf(t.children[1]),u=V0(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function yI(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Jm(t.slice(i),i>0,!1)),o.join("")}function Jm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===qm||o===Xm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===qm||o===Xm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function SI(e,t){const n={type:"text",value:wI(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kI(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bI={blockquote:J_,break:Z_,code:eI,delete:tI,emphasis:nI,footnoteReference:rI,heading:iI,html:oI,imageReference:sI,image:lI,inlineCode:aI,linkReference:uI,link:cI,listItem:dI,list:pI,paragraph:mI,root:hI,strong:gI,table:xI,tableCell:vI,tableRow:yI,text:SI,thematicBreak:kI,toml:ys,yaml:ys,definition:ys,footnoteDefinition:ys};function ys(){}const c1=-1,la=0,uo=1,bl=2,kf=3,bf=4,Nf=5,Cf=6,d1=7,f1=8,Zm=typeof self=="object"?self:globalThis,NI=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case la:case c1:return n(s,i);case uo:{const l=n([],i);for(const u of s)l.push(r(u));return l}case bl:{const l=n({},i);for(const[u,c]of s)l[r(u)]=r(c);return l}case kf:return n(new Date(s),i);case bf:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case Nf:{const l=n(new Map,i);for(const[u,c]of s)l.set(r(u),r(c));return l}case Cf:{const l=n(new Set,i);for(const u of s)l.add(r(u));return l}case d1:{const{name:l,message:u}=s;return n(new Zm[l](u),i)}case f1:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new Zm[o](s),i)};return r},eh=e=>NI(new Map,e)(0),Br="",{toString:CI}={},{keys:jI}=Object,Gi=e=>{const t=typeof e;if(t!=="object"||!e)return[la,t];const n=CI.call(e).slice(8,-1);switch(n){case"Array":return[uo,Br];case"Object":return[bl,Br];case"Date":return[kf,Br];case"RegExp":return[bf,Br];case"Map":return[Nf,Br];case"Set":return[Cf,Br];case"DataView":return[uo,n]}return n.includes("Array")?[uo,n]:n.includes("Error")?[d1,n]:[bl,n]},vs=([e,t])=>e===la&&(t==="function"||t==="symbol"),EI=(e,t,n,r)=>{const i=(s,l)=>{const u=r.push(s)-1;return n.set(l,u),u},o=s=>{if(n.has(s))return n.get(s);let[l,u]=Gi(s);switch(l){case la:{let d=s;switch(u){case"bigint":l=f1,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([c1],s)}return i([l,d],s)}case uo:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}const d=[],f=i([l,d],s);for(const p of s)d.push(o(p));return f}case bl:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],f=i([l,d],s);for(const p of jI(s))(e||!vs(Gi(s[p])))&&d.push([o(p),o(s[p])]);return f}case kf:return i([l,s.toISOString()],s);case bf:{const{source:d,flags:f}=s;return i([l,{source:d,flags:f}],s)}case Nf:{const d=[],f=i([l,d],s);for(const[p,m]of s)(e||!(vs(Gi(p))||vs(Gi(m))))&&d.push([o(p),o(m)]);return f}case Cf:{const d=[],f=i([l,d],s);for(const p of s)(e||!vs(Gi(p)))&&d.push(o(p));return f}}const{message:c}=s;return i([l,{name:u,message:c}],s)};return o},th=(e,{json:t,lossy:n}={})=>{const r=[];return EI(!(t||n),!!t,new Map,r)(e),r},Nl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?eh(th(e,t)):structuredClone(e):(e,t)=>eh(th(e,t));function PI(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 AI(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function TI(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PI,r=e.options.footnoteBackLabel||AI,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&w.push({type:"text",value:" "});let y=typeof n=="string"?n:n(u,m);typeof y=="string"&&(y={type:"text",value:y}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const S=d[d.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 d.push(...w);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(c,x),l.push(x)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Nl(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const p1=function(e){if(e==null)return MI;if(typeof e=="function")return aa(e);if(typeof e=="object")return Array.isArray(e)?_I(e):II(e);if(typeof e=="string")return RI(e);throw new Error("Expected function, string, or object as test")};function _I(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=m1,w,h,S;if((!t||o(u,c,d[d.length-1]||void 0))&&(m=FI(n(u,d)),m[0]===nh))return m;if("children"in u&&u.children){const x=u;if(x.children&&m[0]!==DI)for(h=(r?x.children.length:-1)+s,S=d.concat(x);h>-1&&h0&&n.push({type:"text",value:` +`}),n}function rh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ih(e,t){const n=$I(e,t),r=n.one(e,void 0),i=TI(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function GI(e,t){return e&&"run"in e?async function(n,r){const i=ih(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ih(n,{file:r,...e||t})}}function oh(e){if(e)throw e}var Ds=Object.prototype.hasOwnProperty,g1=Object.prototype.toString,sh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,ah=function(t){return typeof Array.isArray=="function"?Array.isArray(t):g1.call(t)==="[object Array]"},uh=function(t){if(!t||g1.call(t)!=="[object Object]")return!1;var n=Ds.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ds.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ds.call(t,i)},ch=function(t,n){sh&&n.name==="__proto__"?sh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},dh=function(t,n){if(n==="__proto__")if(Ds.call(t,n)){if(lh)return lh(t,n).value}else return;return t[n]},KI=function e(){var t,n,r,i,o,s,l=arguments[0],u=1,c=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});us.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(c){const d=c;if(l&&n)throw d;return i(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const Xt={basename:qI,dirname:XI,extname:JI,join:ZI,sep:"/"};function qI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Go(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 s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function XI(e){if(Go(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 JI(e){Go(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===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 ZI(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tR(e,t){let n="",r=0,i=-1,o=0,s=-1,l,u;for(;++s<=e.length;){if(s2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function Go(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nR={cwd:rR};function rR(){return"/"}function zc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iR(e){if(typeof e=="string")e=new URL(e);else if(!zc(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 oR(e)}function oR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...w]=d;const h=r[p][1];Dc(h)&&Dc(m)&&(m=Ja(!0,h,m)),r[p]=[c,m,...w]}}}}const uR=new jf().freeze();function nu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ru(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function iu(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 ph(e){if(!Dc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ws(e){return cR(e)?e:new x1(e)}function cR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dR(e){return typeof e=="string"||fR(e)}function fR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hh=[],gh={allowDangerousHtml:!0},mR=/^(https?|ircs?|mailto|xmpp)$/i,hR=[{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 gR(e){const t=xR(e),n=yR(e);return vR(t.runSync(t.parse(n),n),e)}function xR(e){const t=e.rehypePlugins||hh,n=e.remarkPlugins||hh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gh}:gh;return uR().use(X_).use(n).use(GI,r).use(t)}function yR(e){const t=e.children||"",n=new x1;return typeof t=="string"&&(n.value=t),n}function vR(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||wR;for(const d of hR)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+pR+d.id,void 0);return h1(e,c),TA(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return s?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in Qa)if(Object.hasOwn(Qa,m)&&Object.hasOwn(d.properties,m)){const w=d.properties[m],h=Qa[m];(h===null||h.includes(d.tagName))&&(d.properties[m]=u(String(w||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,p)),m&&p&&typeof f=="number")return l&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function wR(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||mR.test(e.slice(0,t))?e:""}const Ef=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:s,...l},u)=>{const c=g.useRef(null),d=()=>{var f;(f=c.current)==null||f.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(f=>({id:f.id,role:f.role,content:f.content.slice(0,50)+"..."}))),d()},[t]),a.jsxs("div",{className:de("flex h-full flex-col",e),ref:u,...l,children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:a.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((f,p)=>a.jsxs("div",{className:de("flex gap-3 w-full",f.role==="user"?"justify-end":"justify-start"),children:[f.role!=="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:a.jsx(dt,{className:"h-4 w-4 text-primary-foreground"})}),a.jsxs("div",{className:de("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",f.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[a.jsxs("div",{className:"text-xs opacity-70",children:[f.role==="user"?"You":"Assistant"," • #",p+1]}),a.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:a.jsx(gR,{components:{p:({children:m})=>a.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>a.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>a.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>a.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?a.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):a.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>a.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>a.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>a.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>a.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>a.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>a.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>a.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:f.content})})]}),f.role==="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:a.jsx(ry,{className:"h-4 w-4"})})]},`${f.id}-${p}`)),a.jsx("div",{ref:c})]}),a.jsx("div",{className:"border-t p-4",children:a.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[a.jsx(Yl,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),i(f))}}),o?a.jsx(Z,{type:"button",onClick:s,variant:"outline",size:"icon",children:a.jsx(GN,{className:"h-4 w-4"})}):a.jsx(Z,{type:"submit",disabled:!n.trim(),size:"icon",children:a.jsx(zN,{className:"h-4 w-4"})})]})})]})});Ef.displayName="Chat";const Yt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function y1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function SR(){return y1()}class kR{getAllSessions(){const t=localStorage.getItem(Yt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:y1(),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(Yt.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(Yt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Yt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Yt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:SR(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Yt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Yt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Yt.currentSession,t)}clear(){localStorage.removeItem(Yt.sessions),localStorage.removeItem(Yt.currentSession)}}const Ce=new kR;function v1(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[s,l]=g.useState(null),[u,c]=g.useState(""),[d,f]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,h]=g.useState(r),[S,x]=g.useState(.7),[y,v]=g.useState(1024),b=zt.useMemo(()=>{var L;const O=i.find($=>$.id===s)||null;return console.log("useChat - currentSession updated:",{sessionId:s,found:!!O,messageCount:((L=O==null?void 0:O.messages)==null?void 0:L.length)||0}),O},[i,s]),j=zt.useMemo(()=>{const O=(b==null?void 0:b.messages)||[];return console.log("useChat - messages computed:",O.length,O.map(L=>({id:L.id,role:L.role}))),O},[b==null?void 0:b.messages]);g.useEffect(()=>{const O=Ce.getAllSessions();o(O);const L=Ce.getCurrentSession();L?l(L.id):O.length>0&&(l(O[0].id),Ce.setCurrentSession(O[0].id))},[]);const C=g.useCallback(()=>{const O=Ce.createSession(void 0,p,w),L=Ce.getAllSessions();return o([...L]),l(O.id),Ce.setCurrentSession(O.id),O.id},[p,w]),E=g.useCallback(O=>{l(O),Ce.setCurrentSession(O)},[]),T=g.useCallback(O=>{Ce.deleteSession(O);const L=Ce.getAllSessions();o([...L]),s===O&&(L.length>0?(l(L[0].id),Ce.setCurrentSession(L[0].id)):l(null))},[s]),D=g.useCallback((O,L)=>{Ce.updateSession(O,{title:L});const $=Ce.getAllSessions();o([...$])},[]),A=g.useCallback(O=>{if(!s)return;Ce.addMessageToSession(s,O);const L=Ce.getAllSessions();o([...L])},[s]),I=g.useCallback(async()=>{var _,F;if(!u.trim()||d.isLoading)return;let O=s;O||(O=C());const L=u.trim();if(c(""),f({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(ie=>ie.role!=="system"))==null?void 0:F.map(ie=>({role:ie.role,content:ie.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 ie=await q.json();throw new Error(ie.detail||`HTTP error! status: ${q.status}`)}const N=await q.json();if(O){Ce.addMessageToSession(O,{role:"assistant",content:N.content,thinking_content:N.thinking_content,model_used:N.model_used,supports_thinking:N.supports_thinking});const ie=Ce.getAllSessions();o([...ie])}f({isLoading:!1,error:null})}catch(k){const Y=k instanceof Error?k.message:"An error occurred";if(f({isLoading:!1,error:Y}),O){Ce.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`});const q=Ce.getAllSessions();o([...q])}}},[u,d.isLoading,s,C,A,w,j.length,t,p,S,y]),P=g.useCallback(()=>{f({isLoading:!1,error:null})},[]),V=g.useCallback(()=>{Ce.clear(),o([]),l(null)},[]);return{sessions:i,currentSession:b,currentSessionId:s,createNewSession:C,selectSession:E,deleteSession:T,renameSession:D,clearAllSessions:V,messages:j,input:u,setInput:c,sendMessage:I,stopGeneration:P,isLoading:d.isLoading,error:d.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:h,temperature:S,setTemperature:x,maxTokens:y,setMaxTokens:v}}function bR(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:s,input:l,setInput:u,sendMessage:c,stopGeneration:d,isLoading:f,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:h,temperature:S,setTemperature:x,maxTokens:y,setMaxTokens:v}=v1(),[b,j]=g.useState(!1),[C,E]=g.useState(!1),[T,D]=g.useState(null),[A,I]=g.useState(!1),[P,V]=g.useState(null),[O,L]=g.useState(!1),[$,H]=g.useState(""),[_,F]=g.useState(""),[k,Y]=g.useState([]),q=()=>{if(!$.trim())return;const M={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(M),localStorage.setItem("savedAssistants",JSON.stringify(W)),H(""),F(""),L(!1),alert("助手保存成功!可在模型目录中查看。")},N=[{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."}],ie=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];g.useEffect(()=>{oe(),Oe()},[]);const Oe=()=>{try{const M=localStorage.getItem("loadAssistantConfig");if(M){const W=JSON.parse(M);m(W.model),h(W.systemPrompt||""),x(W.temperature||.7),v(W.maxTokens||1024),localStorage.removeItem("loadAssistantConfig"),setTimeout(()=>{alert(`Assistant "${W.name}" loaded successfully!`)},500)}}catch(M){console.error("Failed to load assistant configuration:",M)}};g.useEffect(()=>{if(p&&!k.find(M=>M.model_name===p)){const M=k[0];M&&m(M.model_name)}},[k,p,m]),g.useEffect(()=>{(async()=>{if(!p||!k.length)return;const W=k.find(ve=>ve.model_name===p);if(!W)return;const Q=`${window.location.protocol}//${window.location.host}`;if(W.type==="local"&&!W.is_loaded){V(W),I(!0);return}const xe=k.filter(ve=>ve.type==="local"&&ve.is_loaded&&ve.model_name!==p);for(const ve of xe)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ve.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ve.model_name}`)}catch(mt){console.error(`Error auto-unloading model ${ve.model_name}:`,mt)}xe.length>0&&oe()})()},[p,k]);const ue=async()=>{if(P){I(!1),D(P.model_name);try{const M=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${M}/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}`),oe();else{console.error(`❌ Failed to load model: ${P.model_name}`);const Q=k.find(xe=>xe.type==="api");Q&&m(Q.model_name)}}catch(M){console.error("Error loading model:",M);const W=k.find(Q=>Q.type==="api");W&&m(W.model_name)}finally{D(null),V(null)}}},K=()=>{I(!1),V(null);const M=k.find(W=>W.type==="api");M&&m(M.model_name)};g.useEffect(()=>{const M=async()=>{const W=`${window.location.protocol}//${window.location.host}`,Q=k.filter(xe=>xe.type==="local"&&xe.is_loaded);for(const xe of Q)try{await fetch(`${W}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:xe.model_name})}),console.log(`✅ Cleanup: unloaded ${xe.model_name}`)}catch(ve){console.error(`Error cleaning up model ${xe.model_name}:`,ve)}};return()=>{M()}},[k]);const oe=async()=>{try{const M=`${window.location.protocol}//${window.location.host}`,W=await fetch(`${M}/models`);if(W.ok){const Q=await W.json();if(Y(Q.models),Q.current_model&&p!==Q.current_model)m(Q.current_model);else if(!p&&Q.models.length>0){const ve=Q.models.find(mt=>mt.type==="api")||Q.models[0];m(ve.model_name)}}}catch(M){console.error("Failed to fetch models:",M)}},be=M=>{u(M)};return a.jsxs("div",{className:"min-h-screen bg-background flex",children:[a.jsx("div",{className:` + ${b?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:a.jsxs("div",{className:"p-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),a.jsxs(Z,{onClick:r,size:"sm",children:[a.jsx(xr,{className:"h-4 w-4 mr-1"}),"New"]})]}),a.jsx("div",{className:"space-y-2",children:e.map(M=>a.jsxs(se,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===M.id?"bg-accent border-primary":""}`,onClick:()=>i(M.id),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:M.title}),a.jsx(Z,{size:"sm",variant:"ghost",onClick:W=>{W.stopPropagation(),o(M.id)},className:"h-6 w-6 p-0",children:a.jsx(Wl,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[M.messages.length," messages"]})]},M.id))})]})}),b&&a.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>j(!1)}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsxs("div",{className:"flex h-14 items-center px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>j(!b),className:"lg:hidden",children:b?a.jsx(Jx,{className:"h-4 w-4"}):a.jsx(Zx,{className:"h-4 w-4"})}),a.jsx(kn,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&a.jsxs(Ee,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[a.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>j(!b),className:"hidden lg:flex flex-shrink-0",children:[a.jsx(Xx,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),a.jsxs(Z,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx(yN,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"View code"}),a.jsx("span",{className:"sm:hidden",children:"Code"})]}),a.jsxs(Z,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx(eC,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),a.jsxs(Z,{variant:"outline",size:"sm",className:"flex-shrink-0",onClick:()=>L(!0),children:[a.jsx(ey,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Save Assistant"})]}),a.jsxs(Z,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[a.jsx(ty,{className:"h-4 w-4 mr-2"}),a.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[a.jsxs("div",{className:"flex-1 flex flex-col",children:[s.length===0&&a.jsx("div",{className:"p-6 border-b",children:a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsx(tt,{className:"text-base",children:"Start with a sample prompt"})}),a.jsx(fe,{children:a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:ie.map((M,W)=>a.jsx(Z,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>be(M.prompt),disabled:f,children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:M.title}),a.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:M.description})]})},W))})})]})}),a.jsx(Ef,{messages:s.map(M=>({id:M.id,role:M.role,content:M.content,createdAt:new Date(M.timestamp)})),input:l,handleInputChange:M=>u(M.target.value),handleSubmit:async M=>{M.preventDefault(),!(!p||!k.find(W=>W.model_name===p))&&await c()},isGenerating:f,stop:d,className:"flex-1"})]}),a.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:a.jsxs("div",{className:"p-4 space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vo,{className:"h-4 w-4"}),a.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsx(tt,{className:"text-sm",children:"Model Selection"})}),a.jsxs(fe,{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Ue,{className:"text-xs font-medium mb-2",children:"Active Model"}),a.jsxs(Wv,{value:p||"",onValueChange:m,children:[a.jsx(rf,{className:"w-full",children:a.jsx(Gv,{placeholder:"Select a model...",children:p&&(()=>{const M=k.find(Q=>Q.model_name===p);if(!M)return p;const W=M.type==="api";return a.jsxs("div",{className:"flex items-center gap-2",children:[W?a.jsx(pl,{className:"h-4 w-4 text-blue-500"}):M.supports_thinking?a.jsx(on,{className:"h-4 w-4 text-purple-500"}):a.jsx(yi,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{className:"truncate",children:M.name}),T===p?a.jsx(Ee,{variant:"outline",className:"text-xs",children:"Loading..."}):a.jsx(Ee,{variant:"outline",className:"text-xs",children:W?"API":M.is_loaded?"Loaded":"Available"})]})})()})}),a.jsxs(of,{children:[a.jsxs(Cm,{children:[a.jsx(wc,{children:"🌐 API Models"}),k.filter(M=>M.type==="api").map(M=>a.jsx(Sl,{value:M.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(pl,{className:"h-4 w-4 text-blue-500"}),a.jsx("span",{children:M.name}),a.jsx(Ee,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},M.model_name))]}),a.jsxs(Cm,{children:[a.jsx(wc,{children:"💻 Local Models"}),k.filter(M=>M.type==="local").map(M=>a.jsx(Sl,{value:M.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[M.supports_thinking?a.jsx(on,{className:"h-4 w-4 text-purple-500"}):a.jsx(yi,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{children:M.name}),T===M.model_name?a.jsx(Ee,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):M.is_loaded?a.jsx(Ee,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):a.jsx(Ee,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},M.model_name))]})]})]})]}),a.jsx("div",{className:"pt-2 border-t",children:a.jsx(Z,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:a.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[a.jsx(Vl,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsx(tt,{className:"text-sm",children:"Parameters"})}),a.jsxs(fe,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs(Ue,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),a.jsx(Io,{value:[S],onValueChange:M=>x(M[0]),min:0,max:2,step:.01,className:"mt-2",disabled:f}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),a.jsxs("div",{children:[a.jsxs(Ue,{className:"text-xs font-medium",children:["Max Tokens: ",y]}),a.jsx(Io,{value:[y],onValueChange:M=>v(M[0]),min:100,max:4096,step:100,className:"mt-2",disabled:f})]})]})]}),a.jsx(se,{children:a.jsxs(nP,{open:C,onOpenChange:E,children:[a.jsx(Xe,{children:a.jsx(rP,{asChild:!0,children:a.jsxs(Z,{variant:"ghost",className:"w-full justify-between p-0",disabled:f,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kn,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&a.jsx(Ee,{variant:"secondary",className:"text-xs",children:"Custom"})]}),a.jsx(zd,{className:`h-4 w-4 transition-transform ${C?"transform rotate-180":""}`})]})})}),a.jsx(iP,{children:a.jsxs(fe,{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Ue,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),a.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:N.map(M=>a.jsx(Z,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>h(M.prompt),disabled:f,children:M.name},M.name))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx(Ue,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&a.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>h(""),className:"h-6 px-2 text-xs",disabled:f,children:[a.jsx(ON,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),a.jsx("textarea",{id:"system-prompt",value:w,onChange:M=>h(M.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:f}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),a.jsx(jm,{open:A,onOpenChange:I,children:a.jsxs(Sc,{children:[a.jsxs(kc,{children:[a.jsxs(Nc,{className:"flex items-center gap-2",children:[a.jsx(Hl,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),a.jsx(Cc,{asChild:!0,children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{children:["You're about to load ",a.jsx("strong",{children:P==null?void 0:P.name})," locally."]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(JN,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),a.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Storage:"})," ",P==null?void 0:P.size_gb]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"RAM:"})," ~",P==null?void 0:P.size_gb," (while running)"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:a.jsxs("div",{className:"text-sm text-blue-700",children:[a.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),a.jsx("p",{className:"mt-1",children:P==null?void 0:P.description}),(P==null?void 0:P.supports_thinking)&&a.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[a.jsx(on,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),a.jsxs(bc,{children:[a.jsx(Ec,{onClick:K,children:"Cancel"}),a.jsx(jc,{onClick:ue,children:"Load Model"})]})]})}),a.jsx(jm,{open:O,onOpenChange:L,children:a.jsxs(Sc,{children:[a.jsxs(kc,{children:[a.jsxs(Nc,{className:"flex items-center gap-2",children:[a.jsx(dt,{className:"h-5 w-5 text-blue-500"}),"Save Current Configuration as Assistant"]}),a.jsx(Cc,{children:"Save your current model settings and system prompt as a reusable assistant."})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"assistant-name",children:"Assistant Name"}),a.jsx(hl,{id:"assistant-name",value:$,onChange:M=>H(M.target.value),placeholder:"e.g., Code Review Expert",className:"mt-1"})]}),a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"assistant-description",children:"Description"}),a.jsx(Yl,{id:"assistant-description",value:_,onChange:M=>F(M.target.value),placeholder:"Describe what this assistant is good at...",rows:3,className:"mt-1"})]}),a.jsxs("div",{className:"bg-muted p-3 rounded-md text-sm",children:[a.jsx("div",{className:"font-medium mb-2",children:"Current Configuration:"}),a.jsxs("div",{className:"space-y-1 text-muted-foreground",children:[a.jsxs("div",{children:["Model: ",p]}),a.jsxs("div",{children:["Temperature: ",S]}),a.jsxs("div",{children:["Max Tokens: ",y]}),a.jsxs("div",{children:["System Prompt: ",w?w.slice(0,50)+"...":"None"]})]})]})]}),a.jsxs(bc,{children:[a.jsx(Ec,{onClick:()=>L(!1),children:"Cancel"}),a.jsx(jc,{onClick:q,disabled:!$.trim(),children:"Save Assistant"})]})]})})]})}function NR(){const[e,t]=g.useState([]),[n,r]=g.useState(null),[i,o]=g.useState(!1),{sessions:s,currentSessionId:l,createNewSession:u,selectSession:c,deleteSession:d,messages:f,input:p,setInput:m,sendMessage:w,stopGeneration:h,isLoading:S,setSelectedModel:x,setSystemPrompt:y,setTemperature:v,setMaxTokens:b}=v1();g.useEffect(()=>{j(),C()},[]);const j=()=>{try{const A=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(A),!n&&A.length>0&&E(A[0])}catch(A){console.error("Failed to load assistants:",A)}},C=()=>{const A=localStorage.getItem("testAssistantConfig"),I=localStorage.getItem("loadAssistantConfig");if(A)try{const P=JSON.parse(A);r(P),T(P),localStorage.removeItem("testAssistantConfig")}catch(P){console.error("Failed to load test assistant config:",P)}else if(I)try{const P=JSON.parse(I);r(P),T(P),localStorage.removeItem("loadAssistantConfig")}catch(P){console.error("Failed to load assistant config:",P)}},E=A=>{r(A),T(A),u()},T=A=>{x(A.model),y(A.instructions),v(A.temperature),b(A.maxTokens)},D=()=>{n&&(localStorage.setItem("editAssistantConfig",JSON.stringify(n)),window.location.href="/assistant-builder")};return a.jsxs("div",{className:"flex h-screen bg-background",children:[a.jsxs("div",{className:`${i?"w-80":"w-0"} transition-all duration-200 overflow-hidden border-r bg-background/95`,children:[a.jsxs("div",{className:"p-4 border-b",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"My Assistants"}),a.jsx(Z,{size:"sm",onClick:()=>window.location.href="/assistant-builder",children:a.jsx(xr,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"space-y-2",children:[e.map(A=>a.jsx(se,{className:`cursor-pointer hover:bg-accent transition-colors ${(n==null?void 0:n.id)===A.id?"ring-2 ring-blue-500":""}`,onClick:()=>E(A),children:a.jsx(fe,{className:"p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(dt,{className:"h-4 w-4 mt-1 text-purple-600"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-medium text-sm truncate",children:A.name}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description||"No description"}),a.jsx(Ee,{variant:"secondary",className:"text-xs mt-1",children:A.model})]})]})})},A.id)),e.length===0&&a.jsxs("div",{className:"text-center py-8",children:[a.jsx(dt,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No assistants yet"}),a.jsx(Z,{size:"sm",variant:"outline",className:"mt-2",onClick:()=>window.location.href="/assistant-builder",children:"Create One"})]})]})]}),a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Sessions"}),a.jsx(Z,{size:"sm",variant:"ghost",onClick:u,children:a.jsx(xr,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"space-y-1",children:s.map(A=>a.jsxs("div",{className:`flex items-center justify-between p-2 rounded-md cursor-pointer hover:bg-accent ${l===A.id?"bg-accent":""}`,children:[a.jsxs("div",{className:"flex-1 min-w-0",onClick:()=>c(A.id),children:[a.jsx("p",{className:"text-xs truncate",children:A.title}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.messages.length," messages"]})]}),a.jsx(Z,{size:"sm",variant:"ghost",onClick:()=>d(A.id),className:"h-6 w-6 p-0",children:a.jsx(Wl,{className:"h-3 w-3"})})]},A.id))})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col",children:[a.jsx("div",{className:"border-b p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>o(!i),children:i?a.jsx(Jx,{className:"h-4 w-4"}):a.jsx(Zx,{className:"h-4 w-4"})}),n?a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:a.jsx(dt,{className:"h-4 w-4 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold",children:n.name}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})]}):a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold",children:"Select an Assistant"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose an assistant to start chatting"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!n&&e.length===0&&a.jsxs(Z,{onClick:()=>window.location.href="/assistant-builder",children:[a.jsx(xr,{className:"h-4 w-4 mr-2"}),"Create Assistant"]}),n&&a.jsxs(a.Fragment,{children:[a.jsx(Z,{variant:"outline",size:"sm",onClick:D,children:a.jsx(Vo,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ee,{variant:"secondary",className:"text-xs",children:n.model}),a.jsxs(Ee,{variant:"outline",className:"text-xs",children:["T: ",n.temperature]}),a.jsxs(Ee,{variant:"outline",className:"text-xs",children:["Max: ",n.maxTokens]})]})]})]})]})}),a.jsx("div",{className:"flex-1 overflow-hidden",children:n?a.jsx(Ef,{messages:f,input:p,handleInputChange:A=>m(A.target.value),handleSubmit:A=>{A.preventDefault(),w()},isGenerating:S,stop:h}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center max-w-md",children:[a.jsx(kn,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),a.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Welcome to Chat Interface"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Select an assistant from the sidebar to start a conversation, or create a new one."}),a.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.length>0?a.jsxs(Z,{onClick:()=>o(!0),children:[a.jsx(Xx,{className:"h-4 w-4 mr-2"}),"Choose Assistant"]}):null,a.jsxs(Z,{onClick:()=>window.location.href="/assistant-builder",children:[a.jsx(xr,{className:"h-4 w-4 mr-2"}),"Create Assistant"]})]})]})})})]})]})}function CR(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[i,o]=g.useState({name:"",description:"",instructions:"",model:"",temperature:.7,maxTokens:1024,capabilities:[]}),[s,l]=g.useState(!1),[u,c]=g.useState(!1);g.useEffect(()=>{d(),f()},[]);const d=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,S=await fetch(`${h}/models`);if(!S.ok)throw new Error(`Failed to fetch models: ${S.status}`);const x=await S.json();if(t(x.models),!i.model&&x.models.length>0){const y=x.models.filter(b=>b.type==="api"),v=y.length>0?y[0].model_name:x.models[0].model_name;o(b=>({...b,model:v}))}}catch(h){console.error("Error fetching models:",h)}finally{r(!1)}},f=()=>{const h=localStorage.getItem("editAssistantConfig");if(h)try{const S=JSON.parse(h);o(S),c(!0),localStorage.removeItem("editAssistantConfig")}catch(S){console.error("Failed to load existing assistant config:",S)}},p=async()=>{if(!i.name.trim()||!i.instructions.trim()){alert("Please provide a name and instructions for your assistant.");return}l(!0);try{const h={...i,id:i.id||Date.now().toString(),createdAt:i.createdAt||new Date().toISOString(),updatedAt:new Date().toISOString()},S=JSON.parse(localStorage.getItem("savedAssistants")||"[]");if(u&&i.id){const x=S.findIndex(y=>y.id===i.id);x!==-1&&(S[x]=h)}else S.push(h);localStorage.setItem("savedAssistants",JSON.stringify(S)),alert(`Assistant "${i.name}" saved successfully!`),o({name:"",description:"",instructions:"",model:e.length>0?e[0].model_name:"",temperature:.7,maxTokens:1024,capabilities:[]}),c(!1)}catch(h){console.error("Error saving assistant:",h),alert("Failed to save assistant. Please try again.")}finally{l(!1)}},m=()=>{if(!i.name.trim()||!i.instructions.trim()){alert("Please provide a name and instructions before testing.");return}localStorage.setItem("testAssistantConfig",JSON.stringify({...i,systemPrompt:i.instructions})),window.location.href="/playground"},w=[{title:"Code Review Expert",description:"Analyzes code for quality, security, and best practices",prompt:`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.`},{title:"Writing Assistant",description:"Helps improve academic and professional writing",prompt:`You are an experienced 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. **Style**: Appropriate tone, engaging voice +4. **Grammar & Mechanics**: Correct errors, improve sentence variety + +Provide specific feedback with examples and rewrite suggestions where helpful.`},{title:"Creative Brainstorming Partner",description:"Generates creative ideas and helps develop concepts",prompt:`You are a creative brainstorming partner with expertise in idea generation. Help users by: + +1. **Idea Generation**: Provide diverse, creative, and original ideas +2. **Concept Development**: Help refine and expand on initial concepts +3. **Problem Solving**: Approach challenges from multiple angles +4. **Innovation**: Suggest unconventional solutions and approaches + +Be enthusiastic, encouraging, and think outside the box.`}];return n?a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(on,{className:"h-8 w-8 animate-pulse mx-auto mb-4 text-blue-600"}),a.jsx("p",{children:"Loading models..."})]})}):a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"max-w-6xl mx-auto p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>window.location.href="/assistants",className:"flex items-center gap-2",children:[a.jsx(rN,{className:"h-4 w-4"}),"Back"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:a.jsx(dt,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:u?"Edit Assistant":"Create Assistant"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Design a custom AI assistant with specialized capabilities"})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(Z,{variant:"outline",onClick:m,disabled:!i.name.trim()||!i.instructions.trim(),children:[a.jsx(kn,{className:"h-4 w-4 mr-2"}),"Test Chat"]}),a.jsx(Z,{onClick:p,disabled:s||!i.name.trim()||!i.instructions.trim(),children:s?a.jsxs(a.Fragment,{children:[a.jsx(yi,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ey,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})})]})]})})}),a.jsxs("div",{className:"max-w-6xl mx-auto p-6 grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(ry,{className:"h-5 w-5"}),"Basic Information"]})}),a.jsxs(fe,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"name",children:"Assistant Name"}),a.jsx(hl,{id:"name",value:i.name,onChange:h=>o(S=>({...S,name:h.target.value})),placeholder:"e.g., Code Review Expert, Writing Assistant",className:"mt-1"})]}),a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"description",children:"Description"}),a.jsx(hl,{id:"description",value:i.description,onChange:h=>o(S=>({...S,description:h.target.value})),placeholder:"Brief description of what this assistant does",className:"mt-1"})]})]})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(on,{className:"h-5 w-5"}),"Model & Parameters"]})}),a.jsxs(fe,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"model",children:"AI Model"}),a.jsxs(Wv,{value:i.model,onValueChange:h=>o(S=>({...S,model:h})),children:[a.jsx(rf,{className:"mt-1",children:a.jsx(Gv,{placeholder:"Choose a model"})}),a.jsx(of,{children:e.map(h=>a.jsx(Sl,{value:h.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ee,{variant:h.type==="api"?"default":"secondary",className:"text-xs",children:h.type==="api"?"API":"Local"}),h.name]})},h.model_name))})]})]}),a.jsxs("div",{children:[a.jsxs(Ue,{htmlFor:"temperature",children:["Temperature: ",i.temperature]}),a.jsx(Io,{id:"temperature",min:0,max:1,step:.1,value:[i.temperature],onValueChange:([h])=>o(S=>({...S,temperature:h})),className:"mt-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),a.jsxs("div",{children:[a.jsxs(Ue,{htmlFor:"maxTokens",children:["Max Tokens: ",i.maxTokens]}),a.jsx(Io,{id:"maxTokens",min:128,max:4096,step:128,value:[i.maxTokens],onValueChange:([h])=>o(S=>({...S,maxTokens:h})),className:"mt-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Maximum length of the response"})]})]})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(Vo,{className:"h-5 w-5"}),"Instructions"]})}),a.jsx(fe,{children:a.jsxs("div",{children:[a.jsx(Ue,{htmlFor:"instructions",children:"System Instructions"}),a.jsx(Yl,{id:"instructions",value:i.instructions,onChange:h=>o(S=>({...S,instructions:h.target.value})),placeholder:"Define how your assistant should behave, its role, and capabilities...",className:"mt-1 min-h-[300px] text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"These instructions define your assistant's behavior, expertise, and response style."})]})})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(To,{className:"h-5 w-5"}),"Example Templates"]})}),a.jsx(fe,{children:a.jsx("div",{className:"space-y-3",children:w.map(h=>a.jsx("div",{className:"p-3 border rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>o(S=>({...S,instructions:h.prompt,name:S.name||h.title,description:S.description||h.description})),children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm",children:h.title}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.description})]}),a.jsx(Fd,{className:"h-4 w-4 text-muted-foreground"})]})},h.title))})})]}),a.jsx(se,{className:"bg-blue-50 border-blue-200",children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Bd,{className:"h-5 w-5 text-blue-600 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-blue-900",children:"Tips for Great Instructions"}),a.jsxs("ul",{className:"text-sm text-blue-700 mt-2 space-y-1",children:[a.jsx("li",{children:"• Be specific about the assistant's role and expertise"}),a.jsx("li",{children:"• Include examples of desired behavior"}),a.jsx("li",{children:"• Define the tone and style of responses"}),a.jsx("li",{children:"• Specify any constraints or guidelines"})]})]})]})})})]})]})]})}function jR(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[i,o]=g.useState(null);g.useEffect(()=>{s()},[]);const s=async()=>{try{const c=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${c}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const f=await d.json();t(f.models)}catch(c){console.error("Error fetching models:",c)}finally{r(!1)}},l=async c=>{o(c);try{const d=`${window.location.protocol}//${window.location.host}`,f=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:c})});if(!f.ok)throw new Error(`Failed to load model: ${f.status}`);s()}catch(d){console.error("Error loading model:",d)}finally{o(null)}},u=async c=>{o(c);try{const d=`${window.location.protocol}//${window.location.host}`,f=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:c})});if(!f.ok)throw new Error(`Failed to unload model: ${f.status}`);s()}catch(d){console.error("Error unloading model:",d)}finally{o(null)}};return n?a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsx(oc,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"max-w-6xl mx-auto p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:a.jsx(Vl,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),a.jsxs(Z,{onClick:()=>window.location.href="/playground",className:"flex items-center gap-2",children:[a.jsx(yi,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(se,{className:"bg-blue-50 border-blue-200",children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Bd,{className:"h-5 w-5 text-blue-600 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Load models to use them in the playground. Models are cached locally for faster access. Each model requires significant storage space and initial download time."})]})]})})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[a.jsx(pl,{className:"h-5 w-5"}),"API Models",a.jsx(Ee,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(c=>c.type==="api").map(c=>a.jsx(xh,{model:c,modelLoading:i,onLoad:l,onUnload:u},c.model_name))})]}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[a.jsx(qx,{className:"h-5 w-5"}),"Local Models",a.jsx(Ee,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(c=>c.type==="local").map(c=>a.jsx(xh,{model:c,modelLoading:i,onLoad:l,onUnload:u},c.model_name))})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(on,{className:"h-5 w-5"}),"Model Statistics"]})}),a.jsx(fe,{children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.filter(c=>c.type==="api").length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"API Models"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(c=>c.type==="local").length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Local Models"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-orange-600",children:e.filter(c=>c.is_loaded).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(c=>c.supports_thinking).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function xh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,s=e.is_loaded;return a.jsxs(se,{className:"hover:shadow-md transition-shadow",children:[a.jsx(Xe,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs(tt,{className:"text-base flex items-center gap-2",children:[i?a.jsx(pl,{className:"h-4 w-4 text-blue-600"}):a.jsx(qx,{className:"h-4 w-4 text-green-600"}),e.name]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),s&&a.jsx(hN,{className:"h-5 w-5 text-green-600"})]})}),a.jsxs(fe,{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Size:"}),a.jsx(Ee,{variant:"outline",className:"text-xs",children:e.size_gb})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),a.jsx(Ee,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Type:"}),a.jsx(Ee,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Features:"}),a.jsxs(Ee,{variant:"outline",className:"text-xs",children:[a.jsx(on,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),a.jsx("div",{className:"pt-2",children:s?a.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?a.jsx(oc,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(Wl,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):a.jsxs(Z,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?a.jsx(oc,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(Hl,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function ER(){const[e,t]=g.useState([]);g.useEffect(()=>{n()},[]);const n=()=>{try{const l=JSON.parse(localStorage.getItem("savedAssistants")||"[]");t(l)}catch(l){console.error("Failed to load assistants:",l)}},r=l=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(l)),window.location.href="/playground"},i=l=>{const u=e.filter(c=>c.id!==l);t(u),localStorage.setItem("savedAssistants",JSON.stringify(u))},o=l=>{alert(`"${l.name}" has been shared to the community! (This is a demo - in production, it would be submitted for review.)`)},s=()=>{window.location.href="/playground"};return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"max-w-6xl mx-auto p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center",children:a.jsx(dt,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"My Assistants"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your custom AI assistants and configurations"})]})]}),a.jsxs(Z,{onClick:s,className:"flex items-center gap-2",children:[a.jsx(xr,{className:"h-4 w-4"}),"Create New Assistant"]})]})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(se,{className:"bg-purple-50 border-purple-200",children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(To,{className:"h-5 w-5 text-purple-600 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-purple-900",children:"Custom AI Assistants"}),a.jsx("p",{className:"text-sm text-purple-700 mt-1",children:"Create specialized AI assistants by configuring models, prompts, and parameters in the Playground. Save different configurations for various tasks and workflows."})]})]})})}),e.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(l=>a.jsx(PR,{assistant:l,onUse:()=>r(l),onDelete:()=>i(l.id),onShare:()=>o(l)},l.id))}):a.jsxs(se,{className:"text-center py-16",children:[a.jsx(dt,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),a.jsx("h3",{className:"text-xl font-medium mb-3",children:"No assistants yet"}),a.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Create your first AI assistant by configuring parameters and prompts in the Playground, then saving your configuration for future use."}),a.jsxs(Z,{onClick:s,size:"lg",className:"flex items-center gap-2 mx-auto",children:[a.jsx(xr,{className:"h-5 w-5"}),"Create Your First Assistant"]})]}),e.length>0&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Assistants"})]}),a.jsx(dt,{className:"h-8 w-8 text-purple-600"})]})})}),a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-blue-600",children:new Set(e.map(l=>l.model)).size}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Models Used"})]}),a.jsx(kn,{className:"h-8 w-8 text-blue-600"})]})})}),a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(l=>l.createdAt&&new Date(l.createdAt)>new Date(Date.now()-7*24*60*60*1e3)).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Created This Week"})]}),a.jsx(To,{className:"h-8 w-8 text-green-600"})]})})})]})]})})]})}function PR({assistant:e,onUse:t,onDelete:n,onShare:r}){return a.jsxs(se,{className:"hover:shadow-lg transition-all duration-200 hover:-translate-y-1",children:[a.jsx(Xe,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs(tt,{className:"text-base flex items-center gap-2",children:[a.jsx(dt,{className:"h-4 w-4 text-purple-600"}),e.name]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e.description||"No description provided"})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:r,className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Share to community",children:a.jsx(ty,{className:"h-4 w-4"})}),a.jsx(Z,{variant:"ghost",size:"sm",onClick:n,className:"text-red-500 hover:text-red-600 hover:bg-red-50",title:"Delete assistant",children:a.jsx(Wl,{className:"h-4 w-4"})})]})]})}),a.jsxs(fe,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Model:"}),a.jsx("p",{className:"text-gray-800 truncate",children:e.model})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),a.jsx("p",{className:"text-gray-800",children:e.temperature})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),a.jsx("p",{className:"text-gray-800",children:e.maxTokens})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Created:"}),a.jsx("p",{className:"text-gray-800",children:new Date(e.createdAt).toLocaleDateString()})]})]}),e.systemPrompt&&a.jsxs("div",{className:"bg-blue-50 rounded p-2",children:[a.jsx("span",{className:"text-xs font-medium text-blue-700",children:"System Prompt:"}),a.jsx("p",{className:"text-xs text-blue-600 mt-1 line-clamp-2",children:e.systemPrompt})]}),a.jsxs(Z,{onClick:t,className:"w-full flex items-center gap-2",children:[a.jsx(kn,{className:"h-4 w-4"}),"Use Assistant"]})]})]})}var ou="rovingFocusGroup.onEntryFocus",AR={bubbles:!1,cancelable:!0},Ko="RovingFocusGroup",[Fc,w1,TR]=Vd(Ko),[_R,S1]=jn(Ko,[TR]),[IR,RR]=_R(Ko),k1=g.forwardRef((e,t)=>a.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(MR,{...e,ref:t})})}));k1.displayName=Ko;var MR=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,p=g.useRef(null),m=he(t,p),w=Gl(o),[h,S]=Cr({prop:s,defaultProp:l??null,onChange:u,caller:Ko}),[x,y]=g.useState(!1),v=Jn(c),b=w1(n),j=g.useRef(!1),[C,E]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(ou,v),()=>T.removeEventListener(ou,v)},[v]),a.jsx(IR,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:h,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>y(!0),[]),onFocusableItemAdd:g.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>E(T=>T-1),[]),children:a.jsx(re.div,{tabIndex:x||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{j.current=!0}),onFocus:te(e.onFocus,T=>{const D=!j.current;if(T.target===T.currentTarget&&D&&!x){const A=new CustomEvent(ou,AR);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const I=b().filter($=>$.focusable),P=I.find($=>$.active),V=I.find($=>$.id===h),L=[P,V,...I].filter(Boolean).map($=>$.ref.current);C1(L,d)}}j.current=!1}),onBlur:te(e.onBlur,()=>y(!1))})})}),b1="RovingFocusGroupItem",N1=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...l}=e,u=xn(),c=o||u,d=RR(b1,n),f=d.currentTabStopId===c,p=w1(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:h}=d;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),a.jsx(Fc.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:a.jsx(re.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?d.onItemFocus(c):S.preventDefault()}),onFocus:te(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const x=DR(S,d.orientation,d.dir);if(x!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(b=>b.focusable).map(b=>b.ref.current);if(x==="last")v.reverse();else if(x==="prev"||x==="next"){x==="prev"&&v.reverse();const b=v.indexOf(S.currentTarget);v=d.loop?zR(v,b+1):v.slice(b+1)}setTimeout(()=>C1(v))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:h!=null}):s})})});N1.displayName=b1;var OR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DR(e,t,n){const r=LR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return OR[r]}function C1(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FR=k1,BR=N1,ua="Tabs",[$R,ZR]=jn(ua,[S1]),j1=S1(),[UR,Pf]=$R(ua),E1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:l,activationMode:u="automatic",...c}=e,d=Gl(l),[f,p]=Cr({prop:r,onChange:i,defaultProp:o??"",caller:ua});return a.jsx(UR,{scope:n,baseId:xn(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:u,children:a.jsx(re.div,{dir:d,"data-orientation":s,...c,ref:t})})});E1.displayName=ua;var P1="TabsList",A1=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Pf(P1,n),s=j1(n);return a.jsx(FR,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(re.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});A1.displayName=P1;var T1="TabsTrigger",_1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Pf(T1,n),l=j1(n),u=M1(s.baseId,r),c=O1(s.baseId,r),d=r===s.value;return a.jsx(BR,{asChild:!0,...l,focusable:!i,active:d,children:a.jsx(re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:te(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:te(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:te(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})})});_1.displayName=T1;var I1="TabsContent",R1=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,l=Pf(I1,n),u=M1(l.baseId,r),c=O1(l.baseId,r),d=r===l.value,f=g.useRef(d);return g.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),a.jsx(Ti,{present:i||d,children:({present:p})=>a.jsx(re.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&o})})});R1.displayName=I1;function M1(e,t){return`${e}-trigger-${t}`}function O1(e,t){return`${e}-content-${t}`}var VR=E1,L1=A1,D1=_1,z1=R1;const HR=VR,F1=g.forwardRef(({className:e,...t},n)=>a.jsx(L1,{ref:n,className:de("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));F1.displayName=L1.displayName;const zs=g.forwardRef(({className:e,...t},n)=>a.jsx(D1,{ref:n,className:de("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}));zs.displayName=D1.displayName;const Fs=g.forwardRef(({className:e,...t},n)=>a.jsx(z1,{ref:n,className:de("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fs.displayName=z1.displayName;function WR(){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 GR(){const[e]=g.useState(WR()),[t,n]=g.useState([]);g.useEffect(()=>{r()},[]);const r=()=>{try{const c=JSON.parse(localStorage.getItem("likedTemplates")||"[]");n(c)}catch(c){console.error("Failed to load liked templates:",c)}},i=c=>{const d=t.includes(c)?t.filter(f=>f!==c):[...t,c];n(d),localStorage.setItem("likedTemplates",JSON.stringify(d))},o=c=>{const d={name:c.name,description:c.description,model:c.model,systemPrompt:c.systemPrompt,temperature:c.temperature,maxTokens:c.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(d)),window.location.href="/playground"},s=e.filter(c=>c.isOfficial||c.likes>200),l=e.reduce((c,d)=>c+d.likes,0),u=e.reduce((c,d)=>c+d.downloads,0);return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"max-w-6xl mx-auto p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:a.jsx(_o,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Community Templates"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Discover and share AI assistant templates created by the community"})]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zr,{className:"h-4 w-4"}),a.jsxs("span",{children:[l.toLocaleString()," likes"]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Hl,{className:"h-4 w-4"}),a.jsxs("span",{children:[u.toLocaleString()," downloads"]})]})]})]})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(se,{className:"bg-blue-50 border-blue-200",children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(To,{className:"h-5 w-5 text-blue-600 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-blue-900",children:"Community-Powered AI"}),a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:'Explore specialized AI assistant templates created by experts and the community. Click "Use Template" to load any configuration directly into your Playground.'})]})]})})}),a.jsxs(HR,{defaultValue:"all",className:"space-y-6",children:[a.jsxs(F1,{className:"grid w-full grid-cols-3",children:[a.jsxs(zs,{value:"all",className:"flex items-center gap-2",children:[a.jsx(_o,{className:"h-4 w-4"}),"All Templates"]}),a.jsxs(zs,{value:"featured",className:"flex items-center gap-2",children:[a.jsx(ny,{className:"h-4 w-4"}),"Featured"]}),a.jsxs(zs,{value:"liked",className:"flex items-center gap-2",children:[a.jsx(Zr,{className:"h-4 w-4"}),"My Likes"]})]}),a.jsx(Fs,{value:"all",className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(c=>a.jsx(su,{template:c,isLiked:t.includes(c.id),onLike:()=>i(c.id),onUse:()=>o(c)},c.id))})}),a.jsx(Fs,{value:"featured",className:"space-y-6",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.map(c=>a.jsx(su,{template:c,isLiked:t.includes(c.id),onLike:()=>i(c.id),onUse:()=>o(c),featured:!0},c.id))})}),a.jsx(Fs,{value:"liked",className:"space-y-6",children:t.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.filter(c=>t.includes(c.id)).map(c=>a.jsx(su,{template:c,isLiked:!0,onLike:()=>i(c.id),onUse:()=>o(c)},c.id))}):a.jsxs(se,{className:"text-center py-16",children:[a.jsx(Zr,{className:"h-16 w-16 mx-auto text-muted-foreground mb-6"}),a.jsx("h3",{className:"text-xl font-medium mb-3",children:"No liked templates yet"}),a.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Explore the community templates and click the heart icon to save your favorites for easy access."})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Templates"})]}),a.jsx(Fd,{className:"h-8 w-8 text-blue-600"})]})})}),a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(c=>c.isOfficial).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Official"})]}),a.jsx(Qx,{className:"h-8 w-8 text-green-600"})]})})}),a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-red-500",children:l.toLocaleString()}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Likes"})]}),a.jsx(Zr,{className:"h-8 w-8 text-red-500"})]})})}),a.jsx(se,{children:a.jsx(fe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-purple-600",children:u.toLocaleString()}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Downloads"})]}),a.jsx(qN,{className:"h-8 w-8 text-purple-600"})]})})})]})]})})]})}function su({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1}){return a.jsxs(se,{className:`hover:shadow-lg transition-all duration-200 hover:-translate-y-1 ${i?"ring-2 ring-yellow-200 shadow-md":""}`,children:[a.jsx(Xe,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(tt,{className:"text-base",children:e.name}),e.isOfficial&&a.jsxs(Ee,{variant:"default",className:"text-xs px-2 py-0 bg-green-600",children:[a.jsx(Qx,{className:"h-3 w-3 mr-1"}),"Official"]}),i&&a.jsx(ny,{className:"h-4 w-4 text-yellow-500 fill-current"})]}),a.jsxs("p",{className:"text-xs text-blue-600 font-medium",children:["by ",e.author]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:e.description})]}),a.jsx(Z,{variant:"ghost",size:"sm",onClick:n,className:t?"text-red-500":"text-muted-foreground hover:text-red-500",title:t?"Unlike":"Like",children:a.jsx(Zr,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),a.jsxs(fe,{className:"space-y-4",children:[a.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,3).map(o=>a.jsx(Ee,{variant:"secondary",className:"text-xs",children:o},o))}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Temperature:"}),a.jsx("p",{className:"text-gray-800",children:e.temperature})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2",children:[a.jsx("span",{className:"font-medium text-gray-600",children:"Max Tokens:"}),a.jsx("p",{className:"text-gray-800",children:e.maxTokens})]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zr,{className:"h-3 w-3"}),a.jsx("span",{children:e.likes})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Hl,{className:"h-3 w-3"}),a.jsx("span",{children:e.downloads})]})]}),a.jsxs(Z,{size:"sm",onClick:r,className:"flex items-center gap-1",children:[a.jsx(Fd,{className:"h-3 w-3"}),"Use"]})]})]})]})}function KR(){return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b",children:a.jsx("div",{className:"flex h-14 items-center px-6",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vo,{className:"h-5 w-5"}),a.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(BN,{className:"h-5 w-5"}),"Server Configuration"]})}),a.jsx(fe,{className:"space-y-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Ue,{className:"text-sm font-medium",children:"Backend URL"}),a.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),a.jsxs("div",{children:[a.jsx(Ue,{className:"text-sm font-medium",children:"Frontend URL"}),a.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(sc,{className:"h-5 w-5"}),"Privacy & Security"]})}),a.jsx(fe,{className:"space-y-4",children:a.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(sc,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),a.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),a.jsxs(se,{children:[a.jsx(Xe,{children:a.jsxs(tt,{className:"flex items-center gap-2",children:[a.jsx(Bd,{className:"h-5 w-5"}),"System Information"]})}),a.jsx(fe,{className:"space-y-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Ue,{className:"text-sm font-medium",children:"Platform"}),a.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[a.jsx(Ee,{variant:"outline",children:"Local"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),a.jsxs("div",{children:[a.jsx(Ue,{className:"text-sm font-medium",children:"Status"}),a.jsx("div",{className:"mt-1",children:a.jsx(Ee,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function YR(){return a.jsx(yb,{children:a.jsx(db,{children:a.jsxs(Qt,{path:"/",element:a.jsx(aC,{}),children:[a.jsx(Qt,{index:!0,element:a.jsx(yC,{})}),a.jsx(Qt,{path:"playground",element:a.jsx(bR,{})}),a.jsx(Qt,{path:"chat",element:a.jsx(NR,{})}),a.jsx(Qt,{path:"assistant-builder",element:a.jsx(CR,{})}),a.jsx(Qt,{path:"models",element:a.jsx(jR,{})}),a.jsx(Qt,{path:"assistants",element:a.jsx(ER,{})}),a.jsx(Qt,{path:"community",element:a.jsx(GR,{})}),a.jsx(Qt,{path:"settings",element:a.jsx(KR,{})})]})})})}lu.createRoot(document.getElementById("root")).render(a.jsx(zt.StrictMode,{children:a.jsx(YR,{})})); +//# sourceMappingURL=index-6f63b786.js.map