diff --git "a/static/assets/index-27738cd1.js" "b/static/assets/index-27738cd1.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-27738cd1.js" @@ -0,0 +1,352 @@ +function R1(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 Ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mh={exports:{}},Ms={},hh={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 Mo=Symbol.for("react.element"),A1=Symbol.for("react.portal"),I1=Symbol.for("react.fragment"),M1=Symbol.for("react.strict_mode"),O1=Symbol.for("react.profiler"),L1=Symbol.for("react.provider"),D1=Symbol.for("react.context"),z1=Symbol.for("react.forward_ref"),F1=Symbol.for("react.suspense"),B1=Symbol.for("react.memo"),$1=Symbol.for("react.lazy"),bf=Symbol.iterator;function U1(e){return e===null||typeof e!="object"?null:(e=bf&&e[bf]||e["@@iterator"],typeof e=="function"?e:null)}var gh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yh=Object.assign,vh={};function bi(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||gh}bi.prototype.isReactComponent={};bi.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")};bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xh(){}xh.prototype=bi.prototype;function Bc(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||gh}var $c=Bc.prototype=new xh;$c.constructor=Bc;yh($c,bi.prototype);$c.isPureReactComponent=!0;var Nf=Array.isArray,wh=Object.prototype.hasOwnProperty,Uc={current:null},Sh={key:!0,ref:!0,__self:!0,__source:!0};function kh(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)wh.call(t,r)&&!Sh.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,k))rei(G,de)?(P[U]=G,P[re]=k,U=re):(P[U]=de,P[ne]=k,U=ne);else if(rei(G,k))P[U]=G,P[re]=k,U=re;else break e}}return z}function i(P,z){var k=P.sortIndex-z.sortIndex;return k!==0?k: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 a=[],u=[],f=1,d=null,p=3,m=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,v=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 x(P){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=P)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function C(P){if(y=!1,x(P),!w)if(n(a)!==null)w=!0,O(E);else{var z=n(u);z!==null&&B(C,z.startTime-P)}}function E(P,z){w=!1,y&&(y=!1,v(T),T=-1),m=!0;var k=p;try{for(x(z),d=n(a);d!==null&&(!(d.expirationTime>z)||P&&!A());){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(a)&&r(a),x(z)}else r(a);d=n(a)}if(d!==null)var b=!0;else{var ne=n(u);ne!==null&&B(C,ne.startTime-z),b=!1}return b}finally{d=null,p=k,m=!1}}var N=!1,j=null,T=-1,L=5,M=-1;function A(){return!(e.unstable_now()-MP||125U?(P.sortIndex=k,t(u,P),n(a)===null&&P===n(u)&&(y?(v(T),T=-1):y=!0,B(C,k-U))):(P.sortIndex=Q,t(a,P),w||m||(w=!0,O(E))),P},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(P){var z=p;return function(){var k=p;p=z;try{return P.apply(this,arguments)}finally{p=k}}}})(jh);Eh.exports=jh;var Z1=Eh.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 ew=g,Nt=Z1;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"),gu=Object.prototype.hasOwnProperty,tw=/^[: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]*$/,jf={},Pf={};function nw(e){return gu.call(Pf,e)?!0:gu.call(jf,e)?!1:tw.test(e)?Pf[e]=!0:(jf[e]=!0,!1)}function rw(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 iw(e,t,n,r){if(t===null||typeof t>"u"||rw(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 lt(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 Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new lt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ge[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wc=/[\-:]([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(Wc,Kc);Ge[t]=new lt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wc,Kc);Ge[t]=new lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wc,Kc);Ge[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gc(e,t,n,r){var i=Ge.hasOwnProperty(t)?Ge[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{Sa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qi(e):""}function ow(e){switch(e.tag){case 5:return Qi(e.type);case 16:return Qi("Lazy");case 13:return Qi("Suspense");case 19:return Qi("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 wu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ur:return"Fragment";case $r:return"Portal";case yu:return"Profiler";case Qc:return"StrictMode";case vu:return"Suspense";case xu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _h:return(e.displayName||"Context")+".Consumer";case Th:return(e._context.displayName||"Context")+".Provider";case Yc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xc:return t=e.displayName||null,t!==null?t:wu(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return wu(e(t))}catch{}}return null}function lw(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 wu(t);case 8:return t===Qc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ah(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sw(e){var t=Ah(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 qo(e){e._valueTracker||(e._valueTracker=sw(e))}function Ih(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ah(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yl(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 Su(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _f(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mh(e,t){t=t.checked,t!=null&&Gc(e,"checked",t,!1)}function ku(e,t){Mh(e,t);var n=qn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Cu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cu(e,t.type,qn(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 Cu(e,t,n){(t!=="number"||Yl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yi=Array.isArray;function ei(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Jo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aw=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){aw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function zh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function Fh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=zh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var uw=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(uw[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 ju(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 Pu=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tu=null,ti=null,ni=null;function Mf(e){if(e=Do(e)){if(typeof Tu!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Fs(t),Tu(e.stateNode,e.type,t))}}function Bh(e){ti?ni?ni.push(e):ni=[e]:ti=e}function $h(){if(ti){var e=ti,t=ni;if(ni=ti=null,Mf(e),t)for(e=0;e>>=0,e===0?32:31-(ww(e)/Sw|0)|0}var Zo=64,el=4194304;function Xi(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 Zl(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=Xi(s):(o&=l,o!==0&&(r=Xi(o)))}else l=n&~i,l!==0?r=Xi(l):o!==0&&(r=Xi(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-Kt(t),e[t]=n}function Nw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=to),Vf=String.fromCharCode(32),Hf=!1;function sg(e,t){switch(e){case"keyup":return Zw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function tS(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(Hf=!0,Vf);case"textInput":return e=t.data,e===Vf&&Hf?null:e;default:return null}}function nS(e,t){if(Vr)return e==="compositionend"||!od&&sg(e,t)?(e=og(),Nl=nd=Dn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qf(n)}}function fg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pg(){for(var e=window,t=Yl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yl(e.document)}return t}function ld(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 dS(e){var t=pg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fg(n.ownerDocument.documentElement,n)){if(r!==null&&ld(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=Yf(n,o);var l=Yf(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,Hr=null,Ou=null,ro=null,Lu=!1;function Xf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lu||Hr==null||Hr!==Yl(r)||(r=Hr,"selectionStart"in r&&ld(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ro&&xo(ro,r)||(ro=r,r=ns(Ou,"onSelect"),0Gr||(e.current=Uu[Gr],Uu[Gr]=null,Gr--)}function Ce(e,t){Gr++,Uu[Gr]=e.current,e.current=t}var Jn={},Ze=rr(Jn),dt=rr(!1),Sr=Jn;function mi(e,t){var n=e.type.contextTypes;if(!n)return Jn;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 ft(e){return e=e.childContextTypes,e!=null}function is(){je(dt),je(Ze)}function rp(e,t,n){if(Ze.current!==Jn)throw Error(F(168));Ce(Ze,t),Ce(dt,n)}function kg(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,lw(e)||"Unknown",i));return Re({},n,r)}function os(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jn,Sr=Ze.current,Ce(Ze,e),Ce(dt,dt.current),!0}function ip(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=kg(e,t,Sr),r.__reactInternalMemoizedMergedChildContext=e,je(dt),je(Ze),Ce(Ze,e)):je(dt),Ce(dt,n)}var yn=null,Bs=!1,La=!1;function Cg(e){yn===null?yn=[e]:yn.push(e)}function CS(e){Bs=!0,Cg(e)}function ir(){if(!La&&yn!==null){La=!0;var e=0,t=we;try{var n=yn;for(we=1;e>=l,i-=l,vn=1<<32-Kt(t)+i|n<T?(L=j,j=null):L=j.sibling;var M=p(v,j,x[T],C);if(M===null){j===null&&(j=L);break}e&&j&&M.alternate===null&&t(v,j),h=o(M,h,T),N===null?E=M:N.sibling=M,N=M,j=L}if(T===x.length)return n(v,j),Pe&&dr(v,T),E;if(j===null){for(;TT?(L=j,j=null):L=j.sibling;var A=p(v,j,M.value,C);if(A===null){j===null&&(j=L);break}e&&j&&A.alternate===null&&t(v,j),h=o(A,h,T),N===null?E=A:N.sibling=A,N=A,j=L}if(M.done)return n(v,j),Pe&&dr(v,T),E;if(j===null){for(;!M.done;T++,M=x.next())M=d(v,M.value,C),M!==null&&(h=o(M,h,T),N===null?E=M:N.sibling=M,N=M);return Pe&&dr(v,T),E}for(j=r(v,j);!M.done;T++,M=x.next())M=m(j,v,T,M.value,C),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?T:M.key),h=o(M,h,T),N===null?E=M:N.sibling=M,N=M);return e&&j.forEach(function(_){return t(v,_)}),Pe&&dr(v,T),E}function S(v,h,x,C){if(typeof x=="object"&&x!==null&&x.type===Ur&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Xo:e:{for(var E=x.key,N=h;N!==null;){if(N.key===E){if(E=x.type,E===Ur){if(N.tag===7){n(v,N.sibling),h=i(N,x.props.children),h.return=v,v=h;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===In&&sp(E)===N.type){n(v,N.sibling),h=i(N,x.props),h.ref=$i(v,N,x),h.return=v,v=h;break e}n(v,N);break}else t(v,N);N=N.sibling}x.type===Ur?(h=xr(x.props.children,v.mode,C,x.key),h.return=v,v=h):(C=Il(x.type,x.key,x.props,null,v.mode,C),C.ref=$i(v,h,x),C.return=v,v=C)}return l(v);case $r:e:{for(N=x.key;h!==null;){if(h.key===N)if(h.tag===4&&h.stateNode.containerInfo===x.containerInfo&&h.stateNode.implementation===x.implementation){n(v,h.sibling),h=i(h,x.children||[]),h.return=v,v=h;break e}else{n(v,h);break}else t(v,h);h=h.sibling}h=Ha(x,v.mode,C),h.return=v,v=h}return l(v);case In:return N=x._init,S(v,h,N(x._payload),C)}if(Yi(x))return w(v,h,x,C);if(Li(x))return y(v,h,x,C);sl(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,h!==null&&h.tag===6?(n(v,h.sibling),h=i(h,x),h.return=v,v=h):(n(v,h),h=Va(x,v.mode,C),h.return=v,v=h),l(v)):n(v,h)}return S}var gi=jg(!0),Pg=jg(!1),as=rr(null),us=null,Xr=null,cd=null;function dd(){cd=Xr=us=null}function fd(e){var t=as.current;je(as),e._currentValue=t}function Wu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ii(e,t){us=e,cd=Xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ct=!0),e.firstContext=null)}function Ot(e){var t=e._currentValue;if(cd!==e)if(e={context:e,memoizedValue:t,next:null},Xr===null){if(us===null)throw Error(F(308));Xr=e,us.dependencies={lanes:0,firstContext:e}}else Xr=Xr.next=e;return t}var hr=null;function pd(e){hr===null?hr=[e]:hr.push(e)}function Tg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,pd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Mn=!1;function md(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _g(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 wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,pd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function jl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zc(e,n)}}function ap(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 cs(e,t,n,r){var i=e.updateQueue;Mn=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,f=u=a=null,s=o;do{var p=s.lane,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,y=s;switch(p=t,m=n,y.tag){case 1:if(w=y.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=y.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Re({},d,p);break e;case 2:Mn=!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?(u=f=m,a=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&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);br|=l,e.lanes=l,e.memoizedState=d}}function up(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=za.transition;za.transition={};try{e(!1),t()}finally{we=n,za.transition=r}}function Gg(){return Lt().memoizedState}function jS(e,t,n){var r=Gn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qg(e))Yg(t,n);else if(n=Tg(e,t,n,r),n!==null){var i=it();Gt(n,e,r,i),Xg(n,t,r)}}function PS(e,t,n){var r=Gn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qg(e))Yg(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 a=t.interleaved;a===null?(i.next=i,pd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Tg(e,t,i,r),n!==null&&(i=it(),Gt(n,e,r,i),Xg(n,t,r))}}function Qg(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Yg(e,t){io=fs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zc(e,n)}}var ps={readContext:Ot,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},TS={readContext:Ot,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:dp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Tl(4194308,4,Ug.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tl(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=jS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:cp,useDebugValue:kd,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=cp(!1),t=e[0];return e=ES.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_e,i=nn();if(Pe){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),He===null)throw Error(F(349));Cr&30||Mg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,dp(Lg.bind(null,r,o,e),[e]),r.flags|=2048,jo(9,Og.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=nn(),t=He.identifierPrefix;if(Pe){var n=xn,r=vn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=No++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[on]=t,e[ko]=r,ly(e,t,!1,!1),t.stateNode=e;e:{switch(l=ju(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;ixi&&(t.flags|=128,r=!0,Ui(o,!1),t.lanes=4194304)}else{if(!r)if(e=ds(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ui(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Pe)return Ye(t),null}else 2*Oe()-o.renderingStartTime>xi&&n!==1073741824&&(t.flags|=128,r=!0,Ui(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=Oe(),t.sibling=null,n=Te.current,Ce(Te,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return Pd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xt&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function DS(e,t){switch(ad(t),t.tag){case 1:return ft(t.type)&&is(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yi(),je(dt),je(Ze),yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gd(t),null;case 13:if(je(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Te),null;case 4:return yi(),null;case 10:return fd(t.type._context),null;case 22:case 23:return Pd(),null;case 24:return null;default:return null}}var ul=!1,Xe=!1,zS=typeof WeakSet=="function"?WeakSet:Set,K=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(e,t,r)}else n.current=null}function ec(e,t,n){try{n()}catch(r){Ae(e,t,r)}}var kp=!1;function FS(e,t){if(Du=es,e=pg(),ld(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,f=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++u===i&&(s=l),p===o&&++f===r&&(a=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(zu={focusedElem:e,selectionRange:n},es=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,S=w.memoizedState,v=t.stateNode,h=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ut(t.type,y),S);v.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(C){Ae(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=kp,kp=!1,w}function oo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&ec(t,n,o)}i=i.next}while(i!==r)}}function Vs(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 tc(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 uy(e){var t=e.alternate;t!==null&&(e.alternate=null,uy(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[$u],delete t[SS],delete t[kS])),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 cy(e){return e.tag===5||e.tag===3||e.tag===4}function Cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cy(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 nc(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=rs));else if(r!==4&&(e=e.child,e!==null))for(nc(e,t,n),e=e.sibling;e!==null;)nc(e,t,n),e=e.sibling}function rc(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(rc(e,t,n),e=e.sibling;e!==null;)rc(e,t,n),e=e.sibling}var We=null,Ht=!1;function Tn(e,t,n){for(n=n.child;n!==null;)dy(e,t,n),n=n.sibling}function dy(e,t,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Os,n)}catch{}switch(n.tag){case 5:Xe||qr(n,t);case 6:var r=We,i=Ht;We=null,Tn(e,t,n),We=r,Ht=i,We!==null&&(Ht?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Ht?(e=We,n=n.stateNode,e.nodeType===8?Oa(e.parentNode,n):e.nodeType===1&&Oa(e,n),yo(e)):Oa(We,n.stateNode));break;case 4:r=We,i=Ht,We=n.stateNode.containerInfo,Ht=!0,Tn(e,t,n),We=r,Ht=i;break;case 0:case 11:case 14:case 15:if(!Xe&&(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)&&ec(n,t,l),i=i.next}while(i!==r)}Tn(e,t,n);break;case 1:if(!Xe&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ae(n,t,s)}Tn(e,t,n);break;case 21:Tn(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,Tn(e,t,n),Xe=r):Tn(e,t,n);break;default:Tn(e,t,n)}}function bp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zS),t.forEach(function(r){var i=QS.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=Oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$S(r/1960))-r,10e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,gs=0,fe&6)throw Error(F(331));var i=fe;for(fe|=4,K=e.current;K!==null;){var o=K,l=o.child;if(K.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aOe()-Ed?vr(e,0):Nd|=n),pt(e,t)}function xy(e,t){t===0&&(e.mode&1?(t=el,el<<=1,!(el&130023424)&&(el=4194304)):t=1);var n=it();e=Cn(e,t),e!==null&&(Oo(e,t,n),pt(e,n))}function GS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xy(e,n)}function QS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),xy(e,n)}var wy;wy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ct=!1,OS(e,t,n);ct=!!(e.flags&131072)}else ct=!1,Pe&&t.flags&1048576&&bg(t,ss,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_l(e,t),e=t.pendingProps;var i=mi(t,Ze.current);ii(t,n),i=xd(null,t,r,e,i,n);var o=wd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ft(r)?(o=!0,os(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,md(t),i.updater=Us,t.stateNode=i,i._reactInternals=t,Gu(t,r,e,n),t=Xu(null,t,r,!0,o,n)):(t.tag=0,Pe&&o&&sd(t),rt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_l(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=XS(r),e=Ut(r,e),i){case 0:t=Yu(null,t,r,e,n);break e;case 1:t=xp(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),Yu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),xp(e,t,r,i,n);case 3:e:{if(ry(t),e===null)throw Error(F(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_g(e,t),cs(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=wp(e,t,r,n,i);break e}else if(r!==i){i=vi(Error(F(424)),t),t=wp(e,t,r,n,i);break e}else for(St=Hn(t.stateNode.containerInfo.firstChild),Ct=t,Pe=!0,Wt=null,n=Pg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(hi(),r===i){t=bn(e,t,n);break e}rt(e,t,r,n)}t=t.child}return t;case 5:return Rg(t),e===null&&Hu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Fu(r,i)?l=null:o!==null&&Fu(r,o)&&(t.flags|=32),ny(e,t),rt(e,t,l,n),t.child;case 6:return e===null&&Hu(t),null;case 13:return iy(e,t,n);case 4:return hd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gi(t,null,r,n):rt(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 rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,Ce(as,r._currentValue),r._currentValue=l,o!==null)if(Qt(o.value,l)){if(o.children===i.children&&!dt.current){t=bn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=wn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Wu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(F(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Wu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}rt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ii(t,n),i=Ot(i),r=r(i),t.flags|=1,rt(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 ey(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),_l(e,t),t.tag=1,ft(r)?(e=!0,os(t)):e=!1,ii(t,n),qg(t,r,i),Gu(t,r,i,n),Xu(null,t,r,!0,e,n);case 19:return oy(e,t,n);case 22:return ty(e,t,n)}throw Error(F(156,t.tag))};function Sy(e,t){return Qh(e,t)}function YS(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 Rt(e,t,n,r){return new YS(e,t,n,r)}function _d(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XS(e){if(typeof e=="function")return _d(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yc)return 11;if(e===Xc)return 14}return 2}function Qn(e,t){var n=e.alternate;return n===null?(n=Rt(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 Il(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")_d(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Ur:return xr(n.children,i,o,t);case Qc:l=8,i|=8;break;case yu:return e=Rt(12,n,t,i|2),e.elementType=yu,e.lanes=o,e;case vu:return e=Rt(13,n,t,i),e.elementType=vu,e.lanes=o,e;case xu:return e=Rt(19,n,t,i),e.elementType=xu,e.lanes=o,e;case Rh:return Ws(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Th:l=10;break e;case _h:l=9;break e;case Yc:l=11;break e;case Xc:l=14;break e;case In:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Rt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function xr(e,t,n,r){return e=Rt(7,e,r,t),e.lanes=n,e}function Ws(e,t,n,r){return e=Rt(22,e,r,t),e.elementType=Rh,e.lanes=n,e.stateNode={isHidden:!1},e}function Va(e,t,n){return e=Rt(6,e,null,t),e.lanes=n,e}function Ha(e,t,n){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qS(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=ba(0),this.expirationTimes=ba(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ba(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rd(e,t,n,r,i,o,l,s,a){return e=new qS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Rt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},md(o),e}function JS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ny)}catch(e){console.error(e)}}Ny(),Nh.exports=Et;var ji=Nh.exports;const rk=Is(ji);var Ap=ji;hu.createRoot=Ap.createRoot,hu.hydrateRoot=Ap.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 To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ey(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ok(){return Math.random().toString(36).substr(2,8)}function Mp(e,t){return{usr:e.state,key:e.key,idx:t}}function ac(e,t,n,r){return n===void 0&&(n=null),To({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pi(t):t,{state:n,key:t&&t.key||r||ok()})}function xs(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 lk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Fn.Pop,a=null,u=f();u==null&&(u=0,l.replaceState(To({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Fn.Pop;let S=f(),v=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:v})}function p(S,v){s=Fn.Push;let h=ac(y.location,S,v);n&&n(h,S),u=f()+1;let x=Mp(h,u),C=y.createHref(h);try{l.pushState(x,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(C)}o&&a&&a({action:s,location:y.location,delta:1})}function m(S,v){s=Fn.Replace;let h=ac(y.location,S,v);n&&n(h,S),u=f();let x=Mp(h,u),C=y.createHref(h);l.replaceState(x,"",C),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let v=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:xs(S);return h=h.replace(/ $/,"%20"),Fe(v,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,v)}let y={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(Ip,d),a=S,()=>{i.removeEventListener(Ip,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let v=w(S);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(S){return l.go(S)}};return y}var Op;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Op||(Op={}));function sk(e,t,n){return n===void 0&&(n="/"),ak(e,t,n,!1)}function ak(e,t,n,r){let i=typeof t=="string"?Pi(t):t,o=Od(i.pathname||"/",n);if(o==null)return null;let l=jy(e);uk(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Fe(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Yn([r,a.relativePath]),f=n.concat(a);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 "'+u+'".')),jy(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:gk(u,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Py(o.path))i(o,l,a)}),t}function Py(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=Py(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function uk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:yk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ck=/^:[\w-]+$/,dk=3,fk=2,pk=1,mk=10,hk=-2,Lp=e=>e==="*";function gk(e,t){let n=e.split("/"),r=n.length;return n.some(Lp)&&(r+=hk),t&&(r+=fk),n.filter(i=>!Lp(i)).reduce((i,o)=>i+(ck.test(o)?dk:o===""?pk:mk),r)}function yk(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 vk(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 y=s[d]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[d];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function xk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ey(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function wk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ey(!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 Sk(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:kk(n,t):t,search:Nk(r),hash:Ek(i)}}function kk(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 Wa(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 Ck(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ty(e,t){let n=Ck(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function _y(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pi(e):(i=To({},e),Fe(!i.pathname||!i.pathname.includes("?"),Wa("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),Wa("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),Wa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=Sk(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Yn=e=>e.join("/").replace(/\/\/+/g,"/"),bk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ek=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function jk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ry=["post","put","patch","delete"];new Set(Ry);const Pk=["get",...Ry];new Set(Pk);/** + * 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 _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=_y(u,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Yn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Ak=g.createContext(null);function Ik(e){let t=g.useContext(or).outlet;return t&&g.createElement(Ak.Provider,{value:e},t)}function My(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Ar),{matches:i}=g.useContext(or),{pathname:o}=Bo(),l=JSON.stringify(Ty(i,r.v7_relativeSplatPath));return g.useMemo(()=>_y(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Mk(e,t){return Ok(e,t)}function Ok(e,t,n,r){Fo()||Fe(!1);let{navigator:i}=g.useContext(Ar),{matches:o}=g.useContext(or),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Bo(),f;if(t){var d;let S=typeof t=="string"?Pi(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Fe(!1),f=S}else f=u;let p=f.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=sk(e,{pathname:m}),y=Bk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Yn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Yn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?g.createElement(Xs.Provider,{value:{location:_o({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Fn.Pop}},y):y}function Lk(){let e=Hk(),t=jk(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 Dk=g.createElement(Lk,null);class zk extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(or.Provider,{value:this.props.routeContext},g.createElement(Ay.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fk(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Ld);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(or.Provider,{value:t},r)}function Bk(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 a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,w=!1,y=null,S=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||Dk,a&&(u<0&&p===0?(Kk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,p+1)),h=()=>{let x;return m?x=y:w?x=S:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,g.createElement(Fk,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(zk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):h()},null)}var Oy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Oy||{}),ws=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}(ws||{});function $k(e){let t=g.useContext(Ld);return t||Fe(!1),t}function Uk(e){let t=g.useContext(Tk);return t||Fe(!1),t}function Vk(e){let t=g.useContext(or);return t||Fe(!1),t}function Ly(e){let t=Vk(),n=t.matches[t.matches.length-1];return n.route.id||Fe(!1),n.route.id}function Hk(){var e;let t=g.useContext(Ay),n=Uk(ws.UseRouteError),r=Ly(ws.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Wk(){let{router:e}=$k(Oy.UseNavigateStable),t=Ly(ws.UseNavigateStable),n=g.useRef(!1);return Iy(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_o({fromRouteId:t},o)))},[e,t])}const zp={};function Kk(e,t,n){!t&&!zp[e]&&(zp[e]=!0)}function Gk(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 Qk(e){return Ik(e.context)}function Br(e){Fe(!1)}function Yk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Fn.Pop,navigator:o,static:l=!1,future:s}=e;Fo()&&Fe(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:o,static:l,future:_o({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Pi(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,y=g.useMemo(()=>{let S=Od(f,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:w},navigationType:i}},[a,f,d,p,m,w,i]);return y==null?null:g.createElement(Ar.Provider,{value:u},g.createElement(Xs.Provider,{children:n,value:y}))}function Xk(e){let{children:t,location:n}=e;return Mk(uc(t),n)}new Promise(()=>{});function uc(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,uc(r.props.children,o));return}r.type!==Br&&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=uc(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 cc(){return cc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Jk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zk(e,t){return e.button===0&&(!t||t==="_self")&&!Jk(e)}const eC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tC="6";try{window.__reactRouterVersion=tC}catch{}const nC="startTransition",Fp=Hc[nC];function rC(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=ik({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=g.useCallback(d=>{u&&Fp?Fp(()=>a(d)):a(d)},[a,u]);return g.useLayoutEffect(()=>l.listen(f),[l,f]),g.useEffect(()=>Gk(r),[r]),g.createElement(Yk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const iC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lC=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:f,viewTransition:d}=t,p=qk(t,eC),{basename:m}=g.useContext(Ar),w,y=!1;if(typeof u=="string"&&oC.test(u)&&(w=u,iC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=Od(C.pathname,m);C.origin===x.origin&&E!=null?u=E+C.search+C.hash:y=!0}catch{}let S=_k(u,{relative:i}),v=sC(u,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function h(x){r&&r(x),x.defaultPrevented||v(x)}return g.createElement("a",cc({},p,{href:w||S,onClick:y||o?r:h,ref:n,target:a}))});var Bp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Bp||(Bp={}));var $p;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($p||($p={}));function sC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Dd(),u=Bo(),f=My(e,{relative:l});return g.useCallback(d=>{if(Zk(d,n)){d.preventDefault();let p=r!==void 0?r:xs(u)===xs(f);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,f,r,i,n,e,o,l,s])}function Dy(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 $y="!";function hC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,f,d=0;du?f-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function gC(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 yC(e){return{cache:mC(e.cacheSize),splitModifiers:hC(e),...uC(e)}}var vC=/\s+/;function xC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(vC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?f.substring(0,d):f),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=gC(a).join(":"),y=u?w+$y:w;return{isTailwindClass:!0,modifierId:y,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,f=s+a;return o.has(f)?!1:(o.add(f),i(a,u).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function wC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),DC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Wp=e=>{const t=DC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),zC=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 FC={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 BC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...FC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hy("lucide",i),...!o&&!zC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,f])=>g.createElement(u,f)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const te=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(BC,{ref:o,iconNode:t,className:Hy(`lucide-${LC(Wp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Wp(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 $C=[["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"}]],UC=te("award",$C);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["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"}]],qs=te("book-open",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HC=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],WC=te("bookmark",HC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KC=[["path",{d:"M12 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"}]],Zr=te("bot",KC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["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"}]],wi=te("brain",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],YC=te("check",QC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Wy=te("chevron-down",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Kp=te("chevron-left",qC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gp=te("chevron-right",JC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eb=te("chevron-up",ZC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],nb=te("circle-check-big",tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ss=te("cloud",rb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["path",{d:"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"}]],Ky=te("crown",ib);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ob=[["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"}]],lb=te("download",ob);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["path",{d:"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"}]],ab=te("eye",sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["path",{d:"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"}]],cb=te("file",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const db=[["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"}]],Gy=te("hard-drive",db);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fb=[["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"}]],pb=te("heart",fb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],hb=te("house",mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Qy=te("info",gb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pc=te("loader-circle",yb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vb=[["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"}]],Js=te("message-square",vb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ks=te("plus",xb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=[["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"}]],Yy=te("save",wb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Qp=te("search",Sb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kb=[["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"}]],Cb=te("send",kb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Nb=te("server",bb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eb=[["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"}]],li=te("settings",Eb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["path",{d:"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"}]],Yp=te("shield",jb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pb=[["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"}]],Tb=te("sliders-vertical",Pb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _b=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Rb=te("square",_b);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["path",{d:"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"}]],Ib=te("star",Ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mb=[["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"}]],Xy=te("trash-2",Mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ob=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],qy=te("trending-up",Ob);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["path",{d:"M12 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"}]],Db=te("upload",Lb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zb=[["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"}]],Fd=te("user",zb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fb=[["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"}]],Bb=te("users",Fb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jy=te("x",$b);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ub=[["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"}]],mc=te("zap",Ub),Vb=[{name:"Templates",href:"/",icon:hb,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:Js,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:qs,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:li,description:"Application settings"}];function Hb(){const e=Bo();return c.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[c.jsx("div",{className:"p-6 border-b",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:c.jsx(wi,{className:"h-5 w-5 text-primary-foreground"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),c.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),c.jsx("nav",{className:"space-y-1",children:Vb.map(t=>{const n=e.pathname===t.href;return c.jsxs(lC,{to:t.href,className:ue("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[c.jsx(t.icon,{className:"h-4 w-4"}),c.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Wb(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(Hb,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(Qk,{})})]})}const Xp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qp=zy,Bd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],d=o==null?void 0:o[u];if(f===null)return null;const p=Xp(f)||Xp(d);return i[u][p]}),s=n&&Object.entries(n).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...u,d,p]:u},[]);return qp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Kb=Bd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function xe({className:e,variant:t,...n}){return c.jsx("div",{className:ue(Kb({variant:t}),e),...n})}function Jp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zy(...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),a=s.find(Xb);if(a){const u=a.props.children,f=s.map(d=>d===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...l,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,f):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Gb=Si("Slot");function Qb(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=Jb(i),s=qb(o,i.props);return i.type!==g.Fragment&&(s.ref=r?Zy(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 ev=Symbol("radix.slottable");function Yb(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ev,t}function Xb(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ev}function qb(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Jb(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 $d=Bd("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Me=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Gb:"button";return c.jsx(l,{className:ue($d({variant:t,size:n,className:e})),ref:o,...i})});Me.displayName="Button";const Je=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Je.displayName="Card";const It=g.forwardRef(({className:e,...t},n)=>c.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)=>c.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mt.displayName="CardTitle";const Zb=g.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Zb.displayName="CardDescription";const mt=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));mt.displayName="CardContent";const eN=g.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));eN.displayName="CardFooter";const tv=g.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));tv.displayName="Input";function tN(){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 nN(){const e=Dd(),[t,n]=g.useState(!1),[r]=g.useState(tN()),[i,o]=g.useState([]),[l,s]=g.useState(""),[a,u]=g.useState("All");g.useEffect(()=>{f(),d()},[]);const f=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,x=await fetch(`${h}/models`);n(x.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 x=i.includes(h)?i.filter(C=>C!==h):[...i,h];o(x),localStorage.setItem("likedTemplates",JSON.stringify(x))},m=h=>{const x={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),e("/playground")},w=r.filter(h=>{const x=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(E=>E.toLowerCase().includes(l.toLowerCase())),C=a==="All"||h.category===a;return x&&C}),y=w.filter(h=>h.isOfficial),S=[...w].sort((h,x)=>x.usageCount-h.usageCount).slice(0,6),v=["All",...Array.from(new Set(r.map(h=>h.category)))];return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(wi,{className:"h-5 w-5 text-white"})}),c.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),c.jsx(xe,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),c.jsxs(Me,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[c.jsx(Zr,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),c.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),c.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."}),c.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[c.jsx(Qp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),c.jsx(tv,{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"})]}),c.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:v.map(h=>c.jsx(Me,{variant:a===h?"default":"outline",size:"sm",onClick:()=>u(h),className:"rounded-full",children:h},h))})]}),a==="All"&&y.length>0&&c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(Ky,{className:"h-5 w-5 text-yellow-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),c.jsx(xe,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:y.slice(0,3).map(h=>c.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),a==="All"&&c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(qy,{className:"h-5 w-5 text-green-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),c.jsx(xe,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>c.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(Bb,{className:"h-5 w-5 text-blue-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),c.jsxs(xe,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>c.jsx(Ka,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):c.jsx(Je,{className:"p-12 text-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsx(Qp,{className:"h-12 w-12 text-gray-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),c.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),c.jsx(Me,{variant:"outline",onClick:()=>{s(""),u("All")},children:"Clear filters"})]})})]})]})]})}function Ka({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return c.jsxs(Je,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&c.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:[c.jsx(Ky,{className:"h-3 w-3"}),"Featured"]}),o&&c.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:[c.jsx(qy,{className:"h-3 w-3"}),"Trending"]}),c.jsx(It,{className:"pb-4",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.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}),c.jsxs("div",{children:[c.jsx(Mt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&c.jsxs(xe,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[c.jsx(UC,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),c.jsx(Me,{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:c.jsx(pb,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),c.jsxs(mt,{className:"space-y-4",children:[c.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>c.jsx(xe,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),c.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(ab,{className:"h-4 w-4"}),c.jsx("span",{children:e.usageCount.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Ib,{className:"h-4 w-4 text-yellow-500 fill-current"}),c.jsx("span",{children:e.rating})]})]}),c.jsx(xe,{variant:"outline",className:"text-xs",children:e.category})]}),c.jsx("div",{className:"pt-2",children:c.jsxs(Me,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[c.jsx(Js,{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 rN(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,a=g.useMemo(()=>s,Object.values(s));return c.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function lr(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=d=>{var v;const{scope:p,children:m,...w}=d,y=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,S=g.useMemo(()=>w,Object.values(w));return c.jsx(y.Provider,{value:S,children:m})};u.displayName=o+"Provider";function f(d,p){var y;const m=((y=p==null?void 0:p[e])==null?void 0:y[a])||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[u,f]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,iN(i,...t)]}function iN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Ud(e){const t=e+"CollectionProvider",[n,r]=lr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:v}=y,h=Vt.useRef(null),x=Vt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:x,collectionRef:h,children:v})};l.displayName=t;const s=e+"CollectionSlot",a=Si(s),u=Vt.forwardRef((y,S)=>{const{scope:v,children:h}=y,x=o(s,v),C=ye(S,x.collectionRef);return c.jsx(a,{ref:C,children:h})});u.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Si(f),m=Vt.forwardRef((y,S)=>{const{scope:v,children:h,...x}=y,C=Vt.useRef(null),E=ye(S,C),N=o(f,v);return Vt.useEffect(()=>(N.itemMap.set(C,{ref:C,...x}),()=>void N.itemMap.delete(C))),c.jsx(p,{[d]:"",ref:E,children:h})});m.displayName=f;function w(y){const S=o(e+"CollectionConsumer",y);return Vt.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const x=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((N,j)=>x.indexOf(N.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},w,r]}var et=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},oN=Hc[" useId ".trim().toString()]||(()=>{}),lN=0;function Xn(e){const[t,n]=g.useState(oN());return et(()=>{e||n(r=>r??String(lN++))},[e]),e||(t?`radix-${t}`:"")}var sN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=sN.reduce((e,t)=>{const n=Si(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function aN(e,t){e&&ji.flushSync(()=>e.dispatchEvent(t))}function Zn(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 uN=Hc[" useInsertionEffect ".trim().toString()]||et;function ki({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=cN({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const d=f.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const u=g.useCallback(f=>{var d;if(s){const p=dN(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[s,e,o,l]);return[a,u]}function cN({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return uN(()=>{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 dN(e){return typeof e=="function"}var fN=g.createContext(void 0);function Zs(e){const t=g.useContext(fN);return e||t||"ltr"}var Ga="rovingFocusGroup.onEntryFocus",pN={bubbles:!1,cancelable:!0},$o="RovingFocusGroup",[hc,nv,mN]=Ud($o),[hN,rv]=lr($o,[mN]),[gN,yN]=hN($o),iv=g.forwardRef((e,t)=>c.jsx(hc.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(hc.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(vN,{...e,ref:t})})}));iv.displayName=$o;var vN=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=g.useRef(null),m=ye(t,p),w=Zs(o),[y,S]=ki({prop:l,defaultProp:s??null,onChange:a,caller:$o}),[v,h]=g.useState(!1),x=Zn(u),C=nv(n),E=g.useRef(!1),[N,j]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Ga,x),()=>T.removeEventListener(Ga,x)},[x]),c.jsx(gN,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:y,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>j(T=>T-1),[]),children:c.jsx(oe.div,{tabIndex:v||N===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{E.current=!0}),onFocus:Z(e.onFocus,T=>{const L=!E.current;if(T.target===T.currentTarget&&L&&!v){const M=new CustomEvent(Ga,pN);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=C().filter(O=>O.focusable),_=A.find(O=>O.active),H=A.find(O=>O.id===y),I=[_,H,...A].filter(Boolean).map(O=>O.ref.current);sv(I,f)}}E.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),ov="RovingFocusGroupItem",lv=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=Xn(),u=o||a,f=yN(ov,n),d=f.currentTabStopId===u,p=nv(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:y}=f;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),c.jsx(hc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(oe.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?f.onItemFocus(u):S.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=SN(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=f.loop?kN(x,C+1):x.slice(C+1)}setTimeout(()=>sv(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});lv.displayName=ov;var xN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function SN(e,t,n){const r=wN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xN[r]}function sv(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function kN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var CN=iv,bN=lv;function NN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Uo=e=>{const{present:t,children:n}=e,r=EN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ye(r.ref,jN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Uo.displayName="Presence";function EN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=NN(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=pl(r.current);o.current=s==="mounted"?u:"none"},[s]),et(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,m=pl(u);e?a("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),et(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const y=pl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=pl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function pl(e){return(e==null?void 0:e.animationName)||"none"}function jN(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 ea="Tabs",[PN,NI]=lr(ea,[rv]),av=rv(),[TN,Vd]=PN(ea),uv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,f=Zs(s),[d,p]=ki({prop:r,onChange:i,defaultProp:o??"",caller:ea});return c.jsx(TN,{scope:n,baseId:Xn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:a,children:c.jsx(oe.div,{dir:f,"data-orientation":l,...u,ref:t})})});uv.displayName=ea;var cv="TabsList",dv=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Vd(cv,n),l=av(n);return c.jsx(CN,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(oe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});dv.displayName=cv;var fv="TabsTrigger",pv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Vd(fv,n),s=av(n),a=gv(l.baseId,r),u=yv(l.baseId,r),f=r===l.value;return c.jsx(bN,{asChild:!0,...s,focusable:!i,active:f,children:c.jsx(oe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:Z(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:Z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});pv.displayName=fv;var mv="TabsContent",hv=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Vd(mv,n),a=gv(s.baseId,r),u=yv(s.baseId,r),f=r===s.value,d=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(Uo,{present:i||f,children:({present:p})=>c.jsx(oe.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});hv.displayName=mv;function gv(e,t){return`${e}-trigger-${t}`}function yv(e,t){return`${e}-content-${t}`}var _N=uv,vv=dv,xv=pv,wv=hv;const RN=_N,Sv=g.forwardRef(({className:e,...t},n)=>c.jsx(vv,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Sv.displayName=vv.displayName;const Ml=g.forwardRef(({className:e,...t},n)=>c.jsx(xv,{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}));Ml.displayName=xv.displayName;const Ol=g.forwardRef(({className:e,...t},n)=>c.jsx(wv,{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=wv.displayName;var AN="Label",kv=g.forwardRef((e,t)=>c.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())}}));kv.displayName=AN;var Cv=kv;const IN=Bd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),qe=g.forwardRef(({className:e,...t},n)=>c.jsx(Cv,{ref:n,className:ue(IN(),e),...t}));qe.displayName=Cv.displayName;function MN(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(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 ON="DismissableLayer",gc="dismissableLayer.update",LN="dismissableLayer.pointerDownOutside",DN="dismissableLayer.focusOutside",Zp,bv=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(bv),[f,d]=g.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=ye(t,j=>d(j)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(S),h=f?y.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=v,E=BN(j=>{const T=j.target,L=[...u.branches].some(M=>M.contains(T));!C||L||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=$N(j=>{const T=j.target;[...u.branches].some(M=>M.contains(T))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return MN(j=>{h===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),g.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),em(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zp)}},[f,p,n,u]),g.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),em())},[f,u]),g.useEffect(()=>{const j=()=>m({});return document.addEventListener(gc,j),()=>document.removeEventListener(gc,j)},[]),c.jsx(oe.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,E.onPointerDownCapture)})});Hd.displayName=ON;var zN="DismissableLayerBranch",FN=g.forwardRef((e,t)=>{const n=g.useContext(bv),r=g.useRef(null),i=ye(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(oe.div,{...e,ref:i})});FN.displayName=zN;function BN(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Nv(LN,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $N(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Nv(DN,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 em(){const e=new CustomEvent(gc);document.dispatchEvent(e)}function Nv(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?aN(i,o):i.dispatchEvent(o)}var Qa="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",tm={bubbles:!1,cancelable:!0},UN="FocusScope",Wd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=g.useState(null),u=Zn(i),f=Zn(o),d=g.useRef(null),p=ye(t,y=>a(y)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:An(d.current,{select:!0})},S=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||An(d.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&An(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const h=new MutationObserver(v);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),h.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){rm.add(m);const y=document.activeElement;if(!s.contains(y)){const v=new CustomEvent(Qa,tm);s.addEventListener(Qa,u),s.dispatchEvent(v),v.defaultPrevented||(VN(QN(Ev(s)),{select:!0}),document.activeElement===y&&An(s))}return()=>{s.removeEventListener(Qa,u),setTimeout(()=>{const v=new CustomEvent(Ya,tm);s.addEventListener(Ya,f),s.dispatchEvent(v),v.defaultPrevented||An(y??document.body,{select:!0}),s.removeEventListener(Ya,f),rm.remove(m)},0)}}},[s,u,f,m]);const w=g.useCallback(y=>{if(!n&&!r||m.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(S&&v){const h=y.currentTarget,[x,C]=HN(h);x&&C?!y.shiftKey&&v===C?(y.preventDefault(),n&&An(x,{select:!0})):y.shiftKey&&v===x&&(y.preventDefault(),n&&An(C,{select:!0})):v===h&&y.preventDefault()}},[n,r,m.paused]);return c.jsx(oe.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Wd.displayName=UN;function VN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(An(r,{select:t}),document.activeElement!==n)return}function HN(e){const t=Ev(e),n=nm(t,e),r=nm(t.reverse(),e);return[n,r]}function Ev(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 nm(e,t){for(const n of e)if(!WN(n,{upTo:t}))return n}function WN(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 KN(e){return e instanceof HTMLInputElement&&"select"in e}function An(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KN(e)&&t&&e.select()}}var rm=GN();function GN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=im(e,t),e.unshift(t)},remove(t){var n;e=im(e,t),(n=e[0])==null||n.resume()}}}function im(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function QN(e){return e.filter(t=>t.tagName!=="A")}var YN="Portal",Kd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);et(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?rk.createPortal(c.jsx(oe.div,{...r,ref:t}),l):null});Kd.displayName=YN;var Xa=0;function jv(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??om()),document.body.insertAdjacentElement("beforeend",e[1]??om()),Xa++,()=>{Xa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xa--}},[])}function om(){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 fE;var t=pE(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])}},hE=Rv(),si="data-scroll-locked",gE=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(qN,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(si,`] { + 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(Ll,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Dl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Ll," .").concat(Ll,` { + right: 0 `).concat(r,`; + } + + .`).concat(Dl," .").concat(Dl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(si,`] { + `).concat(JN,": ").concat(s,`px; + } +`)},am=function(){var e=parseInt(document.body.getAttribute(si)||"0",10);return isFinite(e)?e:0},yE=function(){g.useEffect(function(){return document.body.setAttribute(si,(am()+1).toString()),function(){var e=am()-1;e<=0?document.body.removeAttribute(si):document.body.setAttribute(si,e.toString())}},[])},vE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;yE();var o=g.useMemo(function(){return mE(i)},[i]);return g.createElement(hE,{styles:gE(o,!t,i,n?"":"!important")})},yc=!1;if(typeof window<"u")try{var ml=Object.defineProperty({},"passive",{get:function(){return yc=!0,!0}});window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{yc=!1}var Lr=yc?{passive:!1}:!1,xE=function(e){return e.tagName==="TEXTAREA"},Av=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xE(e)&&n[t]==="visible")},wE=function(e){return Av(e,"overflowY")},SE=function(e){return Av(e,"overflowX")},um=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Iv(e,r);if(i){var o=Mv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},CE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Iv=function(e,t){return e==="v"?wE(t):SE(t)},Mv=function(e,t){return e==="v"?kE(t):CE(t)},bE=function(e,t){return e==="h"&&t==="rtl"?-1:1},NE=function(e,t,n,r,i){var o=bE(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,f=l>0,d=0,p=0;do{if(!s)break;var m=Mv(e,s),w=m[0],y=m[1],S=m[2],v=y-S-o*w;(w||v)&&Iv(e,s)&&(d+=v,p+=w);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(p)<1||!i&&-l>p))&&(u=!0),u},hl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cm=function(e){return[e.deltaX,e.deltaY]},dm=function(e){return e&&"current"in e?e.current:e},EE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jE=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},PE=0,Dr=[];function TE(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(PE++)[0],o=g.useState(Rv)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=XN([e.lockRef.current],(e.shards||[]).map(dm),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var v=hl(y),h=n.current,x="deltaX"in y?y.deltaX:h[0]-v[0],C="deltaY"in y?y.deltaY:h[1]-v[1],E,N=y.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in y&&j==="h"&&N.type==="range")return!1;var T=um(j,N);if(!T)return!0;if(T?E=j:(E=j==="v"?"h":"v",T=um(j,N)),!T)return!1;if(!r.current&&"changedTouches"in y&&(x||C)&&(r.current=E),!E)return!0;var L=r.current||E;return NE(L,S,y,L==="h"?x:C,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Dr.length||Dr[Dr.length-1]!==o)){var v="deltaY"in S?cm(S):hl(S),h=t.current.filter(function(E){return E.name===S.type&&(E.target===S.target||S.target===E.shadowParent)&&EE(E.delta,v)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var x=(l.current.shards||[]).map(dm).filter(Boolean).filter(function(E){return E.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(y,S,v,h){var x={name:y,delta:S,target:v,should:h,shadowParent:_E(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),f=g.useCallback(function(y){n.current=hl(y),r.current=void 0},[]),d=g.useCallback(function(y){u(y.type,cm(y),y.target,s(y,e.lockRef.current))},[]),p=g.useCallback(function(y){u(y.type,hl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Dr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Lr),document.addEventListener("touchmove",a,Lr),document.addEventListener("touchstart",f,Lr),function(){Dr=Dr.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Lr),document.removeEventListener("touchmove",a,Lr),document.removeEventListener("touchstart",f,Lr)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:jE(i)}):null,m?g.createElement(vE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _E(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const RE=oE(_v,TE);var Ov=g.forwardRef(function(e,t){return g.createElement(ta,ln({},e,{ref:t,sideCar:RE}))});Ov.classNames=ta.classNames;const Lv=Ov;var AE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zr=new WeakMap,gl=new WeakMap,yl={},eu=0,Dv=function(e){return e&&(e.host||Dv(e.parentNode))},IE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Dv(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})},ME=function(e,t,n,r){var i=IE(t,Array.isArray(e)?e:[e]);yl[n]||(yl[n]=new WeakMap);var o=yl[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var f=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))f(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",y=(zr.get(p)||0)+1,S=(o.get(p)||0)+1;zr.set(p,y),o.set(p,S),l.push(p),y===1&&w&&gl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),s.clear(),eu++,function(){l.forEach(function(d){var p=zr.get(d)-1,m=o.get(d)-1;zr.set(d,p),o.set(d,m),p||(gl.has(d)||d.removeAttribute(r),gl.delete(d)),m||d.removeAttribute(n)}),eu--,eu||(zr=new WeakMap,zr=new WeakMap,gl=new WeakMap,yl={})}},zv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||AE(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ME(r,i,n,"aria-hidden")):function(){return null}},na="Dialog",[Fv,Bv]=lr(na),[OE,qt]=Fv(na),$v=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,f]=ki({prop:r,defaultProp:i??!1,onChange:o,caller:na});return c.jsx(OE,{scope:t,triggerRef:s,contentRef:a,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:u,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};$v.displayName=na;var Uv="DialogTrigger",Vv=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Uv,n),o=ye(t,i.triggerRef);return c.jsx(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yd(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});Vv.displayName=Uv;var Gd="DialogPortal",[LE,Hv]=Fv(Gd,{forceMount:void 0}),Wv=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=qt(Gd,t);return c.jsx(LE,{scope:t,forceMount:n,children:g.Children.map(r,l=>c.jsx(Uo,{present:n||o.open,children:c.jsx(Kd,{asChild:!0,container:i,children:l})}))})};Wv.displayName=Gd;var Cs="DialogOverlay",Kv=g.forwardRef((e,t)=>{const n=Hv(Cs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Cs,e.__scopeDialog);return o.modal?c.jsx(Uo,{present:r||o.open,children:c.jsx(zE,{...i,ref:t})}):null});Kv.displayName=Cs;var DE=Si("DialogOverlay.RemoveScroll"),zE=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Cs,n);return c.jsx(Lv,{as:DE,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(oe.div,{"data-state":Yd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Er="DialogContent",Gv=g.forwardRef((e,t)=>{const n=Hv(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=qt(Er,e.__scopeDialog);return c.jsx(Uo,{present:r||o.open,children:o.modal?c.jsx(FE,{...i,ref:t}):c.jsx(BE,{...i,ref:t})})});Gv.displayName=Er;var FE=g.forwardRef((e,t)=>{const n=qt(Er,e.__scopeDialog),r=g.useRef(null),i=ye(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return zv(o)},[]),c.jsx(Qv,{...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())})}),BE=g.forwardRef((e,t)=>{const n=qt(Er,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return c.jsx(Qv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Qv=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=qt(Er,n),a=g.useRef(null),u=ye(t,a);return jv(),c.jsxs(c.Fragment,{children:[c.jsx(Wd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(Hd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Yd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(UE,{titleId:s.titleId}),c.jsx(HE,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Qd="DialogTitle",Yv=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Qd,n);return c.jsx(oe.h2,{id:i.titleId,...r,ref:t})});Yv.displayName=Qd;var Xv="DialogDescription",qv=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Xv,n);return c.jsx(oe.p,{id:i.descriptionId,...r,ref:t})});qv.displayName=Xv;var Jv="DialogClose",Zv=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=qt(Jv,n);return c.jsx(oe.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});Zv.displayName=Jv;function Yd(e){return e?"open":"closed"}var ex="DialogTitleWarning",[$E,tx]=rN(ex,{contentName:Er,titleName:Qd,docsSlug:"dialog"}),UE=({titleId:e})=>{const t=tx(ex),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},VE="DialogDescriptionWarning",HE=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tx(VE).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},WE=$v,KE=Vv,GE=Wv,QE=Kv,YE=Gv,XE=Yv,qE=qv,nx=Zv,rx="AlertDialog",[JE,EI]=lr(rx,[Bv]),Pn=Bv(),ix=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pn(t);return c.jsx(WE,{...r,...n,modal:!0})};ix.displayName=rx;var ZE="AlertDialogTrigger",e2=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return c.jsx(KE,{...i,...r,ref:t})});e2.displayName=ZE;var t2="AlertDialogPortal",ox=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pn(t);return c.jsx(GE,{...r,...n})};ox.displayName=t2;var n2="AlertDialogOverlay",lx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return c.jsx(QE,{...i,...r,ref:t})});lx.displayName=n2;var ai="AlertDialogContent",[r2,i2]=JE(ai),o2=Yb("AlertDialogContent"),sx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Pn(n),l=g.useRef(null),s=ye(t,l),a=g.useRef(null);return c.jsx($E,{contentName:ai,titleName:ax,docsSlug:"alert-dialog",children:c.jsx(r2,{scope:n,cancelRef:a,children:c.jsxs(YE,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=a.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(o2,{children:r}),c.jsx(s2,{contentRef:l})]})})})});sx.displayName=ai;var ax="AlertDialogTitle",ux=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return c.jsx(XE,{...i,...r,ref:t})});ux.displayName=ax;var cx="AlertDialogDescription",dx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return c.jsx(qE,{...i,...r,ref:t})});dx.displayName=cx;var l2="AlertDialogAction",fx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return c.jsx(nx,{...i,...r,ref:t})});fx.displayName=l2;var px="AlertDialogCancel",mx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=i2(px,n),o=Pn(n),l=ye(t,i);return c.jsx(nx,{...o,...r,ref:l})});mx.displayName=px;var s2=({contentRef:e})=>{const t=`\`${ai}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ai}\` by passing a \`${cx}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ai}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},a2=ix,u2=ox,hx=lx,gx=sx,yx=fx,vx=mx,xx=ux,wx=dx;const tu=a2,c2=u2,Sx=g.forwardRef(({className:e,...t},n)=>c.jsx(hx,{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}));Sx.displayName=hx.displayName;const zl=g.forwardRef(({className:e,...t},n)=>c.jsxs(c2,{children:[c.jsx(Sx,{}),c.jsx(gx,{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})]}));zl.displayName=gx.displayName;const Fl=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});Fl.displayName="AlertDialogHeader";const Bl=({className:e,...t})=>c.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Bl.displayName="AlertDialogFooter";const $l=g.forwardRef(({className:e,...t},n)=>c.jsx(xx,{ref:n,className:ue("text-lg font-semibold",e),...t}));$l.displayName=xx.displayName;const Ul=g.forwardRef(({className:e,...t},n)=>c.jsx(wx,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Ul.displayName=wx.displayName;const Vl=g.forwardRef(({className:e,...t},n)=>c.jsx(yx,{ref:n,className:ue($d(),e),...t}));Vl.displayName=yx.displayName;const Hl=g.forwardRef(({className:e,...t},n)=>c.jsx(vx,{ref:n,className:ue($d({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Hl.displayName=vx.displayName;const kx=g.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ue("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));kx.displayName="Textarea";function d2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const f2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,m2={};function fm(e,t){return((t||m2).jsx?p2:f2).test(e)}const h2=/[ \t\n\f\r]/g;function g2(e){return typeof e=="object"?e.type==="text"?pm(e.value):!1:pm(e)}function pm(e){return e.replace(h2,"")===""}class Vo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Vo.prototype.normal={};Vo.prototype.property={};Vo.prototype.space=void 0;function Cx(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Vo(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 y2=0;const J=Mr(),De=Mr(),xc=Mr(),$=Mr(),ke=Mr(),ui=Mr(),vt=Mr();function Mr(){return 2**++y2}const wc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:De,commaOrSpaceSeparated:vt,commaSeparated:ui,number:$,overloadedBoolean:xc,spaceSeparated:ke},Symbol.toStringTag,{value:"Module"})),nu=Object.keys(wc);class Xd extends gt{constructor(t,n,r,i){let o=-1;if(super(t,n),mm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&k2.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(hm,N2);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!hm.test(o)){let l=o.replace(S2,b2);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Xd}return new i(r,t)}function b2(e){return"-"+e.toLowerCase()}function N2(e){return e.charAt(1).toUpperCase()}const E2=Cx([bx,v2,jx,Px,Tx],"html"),qd=Cx([bx,x2,jx,Px,Tx],"svg");function j2(e){return e.join(" ").trim()}var Jd={},gm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,P2=/\n/g,T2=/^\s*/,_2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,R2=/^:\s*/,A2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I2=/^[;\s]*/,M2=/^\s+|\s+$/g,O2=` +`,ym="/",vm="*",pr="",L2="comment",D2="declaration",z2=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var y=w.match(P2);y&&(n+=y.length);var S=w.lastIndexOf(O2);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return i(S),e=e.slice(S.length),y}}function u(){a(T2)}function f(w){var y;for(w=w||[];y=d();)y!==!1&&w.push(y);return w}function d(){var w=o();if(!(ym!=e.charAt(0)||vm!=e.charAt(1))){for(var y=2;pr!=e.charAt(y)&&(vm!=e.charAt(y)||ym!=e.charAt(y+1));)++y;if(y+=2,pr===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,i(S),e=e.slice(y),r+=2,w({type:L2,comment:S})}}function p(){var w=o(),y=a(_2);if(y){if(d(),!a(R2))return s("property missing ':'");var S=a(A2),v=w({type:D2,property:xm(y[0].replace(gm,pr)),value:S?xm(S[0].replace(gm,pr)):pr});return a(I2),v}}function m(){var w=[];f(w);for(var y;y=p();)y!==!1&&(w.push(y),f(w));return w}return u(),m()};function xm(e){return e?e.replace(M2,pr):pr}var F2=Ql&&Ql.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jd,"__esModule",{value:!0});Jd.default=$2;var B2=F2(z2);function $2(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,B2.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 ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.camelCase=void 0;var U2=/^--[a-zA-Z0-9_-]+$/,V2=/-([a-z])/g,H2=/^[^-]+$/,W2=/^-(webkit|moz|ms|o|khtml)-/,K2=/^-(ms)-/,G2=function(e){return!e||H2.test(e)||U2.test(e)},Q2=function(e,t){return t.toUpperCase()},wm=function(e,t){return"".concat(t,"-")},Y2=function(e,t){return t===void 0&&(t={}),G2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(K2,wm):e=e.replace(W2,wm),e.replace(V2,Q2))};ra.camelCase=Y2;var X2=Ql&&Ql.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},q2=X2(Jd),J2=ra;function Sc(e,t){var n={};return!e||typeof e!="string"||(0,q2.default)(e,function(r,i){r&&i&&(n[(0,J2.camelCase)(r,t)]=i)}),n}Sc.default=Sc;var Z2=Sc;const ej=Is(Z2),_x=Rx("end"),Zd=Rx("start");function Rx(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 tj(e){const t=Zd(e),n=_x(e);if(t&&n)return{start:t,end:n}}function ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Sm(e.position):"start"in e||"end"in e?Sm(e):"line"in e||"column"in e?kc(e):""}function kc(e){return km(e&&e.line)+":"+km(e&&e.column)}function Sm(e){return kc(e&&e.start)+"-"+kc(e&&e.end)}function km(e){return e&&typeof e=="number"?e:1}class tt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ao(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tt.prototype.file="";tt.prototype.name="";tt.prototype.reason="";tt.prototype.message="";tt.prototype.stack="";tt.prototype.column=void 0;tt.prototype.line=void 0;tt.prototype.ancestors=void 0;tt.prototype.cause=void 0;tt.prototype.fatal=void 0;tt.prototype.place=void 0;tt.prototype.ruleId=void 0;tt.prototype.source=void 0;const ef={}.hasOwnProperty,nj=new Map,rj=/[A-Z]/g,ij=new Set(["table","tbody","thead","tfoot","tr"]),oj=new Set(["td","th"]),Ax="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lj(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=mj(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=pj(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"?qd:E2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Ix(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Ix(e,t,n){if(t.type==="element")return sj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return cj(e,t,n);if(t.type==="mdxjsEsm")return uj(e,t);if(t.type==="root")return dj(e,t,n);if(t.type==="text")return fj(e,t)}function sj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qd,e.schema=i),e.ancestors.push(t);const o=Ox(e,t.tagName,!1),l=hj(e,t);let s=nf(e,t);return ij.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!g2(a):!0})),Mx(e,l,o,t),tf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function aj(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 uj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function cj(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ox(e,t.name,!0),l=gj(e,t),s=nf(e,t);return Mx(e,l,o,t),tf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function dj(e,t,n){const r={};return tf(r,nf(e,t)),e.create(t,e.Fragment,r,n)}function fj(e,t){return t.value}function Mx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pj(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function mj(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=Zd(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function hj(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ef.call(t.properties,i)){const o=yj(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&oj.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 gj(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 nf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:nj;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 Nm={}.hasOwnProperty;function Nj(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ci(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=sr(/[A-Za-z]/),kt=sr(/[\dA-Za-z]/),Pj=sr(/[#-'*+\--9=?A-Z^-~]/);function Cc(e){return e!==null&&(e<32||e===127)}const bc=sr(/\d/),Tj=sr(/[\dA-Fa-f]/),_j=sr(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function ge(e){return e===-2||e===-1||e===32}const Rj=sr(/\p{P}|\p{S}/u),Aj=sr(/\s/);function sr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _i(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 be(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return ge(a)?(e.enter(n),s(a)):t(a)}function s(a){return ge(a)&&o++l))return;const j=t.events.length;let T=j,L,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(L){M=t.events[T][1].end;break}L=!0}for(v(r),N=j;Nx;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=x}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Dj(e,t,n){return be(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jm(e){if(e===null||ht(e)||Aj(e))return 1;if(Rj(e))return 2}function of(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};Pm(d,-a),Pm(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=_t(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=_t(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=_t(u,of(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=_t(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=_t(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,fn(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&ge(N)?be(e,h,"linePrefix",o+1)(N):h(N)}function h(N){return N===null||Y(N)?e.check(Tm,y,C)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||Y(N)?(e.exit("codeFlowValue"),h(N)):(e.consume(N),x)}function C(N){return e.exit("codeFenced"),t(N)}function E(N,j,T){let L=0;return M;function M(I){return N.enter("lineEnding"),N.consume(I),N.exit("lineEnding"),A}function A(I){return N.enter("codeFencedFence"),ge(I)?be(N,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I)}function _(I){return I===s?(N.enter("codeFencedFenceSequence"),H(I)):T(I)}function H(I){return I===s?(L++,N.consume(I),H):L>=l?(N.exit("codeFencedFenceSequence"),ge(I)?be(N,W,"whitespace")(I):W(I)):T(I)}function W(I){return I===null||Y(I)?(N.exit("codeFencedFence"),j(I)):T(I)}}}function Yj(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 iu={name:"codeIndented",tokenize:qj},Xj={partial:!0,tokenize:Jj};function qj(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),be(e,o,"linePrefix",4+1)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):Y(u)?e.attempt(Xj,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||Y(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function Jj(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):be(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 Zj={name:"codeText",previous:tP,resolve:eP,tokenize:nP};function eP(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 Ux(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||Cc(v)?n(v):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(s),p(v)):v===null||v===60||Y(v)?n(v):(e.consume(v),v===92?w:m)}function w(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function y(v){return!f&&(v===null||v===41||ht(v))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(v)):f999||m===null||m===91||m===93&&!a||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),a||(a=!ge(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function Hx(e,t,n,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?n(p):Y(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),be(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||Y(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function uo(e,t){let n;return r;function r(i){return Y(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ge(i)?be(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cP={name:"definition",tokenize:fP},dP={partial:!0,tokenize:pP};function fP(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return Vx.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=ci(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a):n(m)}function a(m){return ht(m)?uo(e,u)(m):u(m)}function u(m){return Ux(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(dP,d,d)(m)}function d(m){return ge(m)?be(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 pP(e,t,n){return r;function r(s){return ht(s)?uo(e,i)(s):n(s)}function i(s){return Hx(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ge(s)?be(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const mP={name:"hardBreakEscape",tokenize:hP};function hP(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 gP={name:"headingAtx",resolve:yP,tokenize:vP};function yP(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 vP(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"),a(f)):f===null||Y(f)?(e.exit("atxHeading"),t(f)):ge(f)?be(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||ht(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const xP=["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"],Rm=["pre","script","style","textarea"],wP={concrete:!0,name:"htmlFlow",resolveTo:CP,tokenize:bP},SP={partial:!0,tokenize:EP},kP={partial:!0,tokenize:NP};function CP(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 bP(e,t,n){const r=this;let i,o,l,s,a;return u;function u(b){return f(b)}function f(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),o=!0,y):b===63?(e.consume(b),i=3,r.interrupt?t:k):sn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),i=2,m):b===91?(e.consume(b),i=5,s=0,w):sn(b)?(e.consume(b),i=4,r.interrupt?t:k):n(b)}function m(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const ne="CDATA[";return b===ne.charCodeAt(s++)?(e.consume(b),s===ne.length?r.interrupt?t:_:w):n(b)}function y(b){return sn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||ht(b)){const ne=b===47,de=l.toLowerCase();return!ne&&!o&&Rm.includes(de)?(i=1,r.interrupt?t(b):_(b)):xP.includes(l.toLowerCase())?(i=6,ne?(e.consume(b),v):r.interrupt?t(b):_(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?h(b):x(b))}return b===45||kt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function v(b){return b===62?(e.consume(b),r.interrupt?t:_):n(b)}function h(b){return ge(b)?(e.consume(b),h):M(b)}function x(b){return b===47?(e.consume(b),M):b===58||b===95||sn(b)?(e.consume(b),C):ge(b)?(e.consume(b),x):M(b)}function C(b){return b===45||b===46||b===58||b===95||kt(b)?(e.consume(b),C):E(b)}function E(b){return b===61?(e.consume(b),N):ge(b)?(e.consume(b),E):x(b)}function N(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,j):ge(b)?(e.consume(b),N):T(b)}function j(b){return b===a?(e.consume(b),a=null,L):b===null||Y(b)?n(b):(e.consume(b),j)}function T(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ht(b)?E(b):(e.consume(b),T)}function L(b){return b===47||b===62||ge(b)?x(b):n(b)}function M(b){return b===62?(e.consume(b),A):n(b)}function A(b){return b===null||Y(b)?_(b):ge(b)?(e.consume(b),A):n(b)}function _(b){return b===45&&i===2?(e.consume(b),O):b===60&&i===1?(e.consume(b),B):b===62&&i===4?(e.consume(b),U):b===63&&i===3?(e.consume(b),k):b===93&&i===5?(e.consume(b),z):Y(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(SP,Q,H)(b)):b===null||Y(b)?(e.exit("htmlFlowData"),H(b)):(e.consume(b),_)}function H(b){return e.check(kP,W,Q)(b)}function W(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),I}function I(b){return b===null||Y(b)?H(b):(e.enter("htmlFlowData"),_(b))}function O(b){return b===45?(e.consume(b),k):_(b)}function B(b){return b===47?(e.consume(b),l="",P):_(b)}function P(b){if(b===62){const ne=l.toLowerCase();return Rm.includes(ne)?(e.consume(b),U):_(b)}return sn(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),P):_(b)}function z(b){return b===93?(e.consume(b),k):_(b)}function k(b){return b===62?(e.consume(b),U):b===45&&i===2?(e.consume(b),k):_(b)}function U(b){return b===null||Y(b)?(e.exit("htmlFlowData"),Q(b)):(e.consume(b),U)}function Q(b){return e.exit("htmlFlow"),t(b)}}function NP(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 EP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ia,t,n)}}const jP={name:"htmlText",tokenize:PP};function PP(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),E):k===63?(e.consume(k),x):sn(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,w):sn(k)?(e.consume(k),h):n(k)}function f(k){return k===45?(e.consume(k),m):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):Y(k)?(l=d,B(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?O(k):k===45?p(k):d(k)}function w(k){const U="CDATA[";return k===U.charCodeAt(o++)?(e.consume(k),o===U.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):Y(k)?(l=y,B(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),v):y(k)}function v(k){return k===62?O(k):k===93?(e.consume(k),v):y(k)}function h(k){return k===null||k===62?O(k):Y(k)?(l=h,B(k)):(e.consume(k),h)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):Y(k)?(l=x,B(k)):(e.consume(k),x)}function C(k){return k===62?O(k):x(k)}function E(k){return sn(k)?(e.consume(k),N):n(k)}function N(k){return k===45||kt(k)?(e.consume(k),N):j(k)}function j(k){return Y(k)?(l=j,B(k)):ge(k)?(e.consume(k),j):O(k)}function T(k){return k===45||kt(k)?(e.consume(k),T):k===47||k===62||ht(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),O):k===58||k===95||sn(k)?(e.consume(k),M):Y(k)?(l=L,B(k)):ge(k)?(e.consume(k),L):O(k)}function M(k){return k===45||k===46||k===58||k===95||kt(k)?(e.consume(k),M):A(k)}function A(k){return k===61?(e.consume(k),_):Y(k)?(l=A,B(k)):ge(k)?(e.consume(k),A):L(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,H):Y(k)?(l=_,B(k)):ge(k)?(e.consume(k),_):(e.consume(k),W)}function H(k){return k===i?(e.consume(k),i=void 0,I):k===null?n(k):Y(k)?(l=H,B(k)):(e.consume(k),H)}function W(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ht(k)?L(k):(e.consume(k),W)}function I(k){return k===47||k===62||ht(k)?L(k):n(k)}function O(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function B(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return ge(k)?be(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return e.enter("htmlTextData"),l(k)}}const lf={name:"labelEnd",resolveAll:AP,resolveTo:IP,tokenize:MP},TP={tokenize:OP},_P={tokenize:LP},RP={tokenize:DP};function AP(e){let t=-1;const n=[];for(;++t=3&&(u===null||Y(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ge(u)?be(e,s,"whitespace")(u):s(u))}}const at={continuation:{tokenize:GP},exit:YP,name:"list",tokenize:KP},HP={partial:!0,tokenize:XP},WP={partial:!0,tokenize:QP};function KP(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:bc(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Wl,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return bc(m)&&++l<10?(e.consume(m),a):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(ia,r.interrupt?n:f,e.attempt(HP,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ge(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 GP(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ia,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,be(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ge(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(WP,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,be(e,e.attempt(at,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function QP(e,t,n){const r=this;return be(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 YP(e){e.exit(this.containerState.type)}function XP(e,t,n){const r=this;return be(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!ge(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Am={name:"setextUnderline",resolveTo:qP,tokenize:JP};function qP(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 JP(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ge(u)?be(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ZP={tokenize:eT};function eT(e){const t=this,n=e.attempt(ia,r,e.attempt(this.parser.constructs.flowInitial,i,be(e,e.attempt(this.parser.constructs.flow,i,e.attempt(oP,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 tT={resolveAll:Kx()},nT=Wx("string"),rT=Wx("text");function Wx(e){return{resolveAll:Kx(e==="text"?iT:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(f){return u(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function yT(e,t){let n=-1;const r=[];let i;for(;++n0){const yt=q.tokenStack[q.tokenStack.length-1];(yt[1]||Mm).call(q,void 0,yt[0])}for(V.position={start:Rn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Rn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},ve=-1;++ve1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function MT(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 OT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Yx(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 LT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yx(e,t);const i={src:_i(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 DT(e,t){const n={src:_i(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 zT(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 FT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yx(e,t);const i={href:_i(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 BT(e,t){const n={href:_i(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 $T(e,t,n){const r=e.all(t),i=n?UT(n):Xx(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 VT(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=Zd(t.children[1]),a=_x(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function QT(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Dm(t.slice(i),i>0,!1)),o.join("")}function Dm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Om||o===Lm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Om||o===Lm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qT(e,t){const n={type:"text",value:XT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZT={blockquote:PT,break:TT,code:_T,delete:RT,emphasis:AT,footnoteReference:IT,heading:MT,html:OT,imageReference:LT,image:DT,inlineCode:zT,linkReference:FT,link:BT,listItem:$T,list:VT,paragraph:HT,root:WT,strong:KT,table:GT,tableCell:YT,tableRow:QT,text:qT,thematicBreak:JT,toml:vl,yaml:vl,definition:vl,footnoteDefinition:vl};function vl(){}const qx=-1,oa=0,co=1,bs=2,sf=3,af=4,uf=5,cf=6,Jx=7,Zx=8,zm=typeof self=="object"?self:globalThis,e_=(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 oa:case qx:return n(l,i);case co:{const s=n([],i);for(const a of l)s.push(r(a));return s}case bs:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case sf:return n(new Date(l),i);case af:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case uf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case cf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case Jx:{const{name:s,message:a}=l;return n(new zm[s](a),i)}case Zx: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 zm[o](l),i)};return r},Fm=e=>e_(new Map,e)(0),Fr="",{toString:t_}={},{keys:n_}=Object,Gi=e=>{const t=typeof e;if(t!=="object"||!e)return[oa,t];const n=t_.call(e).slice(8,-1);switch(n){case"Array":return[co,Fr];case"Object":return[bs,Fr];case"Date":return[sf,Fr];case"RegExp":return[af,Fr];case"Map":return[uf,Fr];case"Set":return[cf,Fr];case"DataView":return[co,n]}return n.includes("Array")?[co,n]:n.includes("Error")?[Jx,n]:[bs,n]},xl=([e,t])=>e===oa&&(t==="function"||t==="symbol"),r_=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Gi(l);switch(s){case oa:{let f=l;switch(a){case"bigint":s=Zx,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([qx],l)}return i([s,f],l)}case co:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const f=[],d=i([s,f],l);for(const p of l)f.push(o(p));return d}case bs:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([s,f],l);for(const p of n_(l))(e||!xl(Gi(l[p])))&&f.push([o(p),o(l[p])]);return d}case sf:return i([s,l.toISOString()],l);case af:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case uf:{const f=[],d=i([s,f],l);for(const[p,m]of l)(e||!(xl(Gi(p))||xl(Gi(m))))&&f.push([o(p),o(m)]);return d}case cf:{const f=[],d=i([s,f],l);for(const p of l)(e||!xl(Gi(p)))&&f.push(o(p));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Bm=(e,{json:t,lossy:n}={})=>{const r=[];return r_(!(t||n),!!t,new Map,r)(e),r},Ns=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fm(Bm(e,t)):structuredClone(e):(e,t)=>Fm(Bm(e,t));function i_(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 o_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function l_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||i_,r=e.options.footnoteBackLabel||o_,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let h=typeof n=="string"?n:n(a,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(a,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 v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ns(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 e0=function(e){if(e==null)return c_;if(typeof e=="function")return la(e);if(typeof e=="object")return Array.isArray(e)?s_(e):a_(e);if(typeof e=="string")return u_(e);throw new Error("Expected function, string, or object as test")};function s_(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=t0,w,y,S;if((!t||o(a,u,f[f.length-1]||void 0))&&(m=h_(n(a,f)),m[0]===$m))return m;if("children"in a&&a.children){const v=a;if(v.children&&m[0]!==p_)for(y=(r?v.children.length:-1)+l,S=f.concat(v);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function Um(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vm(e,t){const n=y_(e,t),r=n.one(e,void 0),i=l_(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function k_(e,t){return e&&"run"in e?async function(n,r){const i=Vm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Vm(n,{file:r,...e||t})}}function Hm(e){if(e)throw e}var Kl=Object.prototype.hasOwnProperty,r0=Object.prototype.toString,Wm=Object.defineProperty,Km=Object.getOwnPropertyDescriptor,Gm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):r0.call(t)==="[object Array]"},Qm=function(t){if(!t||r0.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)},Ym=function(t,n){Wm&&n.name==="__proto__"?Wm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Xm=function(t,n){if(n==="__proto__")if(Kl.call(t,n)){if(Km)return Km(t,n).value}else return;return t[n]},C_=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const f=u;if(s&&n)throw f;return i(f)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const rn={basename:E_,dirname:j_,extname:P_,join:T_,sep:"/"};function E_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ho(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 j_(e){if(Ho(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 P_(e){Ho(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 T_(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function R_(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function Ho(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const A_={cwd:I_};function I_(){return"/"}function Pc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function M_(e){if(typeof e=="string")e=new URL(e);else if(!Pc(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 O_(e)}function O_(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 y=r[p][1];jc(y)&&jc(m)&&(m=lu(!0,y,m)),r[p]=[u,m,...w]}}}}const F_=new df().freeze();function cu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function du(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fu(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 Jm(e){if(!jc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Zm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wl(e){return B_(e)?e:new i0(e)}function B_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $_(e){return typeof e=="string"||U_(e)}function U_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const V_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eh=[],th={allowDangerousHtml:!0},H_=/^(https?|ircs?|mailto|xmpp)$/i,W_=[{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 K_(e){const t=G_(e),n=Q_(e);return Y_(t.runSync(t.parse(n),n),e)}function G_(e){const t=e.rehypePlugins||eh,n=e.remarkPlugins||eh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...th}:th;return F_().use(jT).use(n).use(k_,r).use(t)}function Q_(e){const t=e.children||"",n=new i0;return typeof t=="string"&&(n.value=t),n}function Y_(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||X_;for(const f of W_)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+V_+f.id,void 0);return n0(e,u),lj(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in ru)if(Object.hasOwn(ru,m)&&Object.hasOwn(f.properties,m)){const w=f.properties[m],y=ru[m];(y===null||y.includes(f.tagName))&&(f.properties[m]=a(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 X_(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||H_.test(e.slice(0,t))?e:""}const o0=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=g.useRef(null),f=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),c.jsxs("div",{className:ue("flex h-full flex-col",e),ref:a,...s,children:[c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:c.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>c.jsxs("div",{className:ue("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:c.jsx(Zr,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:ue("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[c.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[c.jsx("span",{children:d.role==="user"?"You":d.assistantInfo?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-medium",children:d.assistantInfo.name}),d.assistantInfo.type!=="default"&&c.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&&c.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",d.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["#",p+1]})]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(K_,{components:{p:({children:m})=>c.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>c.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>c.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>c.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>c.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:d.content})})]}),d.role==="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:c.jsx(Fd,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),c.jsx("div",{ref:u})]}),c.jsx("div",{className:"border-t p-4",children:c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(kx,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?c.jsx(Me,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(Rb,{className:"h-4 w-4"})}):c.jsx(Me,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(Cb,{className:"h-4 w-4"})})]})})]})});o0.displayName="Chat";const tn={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function l0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function q_(){return l0()}class J_{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:l0(),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:q_(),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 Ie=new J_;function Z_(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[f,d]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,y]=g.useState(r),[S,v]=g.useState(.7),[h,x]=g.useState(1024),C=Vt.useMemo(()=>{var O;const I=i.find(B=>B.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!I,messageCount:((O=I==null?void 0:I.messages)==null?void 0:O.length)||0,sessionTitle:(I==null?void 0:I.title)||"No session"}),I},[i,l]),E=Vt.useMemo(()=>{const I=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",I.length,I.map(O=>({id:O.id,role:O.role}))),I},[C==null?void 0:C.messages]);g.useEffect(()=>{const I=Ie.getAllSessions();o(I);const O=Ie.getCurrentSession();O&&s(O.id)},[]);const N=g.useCallback(()=>{const I=Ie.createSession(void 0,p,w),O=Ie.getAllSessions();return o([...O]),s(I.id),Ie.setCurrentSession(I.id),I.id},[p,w]),j=g.useCallback(I=>{console.log("selectSession called with:",I),s(I),Ie.setCurrentSession(I),console.log("currentSessionId updated to:",I)},[]),T=g.useCallback(I=>{Ie.deleteSession(I);const O=Ie.getAllSessions();o([...O]),l===I&&(O.length>0?(s(O[0].id),Ie.setCurrentSession(O[0].id)):s(null))},[l]),L=g.useCallback((I,O)=>{Ie.updateSession(I,{title:O});const B=Ie.getAllSessions();o([...B])},[]),M=g.useCallback(I=>{if(!l)return;Ie.addMessageToSession(l,I);const O=Ie.getAllSessions();o([...O])},[l]),A=g.useCallback(async(I,O)=>{var z,k;if(!a.trim()||f.isLoading)return;let B=l;B||(B=N());const P=a.trim();if(u(""),d({isLoading:!0,error:null}),B){Ie.addMessageToSession(B,{role:"user",content:P});const U=Ie.getAllSessions();o([...U])}try{const U=Ie.getSession(B),Q=((k=(z=U==null?void 0:U.messages)==null?void 0:z.filter(de=>de.role!=="system"))==null?void 0:k.map(de=>({role:de.role,content:de.content})))||[],b=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:(O==null?void 0:O.useRag)||!1,retrieval_count:(O==null?void 0:O.retrievalCount)||3})});if(!b.ok){const de=await b.json();throw new Error(de.detail||`HTTP error! status: ${b.status}`)}const ne=await b.json();if(B){Ie.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=Ie.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){Ie.addMessageToSession(B,{role:"assistant",content:`Sorry, I encountered an error: ${Q}`,assistantInfo:I});const b=Ie.getAllSessions();o([...b])}}},[a,f.isLoading,l,N,M,w,E.length,t,p,S,h]),_=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),H=g.useCallback(()=>{Ie.clear(),o([]),s(null)},[]),W=g.useCallback(()=>{s(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:N,selectSession:j,deleteSession:T,renameSession:L,clearAllSessions:H,clearCurrentSession:W,messages:E,input:a,setInput:u,sendMessage:A,stopGeneration:_,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:v,maxTokens:h,setMaxTokens:x}}function Es(e,[t,n]){return Math.min(n,Math.max(t,e))}function s0(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 a0(e){const[t,n]=g.useState(void 0);return et(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var u0=["PageUp","PageDown"],c0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],d0={"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",[Tc,eR,tR]=Ud(Ri),[f0,jI]=lr(Ri,[tR]),[nR,sa]=f0(Ri),p0=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...y}=e,S=g.useRef(new Set),v=g.useRef(0),x=l==="horizontal"?rR:iR,[C=[],E]=ki({prop:f,defaultProp:u,onChange:A=>{var H;(H=[...S.current][v.current])==null||H.focus(),d(A)}}),N=g.useRef(C);function j(A){const _=uR(C,A);M(A,_)}function T(A){M(A,v.current)}function L(){const A=N.current[v.current];C[v.current]!==A&&p(C)}function M(A,_,{commit:H}={commit:!1}){const W=pR(o),I=mR(Math.round((A-r)/o)*o+r,W),O=Es(I,[r,i]);E((B=[])=>{const P=sR(B,O,_);if(fR(P,a*o)){v.current=P.indexOf(O);const z=String(P)!==String(B);return z&&H&&p(P),z?P:B}else return B})}return c.jsx(nR,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:S.current,values:C,orientation:l,form:w,children:c.jsx(Tc.Provider,{scope:e.__scopeSlider,children:c.jsx(Tc.Slot,{scope:e.__scopeSlider,children:c.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:Z(y.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:L,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,C.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:_})=>{if(!s){const I=u0.includes(A.key)||A.shiftKey&&c0.includes(A.key)?10:1,O=v.current,B=C[O],P=o*I*_;M(B+P,O,{commit:!0})}}})})})})});p0.displayName=Ri;var[m0,h0]=f0(Ri,{startEdge:"left",endEdge:"right",size:"width",direction:1}),rR=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[d,p]=g.useState(null),m=ye(t,x=>p(x)),w=g.useRef(void 0),y=Zs(i),S=y==="ltr",v=S&&!o||!S&&o;function h(x){const C=w.current||d.getBoundingClientRect(),E=[0,C.width],j=ff(E,v?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return c.jsx(m0,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:c.jsx(g0,{dir:y,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=h(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=h(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const E=d0[v?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:E?-1:1})}})})}),iR=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=g.useRef(null),d=ye(t,f),p=g.useRef(void 0),m=!i;function w(y){const S=p.current||f.current.getBoundingClientRect(),v=[0,S.height],x=ff(v,m?[r,n]:[n,r]);return p.current=S,x(y-S.top)}return c.jsx(m0,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:c.jsx(g0,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);o==null||o(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:y=>{const v=d0[m?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:v?-1:1})}})})}),g0=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=sa(Ri,n);return c.jsx(oe.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):u0.concat(c0).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:Z(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:Z(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Z(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),y0="SliderTrack",v0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=sa(y0,n);return c.jsx(oe.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});v0.displayName=y0;var _c="SliderRange",x0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=sa(_c,n),o=h0(_c,n),l=g.useRef(null),s=ye(t,l),a=i.values.length,u=i.values.map(p=>k0(p,i.min,i.max)),f=a>1?Math.min(...u):0,d=100-Math.max(...u);return c.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+"%"}})});x0.displayName=_c;var Rc="SliderThumb",w0=g.forwardRef((e,t)=>{const n=eR(e.__scopeSlider),[r,i]=g.useState(null),o=ye(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(oR,{...e,ref:o,index:l})}),oR=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=sa(Rc,n),s=h0(Rc,n),[a,u]=g.useState(null),f=ye(t,h=>u(h)),d=a?l.form||!!a.closest("form"):!0,p=a0(a),m=l.values[r],w=m===void 0?0:k0(m,l.min,l.max),y=aR(r,l.values.length),S=p==null?void 0:p[s.size],v=S?cR(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${v}px)`},children:[c.jsx(Tc.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(oe.span,{role:"slider","aria-label":e["aria-label"]||y,"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&&c.jsx(S0,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});w0.displayName=Rc;var lR="RadioBubbleInput",S0=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ye(i,r),l=s0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(oe.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});S0.displayName=lR;function sR(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function k0(e,t,n){const o=100/(n-t)*(e-t);return Es(o,[0,100])}function aR(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function uR(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 cR(e,t,n){const r=e/2,o=ff([0,50],[0,r]);return(r-o(t)*n)*n}function dR(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function fR(e,t){if(t>0){const n=dR(e);return Math.min(...n)>=t}return!0}function ff(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 pR(e){return(String(e).split(".")[1]||"").length}function mR(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var C0=p0,hR=v0,gR=x0,yR=w0;const js=g.forwardRef(({className:e,...t},n)=>c.jsxs(C0,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(hR,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(gR,{className:"absolute h-full bg-primary"})}),c.jsx(yR,{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"})]}));js.displayName=C0.displayName;const vR=["top","right","bottom","left"],er=Math.min,wt=Math.max,Ps=Math.round,Sl=Math.floor,dn=e=>({x:e,y:e}),xR={left:"right",right:"left",bottom:"top",top:"bottom"},wR={start:"end",end:"start"};function Ac(e,t,n){return wt(e,er(t,n))}function Nn(e,t){return typeof e=="function"?e(t):e}function En(e){return e.split("-")[0]}function Ai(e){return e.split("-")[1]}function pf(e){return e==="x"?"y":"x"}function mf(e){return e==="y"?"height":"width"}const SR=new Set(["top","bottom"]);function an(e){return SR.has(En(e))?"y":"x"}function hf(e){return pf(an(e))}function kR(e,t,n){n===void 0&&(n=!1);const r=Ai(e),i=hf(e),o=mf(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Ts(l)),[l,Ts(l)]}function CR(e){const t=Ts(e);return[Ic(e),t,Ic(t)]}function Ic(e){return e.replace(/start|end/g,t=>wR[t])}const nh=["left","right"],rh=["right","left"],bR=["top","bottom"],NR=["bottom","top"];function ER(e,t,n){switch(e){case"top":case"bottom":return n?t?rh:nh:t?nh:rh;case"left":case"right":return t?bR:NR;default:return[]}}function jR(e,t,n,r){const i=Ai(e);let o=ER(En(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Ic)))),o}function Ts(e){return e.replace(/left|right|bottom|top/g,t=>xR[t])}function PR(e){return{top:0,right:0,bottom:0,left:0,...e}}function b0(e){return typeof e!="number"?PR(e):{top:e,right:e,bottom:e,left:e}}function _s(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 ih(e,t,n){let{reference:r,floating:i}=e;const o=an(t),l=hf(t),s=mf(l),a=En(t),u=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(a){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(Ai(t)){case"start":m[l]-=p*(n&&u?-1:1);break;case"end":m[l]+=p*(n&&u?-1:1);break}return m}const TR=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=ih(u,r,a),p=r,m={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=Nn(e,t)||{};if(u==null)return{};const d=b0(f),p={x:n,y:r},m=hf(i),w=mf(m),y=await l.getDimensions(u),S=m==="y",v=S?"top":"left",h=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[m]-p[m]-o.floating[w],E=p[m]-o.reference[m],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=N?N[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[x]||o.floating[w]);const T=C/2-E/2,L=j/2-y[w]/2-1,M=er(d[v],L),A=er(d[h],L),_=M,H=j-y[w]-A,W=j/2-y[w]/2+T,I=Ac(_,W,H),O=!a.arrow&&Ai(i)!=null&&W!==I&&o.reference[w]/2-(W<_?M:A)-y[w]/2<0,B=O?W<_?W-_:W-H:0;return{[m]:p[m]+B,data:{[m]:I,centerOffset:W-I-B,...O&&{alignmentOffset:B}},reset:O}}}),RR=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:a,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...S}=Nn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=En(i),h=an(s),x=En(s)===s,C=await(a.isRTL==null?void 0:a.isRTL(u.floating)),E=p||(x||!y?[Ts(s)]:CR(s)),N=w!=="none";!p&&N&&E.push(...jR(s,y,w,C));const j=[s,...E],T=await Ao(t,S),L=[];let M=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&L.push(T[v]),d){const W=kR(i,l,C);L.push(T[W[0]],T[W[1]])}if(M=[...M,{placement:i,overflows:L}],!L.every(W=>W<=0)){var A,_;const W=(((A=o.flip)==null?void 0:A.index)||0)+1,I=j[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 O=(_=M.filter(B=>B.overflows[0]<=0).sort((B,P)=>B.overflows[1]-P.overflows[1])[0])==null?void 0:_.placement;if(!O)switch(m){case"bestFit":{var H;const B=(H=M.filter(P=>{if(N){const z=an(P.placement);return z===h||z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((P,z)=>P[1]-z[1])[0])==null?void 0:H[0];B&&(O=B);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function oh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lh(e){return vR.some(t=>e[t]>=0)}const AR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Nn(e,t);switch(r){case"referenceHidden":{const o=await Ao(t,{...i,elementContext:"reference"}),l=oh(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:lh(l)}}}case"escaped":{const o=await Ao(t,{...i,altBoundary:!0}),l=oh(o,n.floating);return{data:{escapedOffsets:l,escaped:lh(l)}}}default:return{}}}}},N0=new Set(["left","top"]);async function IR(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=Ai(n),a=an(n)==="y",u=N0.has(l)?-1:1,f=o&&a?-1:1,d=Nn(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),a?{x:m*f,y:p*u}:{x:p*u,y:m*f}}const MR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await IR(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},OR=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:v,y:h}=S;return{x:v,y:h}}},...a}=Nn(e,t),u={x:n,y:r},f=await Ao(t,a),d=an(En(i)),p=pf(d);let m=u[p],w=u[d];if(o){const S=p==="y"?"top":"left",v=p==="y"?"bottom":"right",h=m+f[S],x=m-f[v];m=Ac(h,m,x)}if(l){const S=d==="y"?"top":"left",v=d==="y"?"bottom":"right",h=w+f[S],x=w-f[v];w=Ac(h,w,x)}const y=s.fn({...t,[p]:m,[d]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[d]:l}}}}}},LR=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=Nn(e,t),f={x:n,y:r},d=an(i),p=pf(d);let m=f[p],w=f[d];const y=Nn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,E=o.reference[p]+o.reference[x]-S.mainAxis;mE&&(m=E)}if(u){var v,h;const x=p==="y"?"width":"height",C=N0.has(En(i)),E=o.reference[d]-o.floating[x]+(C&&((v=l.offset)==null?void 0:v[d])||0)+(C?0:S.crossAxis),N=o.reference[d]+o.reference[x]+(C?0:((h=l.offset)==null?void 0:h[d])||0)-(C?S.crossAxis:0);wN&&(w=N)}return{[p]:m,[d]:w}}}},DR=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=Nn(e,t),f=await Ao(t,u),d=En(i),p=Ai(i),m=an(i)==="y",{width:w,height:y}=o.floating;let S,v;d==="top"||d==="bottom"?(S=d,v=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,S=p==="end"?"top":"bottom");const h=y-f.top-f.bottom,x=w-f.left-f.right,C=er(y-f[S],h),E=er(w-f[v],x),N=!t.middlewareData.shift;let j=C,T=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=h),N&&!p){const M=wt(f.left,0),A=wt(f.right,0),_=wt(f.top,0),H=wt(f.bottom,0);m?T=w-2*(M!==0||A!==0?M+A:wt(f.left,f.right)):j=y-2*(_!==0||H!==0?_+H:wt(f.top,f.bottom))}await a({...t,availableWidth:T,availableHeight:j});const L=await l.getDimensions(s.floating);return w!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function aa(){return typeof window<"u"}function Ii(e){return E0(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(E0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function E0(e){return aa()?e instanceof Node||e instanceof bt(e).Node:!1}function Yt(e){return aa()?e instanceof Element||e instanceof bt(e).Element:!1}function pn(e){return aa()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function sh(e){return!aa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const zR=new Set(["inline","contents"]);function Wo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zR.has(i)}const FR=new Set(["table","td","th"]);function BR(e){return FR.has(Ii(e))}const $R=[":popover-open",":modal"];function ua(e){return $R.some(t=>{try{return e.matches(t)}catch{return!1}})}const UR=["transform","translate","scale","rotate","perspective"],VR=["transform","translate","scale","rotate","perspective","filter"],HR=["paint","layout","strict","content"];function gf(e){const t=yf(),n=Yt(e)?Xt(e):e;return UR.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)||VR.some(r=>(n.willChange||"").includes(r))||HR.some(r=>(n.contain||"").includes(r))}function WR(e){let t=tr(e);for(;pn(t)&&!Ci(t);){if(gf(t))return t;if(ua(t))return null;t=tr(t)}return null}function yf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const KR=new Set(["html","body","#document"]);function Ci(e){return KR.has(Ii(e))}function Xt(e){return bt(e).getComputedStyle(e)}function ca(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tr(e){if(Ii(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sh(e)&&e.host||mn(e);return sh(t)?t.host:t}function j0(e){const t=tr(e);return Ci(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&Wo(t)?t:j0(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=j0(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=bt(i);if(o){const s=Mc(l);return t.concat(l,l.visualViewport||[],Wo(i)?i:[],s&&n?Io(s):[])}return t.concat(i,Io(i,[],n))}function Mc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P0(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=Ps(n)!==o||Ps(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function vf(e){return Yt(e)?e:e.contextElement}function di(e){const t=vf(e);if(!pn(t))return dn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=P0(t);let l=(o?Ps(n.width):n.width)/r,s=(o?Ps(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const GR=dn(0);function T0(e){const t=bt(e);return!yf()||!t.visualViewport?GR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bt(e)?!1:t}function jr(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=di(r)):l=di(e));const s=QR(o,n,r)?T0(o):dn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=bt(o),m=r&&Yt(r)?bt(r):r;let w=p,y=Mc(w);for(;y&&r&&m!==w;){const S=di(y),v=y.getBoundingClientRect(),h=Xt(y),x=v.left+(y.clientLeft+parseFloat(h.paddingLeft))*S.x,C=v.top+(y.clientTop+parseFloat(h.paddingTop))*S.y;a*=S.x,u*=S.y,f*=S.x,d*=S.y,a+=x,u+=C,w=bt(y),y=Mc(w)}}return _s({width:f,height:d,x:a,y:u})}function da(e,t){const n=ca(e).scrollLeft;return t?t.left+n:jr(mn(e)).left+n}function _0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-da(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function YR(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=mn(r),s=t?ua(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=dn(1);const f=dn(0),d=pn(r);if((d||!d&&!o)&&((Ii(r)!=="body"||Wo(l))&&(a=ca(r)),pn(r))){const m=jr(r);u=di(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=l&&!d&&!o?_0(l,a):dn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-a.scrollTop*u.y+f.y+p.y}}function XR(e){return Array.from(e.getClientRects())}function qR(e){const t=mn(e),n=ca(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+da(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 ah=25;function JR(e,t){const n=bt(e),r=mn(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const f=yf();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=da(r);if(u<=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<=ah&&(o-=w)}else u<=ah&&(o+=u);return{width:o,height:l,x:s,y:a}}const ZR=new Set(["absolute","fixed"]);function eA(e,t){const n=jr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=pn(e)?di(e):dn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function uh(e,t,n){let r;if(t==="viewport")r=JR(e,n);else if(t==="document")r=qR(mn(e));else if(Yt(t))r=eA(t,n);else{const i=T0(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return _s(r)}function R0(e,t){const n=tr(e);return n===t||!Yt(n)||Ci(n)?!1:Xt(n).position==="fixed"||R0(n,t)}function tA(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(s=>Yt(s)&&Ii(s)!=="body"),i=null;const o=Xt(e).position==="fixed";let l=o?tr(e):e;for(;Yt(l)&&!Ci(l);){const s=Xt(l),a=gf(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&ZR.has(i.position)||Wo(l)&&!a&&R0(e,l))?r=r.filter(f=>f!==l):i=s,l=tr(l)}return t.set(e,r),r}function nA(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?ua(t)?[]:tA(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const d=uh(t,f,i);return u.top=wt(d.top,u.top),u.right=er(d.right,u.right),u.bottom=er(d.bottom,u.bottom),u.left=wt(d.left,u.left),u},uh(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function rA(e){const{width:t,height:n}=P0(e);return{width:t,height:n}}function iA(e,t,n){const r=pn(t),i=mn(t),o=n==="fixed",l=jr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=dn(0);function u(){a.x=da(i)}if(r||!r&&!o)if((Ii(t)!=="body"||Wo(i))&&(s=ca(t)),r){const m=jr(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?_0(i,s):dn(0),d=l.left+s.scrollLeft-a.x-f.x,p=l.top+s.scrollTop-a.y-f.y;return{x:d,y:p,width:l.width,height:l.height}}function pu(e){return Xt(e).position==="static"}function ch(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 A0(e,t){const n=bt(e);if(ua(e))return n;if(!pn(e)){let i=tr(e);for(;i&&!Ci(i);){if(Yt(i)&&!pu(i))return i;i=tr(i)}return n}let r=ch(e,t);for(;r&&BR(r)&&pu(r);)r=ch(r,t);return r&&Ci(r)&&pu(r)&&!gf(r)?n:r||WR(e)||n}const oA=async function(e){const t=this.getOffsetParent||A0,n=this.getDimensions,r=await n(e.floating);return{reference:iA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lA(e){return Xt(e).direction==="rtl"}const sA={convertOffsetParentRelativeRectToViewportRelativeRect:YR,getDocumentElement:mn,getClippingRect:nA,getOffsetParent:A0,getElementRects:oA,getClientRects:XR,getDimensions:rA,getScale:di,isElement:Yt,isRTL:lA};function I0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aA(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,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=u;if(s||t(),!p||!m)return;const w=Sl(d),y=Sl(i.clientWidth-(f+p)),S=Sl(i.clientHeight-(d+m)),v=Sl(f),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-v+"px",threshold:wt(0,er(1,a))||1};let C=!0;function E(N){const j=N[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!I0(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return l(!0),o}function uA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=vf(e),f=i||o?[...u?Io(u):[],...Io(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&s?aA(u,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(v=>{let[h]=v;h&&h.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!a&&m.observe(u),m.observe(t));let w,y=a?jr(e):null;a&&S();function S(){const v=jr(e);y&&!I0(y,v)&&n(),y=v,w=requestAnimationFrame(S)}return n(),()=>{var v;f.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d==null||d(),(v=m)==null||v.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const cA=MR,dA=OR,fA=RR,pA=DR,mA=AR,dh=_R,hA=LR,gA=(e,t,n)=>{const r=new Map,i={platform:sA,...n},o={...i.platform,_c:r};return TR(e,t,{...i,platform:o})};var yA=typeof document<"u",vA=function(){},Gl=yA?g.useLayoutEffect:vA;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 M0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fh(e,t){const n=M0(e);return Math.round(t*n)/n}function mu(e){const t=g.useRef(e);return Gl(()=>{t.current=e}),t}function xA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);Rs(p,r)||m(r);const[w,y]=g.useState(null),[S,v]=g.useState(null),h=g.useCallback(P=>{P!==N.current&&(N.current=P,y(P))},[]),x=g.useCallback(P=>{P!==j.current&&(j.current=P,v(P))},[]),C=o||w,E=l||S,N=g.useRef(null),j=g.useRef(null),T=g.useRef(f),L=a!=null,M=mu(a),A=mu(i),_=mu(u),H=g.useCallback(()=>{if(!N.current||!j.current)return;const P={placement:t,strategy:n,middleware:p};A.current&&(P.platform=A.current),gA(N.current,j.current,P).then(z=>{const k={...z,isPositioned:_.current!==!1};W.current&&!Rs(T.current,k)&&(T.current=k,ji.flushSync(()=>{d(k)}))})},[p,t,n,A,_]);Gl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[u]);const W=g.useRef(!1);Gl(()=>(W.current=!0,()=>{W.current=!1}),[]),Gl(()=>{if(C&&(N.current=C),E&&(j.current=E),C&&E){if(M.current)return M.current(C,E,H);H()}},[C,E,H,M,L]);const I=g.useMemo(()=>({reference:N,floating:j,setReference:h,setFloating:x}),[h,x]),O=g.useMemo(()=>({reference:C,floating:E}),[C,E]),B=g.useMemo(()=>{const P={position:n,left:0,top:0};if(!O.floating)return P;const z=fh(O.floating,f.x),k=fh(O.floating,f.y);return s?{...P,transform:"translate("+z+"px, "+k+"px)",...M0(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,O.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:H,refs:I,elements:O,floatingStyles:B}),[f,H,I,O,B])}const wA=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?dh({element:r.current,padding:i}).fn(n):{}:r?dh({element:r,padding:i}).fn(n):{}}}},SA=(e,t)=>({...cA(e),options:[e,t]}),kA=(e,t)=>({...dA(e),options:[e,t]}),CA=(e,t)=>({...hA(e),options:[e,t]}),bA=(e,t)=>({...fA(e),options:[e,t]}),NA=(e,t)=>({...pA(e),options:[e,t]}),EA=(e,t)=>({...mA(e),options:[e,t]}),jA=(e,t)=>({...wA(e),options:[e,t]});var PA="Arrow",O0=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(oe.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});O0.displayName=PA;var TA=O0,xf="Popper",[L0,D0]=lr(xf),[_A,z0]=L0(xf),F0=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return c.jsx(_A,{scope:t,anchor:r,onAnchorChange:i,children:n})};F0.displayName=xf;var B0="PopperAnchor",$0=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=z0(B0,n),l=g.useRef(null),s=ye(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:c.jsx(oe.div,{...i,ref:s})});$0.displayName=B0;var wf="PopperContent",[RA,AA]=L0(wf),U0=g.forwardRef((e,t)=>{var G,ee,me,ie,ce,pe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,S=z0(wf,n),[v,h]=g.useState(null),x=ye(t,Ue=>h(Ue)),[C,E]=g.useState(null),N=a0(C),j=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,L=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(u)?u:[u],_=A.length>0,H={padding:M,boundary:A.filter(MA),altBoundary:_},{refs:W,floatingStyles:I,placement:O,isPositioned:B,middlewareData:P}=xA({strategy:"fixed",placement:L,whileElementsMounted:(...Ue)=>uA(...Ue,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[SA({mainAxis:i+T,alignmentAxis:l}),a&&kA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?CA():void 0,...H}),a&&bA({...H}),NA({...H,apply:({elements:Ue,rects:nt,availableWidth:Jt,availableHeight:Dt})=>{const{width:Zt,height:Oi}=nt.reference,hn=Ue.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`)}}),C&&jA({element:C,padding:s}),OA({arrowWidth:j,arrowHeight:T}),p&&EA({strategy:"referenceHidden",...H})]}),[z,k]=W0(O),U=Zn(w);et(()=>{B&&(U==null||U())},[B,U]);const Q=(G=P.arrow)==null?void 0:G.x,b=(ee=P.arrow)==null?void 0:ee.y,ne=((me=P.arrow)==null?void 0:me.centerOffset)!==0,[de,re]=g.useState();return et(()=>{v&&re(window.getComputedStyle(v).zIndex)},[v]),c.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(" "),...((pe=P.hide)==null?void 0:pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(RA,{scope:n,placedSide:z,onArrowChange:E,arrowX:Q,arrowY:b,shouldHideArrow:ne,children:c.jsx(oe.div,{"data-side":z,"data-align":k,...y,ref:x,style:{...y.style,animation:B?void 0:"none"}})})})});U0.displayName=wf;var V0="PopperArrow",IA={top:"bottom",right:"left",bottom:"top",left:"right"},H0=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=AA(V0,r),l=IA[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(TA,{...i,ref:n,style:{...i.style,display:"block"}})})});H0.displayName=V0;function MA(e){return e!==null}var OA=e=>({name:"transformOrigin",options:e,fn(t){var S,v,h;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=W0(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((v=i.arrow)==null?void 0:v.x)??0)+s/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?d:`${p}px`,y=`${-a}px`):u==="top"?(w=l?d:`${p}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?d:`${m}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?d:`${m}px`),{data:{x:w,y}}}});function W0(e){const[t,n="center"]=e.split("-");return[t,n]}var LA=F0,DA=$0,zA=U0,FA=H0,K0=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"}),BA="VisuallyHidden",$A=g.forwardRef((e,t)=>c.jsx(oe.span,{...e,ref:t,style:{...K0,...e.style}}));$A.displayName=BA;var UA=[" ","Enter","ArrowUp","ArrowDown"],VA=[" ","Enter"],Pr="Select",[fa,pa,HA]=Ud(Pr),[Mi,PI]=lr(Pr,[HA,D0]),ma=D0(),[WA,ar]=Mi(Pr),[KA,GA]=Mi(Pr),G0=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:f,autoComplete:d,disabled:p,required:m,form:w}=e,y=ma(t),[S,v]=g.useState(null),[h,x]=g.useState(null),[C,E]=g.useState(!1),N=Zs(u),[j,T]=ki({prop:r,defaultProp:i??!1,onChange:o,caller:Pr}),[L,M]=ki({prop:l,defaultProp:s,onChange:a,caller:Pr}),A=g.useRef(null),_=S?w||!!S.closest("form"):!0,[H,W]=g.useState(new Set),I=Array.from(H).map(O=>O.props.value).join(";");return c.jsx(LA,{...y,children:c.jsxs(WA,{required:m,scope:t,trigger:S,onTriggerChange:v,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Xn(),value:L,onValueChange:M,open:j,onOpenChange:T,dir:N,triggerPointerDownPosRef:A,disabled:p,children:[c.jsx(fa.Provider,{scope:t,children:c.jsx(KA,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(O=>{W(B=>new Set(B).add(O))},[]),onNativeOptionRemove:g.useCallback(O=>{W(B=>{const P=new Set(B);return P.delete(O),P})},[]),children:n})}),_?c.jsxs(v1,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:L,onChange:O=>M(O.target.value),disabled:p,form:w,children:[L===void 0?c.jsx("option",{value:""}):null,Array.from(H)]},I):null]})})};G0.displayName=Pr;var Q0="SelectTrigger",Y0=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=ma(n),l=ar(Q0,n),s=l.disabled||r,a=ye(t,l.onTriggerChange),u=pa(n),f=g.useRef("touch"),[d,p,m]=w1(y=>{const S=u().filter(x=>!x.disabled),v=S.find(x=>x.value===l.value),h=S1(S,y,v);h!==void 0&&l.onValueChange(h.value)}),w=y=>{s||(l.onOpenChange(!0),m()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return c.jsx(DA,{asChild:!0,...o,children:c.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":x1(l.value)?"":void 0,...i,ref:a,onClick:Z(i.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&w(y)}),onPointerDown:Z(i.onPointerDown,y=>{f.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:Z(i.onKeyDown,y=>{const S=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&UA.includes(y.key)&&(w(),y.preventDefault())})})})});Y0.displayName=Q0;var X0="SelectValue",q0=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=ar(X0,n),{onValueNodeHasChildrenChange:u}=a,f=o!==void 0,d=ye(t,a.onValueNodeChange);return et(()=>{u(f)},[u,f]),c.jsx(oe.span,{...s,ref:d,style:{pointerEvents:"none"},children:x1(a.value)?c.jsx(c.Fragment,{children:l}):o})});q0.displayName=X0;var QA="SelectIcon",J0=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(oe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});J0.displayName=QA;var YA="SelectPortal",Z0=e=>c.jsx(Kd,{asChild:!0,...e});Z0.displayName=YA;var Tr="SelectContent",e1=g.forwardRef((e,t)=>{const n=ar(Tr,e.__scopeSelect),[r,i]=g.useState();if(et(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ji.createPortal(c.jsx(t1,{scope:e.__scopeSelect,children:c.jsx(fa.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(n1,{...e,ref:t})});e1.displayName=Tr;var $t=10,[t1,ur]=Mi(Tr),XA="SelectContentImpl",qA=Si("SelectContent.RemoveScroll"),n1=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S,...v}=e,h=ar(Tr,n),[x,C]=g.useState(null),[E,N]=g.useState(null),j=ye(t,G=>C(G)),[T,L]=g.useState(null),[M,A]=g.useState(null),_=pa(n),[H,W]=g.useState(!1),I=g.useRef(!1);g.useEffect(()=>{if(x)return zv(x)},[x]),jv();const O=g.useCallback(G=>{const[ee,...me]=_().map(pe=>pe.ref.current),[ie]=me.slice(-1),ce=document.activeElement;for(const pe of G)if(pe===ce||(pe==null||pe.scrollIntoView({block:"nearest"}),pe===ee&&E&&(E.scrollTop=0),pe===ie&&E&&(E.scrollTop=E.scrollHeight),pe==null||pe.focus(),document.activeElement!==ce))return},[_,E]),B=g.useCallback(()=>O([T,x]),[O,T,x]);g.useEffect(()=>{H&&B()},[H,B]);const{onOpenChange:P,triggerPointerDownPosRef:z}=h;g.useEffect(()=>{if(x){let G={x:0,y:0};const ee=ie=>{var ce,pe;G={x:Math.abs(Math.round(ie.pageX)-(((ce=z.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((pe=z.current)==null?void 0:pe.y)??0))}},me=ie=>{G.x<=10&&G.y<=10?ie.preventDefault():x.contains(ie.target)||P(!1),document.removeEventListener("pointermove",ee),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",me,{capture:!0})}}},[x,P,z]),g.useEffect(()=>{const G=()=>P(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[P]);const[k,U]=w1(G=>{const ee=_().filter(ce=>!ce.disabled),me=ee.find(ce=>ce.ref.current===document.activeElement),ie=S1(ee,G,me);ie&&setTimeout(()=>ie.ref.current.focus())}),Q=g.useCallback((G,ee,me)=>{const ie=!I.current&&!me;(h.value!==void 0&&h.value===ee||ie)&&(L(G),ie&&(I.current=!0))},[h.value]),b=g.useCallback(()=>x==null?void 0:x.focus(),[x]),ne=g.useCallback((G,ee,me)=>{const ie=!I.current&&!me;(h.value!==void 0&&h.value===ee||ie)&&A(G)},[h.value]),de=r==="popper"?Oc:r1,re=de===Oc?{side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return c.jsx(t1,{scope:n,content:x,viewport:E,onViewportChange:N,itemRefCallback:Q,selectedItem:T,onItemLeave:b,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:M,position:r,isPositioned:H,searchRef:k,children:c.jsx(Lv,{as:qA,allowPinchZoom:!0,children:c.jsx(Wd,{asChild:!0,trapped:h.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:Z(i,G=>{var ee;(ee=h.trigger)==null||ee.focus({preventScroll:!0}),G.preventDefault()}),children:c.jsx(Hd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(de,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:G=>G.preventDefault(),...v,...re,onPlaced:()=>W(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Z(v.onKeyDown,G=>{const ee=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ee&&G.key.length===1&&U(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ie=_().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ce=G.target,pe=ie.indexOf(ce);ie=ie.slice(pe+1)}setTimeout(()=>O(ie)),G.preventDefault()}})})})})})})});n1.displayName=XA;var JA="SelectItemAlignedPosition",r1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ar(Tr,n),l=ur(Tr,n),[s,a]=g.useState(null),[u,f]=g.useState(null),d=ye(t,j=>f(j)),p=pa(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:v,focusSelectedItem:h}=l,x=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&y&&S&&v){const j=o.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),M=v.getBoundingClientRect();if(o.dir!=="rtl"){const ce=M.left-T.left,pe=L.left-ce,Ue=j.left-pe,nt=j.width+Ue,Jt=Math.max(nt,T.width),Dt=window.innerWidth-$t,Zt=Es(pe,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=nt+"px",s.style.left=Zt+"px"}else{const ce=T.right-M.right,pe=window.innerWidth-L.right-ce,Ue=window.innerWidth-j.right-pe,nt=j.width+Ue,Jt=Math.max(nt,T.width),Dt=window.innerWidth-$t,Zt=Es(pe,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=nt+"px",s.style.right=Zt+"px"}const A=p(),_=window.innerHeight-$t*2,H=y.scrollHeight,W=window.getComputedStyle(u),I=parseInt(W.borderTopWidth,10),O=parseInt(W.paddingTop,10),B=parseInt(W.borderBottomWidth,10),P=parseInt(W.paddingBottom,10),z=I+O+H+P+B,k=Math.min(S.offsetHeight*5,z),U=window.getComputedStyle(y),Q=parseInt(U.paddingTop,10),b=parseInt(U.paddingBottom,10),ne=j.top+j.height/2-$t,de=_-ne,re=S.offsetHeight/2,G=S.offsetTop+re,ee=I+O+G,me=z-ee;if(ee<=ne){const ce=A.length>0&&S===A[A.length-1].ref.current;s.style.bottom="0px";const pe=u.clientHeight-y.offsetTop-y.offsetHeight,Ue=Math.max(de,re+(ce?b:0)+pe+B),nt=ee+Ue;s.style.height=nt+"px"}else{const ce=A.length>0&&S===A[0].ref.current;s.style.top="0px";const Ue=Math.max(ne,I+y.offsetTop+(ce?Q:0)+re)+me;s.style.height=Ue+"px",y.scrollTop=ee-ne+y.offsetTop}s.style.margin=`${$t}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,y,S,v,o.dir,r]);et(()=>x(),[x]);const[C,E]=g.useState();et(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const N=g.useCallback(j=>{j&&w.current===!0&&(x(),h==null||h(),w.current=!1)},[x,h]);return c.jsx(eI,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(oe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});r1.displayName=JA;var ZA="SelectPopperPosition",Oc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=$t,...o}=e,l=ma(n);return c.jsx(zA,{...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=ZA;var[eI,Sf]=Mi(Tr,{}),Lc="SelectViewport",i1=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ur(Lc,n),l=Sf(Lc,n),s=ye(t,o.onViewportChange),a=g.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(fa.Slot,{scope:n,children:c.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,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const m=Math.abs(a.current-f.scrollTop);if(m>0){const w=window.innerHeight-$t*2,y=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),v=Math.max(y,S);if(v0?C:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});i1.displayName=Lc;var o1="SelectGroup",[tI,nI]=Mi(o1),l1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Xn();return c.jsx(tI,{scope:n,id:i,children:c.jsx(oe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});l1.displayName=o1;var s1="SelectLabel",a1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=nI(s1,n);return c.jsx(oe.div,{id:i.id,...r,ref:t})});a1.displayName=s1;var As="SelectItem",[rI,u1]=Mi(As),c1=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=ar(As,n),a=ur(As,n),u=s.value===r,[f,d]=g.useState(o??""),[p,m]=g.useState(!1),w=ye(t,h=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,h,r,i)}),y=Xn(),S=g.useRef("touch"),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(rI,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:g.useCallback(h=>{d(x=>x||((h==null?void 0:h.textContent)??"").trim())},[]),children:c.jsx(fa.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:c.jsx(oe.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>m(!0)),onBlur:Z(l.onBlur,()=>m(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&v()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&v()}),onPointerDown:Z(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:Z(l.onPointerMove,h=>{var x;S.current=h.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,h=>{var x;h.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Z(l.onKeyDown,h=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&h.key===" "||(VA.includes(h.key)&&v(),h.key===" "&&h.preventDefault())})})})})});c1.displayName=As;var Ji="SelectItemText",d1=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ar(Ji,n),s=ur(Ji,n),a=u1(Ji,n),u=GA(Ji,n),[f,d]=g.useState(null),p=ye(t,v=>d(v),a.onItemTextChange,v=>{var h;return(h=s.itemTextRefCallback)==null?void 0:h.call(s,v,a.value,a.disabled)}),m=f==null?void 0:f.textContent,w=g.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return et(()=>(y(w),()=>S(w)),[y,S,w]),c.jsxs(c.Fragment,{children:[c.jsx(oe.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ji.createPortal(o.children,l.valueNode):null]})});d1.displayName=Ji;var f1="SelectItemIndicator",p1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u1(f1,n).isSelected?c.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});p1.displayName=f1;var Dc="SelectScrollUpButton",m1=g.forwardRef((e,t)=>{const n=ur(Dc,e.__scopeSelect),r=Sf(Dc,e.__scopeSelect),[i,o]=g.useState(!1),l=ye(t,r.onScrollButtonChange);return et(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(g1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});m1.displayName=Dc;var zc="SelectScrollDownButton",h1=g.forwardRef((e,t)=>{const n=ur(zc,e.__scopeSelect),r=Sf(zc,e.__scopeSelect),[i,o]=g.useState(!1),l=ye(t,r.onScrollButtonChange);return et(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,f=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(g1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});h1.displayName=zc;var g1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ur("SelectScrollButton",n),l=g.useRef(null),s=pa(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),et(()=>{var f;const u=s().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),c.jsx(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 u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{a()})})}),iI="SelectSeparator",y1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});y1.displayName=iI;var Fc="SelectArrow",oI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ma(n),o=ar(Fc,n),l=ur(Fc,n);return o.open&&l.position==="popper"?c.jsx(FA,{...i,...r,ref:t}):null});oI.displayName=Fc;var lI="SelectBubbleInput",v1=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ye(r,i),l=s0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),c.jsx(oe.select,{...n,style:{...K0,...n.style},ref:o,defaultValue:t})});v1.displayName=lI;function x1(e){return e===""||e===void 0}function w1(e){const t=Zn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function S1(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=sI(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function sI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aI=G0,k1=Y0,uI=q0,cI=J0,dI=Z0,C1=e1,fI=i1,pI=l1,b1=a1,N1=c1,mI=d1,hI=p1,E1=m1,j1=h1,P1=y1;const kf=aI,fi=pI,Cf=uI,ha=g.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(k1,{ref:r,className:ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(cI,{asChild:!0,children:c.jsx(Wy,{className:"h-4 w-4 opacity-50"})})]}));ha.displayName=k1.displayName;const T1=g.forwardRef(({className:e,...t},n)=>c.jsx(E1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(eb,{className:"h-4 w-4"})}));T1.displayName=E1.displayName;const _1=g.forwardRef(({className:e,...t},n)=>c.jsx(j1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Wy,{className:"h-4 w-4"})}));_1.displayName=j1.displayName;const ga=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(dI,{children:c.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:[c.jsx(T1,{}),c.jsx(fI,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(_1,{})]})}));ga.displayName=C1.displayName;const wr=g.forwardRef(({className:e,...t},n)=>c.jsx(b1,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));wr.displayName=b1.displayName;const Bn=g.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(N1,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(hI,{children:c.jsx(YC,{className:"h-4 w-4"})})}),c.jsx(mI,{children:t})]}));Bn.displayName=N1.displayName;const gI=g.forwardRef(({className:e,...t},n)=>c.jsx(P1,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));gI.displayName=P1.displayName;function yI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:s}){return c.jsxs(c.Fragment,{children:[c.jsxs(Je,{children:[c.jsx(It,{children:c.jsx(Mt,{className:"text-base",children:"Model"})}),c.jsx(mt,{className:"space-y-4",children:c.jsx("div",{children:c.jsxs(kf,{value:t||"",onValueChange:n,children:[c.jsx(ha,{className:"w-full",children:c.jsx(Cf,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(f=>f.model_name===t);if(!a)return t;const u=a.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[u?c.jsx(Ss,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?c.jsx(wi,{className:"h-4 w-4 text-purple-500"}):c.jsx(mc,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:a.name}),r===t?c.jsx(xe,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(xe,{variant:"outline",className:"text-xs",children:u?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(ga,{children:[c.jsxs(fi,{children:[c.jsx(wr,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>c.jsx(Bn,{value:a.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ss,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:a.name}),c.jsx(xe,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),c.jsxs(fi,{children:[c.jsx(wr,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>c.jsx(Bn,{value:a.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?c.jsx(wi,{className:"h-4 w-4 text-purple-500"}):c.jsx(mc,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:a.name}),r===a.model_name?c.jsx(xe,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?c.jsx(xe,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):c.jsx(xe,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})})})]}),c.jsxs(Je,{children:[c.jsx(It,{children:c.jsx(Mt,{className:"text-base",children:"Parameters"})}),c.jsxs(mt,{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx(qe,{className:"text-sm font-medium",children:"Temperature"}),c.jsx(xe,{variant:"outline",className:"text-xs",children:i})]}),c.jsx(js,{value:[i],onValueChange:a=>o(a[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),c.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[c.jsx("span",{children:"0.0 (Focused)"}),c.jsx("span",{children:"1.0 (Balanced)"}),c.jsx("span",{children:"2.0 (Creative)"})]}),c.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"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx(qe,{className:"text-sm font-medium",children:"Max Tokens"}),c.jsx(xe,{variant:"outline",className:"text-xs",children:l})]}),c.jsx(js,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),c.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[c.jsx("span",{children:"50 (Short)"}),c.jsx("span",{children:"1024 (Medium)"}),c.jsx("span",{children:"4000 (Long)"})]}),c.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 vI({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:s,clearCurrentAssistant:a,openRenameDialog:u,systemPrompt:f}){const d=y=>{if(y==="create_new")s();else if(y==="clear_current")a();else if(y.startsWith("user_")){const S=y.replace("user_","");t(S)}else i(y)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=y=>{switch(y){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 c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(qe,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),c.jsxs(kf,{value:p(),onValueChange:d,children:[c.jsx(ha,{className:"w-full",children:c.jsx(Cf,{placeholder:`Choose assistant (${w} available)`,children:l?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Zr,{className:"h-4 w-4"}),c.jsx("span",{children:l.name}),l.originalTemplate&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),c.jsx(xe,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Zr,{className:"h-4 w-4"}),c.jsx("span",{children:"Choose assistant"}),c.jsx(xe,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),c.jsxs(ga,{children:[c.jsxs(fi,{children:[c.jsxs(wr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(ks,{className:"h-4 w-4"}),"Actions"]}),c.jsx(Bn,{value:"create_new",children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(ks,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),c.jsx(xe,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&c.jsx(Bn,{value:"clear_current",children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Jy,{className:"h-4 w-4 text-gray-600"}),c.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),c.jsx(xe,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&c.jsxs(fi,{children:[c.jsxs(wr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(Fd,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(y=>c.jsx(Bn,{value:`user_${y.id}`,children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Zr,{className:"h-4 w-4 text-blue-600"}),c.jsx("span",{className:"truncate flex-1",children:y.name}),c.jsx(xe,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${y.id}`))]}),r.length>0&&c.jsxs(fi,{children:[c.jsxs(wr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(WC,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(y=>c.jsx(Bn,{value:y.name,children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Zr,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"truncate flex-1",children:y.name}),c.jsx(xe,{variant:"outline",className:"text-xs",children:"Template"})]})},y.name))]}),w===0&&c.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&c.jsxs(Me,{onClick:u,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[c.jsx(li,{className:"h-4 w-4 mr-2"}),"Rename"]}),c.jsxs(Me,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!f.trim(),children:[c.jsx(Yy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function xI({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 c.jsxs("div",{className:"space-y-4 pb-6",children:[c.jsxs(Je,{children:[c.jsx(It,{children:c.jsx(Mt,{className:"text-base",children:"System Instructions"})}),c.jsx(mt,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(qe,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),c.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}),c.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"text-sm flex items-center",children:[c.jsx(wi,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),c.jsx(mt,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsx(qe,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),c.jsxs(kf,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[c.jsx(ha,{className:"w-full h-10",children:c.jsx(Cf,{placeholder:"Select example prompt..."})}),c.jsx(ga,{children:c.jsxs(fi,{children:[c.jsx(wr,{children:"Example Prompts"}),r.map((o,l)=>c.jsx(Bn,{value:l.toString(),children:c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-sm",children:o.title}),c.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"text-sm flex items-center",children:[c.jsx(Js,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),c.jsx(mt,{children:c.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>c.jsxs("li",{className:"flex items-start",children:[c.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 wI({isLoading:e,ragEnabled:t,setRagEnabled:n,retrievalCount:r,setRetrievalCount:i,currentAssistant:o}){const[l,s]=g.useState([]),[a,u]=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 y=Object.entries(w.documents).map(([S,v])=>({id:S,name:v.filename,size:0,type:v.file_type,uploadedAt:new Date().toISOString(),status:v.status,chunks:v.chunks,assistantId:v.assistant_id||null}));s(y)}}}catch(m){console.error("Error loading documents:",m)}})()},[o]);const f=async p=>{const m=p.target.files;if(!(!m||!o)){u(!0);try{const w=new FormData;w.append("assistant_id",o.id);for(const S of Array.from(m))w.append("files",S);const y=await fetch("/rag/upload",{method:"POST",body:w});if(y.ok){const S=await y.json(),v=S.results.filter(x=>x.success).map(x=>({id:x.doc_id,name:x.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:x.chunks,assistantId:o==null?void 0:o.id}));s(x=>[...x,...v]);const h=S.results.filter(x=>!x.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",y.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{u(!1)}}},d=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?s(w=>w.filter(y=>y.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),s(w=>w.filter(y=>y.id!==p))}};return c.jsx("div",{className:"space-y-4 pb-6",children:o?c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Fd,{className:"h-4 w-4 text-blue-600"}),c.jsx("span",{children:o.name}),c.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"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(qe,{className:"text-xs text-muted-foreground",children:"RAG"}),c.jsx("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked),className:"rounded",disabled:e||l.length===0}),t&&l.length>0&&c.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[c.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),c.jsx("span",{className:"text-xs font-medium",children:"Active"})]})]})]})}),c.jsxs(mt,{className:"space-y-4",children:[t&&c.jsxs("div",{className:"border-l-2 border-blue-200 pl-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qe,{className:"text-xs font-medium",children:"Retrieval Depth"}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," chunks"]})]}),c.jsx(js,{value:[r],onValueChange:p=>i(p[0]),max:10,min:1,step:1,className:"w-full"})]}),c.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-4 text-center hover:border-gray-300 transition-colors",children:[c.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:f,className:"hidden",disabled:a||e}),c.jsxs(qe,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[c.jsx(Db,{className:"h-6 w-6 text-gray-400"}),c.jsx("span",{className:"text-sm",children:a?"Uploading...":"Drop files or click to upload"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(qe,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),t&&c.jsxs("span",{className:"text-xs text-green-600",children:["Using ",Math.min(r,l.length)," for context"]})]}),c.jsx("div",{className:"space-y-1",children:l.map(p=>c.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[c.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[c.jsx(cb,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),c.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&c.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),c.jsx(Me,{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:c.jsx(Jy,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&c.jsx("div",{className:"text-center py-3",children:c.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]}):c.jsx(Je,{children:c.jsxs(mt,{className:"pt-6 text-center",children:[c.jsx(qs,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an assistant to manage documents"})]})})})}function SI(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:s,sendMessage:a,stopGeneration:u,isLoading:f,selectedModel:d,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:y,setTemperature:S,maxTokens:v,setMaxTokens:h}=Z_(),[x,C]=g.useState(!1),[E,N]=g.useState(3),[j,T]=g.useState(!1),[L,M]=g.useState(!1),[A,_]=g.useState(null),[H,W]=g.useState(!1),[I,O]=g.useState(null),[B,P]=g.useState([]),[z,k]=g.useState([]),[U,Q]=g.useState(null),[b,ne]=g.useState(!1),[de,re]=g.useState(""),[G,ee]=g.useState(!1),[me,ie]=g.useState(""),ce=()=>{try{const D=JSON.parse(localStorage.getItem("savedAssistants")||"[]");k(D)}catch(D){console.error("Failed to load saved assistants:",D)}},pe=()=>{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)},Ue=()=>{if(!de.trim()||!m.trim())return;const D={id:Date.now().toString(),name:de.trim(),systemPrompt:m,temperature:y,maxTokens:v,model:d,ragEnabled:x,retrievalCount:E,documents:[],createdAt:new Date().toISOString()},X=[...z,D];k(X),localStorage.setItem("savedAssistants",JSON.stringify(X)),Q({id:D.id,name:D.name,type:"user"}),ne(!1),re("")},nt=()=>{ne(!1),re("")},Jt=D=>{const X=z.find(he=>he.id===D);X&&(w(X.systemPrompt),S(X.temperature),h(X.maxTokens),C(X.ragEnabled||!1),N(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(he=>he.name===D);X&&(w(X.prompt),C(!1),N(3),Q({id:D,name:X.name,type:"template"}))},Oi=()=>{w(""),S(.7),h(1024),C(!1),N(3),Q({id:"new_assistant",name:"New Assistant",type:"new"})},hn=()=>{Q(null)},Ko=()=>{U&&(ie(U.name),ee(!0))},Go=()=>{if(!U||!me.trim())return;const D={...U,name:me.trim()};if(Q(D),U.type==="user"){const X=z.map(he=>he.id===U.id?{...he,name:me.trim()}:he);k(X),localStorage.setItem("savedAssistants",JSON.stringify(X))}ee(!1),ie("")},Qo=()=>{ee(!1),ie("")},ya=()=>({name:(U==null?void 0:U.name)||"Default Assistant",type:(U==null?void 0:U.type)||"default",systemPrompt:m,temperature:y,maxTokens:v,originalTemplate:U==null?void 0:U.originalTemplate}),cr=()=>{U&&U.type==="template"&&Q({id:"new_assistant",name:`Custom ${U.name}`,type:"new",originalTemplate:U.name})},va=D=>{w(D),cr()},R=D=>{S(D),cr()},V=D=>{h(D),cr()},q=D=>{C(D),cr()},le=D=>{N(D),cr()};g.useEffect(()=>{zt(),ce()},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:j,configCollapsed:L,sessionsCount:e.length,currentSessionId:t})},[j,L,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(Le=>Le.model_name===d);if(!X)return;const he=`${window.location.protocol}//${window.location.host}`;if(X.type==="local"&&!X.is_loaded){O(X),W(!0);return}const Se=B.filter(Le=>Le.type==="local"&&Le.is_loaded&&Le.model_name!==d);for(const Le of Se)try{(await fetch(`${he}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Le.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Le.model_name}`)}catch(st){console.error(`Error auto-unloading model ${Le.model_name}:`,st)}Se.length>0&&zt()})()},[d,B]);const ve=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 he=B.find(Se=>Se.type==="api");he&&p(he.model_name)}}catch(D){console.error("Error loading model:",D);const X=B.find(he=>he.type==="api");X&&p(X.model_name)}finally{_(null),O(null)}}},yt=()=>{W(!1),O(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}`,he=B.filter(Se=>Se.type==="local"&&Se.is_loaded);for(const Se of he)try{await fetch(`${X}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Se.model_name})}),console.log(`✅ Cleanup: unloaded ${Se.model_name}`)}catch(Le){console.error(`Error cleaning up model ${Se.model_name}:`,Le)}};return()=>{D()}},[B]);const zt=async()=>{try{const D=`${window.location.protocol}//${window.location.host}`,X=await fetch(`${D}/models`);if(X.ok){const he=await X.json();if(P(he.models),he.current_model&&d!==he.current_model)p(he.current_model);else if(!d&&he.models.length>0){const Le=he.models.find(st=>st.type==="api")||he.models[0];p(Le.model_name)}}}catch(D){console.error("Failed to fetch models:",D)}};return c.jsxs("div",{className:"h-screen bg-background flex",children:[c.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${j?"w-12":"w-80"} + `,children:c.jsxs("div",{className:"p-4 space-y-4 h-full",children:[c.jsxs("div",{className:`flex items-center ${j?"justify-center":"justify-between"}`,children:[!j&&c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs("div",{className:"flex gap-1",children:[!j&&c.jsxs(Me,{onClick:i,size:"sm",children:[c.jsx(ks,{className:"h-4 w-4 mr-1"}),"New"]}),c.jsx(Me,{onClick:()=>T(!j),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:j?"Expand Sessions":"Collapse Sessions",children:j?c.jsx(Gp,{className:"h-4 w-4"}):c.jsx(Kp,{className:"h-4 w-4"})})]})]}),j&&c.jsx(Me,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:c.jsx(ks,{className:"h-4 w-4"})}),c.jsxs("div",{className:"space-y-2",children:[!j&&e.map(D=>c.jsxs(Je,{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:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:D.title}),c.jsx(Me,{size:"sm",variant:"ghost",onClick:X=>{X.stopPropagation(),r(D.id)},className:"h-6 w-6 p-0",children:c.jsx(Xy,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[D.messages.length," messages"]})]},D.id)),j&&e.map(D=>c.jsxs(Me,{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:[c.jsx(Js,{className:"h-4 w-4"}),D.messages&&D.messages.length>0&&c.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))]})]})}),c.jsx("div",{className:"flex-1 flex flex-col h-full",children:c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsx("div",{className:"flex-1 flex flex-col",children:c.jsx(o0,{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(Se=>Se.model_name===d))return;const X=ya();await a(X,{useRag:x,retrievalCount:E})},isGenerating:f,stop:u,className:"flex-1"})}),c.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${L?"w-12":"w-[480px] xl:w-[520px]"} + `,children:c.jsxs("div",{className:"p-4 space-y-4 h-full",children:[c.jsxs("div",{className:`flex items-center ${L?"justify-center":"justify-between"}`,children:[!L&&c.jsx("h2",{className:"font-semibold",children:"Configuration"}),c.jsx("div",{className:"flex gap-1",children:c.jsx(Me,{onClick:()=>M(!L),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:L?"Expand Configuration":"Collapse Configuration",children:L?c.jsx(Kp,{className:"h-4 w-4"}):c.jsx(Gp,{className:"h-4 w-4"})})})]}),L&&c.jsx(Me,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:c.jsx(li,{className:"h-4 w-4"})}),c.jsx("div",{className:"space-y-2",children:!L&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:c.jsx(vI,{savedAssistants:z,loadSavedAssistant:Jt,openSaveDialog:pe,presets:Dt,onPresetSelect:Zt,isLoading:f,selectedAssistant:U,createNewAssistant:Oi,clearCurrentAssistant:hn,openRenameDialog:Ko,systemPrompt:m})}),c.jsxs(RN,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[c.jsxs(Sv,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[c.jsxs(Ml,{value:"parameters",className:"flex items-center gap-2",children:[c.jsx(Tb,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),c.jsxs(Ml,{value:"instructions",className:"flex items-center gap-2",children:[c.jsx(li,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),c.jsxs(Ml,{value:"documents",className:"flex items-center gap-2",children:[c.jsx(qs,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),c.jsxs("div",{className:"flex-1 overflow-hidden",children:[c.jsx(Ol,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(yI,{models:B,selectedModel:d,setSelectedModel:p,autoLoadingModel:A,temperature:y,setTemperature:R,maxTokens:v,setMaxTokens:V})}),c.jsx(Ol,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(xI,{systemPrompt:m,setSystemPrompt:va,isLoading:f})}),c.jsx(Ol,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(wI,{isLoading:f,ragEnabled:x,setRagEnabled:q,retrievalCount:E,setRetrievalCount:le,currentAssistant:U})})]})]})]})})]})})]})}),c.jsx(tu,{open:H,onOpenChange:W,children:c.jsxs(zl,{children:[c.jsxs(Fl,{children:[c.jsx($l,{children:"Load Local Model"}),c.jsxs(Ul,{children:["Loading ",c.jsx("strong",{children:I==null?void 0:I.name})," will use approximately ",c.jsx("strong",{children:I==null?void 0:I.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),c.jsxs(Bl,{children:[c.jsx(Hl,{onClick:yt,children:"Cancel"}),c.jsx(Vl,{onClick:ve,children:"Load Model"})]})]})}),c.jsx(tu,{open:b,onOpenChange:ne,children:c.jsxs(zl,{children:[c.jsxs(Fl,{children:[c.jsx($l,{children:"Save Assistant"}),c.jsx(Ul,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(qe,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),c.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()&&Ue(),D.key==="Escape"&&nt()}}),c.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[de.length,"/100 characters"]})]}),c.jsxs(Bl,{children:[c.jsx(Hl,{onClick:nt,children:"Cancel"}),c.jsxs(Vl,{onClick:Ue,disabled:!de.trim(),children:[c.jsx(Yy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),c.jsx(tu,{open:G,onOpenChange:ee,children:c.jsxs(zl,{children:[c.jsxs(Fl,{children:[c.jsx($l,{children:"Rename Assistant"}),c.jsxs(Ul,{children:['Enter a new name for "',U==null?void 0:U.name,'".']})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(qe,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),c.jsx("input",{id:"rename-assistant-name",type:"text",value:me,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"&&me.trim()&&Go(),D.key==="Escape"&&Qo()}}),c.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[me.length,"/100 characters"]})]}),c.jsxs(Bl,{children:[c.jsx(Hl,{onClick:Qo,children:"Cancel"}),c.jsxs(Vl,{onClick:Go,disabled:!me.trim(),children:[c.jsx(li,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function kI(){const e=Dd(),[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)}},a=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)}},u=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?c.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:c.jsx(pc,{className:"h-8 w-8 animate-spin"})}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(qs,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),c.jsxs(Me,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[c.jsx(mc,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsx(Je,{className:"bg-blue-50 border-blue-200",children:c.jsx(mt,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Qy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),c.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Load models to use them in the playground. Models are cached locally for faster access. Each model requires significant storage space and initial download time."})]})]})})}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(Ss,{className:"h-5 w-5"}),"API Models",c.jsx(xe,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(f=>f.type==="api").map(f=>c.jsx(ph,{model:f,modelLoading:o,onLoad:a,onUnload:u},f.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(Gy,{className:"h-5 w-5"}),"Local Models",c.jsx(xe,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(f=>f.type==="local").map(f=>c.jsx(ph,{model:f,modelLoading:o,onLoad:a,onUnload:u},f.model_name))})]})]})})]})}function ph({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return c.jsxs(Je,{className:"hover:shadow-md transition-shadow",children:[c.jsx(It,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs(Mt,{className:"text-base flex items-center gap-2",children:[i?c.jsx(Ss,{className:"h-4 w-4 text-blue-600"}):c.jsx(Gy,{className:"h-4 w-4 text-green-600"}),e.name]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&c.jsx(nb,{className:"h-5 w-5 text-green-600"})]})}),c.jsxs(mt,{className:"space-y-3",children:[c.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Size:"}),c.jsx(xe,{variant:"outline",className:"text-xs",children:e.size_gb})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),c.jsx(xe,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Type:"}),c.jsx(xe,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Features:"}),c.jsxs(xe,{variant:"outline",className:"text-xs",children:[c.jsx(wi,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),c.jsx("div",{className:"pt-2",children:l?c.jsxs(Me,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(pc,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(Xy,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):c.jsxs(Me,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(pc,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(lb,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function CI(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:c.jsx(li,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"flex items-center gap-2",children:[c.jsx(Nb,{className:"h-5 w-5"}),"Server Configuration"]})}),c.jsx(mt,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(qe,{className:"text-sm font-medium",children:"Backend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),c.jsxs("div",{children:[c.jsx(qe,{className:"text-sm font-medium",children:"Frontend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"flex items-center gap-2",children:[c.jsx(Yp,{className:"h-5 w-5"}),"Privacy & Security"]})}),c.jsx(mt,{className:"space-y-4",children:c.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Yp,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),c.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),c.jsxs(Je,{children:[c.jsx(It,{children:c.jsxs(Mt,{className:"flex items-center gap-2",children:[c.jsx(Qy,{className:"h-5 w-5"}),"System Information"]})}),c.jsx(mt,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(qe,{className:"text-sm font-medium",children:"Platform"}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx(xe,{variant:"outline",children:"Local"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),c.jsxs("div",{children:[c.jsx(qe,{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"mt-1",children:c.jsx(xe,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function bI(){return c.jsx(rC,{children:c.jsx(Xk,{children:c.jsxs(Br,{path:"/",element:c.jsx(Wb,{}),children:[c.jsx(Br,{index:!0,element:c.jsx(nN,{})}),c.jsx(Br,{path:"playground",element:c.jsx(SI,{})}),c.jsx(Br,{path:"models",element:c.jsx(kI,{})}),c.jsx(Br,{path:"settings",element:c.jsx(CI,{})})]})})})}hu.createRoot(document.getElementById("root")).render(c.jsx(Vt.StrictMode,{children:c.jsx(bI,{})})); +//# sourceMappingURL=index-27738cd1.js.map