diff --git "a/static/assets/index-dafa19ab.js" "b/static/assets/index-dafa19ab.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-dafa19ab.js" @@ -0,0 +1,357 @@ +function I1(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Yl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},Ls={},xh={exports:{}},se={};/** + * @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"),M1=Symbol.for("react.portal"),L1=Symbol.for("react.fragment"),O1=Symbol.for("react.strict_mode"),D1=Symbol.for("react.profiler"),z1=Symbol.for("react.provider"),F1=Symbol.for("react.context"),B1=Symbol.for("react.forward_ref"),$1=Symbol.for("react.suspense"),U1=Symbol.for("react.memo"),V1=Symbol.for("react.lazy"),Cf=Symbol.iterator;function H1(e){return e===null||typeof e!="object"?null:(e=Cf&&e[Cf]||e["@@iterator"],typeof e=="function"?e:null)}var yh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vh=Object.assign,wh={};function Ni(e,t,n){this.props=e,this.context=t,this.refs=wh,this.updater=n||yh}Ni.prototype.isReactComponent={};Ni.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")};Ni.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sh(){}Sh.prototype=Ni.prototype;function $c(e,t,n){this.props=e,this.context=t,this.refs=wh,this.updater=n||yh}var Uc=$c.prototype=new Sh;Uc.constructor=$c;vh(Uc,Ni.prototype);Uc.isPureReactComponent=!0;var jf=Array.isArray,bh=Object.prototype.hasOwnProperty,Vc={current:null},kh={key:!0,ref:!0,__self:!0,__source:!0};function Nh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)bh.call(t,r)&&!kh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,Q=P[U];if(0>>1;Ui(de,b))rei(K,de)?(P[U]=K,P[re]=b,U=re):(P[U]=de,P[ne]=b,U=ne);else if(rei(K,b))P[U]=K,P[re]=b,U=re;else break e}}return z}function i(P,z){var b=P.sortIndex-z.sortIndex;return b!==0?b:P.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var u=[],c=[],f=1,d=null,p=3,m=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(P){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=P)r(c),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(c)}}function k(P){if(x=!1,v(P),!w)if(n(u)!==null)w=!0,L(j);else{var z=n(c);z!==null&&B(k,z.startTime-P)}}function j(P,z){w=!1,x&&(x=!1,y(T),T=-1),m=!0;var b=p;try{for(v(z),d=n(u);d!==null&&(!(d.expirationTime>z)||P&&!R());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var Q=U(d.expirationTime<=z);z=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(u)&&r(u),v(z)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var ne=n(c);ne!==null&&B(k,ne.startTime-z),N=!1}return N}finally{d=null,p=b,m=!1}}var C=!1,E=null,T=-1,O=5,M=-1;function R(){return!(e.unstable_now()-MP||125U?(P.sortIndex=b,t(c,P),n(u)===null&&P===n(c)&&(x?(y(T),T=-1):x=!0,B(k,b-U))):(P.sortIndex=Q,t(u,P),w||m||(w=!0,L(j))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var z=p;return function(){var b=p;p=z;try{return P.apply(this,arguments)}finally{p=b}}}})(Th);Ph.exports=Th;var tw=Ph.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var nw=g,Ct=tw;function F(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"),xu=Object.prototype.hasOwnProperty,rw=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Pf={},Tf={};function iw(e){return xu.call(Tf,e)?!0:xu.call(Pf,e)?!1:rw.test(e)?Tf[e]=!0:(Pf[e]=!0,!1)}function ow(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lw(e,t,n,r){if(t===null||typeof t>"u"||ow(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ye[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ye[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ye[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ye[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ye[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ye[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ye[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ye[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ye[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function Kc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gc,Kc);Ye[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gc,Kc);Ye[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gc,Kc);Ye[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ye[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ye.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ye[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qc(e,t,n,r){var i=Ye.hasOwnProperty(t)?Ye[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var u=` +`+i[l].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=l&&0<=s);break}}}finally{ba=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yi(e):""}function sw(e){switch(e.tag){case 5:return Yi(e.type);case 16:return Yi("Lazy");case 13:return Yi("Suspense");case 19:return Yi("SuspenseList");case 0:case 2:case 15:return e=ka(e.type,!1),e;case 11:return e=ka(e.type.render,!1),e;case 1:return e=ka(e.type,!0),e;default:return""}}function Su(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 Vr:return"Fragment";case Ur:return"Portal";case yu:return"Profiler";case Yc:return"StrictMode";case vu:return"Suspense";case wu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rh:return(e.displayName||"Context")+".Consumer";case Ah:return(e._context.displayName||"Context")+".Provider";case Xc: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:Su(e.type)||"Memo";case Mn:t=e._payload,e=e._init;try{return Su(e(t))}catch{}}return null}function aw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Su(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 Jn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uw(e){var t=Mh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jo(e){e._valueTracker||(e._valueTracker=uw(e))}function Lh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Mh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xl(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 bu(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Af(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oh(e,t){t=t.checked,t!=null&&Qc(e,"checked",t,!1)}function ku(e,t){Oh(e,t);var n=Jn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Nu(e,t.type,Jn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rf(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 Nu(e,t,n){(t!=="number"||Xl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xi=Array.isArray;function ti(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Zo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var eo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cw=["Webkit","ms","Moz","O"];Object.keys(eo).forEach(function(e){cw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),eo[t]=eo[e]})});function Bh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||eo.hasOwnProperty(e)&&eo[e]?(""+t).trim():t+"px"}function $h(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Bh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var dw=Re({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 Eu(e,t){if(t){if(dw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Pu(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 Tu=null;function Jc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _u=null,ni=null,ri=null;function Lf(e){if(e=zo(e)){if(typeof _u!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Bs(t),_u(e.stateNode,e.type,t))}}function Uh(e){ni?ri?ri.push(e):ri=[e]:ni=e}function Vh(){if(ni){var e=ni,t=ri;if(ri=ni=null,Lf(e),t)for(e=0;e>>=0,e===0?32:31-(bw(e)/kw|0)|0}var el=64,tl=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 es(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=qi(s):(o&=l,o!==0&&(r=qi(o)))}else l=n&~i,l!==0?r=qi(l):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 Oo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Gt(t),e[t]=n}function Ew(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=no),Hf=String.fromCharCode(32),Wf=!1;function ug(e,t){switch(e){case"keyup":return tS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function rS(e,t){switch(e){case"compositionend":return cg(t);case"keypress":return t.which!==32?null:(Wf=!0,Hf);case"textInput":return e=t.data,e===Hf&&Wf?null:e;default:return null}}function iS(e,t){if(Hr)return e==="compositionend"||!ld&&ug(e,t)?(e=sg(),jl=rd=zn=null,Hr=!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=Yf(n)}}function mg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hg(){for(var e=window,t=Xl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xl(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 pS(e){var t=hg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mg(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=Xf(n,o);var l=Xf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wr=null,Ou=null,io=null,Du=!1;function qf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Du||Wr==null||Wr!==Xl(r)||(r=Wr,"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}),io&&wo(io,r)||(io=r,r=rs(Ou,"onSelect"),0Qr||(e.current=Vu[Qr],Vu[Qr]=null,Qr--)}function Ne(e,t){Qr++,Vu[Qr]=e.current,e.current=t}var Zn={},et=ir(Zn),ft=ir(!1),br=Zn;function hi(e,t){var n=e.type.contextTypes;if(!n)return Zn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pt(e){return e=e.childContextTypes,e!=null}function os(){Pe(ft),Pe(et)}function ip(e,t,n){if(et.current!==Zn)throw Error(F(168));Ne(et,t),Ne(ft,n)}function Ng(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(F(108,aw(e)||"Unknown",i));return Re({},n,r)}function ls(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,br=et.current,Ne(et,e),Ne(ft,ft.current),!0}function op(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Ng(e,t,br),r.__reactInternalMemoizedMergedChildContext=e,Pe(ft),Pe(et),Ne(et,e)):Pe(ft),Ne(ft,n)}var yn=null,$s=!1,Da=!1;function Cg(e){yn===null?yn=[e]:yn.push(e)}function CS(e){$s=!0,Cg(e)}function or(){if(!Da&&yn!==null){Da=!0;var e=0,t=Se;try{var n=yn;for(Se=1;e>=l,i-=l,vn=1<<32-Gt(t)+i|n<T?(O=E,E=null):O=E.sibling;var M=p(y,E,v[T],k);if(M===null){E===null&&(E=O);break}e&&E&&M.alternate===null&&t(y,E),h=o(M,h,T),C===null?j=M:C.sibling=M,C=M,E=O}if(T===v.length)return n(y,E),Te&&fr(y,T),j;if(E===null){for(;TT?(O=E,E=null):O=E.sibling;var R=p(y,E,M.value,k);if(R===null){E===null&&(E=O);break}e&&E&&R.alternate===null&&t(y,E),h=o(R,h,T),C===null?j=R:C.sibling=R,C=R,E=O}if(M.done)return n(y,E),Te&&fr(y,T),j;if(E===null){for(;!M.done;T++,M=v.next())M=d(y,M.value,k),M!==null&&(h=o(M,h,T),C===null?j=M:C.sibling=M,C=M);return Te&&fr(y,T),j}for(E=r(y,E);!M.done;T++,M=v.next())M=m(E,y,T,M.value,k),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?T:M.key),h=o(M,h,T),C===null?j=M:C.sibling=M,C=M);return e&&E.forEach(function(_){return t(y,_)}),Te&&fr(y,T),j}function S(y,h,v,k){if(typeof v=="object"&&v!==null&&v.type===Vr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case qo:e:{for(var j=v.key,C=h;C!==null;){if(C.key===j){if(j=v.type,j===Vr){if(C.tag===7){n(y,C.sibling),h=i(C,v.props.children),h.return=y,y=h;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Mn&&ap(j)===C.type){n(y,C.sibling),h=i(C,v.props),h.ref=Ui(y,C,v),h.return=y,y=h;break e}n(y,C);break}else t(y,C);C=C.sibling}v.type===Vr?(h=wr(v.props.children,y.mode,k,v.key),h.return=y,y=h):(k=Ml(v.type,v.key,v.props,null,y.mode,k),k.ref=Ui(y,h,v),k.return=y,y=k)}return l(y);case Ur:e:{for(C=v.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(y,h.sibling),h=i(h,v.children||[]),h.return=y,y=h;break e}else{n(y,h);break}else t(y,h);h=h.sibling}h=Wa(v,y.mode,k),h.return=y,y=h}return l(y);case Mn:return C=v._init,S(y,h,C(v._payload),k)}if(Xi(v))return w(y,h,v,k);if(Di(v))return x(y,h,v,k);al(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(y,h.sibling),h=i(h,v),h.return=y,y=h):(n(y,h),h=Ha(v,y.mode,k),h.return=y,y=h),l(y)):n(y,h)}return S}var xi=Tg(!0),_g=Tg(!1),us=ir(null),cs=null,qr=null,dd=null;function fd(){dd=qr=cs=null}function pd(e){var t=us.current;Pe(us),e._currentValue=t}function Gu(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 oi(e,t){cs=e,dd=qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function Lt(e){var t=e._currentValue;if(dd!==e)if(e={context:e,memoizedValue:t,next:null},qr===null){if(cs===null)throw Error(F(308));qr=e,cs.dependencies={lanes:0,firstContext:e}}else qr=qr.next=e;return t}var gr=null;function md(e){gr===null?gr=[e]:gr.push(e)}function Ag(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,md(t)):(n.next=i.next,i.next=n),t.interleaved=n,Nn(e,r)}function Nn(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 Ln=!1;function hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rg(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 Sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Nn(e,n)}return i=r.interleaved,i===null?(t.next=t,md(r)):(t.next=i.next,i.next=t),r.interleaved=t,Nn(e,n)}function Pl(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,ed(e,n)}}function up(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ds(e,t,n,r){var i=e.updateQueue;Ln=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var u=s,c=u.next;u.next=null,l===null?o=c:l.next=c,l=u;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=u))}if(o!==null){var d=i.baseState;l=0,f=c=u=null,s=o;do{var p=s.lane,m=s.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,x=s;switch(p=t,m=n,x.tag){case 1:if(w=x.payload,typeof w=="function"){d=w.call(m,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=x.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Re({},d,p);break e;case 2:Ln=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else m={eventTime:m,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=m,u=d):f=f.next=m,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(f===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Cr|=l,e.lanes=l,e.memoizedState=d}}function cp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Fa.transition;Fa.transition={};try{e(!1),t()}finally{Se=n,Fa.transition=r}}function Yg(){return Ot().memoizedState}function TS(e,t,n){var r=Qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xg(e))qg(t,n);else if(n=Ag(e,t,n,r),n!==null){var i=ot();Kt(n,e,r,i),Jg(n,t,r)}}function _S(e,t,n){var r=Qn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xg(e))qg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,Qt(s,l)){var u=t.interleaved;u===null?(i.next=i,md(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Ag(e,t,i,r),n!==null&&(i=ot(),Kt(n,e,r,i),Jg(n,t,r))}}function Xg(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function qg(e,t){oo=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ed(e,n)}}var ms={readContext:Lt,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useInsertionEffect:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useSyncExternalStore:Xe,useId:Xe,unstable_isNewReconciler:!1},AS={readContext:Lt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:fp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,Hg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _l(4194308,4,e,t)},useInsertionEffect:function(e,t){return _l(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();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=TS.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:dp,useDebugValue:kd,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=dp(!1),t=e[0];return e=PS.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ae,i=nn();if(Te){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),We===null)throw Error(F(349));Nr&30||Og(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,fp(zg.bind(null,r,o,e),[e]),r.flags|=2048,Po(9,Dg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=nn(),t=We.identifierPrefix;if(Te){var n=wn,r=vn;n=(r&~(1<<32-Gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[on]=t,e[ko]=r,ax(e,t,!1,!1),t.stateNode=e;e:{switch(l=Pu(n,r),n){case"dialog":Ee("cancel",e),Ee("close",e),i=r;break;case"iframe":case"object":case"embed":Ee("load",e),i=r;break;case"video":case"audio":for(i=0;iwi&&(t.flags|=128,r=!0,Vi(o,!1),t.lanes=4194304)}else{if(!r)if(e=fs(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Te)return qe(t),null}else 2*Le()-o.renderingStartTime>wi&&n!==1073741824&&(t.flags|=128,r=!0,Vi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Le(),t.sibling=null,n=_e.current,Ne(_e,r?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return Td(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function FS(e,t){switch(ud(t),t.tag){case 1:return pt(t.type)&&os(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yi(),Pe(ft),Pe(et),yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xd(t),null;case 13:if(Pe(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(_e),null;case 4:return yi(),null;case 10:return pd(t.type._context),null;case 22:case 23:return Td(),null;case 24:return null;default:return null}}var cl=!1,Je=!1,BS=typeof WeakSet=="function"?WeakSet:Set,G=null;function Jr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function tc(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var kp=!1;function $S(e,t){if(zu=ts,e=hg(),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 l=0,s=-1,u=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(u=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++c===i&&(s=l),p===o&&++f===r&&(u=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fu={focusedElem:e,selectionRange:n},ts=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var x=w.memoizedProps,S=w.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ut(t.type,x),S);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(k){Ie(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=kp,kp=!1,w}function lo(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&&tc(t,n,o)}i=i.next}while(i!==r)}}function Hs(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 nc(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 dx(e){var t=e.alternate;t!==null&&(e.alternate=null,dx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[ko],delete t[Uu],delete t[kS],delete t[NS])),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 fx(e){return e.tag===5||e.tag===3||e.tag===4}function Np(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fx(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 rc(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=is));else if(r!==4&&(e=e.child,e!==null))for(rc(e,t,n),e=e.sibling;e!==null;)rc(e,t,n),e=e.sibling}function ic(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(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}var Ge=null,Ht=!1;function _n(e,t,n){for(n=n.child;n!==null;)px(e,t,n),n=n.sibling}function px(e,t,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Os,n)}catch{}switch(n.tag){case 5:Je||Jr(n,t);case 6:var r=Ge,i=Ht;Ge=null,_n(e,t,n),Ge=r,Ht=i,Ge!==null&&(Ht?(e=Ge,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ge.removeChild(n.stateNode));break;case 18:Ge!==null&&(Ht?(e=Ge,n=n.stateNode,e.nodeType===8?Oa(e.parentNode,n):e.nodeType===1&&Oa(e,n),yo(e)):Oa(Ge,n.stateNode));break;case 4:r=Ge,i=Ht,Ge=n.stateNode.containerInfo,Ht=!0,_n(e,t,n),Ge=r,Ht=i;break;case 0:case 11:case 14:case 15:if(!Je&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&tc(n,t,l),i=i.next}while(i!==r)}_n(e,t,n);break;case 1:if(!Je&&(Jr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ie(n,t,s)}_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:n.mode&1?(Je=(r=Je)||n.memoizedState!==null,_n(e,t,n),Je=r):_n(e,t,n);break;default:_n(e,t,n)}}function Cp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new BS),t.forEach(function(r){var i=XS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ft(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*VS(r/1960))-r,10e?16:e,Fn===null)var r=!1;else{if(e=Fn,Fn=null,xs=0,pe&6)throw Error(F(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var o=G,l=o.child;if(G.flags&16){var s=o.deletions;if(s!==null){for(var u=0;uLe()-Ed?vr(e,0):jd|=n),mt(e,t)}function Sx(e,t){t===0&&(e.mode&1?(t=tl,tl<<=1,!(tl&130023424)&&(tl=4194304)):t=1);var n=ot();e=Nn(e,t),e!==null&&(Oo(e,t,n),mt(e,n))}function YS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sx(e,n)}function XS(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(F(314))}r!==null&&r.delete(t),Sx(e,n)}var bx;bx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ft.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,DS(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Te&&t.flags&1048576&&jg(t,as,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Al(e,t),e=t.pendingProps;var i=hi(t,et.current);oi(t,n),i=wd(null,t,r,e,i,n);var o=Sd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pt(r)?(o=!0,ls(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hd(t),i.updater=Vs,t.stateNode=i,i._reactInternals=t,Qu(t,r,e,n),t=qu(null,t,r,!0,o,n)):(t.tag=0,Te&&o&&ad(t),it(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Al(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=JS(r),e=Ut(r,e),i){case 0:t=Xu(null,t,r,e,n);break e;case 1:t=wp(null,t,r,e,n);break e;case 11:t=yp(null,t,r,e,n);break e;case 14:t=vp(null,t,r,Ut(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),Xu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),wp(e,t,r,i,n);case 3:e:{if(ox(t),e===null)throw Error(F(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Rg(e,t),ds(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=vi(Error(F(423)),t),t=Sp(e,t,r,n,i);break e}else if(r!==i){i=vi(Error(F(424)),t),t=Sp(e,t,r,n,i);break e}else for(St=Wn(t.stateNode.containerInfo.firstChild),kt=t,Te=!0,Wt=null,n=_g(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gi(),r===i){t=Cn(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return Ig(t),e===null&&Wu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Bu(r,i)?l=null:o!==null&&Bu(r,o)&&(t.flags|=32),ix(e,t),it(e,t,l,n),t.child;case 6:return e===null&&Wu(t),null;case 13:return lx(e,t,n);case 4:return gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xi(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),yp(e,t,r,i,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,Ne(us,r._currentValue),r._currentValue=l,o!==null)if(Qt(o.value,l)){if(o.children===i.children&&!ft.current){t=Cn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Sn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Gu(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(F(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Gu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}it(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Lt(i),r=r(i),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,i=Ut(r,t.pendingProps),i=Ut(r.type,i),vp(e,t,r,i,n);case 15:return nx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),Al(e,t),t.tag=1,pt(r)?(e=!0,ls(t)):e=!1,oi(t,n),Zg(t,r,i),Qu(t,r,i,n),qu(null,t,r,!0,e,n);case 19:return sx(e,t,n);case 22:return rx(e,t,n)}throw Error(F(156,t.tag))};function kx(e,t){return Xh(e,t)}function qS(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 qS(e,t,n,r)}function Ad(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JS(e){if(typeof e=="function")return Ad(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xc)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 Ml(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Ad(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Vr:return wr(n.children,i,o,t);case Yc:l=8,i|=8;break;case yu:return e=At(12,n,t,i|2),e.elementType=yu,e.lanes=o,e;case vu:return e=At(13,n,t,i),e.elementType=vu,e.lanes=o,e;case wu:return e=At(19,n,t,i),e.elementType=wu,e.lanes=o,e;case Ih:return Gs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ah:l=10;break e;case Rh:l=9;break e;case Xc:l=11;break e;case qc:l=14;break e;case Mn:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=At(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function wr(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Gs(e,t,n,r){return e=At(22,e,r,t),e.elementType=Ih,e.lanes=n,e.stateNode={isHidden:!1},e}function Ha(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function Wa(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 ZS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ca(0),this.expirationTimes=Ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ca(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rd(e,t,n,r,i,o,l,s,u){return e=new ZS(e,t,n,s,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},hd(o),e}function eb(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ex)}catch(e){console.error(e)}}Ex(),Eh.exports=jt;var Ei=Eh.exports;const ob=Ms(Ei);var Ip=Ei;gu.createRoot=Ip.createRoot,gu.hydrateRoot=Ip.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Px(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sb(){return Math.random().toString(36).substr(2,8)}function Lp(e,t){return{usr:e.state,key:e.key,idx:t}}function uc(e,t,n,r){return n===void 0&&(n=null),_o({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pi(t):t,{state:n,key:t&&t.key||r||sb()})}function ws(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 Pi(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 ab(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Bn.Pop,u=null,c=f();c==null&&(c=0,l.replaceState(_o({},l.state,{idx:c}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Bn.Pop;let S=f(),y=S==null?null:S-c;c=S,u&&u({action:s,location:x.location,delta:y})}function p(S,y){s=Bn.Push;let h=uc(x.location,S,y);n&&n(h,S),c=f()+1;let v=Lp(h,c),k=x.createHref(h);try{l.pushState(v,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(k)}o&&u&&u({action:s,location:x.location,delta:1})}function m(S,y){s=Bn.Replace;let h=uc(x.location,S,y);n&&n(h,S),c=f();let v=Lp(h,c),k=x.createHref(h);l.replaceState(v,"",k),o&&u&&u({action:s,location:x.location,delta:0})}function w(S){let y=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:ws(S);return h=h.replace(/ $/,"%20"),Fe(y,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,y)}let x={get action(){return s},get location(){return e(i,l)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(Mp,d),u=S,()=>{i.removeEventListener(Mp,d),u=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let y=w(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(S){return l.go(S)}};return x}var Op;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Op||(Op={}));function ub(e,t,n){return n===void 0&&(n="/"),cb(e,t,n,!1)}function cb(e,t,n,r){let i=typeof t=="string"?Pi(t):t,o=Od(i.pathname||"/",n);if(o==null)return null;let l=Tx(e);db(l);let s=null;for(let u=0;s==null&&u{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};u.relativePath.startsWith("/")&&(Fe(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Xn([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Fe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Tx(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:yb(c,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let u of _x(o.path))i(o,l,u)}),t}function _x(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=_x(r.join("/")),s=[];return s.push(...l.map(u=>u===""?o:[o,u].join("/"))),i&&s.push(...l),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function db(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fb=/^:[\w-]+$/,pb=3,mb=2,hb=1,gb=10,xb=-2,Dp=e=>e==="*";function yb(e,t){let n=e.split("/"),r=n.length;return n.some(Dp)&&(r+=xb),t&&(r+=mb),n.filter(i=>!Dp(i)).reduce((i,o)=>i+(fb.test(o)?pb:o===""?hb:gb),r)}function vb(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 wb(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:p,isOptional:m}=f;if(p==="*"){let x=s[d]||"";l=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=s[d];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function Sb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Px(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,u)=>(r.push({paramName:s,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 bb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Px(!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 kb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pi(e):e;return{pathname:n?n.startsWith("/")?n:Nb(n,t):t,search:Eb(r),hash:Pb(i)}}function Nb(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 Ga(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 Cb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ax(e,t){let n=Cb(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Rx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pi(e):(i=_o({},e),Fe(!i.pathname||!i.pathname.includes("?"),Ga("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),Ga("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),Ga("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let u=kb(i,s),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}const Xn=e=>e.join("/").replace(/\/\/+/g,"/"),jb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Tb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ix=["post","put","patch","delete"];new Set(Ix);const _b=["get",...Ix];new Set(_b);/** + * 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{s.current=!0}),g.useCallback(function(c,f){if(f===void 0&&(f={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=Rx(c,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Xn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Mb=g.createContext(null);function Lb(e){let t=g.useContext(lr).outlet;return t&&g.createElement(Mb.Provider,{value:e},t)}function Ox(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Mr),{matches:i}=g.useContext(lr),{pathname:o}=$o(),l=JSON.stringify(Ax(i,r.v7_relativeSplatPath));return g.useMemo(()=>Rx(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Ob(e,t){return Db(e,t)}function Db(e,t,n,r){Bo()||Fe(!1);let{navigator:i}=g.useContext(Mr),{matches:o}=g.useContext(lr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=$o(),f;if(t){var d;let S=typeof t=="string"?Pi(t):t;u==="/"||(d=S.pathname)!=null&&d.startsWith(u)||Fe(!1),f=S}else f=c;let p=f.pathname||"/",m=p;if(u!=="/"){let S=u.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=ub(e,{pathname:m}),x=Ub(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Xn([u,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Xn([u,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&x?g.createElement(qs.Provider,{value:{location:Ao({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Bn.Pop}},x):x}function zb(){let e=Gb(),t=Tb(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 Fb=g.createElement(zb,null);class Bb extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(lr.Provider,{value:this.props.routeContext},g.createElement(Mx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $b(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Dd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(lr.Provider,{value:t},r)}function Ub(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let f=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||Fe(!1),l=l.slice(0,Math.min(l.length,f+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,w=!1,x=null,S=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,x=d.route.errorElement||Fb,u&&(c<0&&p===0?(Qb("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,p+1)),h=()=>{let v;return m?v=x:w?v=S:d.route.Component?v=g.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=f,g.createElement($b,{match:d,routeContext:{outlet:f,matches:y,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Bb,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:h(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):h()},null)}var Dx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Dx||{}),Ss=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ss||{});function Vb(e){let t=g.useContext(Dd);return t||Fe(!1),t}function Hb(e){let t=g.useContext(Ab);return t||Fe(!1),t}function Wb(e){let t=g.useContext(lr);return t||Fe(!1),t}function zx(e){let t=Wb(),n=t.matches[t.matches.length-1];return n.route.id||Fe(!1),n.route.id}function Gb(){var e;let t=g.useContext(Mx),n=Hb(Ss.UseRouteError),r=zx(Ss.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Kb(){let{router:e}=Vb(Dx.UseNavigateStable),t=zx(Ss.UseNavigateStable),n=g.useRef(!1);return Lx(()=>{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 Fp={};function Qb(e,t,n){!t&&!Fp[e]&&(Fp[e]=!0)}function Yb(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 Xb(e){return Lb(e.context)}function gn(e){Fe(!1)}function qb(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Bn.Pop,navigator:o,static:l=!1,future:s}=e;Bo()&&Fe(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:o,static:l,future:Ao({v7_relativeSplatPath:!1},s)}),[u,s,o,l]);typeof r=="string"&&(r=Pi(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,x=g.useMemo(()=>{let S=Od(f,u);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:w},navigationType:i}},[u,f,d,p,m,w,i]);return x==null?null:g.createElement(Mr.Provider,{value:c},g.createElement(qs.Provider,{children:n,value:x}))}function Jb(e){let{children:t,location:n}=e;return Ob(cc(t),n)}new Promise(()=>{});function cc(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,cc(r.props.children,o));return}r.type!==gn&&Fe(!1),!r.props.index||!r.props.children||Fe(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=cc(r.props.children,o)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function ek(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tk(e,t){return e.button===0&&(!t||t==="_self")&&!ek(e)}const nk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rk="6";try{window.__reactRouterVersion=rk}catch{}const ik="startTransition",Bp=Wc[ik];function ok(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=lb({window:i,v5Compat:!0}));let l=o.current,[s,u]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},f=g.useCallback(d=>{c&&Bp?Bp(()=>u(d)):u(d)},[u,c]);return g.useLayoutEffect(()=>l.listen(f),[l,f]),g.useEffect(()=>Yb(r),[r]),g.createElement(qb,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$p=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:u,to:c,preventScrollReset:f,viewTransition:d}=t,p=Zb(t,nk),{basename:m}=g.useContext(Mr),w,x=!1;if(typeof c=="string"&&sk.test(c)&&(w=c,lk))try{let v=new URL(window.location.href),k=c.startsWith("//")?new URL(v.protocol+c):new URL(c),j=Od(k.pathname,m);k.origin===v.origin&&j!=null?c=j+k.search+k.hash:x=!0}catch{}let S=Rb(c,{relative:i}),y=ak(c,{replace:l,state:s,target:u,preventScrollReset:f,relative:i,viewTransition:d});function h(v){r&&r(v),v.defaultPrevented||y(v)}return g.createElement("a",dc({},p,{href:w||S,onClick:x||o?r:h,ref:n,target:u}))});var Up;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Up||(Up={}));var Vp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Vp||(Vp={}));function ak(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,u=Ti(),c=$o(),f=Ox(e,{relative:l});return g.useCallback(d=>{if(tk(d,n)){d.preventDefault();let p=r!==void 0?r:ws(c)===ws(f);u(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[c,u,f,r,i,n,e,o,l,s])}function Fx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var Vx="!";function gk(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],u=0,c=0,f,d=0;dc?f-c:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:S}}}function xk(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var i=r[0]==="[";i?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function yk(e){return{cache:hk(e.cacheSize),splitModifiers:gk(e),...ck(e)}}var vk=/\s+/;function wk(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(vk).map(function(l){var s=n(l),u=s.modifiers,c=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?f.substring(0,d):f),m=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=xk(u).join(":"),x=c?w+Vx:w;return{isTailwindClass:!0,modifierId:x,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,u=l.classGroupId,c=l.hasPostfixModifier,f=s+u;return o.has(f)?!1:(o.add(f),i(u,c).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function Sk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Kp=e=>{const t=zk(e);return t.charAt(0).toUpperCase()+t.slice(1)},Gx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Fk=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 Bk={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 $k=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},u)=>g.createElement("svg",{ref:u,...Bk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Gx("lucide",i),...!o&&!Fk(s)&&{"aria-hidden":"true"},...s},[...l.map(([c,f])=>g.createElement(c,f)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ee=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement($k,{ref:o,iconNode:t,className:Gx(`lucide-${Dk(Kp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Kp(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 Uk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Vk=ee("arrow-left",Uk);/** + * @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 Hk=[["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"}]],Wk=ee("award",Hk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gk=[["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"}]],Js=ee("book-open",Gk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kk=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Qk=ee("bookmark",Kk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yk=[["path",{d:"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"}]],ei=ee("bot",Yk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xk=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Er=ee("brain",Xk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jk=ee("check",qk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Kx=ee("chevron-down",Zk);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Qp=ee("chevron-left",eN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yp=ee("chevron-right",tN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rN=ee("chevron-up",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:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],oN=ee("circle-check-big",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 lN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],bs=ee("cloud",lN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Qx=ee("crown",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 aN=[["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"}]],uN=ee("download",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 cN=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dN=ee("eye",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 fN=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],pN=ee("file",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=[["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"}]],Yx=ee("hard-drive",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 hN=[["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"}]],gN=ee("heart",hN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xx=ee("info",xN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mc=ee("loader-circle",yN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vN=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Fd=ee("menu",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:"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"}]],Zs=ee("message-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 SN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ks=ee("plus",SN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bN=[["path",{d:"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"}]],qx=ee("save",bN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Xp=ee("search",kN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NN=[["path",{d:"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"}]],CN=ee("send",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 jN=[["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"}]],EN=ee("server",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=[["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"}]],si=ee("settings",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 TN=[["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"}]],qp=ee("shield",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=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],AN=ee("sliders-vertical",_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 RN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],IN=ee("square",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:"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"}]],LN=ee("star",MN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ON=[["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"}]],Jx=ee("trash-2",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 DN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Zx=ee("trending-up",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 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"}]],FN=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 BN=[["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"}]],Bd=ee("user",BN);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $N=[["path",{d:"M16 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"}]],UN=ee("users",$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 VN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ey=ee("x",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:"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"}]],hc=ee("zap",HN),WN=[{name:"Templates",href:"/templates",icon:Er,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:Zs,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:Js,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:si,description:"Application settings"}];function GN(){const e=$o();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(Er,{className:"h-5 w-5 text-primary-foreground"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),a.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[a.jsx("div",{children:a.jsxs($p,{to:"/",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent text-muted-foreground hover:text-foreground",children:[a.jsx(Vk,{className:"h-4 w-4"}),a.jsx("span",{children:"Back to Home"})]})}),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:WN.map(t=>{const n=e.pathname===t.href;return a.jsxs($p,{to:t.href,className:ue("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[a.jsx(t.icon,{className:"h-4 w-4"}),a.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})]})]})}function KN(){return a.jsxs("div",{className:"flex h-screen bg-background",children:[a.jsx("div",{className:"w-64 border-r",children:a.jsx(GN,{})}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Xb,{})})]})}function Jp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ty(...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,...l}=r,s=g.Children.toArray(o),u=s.find(qN);if(u){const c=u.props.children,f=s.map(d=>d===u?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return a.jsx(t,{...l,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,f):null})}return a.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var QN=Si("Slot");function YN(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=ZN(i),s=JN(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ty(r,l):l),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ny=Symbol("radix.slottable");function XN(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ny,t}function qN(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ny}function JN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ZN(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=Bx,$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,l=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],d=o==null?void 0:o[c];if(f===null)return null;const p=Zp(f)||Zp(d);return i[c][p]}),s=n&&Object.entries(n).reduce((c,f)=>{let[d,p]=f;return p===void 0||(c[d]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(w=>{let[x,S]=w;return Array.isArray(S)?S.includes({...o,...s}[x]):{...o,...s}[x]===S})?[...c,d,p]:c},[]);return em(e,l,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"}}),fe=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?QN:"button";return a.jsx(l,{className:ue(Ud({variant:t,size:n,className:e})),ref:o,...i})});fe.displayName="Button";function eC(){const e=Ti();return a.jsxs("div",{className:"min-h-screen bg-gray-50",children:[a.jsx("nav",{className:"bg-white border-b border-gray-200",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex justify-between items-center h-20",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-16 w-16",onError:t=>{console.error("Logo failed to load"),t.currentTarget.style.display="none"}})}),a.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[a.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Home"}),a.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Technology"}),a.jsx("button",{onClick:()=>e("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),a.jsx(fe,{variant:"outline",onClick:()=>e("/playground"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My device"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx(fe,{variant:"ghost",size:"sm",children:a.jsx(Fd,{className:"h-5 w-5"})})})]})})}),a.jsx("div",{className:"relative py-24 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"relative mb-8",children:a.jsxs("h1",{className:"text-5xl md:text-7xl lg:text-8xl font-bold text-black leading-tight",children:["Offline AI that",a.jsx("br",{}),"works where the",a.jsx("br",{}),"cloud cannot"]})}),a.jsx("p",{className:"text-xl md:text-2xl text-purple-700 font-semibold mb-12 max-w-3xl mx-auto",children:"AI that stays reliable, private, and resilient in any environment"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-20",children:[a.jsx(fe,{size:"lg",className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3 text-lg font-medium",onClick:()=>e("/playground"),children:"Learn More"}),a.jsx(fe,{size:"lg",variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-8 py-3 text-lg font-medium",onClick:()=>e("/playground"),children:"I already have a device"})]})]})}),a.jsx("div",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-white",children:a.jsx("div",{className:"max-w-6xl mx-auto",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:a.jsx("img",{src:"/assets/24h.png",alt:"24/7 Available",className:"h-12 w-12",onError:t=>{console.error("24h icon failed to load"),t.currentTarget.style.display="none"}})}),a.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Always Available"})]}),a.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud AI fails without internet. Our offline AI runs fully on-device, ready to assist anywhere — from airplanes to remote mountains."})]}),a.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:a.jsx("img",{src:"/assets/privacy.png",alt:"Privacy & Security",className:"h-12 w-12",onError:t=>{console.error("Privacy icon failed to load"),t.currentTarget.style.display="none"}})}),a.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Privacy & Security"})]}),a.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud AI requires uploading sensitive data. Offline AI keeps all processing local, protecting personal privacy and enterprise security."})]}),a.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:a.jsx("img",{src:"/assets/reliablity.png",alt:"Reliability",className:"h-12 w-12",onError:t=>{console.error("Reliability icon failed to load"),t.currentTarget.style.display="none"}})}),a.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Reliability"})]}),a.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud latency can cost lives in emergencies. Offline AI responds instantly, built for survival, healthcare, and safety-critical moments."})]})]})})}),a.jsx("footer",{className:"bg-gray-900 text-white py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-6xl mx-auto text-center",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-12 w-12",onError:t=>{console.error("Footer logo failed to load"),t.currentTarget.style.display="none"}})}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Need help? Contact us to get customized device and services"}),a.jsxs("div",{className:"flex justify-center space-x-6",children:[a.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Privacy Policy"}),a.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Terms of Service"}),a.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Support"})]})]})})]})}const tC=$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 ye({className:e,variant:t,...n}){return a.jsx("div",{className:ue(tC({variant:t}),e),...n})}const Ue=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const It=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));It.displayName="CardHeader";const Mt=g.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mt.displayName="CardTitle";const nC=g.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));nC.displayName="CardDescription";const Qe=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));Qe.displayName="CardContent";const rC=g.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));rC.displayName="CardFooter";function iC(){const[e,t]=g.useState("Hardware"),n=Ti();return a.jsxs("div",{className:"min-h-screen bg-gray-50",children:[a.jsx("nav",{className:"bg-white border-b border-gray-200",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex justify-between items-center h-20",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-16 w-16",onError:r=>{console.error("Logo failed to load"),r.currentTarget.style.display="none"}})}),a.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[a.jsx("button",{onClick:()=>n("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),a.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Technology"}),a.jsx("button",{onClick:()=>n("/usecases"),className:"text-gray-700 hover:text-purple-600 font-medium transition-colors",children:"Use Cases"}),a.jsx(fe,{variant:"outline",onClick:()=>n("/playground"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My device"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx(fe,{variant:"ghost",size:"sm",children:a.jsx(Fd,{className:"h-5 w-5"})})})]})})}),a.jsx("div",{className:"py-24 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Our Technology"}),a.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-8",children:"Low-cost FPGA-based design, optimized for Large Language Models on-device."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx("div",{className:"bg-white rounded-lg p-1 shadow-sm",children:["Hardware","Software"].map(r=>a.jsx("button",{onClick:()=>t(r),className:`px-6 py-2 rounded-md text-sm font-medium transition-all ${e===r?"bg-purple-600 text-white":"text-gray-700 hover:text-purple-600"}`,children:r},r))})})]})}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[e==="Hardware"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Hardware Description"}),a.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"Huoxu is an ultra–low-budget single-board computer designed specifically for large language model (LLM) deployment. Despite its compact form factor and low power consumption, we provide:"}),a.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Accelerated inference performance — delivering up to 15 tokens per second on a 30B model, thanks to its optimized FPGA-based AI engine."]}),a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"High memory capacity — up to 40GB RAM, enabling hosting of LLMs up to ≥30B parameters."]}),a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Cost efficiency — making advanced AI workloads accessible at low cost."]})]})]}),a.jsx(Ue,{className:"bg-gradient-to-br from-purple-50 to-blue-50 border-0 shadow-lg",children:a.jsx(Qe,{className:"p-8 space-y-6",children:a.jsxs("div",{className:"flex flex-col space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Chip"}),a.jsx("span",{className:"text-base text-gray-700",children:"AMD Zynq UltraScale+ XCZU3EG"})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Processor"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Quad-core 64-bit Arm Cortex-A53 CPU"}),a.jsx("div",{children:"Dual-core 64-bit Arm Cortex-R5 CPU"}),a.jsx("div",{children:"ARM Mali-400 GPU"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"FPGA Fabric"}),a.jsx("span",{className:"text-base text-gray-700",children:"70K LUT, 360 DSP slices"})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Memory"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"8 GB 64-bit DDR4 (2400 Mbps) on CPU side"}),a.jsx("div",{children:"8 GB / 16 GB / 32 GB DDR4 (2133 Mbps) on FPGA side (SODIMM)"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Storage"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"256 GB PCIe 2.0 x1 NVMe SSD"}),a.jsx("div",{children:"MicroSD card slot"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"I/O"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"USB 2.0 / 3.0 via Type-C"}),a.jsx("div",{children:"Mini DisplayPort"})]})]})]})})})]}),e==="Software"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-start",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-6",children:"Software Stack"}),a.jsx("p",{className:"text-lg text-gray-800 leading-relaxed",children:"Our comprehensive software ecosystem is designed to maximize the potential of Huoxu hardware, providing seamless LLM deployment and management capabilities:"}),a.jsxs("ul",{className:"mt-6 space-y-3 text-lg text-gray-800",children:[a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Custom FPGA-optimized inference engine with quantization support for efficient model deployment."]}),a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Edge LLM Platform — intuitive web interface for model management, chat, and system monitoring."]}),a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"Support for popular model formats (GGUF, ONNX) and frameworks (Transformers, LLaMA.cpp)."]}),a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"text-purple-600 mr-2",children:"•"}),"REST API for seamless integration with existing applications and services."]})]})]}),a.jsx(Ue,{className:"bg-gradient-to-br from-green-50 to-blue-50 border-0 shadow-lg",children:a.jsx(Qe,{className:"p-8 space-y-6",children:a.jsxs("div",{className:"flex flex-col space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"OS Support"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Ubuntu 22.04 LTS"}),a.jsx("div",{children:"Custom Linux Distribution"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Model Formats"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"GGUF (LLaMA.cpp)"}),a.jsx("div",{children:"ONNX"}),a.jsx("div",{children:"PyTorch"}),a.jsx("div",{children:"Transformers"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Inference Engine"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Custom FPGA Accelerator"}),a.jsx("div",{children:"LLaMA.cpp Integration"}),a.jsx("div",{children:"Quantization Support"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Management Interface"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Web-based Dashboard"}),a.jsx("div",{children:"REST API"}),a.jsx("div",{children:"CLI Tools"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Development Tools"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Python SDK"}),a.jsx("div",{children:"Model Optimization Tools"}),a.jsx("div",{children:"Performance Profiler"})]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:"text-lg font-bold text-gray-900",children:"Security"}),a.jsxs("div",{className:"text-base text-gray-700 text-right",children:[a.jsx("div",{children:"Secure Boot"}),a.jsx("div",{children:"Model Encryption"}),a.jsx("div",{children:"Access Control"})]})]})]})})})]})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[a.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"Why us?"}),a.jsxs("div",{className:"bg-white rounded-3xl shadow-xl overflow-hidden",children:[a.jsxs("div",{className:"grid grid-cols-4 bg-gradient-to-r from-gray-50 to-gray-100",children:[a.jsx("div",{className:"p-6"}),a.jsx("div",{className:"p-6 text-center",children:a.jsx(ye,{className:"bg-purple-600 text-white font-bold px-4 py-2",children:"Ours"})}),a.jsx("div",{className:"p-6 text-center",children:a.jsx("span",{className:"font-bold text-gray-800",children:"Raspberry Pi 5"})}),a.jsx("div",{className:"p-6 text-center",children:a.jsx("span",{className:"font-bold text-gray-800",children:"Jetson Orin Nano"})})]}),[{label:"Price",ours:"$199",pi:"$120",jetson:"$249"},{label:"RAM",ours:"24GB/40GB",pi:"16GB",jetson:"8GB"},{label:"CPU",ours:"Cortex-A53",pi:"Cortex-A72",jetson:"Cortex-A78"},{label:"AI Engine",ours:"Optimized Accelerator on FPGA",pi:"Neon SIMD Instructions",jetson:"Cuda/Tensor Core"},{label:"Power",ours:"<10W",pi:"5-12 W",jetson:"7-25"},{label:"LLM decode Performance",ours:"15 tokens/s",pi:"<5 tokens/s",jetson:"15 tokens/s"}].map((r,i)=>a.jsxs("div",{className:`grid grid-cols-4 ${i%2===0?"bg-gray-50":"bg-white"}`,children:[a.jsx("div",{className:"p-4 font-medium text-gray-900 border-r border-gray-200",children:r.label}),a.jsx("div",{className:"p-4 text-center text-white bg-purple-600 font-medium",children:r.ours}),a.jsx("div",{className:"p-4 text-center text-purple-600 font-medium border-r border-gray-200",children:r.pi}),a.jsx("div",{className:"p-4 text-center text-purple-600 font-medium",children:r.jetson})]},r.label))]}),a.jsx("div",{className:"text-center mt-8",children:a.jsx(fe,{className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",children:"View our vision"})})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:[a.jsx("h2",{className:"text-3xl font-semibold text-purple-600 mb-8",children:"The device layout plan"}),a.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 text-center",children:[a.jsx("div",{className:"relative max-w-4xl mx-auto",children:a.jsx("img",{src:"/assets/chips.png",alt:"Device Layout Plan",className:"w-full h-auto rounded-lg shadow-lg",onError:r=>{console.error("Chips image failed to load"),r.currentTarget.style.display="none"}})}),a.jsxs("div",{className:"flex justify-center space-x-4 mt-8",children:[a.jsx(fe,{className:"bg-purple-600 hover:bg-purple-700 text-white px-6 py-2",children:"Get your device"}),a.jsx(fe,{variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-6 py-2",children:"View use cases"})]})]}),a.jsx("p",{className:"text-center text-gray-600 mt-6",children:"Need help? Contact us to get customized device and services"})]})]})}function oC(){const e=Ti(),t=[{id:1,category:"Use case 1: Outdoor Rescue",title:"Offline AI that guides survival in extreme environments",description:"When hikers, travelers, or drivers lose connection to mountains, forests, or rural roads, cloud AI systems can't offer real-time survival guidance, first aid tips, and emergency signaling — even without internet. Includes moments, it becomes your reliable voice of calm and safety.",image:"/api/placeholder/336/240",bgColor:"from-blue-100 to-purple-100"},{id:2,category:"Use case 2: Offline Healthcare",title:"A simple device for seniors to access trusted medical guidance",description:"Many elderly users struggle with smartphones and digital devices. Our simple, voice-only need to press a button or speak a request to get clear, step-by-step medical advice. No internet, no accounts, no complicated setup — just instant, private support for everyday health concerns that helps.",image:"/api/placeholder/336/240",bgColor:"from-green-100 to-blue-100"},{id:3,category:"Use case 3: AI Companion and Assistance",title:"A private, always-available conversational partner",description:"Life can be stressful and lonely at times. Our Offline AI device can be embedded inside a plush toy, transforming it into a private, always-available companion. It listens, talks, tells stories without uploading data to the cloud. AI partner that brings warmth, reassurance, and practical help whenever you need it.",image:"/api/placeholder/336/240",bgColor:"from-purple-100 to-pink-100"}];return a.jsxs("div",{className:"min-h-screen bg-gray-50",children:[a.jsx("nav",{className:"bg-white border-b border-gray-200",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex justify-between items-center h-20",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("img",{src:"/assets/logo.png",alt:"EdgeLLM Logo",className:"h-16 w-16",onError:n=>{console.error("Logo failed to load"),n.currentTarget.style.display="none"}})}),a.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[a.jsx("button",{onClick:()=>e("/"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Home"}),a.jsx("button",{onClick:()=>e("/technology"),className:"text-gray-700 hover:text-purple-600 font-medium",children:"Technology"}),a.jsx("span",{className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Use Cases"}),a.jsx(fe,{variant:"outline",onClick:()=>e("/playground"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My device"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx(fe,{variant:"ghost",size:"sm",children:a.jsx(Fd,{className:"h-5 w-5"})})})]})})}),a.jsx("div",{className:"py-24 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-black mb-6",children:"Use Case Examples"}),a.jsx("p",{className:"text-xl text-purple-700 font-semibold max-w-2xl mx-auto mb-12",children:"Bringing intelligent computing to the edge of connectivity"})]})}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((n,r)=>a.jsx(Ue,{className:"bg-white shadow-lg border-0 rounded-3xl overflow-hidden h-full flex flex-col",children:a.jsxs(Qe,{className:"p-6 flex flex-col h-full",children:[a.jsx("div",{className:"w-full h-60 rounded-xl mb-6 overflow-hidden",children:a.jsx("img",{src:`/assets/${r===0?"outdoor_rescue.png":r===1?"health_care.png":"companion.png"}`,alt:n.title,className:"w-full h-full object-cover",onError:i=>{console.error(`Failed to load image for use case ${r+1}`),i.currentTarget.style.display="none";const o=document.createElement("div");o.className="w-full h-60 bg-gradient-to-br from-gray-200 to-gray-300 rounded-xl flex items-center justify-center",r===0?o.innerHTML='':r===1?o.innerHTML='':o.innerHTML='',i.currentTarget.parentNode&&i.currentTarget.parentNode.appendChild(o)}})}),a.jsxs("div",{className:"flex flex-col flex-grow space-y-4",children:[a.jsx("div",{className:"text-sm font-semibold text-purple-600",children:n.category}),a.jsx("h3",{className:"text-xl font-semibold text-black leading-tight",children:n.title}),a.jsx("p",{className:"text-gray-600 text-sm leading-relaxed flex-grow",children:n.description}),a.jsx("div",{className:"pt-4",children:a.jsx(fe,{className:"bg-purple-600 hover:bg-purple-700 text-white text-sm px-4 py-2 w-auto",onClick:()=>{console.log("Selected use case:",n.id)},children:"Select"})})]})]})},n.id))})}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-16",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-400/30 via-blue-500/30 to-pink-500/30 backdrop-blur-sm rounded-3xl"}),a.jsxs("div",{className:"relative bg-purple-400/20 backdrop-blur-lg rounded-3xl p-8 text-center",children:[a.jsx("div",{className:"flex justify-center mb-6 space-x-1",children:[...Array(20)].map((n,r)=>a.jsx("div",{className:"bg-purple-600 rounded-full animate-pulse",style:{width:"3px",height:`${Math.random()*40+10}px`,animationDelay:`${r*.1}s`,animationDuration:"1s"}},r))}),a.jsx("h2",{className:"text-2xl font-medium text-white mb-4",children:"Customize your own device"}),a.jsx("p",{className:"text-gray-900 mb-6",children:"Need help? Contact us to get customized device and services"}),a.jsx(fe,{className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3",onClick:()=>e("/playground"),children:"Get Started"})]})]})})]})}const ry=g.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));ry.displayName="Input";function lC(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions. Helps identify bugs, security issues, and performance optimizations.",author:"EdgeLLM Team",category:"Developer Tools",tags:["code review","programming","debugging"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15",icon:"🔍",usageCount:1247,rating:4.8},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements. Perfect for essays, articles, and professional documents.",author:"Community",category:"Writing",tags:["writing","editing","grammar"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a writing tutor. Help improve writing through structure, clarity, grammar, and style suggestions. Provide specific feedback and examples.",temperature:.4,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"📝",usageCount:892,rating:4.6},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters. Great for fiction writers and storytellers.",author:"Community",category:"Writing",tags:["creative","storytelling","fiction"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30",icon:"✨",usageCount:634,rating:4.7},{id:"data-analyst",name:"Data Analysis Expert",description:"Helps analyze data patterns, create insights, and generate comprehensive reports with statistical analysis.",author:"EdgeLLM Team",category:"Data & Analytics",tags:["data","analytics","statistics"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a data analysis expert. Help users understand data patterns, create visualizations, and provide statistical insights.",temperature:.2,maxTokens:1200,isOfficial:!0,createdAt:"2024-01-18",icon:"📊",usageCount:567,rating:4.9},{id:"language-tutor",name:"Language Learning Tutor",description:"Interactive language tutor for vocabulary, grammar, and conversation practice. Supports multiple languages.",author:"Community",category:"Education",tags:["language","learning","education"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a friendly language tutor. Help users learn languages through interactive exercises, explanations, and conversation practice.",temperature:.6,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"🌐",usageCount:423,rating:4.5},{id:"business-advisor",name:"Business Strategy Advisor",description:"Provides strategic business advice, market analysis, and growth recommendations for entrepreneurs and businesses.",author:"EdgeLLM Team",category:"Business",tags:["strategy","business","consulting"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a business strategy consultant. Provide strategic advice, market insights, and growth recommendations based on business principles.",temperature:.4,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-22",icon:"💼",usageCount:789,rating:4.7},{id:"research-assistant",name:"Research Assistant",description:"Helps with academic and professional research, source analysis, and comprehensive report writing.",author:"Community",category:"Research",tags:["research","academic","analysis"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a research assistant. Help users conduct thorough research, analyze sources, and organize findings into comprehensive reports.",temperature:.3,maxTokens:1200,isOfficial:!1,createdAt:"2024-01-25",icon:"📚",usageCount:356,rating:4.4},{id:"math-tutor",name:"Math & Science Tutor",description:"Expert tutor for mathematics, physics, chemistry, and other STEM subjects with step-by-step explanations.",author:"EdgeLLM Team",category:"Education",tags:["math","science","tutoring"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a math and science tutor. Provide clear, step-by-step explanations for mathematical and scientific concepts.",temperature:.2,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-28",icon:"🔬",usageCount:678,rating:4.8}]}function sC(){const e=Ti(),[t,n]=g.useState(!1),[r]=g.useState(lC()),[i,o]=g.useState([]),[l,s]=g.useState(""),[u,c]=g.useState("All");g.useEffect(()=>{f(),d()},[]);const f=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,v=await fetch(`${h}/models`);n(v.ok)}catch{n(!1)}},d=()=>{try{const h=JSON.parse(localStorage.getItem("likedTemplates")||"[]");o(h)}catch(h){console.error("Failed to load liked templates:",h)}},p=h=>{const v=i.includes(h)?i.filter(k=>k!==h):[...i,h];o(v),localStorage.setItem("likedTemplates",JSON.stringify(v))},m=h=>{const v={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(v)),e("/playground")},w=r.filter(h=>{const v=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(j=>j.toLowerCase().includes(l.toLowerCase())),k=u==="All"||h.category===u;return v&&k}),x=w.filter(h=>h.isOfficial),S=[...w].sort((h,v)=>v.usageCount-h.usageCount).slice(0,6),y=["All",...Array.from(new Set(r.map(h=>h.category)))];return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:a.jsx(Er,{className:"h-5 w-5 text-white"})}),a.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),a.jsx(ye,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),a.jsxs(fe,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[a.jsx(ei,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),a.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),a.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),a.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[a.jsx(Xp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),a.jsx(ry,{type:"text",placeholder:"Search assistants...",value:l,onChange:h=>s(h.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),a.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:y.map(h=>a.jsx(fe,{variant:u===h?"default":"outline",size:"sm",onClick:()=>c(h),className:"rounded-full",children:h},h))})]}),u==="All"&&x.length>0&&a.jsxs("div",{className:"mb-12",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Qx,{className:"h-5 w-5 text-yellow-600"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),a.jsx(ye,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:x.slice(0,3).map(h=>a.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),u==="All"&&a.jsxs("div",{className:"mb-12",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Zx,{className:"h-5 w-5 text-green-600"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),a.jsx(ye,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>a.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),a.jsxs("div",{className:"mb-12",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(UN,{className:"h-5 w-5 text-blue-600"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:u==="All"?"All Templates":u}),a.jsxs(ye,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>a.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):a.jsx(Ue,{className:"p-12 text-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx(Xp,{className:"h-12 w-12 text-gray-400"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),a.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),a.jsx(fe,{variant:"outline",onClick:()=>{s(""),c("All")},children:"Clear filters"})]})})]})]})]})}function Ka({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return a.jsxs(Ue,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&a.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[a.jsx(Qx,{className:"h-3 w-3"}),"Featured"]}),o&&a.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[a.jsx(Zx,{className:"h-3 w-3"}),"Trending"]}),a.jsx(It,{className:"pb-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),a.jsxs("div",{children:[a.jsx(Mt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&a.jsxs(ye,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[a.jsx(Wk,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),a.jsx(fe,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:a.jsx(gN,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),a.jsxs(Qe,{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>a.jsx(ye,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),a.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(dN,{className:"h-4 w-4"}),a.jsx("span",{children:e.usageCount.toLocaleString()})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(LN,{className:"h-4 w-4 text-yellow-500 fill-current"}),a.jsx("span",{children:e.rating})]})]}),a.jsx(ye,{variant:"outline",className:"text-xs",children:e.category})]}),a.jsx("div",{className:"pt-2",children:a.jsxs(fe,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[a.jsx(Zs,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function aC(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,u=g.useMemo(()=>s,Object.values(s));return a.jsx(n.Provider,{value:u,children:l})};r.displayName=e+"Provider";function i(o){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function sr(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),u=n.length;n=[...n,l];const c=d=>{var y;const{scope:p,children:m,...w}=d,x=((y=p==null?void 0:p[e])==null?void 0:y[u])||s,S=g.useMemo(()=>w,Object.values(w));return a.jsx(x.Provider,{value:S,children:m})};c.displayName=o+"Provider";function f(d,p){var x;const m=((x=p==null?void 0:p[e])==null?void 0:x[u])||s,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(s){const u=(s==null?void 0:s[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,uC(i,...t)]}function uC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Vd(e){const t=e+"CollectionProvider",[n,r]=sr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:S,children:y}=x,h=Vt.useRef(null),v=Vt.useRef(new Map).current;return a.jsx(i,{scope:S,itemMap:v,collectionRef:h,children:y})};l.displayName=t;const s=e+"CollectionSlot",u=Si(s),c=Vt.forwardRef((x,S)=>{const{scope:y,children:h}=x,v=o(s,y),k=ve(S,v.collectionRef);return a.jsx(u,{ref:k,children:h})});c.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Si(f),m=Vt.forwardRef((x,S)=>{const{scope:y,children:h,...v}=x,k=Vt.useRef(null),j=ve(S,k),C=o(f,y);return Vt.useEffect(()=>(C.itemMap.set(k,{ref:k,...v}),()=>void C.itemMap.delete(k))),a.jsx(p,{[d]:"",ref:j,children:h})});m.displayName=f;function w(x){const S=o(e+"CollectionConsumer",x);return Vt.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((C,E)=>v.indexOf(C.ref.current)-v.indexOf(E.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:m},w,r]}var tt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},cC=Wc[" useId ".trim().toString()]||(()=>{}),dC=0;function qn(e){const[t,n]=g.useState(cC());return tt(()=>{e||n(r=>r??String(dC++))},[e]),e||(t?`radix-${t}`:"")}var fC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=fC.reduce((e,t)=>{const n=Si(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...s}=i,u=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function pC(e,t){e&&Ei.flushSync(()=>e.dispatchEvent(t))}function er(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var mC=Wc[" useInsertionEffect ".trim().toString()]||tt;function bi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=hC({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:i;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const d=f.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const c=g.useCallback(f=>{var d;if(s){const p=gC(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[s,e,o,l]);return[u,c]}function hC({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return mC(()=>{o.current=t},[t]),g.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function gC(e){return typeof e=="function"}var xC=g.createContext(void 0);function ea(e){const t=g.useContext(xC);return e||t||"ltr"}var Qa="rovingFocusGroup.onEntryFocus",yC={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[gc,iy,vC]=Vd(Uo),[wC,oy]=sr(Uo,[vC]),[SC,bC]=wC(Uo),ly=g.forwardRef((e,t)=>a.jsx(gc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(gc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(kC,{...e,ref:t})})}));ly.displayName=Uo;var kC=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=e,p=g.useRef(null),m=ve(t,p),w=ea(o),[x,S]=bi({prop:l,defaultProp:s??null,onChange:u,caller:Uo}),[y,h]=g.useState(!1),v=er(c),k=iy(n),j=g.useRef(!1),[C,E]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Qa,v),()=>T.removeEventListener(Qa,v)},[v]),a.jsx(SC,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>E(T=>T-1),[]),children:a.jsx(oe.div,{tabIndex:y||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{j.current=!0}),onFocus:Z(e.onFocus,T=>{const O=!j.current;if(T.target===T.currentTarget&&O&&!y){const M=new CustomEvent(Qa,yC);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const R=k().filter(L=>L.focusable),_=R.find(L=>L.active),H=R.find(L=>L.id===x),I=[_,H,...R].filter(Boolean).map(L=>L.ref.current);uy(I,f)}}j.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),sy="RovingFocusGroupItem",ay=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,u=qn(),c=o||u,f=bC(sy,n),d=f.currentTabStopId===c,p=iy(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:x}=f;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),a.jsx(gc.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:a.jsx(oe.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const y=jC(S,f.orientation,f.dir);if(y!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(k=>k.focusable).map(k=>k.ref.current);if(y==="last")v.reverse();else if(y==="prev"||y==="next"){y==="prev"&&v.reverse();const k=v.indexOf(S.currentTarget);v=f.loop?EC(v,k+1):v.slice(k+1)}setTimeout(()=>uy(v))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:x!=null}):l})})});ay.displayName=sy;var NC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jC(e,t,n){const r=CC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NC[r]}function uy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function EC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PC=ly,TC=ay;function _C(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Vo=e=>{const{present:t,children:n}=e,r=AC(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ve(r.ref,RC(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Vo.displayName="Presence";function AC(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,u]=_C(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=ml(r.current);o.current=s==="mounted"?c:"none"},[s]),tt(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=ml(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),tt(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,d=m=>{const x=ml(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&x&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=ml(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ml(e){return(e==null?void 0:e.animationName)||"none"}function RC(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 ta="Tabs",[IC,_I]=sr(ta,[oy]),cy=oy(),[MC,Hd]=IC(ta),dy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:u="automatic",...c}=e,f=ea(s),[d,p]=bi({prop:r,onChange:i,defaultProp:o??"",caller:ta});return a.jsx(MC,{scope:n,baseId:qn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:u,children:a.jsx(oe.div,{dir:f,"data-orientation":l,...c,ref:t})})});dy.displayName=ta;var fy="TabsList",py=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Hd(fy,n),l=cy(n);return a.jsx(PC,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(oe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});py.displayName=fy;var my="TabsTrigger",hy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Hd(my,n),s=cy(n),u=yy(l.baseId,r),c=vy(l.baseId,r),f=r===l.value;return a.jsx(TC,{asChild:!0,...s,focusable:!i,active:f,children:a.jsx(oe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Z(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:Z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});hy.displayName=my;var gy="TabsContent",xy=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Hd(gy,n),u=yy(s.baseId,r),c=vy(s.baseId,r),f=r===s.value,d=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),a.jsx(Vo,{present:i||f,children:({present:p})=>a.jsx(oe.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});xy.displayName=gy;function yy(e,t){return`${e}-trigger-${t}`}function vy(e,t){return`${e}-content-${t}`}var LC=dy,wy=py,Sy=hy,by=xy;const OC=LC,ky=g.forwardRef(({className:e,...t},n)=>a.jsx(wy,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ky.displayName=wy.displayName;const Ll=g.forwardRef(({className:e,...t},n)=>a.jsx(Sy,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ll.displayName=Sy.displayName;const Ol=g.forwardRef(({className:e,...t},n)=>a.jsx(by,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ol.displayName=by.displayName;var DC="Label",Ny=g.forwardRef((e,t)=>a.jsx(oe.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())}}));Ny.displayName=DC;var Cy=Ny;const zC=$d("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ze=g.forwardRef(({className:e,...t},n)=>a.jsx(Cy,{ref:n,className:ue(zC(),e),...t}));Ze.displayName=Cy.displayName;function FC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var BC="DismissableLayer",xc="dismissableLayer.update",$C="dismissableLayer.pointerDownOutside",UC="dismissableLayer.focusOutside",tm,jy=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:l,onDismiss:s,...u}=e,c=g.useContext(jy),[f,d]=g.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=ve(t,E=>d(E)),x=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=x.indexOf(S),h=f?x.indexOf(f):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=h>=y,j=WC(E=>{const T=E.target,O=[...c.branches].some(M=>M.contains(T));!k||O||(i==null||i(E),l==null||l(E),E.defaultPrevented||s==null||s())},p),C=GC(E=>{const T=E.target;[...c.branches].some(M=>M.contains(T))||(o==null||o(E),l==null||l(E),E.defaultPrevented||s==null||s())},p);return FC(E=>{h===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},p),g.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tm=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),nm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=tm)}},[f,p,n,c]),g.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),nm())},[f,c]),g.useEffect(()=>{const E=()=>m({});return document.addEventListener(xc,E),()=>document.removeEventListener(xc,E)},[]),a.jsx(oe.div,{...u,ref:w,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,j.onPointerDownCapture)})});Wd.displayName=BC;var VC="DismissableLayerBranch",HC=g.forwardRef((e,t)=>{const n=g.useContext(jy),r=g.useRef(null),i=ve(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(oe.div,{...e,ref:i})});HC.displayName=VC;function WC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Ey($C,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function GC(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ey(UC,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(xc);document.dispatchEvent(e)}function Ey(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?pC(i,o):i.dispatchEvent(o)}var Ya="focusScope.autoFocusOnMount",Xa="focusScope.autoFocusOnUnmount",rm={bubbles:!1,cancelable:!0},KC="FocusScope",Gd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,u]=g.useState(null),c=er(i),f=er(o),d=g.useRef(null),p=ve(t,x=>u(x)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let x=function(v){if(m.paused||!s)return;const k=v.target;s.contains(k)?d.current=k:In(d.current,{select:!0})},S=function(v){if(m.paused||!s)return;const k=v.relatedTarget;k!==null&&(s.contains(k)||In(d.current,{select:!0}))},y=function(v){if(document.activeElement===document.body)for(const j of v)j.removedNodes.length>0&&In(s)};document.addEventListener("focusin",x),document.addEventListener("focusout",S);const h=new MutationObserver(y);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),h.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){om.add(m);const x=document.activeElement;if(!s.contains(x)){const y=new CustomEvent(Ya,rm);s.addEventListener(Ya,c),s.dispatchEvent(y),y.defaultPrevented||(QC(ZC(Py(s)),{select:!0}),document.activeElement===x&&In(s))}return()=>{s.removeEventListener(Ya,c),setTimeout(()=>{const y=new CustomEvent(Xa,rm);s.addEventListener(Xa,f),s.dispatchEvent(y),y.defaultPrevented||In(x??document.body,{select:!0}),s.removeEventListener(Xa,f),om.remove(m)},0)}}},[s,c,f,m]);const w=g.useCallback(x=>{if(!n&&!r||m.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,y=document.activeElement;if(S&&y){const h=x.currentTarget,[v,k]=YC(h);v&&k?!x.shiftKey&&y===k?(x.preventDefault(),n&&In(v,{select:!0})):x.shiftKey&&y===v&&(x.preventDefault(),n&&In(k,{select:!0})):y===h&&x.preventDefault()}},[n,r,m.paused]);return a.jsx(oe.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Gd.displayName=KC;function QC(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(In(r,{select:t}),document.activeElement!==n)return}function YC(e){const t=Py(e),n=im(t,e),r=im(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 im(e,t){for(const n of e)if(!XC(n,{upTo:t}))return n}function XC(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 qC(e){return e instanceof HTMLInputElement&&"select"in e}function In(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qC(e)&&t&&e.select()}}var om=JC();function JC(){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 ZC(e){return e.filter(t=>t.tagName!=="A")}var e2="Portal",Kd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);tt(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ob.createPortal(a.jsx(oe.div,{...r,ref:t}),l):null});Kd.displayName=e2;var qa=0;function Ty(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??sm()),document.body.insertAdjacentElement("beforeend",e[1]??sm()),qa++,()=>{qa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qa--}},[])}function sm(){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 ln=function(){return ln=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return x2;var t=y2(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])}},w2=Iy(),ai="data-scroll-locked",S2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(n2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(ai,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Dl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(zl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Dl," .").concat(Dl,` { + right: 0 `).concat(r,`; + } + + .`).concat(zl," .").concat(zl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ai,`] { + `).concat(r2,": ").concat(s,`px; + } +`)},cm=function(){var e=parseInt(document.body.getAttribute(ai)||"0",10);return isFinite(e)?e:0},b2=function(){g.useEffect(function(){return document.body.setAttribute(ai,(cm()+1).toString()),function(){var e=cm()-1;e<=0?document.body.removeAttribute(ai):document.body.setAttribute(ai,e.toString())}},[])},k2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;b2();var o=g.useMemo(function(){return v2(i)},[i]);return g.createElement(w2,{styles:S2(o,!t,i,n?"":"!important")})},yc=!1;if(typeof window<"u")try{var hl=Object.defineProperty({},"passive",{get:function(){return yc=!0,!0}});window.addEventListener("test",hl,hl),window.removeEventListener("test",hl,hl)}catch{yc=!1}var zr=yc?{passive:!1}:!1,N2=function(e){return e.tagName==="TEXTAREA"},My=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!N2(e)&&n[t]==="visible")},C2=function(e){return My(e,"overflowY")},j2=function(e){return My(e,"overflowX")},dm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Ly(e,r);if(i){var o=Oy(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},E2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},P2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ly=function(e,t){return e==="v"?C2(t):j2(t)},Oy=function(e,t){return e==="v"?E2(t):P2(t)},T2=function(e,t){return e==="h"&&t==="rtl"?-1:1},_2=function(e,t,n,r,i){var o=T2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,u=t.contains(s),c=!1,f=l>0,d=0,p=0;do{if(!s)break;var m=Oy(e,s),w=m[0],x=m[1],S=m[2],y=x-S-o*w;(w||y)&&Ly(e,s)&&(d+=y,p+=w);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(p)<1||!i&&-l>p))&&(c=!0),c},gl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fm=function(e){return[e.deltaX,e.deltaY]},pm=function(e){return e&&"current"in e?e.current:e},A2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},R2=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},I2=0,Fr=[];function M2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(I2++)[0],o=g.useState(Iy)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=t2([e.lockRef.current],(e.shards||[]).map(pm),!0).filter(Boolean);return x.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(x,S){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var y=gl(x),h=n.current,v="deltaX"in x?x.deltaX:h[0]-y[0],k="deltaY"in x?x.deltaY:h[1]-y[1],j,C=x.target,E=Math.abs(v)>Math.abs(k)?"h":"v";if("touches"in x&&E==="h"&&C.type==="range")return!1;var T=dm(E,C);if(!T)return!0;if(T?j=E:(j=E==="v"?"h":"v",T=dm(E,C)),!T)return!1;if(!r.current&&"changedTouches"in x&&(v||k)&&(r.current=j),!j)return!0;var O=r.current||j;return _2(O,S,x,O==="h"?v:k,!0)},[]),u=g.useCallback(function(x){var S=x;if(!(!Fr.length||Fr[Fr.length-1]!==o)){var y="deltaY"in S?fm(S):gl(S),h=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&A2(j.delta,y)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var v=(l.current.shards||[]).map(pm).filter(Boolean).filter(function(j){return j.contains(S.target)}),k=v.length>0?s(S,v[0]):!l.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(x,S,y,h){var v={name:x,delta:S,target:y,should:h,shadowParent:L2(y)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(k){return k!==v})},1)},[]),f=g.useCallback(function(x){n.current=gl(x),r.current=void 0},[]),d=g.useCallback(function(x){c(x.type,fm(x),x.target,s(x,e.lockRef.current))},[]),p=g.useCallback(function(x){c(x.type,gl(x),x.target,s(x,e.lockRef.current))},[]);g.useEffect(function(){return Fr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,zr),document.addEventListener("touchmove",u,zr),document.addEventListener("touchstart",f,zr),function(){Fr=Fr.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,zr),document.removeEventListener("touchmove",u,zr),document.removeEventListener("touchstart",f,zr)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:R2(i)}):null,m?g.createElement(k2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function L2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const O2=c2(Ry,M2);var Dy=g.forwardRef(function(e,t){return g.createElement(na,ln({},e,{ref:t,sideCar:O2}))});Dy.classNames=na.classNames;const zy=Dy;var D2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Br=new WeakMap,xl=new WeakMap,yl={},tu=0,Fy=function(e){return e&&(e.host||Fy(e.parentNode))},z2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fy(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},F2=function(e,t,n,r){var i=z2(t,Array.isArray(e)?e:[e]);yl[n]||(yl[n]=new WeakMap);var o=yl[n],l=[],s=new Set,u=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))f(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",x=(Br.get(p)||0)+1,S=(o.get(p)||0)+1;Br.set(p,x),o.set(p,S),l.push(p),x===1&&w&&xl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return f(t),s.clear(),tu++,function(){l.forEach(function(d){var p=Br.get(d)-1,m=o.get(d)-1;Br.set(d,p),o.set(d,m),p||(xl.has(d)||d.removeAttribute(r),xl.delete(d)),m||d.removeAttribute(n)}),tu--,tu||(Br=new WeakMap,Br=new WeakMap,xl=new WeakMap,yl={})}},By=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||D2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),F2(r,i,n,"aria-hidden")):function(){return null}},ra="Dialog",[$y,Uy]=sr(ra),[B2,qt]=$y(ra),Vy=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),u=g.useRef(null),[c,f]=bi({prop:r,defaultProp:i??!1,onChange:o,caller:ra});return a.jsx(B2,{scope:t,triggerRef:s,contentRef:u,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};Vy.displayName=ra;var Hy="DialogTrigger",Wy=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Hy,n),o=ve(t,i.triggerRef);return a.jsx(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Xd(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});Wy.displayName=Hy;var Qd="DialogPortal",[$2,Gy]=$y(Qd,{forceMount:void 0}),Ky=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=qt(Qd,t);return a.jsx($2,{scope:t,forceMount:n,children:g.Children.map(r,l=>a.jsx(Vo,{present:n||o.open,children:a.jsx(Kd,{asChild:!0,container:i,children:l})}))})};Ky.displayName=Qd;var Ns="DialogOverlay",Qy=g.forwardRef((e,t)=>{const n=Gy(Ns,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Ns,e.__scopeDialog);return o.modal?a.jsx(Vo,{present:r||o.open,children:a.jsx(V2,{...i,ref:t})}):null});Qy.displayName=Ns;var U2=Si("DialogOverlay.RemoveScroll"),V2=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Ns,n);return a.jsx(zy,{as:U2,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(oe.div,{"data-state":Xd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pr="DialogContent",Yy=g.forwardRef((e,t)=>{const n=Gy(Pr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Pr,e.__scopeDialog);return a.jsx(Vo,{present:r||o.open,children:o.modal?a.jsx(H2,{...i,ref:t}):a.jsx(W2,{...i,ref:t})})});Yy.displayName=Pr;var H2=g.forwardRef((e,t)=>{const n=qt(Pr,e.__scopeDialog),r=g.useRef(null),i=ve(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return By(o)},[]),a.jsx(Xy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),W2=g.forwardRef((e,t)=>{const n=qt(Pr,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return a.jsx(Xy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Xy=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=qt(Pr,n),u=g.useRef(null),c=ve(t,u);return Ty(),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:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Xd(s.open),...l,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(K2,{titleId:s.titleId}),a.jsx(Y2,{contentRef:u,descriptionId:s.descriptionId})]})]})}),Yd="DialogTitle",qy=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Yd,n);return a.jsx(oe.h2,{id:i.titleId,...r,ref:t})});qy.displayName=Yd;var Jy="DialogDescription",Zy=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Jy,n);return a.jsx(oe.p,{id:i.descriptionId,...r,ref:t})});Zy.displayName=Jy;var ev="DialogClose",tv=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(ev,n);return a.jsx(oe.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});tv.displayName=ev;function Xd(e){return e?"open":"closed"}var nv="DialogTitleWarning",[G2,rv]=aC(nv,{contentName:Pr,titleName:Yd,docsSlug:"dialog"}),K2=({titleId:e})=>{const t=rv(nv),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},Q2="DialogDescriptionWarning",Y2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rv(Q2).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},X2=Vy,q2=Wy,J2=Ky,Z2=Qy,ej=Yy,tj=qy,nj=Zy,iv=tv,ov="AlertDialog",[rj,AI]=sr(ov,[Uy]),Tn=Uy(),lv=e=>{const{__scopeAlertDialog:t,...n}=e,r=Tn(t);return a.jsx(X2,{...r,...n,modal:!0})};lv.displayName=ov;var ij="AlertDialogTrigger",oj=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Tn(n);return a.jsx(q2,{...i,...r,ref:t})});oj.displayName=ij;var lj="AlertDialogPortal",sv=e=>{const{__scopeAlertDialog:t,...n}=e,r=Tn(t);return a.jsx(J2,{...r,...n})};sv.displayName=lj;var sj="AlertDialogOverlay",av=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Tn(n);return a.jsx(Z2,{...i,...r,ref:t})});av.displayName=sj;var ui="AlertDialogContent",[aj,uj]=rj(ui),cj=XN("AlertDialogContent"),uv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Tn(n),l=g.useRef(null),s=ve(t,l),u=g.useRef(null);return a.jsx(G2,{contentName:ui,titleName:cv,docsSlug:"alert-dialog",children:a.jsx(aj,{scope:n,cancelRef:u,children:a.jsxs(ej,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=u.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[a.jsx(cj,{children:r}),a.jsx(fj,{contentRef:l})]})})})});uv.displayName=ui;var cv="AlertDialogTitle",dv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Tn(n);return a.jsx(tj,{...i,...r,ref:t})});dv.displayName=cv;var fv="AlertDialogDescription",pv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Tn(n);return a.jsx(nj,{...i,...r,ref:t})});pv.displayName=fv;var dj="AlertDialogAction",mv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Tn(n);return a.jsx(iv,{...i,...r,ref:t})});mv.displayName=dj;var hv="AlertDialogCancel",gv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=uj(hv,n),o=Tn(n),l=ve(t,i);return a.jsx(iv,{...o,...r,ref:l})});gv.displayName=hv;var fj=({contentRef:e})=>{const t=`\`${ui}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ui}\` by passing a \`${fv}\` 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 \`${ui}\`. 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},pj=lv,mj=sv,xv=av,yv=uv,vv=mv,wv=gv,Sv=dv,bv=pv;const nu=pj,hj=mj,kv=g.forwardRef(({className:e,...t},n)=>a.jsx(xv,{className:ue("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));kv.displayName=xv.displayName;const Fl=g.forwardRef(({className:e,...t},n)=>a.jsxs(hj,{children:[a.jsx(kv,{}),a.jsx(yv,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Fl.displayName=yv.displayName;const Bl=({className:e,...t})=>a.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bl.displayName="AlertDialogHeader";const $l=({className:e,...t})=>a.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$l.displayName="AlertDialogFooter";const Ul=g.forwardRef(({className:e,...t},n)=>a.jsx(Sv,{ref:n,className:ue("text-lg font-semibold",e),...t}));Ul.displayName=Sv.displayName;const Vl=g.forwardRef(({className:e,...t},n)=>a.jsx(bv,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Vl.displayName=bv.displayName;const Hl=g.forwardRef(({className:e,...t},n)=>a.jsx(vv,{ref:n,className:ue(Ud(),e),...t}));Hl.displayName=vv.displayName;const Wl=g.forwardRef(({className:e,...t},n)=>a.jsx(wv,{ref:n,className:ue(Ud({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Wl.displayName=wv.displayName;const Nv=g.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:ue("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Nv.displayName="Textarea";function gj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vj={};function mm(e,t){return((t||vj).jsx?yj:xj).test(e)}const wj=/[ \t\n\f\r]/g;function Sj(e){return typeof e=="object"?e.type==="text"?hm(e.value):!1:hm(e)}function hm(e){return e.replace(wj,"")===""}class Ho{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ho.prototype.normal={};Ho.prototype.property={};Ho.prototype.space=void 0;function Cv(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ho(n,r,t)}function vc(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let bj=0;const J=Or(),De=Or(),wc=Or(),$=Or(),ke=Or(),ci=Or(),yt=Or();function Or(){return 2**++bj}const Sc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:De,commaOrSpaceSeparated:yt,commaSeparated:ci,number:$,overloadedBoolean:wc,spaceSeparated:ke},Symbol.toStringTag,{value:"Module"})),ru=Object.keys(Sc);class qd extends gt{constructor(t,n,r,i){let o=-1;if(super(t,n),gm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ej.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(xm,_j);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!xm.test(o)){let l=o.replace(jj,Tj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=qd}return new i(r,t)}function Tj(e){return"-"+e.toLowerCase()}function _j(e){return e.charAt(1).toUpperCase()}const Aj=Cv([jv,kj,Tv,_v,Av],"html"),Jd=Cv([jv,Nj,Tv,_v,Av],"svg");function Rj(e){return e.join(" ").trim()}var Zd={},ym=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ij=/\n/g,Mj=/^\s*/,Lj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Oj=/^:\s*/,Dj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zj=/^[;\s]*/,Fj=/^\s+|\s+$/g,Bj=` +`,vm="/",wm="*",mr="",$j="comment",Uj="declaration",Vj=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var x=w.match(Ij);x&&(n+=x.length);var S=w.lastIndexOf(Bj);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(x){return x.position=new l(w),c(),x}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var x=new Error(t.source+":"+n+":"+r+": "+w);if(x.reason=w,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(w){var x=w.exec(e);if(x){var S=x[0];return i(S),e=e.slice(S.length),x}}function c(){u(Mj)}function f(w){var x;for(w=w||[];x=d();)x!==!1&&w.push(x);return w}function d(){var w=o();if(!(vm!=e.charAt(0)||wm!=e.charAt(1))){for(var x=2;mr!=e.charAt(x)&&(wm!=e.charAt(x)||vm!=e.charAt(x+1));)++x;if(x+=2,mr===e.charAt(x-1))return s("End of comment missing");var S=e.slice(2,x-2);return r+=2,i(S),e=e.slice(x),r+=2,w({type:$j,comment:S})}}function p(){var w=o(),x=u(Lj);if(x){if(d(),!u(Oj))return s("property missing ':'");var S=u(Dj),y=w({type:Uj,property:Sm(x[0].replace(ym,mr)),value:S?Sm(S[0].replace(ym,mr)):mr});return u(zj),y}}function m(){var w=[];f(w);for(var x;x=p();)x!==!1&&(w.push(x),f(w));return w}return c(),m()};function Sm(e){return e?e.replace(Fj,mr):mr}var Hj=Yl&&Yl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zd,"__esModule",{value:!0});Zd.default=Gj;var Wj=Hj(Vj);function Gj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Wj.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.camelCase=void 0;var Kj=/^--[a-zA-Z0-9_-]+$/,Qj=/-([a-z])/g,Yj=/^[^-]+$/,Xj=/^-(webkit|moz|ms|o|khtml)-/,qj=/^-(ms)-/,Jj=function(e){return!e||Yj.test(e)||Kj.test(e)},Zj=function(e,t){return t.toUpperCase()},bm=function(e,t){return"".concat(t,"-")},eE=function(e,t){return t===void 0&&(t={}),Jj(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qj,bm):e=e.replace(Xj,bm),e.replace(Qj,Zj))};ia.camelCase=eE;var tE=Yl&&Yl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nE=tE(Zd),rE=ia;function bc(e,t){var n={};return!e||typeof e!="string"||(0,nE.default)(e,function(r,i){r&&i&&(n[(0,rE.camelCase)(r,t)]=i)}),n}bc.default=bc;var iE=bc;const oE=Ms(iE),Rv=Iv("end"),ef=Iv("start");function Iv(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 lE(e){const t=ef(e),n=Rv(e);if(t&&n)return{start:t,end:n}}function uo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?km(e.position):"start"in e||"end"in e?km(e):"line"in e||"column"in e?kc(e):""}function kc(e){return Nm(e&&e.line)+":"+Nm(e&&e.column)}function km(e){return kc(e&&e.start)+"-"+kc(e&&e.end)}function Nm(e){return e&&typeof e=="number"?e:1}class nt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=uo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nt.prototype.file="";nt.prototype.name="";nt.prototype.reason="";nt.prototype.message="";nt.prototype.stack="";nt.prototype.column=void 0;nt.prototype.line=void 0;nt.prototype.ancestors=void 0;nt.prototype.cause=void 0;nt.prototype.fatal=void 0;nt.prototype.place=void 0;nt.prototype.ruleId=void 0;nt.prototype.source=void 0;const tf={}.hasOwnProperty,sE=new Map,aE=/[A-Z]/g,uE=new Set(["table","tbody","thead","tfoot","tr"]),cE=new Set(["td","th"]),Mv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dE(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=vE(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=yE(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"?Jd:Aj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Lv(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Lv(e,t,n){if(t.type==="element")return fE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return hE(e,t,n);if(t.type==="mdxjsEsm")return mE(e,t);if(t.type==="root")return gE(e,t,n);if(t.type==="text")return xE(e,t)}function fE(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jd,e.schema=i),e.ancestors.push(t);const o=Dv(e,t.tagName,!1),l=wE(e,t);let s=rf(e,t);return uE.has(t.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!Sj(u):!0})),Ov(e,l,o,t),nf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function pE(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)}Ro(e,t.position)}function mE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function hE(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Dv(e,t.name,!0),l=SE(e,t),s=rf(e,t);return Ov(e,l,o,t),nf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function gE(e,t,n){const r={};return nf(r,rf(e,t)),e.create(t,e.Fragment,r,n)}function xE(e,t){return t.value}function Ov(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yE(e,t,n){return r;function r(i,o,l,s){const c=Array.isArray(l.children)?n:t;return s?c(o,l,s):c(o,l)}}function vE(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),u=ef(r);return t(i,o,l,s,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function wE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tf.call(t.properties,i)){const o=bE(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&cE.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function SE(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Ro(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Ro(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function rf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:sE;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(fn(e,e.length,0,t),e):t}const Em={}.hasOwnProperty;function _E(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 di(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=ar(/[A-Za-z]/),bt=ar(/[\dA-Za-z]/),IE=ar(/[#-'*+\--9=?A-Z^-~]/);function Nc(e){return e!==null&&(e<32||e===127)}const Cc=ar(/\d/),ME=ar(/[\dA-Fa-f]/),LE=ar(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function xe(e){return e===-2||e===-1||e===32}const OE=ar(/\p{P}|\p{S}/u),DE=ar(/\s/);function ar(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ai(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return xe(u)?(e.enter(n),s(u)):t(u)}function s(u){return xe(u)&&o++l))return;const E=t.events.length;let T=E,O,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(O){M=t.events[T][1].end;break}O=!0}for(y(r),C=E;Cv;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=v}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function UE(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tm(e){if(e===null||ht(e)||DE(e))return 1;if(OE(e))return 2}function lf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};_m(d,-u),_m(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=_t(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=_t(c,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=_t(c,lf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=_t(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=_t(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,fn(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n0&&xe(C)?Ce(e,h,"linePrefix",o+1)(C):h(C)}function h(C){return C===null||Y(C)?e.check(Am,x,k)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||Y(C)?(e.exit("codeFlowValue"),h(C)):(e.consume(C),v)}function k(C){return e.exit("codeFenced"),t(C)}function j(C,E,T){let O=0;return M;function M(I){return C.enter("lineEnding"),C.consume(I),C.exit("lineEnding"),R}function R(I){return C.enter("codeFencedFence"),xe(I)?Ce(C,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I)}function _(I){return I===s?(C.enter("codeFencedFenceSequence"),H(I)):T(I)}function H(I){return I===s?(O++,C.consume(I),H):O>=l?(C.exit("codeFencedFenceSequence"),xe(I)?Ce(C,W,"whitespace")(I):W(I)):T(I)}function W(I){return I===null||Y(I)?(C.exit("codeFencedFence"),E(I)):T(I)}}}function eP(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const ou={name:"codeIndented",tokenize:nP},tP={partial:!0,tokenize:rP};function nP(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ce(e,o,"linePrefix",4+1)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?u(c):Y(c)?e.attempt(tP,l,u)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Y(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),s)}function u(c){return e.exit("codeIndented"),t(c)}}function rP(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Ce(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):Y(l)?i(l):n(l)}}const iP={name:"codeText",previous:lP,resolve:oP,tokenize:sP};function oP(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&&Ki(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),Ki(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ki(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Hv(e,t,n,r,i,o,l,s,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||Nc(y)?n(y):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||Y(y)?n(y):(e.consume(y),y===92?w:m)}function w(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!f&&(y===null||y===41||ht(y))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(y)):f999||m===null||m===91||m===93&&!u||m===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Y(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Y(m)||s++>999?(e.exit("chunkString"),f(m)):(e.consume(m),u||(u=!xe(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function Gv(e,t,n,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===l?(e.exit(o),u(l)):p===null?n(p):Y(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ce(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||Y(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function co(e,t){let n;return r;function r(i){return Y(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):xe(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const hP={name:"definition",tokenize:xP},gP={partial:!0,tokenize:yP};function xP(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return Wv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return ht(m)?co(e,c)(m):c(m)}function c(m){return Hv(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(gP,d,d)(m)}function d(m){return xe(m)?Ce(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Y(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function yP(e,t,n){return r;function r(s){return ht(s)?co(e,i)(s):n(s)}function i(s){return Gv(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return xe(s)?Ce(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const vP={name:"hardBreakEscape",tokenize:wP};function wP(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Y(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const SP={name:"headingAtx",resolve:bP,tokenize:kP};function bP(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"},fn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function kP(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||ht(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Y(f)?(e.exit("atxHeading"),t(f)):xe(f)?Ce(e,s,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),s(f))}function c(f){return f===null||f===35||ht(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),c)}}const NP=["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"],Im=["pre","script","style","textarea"],CP={concrete:!0,name:"htmlFlow",resolveTo:PP,tokenize:TP},jP={partial:!0,tokenize:AP},EP={partial:!0,tokenize:_P};function PP(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 TP(e,t,n){const r=this;let i,o,l,s,u;return c;function c(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),o=!0,x):N===63?(e.consume(N),i=3,r.interrupt?t:b):sn(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,s=0,w):sn(N)?(e.consume(N),i=4,r.interrupt?t:b):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:b):n(N)}function w(N){const ne="CDATA[";return N===ne.charCodeAt(s++)?(e.consume(N),s===ne.length?r.interrupt?t:_:w):n(N)}function x(N){return sn(N)?(e.consume(N),l=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||ht(N)){const ne=N===47,de=l.toLowerCase();return!ne&&!o&&Im.includes(de)?(i=1,r.interrupt?t(N):_(N)):NP.includes(l.toLowerCase())?(i=6,ne?(e.consume(N),y):r.interrupt?t(N):_(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?h(N):v(N))}return N===45||bt(N)?(e.consume(N),l+=String.fromCharCode(N),S):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:_):n(N)}function h(N){return xe(N)?(e.consume(N),h):M(N)}function v(N){return N===47?(e.consume(N),M):N===58||N===95||sn(N)?(e.consume(N),k):xe(N)?(e.consume(N),v):M(N)}function k(N){return N===45||N===46||N===58||N===95||bt(N)?(e.consume(N),k):j(N)}function j(N){return N===61?(e.consume(N),C):xe(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):xe(N)?(e.consume(N),C):T(N)}function E(N){return N===u?(e.consume(N),u=null,O):N===null||Y(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ht(N)?j(N):(e.consume(N),T)}function O(N){return N===47||N===62||xe(N)?v(N):n(N)}function M(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||Y(N)?_(N):xe(N)?(e.consume(N),R):n(N)}function _(N){return N===45&&i===2?(e.consume(N),L):N===60&&i===1?(e.consume(N),B):N===62&&i===4?(e.consume(N),U):N===63&&i===3?(e.consume(N),b):N===93&&i===5?(e.consume(N),z):Y(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(jP,Q,H)(N)):N===null||Y(N)?(e.exit("htmlFlowData"),H(N)):(e.consume(N),_)}function H(N){return e.check(EP,W,Q)(N)}function W(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),I}function I(N){return N===null||Y(N)?H(N):(e.enter("htmlFlowData"),_(N))}function L(N){return N===45?(e.consume(N),b):_(N)}function B(N){return N===47?(e.consume(N),l="",P):_(N)}function P(N){if(N===62){const ne=l.toLowerCase();return Im.includes(ne)?(e.consume(N),U):_(N)}return sn(N)&&l.length<8?(e.consume(N),l+=String.fromCharCode(N),P):_(N)}function z(N){return N===93?(e.consume(N),b):_(N)}function b(N){return N===62?(e.consume(N),U):N===45&&i===2?(e.consume(N),b):_(N)}function U(N){return N===null||Y(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),U)}function Q(N){return e.exit("htmlFlow"),t(N)}}function _P(e,t,n){const r=this;return i;function i(l){return Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function AP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(oa,t,n)}}const RP={name:"htmlText",tokenize:IP};function IP(e,t,n){const r=this;let i,o,l;return s;function s(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),j):b===63?(e.consume(b),v):sn(b)?(e.consume(b),T):n(b)}function c(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,w):sn(b)?(e.consume(b),h):n(b)}function f(b){return b===45?(e.consume(b),m):n(b)}function d(b){return b===null?n(b):b===45?(e.consume(b),p):Y(b)?(l=d,B(b)):(e.consume(b),d)}function p(b){return b===45?(e.consume(b),m):d(b)}function m(b){return b===62?L(b):b===45?p(b):d(b)}function w(b){const U="CDATA[";return b===U.charCodeAt(o++)?(e.consume(b),o===U.length?x:w):n(b)}function x(b){return b===null?n(b):b===93?(e.consume(b),S):Y(b)?(l=x,B(b)):(e.consume(b),x)}function S(b){return b===93?(e.consume(b),y):x(b)}function y(b){return b===62?L(b):b===93?(e.consume(b),y):x(b)}function h(b){return b===null||b===62?L(b):Y(b)?(l=h,B(b)):(e.consume(b),h)}function v(b){return b===null?n(b):b===63?(e.consume(b),k):Y(b)?(l=v,B(b)):(e.consume(b),v)}function k(b){return b===62?L(b):v(b)}function j(b){return sn(b)?(e.consume(b),C):n(b)}function C(b){return b===45||bt(b)?(e.consume(b),C):E(b)}function E(b){return Y(b)?(l=E,B(b)):xe(b)?(e.consume(b),E):L(b)}function T(b){return b===45||bt(b)?(e.consume(b),T):b===47||b===62||ht(b)?O(b):n(b)}function O(b){return b===47?(e.consume(b),L):b===58||b===95||sn(b)?(e.consume(b),M):Y(b)?(l=O,B(b)):xe(b)?(e.consume(b),O):L(b)}function M(b){return b===45||b===46||b===58||b===95||bt(b)?(e.consume(b),M):R(b)}function R(b){return b===61?(e.consume(b),_):Y(b)?(l=R,B(b)):xe(b)?(e.consume(b),R):O(b)}function _(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,H):Y(b)?(l=_,B(b)):xe(b)?(e.consume(b),_):(e.consume(b),W)}function H(b){return b===i?(e.consume(b),i=void 0,I):b===null?n(b):Y(b)?(l=H,B(b)):(e.consume(b),H)}function W(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||ht(b)?O(b):(e.consume(b),W)}function I(b){return b===47||b===62||ht(b)?O(b):n(b)}function L(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function B(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),P}function P(b){return xe(b)?Ce(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):z(b)}function z(b){return e.enter("htmlTextData"),l(b)}}const sf={name:"labelEnd",resolveAll:DP,resolveTo:zP,tokenize:FP},MP={tokenize:BP},LP={tokenize:$P},OP={tokenize:UP};function DP(e){let t=-1;const n=[];for(;++t=3&&(c===null||Y(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),xe(c)?Ce(e,s,"whitespace")(c):s(c))}}const ut={continuation:{tokenize:JP},exit:eT,name:"list",tokenize:qP},YP={partial:!0,tokenize:tT},XP={partial:!0,tokenize:ZP};function qP(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Cc(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(Gl,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 Cc(m)&&++l<10?(e.consume(m),u):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(oa,r.interrupt?n:f,e.attempt(YP,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return xe(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 JP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oa,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!xe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(XP,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function ZP(e,t,n){const r=this;return Ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function eT(e){e.exit(this.containerState.type)}function tT(e,t,n){const r=this;return Ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!xe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Mm={name:"setextUnderline",resolveTo:nT,tokenize:rT};function nT(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function rT(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),xe(c)?Ce(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Y(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const iT={tokenize:oT};function oT(e){const t=this,n=e.attempt(oa,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cP,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 lT={resolveAll:Qv()},sT=Kv("string"),aT=Kv("text");function Kv(e){return{resolveAll:Qv(e==="text"?uT:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(f){return c(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function bT(e,t){let n=-1;const r=[];let i;for(;++n0){const xt=q.tokenStack[q.tokenStack.length-1];(xt[1]||Om).call(q,void 0,xt[0])}for(V.position={start:Rn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:Rn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function FT(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 BT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function $T(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(e,t);const i={src:Ai(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function UT(e,t){const n={src:Ai(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function VT(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 HT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(e,t);const i={href:Ai(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function WT(e,t){const n={href:Ai(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function GT(e,t,n){const r=e.all(t),i=n?KT(n):Jv(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function QT(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=ef(t.children[1]),u=Rv(t.children[t.children.length-1]);s&&u&&(l.position={start:s,end:u}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function ZT(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Fm(t.slice(i),i>0,!1)),o.join("")}function Fm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Dm||o===zm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Dm||o===zm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function n_(e,t){const n={type:"text",value:t_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function r_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const i_={blockquote:IT,break:MT,code:LT,delete:OT,emphasis:DT,footnoteReference:zT,heading:FT,html:BT,imageReference:$T,image:UT,inlineCode:VT,linkReference:HT,link:WT,listItem:GT,list:QT,paragraph:YT,root:XT,strong:qT,table:JT,tableCell:e_,tableRow:ZT,text:n_,thematicBreak:r_,toml:vl,yaml:vl,definition:vl,footnoteDefinition:vl};function vl(){}const Zv=-1,la=0,fo=1,Cs=2,af=3,uf=4,cf=5,df=6,e0=7,t0=8,Bm=typeof self=="object"?self:globalThis,o_=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case la:case Zv:return n(l,i);case fo:{const s=n([],i);for(const u of l)s.push(r(u));return s}case Cs:{const s=n({},i);for(const[u,c]of l)s[r(u)]=r(c);return s}case af:return n(new Date(l),i);case uf:{const{source:s,flags:u}=l;return n(new RegExp(s,u),i)}case cf:{const s=n(new Map,i);for(const[u,c]of l)s.set(r(u),r(c));return s}case df:{const s=n(new Set,i);for(const u of l)s.add(r(u));return s}case e0:{const{name:s,message:u}=l;return n(new Bm[s](u),i)}case t0:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new Bm[o](l),i)};return r},$m=e=>o_(new Map,e)(0),$r="",{toString:l_}={},{keys:s_}=Object,Qi=e=>{const t=typeof e;if(t!=="object"||!e)return[la,t];const n=l_.call(e).slice(8,-1);switch(n){case"Array":return[fo,$r];case"Object":return[Cs,$r];case"Date":return[af,$r];case"RegExp":return[uf,$r];case"Map":return[cf,$r];case"Set":return[df,$r];case"DataView":return[fo,n]}return n.includes("Array")?[fo,n]:n.includes("Error")?[e0,n]:[Cs,n]},wl=([e,t])=>e===la&&(t==="function"||t==="symbol"),a_=(e,t,n,r)=>{const i=(l,s)=>{const u=r.push(l)-1;return n.set(s,u),u},o=l=>{if(n.has(l))return n.get(l);let[s,u]=Qi(l);switch(s){case la:{let f=l;switch(u){case"bigint":s=t0,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Zv],l)}return i([s,f],l)}case fo:{if(u){let p=l;return u==="DataView"?p=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(l)),i([u,[...p]],l)}const f=[],d=i([s,f],l);for(const p of l)f.push(o(p));return d}case Cs:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([s,f],l);for(const p of s_(l))(e||!wl(Qi(l[p])))&&f.push([o(p),o(l[p])]);return d}case af:return i([s,l.toISOString()],l);case uf:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case cf:{const f=[],d=i([s,f],l);for(const[p,m]of l)(e||!(wl(Qi(p))||wl(Qi(m))))&&f.push([o(p),o(m)]);return d}case df:{const f=[],d=i([s,f],l);for(const p of l)(e||!wl(Qi(p)))&&f.push(o(p));return d}}const{message:c}=l;return i([s,{name:u,message:c}],l)};return o},Um=(e,{json:t,lossy:n}={})=>{const r=[];return a_(!(t||n),!!t,new Map,r)(e),r},js=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$m(Um(e,t)):structuredClone(e):(e,t)=>$m(Um(e,t));function u_(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 c_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function d_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||u_,r=e.options.footnoteBackLabel||c_,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let u=-1;for(;++u0&&w.push({type:"text",value:" "});let h=typeof n=="string"?n:n(u,m);typeof h=="string"&&(h={type:"text",value:h}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(h)?h:[h]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const h=S.children[S.children.length-1];h&&h.type==="text"?h.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else f.push(...w);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...js(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const n0=function(e){if(e==null)return h_;if(typeof e=="function")return sa(e);if(typeof e=="object")return Array.isArray(e)?f_(e):p_(e);if(typeof e=="string")return m_(e);throw new Error("Expected function, string, or object as test")};function f_(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=r0,w,x,S;if((!t||o(u,c,f[f.length-1]||void 0))&&(m=w_(n(u,f)),m[0]===Vm))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==y_)for(x=(r?y.children.length:-1)+l,S=f.concat(y);x>-1&&x0&&n.push({type:"text",value:` +`}),n}function Hm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wm(e,t){const n=b_(e,t),r=n.one(e,void 0),i=d_(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function E_(e,t){return e&&"run"in e?async function(n,r){const i=Wm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wm(n,{file:r,...e||t})}}function Gm(e){if(e)throw e}var Kl=Object.prototype.hasOwnProperty,o0=Object.prototype.toString,Km=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,Ym=function(t){return typeof Array.isArray=="function"?Array.isArray(t):o0.call(t)==="[object Array]"},Xm=function(t){if(!t||o0.call(t)!=="[object Object]")return!1;var n=Kl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Kl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Kl.call(t,i)},qm=function(t,n){Km&&n.name==="__proto__"?Km(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Jm=function(t,n){if(n==="__proto__")if(Kl.call(t,n)){if(Qm)return Qm(t,n).value}else return;return t[n]},P_=function e(){var t,n,r,i,o,l,s=arguments[0],u=1,c=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});ul.length;let u;s&&l.push(i);try{u=e.apply(this,l)}catch(c){const f=c;if(s&&n)throw f;return i(f)}s||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const rn={basename:A_,dirname:R_,extname:I_,join:M_,sep:"/"};function A_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function R_(e){if(Wo(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 I_(e){Wo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function M_(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function O_(e,t){let n="",r=0,i=-1,o=0,l=-1,s,u;for(;++l<=e.length;){if(l2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function Wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const D_={cwd:z_};function z_(){return"/"}function Tc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function F_(e){if(typeof e=="string")e=new URL(e);else if(!Tc(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 B_(e)}function B_(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]=f;const x=r[p][1];Pc(x)&&Pc(m)&&(m=su(!0,x,m)),r[p]=[c,m,...w]}}}}const H_=new ff().freeze();function du(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pu(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 eh(e){if(!Pc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function th(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sl(e){return W_(e)?e:new l0(e)}function W_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function G_(e){return typeof e=="string"||K_(e)}function K_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Q_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nh=[],rh={allowDangerousHtml:!0},Y_=/^(https?|ircs?|mailto|xmpp)$/i,X_=[{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 q_(e){const t=J_(e),n=Z_(e);return eA(t.runSync(t.parse(n),n),e)}function J_(e){const t=e.rehypePlugins||nh,n=e.remarkPlugins||nh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rh}:rh;return H_().use(RT).use(n).use(E_,r).use(t)}function Z_(e){const t=e.children||"",n=new l0;return typeof t=="string"&&(n.value=t),n}function eA(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,u=t.urlTransform||tA;for(const f of X_)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Q_+f.id,void 0);return i0(e,c),dE(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in iu)if(Object.hasOwn(iu,m)&&Object.hasOwn(f.properties,m)){const w=f.properties[m],x=iu[m];(x===null||x.includes(f.tagName))&&(f.properties[m]=u(String(w||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(f,d,p)),m&&p&&typeof d=="number")return s&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function tA(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||Y_.test(e.slice(0,t))?e:""}const s0=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},u)=>{const c=g.useRef(null),f=()=>{var d;(d=c.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),a.jsxs("div",{className:ue("flex h-full flex-col",e),ref:u,...s,children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:a.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>a.jsxs("div",{className:ue("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:a.jsx(ei,{className:"h-4 w-4 text-primary-foreground"})}),a.jsxs("div",{className:ue("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[a.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[a.jsx("span",{children:d.role==="user"?"You":d.assistantInfo?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-medium",children:d.assistantInfo.name}),d.assistantInfo.type!=="default"&&a.jsx("span",{className:ue("inline-block px-1.5 py-0.5 rounded text-[10px] font-medium ml-1",d.assistantInfo.type==="user"&&"bg-blue-100 text-blue-700",d.assistantInfo.type==="template"&&"bg-gray-100 text-gray-700",d.assistantInfo.type==="new"&&"bg-green-100 text-green-700"),children:d.assistantInfo.type==="user"?"Mine":d.assistantInfo.type==="template"?"Template":"New"}),d.assistantInfo.originalTemplate&&a.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",d.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:["#",p+1]})]}),a.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:a.jsx(q_,{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:d.content})})]}),d.role==="user"&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:a.jsx(Bd,{className:"h-4 w-4"})})]},`${d.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(Nv,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?a.jsx(fe,{type:"button",onClick:l,variant:"outline",size:"icon",children:a.jsx(IN,{className:"h-4 w-4"})}):a.jsx(fe,{type:"submit",disabled:!n.trim(),size:"icon",children:a.jsx(CN,{className:"h-4 w-4"})})]})})]})});s0.displayName="Chat";const tn={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function a0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function nA(){return a0()}class rA{getAllSessions(){const t=localStorage.getItem(tn.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:a0(),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(tn.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(tn.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(tn.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(tn.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:nA(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(tn.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(tn.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(tn.currentSession,t)}clear(){localStorage.removeItem(tn.sessions),localStorage.removeItem(tn.currentSession)}}const Me=new rA;function iA(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,s]=g.useState(null),[u,c]=g.useState(""),[f,d]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,x]=g.useState(r),[S,y]=g.useState(.7),[h,v]=g.useState(1024),k=Vt.useMemo(()=>{var L;const I=i.find(B=>B.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!I,messageCount:((L=I==null?void 0:I.messages)==null?void 0:L.length)||0,sessionTitle:(I==null?void 0:I.title)||"No session"}),I},[i,l]),j=Vt.useMemo(()=>{const I=(k==null?void 0:k.messages)||[];return console.log("useChat - messages computed:",I.length,I.map(L=>({id:L.id,role:L.role}))),I},[k==null?void 0:k.messages]);g.useEffect(()=>{const I=Me.getAllSessions();o(I);const L=Me.getCurrentSession();L&&s(L.id)},[]);const C=g.useCallback(()=>{const I=Me.createSession(void 0,p,w),L=Me.getAllSessions();return o([...L]),s(I.id),Me.setCurrentSession(I.id),I.id},[p,w]),E=g.useCallback(I=>{console.log("selectSession called with:",I),s(I),Me.setCurrentSession(I),console.log("currentSessionId updated to:",I)},[]),T=g.useCallback(I=>{Me.deleteSession(I);const L=Me.getAllSessions();o([...L]),l===I&&(L.length>0?(s(L[0].id),Me.setCurrentSession(L[0].id)):s(null))},[l]),O=g.useCallback((I,L)=>{Me.updateSession(I,{title:L});const B=Me.getAllSessions();o([...B])},[]),M=g.useCallback(I=>{if(!l)return;Me.addMessageToSession(l,I);const L=Me.getAllSessions();o([...L])},[l]),R=g.useCallback(async(I,L)=>{var z,b;if(!u.trim()||f.isLoading)return;let B=l;B||(B=C());const P=u.trim();if(c(""),d({isLoading:!0,error:null}),B){Me.addMessageToSession(B,{role:"user",content:P});const U=Me.getAllSessions();o([...U])}try{const U=Me.getSession(B),Q=((b=(z=U==null?void 0:U.messages)==null?void 0:z.filter(de=>de.role!=="system"))==null?void 0:b.map(de=>({role:de.role,content:de.content})))||[],N=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:P,messages:Q,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h,use_rag:(L==null?void 0:L.useRag)||!1,retrieval_count:(L==null?void 0:L.retrievalCount)||3})});if(!N.ok){const de=await N.json();throw new Error(de.detail||`HTTP error! status: ${N.status}`)}const ne=await N.json();if(B){Me.addMessageToSession(B,{role:"assistant",content:ne.content,thinking_content:ne.thinking_content,model_used:ne.model_used,supports_thinking:ne.supports_thinking,assistantInfo:I});const de=Me.getAllSessions();o([...de])}d({isLoading:!1,error:null})}catch(U){const Q=U instanceof Error?U.message:"An error occurred";if(d({isLoading:!1,error:Q}),B){Me.addMessageToSession(B,{role:"assistant",content:`Sorry, I encountered an error: ${Q}`,assistantInfo:I});const N=Me.getAllSessions();o([...N])}}},[u,f.isLoading,l,C,M,w,j.length,t,p,S,h]),_=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),H=g.useCallback(()=>{Me.clear(),o([]),s(null)},[]),W=g.useCallback(()=>{s(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:k,currentSessionId:l,createNewSession:C,selectSession:E,deleteSession:T,renameSession:O,clearAllSessions:H,clearCurrentSession:W,messages:j,input:u,setInput:c,sendMessage:R,stopGeneration:_,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:x,temperature:S,setTemperature:y,maxTokens:h,setMaxTokens:v}}function Es(e,[t,n]){return Math.min(n,Math.max(t,e))}function u0(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 c0(e){const[t,n]=g.useState(void 0);return tt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;l=c.inlineSize,s=c.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var d0=["PageUp","PageDown"],f0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],p0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ri="Slider",[_c,oA,lA]=Vd(Ri),[m0,RI]=sr(Ri,[lA]),[sA,aa]=m0(Ri),h0=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...x}=e,S=g.useRef(new Set),y=g.useRef(0),v=l==="horizontal"?aA:uA,[k=[],j]=bi({prop:f,defaultProp:c,onChange:R=>{var H;(H=[...S.current][y.current])==null||H.focus(),d(R)}}),C=g.useRef(k);function E(R){const _=mA(k,R);M(R,_)}function T(R){M(R,y.current)}function O(){const R=C.current[y.current];k[y.current]!==R&&p(k)}function M(R,_,{commit:H}={commit:!1}){const W=yA(o),I=vA(Math.round((R-r)/o)*o+r,W),L=Es(I,[r,i]);j((B=[])=>{const P=fA(B,L,_);if(xA(P,u*o)){y.current=P.indexOf(L);const z=String(P)!==String(B);return z&&H&&p(P),z?P:B}else return B})}return a.jsx(sA,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:y,thumbs:S.current,values:k,orientation:l,form:w,children:a.jsx(_c.Provider,{scope:e.__scopeSlider,children:a.jsx(_c.Slot,{scope:e.__scopeSlider,children:a.jsx(v,{"aria-disabled":s,"data-disabled":s?"":void 0,...x,ref:t,onPointerDown:Z(x.onPointerDown,()=>{s||(C.current=k)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:E,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:O,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,k.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:_})=>{if(!s){const I=d0.includes(R.key)||R.shiftKey&&f0.includes(R.key)?10:1,L=y.current,B=k[L],P=o*I*_;M(B+P,L,{commit:!0})}}})})})})});h0.displayName=Ri;var[g0,x0]=m0(Ri,{startEdge:"left",endEdge:"right",size:"width",direction:1}),aA=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:u,onStepKeyDown:c,...f}=e,[d,p]=g.useState(null),m=ve(t,v=>p(v)),w=g.useRef(void 0),x=ea(i),S=x==="ltr",y=S&&!o||!S&&o;function h(v){const k=w.current||d.getBoundingClientRect(),j=[0,k.width],E=pf(j,y?[n,r]:[r,n]);return w.current=k,E(v-k.left)}return a.jsx(g0,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:a.jsx(y0,{dir:x,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const k=h(v.clientX);l==null||l(k)},onSlideMove:v=>{const k=h(v.clientX);s==null||s(k)},onSlideEnd:()=>{w.current=void 0,u==null||u()},onStepKeyDown:v=>{const j=p0[y?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:j?-1:1})}})})}),uA=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:u,...c}=e,f=g.useRef(null),d=ve(t,f),p=g.useRef(void 0),m=!i;function w(x){const S=p.current||f.current.getBoundingClientRect(),y=[0,S.height],v=pf(y,m?[r,n]:[n,r]);return p.current=S,v(x-S.top)}return a.jsx(g0,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:a.jsx(y0,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const S=w(x.clientY);o==null||o(S)},onSlideMove:x=>{const S=w(x.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:x=>{const y=p0[m?"from-bottom":"from-top"].includes(x.key);u==null||u({event:x,direction:y?-1:1})}})})}),y0=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:u,...c}=e,f=aa(Ri,n);return a.jsx(oe.span,{...c,ref:t,onKeyDown:Z(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):d0.concat(f0).includes(d.key)&&(u(d),d.preventDefault())}),onPointerDown:Z(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:Z(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Z(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),v0="SliderTrack",w0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=aa(v0,n);return a.jsx(oe.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});w0.displayName=v0;var Ac="SliderRange",S0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=aa(Ac,n),o=x0(Ac,n),l=g.useRef(null),s=ve(t,l),u=i.values.length,c=i.values.map(p=>N0(p,i.min,i.max)),f=u>1?Math.min(...c):0,d=100-Math.max(...c);return a.jsx(oe.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});S0.displayName=Ac;var Rc="SliderThumb",b0=g.forwardRef((e,t)=>{const n=oA(e.__scopeSlider),[r,i]=g.useState(null),o=ve(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return a.jsx(cA,{...e,ref:o,index:l})}),cA=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=aa(Rc,n),s=x0(Rc,n),[u,c]=g.useState(null),f=ve(t,h=>c(h)),d=u?l.form||!!u.closest("form"):!0,p=c0(u),m=l.values[r],w=m===void 0?0:N0(m,l.min,l.max),x=pA(r,l.values.length),S=p==null?void 0:p[s.size],y=S?hA(S,w,s.direction):0;return g.useEffect(()=>{if(u)return l.thumbs.add(u),()=>{l.thumbs.delete(u)}},[u,l.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${y}px)`},children:[a.jsx(_c.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(oe.span,{role:"slider","aria-label":e["aria-label"]||x,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:Z(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&a.jsx(k0,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});b0.displayName=Rc;var dA="RadioBubbleInput",k0=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(i,r),l=u0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),a.jsx(oe.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});k0.displayName=dA;function fA(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function N0(e,t,n){const o=100/(n-t)*(e-t);return Es(o,[0,100])}function pA(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function mA(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 hA(e,t,n){const r=e/2,o=pf([0,50],[0,r]);return(r-o(t)*n)*n}function gA(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function xA(e,t){if(t>0){const n=gA(e);return Math.min(...n)>=t}return!0}function pf(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 yA(e){return(String(e).split(".")[1]||"").length}function vA(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var C0=h0,wA=w0,SA=S0,bA=b0;const Ps=g.forwardRef(({className:e,...t},n)=>a.jsxs(C0,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(wA,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(SA,{className:"absolute h-full bg-primary"})}),a.jsx(bA,{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"})]}));Ps.displayName=C0.displayName;const kA=["top","right","bottom","left"],tr=Math.min,wt=Math.max,Ts=Math.round,bl=Math.floor,dn=e=>({x:e,y:e}),NA={left:"right",right:"left",bottom:"top",top:"bottom"},CA={start:"end",end:"start"};function Ic(e,t,n){return wt(e,tr(t,n))}function jn(e,t){return typeof e=="function"?e(t):e}function En(e){return e.split("-")[0]}function Ii(e){return e.split("-")[1]}function mf(e){return e==="x"?"y":"x"}function hf(e){return e==="y"?"height":"width"}const jA=new Set(["top","bottom"]);function an(e){return jA.has(En(e))?"y":"x"}function gf(e){return mf(an(e))}function EA(e,t,n){n===void 0&&(n=!1);const r=Ii(e),i=gf(e),o=hf(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=_s(l)),[l,_s(l)]}function PA(e){const t=_s(e);return[Mc(e),t,Mc(t)]}function Mc(e){return e.replace(/start|end/g,t=>CA[t])}const ih=["left","right"],oh=["right","left"],TA=["top","bottom"],_A=["bottom","top"];function AA(e,t,n){switch(e){case"top":case"bottom":return n?t?oh:ih:t?ih:oh;case"left":case"right":return t?TA:_A;default:return[]}}function RA(e,t,n,r){const i=Ii(e);let o=AA(En(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Mc)))),o}function _s(e){return e.replace(/left|right|bottom|top/g,t=>NA[t])}function IA(e){return{top:0,right:0,bottom:0,left:0,...e}}function j0(e){return typeof e!="number"?IA(e):{top:e,right:e,bottom:e,left:e}}function As(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 lh(e,t,n){let{reference:r,floating:i}=e;const o=an(t),l=gf(t),s=hf(l),u=En(t),c=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(u){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ii(t)){case"start":m[l]-=p*(n&&c?-1:1);break;case"end":m[l]+=p*(n&&c?-1:1);break}return m}const MA=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=lh(c,r,u),p=r,m={},w=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:u}=t,{element:c,padding:f=0}=jn(e,t)||{};if(c==null)return{};const d=j0(f),p={x:n,y:r},m=gf(i),w=hf(m),x=await l.getDimensions(c),S=m==="y",y=S?"top":"left",h=S?"bottom":"right",v=S?"clientHeight":"clientWidth",k=o.reference[w]+o.reference[m]-p[m]-o.floating[w],j=p[m]-o.reference[m],C=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let E=C?C[v]:0;(!E||!await(l.isElement==null?void 0:l.isElement(C)))&&(E=s.floating[v]||o.floating[w]);const T=k/2-j/2,O=E/2-x[w]/2-1,M=tr(d[y],O),R=tr(d[h],O),_=M,H=E-x[w]-R,W=E/2-x[w]/2+T,I=Ic(_,W,H),L=!u.arrow&&Ii(i)!=null&&W!==I&&o.reference[w]/2-(W<_?M:R)-x[w]/2<0,B=L?W<_?W-_:W-H:0;return{[m]:p[m]+B,data:{[m]:I,centerOffset:W-I-B,...L&&{alignmentOffset:B}},reset:L}}}),OA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:s,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...S}=jn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=En(i),h=an(s),v=En(s)===s,k=await(u.isRTL==null?void 0:u.isRTL(c.floating)),j=p||(v||!x?[_s(s)]:PA(s)),C=w!=="none";!p&&C&&j.push(...RA(s,x,w,k));const E=[s,...j],T=await Io(t,S),O=[];let M=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&O.push(T[y]),d){const W=EA(i,l,k);O.push(T[W[0]],T[W[1]])}if(M=[...M,{placement:i,overflows:O}],!O.every(W=>W<=0)){var R,_;const W=(((R=o.flip)==null?void 0:R.index)||0)+1,I=E[W];if(I&&(!(d==="alignment"?h!==an(I):!1)||M.every(P=>an(P.placement)===h?P.overflows[0]>0:!0)))return{data:{index:W,overflows:M},reset:{placement:I}};let L=(_=M.filter(B=>B.overflows[0]<=0).sort((B,P)=>B.overflows[1]-P.overflows[1])[0])==null?void 0:_.placement;if(!L)switch(m){case"bestFit":{var H;const B=(H=M.filter(P=>{if(C){const z=an(P.placement);return z===h||z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(z=>z>0).reduce((z,b)=>z+b,0)]).sort((P,z)=>P[1]-z[1])[0])==null?void 0:H[0];B&&(L=B);break}case"initialPlacement":L=s;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function sh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ah(e){return kA.some(t=>e[t]>=0)}const DA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=jn(e,t);switch(r){case"referenceHidden":{const o=await Io(t,{...i,elementContext:"reference"}),l=sh(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ah(l)}}}case"escaped":{const o=await Io(t,{...i,altBoundary:!0}),l=sh(o,n.floating);return{data:{escapedOffsets:l,escaped:ah(l)}}}default:return{}}}}},E0=new Set(["left","top"]);async function zA(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=En(n),s=Ii(n),u=an(n)==="y",c=E0.has(l)?-1:1,f=o&&u?-1:1,d=jn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),u?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const FA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,u=await zA(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:l}}}}},BA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:y,y:h}=S;return{x:y,y:h}}},...u}=jn(e,t),c={x:n,y:r},f=await Io(t,u),d=an(En(i)),p=mf(d);let m=c[p],w=c[d];if(o){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",h=m+f[S],v=m-f[y];m=Ic(h,m,v)}if(l){const S=d==="y"?"top":"left",y=d==="y"?"bottom":"right",h=w+f[S],v=w-f[y];w=Ic(h,w,v)}const x=s.fn({...t,[p]:m,[d]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[d]:l}}}}}},$A=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:u=!0,crossAxis:c=!0}=jn(e,t),f={x:n,y:r},d=an(i),p=mf(d);let m=f[p],w=f[d];const x=jn(s,t),S=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const v=p==="y"?"height":"width",k=o.reference[p]-o.floating[v]+S.mainAxis,j=o.reference[p]+o.reference[v]-S.mainAxis;mj&&(m=j)}if(c){var y,h;const v=p==="y"?"width":"height",k=E0.has(En(i)),j=o.reference[d]-o.floating[v]+(k&&((y=l.offset)==null?void 0:y[d])||0)+(k?0:S.crossAxis),C=o.reference[d]+o.reference[v]+(k?0:((h=l.offset)==null?void 0:h[d])||0)-(k?S.crossAxis:0);wC&&(w=C)}return{[p]:m,[d]:w}}}},UA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:u=()=>{},...c}=jn(e,t),f=await Io(t,c),d=En(i),p=Ii(i),m=an(i)==="y",{width:w,height:x}=o.floating;let S,y;d==="top"||d==="bottom"?(S=d,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,S=p==="end"?"top":"bottom");const h=x-f.top-f.bottom,v=w-f.left-f.right,k=tr(x-f[S],h),j=tr(w-f[y],v),C=!t.middlewareData.shift;let E=k,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=h),C&&!p){const M=wt(f.left,0),R=wt(f.right,0),_=wt(f.top,0),H=wt(f.bottom,0);m?T=w-2*(M!==0||R!==0?M+R:wt(f.left,f.right)):E=x-2*(_!==0||H!==0?_+H:wt(f.top,f.bottom))}await u({...t,availableWidth:T,availableHeight:E});const O=await l.getDimensions(s.floating);return w!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function ua(){return typeof window<"u"}function Mi(e){return P0(e)?(e.nodeName||"").toLowerCase():"#document"}function Nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(P0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P0(e){return ua()?e instanceof Node||e instanceof Nt(e).Node:!1}function Yt(e){return ua()?e instanceof Element||e instanceof Nt(e).Element:!1}function pn(e){return ua()?e instanceof HTMLElement||e instanceof Nt(e).HTMLElement:!1}function uh(e){return!ua()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot}const VA=new Set(["inline","contents"]);function Go(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!VA.has(i)}const HA=new Set(["table","td","th"]);function WA(e){return HA.has(Mi(e))}const GA=[":popover-open",":modal"];function ca(e){return GA.some(t=>{try{return e.matches(t)}catch{return!1}})}const KA=["transform","translate","scale","rotate","perspective"],QA=["transform","translate","scale","rotate","perspective","filter"],YA=["paint","layout","strict","content"];function xf(e){const t=yf(),n=Yt(e)?Xt(e):e;return KA.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)||QA.some(r=>(n.willChange||"").includes(r))||YA.some(r=>(n.contain||"").includes(r))}function XA(e){let t=nr(e);for(;pn(t)&&!ki(t);){if(xf(t))return t;if(ca(t))return null;t=nr(t)}return null}function yf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qA=new Set(["html","body","#document"]);function ki(e){return qA.has(Mi(e))}function Xt(e){return Nt(e).getComputedStyle(e)}function da(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nr(e){if(Mi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||uh(e)&&e.host||mn(e);return uh(t)?t.host:t}function T0(e){const t=nr(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&Go(t)?t:T0(t)}function Mo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=T0(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Nt(i);if(o){const s=Lc(l);return t.concat(l,l.visualViewport||[],Go(i)?i:[],s&&n?Mo(s):[])}return t.concat(i,Mo(i,[],n))}function Lc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _0(e){const t=Xt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=pn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=Ts(n)!==o||Ts(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function vf(e){return Yt(e)?e:e.contextElement}function fi(e){const t=vf(e);if(!pn(t))return dn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=_0(t);let l=(o?Ts(n.width):n.width)/r,s=(o?Ts(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const JA=dn(0);function A0(e){const t=Nt(e);return!yf()||!t.visualViewport?JA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nt(e)?!1:t}function Tr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=vf(e);let l=dn(1);t&&(r?Yt(r)&&(l=fi(r)):l=fi(e));const s=ZA(o,n,r)?A0(o):dn(0);let u=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=Nt(o),m=r&&Yt(r)?Nt(r):r;let w=p,x=Lc(w);for(;x&&r&&m!==w;){const S=fi(x),y=x.getBoundingClientRect(),h=Xt(x),v=y.left+(x.clientLeft+parseFloat(h.paddingLeft))*S.x,k=y.top+(x.clientTop+parseFloat(h.paddingTop))*S.y;u*=S.x,c*=S.y,f*=S.x,d*=S.y,u+=v,c+=k,w=Nt(x),x=Lc(w)}}return As({width:f,height:d,x:u,y:c})}function fa(e,t){const n=da(e).scrollLeft;return t?t.left+n:Tr(mn(e)).left+n}function R0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fa(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function eR(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=mn(r),s=t?ca(t.floating):!1;if(r===l||s&&o)return n;let u={scrollLeft:0,scrollTop:0},c=dn(1);const f=dn(0),d=pn(r);if((d||!d&&!o)&&((Mi(r)!=="body"||Go(l))&&(u=da(r)),pn(r))){const m=Tr(r);c=fi(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=l&&!d&&!o?R0(l,u):dn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-u.scrollTop*c.y+f.y+p.y}}function tR(e){return Array.from(e.getClientRects())}function nR(e){const t=mn(e),n=da(e),r=e.ownerDocument.body,i=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+fa(e);const s=-n.scrollTop;return Xt(r).direction==="rtl"&&(l+=wt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const ch=25;function rR(e,t){const n=Nt(e),r=mn(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,u=0;if(i){o=i.width,l=i.height;const f=yf();(!f||f&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const c=fa(r);if(c<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-m);w<=ch&&(o-=w)}else c<=ch&&(o+=c);return{width:o,height:l,x:s,y:u}}const iR=new Set(["absolute","fixed"]);function oR(e,t){const n=Tr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=pn(e)?fi(e):dn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:l,height:s,x:u,y:c}}function dh(e,t,n){let r;if(t==="viewport")r=rR(e,n);else if(t==="document")r=nR(mn(e));else if(Yt(t))r=oR(t,n);else{const i=A0(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return As(r)}function I0(e,t){const n=nr(e);return n===t||!Yt(n)||ki(n)?!1:Xt(n).position==="fixed"||I0(n,t)}function lR(e,t){const n=t.get(e);if(n)return n;let r=Mo(e,[],!1).filter(s=>Yt(s)&&Mi(s)!=="body"),i=null;const o=Xt(e).position==="fixed";let l=o?nr(e):e;for(;Yt(l)&&!ki(l);){const s=Xt(l),u=xf(l);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&!!i&&iR.has(i.position)||Go(l)&&!u&&I0(e,l))?r=r.filter(f=>f!==l):i=s,l=nr(l)}return t.set(e,r),r}function sR(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?ca(t)?[]:lR(t,this._c):[].concat(n),r],s=l[0],u=l.reduce((c,f)=>{const d=dh(t,f,i);return c.top=wt(d.top,c.top),c.right=tr(d.right,c.right),c.bottom=tr(d.bottom,c.bottom),c.left=wt(d.left,c.left),c},dh(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function aR(e){const{width:t,height:n}=_0(e);return{width:t,height:n}}function uR(e,t,n){const r=pn(t),i=mn(t),o=n==="fixed",l=Tr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const u=dn(0);function c(){u.x=fa(i)}if(r||!r&&!o)if((Mi(t)!=="body"||Go(i))&&(s=da(t)),r){const m=Tr(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?R0(i,s):dn(0),d=l.left+s.scrollLeft-u.x-f.x,p=l.top+s.scrollTop-u.y-f.y;return{x:d,y:p,width:l.width,height:l.height}}function mu(e){return Xt(e).position==="static"}function fh(e,t){if(!pn(e)||Xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function M0(e,t){const n=Nt(e);if(ca(e))return n;if(!pn(e)){let i=nr(e);for(;i&&!ki(i);){if(Yt(i)&&!mu(i))return i;i=nr(i)}return n}let r=fh(e,t);for(;r&&WA(r)&&mu(r);)r=fh(r,t);return r&&ki(r)&&mu(r)&&!xf(r)?n:r||XA(e)||n}const cR=async function(e){const t=this.getOffsetParent||M0,n=this.getDimensions,r=await n(e.floating);return{reference:uR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dR(e){return Xt(e).direction==="rtl"}const fR={convertOffsetParentRelativeRectToViewportRelativeRect:eR,getDocumentElement:mn,getClippingRect:sR,getOffsetParent:M0,getElementRects:cR,getClientRects:tR,getDimensions:aR,getScale:fi,isElement:Yt,isRTL:dR};function L0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pR(e,t){let n=null,r;const i=mn(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const c=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=c;if(s||t(),!p||!m)return;const w=bl(d),x=bl(i.clientWidth-(f+p)),S=bl(i.clientHeight-(d+m)),y=bl(f),v={rootMargin:-w+"px "+-x+"px "+-S+"px "+-y+"px",threshold:wt(0,tr(1,u))||1};let k=!0;function j(C){const E=C[0].intersectionRatio;if(E!==u){if(!k)return l();E?l(!1,E):r=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!L0(c,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(j,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,v)}n.observe(e)}return l(!0),o}function mR(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=vf(e),f=i||o?[...c?Mo(c):[],...Mo(t)]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=c&&s?pR(c,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let w,x=u?Tr(e):null;u&&S();function S(){const y=Tr(e);x&&!L0(x,y)&&n(),x=y,w=requestAnimationFrame(S)}return n(),()=>{var y;f.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,u&&cancelAnimationFrame(w)}}const hR=FA,gR=BA,xR=OA,yR=UA,vR=DA,ph=LA,wR=$A,SR=(e,t,n)=>{const r=new Map,i={platform:fR,...n},o={...i.platform,_c:r};return MA(e,t,{...i,platform:o})};var bR=typeof document<"u",kR=function(){},Ql=bR?g.useLayoutEffect:kR;function Rs(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(!Rs(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)&&!Rs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function O0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mh(e,t){const n=O0(e);return Math.round(t*n)/n}function hu(e){const t=g.useRef(e);return Ql(()=>{t.current=e}),t}function NR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[f,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);Rs(p,r)||m(r);const[w,x]=g.useState(null),[S,y]=g.useState(null),h=g.useCallback(P=>{P!==C.current&&(C.current=P,x(P))},[]),v=g.useCallback(P=>{P!==E.current&&(E.current=P,y(P))},[]),k=o||w,j=l||S,C=g.useRef(null),E=g.useRef(null),T=g.useRef(f),O=u!=null,M=hu(u),R=hu(i),_=hu(c),H=g.useCallback(()=>{if(!C.current||!E.current)return;const P={placement:t,strategy:n,middleware:p};R.current&&(P.platform=R.current),SR(C.current,E.current,P).then(z=>{const b={...z,isPositioned:_.current!==!1};W.current&&!Rs(T.current,b)&&(T.current=b,Ei.flushSync(()=>{d(b)}))})},[p,t,n,R,_]);Ql(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[c]);const W=g.useRef(!1);Ql(()=>(W.current=!0,()=>{W.current=!1}),[]),Ql(()=>{if(k&&(C.current=k),j&&(E.current=j),k&&j){if(M.current)return M.current(k,j,H);H()}},[k,j,H,M,O]);const I=g.useMemo(()=>({reference:C,floating:E,setReference:h,setFloating:v}),[h,v]),L=g.useMemo(()=>({reference:k,floating:j}),[k,j]),B=g.useMemo(()=>{const P={position:n,left:0,top:0};if(!L.floating)return P;const z=mh(L.floating,f.x),b=mh(L.floating,f.y);return s?{...P,transform:"translate("+z+"px, "+b+"px)",...O0(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:b}},[n,s,L.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:H,refs:I,elements:L,floatingStyles:B}),[f,H,I,L,B])}const CR=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?ph({element:r.current,padding:i}).fn(n):{}:r?ph({element:r,padding:i}).fn(n):{}}}},jR=(e,t)=>({...hR(e),options:[e,t]}),ER=(e,t)=>({...gR(e),options:[e,t]}),PR=(e,t)=>({...wR(e),options:[e,t]}),TR=(e,t)=>({...xR(e),options:[e,t]}),_R=(e,t)=>({...yR(e),options:[e,t]}),AR=(e,t)=>({...vR(e),options:[e,t]}),RR=(e,t)=>({...CR(e),options:[e,t]});var IR="Arrow",D0=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return a.jsx(oe.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"})})});D0.displayName=IR;var MR=D0,wf="Popper",[z0,F0]=sr(wf),[LR,B0]=z0(wf),$0=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return a.jsx(LR,{scope:t,anchor:r,onAnchorChange:i,children:n})};$0.displayName=wf;var U0="PopperAnchor",V0=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=B0(U0,n),l=g.useRef(null),s=ve(t,l),u=g.useRef(null);return g.useEffect(()=>{const c=u.current;u.current=(r==null?void 0:r.current)||l.current,c!==u.current&&o.onAnchorChange(u.current)}),r?null:a.jsx(oe.div,{...i,ref:s})});V0.displayName=U0;var Sf="PopperContent",[OR,DR]=z0(Sf),H0=g.forwardRef((e,t)=>{var K,te,he,ie,ce,me;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...x}=e,S=B0(Sf,n),[y,h]=g.useState(null),v=ve(t,Ve=>h(Ve)),[k,j]=g.useState(null),C=c0(k),E=(C==null?void 0:C.width)??0,T=(C==null?void 0:C.height)??0,O=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(c)?c:[c],_=R.length>0,H={padding:M,boundary:R.filter(FR),altBoundary:_},{refs:W,floatingStyles:I,placement:L,isPositioned:B,middlewareData:P}=NR({strategy:"fixed",placement:O,whileElementsMounted:(...Ve)=>mR(...Ve,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[jR({mainAxis:i+T,alignmentAxis:l}),u&&ER({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?PR():void 0,...H}),u&&TR({...H}),_R({...H,apply:({elements:Ve,rects:rt,availableWidth:Jt,availableHeight:Dt})=>{const{width:Zt,height:Oi}=rt.reference,hn=Ve.floating.style;hn.setProperty("--radix-popper-available-width",`${Jt}px`),hn.setProperty("--radix-popper-available-height",`${Dt}px`),hn.setProperty("--radix-popper-anchor-width",`${Zt}px`),hn.setProperty("--radix-popper-anchor-height",`${Oi}px`)}}),k&&RR({element:k,padding:s}),BR({arrowWidth:E,arrowHeight:T}),p&&AR({strategy:"referenceHidden",...H})]}),[z,b]=K0(L),U=er(w);tt(()=>{B&&(U==null||U())},[B,U]);const Q=(K=P.arrow)==null?void 0:K.x,N=(te=P.arrow)==null?void 0:te.y,ne=((he=P.arrow)==null?void 0:he.centerOffset)!==0,[de,re]=g.useState();return tt(()=>{y&&re(window.getComputedStyle(y).zIndex)},[y]),a.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:B?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(ie=P.transformOrigin)==null?void 0:ie.x,(ce=P.transformOrigin)==null?void 0:ce.y].join(" "),...((me=P.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(OR,{scope:n,placedSide:z,onArrowChange:j,arrowX:Q,arrowY:N,shouldHideArrow:ne,children:a.jsx(oe.div,{"data-side":z,"data-align":b,...x,ref:v,style:{...x.style,animation:B?void 0:"none"}})})})});H0.displayName=Sf;var W0="PopperArrow",zR={top:"bottom",right:"left",bottom:"top",left:"right"},G0=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=DR(W0,r),l=zR[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(MR,{...i,ref:n,style:{...i.style,display:"block"}})})});G0.displayName=W0;function FR(e){return e!==null}var BR=e=>({name:"transformOrigin",options:e,fn(t){var S,y,h;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[c,f]=K0(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+u/2;let w="",x="";return c==="bottom"?(w=l?d:`${p}px`,x=`${-u}px`):c==="top"?(w=l?d:`${p}px`,x=`${r.floating.height+u}px`):c==="right"?(w=`${-u}px`,x=l?d:`${m}px`):c==="left"&&(w=`${r.floating.width+u}px`,x=l?d:`${m}px`),{data:{x:w,y:x}}}});function K0(e){const[t,n="center"]=e.split("-");return[t,n]}var $R=$0,UR=V0,VR=H0,HR=G0,Q0=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"}),WR="VisuallyHidden",GR=g.forwardRef((e,t)=>a.jsx(oe.span,{...e,ref:t,style:{...Q0,...e.style}}));GR.displayName=WR;var KR=[" ","Enter","ArrowUp","ArrowDown"],QR=[" ","Enter"],_r="Select",[pa,ma,YR]=Vd(_r),[Li,II]=sr(_r,[YR,F0]),ha=F0(),[XR,ur]=Li(_r),[qR,JR]=Li(_r),Y0=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:u,dir:c,name:f,autoComplete:d,disabled:p,required:m,form:w}=e,x=ha(t),[S,y]=g.useState(null),[h,v]=g.useState(null),[k,j]=g.useState(!1),C=ea(c),[E,T]=bi({prop:r,defaultProp:i??!1,onChange:o,caller:_r}),[O,M]=bi({prop:l,defaultProp:s,onChange:u,caller:_r}),R=g.useRef(null),_=S?w||!!S.closest("form"):!0,[H,W]=g.useState(new Set),I=Array.from(H).map(L=>L.props.value).join(";");return a.jsx($R,{...x,children:a.jsxs(XR,{required:m,scope:t,trigger:S,onTriggerChange:y,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:qn(),value:O,onValueChange:M,open:E,onOpenChange:T,dir:C,triggerPointerDownPosRef:R,disabled:p,children:[a.jsx(pa.Provider,{scope:t,children:a.jsx(qR,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(L=>{W(B=>new Set(B).add(L))},[]),onNativeOptionRemove:g.useCallback(L=>{W(B=>{const P=new Set(B);return P.delete(L),P})},[]),children:n})}),_?a.jsxs(w1,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:O,onChange:L=>M(L.target.value),disabled:p,form:w,children:[O===void 0?a.jsx("option",{value:""}):null,Array.from(H)]},I):null]})})};Y0.displayName=_r;var X0="SelectTrigger",q0=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=ha(n),l=ur(X0,n),s=l.disabled||r,u=ve(t,l.onTriggerChange),c=ma(n),f=g.useRef("touch"),[d,p,m]=b1(x=>{const S=c().filter(v=>!v.disabled),y=S.find(v=>v.value===l.value),h=k1(S,x,y);h!==void 0&&l.onValueChange(h.value)}),w=x=>{s||(l.onOpenChange(!0),m()),x&&(l.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return a.jsx(UR,{asChild:!0,...o,children:a.jsx(oe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":S1(l.value)?"":void 0,...i,ref:u,onClick:Z(i.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&w(x)}),onPointerDown:Z(i.onPointerDown,x=>{f.current=x.pointerType;const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:Z(i.onKeyDown,x=>{const S=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(S&&x.key===" ")&&KR.includes(x.key)&&(w(),x.preventDefault())})})})});q0.displayName=X0;var J0="SelectValue",Z0=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,u=ur(J0,n),{onValueNodeHasChildrenChange:c}=u,f=o!==void 0,d=ve(t,u.onValueNodeChange);return tt(()=>{c(f)},[c,f]),a.jsx(oe.span,{...s,ref:d,style:{pointerEvents:"none"},children:S1(u.value)?a.jsx(a.Fragment,{children:l}):o})});Z0.displayName=J0;var ZR="SelectIcon",e1=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return a.jsx(oe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});e1.displayName=ZR;var eI="SelectPortal",t1=e=>a.jsx(Kd,{asChild:!0,...e});t1.displayName=eI;var Ar="SelectContent",n1=g.forwardRef((e,t)=>{const n=ur(Ar,e.__scopeSelect),[r,i]=g.useState();if(tt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ei.createPortal(a.jsx(r1,{scope:e.__scopeSelect,children:a.jsx(pa.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(i1,{...e,ref:t})});n1.displayName=Ar;var $t=10,[r1,cr]=Li(Ar),tI="SelectContentImpl",nI=Si("SelectContent.RemoveScroll"),i1=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:u,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S,...y}=e,h=ur(Ar,n),[v,k]=g.useState(null),[j,C]=g.useState(null),E=ve(t,K=>k(K)),[T,O]=g.useState(null),[M,R]=g.useState(null),_=ma(n),[H,W]=g.useState(!1),I=g.useRef(!1);g.useEffect(()=>{if(v)return By(v)},[v]),Ty();const L=g.useCallback(K=>{const[te,...he]=_().map(me=>me.ref.current),[ie]=he.slice(-1),ce=document.activeElement;for(const me of K)if(me===ce||(me==null||me.scrollIntoView({block:"nearest"}),me===te&&j&&(j.scrollTop=0),me===ie&&j&&(j.scrollTop=j.scrollHeight),me==null||me.focus(),document.activeElement!==ce))return},[_,j]),B=g.useCallback(()=>L([T,v]),[L,T,v]);g.useEffect(()=>{H&&B()},[H,B]);const{onOpenChange:P,triggerPointerDownPosRef:z}=h;g.useEffect(()=>{if(v){let K={x:0,y:0};const te=ie=>{var ce,me;K={x:Math.abs(Math.round(ie.pageX)-(((ce=z.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((me=z.current)==null?void 0:me.y)??0))}},he=ie=>{K.x<=10&&K.y<=10?ie.preventDefault():v.contains(ie.target)||P(!1),document.removeEventListener("pointermove",te),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",he,{capture:!0})}}},[v,P,z]),g.useEffect(()=>{const K=()=>P(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[P]);const[b,U]=b1(K=>{const te=_().filter(ce=>!ce.disabled),he=te.find(ce=>ce.ref.current===document.activeElement),ie=k1(te,K,he);ie&&setTimeout(()=>ie.ref.current.focus())}),Q=g.useCallback((K,te,he)=>{const ie=!I.current&&!he;(h.value!==void 0&&h.value===te||ie)&&(O(K),ie&&(I.current=!0))},[h.value]),N=g.useCallback(()=>v==null?void 0:v.focus(),[v]),ne=g.useCallback((K,te,he)=>{const ie=!I.current&&!he;(h.value!==void 0&&h.value===te||ie)&&R(K)},[h.value]),de=r==="popper"?Oc:o1,re=de===Oc?{side:s,sideOffset:u,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:x,avoidCollisions:S}:{};return a.jsx(r1,{scope:n,content:v,viewport:j,onViewportChange:C,itemRefCallback:Q,selectedItem:T,onItemLeave:N,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:M,position:r,isPositioned:H,searchRef:b,children:a.jsx(zy,{as:nI,allowPinchZoom:!0,children:a.jsx(Gd,{asChild:!0,trapped:h.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Z(i,K=>{var te;(te=h.trigger)==null||te.focus({preventScroll:!0}),K.preventDefault()}),children:a.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:a.jsx(de,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:K=>K.preventDefault(),...y,...re,onPlaced:()=>W(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,K=>{const te=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!te&&K.key.length===1&&U(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ie=_().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ce=K.target,me=ie.indexOf(ce);ie=ie.slice(me+1)}setTimeout(()=>L(ie)),K.preventDefault()}})})})})})})});i1.displayName=tI;var rI="SelectItemAlignedPosition",o1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ur(Ar,n),l=cr(Ar,n),[s,u]=g.useState(null),[c,f]=g.useState(null),d=ve(t,E=>f(E)),p=ma(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:x,selectedItem:S,selectedItemText:y,focusSelectedItem:h}=l,v=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&x&&S&&y){const E=o.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),O=o.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(o.dir!=="rtl"){const ce=M.left-T.left,me=O.left-ce,Ve=E.left-me,rt=E.width+Ve,Jt=Math.max(rt,T.width),Dt=window.innerWidth-$t,Zt=Es(me,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=rt+"px",s.style.left=Zt+"px"}else{const ce=T.right-M.right,me=window.innerWidth-O.right-ce,Ve=window.innerWidth-E.right-me,rt=E.width+Ve,Jt=Math.max(rt,T.width),Dt=window.innerWidth-$t,Zt=Es(me,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=rt+"px",s.style.right=Zt+"px"}const R=p(),_=window.innerHeight-$t*2,H=x.scrollHeight,W=window.getComputedStyle(c),I=parseInt(W.borderTopWidth,10),L=parseInt(W.paddingTop,10),B=parseInt(W.borderBottomWidth,10),P=parseInt(W.paddingBottom,10),z=I+L+H+P+B,b=Math.min(S.offsetHeight*5,z),U=window.getComputedStyle(x),Q=parseInt(U.paddingTop,10),N=parseInt(U.paddingBottom,10),ne=E.top+E.height/2-$t,de=_-ne,re=S.offsetHeight/2,K=S.offsetTop+re,te=I+L+K,he=z-te;if(te<=ne){const ce=R.length>0&&S===R[R.length-1].ref.current;s.style.bottom="0px";const me=c.clientHeight-x.offsetTop-x.offsetHeight,Ve=Math.max(de,re+(ce?N:0)+me+B),rt=te+Ve;s.style.height=rt+"px"}else{const ce=R.length>0&&S===R[0].ref.current;s.style.top="0px";const Ve=Math.max(ne,I+x.offsetTop+(ce?Q:0)+re)+he;s.style.height=Ve+"px",x.scrollTop=te-ne+x.offsetTop}s.style.margin=`${$t}px 0`,s.style.minHeight=b+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,c,x,S,y,o.dir,r]);tt(()=>v(),[v]);const[k,j]=g.useState();tt(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(E=>{E&&w.current===!0&&(v(),h==null||h(),w.current=!1)},[v,h]);return a.jsx(oI,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:a.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:a.jsx(oe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});o1.displayName=rI;var iI="SelectPopperPosition",Oc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=$t,...o}=e,l=ha(n);return a.jsx(VR,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oc.displayName=iI;var[oI,bf]=Li(Ar,{}),Dc="SelectViewport",l1=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=cr(Dc,n),l=bf(Dc,n),s=ve(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(pa.Slot,{scope:n,children:a.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const m=Math.abs(u.current-f.scrollTop);if(m>0){const w=window.innerHeight-$t*2,x=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),y=Math.max(x,S);if(y0?k:0,d.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});l1.displayName=Dc;var s1="SelectGroup",[lI,sI]=Li(s1),a1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qn();return a.jsx(lI,{scope:n,id:i,children:a.jsx(oe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});a1.displayName=s1;var u1="SelectLabel",c1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=sI(u1,n);return a.jsx(oe.div,{id:i.id,...r,ref:t})});c1.displayName=u1;var Is="SelectItem",[aI,d1]=Li(Is),f1=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=ur(Is,n),u=cr(Is,n),c=s.value===r,[f,d]=g.useState(o??""),[p,m]=g.useState(!1),w=ve(t,h=>{var v;return(v=u.itemRefCallback)==null?void 0:v.call(u,h,r,i)}),x=qn(),S=g.useRef("touch"),y=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(aI,{scope:n,value:r,disabled:i,textId:x,isSelected:c,onItemTextChange:g.useCallback(h=>{d(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:a.jsx(pa.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:a.jsx(oe.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>m(!0)),onBlur:Z(l.onBlur,()=>m(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&y()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&y()}),onPointerDown:Z(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:Z(l.onPointerMove,h=>{var v;S.current=h.pointerType,i?(v=u.onItemLeave)==null||v.call(u):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=u.onItemLeave)==null||v.call(u))}),onKeyDown:Z(l.onKeyDown,h=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&h.key===" "||(QR.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});f1.displayName=Is;var Zi="SelectItemText",p1=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ur(Zi,n),s=cr(Zi,n),u=d1(Zi,n),c=JR(Zi,n),[f,d]=g.useState(null),p=ve(t,y=>d(y),u.onItemTextChange,y=>{var h;return(h=s.itemTextRefCallback)==null?void 0:h.call(s,y,u.value,u.disabled)}),m=f==null?void 0:f.textContent,w=g.useMemo(()=>a.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=c;return tt(()=>(x(w),()=>S(w)),[x,S,w]),a.jsxs(a.Fragment,{children:[a.jsx(oe.span,{id:u.textId,...o,ref:p}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ei.createPortal(o.children,l.valueNode):null]})});p1.displayName=Zi;var m1="SelectItemIndicator",h1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d1(m1,n).isSelected?a.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});h1.displayName=m1;var zc="SelectScrollUpButton",g1=g.forwardRef((e,t)=>{const n=cr(zc,e.__scopeSelect),r=bf(zc,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?a.jsx(y1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});g1.displayName=zc;var Fc="SelectScrollDownButton",x1=g.forwardRef((e,t)=>{const n=cr(Fc,e.__scopeSelect),r=bf(Fc,e.__scopeSelect),[i,o]=g.useState(!1),l=ve(t,r.onScrollButtonChange);return tt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?a.jsx(y1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});x1.displayName=Fc;var y1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=cr("SelectScrollButton",n),l=g.useRef(null),s=ma(n),u=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),tt(()=>{var f;const c=s().find(d=>d.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),a.jsx(oe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Z(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{u()})})}),uI="SelectSeparator",v1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});v1.displayName=uI;var Bc="SelectArrow",cI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ha(n),o=ur(Bc,n),l=cr(Bc,n);return o.open&&l.position==="popper"?a.jsx(HR,{...i,...r,ref:t}):null});cI.displayName=Bc;var dI="SelectBubbleInput",w1=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ve(r,i),l=u0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),a.jsx(oe.select,{...n,style:{...Q0,...n.style},ref:o,defaultValue:t})});w1.displayName=dI;function S1(e){return e===""||e===void 0}function b1(e){const t=er(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const s=n.current+l;t(s),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function k1(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=fI(e,Math.max(o,0));i.length===1&&(l=l.filter(c=>c!==n));const u=l.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function fI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pI=Y0,N1=q0,mI=Z0,hI=e1,gI=t1,C1=n1,xI=l1,yI=a1,j1=c1,E1=f1,vI=p1,wI=h1,P1=g1,T1=x1,_1=v1;const kf=pI,pi=yI,Nf=mI,ga=g.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(N1,{ref:r,className:ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(hI,{asChild:!0,children:a.jsx(Kx,{className:"h-4 w-4 opacity-50"})})]}));ga.displayName=N1.displayName;const A1=g.forwardRef(({className:e,...t},n)=>a.jsx(P1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(rN,{className:"h-4 w-4"})}));A1.displayName=P1.displayName;const R1=g.forwardRef(({className:e,...t},n)=>a.jsx(T1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Kx,{className:"h-4 w-4"})}));R1.displayName=T1.displayName;const xa=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>a.jsx(gI,{children:a.jsxs(C1,{ref:i,className:ue("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(A1,{}),a.jsx(xI,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(R1,{})]})}));xa.displayName=C1.displayName;const Sr=g.forwardRef(({className:e,...t},n)=>a.jsx(j1,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Sr.displayName=j1.displayName;const $n=g.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(E1,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(wI,{children:a.jsx(Jk,{className:"h-4 w-4"})})}),a.jsx(vI,{children:t})]}));$n.displayName=E1.displayName;const SI=g.forwardRef(({className:e,...t},n)=>a.jsx(_1,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));SI.displayName=_1.displayName;function bI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:s}){return a.jsxs(a.Fragment,{children:[a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsx(Mt,{className:"text-base",children:"Model"})}),a.jsx(Qe,{className:"space-y-4",children:a.jsx("div",{children:a.jsxs(kf,{value:t||"",onValueChange:n,children:[a.jsx(ga,{className:"w-full",children:a.jsx(Nf,{placeholder:"Select a model...",children:t&&(()=>{const u=e.find(f=>f.model_name===t);if(!u)return t;const c=u.type==="api";return a.jsxs("div",{className:"flex items-center gap-2",children:[c?a.jsx(bs,{className:"h-4 w-4 text-blue-500"}):u.supports_thinking?a.jsx(Er,{className:"h-4 w-4 text-purple-500"}):a.jsx(hc,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{className:"truncate",children:u.name}),r===t?a.jsx(ye,{variant:"outline",className:"text-xs",children:"Loading..."}):a.jsx(ye,{variant:"outline",className:"text-xs",children:c?"API":u.is_loaded?"Loaded":"Available"})]})})()})}),a.jsxs(xa,{children:[a.jsxs(pi,{children:[a.jsx(Sr,{children:"🌐 API Models"}),e.filter(u=>u.type==="api").map(u=>a.jsx($n,{value:u.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bs,{className:"h-4 w-4 text-blue-500"}),a.jsx("span",{children:u.name}),a.jsx(ye,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},u.model_name))]}),a.jsxs(pi,{children:[a.jsx(Sr,{children:"💻 Local Models"}),e.filter(u=>u.type==="local").map(u=>a.jsx($n,{value:u.model_name,children:a.jsxs("div",{className:"flex items-center gap-2",children:[u.supports_thinking?a.jsx(Er,{className:"h-4 w-4 text-purple-500"}):a.jsx(hc,{className:"h-4 w-4 text-green-500"}),a.jsx("span",{children:u.name}),r===u.model_name?a.jsx(ye,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):u.is_loaded?a.jsx(ye,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):a.jsx(ye,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},u.model_name))]})]})]})})})]}),a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsx(Mt,{className:"text-base",children:"Parameters"})}),a.jsxs(Qe,{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(Ze,{className:"text-sm font-medium",children:"Temperature"}),a.jsx(ye,{variant:"outline",className:"text-xs",children:i})]}),a.jsx(Ps,{value:[i],onValueChange:u=>o(u[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),a.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[a.jsx("span",{children:"0.0 (Focused)"}),a.jsx("span",{children:"1.0 (Balanced)"}),a.jsx("span",{children:"2.0 (Creative)"})]}),a.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:i<=.3?"🎯 Very focused and deterministic responses":i<=.7?"⚖️ Balanced creativity and consistency":i<=1.2?"🎨 More creative and varied responses":"🚀 Highly creative, unpredictable responses"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(Ze,{className:"text-sm font-medium",children:"Max Tokens"}),a.jsx(ye,{variant:"outline",className:"text-xs",children:l})]}),a.jsx(Ps,{value:[l],onValueChange:u=>s(u[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),a.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[a.jsx("span",{children:"50 (Short)"}),a.jsx("span",{children:"1024 (Medium)"}),a.jsx("span",{children:"4000 (Long)"})]}),a.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:l<=200?"📝 Brief responses, good for quick answers":l<=1e3?"📄 Medium responses, balanced length":l<=2e3?"📋 Long responses, detailed explanations":"📚 Very long responses, comprehensive content"})]})]})]})]})}function kI({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:s,clearCurrentAssistant:u,openRenameDialog:c,systemPrompt:f}){const d=x=>{if(x==="create_new")s();else if(x==="clear_current")u();else if(x.startsWith("user_")){const S=x.replace("user_","");t(S)}else i(x)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=x=>{switch(x){case"user":return{variant:"secondary",text:"Mine"};case"template":return{variant:"outline",text:"Template"};case"new":return{variant:"default",text:"New",className:"bg-green-100 text-green-700"}}},w=e.length+r.length;return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ze,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),a.jsxs(kf,{value:p(),onValueChange:d,children:[a.jsx(ga,{className:"w-full",children:a.jsx(Nf,{placeholder:`Choose assistant (${w} available)`,children:l?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ei,{className:"h-4 w-4"}),a.jsx("span",{children:l.name}),l.originalTemplate&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),a.jsx(ye,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ei,{className:"h-4 w-4"}),a.jsx("span",{children:"Choose assistant"}),a.jsx(ye,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),a.jsxs(xa,{children:[a.jsxs(pi,{children:[a.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx(ks,{className:"h-4 w-4"}),"Actions"]}),a.jsx($n,{value:"create_new",children:a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx(ks,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),a.jsx(ye,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&a.jsx($n,{value:"clear_current",children:a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx(ey,{className:"h-4 w-4 text-gray-600"}),a.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),a.jsx(ye,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&a.jsxs(pi,{children:[a.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx(Bd,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(x=>a.jsx($n,{value:`user_${x.id}`,children:a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx(ei,{className:"h-4 w-4 text-blue-600"}),a.jsx("span",{className:"truncate flex-1",children:x.name}),a.jsx(ye,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${x.id}`))]}),r.length>0&&a.jsxs(pi,{children:[a.jsxs(Sr,{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx(Qk,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(x=>a.jsx($n,{value:x.name,children:a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx(ei,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"truncate flex-1",children:x.name}),a.jsx(ye,{variant:"outline",className:"text-xs",children:"Template"})]})},x.name))]}),w===0&&a.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&a.jsxs(fe,{onClick:c,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[a.jsx(si,{className:"h-4 w-4 mr-2"}),"Rename"]}),a.jsxs(fe,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!f.trim(),children:[a.jsx(qx,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function NI({systemPrompt:e,setSystemPrompt:t,isLoading:n}){const r=[{title:"Helpful Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses. If you're unsure about something, say so."},{title:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include helpful comments."},{title:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{title:"Teacher/Tutor",prompt:"You are a patient and knowledgeable teacher. Break down complex concepts into simple, understandable parts. Use examples and analogies to help explain ideas."}],i=["Be specific about the assistant's role and expertise","Include desired communication style and tone","Specify output format if needed (lists, paragraphs, etc.)","Add ethical guidelines and behavior expectations"];return a.jsxs("div",{className:"space-y-4 pb-6",children:[a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsx(Mt,{className:"text-base",children:"System Instructions"})}),a.jsx(Qe,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ze,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),a.jsx("textarea",{value:e,onChange:o=>t(o.target.value),placeholder:"Define your AI assistant's role, personality, and behavior...",className:"w-full h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-none overflow-y-auto",disabled:n}),a.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"text-sm flex items-center",children:[a.jsx(Er,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),a.jsx(Qe,{children:a.jsxs("div",{className:"space-y-3",children:[a.jsx(Ze,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),a.jsxs(kf,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[a.jsx(ga,{className:"w-full h-10",children:a.jsx(Nf,{placeholder:"Select example prompt..."})}),a.jsx(xa,{children:a.jsxs(pi,{children:[a.jsx(Sr,{children:"Example Prompts"}),r.map((o,l)=>a.jsx($n,{value:l.toString(),children:a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("span",{className:"font-medium text-sm",children:o.title}),a.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"text-sm flex items-center",children:[a.jsx(Zs,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),a.jsx(Qe,{children:a.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>a.jsxs("li",{className:"flex items-start",children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 bg-blue-400 rounded-full mt-1.5 mr-2 flex-shrink-0"}),o]},l))})})]})]})}function CI({isLoading:e,ragEnabled:t,setRagEnabled:n,retrievalCount:r,setRetrievalCount:i,currentAssistant:o}){const[l,s]=g.useState([]),[u,c]=g.useState(!1);g.useEffect(()=>{(async()=>{if(!o){s([]);return}try{const m=await fetch("/rag/documents");if(m.ok){const w=await m.json();if(w.documents){const x=Object.entries(w.documents).map(([S,y])=>({id:S,name:y.filename,size:0,type:y.file_type,uploadedAt:new Date().toISOString(),status:y.status,chunks:y.chunks,assistantId:y.assistant_id||null}));s(x)}}}catch(m){console.error("Error loading documents:",m)}})()},[o]);const f=async p=>{const m=p.target.files;if(!(!m||!o)){c(!0);try{const w=new FormData;w.append("assistant_id",o.id);for(const S of Array.from(m))w.append("files",S);const x=await fetch("/rag/upload",{method:"POST",body:w});if(x.ok){const S=await x.json(),y=S.results.filter(v=>v.success).map(v=>({id:v.doc_id,name:v.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:v.chunks,assistantId:o==null?void 0:o.id}));s(v=>[...v,...y]);const h=S.results.filter(v=>!v.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",x.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{c(!1)}}},d=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?s(w=>w.filter(x=>x.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),s(w=>w.filter(x=>x.id!==p))}};return a.jsx("div",{className:"space-y-4 pb-6",children:o?a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Bd,{className:"h-4 w-4 text-blue-600"}),a.jsx("span",{children:o.name}),a.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${o.type==="user"?"bg-blue-100 text-blue-700":o.type==="template"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-700"}`,children:o.type==="user"?"My Assistant":o.type==="template"?"Template":"New Assistant"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ze,{className:"text-xs text-muted-foreground",children:"RAG"}),a.jsx("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked),className:"rounded",disabled:e||l.length===0}),t&&l.length>0&&a.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),a.jsx("span",{className:"text-xs font-medium",children:"Active"})]})]})]})}),a.jsxs(Qe,{className:"space-y-4",children:[t&&a.jsxs("div",{className:"border-l-2 border-blue-200 pl-3 space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ze,{className:"text-xs font-medium",children:"Retrieval Depth"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," chunks"]})]}),a.jsx(Ps,{value:[r],onValueChange:p=>i(p[0]),max:10,min:1,step:1,className:"w-full"})]}),a.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-4 text-center hover:border-gray-300 transition-colors",children:[a.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:f,className:"hidden",disabled:u||e}),a.jsxs(Ze,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[a.jsx(FN,{className:"h-6 w-6 text-gray-400"}),a.jsx("span",{className:"text-sm",children:u?"Uploading...":"Drop files or click to upload"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Ze,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),t&&a.jsxs("span",{className:"text-xs text-green-600",children:["Using ",Math.min(r,l.length)," for context"]})]}),a.jsx("div",{className:"space-y-1",children:l.map(p=>a.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[a.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[a.jsx(pN,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),a.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&a.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),a.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>d(p.id),disabled:e,className:"h-6 w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:a.jsx(ey,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&a.jsx("div",{className:"text-center py-3",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]}):a.jsx(Ue,{children:a.jsxs(Qe,{className:"pt-6 text-center",children:[a.jsx(Js,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an assistant to manage documents"})]})})})}function jI(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:s,sendMessage:u,stopGeneration:c,isLoading:f,selectedModel:d,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:x,setTemperature:S,maxTokens:y,setMaxTokens:h}=iA(),[v,k]=g.useState(!1),[j,C]=g.useState(3),[E,T]=g.useState(!1),[O,M]=g.useState(!1),[R,_]=g.useState(null),[H,W]=g.useState(!1),[I,L]=g.useState(null),[B,P]=g.useState([]),[z,b]=g.useState([]),[U,Q]=g.useState(null),[N,ne]=g.useState(!1),[de,re]=g.useState(""),[K,te]=g.useState(!1),[he,ie]=g.useState(""),ce=()=>{try{const D=JSON.parse(localStorage.getItem("savedAssistants")||"[]");b(D)}catch(D){console.error("Failed to load saved assistants:",D)}},me=()=>{if(!m.trim())return;let D="My Assistant";U&&(U.type==="new"?D=U.name:U.type==="template"?D=`My ${U.name}`:D=U.name+" Copy"),re(D),ne(!0)},Ve=()=>{if(!de.trim()||!m.trim())return;const D={id:Date.now().toString(),name:de.trim(),systemPrompt:m,temperature:x,maxTokens:y,model:d,ragEnabled:v,retrievalCount:j,documents:[],createdAt:new Date().toISOString()},X=[...z,D];b(X),localStorage.setItem("savedAssistants",JSON.stringify(X)),Q({id:D.id,name:D.name,type:"user"}),ne(!1),re("")},rt=()=>{ne(!1),re("")},Jt=D=>{const X=z.find(ge=>ge.id===D);X&&(w(X.systemPrompt),S(X.temperature),h(X.maxTokens),k(X.ragEnabled||!1),C(X.retrievalCount||3),X.model&&p(X.model),Q({id:X.id,name:X.name,type:"user"}))},Dt=[{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:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."}],Zt=D=>{const X=Dt.find(ge=>ge.name===D);X&&(w(X.prompt),k(!1),C(3),Q({id:D,name:X.name,type:"template"}))},Oi=()=>{w(""),S(.7),h(1024),k(!1),C(3),Q({id:"new_assistant",name:"New Assistant",type:"new"})},hn=()=>{Q(null)},Ko=()=>{U&&(ie(U.name),te(!0))},Qo=()=>{if(!U||!he.trim())return;const D={...U,name:he.trim()};if(Q(D),U.type==="user"){const X=z.map(ge=>ge.id===U.id?{...ge,name:he.trim()}:ge);b(X),localStorage.setItem("savedAssistants",JSON.stringify(X))}te(!1),ie("")},Yo=()=>{te(!1),ie("")},ya=()=>({name:(U==null?void 0:U.name)||"Default Assistant",type:(U==null?void 0:U.type)||"default",systemPrompt:m,temperature:x,maxTokens:y,originalTemplate:U==null?void 0:U.originalTemplate}),dr=()=>{U&&U.type==="template"&&Q({id:"new_assistant",name:`Custom ${U.name}`,type:"new",originalTemplate:U.name})},va=D=>{w(D),dr()},A=D=>{S(D),dr()},V=D=>{h(D),dr()},q=D=>{k(D),dr()},le=D=>{C(D),dr()};g.useEffect(()=>{zt(),ce()},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:E,configCollapsed:O,sessionsCount:e.length,currentSessionId:t})},[E,O,e.length,t]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(D=>({id:D.id,title:D.title})))},[e]),g.useEffect(()=>{if(d&&!B.find(D=>D.model_name===d)){const D=B[0];D&&p(D.model_name)}},[B,d,p]),g.useEffect(()=>{(async()=>{if(!d||!B.length)return;const X=B.find(Oe=>Oe.model_name===d);if(!X)return;const ge=`${window.location.protocol}//${window.location.host}`;if(X.type==="local"&&!X.is_loaded){L(X),W(!0);return}const be=B.filter(Oe=>Oe.type==="local"&&Oe.is_loaded&&Oe.model_name!==d);for(const Oe of be)try{(await fetch(`${ge}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Oe.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Oe.model_name}`)}catch(at){console.error(`Error auto-unloading model ${Oe.model_name}:`,at)}be.length>0&&zt()})()},[d,B]);const we=async()=>{if(I){W(!1),_(I.model_name);try{const D=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${D}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:I.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${I.model_name}`),zt();else{console.error(`❌ Failed to load model: ${I.model_name}`);const ge=B.find(be=>be.type==="api");ge&&p(ge.model_name)}}catch(D){console.error("Error loading model:",D);const X=B.find(ge=>ge.type==="api");X&&p(X.model_name)}finally{_(null),L(null)}}},xt=()=>{W(!1),L(null);const D=B.find(X=>X.type==="api");D&&p(D.model_name)};g.useEffect(()=>{const D=async()=>{const X=`${window.location.protocol}//${window.location.host}`,ge=B.filter(be=>be.type==="local"&&be.is_loaded);for(const be of ge)try{await fetch(`${X}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:be.model_name})}),console.log(`✅ Cleanup: unloaded ${be.model_name}`)}catch(Oe){console.error(`Error cleaning up model ${be.model_name}:`,Oe)}};return()=>{D()}},[B]);const zt=async()=>{try{const D=`${window.location.protocol}//${window.location.host}`,X=await fetch(`${D}/models`);if(X.ok){const ge=await X.json();if(P(ge.models),ge.current_model&&d!==ge.current_model)p(ge.current_model);else if(!d&&ge.models.length>0){const Oe=ge.models.find(at=>at.type==="api")||ge.models[0];p(Oe.model_name)}}}catch(D){console.error("Failed to fetch models:",D)}};return a.jsxs("div",{className:"h-screen bg-background flex",children:[a.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${E?"w-12":"w-80"} + `,children:a.jsxs("div",{className:"p-4 space-y-4 h-full",children:[a.jsxs("div",{className:`flex items-center ${E?"justify-center":"justify-between"}`,children:[!E&&a.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),a.jsxs("div",{className:"flex gap-1",children:[!E&&a.jsxs(fe,{onClick:i,size:"sm",children:[a.jsx(ks,{className:"h-4 w-4 mr-1"}),"New"]}),a.jsx(fe,{onClick:()=>T(!E),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:E?"Expand Sessions":"Collapse Sessions",children:E?a.jsx(Yp,{className:"h-4 w-4"}):a.jsx(Qp,{className:"h-4 w-4"})})]})]}),E&&a.jsx(fe,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:a.jsx(ks,{className:"h-4 w-4"})}),a.jsxs("div",{className:"space-y-2",children:[!E&&e.map(D=>a.jsxs(Ue,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===D.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",D.id,D.title),n(D.id)},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:D.title}),a.jsx(fe,{size:"sm",variant:"ghost",onClick:X=>{X.stopPropagation(),r(D.id)},className:"h-6 w-6 p-0",children:a.jsx(Jx,{className:"h-3 w-3"})})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[D.messages.length," messages"]})]},D.id)),E&&e.map(D=>a.jsxs(fe,{variant:t===D.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:D.title,onClick:()=>{console.log("Session icon clicked:",D.id,D.title),n(D.id)},children:[a.jsx(Zs,{className:"h-4 w-4"}),D.messages&&D.messages.length>0&&a.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(D.messages.length,9)})]},D.id))]})]})}),a.jsx("div",{className:"flex-1 flex flex-col h-full",children:a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[a.jsx("div",{className:"flex-1 flex flex-col",children:a.jsx(s0,{messages:o.map(D=>({id:D.id,role:D.role,content:D.content,createdAt:new Date(D.timestamp),assistantInfo:D.assistantInfo})),input:l,handleInputChange:D=>s(D.target.value),handleSubmit:async D=>{if(D.preventDefault(),!d||!B.find(be=>be.model_name===d))return;const X=ya();await u(X,{useRag:v,retrievalCount:j})},isGenerating:f,stop:c,className:"flex-1"})}),a.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${O?"w-12":"w-[480px] xl:w-[520px]"} + `,children:a.jsxs("div",{className:"p-4 space-y-4 h-full",children:[a.jsxs("div",{className:`flex items-center ${O?"justify-center":"justify-between"}`,children:[!O&&a.jsx("h2",{className:"font-semibold",children:"Configuration"}),a.jsx("div",{className:"flex gap-1",children:a.jsx(fe,{onClick:()=>M(!O),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:O?"Expand Configuration":"Collapse Configuration",children:O?a.jsx(Qp,{className:"h-4 w-4"}):a.jsx(Yp,{className:"h-4 w-4"})})})]}),O&&a.jsx(fe,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:a.jsx(si,{className:"h-4 w-4"})}),a.jsx("div",{className:"space-y-2",children:!O&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:a.jsx(kI,{savedAssistants:z,loadSavedAssistant:Jt,openSaveDialog:me,presets:Dt,onPresetSelect:Zt,isLoading:f,selectedAssistant:U,createNewAssistant:Oi,clearCurrentAssistant:hn,openRenameDialog:Ko,systemPrompt:m})}),a.jsxs(OC,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[a.jsxs(ky,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[a.jsxs(Ll,{value:"parameters",className:"flex items-center gap-2",children:[a.jsx(AN,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),a.jsxs(Ll,{value:"instructions",className:"flex items-center gap-2",children:[a.jsx(si,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),a.jsxs(Ll,{value:"documents",className:"flex items-center gap-2",children:[a.jsx(Js,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[a.jsx(Ol,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:a.jsx(bI,{models:B,selectedModel:d,setSelectedModel:p,autoLoadingModel:R,temperature:x,setTemperature:A,maxTokens:y,setMaxTokens:V})}),a.jsx(Ol,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:a.jsx(NI,{systemPrompt:m,setSystemPrompt:va,isLoading:f})}),a.jsx(Ol,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:a.jsx(CI,{isLoading:f,ragEnabled:v,setRagEnabled:q,retrievalCount:j,setRetrievalCount:le,currentAssistant:U})})]})]})]})})]})})]})}),a.jsx(nu,{open:H,onOpenChange:W,children:a.jsxs(Fl,{children:[a.jsxs(Bl,{children:[a.jsx(Ul,{children:"Load Local Model"}),a.jsxs(Vl,{children:["Loading ",a.jsx("strong",{children:I==null?void 0:I.name})," will use approximately ",a.jsx("strong",{children:I==null?void 0:I.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),a.jsxs($l,{children:[a.jsx(Wl,{onClick:xt,children:"Cancel"}),a.jsx(Hl,{onClick:we,children:"Load Model"})]})]})}),a.jsx(nu,{open:N,onOpenChange:ne,children:a.jsxs(Fl,{children:[a.jsxs(Bl,{children:[a.jsx(Ul,{children:"Save Assistant"}),a.jsx(Vl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),a.jsxs("div",{className:"py-4",children:[a.jsx(Ze,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),a.jsx("input",{id:"assistant-name",type:"text",value:de,onChange:D=>re(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter a name for your assistant...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&de.trim()&&Ve(),D.key==="Escape"&&rt()}}),a.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[de.length,"/100 characters"]})]}),a.jsxs($l,{children:[a.jsx(Wl,{onClick:rt,children:"Cancel"}),a.jsxs(Hl,{onClick:Ve,disabled:!de.trim(),children:[a.jsx(qx,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),a.jsx(nu,{open:K,onOpenChange:te,children:a.jsxs(Fl,{children:[a.jsxs(Bl,{children:[a.jsx(Ul,{children:"Rename Assistant"}),a.jsxs(Vl,{children:['Enter a new name for "',U==null?void 0:U.name,'".']})]}),a.jsxs("div",{className:"py-4",children:[a.jsx(Ze,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),a.jsx("input",{id:"rename-assistant-name",type:"text",value:he,onChange:D=>ie(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter new assistant name...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&he.trim()&&Qo(),D.key==="Escape"&&Yo()}}),a.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[he.length,"/100 characters"]})]}),a.jsxs($l,{children:[a.jsx(Wl,{onClick:Yo,children:"Cancel"}),a.jsxs(Hl,{onClick:Qo,disabled:!he.trim(),children:[a.jsx(si,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function EI(){const e=Ti(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,l]=g.useState(null);g.useEffect(()=>{s()},[]);const s=async()=>{try{const f=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${f}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const p=await d.json();n(p.models)}catch(f){console.error("Error fetching models:",f)}finally{i(!1)}},u=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);s()}catch(d){console.error("Error loading model:",d)}finally{l(null)}},c=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);s()}catch(d){console.error("Error unloading model:",d)}finally{l(null)}};return r?a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsx(mc,{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(Js,{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(fe,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[a.jsx(hc,{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(Ue,{className:"bg-blue-50 border-blue-200",children:a.jsx(Qe,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Xx,{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(bs,{className:"h-5 w-5"}),"API Models",a.jsx(ye,{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:t.filter(f=>f.type==="api").map(f=>a.jsx(hh,{model:f,modelLoading:o,onLoad:u,onUnload:c},f.model_name))})]}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[a.jsx(Yx,{className:"h-5 w-5"}),"Local Models",a.jsx(ye,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(f=>f.type==="local").map(f=>a.jsx(hh,{model:f,modelLoading:o,onLoad:u,onUnload:c},f.model_name))})]})]})})]})}function hh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return a.jsxs(Ue,{className:"hover:shadow-md transition-shadow",children:[a.jsx(It,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs(Mt,{className:"text-base flex items-center gap-2",children:[i?a.jsx(bs,{className:"h-4 w-4 text-blue-600"}):a.jsx(Yx,{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})]}),l&&a.jsx(oN,{className:"h-5 w-5 text-green-600"})]})}),a.jsxs(Qe,{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(ye,{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(ye,{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(ye,{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(ye,{variant:"outline",className:"text-xs",children:[a.jsx(Er,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),a.jsx("div",{className:"pt-2",children:l?a.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?a.jsx(mc,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(Jx,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):a.jsxs(fe,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?a.jsx(mc,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(uN,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function PI(){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.jsx("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-gray-600 rounded-lg flex items-center justify-center",children:a.jsx(si,{className:"h-5 w-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),a.jsx("div",{className:"flex-1 p-6",children:a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsxs(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"flex items-center gap-2",children:[a.jsx(EN,{className:"h-5 w-5"}),"Server Configuration"]})}),a.jsx(Qe,{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(Ze,{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(Ze,{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(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"flex items-center gap-2",children:[a.jsx(qp,{className:"h-5 w-5"}),"Privacy & Security"]})}),a.jsx(Qe,{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(qp,{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(Ue,{children:[a.jsx(It,{children:a.jsxs(Mt,{className:"flex items-center gap-2",children:[a.jsx(Xx,{className:"h-5 w-5"}),"System Information"]})}),a.jsx(Qe,{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(Ze,{className:"text-sm font-medium",children:"Platform"}),a.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[a.jsx(ye,{variant:"outline",children:"Local"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),a.jsxs("div",{children:[a.jsx(Ze,{className:"text-sm font-medium",children:"Status"}),a.jsx("div",{className:"mt-1",children:a.jsx(ye,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function TI(){return a.jsx(ok,{children:a.jsxs(Jb,{children:[a.jsx(gn,{path:"/",element:a.jsx(eC,{})}),a.jsx(gn,{path:"/technology",element:a.jsx(iC,{})}),a.jsx(gn,{path:"/usecases",element:a.jsx(oC,{})}),a.jsxs(gn,{path:"/",element:a.jsx(KN,{}),children:[a.jsx(gn,{path:"templates",element:a.jsx(sC,{})}),a.jsx(gn,{path:"playground",element:a.jsx(jI,{})}),a.jsx(gn,{path:"models",element:a.jsx(EI,{})}),a.jsx(gn,{path:"settings",element:a.jsx(PI,{})})]})]})})}gu.createRoot(document.getElementById("root")).render(a.jsx(Vt.StrictMode,{children:a.jsx(TI,{})})); +//# sourceMappingURL=index-dafa19ab.js.map