diff --git "a/static/assets/index-0700955c.js" "b/static/assets/index-0700955c.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-0700955c.js" @@ -0,0 +1,330 @@ +function N1(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qh={exports:{}},ys={},Jh={exports:{}},re={};/** + * @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 ji=Symbol.for("react.element"),P1=Symbol.for("react.portal"),j1=Symbol.for("react.fragment"),T1=Symbol.for("react.strict_mode"),_1=Symbol.for("react.profiler"),A1=Symbol.for("react.provider"),R1=Symbol.for("react.context"),I1=Symbol.for("react.forward_ref"),M1=Symbol.for("react.suspense"),L1=Symbol.for("react.memo"),O1=Symbol.for("react.lazy"),af=Symbol.iterator;function D1(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},em=Object.assign,tm={};function go(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}go.prototype.isReactComponent={};go.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")};go.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nm(){}nm.prototype=go.prototype;function Sc(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}var kc=Sc.prototype=new nm;kc.constructor=Sc;em(kc,go.prototype);kc.isPureReactComponent=!0;var uf=Array.isArray,rm=Object.prototype.hasOwnProperty,Cc={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function im(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)rm.call(t,r)&&!om.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,Y=j[G];if(0>>1;Go(Pe,k))Uo(B,Pe)?(j[G]=B,j[U]=k,G=U):(j[G]=Pe,j[de]=k,G=de);else if(Uo(B,k))j[G]=B,j[U]=k,G=U;else break e}}return D}function o(j,D){var k=j.sortIndex-D.sortIndex;return k!==0?k:j.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],c=1,d=null,p=3,h=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=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(j){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=j)r(u),D.sortIndex=D.expirationTime,t(a,D);else break;D=n(u)}}function C(j){if(v=!1,x(j),!w)if(n(a)!==null)w=!0,$(N);else{var D=n(u);D!==null&&W(C,D.startTime-j)}}function N(j,D){w=!1,v&&(v=!1,g(T),T=-1),h=!0;var k=p;try{for(x(D),d=n(a);d!==null&&(!(d.expirationTime>D)||j&&!I());){var G=d.callback;if(typeof G=="function"){d.callback=null,p=d.priorityLevel;var Y=G(d.expirationTime<=D);D=e.unstable_now(),typeof Y=="function"?d.callback=Y:d===n(a)&&r(a),x(D)}else r(a);d=n(a)}if(d!==null)var b=!0;else{var de=n(u);de!==null&&W(C,de.startTime-D),b=!1}return b}finally{d=null,p=k,h=!1}}var E=!1,P=null,T=-1,L=5,A=-1;function I(){return!(e.unstable_now()-Aj||125G?(j.sortIndex=k,t(u,j),n(a)===null&&j===n(u)&&(v?(g(T),T=-1):v=!0,W(C,k-G))):(j.sortIndex=Y,t(a,j),w||h||(w=!0,$(N))),j},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(j){var D=p;return function(){var k=p;p=D;try{return j.apply(this,arguments)}finally{p=k}}}})(cm);um.exports=cm;var Q1=um.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 Y1=y,gt=Q1;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ya=Object.prototype.hasOwnProperty,X1=/^[: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]*$/,df={},ff={};function q1(e){return Ya.call(ff,e)?!0:Ya.call(df,e)?!1:X1.test(e)?ff[e]=!0:(df[e]=!0,!1)}function J1(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 Z1(e,t,n,r){if(t===null||typeof t>"u"||J1(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 Je(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Je(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){Be[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nc=/[\-:]([a-z])/g;function Pc(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(Nc,Pc);Be[t]=new Je(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(Nc,Pc);Be[t]=new Je(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(Nc,Pc);Be[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function jc(e,t,n,r){var o=Be.hasOwnProperty(t)?Be[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var a=` +`+o[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{ta=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$o(e):""}function ew(e){switch(e.tag){case 5:return $o(e.type);case 16:return $o("Lazy");case 13:return $o("Suspense");case 19:return $o("SuspenseList");case 0:case 2:case 15:return e=na(e.type,!1),e;case 11:return e=na(e.type.render,!1),e;case 1:return e=na(e.type,!0),e;default:return""}}function Za(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 Dr:return"Fragment";case Or:return"Portal";case Xa:return"Profiler";case Tc:return"StrictMode";case qa:return"Suspense";case Ja:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pm:return(e.displayName||"Context")+".Consumer";case fm:return(e._context.displayName||"Context")+".Provider";case _c:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ac:return t=e.displayName||null,t!==null?t:Za(e.type)||"Memo";case jn:t=e._payload,e=e._init;try{return Za(e(t))}catch{}}return null}function tw(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 Za(t);case 8:return t===Tc?"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 Wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nw(e){var t=mm(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.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 Vi(e){e._valueTracker||(e._valueTracker=nw(e))}function gm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ml(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 eu(e,t){var n=t.checked;return Ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wn(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 ym(e,t){t=t.checked,t!=null&&jc(e,"checked",t,!1)}function tu(e,t){ym(e,t);var n=Wn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&nu(e,t.type,Wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nu(e,t,n){(t!=="number"||Ml(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Uo=Array.isArray;function Qr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Hi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ii(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ko={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},rw=["Webkit","ms","Moz","O"];Object.keys(Ko).forEach(function(e){rw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ko[t]=Ko[e]})});function Sm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ko.hasOwnProperty(e)&&Ko[e]?(""+t).trim():t+"px"}function km(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Sm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ow=Ne({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 iu(e,t){if(t){if(ow[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function lu(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 su=null;function Rc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var au=null,Yr=null,Xr=null;function vf(e){if(e=Ai(e)){if(typeof au!="function")throw Error(z(280));var t=e.stateNode;t&&(t=ks(t),au(e.stateNode,e.type,t))}}function Cm(e){Yr?Xr?Xr.push(e):Xr=[e]:Yr=e}function bm(){if(Yr){var e=Yr,t=Xr;if(Xr=Yr=null,vf(e),t)for(e=0;e>>=0,e===0?32:31-(mw(e)/gw|0)|0}var Wi=64,Ki=4194304;function Vo(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,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=Vo(s):(i&=l,i!==0&&(r=Vo(i)))}else l=n&~o,l!==0?r=Vo(l):i!==0&&(r=Vo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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 Ti(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function ww(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=Qo),Pf=String.fromCharCode(32),jf=!1;function Hm(e,t){switch(e){case"keyup":return Qw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function Xw(e,t){switch(e){case"compositionend":return Wm(t);case"keypress":return t.which!==32?null:(jf=!0,Pf);case"textInput":return e=t.data,e===Pf&&jf?null:e;default:return null}}function qw(e,t){if(zr)return e==="compositionend"||!Bc&&Hm(e,t)?(e=Um(),yl=Dc=Rn=null,zr=!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=Rf(n)}}function Ym(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ym(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xm(){for(var e=window,t=Ml();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ml(e.document)}return t}function $c(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 lS(e){var t=Xm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ym(n.ownerDocument.documentElement,n)){if(r!==null&&$c(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=If(n,i);var l=If(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>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,Fr=null,hu=null,Xo=null,mu=!1;function Mf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mu||Fr==null||Fr!==Ml(r)||(r=Fr,"selectionStart"in r&&$c(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}),Xo&&di(Xo,r)||(Xo=r,r=$l(hu,"onSelect"),0Ur||(e.current=Su[Ur],Su[Ur]=null,Ur--)}function ye(e,t){Ur++,Su[Ur]=e.current,e.current=t}var Kn={},He=qn(Kn),nt=qn(!1),mr=Kn;function lo(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function Vl(){Se(nt),Se(He)}function $f(e,t,n){if(He.current!==Kn)throw Error(z(168));ye(He,t),ye(nt,n)}function ig(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,tw(e)||"Unknown",o));return Ne({},n,r)}function Hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,mr=He.current,ye(He,e),ye(nt,nt.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=ig(e,t,mr),r.__reactInternalMemoizedMergedChildContext=e,Se(nt),Se(He),ye(He,e)):Se(nt),ye(nt,n)}var un=null,Cs=!1,ga=!1;function lg(e){un===null?un=[e]:un.push(e)}function vS(e){Cs=!0,lg(e)}function Jn(){if(!ga&&un!==null){ga=!0;var e=0,t=he;try{var n=un;for(he=1;e>=l,o-=l,cn=1<<32-Dt(t)+o|n<T?(L=P,P=null):L=P.sibling;var A=p(g,P,x[T],C);if(A===null){P===null&&(P=L);break}e&&P&&A.alternate===null&&t(g,P),m=i(A,m,T),E===null?N=A:E.sibling=A,E=A,P=L}if(T===x.length)return n(g,P),ke&&lr(g,T),N;if(P===null){for(;TT?(L=P,P=null):L=P.sibling;var I=p(g,P,A.value,C);if(I===null){P===null&&(P=L);break}e&&P&&I.alternate===null&&t(g,P),m=i(I,m,T),E===null?N=I:E.sibling=I,E=I,P=L}if(A.done)return n(g,P),ke&&lr(g,T),N;if(P===null){for(;!A.done;T++,A=x.next())A=d(g,A.value,C),A!==null&&(m=i(A,m,T),E===null?N=A:E.sibling=A,E=A);return ke&&lr(g,T),N}for(P=r(g,P);!A.done;T++,A=x.next())A=h(P,g,T,A.value,C),A!==null&&(e&&A.alternate!==null&&P.delete(A.key===null?T:A.key),m=i(A,m,T),E===null?N=A:E.sibling=A,E=A);return e&&P.forEach(function(_){return t(g,_)}),ke&&lr(g,T),N}function S(g,m,x,C){if(typeof x=="object"&&x!==null&&x.type===Dr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ui:e:{for(var N=x.key,E=m;E!==null;){if(E.key===N){if(N=x.type,N===Dr){if(E.tag===7){n(g,E.sibling),m=o(E,x.props.children),m.return=g,g=m;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===jn&&Wf(N)===E.type){n(g,E.sibling),m=o(E,x.props),m.ref=Mo(g,E,x),m.return=g,g=m;break e}n(g,E);break}else t(g,E);E=E.sibling}x.type===Dr?(m=hr(x.props.children,g.mode,C,x.key),m.return=g,g=m):(C=El(x.type,x.key,x.props,null,g.mode,C),C.ref=Mo(g,m,x),C.return=g,g=C)}return l(g);case Or:e:{for(E=x.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(g,m.sibling),m=o(m,x.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=ba(x,g.mode,C),m.return=g,g=m}return l(g);case jn:return E=x._init,S(g,m,E(x._payload),C)}if(Uo(x))return w(g,m,x,C);if(To(x))return v(g,m,x,C);Zi(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,x),m.return=g,g=m):(n(g,m),m=Ca(x,g.mode,C),m.return=g,g=m),l(g)):n(g,m)}return S}var ao=cg(!0),dg=cg(!1),Gl=qn(null),Ql=null,Wr=null,Wc=null;function Kc(){Wc=Wr=Ql=null}function Gc(e){var t=Gl.current;Se(Gl),e._currentValue=t}function bu(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 Jr(e,t){Ql=e,Wc=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(tt=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(Wc!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(Ql===null)throw Error(z(308));Wr=e,Ql.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var cr=null;function Qc(e){cr===null?cr=[e]:cr.push(e)}function fg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Qc(t)):(n.next=o.next,o.next=n),t.interleaved=n,mn(e,r)}function mn(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 Tn=!1;function Yc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pg(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 fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mn(e,n)}return o=r.interleaved,o===null?(t.next=t,Qc(r)):(t.next=o.next,o.next=t),r.interleaved=t,mn(e,n)}function xl(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,Mc(e,n)}}function Kf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=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};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 Yl(e,t,n,r){var o=e.updateQueue;Tn=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?i=u:l.next=u,l=a;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;l=0,c=u=a=null,s=i;do{var p=s.lane,h=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,v=s;switch(p=t,h=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(h,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,p=typeof w=="function"?w.call(h,d,p):w,p==null)break e;d=Ne({},d,p);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,l|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;p=s,s=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);vr|=l,e.lanes=l,e.memoizedState=d}}function Gf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=va.transition;va.transition={};try{e(!1),t()}finally{he=n,va.transition=r}}function _g(){return Pt().memoizedState}function kS(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ag(e))Rg(t,n);else if(n=fg(e,t,n,r),n!==null){var o=Ye();zt(n,e,r,o),Ig(n,t,r)}}function CS(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ag(e))Rg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,$t(s,l)){var a=t.interleaved;a===null?(o.next=o,Qc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=fg(e,t,o,r),n!==null&&(o=Ye(),zt(n,e,r,o),Ig(n,t,r))}}function Ag(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Rg(e,t){qo=ql=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ig(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var Jl={readContext:Nt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},bS={readContext:Nt,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:Yf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Sl(4194308,4,Eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sl(4,2,e,t)},useMemo:function(e,t){var n=Gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gt();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=kS.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:Qf,useDebugValue:rd,useDeferredValue:function(e){return Gt().memoizedState=e},useTransition:function(){var e=Qf(!1),t=e[0];return e=SS.bind(null,e[1]),Gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ee,o=Gt();if(ke){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),De===null)throw Error(z(349));yr&30||yg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Yf(xg.bind(null,r,i,e),[e]),r.flags|=2048,xi(9,vg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Gt(),t=De.identifierPrefix;if(ke){var n=dn,r=cn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=yi++,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[Yt]=t,e[hi]=r,Vg(e,t,!1,!1),t.stateNode=e;e:{switch(l=lu(n,r),n){case"dialog":we("cancel",e),we("close",e),o=r;break;case"iframe":case"object":case"embed":we("load",e),o=r;break;case"video":case"audio":for(o=0;ofo&&(t.flags|=128,r=!0,Lo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Xl(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Lo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!ke)return Ue(t),null}else 2*_e()-i.renderingStartTime>fo&&n!==1073741824&&(t.flags|=128,r=!0,Lo(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=_e(),t.sibling=null,n=Ce.current,ye(Ce,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return ud(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ct&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function RS(e,t){switch(Vc(t),t.tag){case 1:return rt(t.type)&&Vl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),Se(nt),Se(He),Jc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(Se(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ce),null;case 4:return uo(),null;case 10:return Gc(t.type._context),null;case 22:case 23:return ud(),null;case 24:return null;default:return null}}var tl=!1,Ve=!1,IS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Kr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Iu(e,t,n){try{n()}catch(r){Te(e,t,r)}}var lp=!1;function MS(e,t){if(gu=Fl,e=Xm(),$c(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(s=l+o),d!==i||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===o&&(s=l),p===i&&++c===r&&(a=l),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},Fl=!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 v=w.memoizedProps,S=w.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Rt(t.type,v),S);g.__reactInternalSnapshotBeforeUpdate=m}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(z(163))}}catch(C){Te(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=lp,lp=!1,w}function Jo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Iu(t,n,i)}o=o.next}while(o!==r)}}function Ns(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 Mu(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 Kg(e){var t=e.alternate;t!==null&&(e.alternate=null,Kg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[hi],delete t[wu],delete t[gS],delete t[yS])),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 Gg(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ul));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Ou(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(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}var ze=null,Mt=!1;function bn(e,t,n){for(n=n.child;n!==null;)Qg(e,t,n),n=n.sibling}function Qg(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(vs,n)}catch{}switch(n.tag){case 5:Ve||Kr(n,t);case 6:var r=ze,o=Mt;ze=null,bn(e,t,n),ze=r,Mt=o,ze!==null&&(Mt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(Mt?(e=ze,n=n.stateNode,e.nodeType===8?ma(e.parentNode,n):e.nodeType===1&&ma(e,n),ui(e)):ma(ze,n.stateNode));break;case 4:r=ze,o=Mt,ze=n.stateNode.containerInfo,Mt=!0,bn(e,t,n),ze=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Iu(n,t,l),o=o.next}while(o!==r)}bn(e,t,n);break;case 1:if(!Ve&&(Kr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Te(n,t,s)}bn(e,t,n);break;case 21:bn(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,bn(e,t,n),Ve=r):bn(e,t,n);break;default:bn(e,t,n)}}function ap(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new IS),t.forEach(function(r){var o=VS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Tt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*OS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,ts=0,ue&6)throw Error(z(331));var o=ue;for(ue|=4,K=e.current;K!==null;){var i=K,l=i.child;if(K.flags&16){var s=i.deletions;if(s!==null){for(var a=0;a_e()-sd?pr(e,0):ld|=n),ot(e,t)}function ny(e,t){t===0&&(e.mode&1?(t=Ki,Ki<<=1,!(Ki&130023424)&&(Ki=4194304)):t=1);var n=Ye();e=mn(e,t),e!==null&&(Ti(e,t,n),ot(e,n))}function US(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ny(e,n)}function VS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),ny(e,n)}var ry;ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)tt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return tt=!1,_S(e,t,n);tt=!!(e.flags&131072)}else tt=!1,ke&&t.flags&1048576&&sg(t,Kl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kl(e,t),e=t.pendingProps;var o=lo(t,He.current);Jr(t,n),o=ed(null,t,r,e,o,n);var i=td();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(i=!0,Hl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yc(t),o.updater=Es,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Tu(null,t,r,!0,i,n)):(t.tag=0,ke&&i&&Uc(t),Qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=WS(r),e=Rt(r,e),o){case 0:t=ju(null,t,r,e,n);break e;case 1:t=rp(null,t,r,e,n);break e;case 11:t=tp(null,t,r,e,n);break e;case 14:t=np(null,t,r,Rt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),ju(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),rp(e,t,r,o,n);case 3:e:{if(Bg(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,pg(e,t),Yl(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=co(Error(z(423)),t),t=op(e,t,r,n,o);break e}else if(r!==o){o=co(Error(z(424)),t),t=op(e,t,r,n,o);break e}else for(ft=zn(t.stateNode.containerInfo.firstChild),ht=t,ke=!0,Lt=null,n=dg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=gn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return hg(t),e===null&&Cu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,vu(r,o)?l=null:i!==null&&vu(r,i)&&(t.flags|=32),Fg(e,t),Qe(e,t,l,n),t.child;case 6:return e===null&&Cu(t),null;case 13:return $g(e,t,n);case 4:return Xc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),tp(e,t,r,o,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,ye(Gl,r._currentValue),r._currentValue=l,i!==null)if($t(i.value,l)){if(i.children===o.children&&!nt.current){t=gn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=fn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),bu(i.return,n,t),s.lanes|=n;break}a=a.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),bu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Jr(t,n),o=Nt(o),r=r(o),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,o=Rt(r,t.pendingProps),o=Rt(r.type,o),np(e,t,r,o,n);case 15:return Dg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Rt(r,o),kl(e,t),t.tag=1,rt(r)?(e=!0,Hl(t)):e=!1,Jr(t,n),Mg(t,r,o),Nu(t,r,o,n),Tu(null,t,r,!0,e,n);case 19:return Ug(e,t,n);case 22:return zg(e,t,n)}throw Error(z(156,t.tag))};function oy(e,t){return Am(e,t)}function HS(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 Ct(e,t,n,r){return new HS(e,t,n,r)}function dd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WS(e){if(typeof e=="function")return dd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_c)return 11;if(e===Ac)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Ct(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 El(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")dd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Dr:return hr(n.children,o,i,t);case Tc:l=8,o|=8;break;case Xa:return e=Ct(12,n,t,o|2),e.elementType=Xa,e.lanes=i,e;case qa:return e=Ct(13,n,t,o),e.elementType=qa,e.lanes=i,e;case Ja:return e=Ct(19,n,t,o),e.elementType=Ja,e.lanes=i,e;case hm:return js(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fm:l=10;break e;case pm:l=9;break e;case _c:l=11;break e;case Ac:l=14;break e;case jn:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Ct(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function hr(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function js(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=hm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ca(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function ba(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KS(e,t,n,r,o){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=oa(0),this.expirationTimes=oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function fd(e,t,n,r,o,i,l,s,a){return e=new KS(e,t,n,s,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yc(i),e}function GS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ay)}catch(e){console.error(e)}}ay(),am.exports=yt;var xo=am.exports;const JS=gs(xo);var gp=xo;Qa.createRoot=gp.createRoot,Qa.hydrateRoot=gp.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 Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function uy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ek(){return Math.random().toString(36).substr(2,8)}function vp(e,t){return{usr:e.state,key:e.key,idx:t}}function $u(e,t,n,r){return n===void 0&&(n=null),Si({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?wo(t):t,{state:n,key:t&&t.key||r||ek()})}function os(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 wo(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 tk(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,s=Mn.Pop,a=null,u=c();u==null&&(u=0,l.replaceState(Si({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function d(){s=Mn.Pop;let S=c(),g=S==null?null:S-u;u=S,a&&a({action:s,location:v.location,delta:g})}function p(S,g){s=Mn.Push;let m=$u(v.location,S,g);n&&n(m,S),u=c()+1;let x=vp(m,u),C=v.createHref(m);try{l.pushState(x,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(C)}i&&a&&a({action:s,location:v.location,delta:1})}function h(S,g){s=Mn.Replace;let m=$u(v.location,S,g);n&&n(m,S),u=c();let x=vp(m,u),C=v.createHref(m);l.replaceState(x,"",C),i&&a&&a({action:s,location:v.location,delta:0})}function w(S){let g=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof S=="string"?S:os(S);return m=m.replace(/ $/,"%20"),Ie(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let v={get action(){return s},get location(){return e(o,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return o.addEventListener(yp,d),a=S,()=>{o.removeEventListener(yp,d),a=null}},createHref(S){return t(o,S)},createURL:w,encodeLocation(S){let g=w(S);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:h,go(S){return l.go(S)}};return v}var xp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xp||(xp={}));function nk(e,t,n){return n===void 0&&(n="/"),rk(e,t,n,!1)}function rk(e,t,n,r){let o=typeof t=="string"?wo(t):t,i=gd(o.pathname||"/",n);if(i==null)return null;let l=cy(e);ok(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};a.relativePath.startsWith("/")&&(Ie(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=Vn([r,a.relativePath]),c=n.concat(a);i.children&&i.children.length>0&&(Ie(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),cy(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:dk(u,i.index),routesMeta:c})};return e.forEach((i,l)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,l);else for(let a of dy(i.path))o(i,l,a)}),t}function dy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=dy(r.join("/")),s=[];return s.push(...l.map(a=>a===""?i:[i,a].join("/"))),o&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function ok(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ik=/^:[\w-]+$/,lk=3,sk=2,ak=1,uk=10,ck=-2,wp=e=>e==="*";function dk(e,t){let n=e.split("/"),r=n.length;return n.some(wp)&&(r+=ck),t&&(r+=sk),n.filter(o=>!wp(o)).reduce((o,i)=>o+(ik.test(i)?lk:i===""?ak:uk),r)}function fk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function pk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",l=[];for(let s=0;s{let{paramName:p,isOptional:h}=c;if(p==="*"){let v=s[d]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=s[d];return h&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function hk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uy(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=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function mk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return uy(!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 gd(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 gk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?wo(e):e;return{pathname:n?n.startsWith("/")?n:yk(n,t):t,search:wk(r),hash:Sk(o)}}function yk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ea(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 vk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fy(e,t){let n=vk(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function py(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=wo(e):(o=Si({},e),Ie(!o.pathname||!o.pathname.includes("?"),Ea("?","pathname","search",o)),Ie(!o.pathname||!o.pathname.includes("#"),Ea("#","pathname","hash",o)),Ie(!o.search||!o.search.includes("#"),Ea("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.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;o.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=gk(o,s),u=l&&l!=="/"&&l.endsWith("/"),c=(i||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const Vn=e=>e.join("/").replace(/\/\/+/g,"/"),xk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Sk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function kk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const hy=["post","put","patch","delete"];new Set(hy);const Ck=["get",...hy];new Set(Ck);/** + * 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 ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),y.useCallback(function(u,c){if(c===void 0&&(c={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=py(u,JSON.parse(l),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Vn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,l,i,e])}const Pk=y.createContext(null);function jk(e){let t=y.useContext(Zn).outlet;return t&&y.createElement(Pk.Provider,{value:e},t)}function yy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Nr),{matches:o}=y.useContext(Zn),{pathname:i}=Mi(),l=JSON.stringify(fy(o,r.v7_relativeSplatPath));return y.useMemo(()=>py(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Tk(e,t){return _k(e,t)}function _k(e,t,n,r){Ii()||Ie(!1);let{navigator:o}=y.useContext(Nr),{matches:i}=y.useContext(Zn),l=i[i.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Mi(),c;if(t){var d;let S=typeof t=="string"?wo(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Ie(!1),c=S}else c=u;let p=c.pathname||"/",h=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=nk(e,{pathname:h}),v=Lk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Vn([a,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Vn([a,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?y.createElement(Is.Provider,{value:{location:ki({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Mn.Pop}},v):v}function Ak(){let e=Fk(),t=kk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:o},n):null,i)}const Rk=y.createElement(Ak,null);class Ik extends y.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?y.createElement(Zn.Provider,{value:this.props.routeContext},y.createElement(my.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mk(e){let{routeContext:t,match:n,children:r}=e,o=y.useContext(yd);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Zn.Provider,{value:t},r)}function Lk(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(o=n)==null?void 0:o.errors;if(s!=null){let c=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);c>=0||Ie(!1),l=l.slice(0,Math.min(l.length,c+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((c,d,p)=>{let h,w=!1,v=null,S=null;n&&(h=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||Rk,a&&(u<0&&p===0?($k("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,p+1)),m=()=>{let x;return h?x=v:w?x=S:d.route.Component?x=y.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,y.createElement(Mk,{match:d,routeContext:{outlet:c,matches:g,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?y.createElement(Ik,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var vy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vy||{}),is=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}(is||{});function Ok(e){let t=y.useContext(yd);return t||Ie(!1),t}function Dk(e){let t=y.useContext(bk);return t||Ie(!1),t}function zk(e){let t=y.useContext(Zn);return t||Ie(!1),t}function xy(e){let t=zk(),n=t.matches[t.matches.length-1];return n.route.id||Ie(!1),n.route.id}function Fk(){var e;let t=y.useContext(my),n=Dk(is.UseRouteError),r=xy(is.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Bk(){let{router:e}=Ok(vy.UseNavigateStable),t=xy(is.UseNavigateStable),n=y.useRef(!1);return gy(()=>{n.current=!0}),y.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,ki({fromRouteId:t},i)))},[e,t])}const kp={};function $k(e,t,n){!t&&!kp[e]&&(kp[e]=!0)}function Uk(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 Vk(e){return jk(e.context)}function Lr(e){Ie(!1)}function Hk(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Mn.Pop,navigator:i,static:l=!1,future:s}=e;Ii()&&Ie(!1);let a=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:a,navigator:i,static:l,future:ki({v7_relativeSplatPath:!1},s)}),[a,s,i,l]);typeof r=="string"&&(r=wo(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:w="default"}=r,v=y.useMemo(()=>{let S=gd(c,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:h,key:w},navigationType:o}},[a,c,d,p,h,w,o]);return v==null?null:y.createElement(Nr.Provider,{value:u},y.createElement(Is.Provider,{children:n,value:v}))}function Wk(e){let{children:t,location:n}=e;return Tk(Uu(t),n)}new Promise(()=>{});function Uu(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,o)=>{if(!y.isValidElement(r))return;let i=[...t,o];if(r.type===y.Fragment){n.push.apply(n,Uu(r.props.children,i));return}r.type!==Lr&&Ie(!1),!r.props.index||!r.props.children||Ie(!1);let l={id:r.props.id||i.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=Uu(r.props.children,i)),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 Vu(){return Vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Gk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qk(e,t){return e.button===0&&(!t||t==="_self")&&!Gk(e)}const Yk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Xk="6";try{window.__reactRouterVersion=Xk}catch{}const qk="startTransition",Cp=Ec[qk];function Jk(e){let{basename:t,children:n,future:r,window:o}=e,i=y.useRef();i.current==null&&(i.current=ZS({window:o,v5Compat:!0}));let l=i.current,[s,a]=y.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},c=y.useCallback(d=>{u&&Cp?Cp(()=>a(d)):a(d)},[a,u]);return y.useLayoutEffect(()=>l.listen(c),[l,c]),y.useEffect(()=>Uk(r),[r]),y.createElement(Hk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const Zk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wy=y.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:l,state:s,target:a,to:u,preventScrollReset:c,viewTransition:d}=t,p=Kk(t,Yk),{basename:h}=y.useContext(Nr),w,v=!1;if(typeof u=="string"&&eC.test(u)&&(w=u,Zk))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=gd(C.pathname,h);C.origin===x.origin&&N!=null?u=N+C.search+C.hash:v=!0}catch{}let S=Ek(u,{relative:o}),g=tC(u,{replace:l,state:s,target:a,preventScrollReset:c,relative:o,viewTransition:d});function m(x){r&&r(x),x.defaultPrevented||g(x)}return y.createElement("a",Vu({},p,{href:w||S,onClick:v||i?r:m,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 Ep;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ep||(Ep={}));function tC(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s}=t===void 0?{}:t,a=vd(),u=Mi(),c=yy(e,{relative:l});return y.useCallback(d=>{if(Qk(d,n)){d.preventDefault();let p=r!==void 0?r:os(u)===os(c);a(e,{replace:p,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[u,a,c,r,o,n,e,i,l,s])}function Sy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=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 o(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):o(l,s)}}}var Ey="!";function uC(e){var t=e.separator||":",n=t.length===1,r=t[0],o=t.length;return function(l){for(var s=[],a=0,u=0,c,d=0;du?c-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:S}}}function cC(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var o=r[0]==="[";o?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function dC(e){return{cache:aC(e.cacheSize),splitModifiers:uC(e),...rC(e)}}var fC=/\s+/;function pC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,o=t.getConflictingClassGroupIds,i=new Set;return e.trim().split(fC).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,c=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?c.substring(0,d):c),h=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(c),!p)return{isTailwindClass:!1,originalClassName:l};h=!1}var w=cC(a).join(":"),v=u?w+Ey:w;return{isTailwindClass:!0,modifierId:v,classGroupId:p,originalClassName:l,hasPostfixModifier:h}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,c=s+a;return i.has(c)?!1:(i.add(c),o(a,u).forEach(function(d){return i.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function hC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Tp=e=>{const t=AC(e);return t.charAt(0).toUpperCase()+t.slice(1)},jy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),RC=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 IC={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 MC=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:l,...s},a)=>y.createElement("svg",{ref:a,...IC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jy("lucide",o),...!i&&!RC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,c])=>y.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** + * @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 ae=(e,t)=>{const n=y.forwardRef(({className:r,...o},i)=>y.createElement(MC,{ref:i,iconNode:t,className:jy(`lucide-${_C(Tp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Tp(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 LC=[["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"}]],OC=ae("award",LC);/** + * @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 DC=[["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"}]],wd=ae("book-open",DC);/** + * @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:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],FC=ae("bookmark",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 BC=[["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"}]],Li=ae("bot",BC);/** + * @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:"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"}]],Ci=ae("brain",$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 UC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],VC=ae("check",UC);/** + * @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:"m6 9 6 6 6-6",key:"qrunsl"}]],Ty=ae("chevron-down",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 WC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],KC=ae("chevron-up",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],QC=ae("circle-check-big",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 YC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ls=ae("cloud",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["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"}]],_y=ae("crown",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:"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"}]],JC=ae("download",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 ZC=[["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"}]],eb=ae("eye",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=[["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"}]],Ay=ae("hard-drive",tb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nb=[["path",{d:"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"}]],rb=ae("heart",nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ob=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ib=ae("history",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:"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"}]],sb=ae("house",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 ab=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ry=ae("info",ab);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ku=ae("loader-circle",ub);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cb=[["path",{d:"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"}]],Sd=ae("message-square",cb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const db=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fb=ae("plus",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 pb=[["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"}]],hb=ae("save",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 mb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],_p=ae("search",mb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["path",{d:"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"}]],yb=ae("send",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 vb=[["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"}]],xb=ae("server",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 wb=[["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"}]],kd=ae("settings",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:"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"}]],Ap=ae("shield",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=[["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"}]],Cb=ae("sliders-vertical",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:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Eb=ae("square",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 Nb=[["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"}]],Pb=ae("star",Nb);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Iy=ae("trash-2",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 Tb=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],My=ae("trending-up",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 _b=[["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"}]],Ly=ae("user",_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:"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"}]],Rb=ae("users",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 Ib=[["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"}]],Gu=ae("zap",Ib),Mb=[{name:"Templates",href:"/",icon:sb,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:Sd,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:wd,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:kd,description:"Application settings"}];function Lb(){const e=Mi();return f.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[f.jsx("div",{className:"p-6 border-b",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:f.jsx(Ci,{className:"h-5 w-5 text-primary-foreground"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),f.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:f.jsxs("div",{children:[f.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),f.jsx("nav",{className:"space-y-1",children:Mb.map(t=>{const n=e.pathname===t.href;return f.jsxs(wy,{to:t.href,className:se("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:[f.jsx(t.icon,{className:"h-4 w-4"}),f.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Ob(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(Lb,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(Vk,{})})]})}const Rp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ip=ky,Cd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ip(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=Rp(c)||Rp(d);return o[u][p]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...i,...s}[v]):{...i,...s}[v]===S})?[...u,d,p]:u},[]);return Ip(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Db=Cd("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 be({className:e,variant:t,...n}){return f.jsx("div",{className:se(Db({variant:t}),e),...n})}function Mp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oy(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Mp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{children:i,...l}=r,s=y.Children.toArray(i),a=s.find($b);if(a){const u=a.props.children,c=s.map(d=>d===a?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:d);return f.jsx(t,{...l,ref:o,children:y.isValidElement(u)?y.cloneElement(u,void 0,c):null})}return f.jsx(t,{...l,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var zb=po("Slot");function Fb(e){const t=y.forwardRef((n,r)=>{const{children:o,...i}=n;if(y.isValidElement(o)){const l=Vb(o),s=Ub(i,o.props);return o.type!==y.Fragment&&(s.ref=r?Oy(r,l):l),y.cloneElement(o,s)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dy=Symbol("radix.slottable");function Bb(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Dy,t}function $b(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dy}function Ub(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const a=i(...s);return o(...s),a}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Vb(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const bd=Cd("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"}}),Xe=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const l=r?zb:"button";return f.jsx(l,{className:se(bd({variant:t,size:n,className:e})),ref:i,...o})});Xe.displayName="Button";const it=y.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));it.displayName="Card";const Ft=y.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:se("flex flex-col space-y-1.5 p-6",e),...t}));Ft.displayName="CardHeader";const Bt=y.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Bt.displayName="CardTitle";const Hb=y.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:se("text-sm text-muted-foreground",e),...t}));Hb.displayName="CardDescription";const Et=y.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:se("p-6 pt-0",e),...t}));Et.displayName="CardContent";const Wb=y.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:se("flex items-center p-6 pt-0",e),...t}));Wb.displayName="CardFooter";const zy=y.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{type:t,className:se("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}));zy.displayName="Input";function Kb(){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 Gb(){const e=vd(),[t,n]=y.useState(!1),[r]=y.useState(Kb()),[o,i]=y.useState([]),[l,s]=y.useState(""),[a,u]=y.useState("All");y.useEffect(()=>{c(),d()},[]);const c=async()=>{try{const m=`${window.location.protocol}//${window.location.host}`,x=await fetch(`${m}/models`);n(x.ok)}catch{n(!1)}},d=()=>{try{const m=JSON.parse(localStorage.getItem("likedTemplates")||"[]");i(m)}catch(m){console.error("Failed to load liked templates:",m)}},p=m=>{const x=o.includes(m)?o.filter(C=>C!==m):[...o,m];i(x),localStorage.setItem("likedTemplates",JSON.stringify(x))},h=m=>{const x={name:m.name,description:m.description,model:m.model,systemPrompt:m.systemPrompt,temperature:m.temperature,maxTokens:m.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),e("/playground")},w=r.filter(m=>{const x=m.name.toLowerCase().includes(l.toLowerCase())||m.description.toLowerCase().includes(l.toLowerCase())||m.tags.some(N=>N.toLowerCase().includes(l.toLowerCase())),C=a==="All"||m.category===a;return x&&C}),v=w.filter(m=>m.isOfficial),S=[...w].sort((m,x)=>x.usageCount-m.usageCount).slice(0,6),g=["All",...Array.from(new Set(r.map(m=>m.category)))];return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-4",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(Ci,{className:"h-5 w-5 text-white"})}),f.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),f.jsx(be,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),f.jsxs(Xe,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(Li,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),f.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),f.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."}),f.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[f.jsx(_p,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),f.jsx(zy,{type:"text",placeholder:"Search assistants...",value:l,onChange:m=>s(m.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),f.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:g.map(m=>f.jsx(Xe,{variant:a===m?"default":"outline",size:"sm",onClick:()=>u(m),className:"rounded-full",children:m},m))})]}),a==="All"&&v.length>0&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(_y,{className:"h-5 w-5 text-yellow-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),f.jsx(be,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:v.slice(0,3).map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m),featured:!0},m.id))})]}),a==="All"&&f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(My,{className:"h-5 w-5 text-green-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),f.jsx(be,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m),trending:!0},m.id))})]}),f.jsxs("div",{className:"mb-12",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[f.jsx(Rb,{className:"h-5 w-5 text-blue-600"}),f.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),f.jsxs(be,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(m=>f.jsx(Na,{template:m,isLiked:o.includes(m.id),onLike:()=>p(m.id),onUse:()=>h(m)},m.id))}):f.jsx(it,{className:"p-12 text-center",children:f.jsxs("div",{className:"flex flex-col items-center gap-4",children:[f.jsx(_p,{className:"h-12 w-12 text-gray-400"}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),f.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),f.jsx(Xe,{variant:"outline",onClick:()=>{s(""),u("All")},children:"Clear filters"})]})})]})]})]})}function Na({template:e,isLiked:t,onLike:n,onUse:r,featured:o=!1,trending:i=!1}){return f.jsxs(it,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[o&&f.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:[f.jsx(_y,{className:"h-3 w-3"}),"Featured"]}),i&&f.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:[f.jsx(My,{className:"h-3 w-3"}),"Trending"]}),f.jsx(Ft,{className:"pb-4",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.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}),f.jsxs("div",{children:[f.jsx(Bt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&f.jsxs(be,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[f.jsx(OC,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),f.jsx(Xe,{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:f.jsx(rb,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),f.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>f.jsx(be,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),f.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(eb,{className:"h-4 w-4"}),f.jsx("span",{children:e.usageCount.toLocaleString()})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Pb,{className:"h-4 w-4 text-yellow-500 fill-current"}),f.jsx("span",{children:e.rating})]})]}),f.jsx(be,{variant:"outline",className:"text-xs",children:e.category})]}),f.jsx("div",{className:"pt-2",children:f.jsxs(Xe,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[f.jsx(Sd,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Qb(e,t){const n=y.createContext(t),r=i=>{const{children:l,...s}=i,a=y.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function o(i){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function er(e,t=[]){let n=[];function r(i,l){const s=y.createContext(l),a=n.length;n=[...n,l];const u=d=>{var g;const{scope:p,children:h,...w}=d,v=((g=p==null?void 0:p[e])==null?void 0:g[a])||s,S=y.useMemo(()=>w,Object.values(w));return f.jsx(v.Provider,{value:S,children:h})};u.displayName=i+"Provider";function c(d,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,w=y.useContext(h);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(l=>y.createContext(l));return function(s){const a=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,Yb(o,...t)]}function Yb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(i)[`__scope${u}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Ed(e){const t=e+"CollectionProvider",[n,r]=er(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:S,children:g}=v,m=It.useRef(null),x=It.useRef(new Map).current;return f.jsx(o,{scope:S,itemMap:x,collectionRef:m,children:g})};l.displayName=t;const s=e+"CollectionSlot",a=po(s),u=It.forwardRef((v,S)=>{const{scope:g,children:m}=v,x=i(s,g),C=pe(S,x.collectionRef);return f.jsx(a,{ref:C,children:m})});u.displayName=s;const c=e+"CollectionItemSlot",d="data-radix-collection-item",p=po(c),h=It.forwardRef((v,S)=>{const{scope:g,children:m,...x}=v,C=It.useRef(null),N=pe(S,C),E=i(c,g);return It.useEffect(()=>(E.itemMap.set(C,{ref:C,...x}),()=>void E.itemMap.delete(C))),f.jsx(p,{[d]:"",ref:N,children:m})});h.displayName=c;function w(v){const S=i(e+"CollectionConsumer",v);return It.useCallback(()=>{const m=S.collectionRef.current;if(!m)return[];const x=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((E,P)=>x.indexOf(E.ref.current)-x.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},w,r]}var We=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Xb=Ec[" useId ".trim().toString()]||(()=>{}),qb=0;function Hn(e){const[t,n]=y.useState(Xb());return We(()=>{e||n(r=>r??String(qb++))},[e]),e||(t?`radix-${t}`:"")}var Jb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=Jb.reduce((e,t)=>{const n=po(`Primitive.${t}`),r=y.forwardRef((o,i)=>{const{asChild:l,...s}=o,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Zb(e,t){e&&xo.flushSync(()=>e.dispatchEvent(t))}function Gn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var eE=Ec[" useInsertionEffect ".trim().toString()]||We;function ho({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,l]=tE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{const c=y.useRef(e!==void 0);y.useEffect(()=>{const d=c.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.`),c.current=s},[s,r])}const u=y.useCallback(c=>{var d;if(s){const p=nE(c)?c(e):c;p!==e&&((d=l.current)==null||d.call(l,p))}else i(c)},[s,e,i,l]);return[a,u]}function tE({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),o=y.useRef(n),i=y.useRef(t);return eE(()=>{i.current=t},[t]),y.useEffect(()=>{var l;o.current!==n&&((l=i.current)==null||l.call(i,n),o.current=n)},[n,o]),[n,r,i]}function nE(e){return typeof e=="function"}var rE=y.createContext(void 0);function Ms(e){const t=y.useContext(rE);return e||t||"ltr"}var Pa="rovingFocusGroup.onEntryFocus",oE={bubbles:!1,cancelable:!0},Oi="RovingFocusGroup",[Qu,Fy,iE]=Ed(Oi),[lE,By]=er(Oi,[iE]),[sE,aE]=lE(Oi),$y=y.forwardRef((e,t)=>f.jsx(Qu.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Qu.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(uE,{...e,ref:t})})}));$y.displayName=Oi;var uE=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=y.useRef(null),h=pe(t,p),w=Ms(i),[v,S]=ho({prop:l,defaultProp:s??null,onChange:a,caller:Oi}),[g,m]=y.useState(!1),x=Gn(u),C=Fy(n),N=y.useRef(!1),[E,P]=y.useState(0);return y.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Pa,x),()=>T.removeEventListener(Pa,x)},[x]),f.jsx(sE,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:v,onItemFocus:y.useCallback(T=>S(T),[S]),onItemShiftTab:y.useCallback(()=>m(!0),[]),onFocusableItemAdd:y.useCallback(()=>P(T=>T+1),[]),onFocusableItemRemove:y.useCallback(()=>P(T=>T-1),[]),children:f.jsx(ne.div,{tabIndex:g||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{N.current=!0}),onFocus:ee(e.onFocus,T=>{const L=!N.current;if(T.target===T.currentTarget&&L&&!g){const A=new CustomEvent(Pa,oE);if(T.currentTarget.dispatchEvent(A),!A.defaultPrevented){const I=C().filter($=>$.focusable),_=I.find($=>$.active),H=I.find($=>$.id===v),O=[_,H,...I].filter(Boolean).map($=>$.ref.current);Hy(O,c)}}N.current=!1}),onBlur:ee(e.onBlur,()=>m(!1))})})}),Uy="RovingFocusGroupItem",Vy=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:l,...s}=e,a=Hn(),u=i||a,c=aE(Uy,n),d=c.currentTabStopId===u,p=Fy(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=c;return y.useEffect(()=>{if(r)return h(),()=>w()},[r,h,w]),f.jsx(Qu.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:f.jsx(ne.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ee(e.onMouseDown,S=>{r?c.onItemFocus(u):S.preventDefault()}),onFocus:ee(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){c.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const g=fE(S,c.orientation,c.dir);if(g!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=c.loop?pE(x,C+1):x.slice(C+1)}setTimeout(()=>Hy(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:v!=null}):l})})});Vy.displayName=Uy;var cE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fE(e,t,n){const r=dE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cE[r]}function Hy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function pE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hE=$y,mE=Vy;function gE(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Di=e=>{const{present:t,children:n}=e,r=yE(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=pe(r.ref,vE(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};Di.displayName="Presence";function yE(e){const[t,n]=y.useState(),r=y.useRef(null),o=y.useRef(e),i=y.useRef("none"),l=e?"mounted":"unmounted",[s,a]=gE(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=il(r.current);i.current=s==="mounted"?u:"none"},[s]),We(()=>{const u=r.current,c=o.current;if(c!==e){const p=i.current,h=il(u);e?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),We(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=h=>{const v=il(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(a("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=h=>{h.target===t&&(i.current=il(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.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:y.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function il(e){return(e==null?void 0:e.animationName)||"none"}function vE(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ls="Tabs",[xE,gI]=er(Ls,[By]),Wy=By(),[wE,Nd]=xE(Ls),Ky=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,c=Ms(s),[d,p]=ho({prop:r,onChange:o,defaultProp:i??"",caller:Ls});return f.jsx(wE,{scope:n,baseId:Hn(),value:d,onValueChange:p,orientation:l,dir:c,activationMode:a,children:f.jsx(ne.div,{dir:c,"data-orientation":l,...u,ref:t})})});Ky.displayName=Ls;var Gy="TabsList",Qy=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Nd(Gy,n),l=Wy(n);return f.jsx(hE,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(ne.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Qy.displayName=Gy;var Yy="TabsTrigger",Xy=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,l=Nd(Yy,n),s=Wy(n),a=Zy(l.baseId,r),u=ev(l.baseId,r),c=r===l.value;return f.jsx(mE,{asChild:!0,...s,focusable:!o,active:c,children:f.jsx(ne.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":u,"data-state":c?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:t,onMouseDown:ee(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:ee(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const d=l.activationMode!=="manual";!c&&!o&&d&&l.onValueChange(r)})})})});Xy.displayName=Yy;var qy="TabsContent",Jy=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...l}=e,s=Nd(qy,n),a=Zy(s.baseId,r),u=ev(s.baseId,r),c=r===s.value,d=y.useRef(c);return y.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(Di,{present:o||c,children:({present:p})=>f.jsx(ne.div,{"data-state":c?"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&&i})})});Jy.displayName=qy;function Zy(e,t){return`${e}-trigger-${t}`}function ev(e,t){return`${e}-content-${t}`}var SE=Ky,tv=Qy,nv=Xy,rv=Jy;const kE=SE,ov=y.forwardRef(({className:e,...t},n)=>f.jsx(tv,{ref:n,className:se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ov.displayName=tv.displayName;const Nl=y.forwardRef(({className:e,...t},n)=>f.jsx(nv,{ref:n,className:se("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}));Nl.displayName=nv.displayName;const Pl=y.forwardRef(({className:e,...t},n)=>f.jsx(rv,{ref:n,className:se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Pl.displayName=rv.displayName;function ss(e,[t,n]){return Math.min(n,Math.max(t,e))}function iv(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function lv(e){const[t,n]=y.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let l,s;if("borderBoxSize"in i){const a=i.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 sv=["PageUp","PageDown"],av=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},So="Slider",[Yu,CE,bE]=Ed(So),[cv,yI]=er(So,[bE]),[EE,Os]=cv(So),dv=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:c,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:h=!1,form:w,...v}=e,S=y.useRef(new Set),g=y.useRef(0),x=l==="horizontal"?NE:PE,[C=[],N]=ho({prop:c,defaultProp:u,onChange:I=>{var H;(H=[...S.current][g.current])==null||H.focus(),d(I)}}),E=y.useRef(C);function P(I){const _=RE(C,I);A(I,_)}function T(I){A(I,g.current)}function L(){const I=E.current[g.current];C[g.current]!==I&&p(C)}function A(I,_,{commit:H}={commit:!1}){const M=OE(i),O=DE(Math.round((I-r)/i)*i+r,M),$=ss(O,[r,o]);N((W=[])=>{const j=_E(W,$,_);if(LE(j,a*i)){g.current=j.indexOf($);const D=String(j)!==String(W);return D&&H&&p(j),D?j:W}else return W})}return f.jsx(EE,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:w,children:f.jsx(Yu.Provider,{scope:e.__scopeSlider,children:f.jsx(Yu.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:t,onPointerDown:ee(v.onPointerDown,()=>{s||(E.current=C)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:P,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:L,onHomeKeyDown:()=>!s&&A(r,0,{commit:!0}),onEndKeyDown:()=>!s&&A(o,C.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:_})=>{if(!s){const O=sv.includes(I.key)||I.shiftKey&&av.includes(I.key)?10:1,$=g.current,W=C[$],j=i*O*_;A(W+j,$,{commit:!0})}}})})})})});dv.displayName=So;var[fv,pv]=cv(So,{startEdge:"left",endEdge:"right",size:"width",direction:1}),NE=y.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...c}=e,[d,p]=y.useState(null),h=pe(t,x=>p(x)),w=y.useRef(void 0),v=Ms(o),S=v==="ltr",g=S&&!i||!S&&i;function m(x){const C=w.current||d.getBoundingClientRect(),N=[0,C.width],P=Pd(N,g?[n,r]:[r,n]);return w.current=C,P(x-C.left)}return f.jsx(fv,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:f.jsx(hv,{dir:v,"data-orientation":"horizontal",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=m(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=m(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=uv[g?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),PE=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,c=y.useRef(null),d=pe(t,c),p=y.useRef(void 0),h=!o;function w(v){const S=p.current||c.current.getBoundingClientRect(),g=[0,S.height],x=Pd(g,h?[r,n]:[n,r]);return p.current=S,x(v-S.top)}return f.jsx(fv,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:f.jsx(hv,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=w(v.clientY);i==null||i(S)},onSlideMove:v=>{const S=w(v.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:v=>{const g=uv[h?"from-bottom":"from-top"].includes(v.key);a==null||a({event:v,direction:g?-1:1})}})})}),hv=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,c=Os(So,n);return f.jsx(ne.span,{...u,ref:t,onKeyDown:ee(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):sv.concat(av).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:ee(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),c.thumbs.has(p)?p.focus():r(d)}),onPointerMove:ee(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:ee(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),i(d))})})}),mv="SliderTrack",gv=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Os(mv,n);return f.jsx(ne.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});gv.displayName=mv;var Xu="SliderRange",yv=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Os(Xu,n),i=pv(Xu,n),l=y.useRef(null),s=pe(t,l),a=o.values.length,u=o.values.map(p=>wv(p,o.min,o.max)),c=a>1?Math.min(...u):0,d=100-Math.max(...u);return f.jsx(ne.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:c+"%",[i.endEdge]:d+"%"}})});yv.displayName=Xu;var qu="SliderThumb",vv=y.forwardRef((e,t)=>{const n=CE(e.__scopeSlider),[r,o]=y.useState(null),i=pe(t,s=>o(s)),l=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(jE,{...e,ref:i,index:l})}),jE=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,l=Os(qu,n),s=pv(qu,n),[a,u]=y.useState(null),c=pe(t,m=>u(m)),d=a?l.form||!!a.closest("form"):!0,p=lv(a),h=l.values[r],w=h===void 0?0:wv(h,l.min,l.max),v=AE(r,l.values.length),S=p==null?void 0:p[s.size],g=S?IE(S,w,s.direction):0;return y.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${g}px)`},children:[f.jsx(Yu.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":l.min,"aria-valuenow":h,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:c,style:h===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&f.jsx(xv,{name:o??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:h},r)]})});vv.displayName=qu;var TE="RadioBubbleInput",xv=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=y.useRef(null),i=pe(o,r),l=iv(t);return y.useEffect(()=>{const s=o.current;if(!s)return;const a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&c){const d=new Event("input",{bubbles:!0});c.call(s,t),s.dispatchEvent(d)}},[l,t]),f.jsx(ne.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});xv.displayName=TE;function _E(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function wv(e,t,n){const i=100/(n-t)*(e-t);return ss(i,[0,100])}function AE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function RE(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function IE(e,t,n){const r=e/2,i=Pd([0,50],[0,r]);return(r-i(t)*n)*n}function ME(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function LE(e,t){if(t>0){const n=ME(e);return Math.min(...n)>=t}return!0}function Pd(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 OE(e){return(String(e).split(".")[1]||"").length}function DE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Sv=dv,zE=gv,FE=yv,BE=vv;const Ju=y.forwardRef(({className:e,...t},n)=>f.jsxs(Sv,{ref:n,className:se("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(zE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(FE,{className:"absolute h-full bg-primary"})}),f.jsx(BE,{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"})]}));Ju.displayName=Sv.displayName;var $E="Label",kv=y.forwardRef((e,t)=>f.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kv.displayName=$E;var Cv=kv;const UE=Cd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ot=y.forwardRef(({className:e,...t},n)=>f.jsx(Cv,{ref:n,className:se(UE(),e),...t}));Ot.displayName=Cv.displayName;function VE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var HE="DismissableLayer",Zu="dismissableLayer.update",WE="dismissableLayer.pointerDownOutside",KE="dismissableLayer.focusOutside",Lp,bv=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jd=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...a}=e,u=y.useContext(bv),[c,d]=y.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),w=pe(t,P=>d(P)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(S),m=c?v.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=g,N=YE(P=>{const T=P.target,L=[...u.branches].some(A=>A.contains(T));!C||L||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},p),E=XE(P=>{const T=P.target;[...u.branches].some(A=>A.contains(T))||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},p);return VE(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),y.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Lp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Op(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Lp)}},[c,p,n,u]),y.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Op())},[c,u]),y.useEffect(()=>{const P=()=>h({});return document.addEventListener(Zu,P),()=>document.removeEventListener(Zu,P)},[]),f.jsx(ne.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,N.onPointerDownCapture)})});jd.displayName=HE;var GE="DismissableLayerBranch",QE=y.forwardRef((e,t)=>{const n=y.useContext(bv),r=y.useRef(null),o=pe(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(ne.div,{...e,ref:o})});QE.displayName=GE;function YE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let a=function(){Ev(WE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function XE(e,t=globalThis==null?void 0:globalThis.document){const n=Gn(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ev(KE,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Op(){const e=new CustomEvent(Zu);document.dispatchEvent(e)}function Ev(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Zb(o,i):o.dispatchEvent(i)}var ja=0;function Nv(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dp()),document.body.insertAdjacentElement("beforeend",e[1]??Dp()),ja++,()=>{ja===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ja--}},[])}function Dp(){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 Ta="focusScope.autoFocusOnMount",_a="focusScope.autoFocusOnUnmount",zp={bubbles:!1,cancelable:!0},qE="FocusScope",Td=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...l}=e,[s,a]=y.useState(null),u=Gn(o),c=Gn(i),d=y.useRef(null),p=pe(t,v=>a(v)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let v=function(x){if(h.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:Pn(d.current,{select:!0})},S=function(x){if(h.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Pn(d.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Pn(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const m=new MutationObserver(g);return s&&m.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),m.disconnect()}}},[r,s,h.paused]),y.useEffect(()=>{if(s){Bp.add(h);const v=document.activeElement;if(!s.contains(v)){const g=new CustomEvent(Ta,zp);s.addEventListener(Ta,u),s.dispatchEvent(g),g.defaultPrevented||(JE(rN(Pv(s)),{select:!0}),document.activeElement===v&&Pn(s))}return()=>{s.removeEventListener(Ta,u),setTimeout(()=>{const g=new CustomEvent(_a,zp);s.addEventListener(_a,c),s.dispatchEvent(g),g.defaultPrevented||Pn(v??document.body,{select:!0}),s.removeEventListener(_a,c),Bp.remove(h)},0)}}},[s,u,c,h]);const w=y.useCallback(v=>{if(!n&&!r||h.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(S&&g){const m=v.currentTarget,[x,C]=ZE(m);x&&C?!v.shiftKey&&g===C?(v.preventDefault(),n&&Pn(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&Pn(C,{select:!0})):g===m&&v.preventDefault()}},[n,r,h.paused]);return f.jsx(ne.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Td.displayName=qE;function JE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function ZE(e){const t=Pv(e),n=Fp(t,e),r=Fp(t.reverse(),e);return[n,r]}function Pv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fp(e,t){for(const n of e)if(!eN(n,{upTo:t}))return n}function eN(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 tN(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tN(e)&&t&&e.select()}}var Bp=nN();function nN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$p(e,t),e.unshift(t)},remove(t){var n;e=$p(e,t),(n=e[0])==null||n.resume()}}}function $p(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rN(e){return e.filter(t=>t.tagName!=="A")}const oN=["top","right","bottom","left"],Qn=Math.min,dt=Math.max,as=Math.round,ll=Math.floor,tn=e=>({x:e,y:e}),iN={left:"right",right:"left",bottom:"top",top:"bottom"},lN={start:"end",end:"start"};function ec(e,t,n){return dt(e,Qn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function _d(e){return e==="x"?"y":"x"}function Ad(e){return e==="y"?"height":"width"}const sN=new Set(["top","bottom"]);function Jt(e){return sN.has(vn(e))?"y":"x"}function Rd(e){return _d(Jt(e))}function aN(e,t,n){n===void 0&&(n=!1);const r=ko(e),o=Rd(e),i=Ad(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=us(l)),[l,us(l)]}function uN(e){const t=us(e);return[tc(e),t,tc(t)]}function tc(e){return e.replace(/start|end/g,t=>lN[t])}const Up=["left","right"],Vp=["right","left"],cN=["top","bottom"],dN=["bottom","top"];function fN(e,t,n){switch(e){case"top":case"bottom":return n?t?Vp:Up:t?Up:Vp;case"left":case"right":return t?cN:dN;default:return[]}}function pN(e,t,n,r){const o=ko(e);let i=fN(vn(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(tc)))),i}function us(e){return e.replace(/left|right|bottom|top/g,t=>iN[t])}function hN(e){return{top:0,right:0,bottom:0,left:0,...e}}function jv(e){return typeof e!="number"?hN(e):{top:e,right:e,bottom:e,left:e}}function cs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Hp(e,t,n){let{reference:r,floating:o}=e;const i=Jt(t),l=Rd(t),s=Ad(l),a=vn(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(a){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ko(t)){case"start":h[l]-=p*(n&&u?-1:1);break;case"end":h[l]+=p*(n&&u?-1:1);break}return h}const mN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Hp(u,r,a),p=r,h={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:c=0}=yn(e,t)||{};if(u==null)return{};const d=jv(c),p={x:n,y:r},h=Rd(o),w=Ad(h),v=await l.getDimensions(u),S=h==="y",g=S?"top":"left",m=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=i.reference[w]+i.reference[h]-p[h]-i.floating[w],N=p[h]-i.reference[h],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=E?E[x]:0;(!P||!await(l.isElement==null?void 0:l.isElement(E)))&&(P=s.floating[x]||i.floating[w]);const T=C/2-N/2,L=P/2-v[w]/2-1,A=Qn(d[g],L),I=Qn(d[m],L),_=A,H=P-v[w]-I,M=P/2-v[w]/2+T,O=ec(_,M,H),$=!a.arrow&&ko(o)!=null&&M!==O&&i.reference[w]/2-(M<_?A:I)-v[w]/2<0,W=$?M<_?M-_:M-H:0;return{[h]:p[h]+W,data:{[h]:O,centerOffset:M-O-W,...$&&{alignmentOffset:W}},reset:$}}}),yN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...S}=yn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=vn(o),m=Jt(s),x=vn(s)===s,C=await(a.isRTL==null?void 0:a.isRTL(u.floating)),N=p||(x||!v?[us(s)]:uN(s)),E=w!=="none";!p&&E&&N.push(...pN(s,v,w,C));const P=[s,...N],T=await bi(t,S),L=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&L.push(T[g]),d){const M=aN(o,l,C);L.push(T[M[0]],T[M[1]])}if(A=[...A,{placement:o,overflows:L}],!L.every(M=>M<=0)){var I,_;const M=(((I=i.flip)==null?void 0:I.index)||0)+1,O=P[M];if(O&&(!(d==="alignment"?m!==Jt(O):!1)||A.every(j=>Jt(j.placement)===m?j.overflows[0]>0:!0)))return{data:{index:M,overflows:A},reset:{placement:O}};let $=(_=A.filter(W=>W.overflows[0]<=0).sort((W,j)=>W.overflows[1]-j.overflows[1])[0])==null?void 0:_.placement;if(!$)switch(h){case"bestFit":{var H;const W=(H=A.filter(j=>{if(E){const D=Jt(j.placement);return D===m||D==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(D=>D>0).reduce((D,k)=>D+k,0)]).sort((j,D)=>j[1]-D[1])[0])==null?void 0:H[0];W&&($=W);break}case"initialPlacement":$=s;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function Wp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kp(e){return oN.some(t=>e[t]>=0)}const vN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yn(e,t);switch(r){case"referenceHidden":{const i=await bi(t,{...o,elementContext:"reference"}),l=Wp(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Kp(l)}}}case"escaped":{const i=await bi(t,{...o,altBoundary:!0}),l=Wp(i,n.floating);return{data:{escapedOffsets:l,escaped:Kp(l)}}}default:return{}}}}},Tv=new Set(["left","top"]);async function xN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=vn(n),s=ko(n),a=Jt(n)==="y",u=Tv.has(l)?-1:1,c=i&&a?-1:1,d=yn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(h=s==="end"?w*-1:w),a?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const wN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await xN(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},SN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:g,y:m}=S;return{x:g,y:m}}},...a}=yn(e,t),u={x:n,y:r},c=await bi(t,a),d=Jt(vn(o)),p=_d(d);let h=u[p],w=u[d];if(i){const S=p==="y"?"top":"left",g=p==="y"?"bottom":"right",m=h+c[S],x=h-c[g];h=ec(m,h,x)}if(l){const S=d==="y"?"top":"left",g=d==="y"?"bottom":"right",m=w+c[S],x=w-c[g];w=ec(m,w,x)}const v=s.fn({...t,[p]:h,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[d]:l}}}}}},kN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=yn(e,t),c={x:n,y:r},d=Jt(o),p=_d(d);let h=c[p],w=c[d];const v=yn(s,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){const x=p==="y"?"height":"width",C=i.reference[p]-i.floating[x]+S.mainAxis,N=i.reference[p]+i.reference[x]-S.mainAxis;hN&&(h=N)}if(u){var g,m;const x=p==="y"?"width":"height",C=Tv.has(vn(o)),N=i.reference[d]-i.floating[x]+(C&&((g=l.offset)==null?void 0:g[d])||0)+(C?0:S.crossAxis),E=i.reference[d]+i.reference[x]+(C?0:((m=l.offset)==null?void 0:m[d])||0)-(C?S.crossAxis:0);wE&&(w=E)}return{[p]:h,[d]:w}}}},CN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...u}=yn(e,t),c=await bi(t,u),d=vn(o),p=ko(o),h=Jt(o)==="y",{width:w,height:v}=i.floating;let S,g;d==="top"||d==="bottom"?(S=d,g=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,S=p==="end"?"top":"bottom");const m=v-c.top-c.bottom,x=w-c.left-c.right,C=Qn(v-c[S],m),N=Qn(w-c[g],x),E=!t.middlewareData.shift;let P=C,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),E&&!p){const A=dt(c.left,0),I=dt(c.right,0),_=dt(c.top,0),H=dt(c.bottom,0);h?T=w-2*(A!==0||I!==0?A+I:dt(c.left,c.right)):P=v-2*(_!==0||H!==0?_+H:dt(c.top,c.bottom))}await a({...t,availableWidth:T,availableHeight:P});const L=await l.getDimensions(s.floating);return w!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function Ds(){return typeof window<"u"}function Co(e){return _v(e)?(e.nodeName||"").toLowerCase():"#document"}function mt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function on(e){var t;return(t=(_v(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _v(e){return Ds()?e instanceof Node||e instanceof mt(e).Node:!1}function Ut(e){return Ds()?e instanceof Element||e instanceof mt(e).Element:!1}function nn(e){return Ds()?e instanceof HTMLElement||e instanceof mt(e).HTMLElement:!1}function Gp(e){return!Ds()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot}const bN=new Set(["inline","contents"]);function zi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!bN.has(o)}const EN=new Set(["table","td","th"]);function NN(e){return EN.has(Co(e))}const PN=[":popover-open",":modal"];function zs(e){return PN.some(t=>{try{return e.matches(t)}catch{return!1}})}const jN=["transform","translate","scale","rotate","perspective"],TN=["transform","translate","scale","rotate","perspective","filter"],_N=["paint","layout","strict","content"];function Id(e){const t=Md(),n=Ut(e)?Vt(e):e;return jN.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)||TN.some(r=>(n.willChange||"").includes(r))||_N.some(r=>(n.contain||"").includes(r))}function AN(e){let t=Yn(e);for(;nn(t)&&!mo(t);){if(Id(t))return t;if(zs(t))return null;t=Yn(t)}return null}function Md(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const RN=new Set(["html","body","#document"]);function mo(e){return RN.has(Co(e))}function Vt(e){return mt(e).getComputedStyle(e)}function Fs(e){return Ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yn(e){if(Co(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gp(e)&&e.host||on(e);return Gp(t)?t.host:t}function Av(e){const t=Yn(e);return mo(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&zi(t)?t:Av(t)}function Ei(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Av(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=mt(o);if(i){const s=nc(l);return t.concat(l,l.visualViewport||[],zi(o)?o:[],s&&n?Ei(s):[])}return t.concat(o,Ei(o,[],n))}function nc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rv(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nn(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=as(n)!==i||as(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Ld(e){return Ut(e)?e:e.contextElement}function eo(e){const t=Ld(e);if(!nn(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Rv(t);let l=(i?as(n.width):n.width)/r,s=(i?as(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const IN=tn(0);function Iv(e){const t=mt(e);return!Md()||!t.visualViewport?IN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mt(e)?!1:t}function wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ld(e);let l=tn(1);t&&(r?Ut(r)&&(l=eo(r)):l=eo(e));const s=MN(i,n,r)?Iv(i):tn(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const p=mt(i),h=r&&Ut(r)?mt(r):r;let w=p,v=nc(w);for(;v&&r&&h!==w;){const S=eo(v),g=v.getBoundingClientRect(),m=Vt(v),x=g.left+(v.clientLeft+parseFloat(m.paddingLeft))*S.x,C=g.top+(v.clientTop+parseFloat(m.paddingTop))*S.y;a*=S.x,u*=S.y,c*=S.x,d*=S.y,a+=x,u+=C,w=mt(v),v=nc(w)}}return cs({width:c,height:d,x:a,y:u})}function Bs(e,t){const n=Fs(e).scrollLeft;return t?t.left+n:wr(on(e)).left+n}function Mv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function LN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=on(r),s=t?zs(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=tn(1);const c=tn(0),d=nn(r);if((d||!d&&!i)&&((Co(r)!=="body"||zi(l))&&(a=Fs(r)),nn(r))){const h=wr(r);u=eo(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=l&&!d&&!i?Mv(l,a):tn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-a.scrollTop*u.y+c.y+p.y}}function ON(e){return Array.from(e.getClientRects())}function DN(e){const t=on(e),n=Fs(e),r=e.ownerDocument.body,o=dt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=dt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Bs(e);const s=-n.scrollTop;return Vt(r).direction==="rtl"&&(l+=dt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}const Qp=25;function zN(e,t){const n=mt(e),r=on(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const c=Md();(!c||c&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}const u=Bs(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-h);w<=Qp&&(i-=w)}else u<=Qp&&(i+=u);return{width:i,height:l,x:s,y:a}}const FN=new Set(["absolute","fixed"]);function BN(e,t){const n=wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=nn(e)?eo(e):tn(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,u=r*i.y;return{width:l,height:s,x:a,y:u}}function Yp(e,t,n){let r;if(t==="viewport")r=zN(e,n);else if(t==="document")r=DN(on(e));else if(Ut(t))r=BN(t,n);else{const o=Iv(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cs(r)}function Lv(e,t){const n=Yn(e);return n===t||!Ut(n)||mo(n)?!1:Vt(n).position==="fixed"||Lv(n,t)}function $N(e,t){const n=t.get(e);if(n)return n;let r=Ei(e,[],!1).filter(s=>Ut(s)&&Co(s)!=="body"),o=null;const i=Vt(e).position==="fixed";let l=i?Yn(e):e;for(;Ut(l)&&!mo(l);){const s=Vt(l),a=Id(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&FN.has(o.position)||zi(l)&&!a&&Lv(e,l))?r=r.filter(c=>c!==l):o=s,l=Yn(l)}return t.set(e,r),r}function UN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?zs(t)?[]:$N(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,c)=>{const d=Yp(t,c,o);return u.top=dt(d.top,u.top),u.right=Qn(d.right,u.right),u.bottom=Qn(d.bottom,u.bottom),u.left=dt(d.left,u.left),u},Yp(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function VN(e){const{width:t,height:n}=Rv(e);return{width:t,height:n}}function HN(e,t,n){const r=nn(t),o=on(t),i=n==="fixed",l=wr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=tn(0);function u(){a.x=Bs(o)}if(r||!r&&!i)if((Co(t)!=="body"||zi(o))&&(s=Fs(t)),r){const h=wr(t,!0,i,t);a.x=h.x+t.clientLeft,a.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=o&&!r&&!i?Mv(o,s):tn(0),d=l.left+s.scrollLeft-a.x-c.x,p=l.top+s.scrollTop-a.y-c.y;return{x:d,y:p,width:l.width,height:l.height}}function Aa(e){return Vt(e).position==="static"}function Xp(e,t){if(!nn(e)||Vt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return on(e)===n&&(n=n.ownerDocument.body),n}function Ov(e,t){const n=mt(e);if(zs(e))return n;if(!nn(e)){let o=Yn(e);for(;o&&!mo(o);){if(Ut(o)&&!Aa(o))return o;o=Yn(o)}return n}let r=Xp(e,t);for(;r&&NN(r)&&Aa(r);)r=Xp(r,t);return r&&mo(r)&&Aa(r)&&!Id(r)?n:r||AN(e)||n}const WN=async function(e){const t=this.getOffsetParent||Ov,n=this.getDimensions,r=await n(e.floating);return{reference:HN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KN(e){return Vt(e).direction==="rtl"}const GN={convertOffsetParentRelativeRectToViewportRelativeRect:LN,getDocumentElement:on,getClippingRect:UN,getOffsetParent:Ov,getElementRects:WN,getClientRects:ON,getDimensions:VN,getScale:eo,isElement:Ut,isRTL:KN};function Dv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QN(e,t){let n=null,r;const o=on(e);function i(){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),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:h}=u;if(s||t(),!p||!h)return;const w=ll(d),v=ll(o.clientWidth-(c+p)),S=ll(o.clientHeight-(d+h)),g=ll(c),x={rootMargin:-w+"px "+-v+"px "+-S+"px "+-g+"px",threshold:dt(0,Qn(1,a))||1};let C=!0;function N(E){const P=E[0].intersectionRatio;if(P!==a){if(!C)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!Dv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(N,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),i}function YN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Ld(e),c=o||i?[...u?Ei(u):[],...Ei(t)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const d=u&&s?QN(u,n):null;let p=-1,h=null;l&&(h=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let w,v=a?wr(e):null;a&&S();function S(){const g=wr(e);v&&!Dv(v,g)&&n(),v=g,w=requestAnimationFrame(S)}return n(),()=>{var g;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,a&&cancelAnimationFrame(w)}}const XN=wN,qN=SN,JN=yN,ZN=CN,e2=vN,qp=gN,t2=kN,n2=(e,t,n)=>{const r=new Map,o={platform:GN,...n},i={...o.platform,_c:r};return mN(e,t,{...o,platform:i})};var r2=typeof document<"u",o2=function(){},jl=r2?y.useLayoutEffect:o2;function ds(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,o;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(!ds(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ds(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jp(e,t){const n=zv(e);return Math.round(t*n)/n}function Ra(e){const t=y.useRef(e);return jl(()=>{t.current=e}),t}function i2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[c,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=y.useState(r);ds(p,r)||h(r);const[w,v]=y.useState(null),[S,g]=y.useState(null),m=y.useCallback(j=>{j!==E.current&&(E.current=j,v(j))},[]),x=y.useCallback(j=>{j!==P.current&&(P.current=j,g(j))},[]),C=i||w,N=l||S,E=y.useRef(null),P=y.useRef(null),T=y.useRef(c),L=a!=null,A=Ra(a),I=Ra(o),_=Ra(u),H=y.useCallback(()=>{if(!E.current||!P.current)return;const j={placement:t,strategy:n,middleware:p};I.current&&(j.platform=I.current),n2(E.current,P.current,j).then(D=>{const k={...D,isPositioned:_.current!==!1};M.current&&!ds(T.current,k)&&(T.current=k,xo.flushSync(()=>{d(k)}))})},[p,t,n,I,_]);jl(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[u]);const M=y.useRef(!1);jl(()=>(M.current=!0,()=>{M.current=!1}),[]),jl(()=>{if(C&&(E.current=C),N&&(P.current=N),C&&N){if(A.current)return A.current(C,N,H);H()}},[C,N,H,A,L]);const O=y.useMemo(()=>({reference:E,floating:P,setReference:m,setFloating:x}),[m,x]),$=y.useMemo(()=>({reference:C,floating:N}),[C,N]),W=y.useMemo(()=>{const j={position:n,left:0,top:0};if(!$.floating)return j;const D=Jp($.floating,c.x),k=Jp($.floating,c.y);return s?{...j,transform:"translate("+D+"px, "+k+"px)",...zv($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:k}},[n,s,$.floating,c.x,c.y]);return y.useMemo(()=>({...c,update:H,refs:O,elements:$,floatingStyles:W}),[c,H,O,$,W])}const l2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qp({element:r.current,padding:o}).fn(n):{}:r?qp({element:r,padding:o}).fn(n):{}}}},s2=(e,t)=>({...XN(e),options:[e,t]}),a2=(e,t)=>({...qN(e),options:[e,t]}),u2=(e,t)=>({...t2(e),options:[e,t]}),c2=(e,t)=>({...JN(e),options:[e,t]}),d2=(e,t)=>({...ZN(e),options:[e,t]}),f2=(e,t)=>({...e2(e),options:[e,t]}),p2=(e,t)=>({...l2(e),options:[e,t]});var h2="Arrow",Fv=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(ne.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Fv.displayName=h2;var m2=Fv,Od="Popper",[Bv,$v]=er(Od),[g2,Uv]=Bv(Od),Vv=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return f.jsx(g2,{scope:t,anchor:r,onAnchorChange:o,children:n})};Vv.displayName=Od;var Hv="PopperAnchor",Wv=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Uv(Hv,n),l=y.useRef(null),s=pe(t,l),a=y.useRef(null);return y.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&i.onAnchorChange(a.current)}),r?null:f.jsx(ne.div,{...o,ref:s})});Wv.displayName=Hv;var Dd="PopperContent",[y2,v2]=Bv(Dd),Kv=y.forwardRef((e,t)=>{var B,Q,oe,X,te,fe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,S=Uv(Dd,n),[g,m]=y.useState(null),x=pe(t,Ge=>m(Ge)),[C,N]=y.useState(null),E=lv(C),P=(E==null?void 0:E.width)??0,T=(E==null?void 0:E.height)??0,L=r+(i!=="center"?"-"+i:""),A=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},I=Array.isArray(u)?u:[u],_=I.length>0,H={padding:A,boundary:I.filter(w2),altBoundary:_},{refs:M,floatingStyles:O,placement:$,isPositioned:W,middlewareData:j}=i2({strategy:"fixed",placement:L,whileElementsMounted:(...Ge)=>YN(...Ge,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[s2({mainAxis:o+T,alignmentAxis:l}),a&&a2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?u2():void 0,...H}),a&&c2({...H}),d2({...H,apply:({elements:Ge,rects:xt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:Js}=xt.reference,or=Ge.floating.style;or.setProperty("--radix-popper-available-width",`${Sn}px`),or.setProperty("--radix-popper-available-height",`${kn}px`),or.setProperty("--radix-popper-anchor-width",`${Cn}px`),or.setProperty("--radix-popper-anchor-height",`${Js}px`)}}),C&&p2({element:C,padding:s}),S2({arrowWidth:P,arrowHeight:T}),p&&f2({strategy:"referenceHidden",...H})]}),[D,k]=Yv($),G=Gn(w);We(()=>{W&&(G==null||G())},[W,G]);const Y=(B=j.arrow)==null?void 0:B.x,b=(Q=j.arrow)==null?void 0:Q.y,de=((oe=j.arrow)==null?void 0:oe.centerOffset)!==0,[Pe,U]=y.useState();return We(()=>{g&&U(window.getComputedStyle(g).zIndex)},[g]),f.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:W?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(X=j.transformOrigin)==null?void 0:X.x,(te=j.transformOrigin)==null?void 0:te.y].join(" "),...((fe=j.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(y2,{scope:n,placedSide:D,onArrowChange:N,arrowX:Y,arrowY:b,shouldHideArrow:de,children:f.jsx(ne.div,{"data-side":D,"data-align":k,...v,ref:x,style:{...v.style,animation:W?void 0:"none"}})})})});Kv.displayName=Dd;var Gv="PopperArrow",x2={top:"bottom",right:"left",bottom:"top",left:"right"},Qv=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=v2(Gv,r),l=x2[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(m2,{...o,ref:n,style:{...o.style,display:"block"}})})});Qv.displayName=Gv;function w2(e){return e!==null}var S2=e=>({name:"transformOrigin",options:e,fn(t){var S,g,m;const{placement:n,rects:r,middlewareData:o}=t,l=((S=o.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,c]=Yv(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((g=o.arrow)==null?void 0:g.x)??0)+s/2,h=(((m=o.arrow)==null?void 0:m.y)??0)+a/2;let w="",v="";return u==="bottom"?(w=l?d:`${p}px`,v=`${-a}px`):u==="top"?(w=l?d:`${p}px`,v=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,v=l?d:`${h}px`):u==="left"&&(w=`${r.floating.width+a}px`,v=l?d:`${h}px`),{data:{x:w,y:v}}}});function Yv(e){const[t,n="center"]=e.split("-");return[t,n]}var k2=Vv,C2=Wv,b2=Kv,E2=Qv,N2="Portal",zd=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=y.useState(!1);We(()=>i(!0),[]);const l=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?JS.createPortal(f.jsx(ne.div,{...r,ref:t}),l):null});zd.displayName=N2;var Xv=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"}),P2="VisuallyHidden",j2=y.forwardRef((e,t)=>f.jsx(ne.span,{...e,ref:t,style:{...Xv,...e.style}}));j2.displayName=P2;var T2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ar=new WeakMap,sl=new WeakMap,al={},Ia=0,qv=function(e){return e&&(e.host||qv(e.parentNode))},_2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qv(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})},A2=function(e,t,n,r){var o=_2(t,Array.isArray(e)?e:[e]);al[n]||(al[n]=new WeakMap);var i=al[n],l=[],s=new Set,a=new Set(o),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))c(p);else try{var h=p.getAttribute(r),w=h!==null&&h!=="false",v=(Ar.get(p)||0)+1,S=(i.get(p)||0)+1;Ar.set(p,v),i.set(p,S),l.push(p),v===1&&w&&sl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return c(t),s.clear(),Ia++,function(){l.forEach(function(d){var p=Ar.get(d)-1,h=i.get(d)-1;Ar.set(d,p),i.set(d,h),p||(sl.has(d)||d.removeAttribute(r),sl.delete(d)),h||d.removeAttribute(n)}),Ia--,Ia||(Ar=new WeakMap,Ar=new WeakMap,sl=new WeakMap,al={})}},Jv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||T2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),A2(r,o,n,"aria-hidden")):function(){return null}},Xt=function(){return Xt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Q2;var t=Y2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},q2=nx(),to="data-scroll-locked",J2=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(I2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(to,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`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(Tl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(_l,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Tl," .").concat(Tl,` { + right: 0 `).concat(r,`; + } + + .`).concat(_l," .").concat(_l,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(to,`] { + `).concat(M2,": ").concat(s,`px; + } +`)},th=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},Z2=function(){y.useEffect(function(){return document.body.setAttribute(to,(th()+1).toString()),function(){var e=th()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},eP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Z2();var i=y.useMemo(function(){return X2(o)},[o]);return y.createElement(q2,{styles:J2(i,!t,o,n?"":"!important")})},rc=!1;if(typeof window<"u")try{var ul=Object.defineProperty({},"passive",{get:function(){return rc=!0,!0}});window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{rc=!1}var Rr=rc?{passive:!1}:!1,tP=function(e){return e.tagName==="TEXTAREA"},rx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tP(e)&&n[t]==="visible")},nP=function(e){return rx(e,"overflowY")},rP=function(e){return rx(e,"overflowX")},nh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ox(e,r);if(o){var i=ix(e,r),l=i[1],s=i[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ox=function(e,t){return e==="v"?nP(t):rP(t)},ix=function(e,t){return e==="v"?oP(t):iP(t)},lP=function(e,t){return e==="h"&&t==="rtl"?-1:1},sP=function(e,t,n,r,o){var i=lP(e,window.getComputedStyle(t).direction),l=i*r,s=n.target,a=t.contains(s),u=!1,c=l>0,d=0,p=0;do{if(!s)break;var h=ix(e,s),w=h[0],v=h[1],S=h[2],g=v-S-i*w;(w||g)&&ox(e,s)&&(d+=g,p+=w);var m=s.parentNode;s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&(o&&Math.abs(d)<1||!o&&l>d)||!c&&(o&&Math.abs(p)<1||!o&&-l>p))&&(u=!0),u},cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rh=function(e){return[e.deltaX,e.deltaY]},oh=function(e){return e&&"current"in e?e.current:e},aP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uP=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},cP=0,Ir=[];function dP(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(cP++)[0],i=y.useState(nx)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=R2([e.lockRef.current],(e.shards||[]).map(oh),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var g=cl(v),m=n.current,x="deltaX"in v?v.deltaX:m[0]-g[0],C="deltaY"in v?v.deltaY:m[1]-g[1],N,E=v.target,P=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in v&&P==="h"&&E.type==="range")return!1;var T=nh(P,E);if(!T)return!0;if(T?N=P:(N=P==="v"?"h":"v",T=nh(P,E)),!T)return!1;if(!r.current&&"changedTouches"in v&&(x||C)&&(r.current=N),!N)return!0;var L=r.current||N;return sP(L,S,v,L==="h"?x:C,!0)},[]),a=y.useCallback(function(v){var S=v;if(!(!Ir.length||Ir[Ir.length-1]!==i)){var g="deltaY"in S?rh(S):cl(S),m=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&aP(N.delta,g)})[0];if(m&&m.should){S.cancelable&&S.preventDefault();return}if(!m){var x=(l.current.shards||[]).map(oh).filter(Boolean).filter(function(N){return N.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=y.useCallback(function(v,S,g,m){var x={name:v,delta:S,target:g,should:m,shadowParent:fP(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),c=y.useCallback(function(v){n.current=cl(v),r.current=void 0},[]),d=y.useCallback(function(v){u(v.type,rh(v),v.target,s(v,e.lockRef.current))},[]),p=y.useCallback(function(v){u(v.type,cl(v),v.target,s(v,e.lockRef.current))},[]);y.useEffect(function(){return Ir.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Rr),document.addEventListener("touchmove",a,Rr),document.addEventListener("touchstart",c,Rr),function(){Ir=Ir.filter(function(v){return v!==i}),document.removeEventListener("wheel",a,Rr),document.removeEventListener("touchmove",a,Rr),document.removeEventListener("touchstart",c,Rr)}},[]);var h=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(i,{styles:uP(o)}):null,h?y.createElement(eP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pP=$2(tx,dP);var lx=y.forwardRef(function(e,t){return y.createElement($s,Xt({},e,{ref:t,sideCar:pP}))});lx.classNames=$s.classNames;const sx=lx;var hP=[" ","Enter","ArrowUp","ArrowDown"],mP=[" ","Enter"],Sr="Select",[Us,Vs,gP]=Ed(Sr),[bo,vI]=er(Sr,[gP,$v]),Hs=$v(),[yP,tr]=bo(Sr),[vP,xP]=bo(Sr),ax=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:l,defaultValue:s,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:p,required:h,form:w}=e,v=Hs(t),[S,g]=y.useState(null),[m,x]=y.useState(null),[C,N]=y.useState(!1),E=Ms(u),[P,T]=ho({prop:r,defaultProp:o??!1,onChange:i,caller:Sr}),[L,A]=ho({prop:l,defaultProp:s,onChange:a,caller:Sr}),I=y.useRef(null),_=S?w||!!S.closest("form"):!0,[H,M]=y.useState(new Set),O=Array.from(H).map($=>$.props.value).join(";");return f.jsx(k2,{...v,children:f.jsxs(yP,{required:h,scope:t,trigger:S,onTriggerChange:g,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Hn(),value:L,onValueChange:A,open:P,onOpenChange:T,dir:E,triggerPointerDownPosRef:I,disabled:p,children:[f.jsx(Us.Provider,{scope:t,children:f.jsx(vP,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback($=>{M(W=>new Set(W).add($))},[]),onNativeOptionRemove:y.useCallback($=>{M(W=>{const j=new Set(W);return j.delete($),j})},[]),children:n})}),_?f.jsxs(Ix,{"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:L,onChange:$=>A($.target.value),disabled:p,form:w,children:[L===void 0?f.jsx("option",{value:""}):null,Array.from(H)]},O):null]})})};ax.displayName=Sr;var ux="SelectTrigger",cx=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Hs(n),l=tr(ux,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=Vs(n),c=y.useRef("touch"),[d,p,h]=Lx(v=>{const S=u().filter(x=>!x.disabled),g=S.find(x=>x.value===l.value),m=Ox(S,v,g);m!==void 0&&l.onValueChange(m.value)}),w=v=>{s||(l.onOpenChange(!0),h()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return f.jsx(C2,{asChild:!0,...i,children:f.jsx(ne.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":Mx(l.value)?"":void 0,...o,ref:a,onClick:ee(o.onClick,v=>{v.currentTarget.focus(),c.current!=="mouse"&&w(v)}),onPointerDown:ee(o.onPointerDown,v=>{c.current=v.pointerType;const S=v.target;S.hasPointerCapture(v.pointerId)&&S.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:ee(o.onKeyDown,v=>{const S=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(S&&v.key===" ")&&hP.includes(v.key)&&(w(),v.preventDefault())})})})});cx.displayName=ux;var dx="SelectValue",fx=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:l="",...s}=e,a=tr(dx,n),{onValueNodeHasChildrenChange:u}=a,c=i!==void 0,d=pe(t,a.onValueNodeChange);return We(()=>{u(c)},[u,c]),f.jsx(ne.span,{...s,ref:d,style:{pointerEvents:"none"},children:Mx(a.value)?f.jsx(f.Fragment,{children:l}):i})});fx.displayName=dx;var wP="SelectIcon",px=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(ne.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});px.displayName=wP;var SP="SelectPortal",hx=e=>f.jsx(zd,{asChild:!0,...e});hx.displayName=SP;var kr="SelectContent",mx=y.forwardRef((e,t)=>{const n=tr(kr,e.__scopeSelect),[r,o]=y.useState();if(We(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?xo.createPortal(f.jsx(gx,{scope:e.__scopeSelect,children:f.jsx(Us.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(yx,{...e,ref:t})});mx.displayName=kr;var At=10,[gx,nr]=bo(kr),kP="SelectContentImpl",CP=po("SelectContent.RemoveScroll"),yx=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S,...g}=e,m=tr(kr,n),[x,C]=y.useState(null),[N,E]=y.useState(null),P=pe(t,B=>C(B)),[T,L]=y.useState(null),[A,I]=y.useState(null),_=Vs(n),[H,M]=y.useState(!1),O=y.useRef(!1);y.useEffect(()=>{if(x)return Jv(x)},[x]),Nv();const $=y.useCallback(B=>{const[Q,...oe]=_().map(fe=>fe.ref.current),[X]=oe.slice(-1),te=document.activeElement;for(const fe of B)if(fe===te||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Q&&N&&(N.scrollTop=0),fe===X&&N&&(N.scrollTop=N.scrollHeight),fe==null||fe.focus(),document.activeElement!==te))return},[_,N]),W=y.useCallback(()=>$([T,x]),[$,T,x]);y.useEffect(()=>{H&&W()},[H,W]);const{onOpenChange:j,triggerPointerDownPosRef:D}=m;y.useEffect(()=>{if(x){let B={x:0,y:0};const Q=X=>{var te,fe;B={x:Math.abs(Math.round(X.pageX)-(((te=D.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(X.pageY)-(((fe=D.current)==null?void 0:fe.y)??0))}},oe=X=>{B.x<=10&&B.y<=10?X.preventDefault():x.contains(X.target)||j(!1),document.removeEventListener("pointermove",Q),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",oe,{capture:!0})}}},[x,j,D]),y.useEffect(()=>{const B=()=>j(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[j]);const[k,G]=Lx(B=>{const Q=_().filter(te=>!te.disabled),oe=Q.find(te=>te.ref.current===document.activeElement),X=Ox(Q,B,oe);X&&setTimeout(()=>X.ref.current.focus())}),Y=y.useCallback((B,Q,oe)=>{const X=!O.current&&!oe;(m.value!==void 0&&m.value===Q||X)&&(L(B),X&&(O.current=!0))},[m.value]),b=y.useCallback(()=>x==null?void 0:x.focus(),[x]),de=y.useCallback((B,Q,oe)=>{const X=!O.current&&!oe;(m.value!==void 0&&m.value===Q||X)&&I(B)},[m.value]),Pe=r==="popper"?oc:vx,U=Pe===oc?{side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:S}:{};return f.jsx(gx,{scope:n,content:x,viewport:N,onViewportChange:E,itemRefCallback:Y,selectedItem:T,onItemLeave:b,itemTextRefCallback:de,focusSelectedItem:W,selectedItemText:A,position:r,isPositioned:H,searchRef:k,children:f.jsx(sx,{as:CP,allowPinchZoom:!0,children:f.jsx(Td,{asChild:!0,trapped:m.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:ee(o,B=>{var Q;(Q=m.trigger)==null||Q.focus({preventScroll:!0}),B.preventDefault()}),children:f.jsx(jd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:f.jsx(Pe,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:B=>B.preventDefault(),...g,...U,onPlaced:()=>M(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ee(g.onKeyDown,B=>{const Q=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!Q&&B.key.length===1&&G(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let X=_().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(B.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const te=B.target,fe=X.indexOf(te);X=X.slice(fe+1)}setTimeout(()=>$(X)),B.preventDefault()}})})})})})})});yx.displayName=kP;var bP="SelectItemAlignedPosition",vx=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tr(kr,n),l=nr(kr,n),[s,a]=y.useState(null),[u,c]=y.useState(null),d=pe(t,P=>c(P)),p=Vs(n),h=y.useRef(!1),w=y.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:g,focusSelectedItem:m}=l,x=y.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&u&&v&&S&&g){const P=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),A=g.getBoundingClientRect();if(i.dir!=="rtl"){const te=A.left-T.left,fe=L.left-te,Ge=P.left-fe,xt=P.width+Ge,Sn=Math.max(xt,T.width),kn=window.innerWidth-At,Cn=ss(fe,[At,Math.max(At,kn-Sn)]);s.style.minWidth=xt+"px",s.style.left=Cn+"px"}else{const te=T.right-A.right,fe=window.innerWidth-L.right-te,Ge=window.innerWidth-P.right-fe,xt=P.width+Ge,Sn=Math.max(xt,T.width),kn=window.innerWidth-At,Cn=ss(fe,[At,Math.max(At,kn-Sn)]);s.style.minWidth=xt+"px",s.style.right=Cn+"px"}const I=p(),_=window.innerHeight-At*2,H=v.scrollHeight,M=window.getComputedStyle(u),O=parseInt(M.borderTopWidth,10),$=parseInt(M.paddingTop,10),W=parseInt(M.borderBottomWidth,10),j=parseInt(M.paddingBottom,10),D=O+$+H+j+W,k=Math.min(S.offsetHeight*5,D),G=window.getComputedStyle(v),Y=parseInt(G.paddingTop,10),b=parseInt(G.paddingBottom,10),de=P.top+P.height/2-At,Pe=_-de,U=S.offsetHeight/2,B=S.offsetTop+U,Q=O+$+B,oe=D-Q;if(Q<=de){const te=I.length>0&&S===I[I.length-1].ref.current;s.style.bottom="0px";const fe=u.clientHeight-v.offsetTop-v.offsetHeight,Ge=Math.max(Pe,U+(te?b:0)+fe+W),xt=Q+Ge;s.style.height=xt+"px"}else{const te=I.length>0&&S===I[0].ref.current;s.style.top="0px";const Ge=Math.max(de,O+v.offsetTop+(te?Y:0)+U)+oe;s.style.height=Ge+"px",v.scrollTop=Q-de+v.offsetTop}s.style.margin=`${At}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,s,u,v,S,g,i.dir,r]);We(()=>x(),[x]);const[C,N]=y.useState();We(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const E=y.useCallback(P=>{P&&w.current===!0&&(x(),m==null||m(),w.current=!1)},[x,m]);return f.jsx(NP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(ne.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});vx.displayName=bP;var EP="SelectPopperPosition",oc=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=At,...i}=e,l=Hs(n);return f.jsx(b2,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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=EP;var[NP,Fd]=bo(kr,{}),ic="SelectViewport",xx=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nr(ic,n),l=Fd(ic,n),s=pe(t,i.onViewportChange),a=y.useRef(0);return f.jsxs(f.Fragment,{children:[f.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}),f.jsx(Us.Slot,{scope:n,children:f.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ee(o.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const h=Math.abs(a.current-c.scrollTop);if(h>0){const w=window.innerHeight-At*2,v=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),g=Math.max(v,S);if(g0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});xx.displayName=ic;var wx="SelectGroup",[PP,jP]=bo(wx),Sx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hn();return f.jsx(PP,{scope:n,id:o,children:f.jsx(ne.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Sx.displayName=wx;var kx="SelectLabel",Cx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jP(kx,n);return f.jsx(ne.div,{id:o.id,...r,ref:t})});Cx.displayName=kx;var fs="SelectItem",[TP,bx]=bo(fs),Ex=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...l}=e,s=tr(fs,n),a=nr(fs,n),u=s.value===r,[c,d]=y.useState(i??""),[p,h]=y.useState(!1),w=pe(t,m=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,m,r,o)}),v=Hn(),S=y.useRef("touch"),g=()=>{o||(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 f.jsx(TP,{scope:n,value:r,disabled:o,textId:v,isSelected:u,onItemTextChange:y.useCallback(m=>{d(x=>x||((m==null?void 0:m.textContent)??"").trim())},[]),children:f.jsx(Us.ItemSlot,{scope:n,value:r,disabled:o,textValue:c,children:f.jsx(ne.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:w,onFocus:ee(l.onFocus,()=>h(!0)),onBlur:ee(l.onBlur,()=>h(!1)),onClick:ee(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:ee(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:ee(l.onPointerDown,m=>{S.current=m.pointerType}),onPointerMove:ee(l.onPointerMove,m=>{var x;S.current=m.pointerType,o?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(l.onPointerLeave,m=>{var x;m.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:ee(l.onKeyDown,m=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(mP.includes(m.key)&&g(),m.key===" "&&m.preventDefault())})})})})});Ex.displayName=fs;var Wo="SelectItemText",Nx=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,l=tr(Wo,n),s=nr(Wo,n),a=bx(Wo,n),u=xP(Wo,n),[c,d]=y.useState(null),p=pe(t,g=>d(g),a.onItemTextChange,g=>{var m;return(m=s.itemTextRefCallback)==null?void 0:m.call(s,g,a.value,a.disabled)}),h=c==null?void 0:c.textContent,w=y.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:h},a.value),[a.disabled,a.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=u;return We(()=>(v(w),()=>S(w)),[v,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(ne.span,{id:a.textId,...i,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?xo.createPortal(i.children,l.valueNode):null]})});Nx.displayName=Wo;var Px="SelectItemIndicator",jx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return bx(Px,n).isSelected?f.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});jx.displayName=Px;var lc="SelectScrollUpButton",Tx=y.forwardRef((e,t)=>{const n=nr(lc,e.__scopeSelect),r=Fd(lc,e.__scopeSelect),[o,i]=y.useState(!1),l=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;i(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Ax,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Tx.displayName=lc;var sc="SelectScrollDownButton",_x=y.forwardRef((e,t)=>{const n=nr(sc,e.__scopeSelect),r=Fd(sc,e.__scopeSelect),[o,i]=y.useState(!1),l=pe(t,r.onScrollButtonChange);return We(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,c=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Ax,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});_x.displayName=sc;var Ax=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nr("SelectScrollButton",n),l=y.useRef(null),s=Vs(n),a=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>a(),[a]),We(()=>{var c;const u=s().find(d=>d.ref.current===document.activeElement);(c=u==null?void 0:u.ref.current)==null||c.scrollIntoView({block:"nearest"})},[s]),f.jsx(ne.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ee(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ee(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ee(o.onPointerLeave,()=>{a()})})}),_P="SelectSeparator",Rx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});Rx.displayName=_P;var ac="SelectArrow",AP=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hs(n),i=tr(ac,n),l=nr(ac,n);return i.open&&l.position==="popper"?f.jsx(E2,{...o,...r,ref:t}):null});AP.displayName=ac;var RP="SelectBubbleInput",Ix=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=y.useRef(null),i=pe(r,o),l=iv(t);return y.useEffect(()=>{const s=o.current;if(!s)return;const a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&c){const d=new Event("change",{bubbles:!0});c.call(s,t),s.dispatchEvent(d)}},[l,t]),f.jsx(ne.select,{...n,style:{...Xv,...n.style},ref:i,defaultValue:t})});Ix.displayName=RP;function Mx(e){return e===""||e===void 0}function Lx(e){const t=Gn(e),n=y.useRef(""),r=y.useRef(0),o=y.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]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Ox(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=IP(e,Math.max(i,0));o.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function IP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var MP=ax,Dx=cx,LP=fx,OP=px,DP=hx,zx=mx,zP=xx,FP=Sx,Fx=Cx,Bx=Ex,BP=Nx,$P=jx,$x=Tx,Ux=_x,Vx=Rx;const Bd=MP,ih=FP,$d=LP,Ws=y.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Dx,{ref:r,className:se("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,f.jsx(OP,{asChild:!0,children:f.jsx(Ty,{className:"h-4 w-4 opacity-50"})})]}));Ws.displayName=Dx.displayName;const Hx=y.forwardRef(({className:e,...t},n)=>f.jsx($x,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(KC,{className:"h-4 w-4"})}));Hx.displayName=$x.displayName;const Wx=y.forwardRef(({className:e,...t},n)=>f.jsx(Ux,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Ty,{className:"h-4 w-4"})}));Wx.displayName=Ux.displayName;const Ks=y.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>f.jsx(DP,{children:f.jsxs(zx,{ref:o,className:se("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:[f.jsx(Hx,{}),f.jsx(zP,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(Wx,{})]})}));Ks.displayName=zx.displayName;const uc=y.forwardRef(({className:e,...t},n)=>f.jsx(Fx,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));uc.displayName=Fx.displayName;const Ni=y.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(Bx,{ref:r,className:se("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:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx($P,{children:f.jsx(VC,{className:"h-4 w-4"})})}),f.jsx(BP,{children:t})]}));Ni.displayName=Bx.displayName;const UP=y.forwardRef(({className:e,...t},n)=>f.jsx(Vx,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));UP.displayName=Vx.displayName;var Gs="Dialog",[Kx,Gx]=er(Gs),[VP,Ht]=Kx(Gs),Qx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:l=!0}=e,s=y.useRef(null),a=y.useRef(null),[u,c]=ho({prop:r,defaultProp:o??!1,onChange:i,caller:Gs});return f.jsx(VP,{scope:t,triggerRef:s,contentRef:a,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:u,onOpenChange:c,onOpenToggle:y.useCallback(()=>c(d=>!d),[c]),modal:l,children:n})};Qx.displayName=Gs;var Yx="DialogTrigger",Xx=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ht(Yx,n),i=pe(t,o.triggerRef);return f.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Hd(o.open),...r,ref:i,onClick:ee(e.onClick,o.onOpenToggle)})});Xx.displayName=Yx;var Ud="DialogPortal",[HP,qx]=Kx(Ud,{forceMount:void 0}),Jx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ht(Ud,t);return f.jsx(HP,{scope:t,forceMount:n,children:y.Children.map(r,l=>f.jsx(Di,{present:n||i.open,children:f.jsx(zd,{asChild:!0,container:o,children:l})}))})};Jx.displayName=Ud;var ps="DialogOverlay",Zx=y.forwardRef((e,t)=>{const n=qx(ps,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ht(ps,e.__scopeDialog);return i.modal?f.jsx(Di,{present:r||i.open,children:f.jsx(KP,{...o,ref:t})}):null});Zx.displayName=ps;var WP=po("DialogOverlay.RemoveScroll"),KP=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ht(ps,n);return f.jsx(sx,{as:WP,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(ne.div,{"data-state":Hd(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cr="DialogContent",e0=y.forwardRef((e,t)=>{const n=qx(Cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ht(Cr,e.__scopeDialog);return f.jsx(Di,{present:r||i.open,children:i.modal?f.jsx(GP,{...o,ref:t}):f.jsx(QP,{...o,ref:t})})});e0.displayName=Cr;var GP=y.forwardRef((e,t)=>{const n=Ht(Cr,e.__scopeDialog),r=y.useRef(null),o=pe(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return Jv(i)},[]),f.jsx(t0,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&i.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,i=>i.preventDefault())})}),QP=y.forwardRef((e,t)=>{const n=Ht(Cr,e.__scopeDialog),r=y.useRef(!1),o=y.useRef(!1);return f.jsx(t0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),t0=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...l}=e,s=Ht(Cr,n),a=y.useRef(null),u=pe(t,a);return Nv(),f.jsxs(f.Fragment,{children:[f.jsx(Td,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(jd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(XP,{titleId:s.titleId}),f.jsx(JP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Vd="DialogTitle",n0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ht(Vd,n);return f.jsx(ne.h2,{id:o.titleId,...r,ref:t})});n0.displayName=Vd;var r0="DialogDescription",o0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ht(r0,n);return f.jsx(ne.p,{id:o.descriptionId,...r,ref:t})});o0.displayName=r0;var i0="DialogClose",l0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ht(i0,n);return f.jsx(ne.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>o.onOpenChange(!1))})});l0.displayName=i0;function Hd(e){return e?"open":"closed"}var s0="DialogTitleWarning",[YP,a0]=Qb(s0,{contentName:Cr,titleName:Vd,docsSlug:"dialog"}),XP=({titleId:e})=>{const t=a0(s0),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 y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},qP="DialogDescriptionWarning",JP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a0(qP).contentName}}.`;return y.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ZP=Qx,ej=Xx,tj=Jx,nj=Zx,rj=e0,oj=n0,ij=o0,u0=l0,c0="AlertDialog",[lj,xI]=er(c0,[Gx]),wn=Gx(),d0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(ZP,{...r,...n,modal:!0})};d0.displayName=c0;var sj="AlertDialogTrigger",aj=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(ej,{...o,...r,ref:t})});aj.displayName=sj;var uj="AlertDialogPortal",f0=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(tj,{...r,...n})};f0.displayName=uj;var cj="AlertDialogOverlay",p0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(nj,{...o,...r,ref:t})});p0.displayName=cj;var no="AlertDialogContent",[dj,fj]=lj(no),pj=Bb("AlertDialogContent"),h0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=wn(n),l=y.useRef(null),s=pe(t,l),a=y.useRef(null);return f.jsx(YP,{contentName:no,titleName:m0,docsSlug:"alert-dialog",children:f.jsx(dj,{scope:n,cancelRef:a,children:f.jsxs(rj,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:ee(o.onOpenAutoFocus,u=>{var c;u.preventDefault(),(c=a.current)==null||c.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[f.jsx(pj,{children:r}),f.jsx(mj,{contentRef:l})]})})})});h0.displayName=no;var m0="AlertDialogTitle",g0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(oj,{...o,...r,ref:t})});g0.displayName=m0;var y0="AlertDialogDescription",v0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(ij,{...o,...r,ref:t})});v0.displayName=y0;var hj="AlertDialogAction",x0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wn(n);return f.jsx(u0,{...o,...r,ref:t})});x0.displayName=hj;var w0="AlertDialogCancel",S0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=fj(w0,n),i=wn(n),l=pe(t,o);return f.jsx(u0,{...i,...r,ref:l})});S0.displayName=w0;var mj=({contentRef:e})=>{const t=`\`${no}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${no}\` by passing a \`${y0}\` 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 \`${no}\`. 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 y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},gj=d0,yj=f0,k0=p0,C0=h0,b0=x0,E0=S0,N0=g0,P0=v0;const vj=gj,xj=yj,j0=y.forwardRef(({className:e,...t},n)=>f.jsx(k0,{className:se("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}));j0.displayName=k0.displayName;const T0=y.forwardRef(({className:e,...t},n)=>f.jsxs(xj,{children:[f.jsx(j0,{}),f.jsx(C0,{ref:n,className:se("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})]}));T0.displayName=C0.displayName;const _0=({className:e,...t})=>f.jsx("div",{className:se("flex flex-col space-y-2 text-center sm:text-left",e),...t});_0.displayName="AlertDialogHeader";const A0=({className:e,...t})=>f.jsx("div",{className:se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});A0.displayName="AlertDialogFooter";const R0=y.forwardRef(({className:e,...t},n)=>f.jsx(N0,{ref:n,className:se("text-lg font-semibold",e),...t}));R0.displayName=N0.displayName;const I0=y.forwardRef(({className:e,...t},n)=>f.jsx(P0,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));I0.displayName=P0.displayName;const M0=y.forwardRef(({className:e,...t},n)=>f.jsx(b0,{ref:n,className:se(bd(),e),...t}));M0.displayName=b0.displayName;const L0=y.forwardRef(({className:e,...t},n)=>f.jsx(E0,{ref:n,className:se(bd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));L0.displayName=E0.displayName;const O0=y.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:se("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}));O0.displayName="Textarea";function wj(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Sj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cj={};function lh(e,t){return((t||Cj).jsx?kj:Sj).test(e)}const bj=/[ \t\n\f\r]/g;function Ej(e){return typeof e=="object"?e.type==="text"?sh(e.value):!1:sh(e)}function sh(e){return e.replace(bj,"")===""}class Fi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Fi.prototype.normal={};Fi.prototype.property={};Fi.prototype.space=void 0;function D0(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Fi(n,r,t)}function cc(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let Nj=0;const Z=jr(),Ae=jr(),dc=jr(),F=jr(),ge=jr(),ro=jr(),ut=jr();function jr(){return 2**++Nj}const fc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:Ae,commaOrSpaceSeparated:ut,commaSeparated:ro,number:F,overloadedBoolean:dc,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Da=Object.keys(fc);class Wd extends st{constructor(t,n,r,o){let i=-1;if(super(t,n),ah(this,"space",o),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&Aj.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(uh,Mj);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!uh.test(i)){let l=i.replace(_j,Ij);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Wd}return new o(r,t)}function Ij(e){return"-"+e.toLowerCase()}function Mj(e){return e.charAt(1).toUpperCase()}const Lj=D0([z0,Pj,$0,U0,V0],"html"),Kd=D0([z0,jj,$0,U0,V0],"svg");function Oj(e){return e.join(" ").trim()}var Gd={},ch=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Dj=/\n/g,zj=/^\s*/,Fj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Bj=/^:\s*/,$j=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Uj=/^[;\s]*/,Vj=/^\s+|\s+$/g,Hj=` +`,dh="/",fh="*",ar="",Wj="comment",Kj="declaration",Gj=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 o(w){var v=w.match(Dj);v&&(n+=v.length);var S=w.lastIndexOf(Hj);r=~S?w.length-S:r+w.length}function i(){var w={line:n,column:r};return function(v){return v.position=new l(w),u(),v}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var v=new Error(t.source+":"+n+":"+r+": "+w);if(v.reason=w,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(w){var v=w.exec(e);if(v){var S=v[0];return o(S),e=e.slice(S.length),v}}function u(){a(zj)}function c(w){var v;for(w=w||[];v=d();)v!==!1&&w.push(v);return w}function d(){var w=i();if(!(dh!=e.charAt(0)||fh!=e.charAt(1))){for(var v=2;ar!=e.charAt(v)&&(fh!=e.charAt(v)||dh!=e.charAt(v+1));)++v;if(v+=2,ar===e.charAt(v-1))return s("End of comment missing");var S=e.slice(2,v-2);return r+=2,o(S),e=e.slice(v),r+=2,w({type:Wj,comment:S})}}function p(){var w=i(),v=a(Fj);if(v){if(d(),!a(Bj))return s("property missing ':'");var S=a($j),g=w({type:Kj,property:ph(v[0].replace(ch,ar)),value:S?ph(S[0].replace(ch,ar)):ar});return a(Uj),g}}function h(){var w=[];c(w);for(var v;v=p();)v!==!1&&(w.push(v),c(w));return w}return u(),h()};function ph(e){return e?e.replace(Vj,ar):ar}var Qj=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=Xj;var Yj=Qj(Gj);function Xj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Yj.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var l=i.property,s=i.value;o?t(l,s,i):s&&(n=n||{},n[l]=s)}}),n}var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.camelCase=void 0;var qj=/^--[a-zA-Z0-9_-]+$/,Jj=/-([a-z])/g,Zj=/^[^-]+$/,eT=/^-(webkit|moz|ms|o|khtml)-/,tT=/^-(ms)-/,nT=function(e){return!e||Zj.test(e)||qj.test(e)},rT=function(e,t){return t.toUpperCase()},hh=function(e,t){return"".concat(t,"-")},oT=function(e,t){return t===void 0&&(t={}),nT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(tT,hh):e=e.replace(eT,hh),e.replace(Jj,rT))};Qs.camelCase=oT;var iT=Il&&Il.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lT=iT(Gd),sT=Qs;function pc(e,t){var n={};return!e||typeof e!="string"||(0,lT.default)(e,function(r,o){r&&o&&(n[(0,sT.camelCase)(r,t)]=o)}),n}pc.default=pc;var aT=pc;const uT=gs(aT),H0=W0("end"),Qd=W0("start");function W0(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 cT(e){const t=Qd(e),n=H0(e);if(t&&n)return{start:t,end:n}}function ti(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mh(e.position):"start"in e||"end"in e?mh(e):"line"in e||"column"in e?hc(e):""}function hc(e){return gh(e&&e.line)+":"+gh(e&&e.column)}function mh(e){return hc(e&&e.start)+"-"+hc(e&&e.end)}function gh(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(l=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?i.ruleId=r:(i.source=r.slice(0,a),i.ruleId=r.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=ti(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const Yd={}.hasOwnProperty,dT=new Map,fT=/[A-Z]/g,pT=new Set(["table","tbody","thead","tfoot","tr"]),hT=new Set(["td","th"]),K0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mT(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=CT(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=kT(n,t.jsx,t.jsxs)}const o={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"?Kd:Lj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=G0(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function G0(e,t,n){if(t.type==="element")return gT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xT(e,t,n);if(t.type==="mdxjsEsm")return vT(e,t);if(t.type==="root")return wT(e,t,n);if(t.type==="text")return ST(e,t)}function gT(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Kd,e.schema=o),e.ancestors.push(t);const i=Y0(e,t.tagName,!1),l=bT(e,t);let s=qd(e,t);return pT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!Ej(a):!0})),Q0(e,l,i,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function yT(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)}Pi(e,t.position)}function vT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pi(e,t.position)}function xT(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Kd,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Y0(e,t.name,!0),l=ET(e,t),s=qd(e,t);return Q0(e,l,i,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function wT(e,t,n){const r={};return Xd(r,qd(e,t)),e.create(t,e.Fragment,r,n)}function ST(e,t){return t.value}function Q0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function kT(e,t,n){return r;function r(o,i,l,s){const u=Array.isArray(l.children)?n:t;return s?u(i,l,s):u(i,l)}}function CT(e,t){return n;function n(r,o,i,l){const s=Array.isArray(i.children),a=Qd(r);return t(o,i,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function bT(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Yd.call(t.properties,o)){const i=NT(e,o,t.properties[o]);if(i){const[l,s]=i;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&hT.has(t.tagName)?r=s:n[l]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ET(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Pi(e,t.position);else{const o=r.name;let i;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,i=e.evaluater.evaluateExpression(s.expression)}else Pi(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function qd(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:dT;for(;++ro?0:o+t:t=t>o?o: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);i0?(rn(e,e.length,0,t),e):t}const xh={}.hasOwnProperty;function MT(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 oo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qt=rr(/[A-Za-z]/),pt=rr(/[\dA-Za-z]/),DT=rr(/[#-'*+\--9=?A-Z^-~]/);function mc(e){return e!==null&&(e<32||e===127)}const gc=rr(/\d/),zT=rr(/[\dA-Fa-f]/),FT=rr(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const BT=rr(/\p{P}|\p{S}/u),$T=rr(/\s/);function rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function No(e){const t=[];let n=-1,r=0,o=0;for(;++n55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(l=String.fromCharCode(i,s),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(a){return ce(a)?(e.enter(n),s(a)):t(a)}function s(a){return ce(a)&&i++l))return;const P=t.events.length;let T=P,L,A;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(L){A=t.events[T][1].end;break}L=!0}for(g(r),E=P;Ex;){const N=n[C];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function m(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function KT(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sh(e){if(e===null||lt(e)||$T(e))return 1;if(BT(e))return 2}function Zd(e,t,n){const r=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};kh(d,-a),kh(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},i={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={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=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),u=kt(u,Zd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,rn(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&ce(E)?ve(e,m,"linePrefix",i+1)(E):m(E)}function m(E){return E===null||q(E)?e.check(Ch,v,C)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||q(E)?(e.exit("codeFlowValue"),m(E)):(e.consume(E),x)}function C(E){return e.exit("codeFenced"),t(E)}function N(E,P,T){let L=0;return A;function A(O){return E.enter("lineEnding"),E.consume(O),E.exit("lineEnding"),I}function I(O){return E.enter("codeFencedFence"),ce(O)?ve(E,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_(O)}function _(O){return O===s?(E.enter("codeFencedFenceSequence"),H(O)):T(O)}function H(O){return O===s?(L++,E.consume(O),H):L>=l?(E.exit("codeFencedFenceSequence"),ce(O)?ve(E,M,"whitespace")(O):M(O)):T(O)}function M(O){return O===null||q(O)?(E.exit("codeFencedFence"),P(O)):T(O)}}}function o_(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Fa={name:"codeIndented",tokenize:l_},i_={partial:!0,tokenize:s_};function l_(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),ve(e,i,"linePrefix",4+1)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):q(u)?e.attempt(i_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||q(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function s_(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):q(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ve(e,i,"linePrefix",4+1)(l)}function i(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):q(l)?o(l):n(l)}}const a_={name:"codeText",previous:c_,resolve:u_,tokenize:d_};function u_(e){let t=e.length-4,n=3,r,o;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 o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Fo(this.left,r),i.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),Fo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fo(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 n1(e,t,n,r,o,i,l,s,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return g===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(g),e.exit(i),p):g===null||g===32||g===41||mc(g)?n(g):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(g))}function p(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(s),p(g)):g===null||g===60||q(g)?n(g):(e.consume(g),g===92?w:h)}function w(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function v(g){return!c&&(g===null||g===41||lt(g))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(g)):c999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||q(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!ce(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function o1(e,t,n,r,o,i){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),u(p))}function u(p){return p===l?(e.exit(i),a(l)):p===null?n(p):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ve(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===l||p===null||q(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:c)}function d(p){return p===l||p===92?(e.consume(p),c):c(p)}}function ni(e,t){let n;return r;function r(o){return q(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ce(o)?ve(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const x_={name:"definition",tokenize:S_},w_={partial:!0,tokenize:k_};function S_(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),l(h)}function l(h){return r1.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return o=oo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return lt(h)?ni(e,u)(h):u(h)}function u(h){return n1(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(w_,d,d)(h)}function d(h){return ce(h)?ve(e,p,"whitespace")(h):p(h)}function p(h){return h===null||q(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function k_(e,t,n){return r;function r(s){return lt(s)?ni(e,o)(s):n(s)}function o(s){return o1(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return ce(s)?ve(e,l,"whitespace")(s):l(s)}function l(s){return s===null||q(s)?t(s):n(s)}}const C_={name:"hardBreakEscape",tokenize:b_};function b_(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return q(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const E_={name:"headingAtx",resolve:N_,tokenize:P_};function N_(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},rn(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function P_(e,t,n){let r=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&r++<6?(e.consume(c),l):c===null||lt(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||q(c)?(e.exit("atxHeading"),t(c)):ce(c)?ve(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||lt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const j_=["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"],Eh=["pre","script","style","textarea"],T_={concrete:!0,name:"htmlFlow",resolveTo:R_,tokenize:I_},__={partial:!0,tokenize:L_},A_={partial:!0,tokenize:M_};function R_(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 I_(e,t,n){const r=this;let o,i,l,s,a;return u;function u(b){return c(b)}function c(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),i=!0,v):b===63?(e.consume(b),o=3,r.interrupt?t:k):qt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),o=2,h):b===91?(e.consume(b),o=5,s=0,w):qt(b)?(e.consume(b),o=4,r.interrupt?t:k):n(b)}function h(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const de="CDATA[";return b===de.charCodeAt(s++)?(e.consume(b),s===de.length?r.interrupt?t:_:w):n(b)}function v(b){return qt(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||lt(b)){const de=b===47,Pe=l.toLowerCase();return!de&&!i&&Eh.includes(Pe)?(o=1,r.interrupt?t(b):_(b)):j_.includes(l.toLowerCase())?(o=6,de?(e.consume(b),g):r.interrupt?t(b):_(b)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):i?m(b):x(b))}return b===45||pt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function g(b){return b===62?(e.consume(b),r.interrupt?t:_):n(b)}function m(b){return ce(b)?(e.consume(b),m):A(b)}function x(b){return b===47?(e.consume(b),A):b===58||b===95||qt(b)?(e.consume(b),C):ce(b)?(e.consume(b),x):A(b)}function C(b){return b===45||b===46||b===58||b===95||pt(b)?(e.consume(b),C):N(b)}function N(b){return b===61?(e.consume(b),E):ce(b)?(e.consume(b),N):x(b)}function E(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,P):ce(b)?(e.consume(b),E):T(b)}function P(b){return b===a?(e.consume(b),a=null,L):b===null||q(b)?n(b):(e.consume(b),P)}function T(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||lt(b)?N(b):(e.consume(b),T)}function L(b){return b===47||b===62||ce(b)?x(b):n(b)}function A(b){return b===62?(e.consume(b),I):n(b)}function I(b){return b===null||q(b)?_(b):ce(b)?(e.consume(b),I):n(b)}function _(b){return b===45&&o===2?(e.consume(b),$):b===60&&o===1?(e.consume(b),W):b===62&&o===4?(e.consume(b),G):b===63&&o===3?(e.consume(b),k):b===93&&o===5?(e.consume(b),D):q(b)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(__,Y,H)(b)):b===null||q(b)?(e.exit("htmlFlowData"),H(b)):(e.consume(b),_)}function H(b){return e.check(A_,M,Y)(b)}function M(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),O}function O(b){return b===null||q(b)?H(b):(e.enter("htmlFlowData"),_(b))}function $(b){return b===45?(e.consume(b),k):_(b)}function W(b){return b===47?(e.consume(b),l="",j):_(b)}function j(b){if(b===62){const de=l.toLowerCase();return Eh.includes(de)?(e.consume(b),G):_(b)}return qt(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),j):_(b)}function D(b){return b===93?(e.consume(b),k):_(b)}function k(b){return b===62?(e.consume(b),G):b===45&&o===2?(e.consume(b),k):_(b)}function G(b){return b===null||q(b)?(e.exit("htmlFlowData"),Y(b)):(e.consume(b),G)}function Y(b){return e.exit("htmlFlow"),t(b)}}function M_(e,t,n){const r=this;return o;function o(l){return q(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function L_(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ys,t,n)}}const O_={name:"htmlText",tokenize:D_};function D_(e,t,n){const r=this;let o,i,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),N):k===63?(e.consume(k),x):qt(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,w):qt(k)?(e.consume(k),m):n(k)}function c(k){return k===45?(e.consume(k),h):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):q(k)?(l=d,W(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),h):d(k)}function h(k){return k===62?$(k):k===45?p(k):d(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(i++)?(e.consume(k),i===G.length?v:w):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),S):q(k)?(l=v,W(k)):(e.consume(k),v)}function S(k){return k===93?(e.consume(k),g):v(k)}function g(k){return k===62?$(k):k===93?(e.consume(k),g):v(k)}function m(k){return k===null||k===62?$(k):q(k)?(l=m,W(k)):(e.consume(k),m)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):q(k)?(l=x,W(k)):(e.consume(k),x)}function C(k){return k===62?$(k):x(k)}function N(k){return qt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||pt(k)?(e.consume(k),E):P(k)}function P(k){return q(k)?(l=P,W(k)):ce(k)?(e.consume(k),P):$(k)}function T(k){return k===45||pt(k)?(e.consume(k),T):k===47||k===62||lt(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),$):k===58||k===95||qt(k)?(e.consume(k),A):q(k)?(l=L,W(k)):ce(k)?(e.consume(k),L):$(k)}function A(k){return k===45||k===46||k===58||k===95||pt(k)?(e.consume(k),A):I(k)}function I(k){return k===61?(e.consume(k),_):q(k)?(l=I,W(k)):ce(k)?(e.consume(k),I):L(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),o=k,H):q(k)?(l=_,W(k)):ce(k)?(e.consume(k),_):(e.consume(k),M)}function H(k){return k===o?(e.consume(k),o=void 0,O):k===null?n(k):q(k)?(l=H,W(k)):(e.consume(k),H)}function M(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||lt(k)?L(k):(e.consume(k),M)}function O(k){return k===47||k===62||lt(k)?L(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function W(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),j}function j(k){return ce(k)?ve(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):D(k)}function D(k){return e.enter("htmlTextData"),l(k)}}const ef={name:"labelEnd",resolveAll:$_,resolveTo:U_,tokenize:V_},z_={tokenize:H_},F_={tokenize:W_},B_={tokenize:K_};function $_(e){let t=-1;const n=[];for(;++t=3&&(u===null||q(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ce(u)?ve(e,s,"whitespace")(u):s(u))}}const Ze={continuation:{tokenize:nA},exit:oA,name:"list",tokenize:tA},Z_={partial:!0,tokenize:iA},eA={partial:!0,tokenize:rA};function tA(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return s;function s(h){const w=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:gc(h)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Al,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return gc(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ys,r.interrupt?n:c,e.attempt(Z_,p,d))}function c(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function d(h){return ce(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function nA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ys,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!ce(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(eA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(Ze,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function rA(e,t,n){const r=this;return ve(e,o,"listItemIndent",r.containerState.size+1);function o(i){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(i):n(i)}}function oA(e){e.exit(this.containerState.type)}function iA(e,t,n){const r=this;return ve(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function o(i){const l=r.events[r.events.length-1];return!ce(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Nh={name:"setextUnderline",resolveTo:lA,tokenize:sA};function lA(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function sA(e,t,n){const r=this;let o;return i;function i(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===o?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ce(u)?ve(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||q(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const aA={tokenize:uA};function uA(e){const t=this,n=e.attempt(Ys,r,e.attempt(this.parser.constructs.flowInitial,o,ve(e,e.attempt(this.parser.constructs.flow,o,e.attempt(h_,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cA={resolveAll:l1()},dA=i1("string"),fA=i1("text");function i1(e){return{resolveAll:l1(e==="text"?pA:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,s);return l;function l(c){return u(c)?i(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let p=-1;if(d)for(;++p-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function NA(e,t){let n=-1;const r=[];let o;for(;++n0){const jt=J.tokenStack[J.tokenStack.length-1];(jt[1]||jh).call(J,void 0,jt[0])}for(V.position={start:Nn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Nn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me1?"-"+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 VA(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 HA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function u1(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function WA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return u1(e,t);const o={src:No(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function KA(e,t){const n={src:No(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 GA(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 QA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return u1(e,t);const o={href:No(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function YA(e,t){const n={href:No(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 XA(e,t,n){const r=e.all(t),o=n?qA(n):c1(t),i={},l=[];if(typeof t.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(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:[]}),i.className=["task-list-item"]}let s=-1;for(;++s1}function JA(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Qd(t.children[1]),a=H0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function rR(e,t,n){const r=n?n.children:void 0,i=(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]),o=r.index+r[0].length,r=n.exec(t);return i.push(Ah(t.slice(o),o>0,!1)),i.join("")}function Ah(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Th||i===_h;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Th||i===_h;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function lR(e,t){const n={type:"text",value:iR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const aR={blockquote:DA,break:zA,code:FA,delete:BA,emphasis:$A,footnoteReference:UA,heading:VA,html:HA,imageReference:WA,image:KA,inlineCode:GA,linkReference:QA,link:YA,listItem:XA,list:JA,paragraph:ZA,root:eR,strong:tR,table:nR,tableCell:oR,tableRow:rR,text:lR,thematicBreak:sR,toml:dl,yaml:dl,definition:dl,footnoteDefinition:dl};function dl(){}const d1=-1,Xs=0,ri=1,hs=2,tf=3,nf=4,rf=5,of=6,f1=7,p1=8,Rh=typeof self=="object"?self:globalThis,uR=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case Xs:case d1:return n(l,o);case ri:{const s=n([],o);for(const a of l)s.push(r(a));return s}case hs:{const s=n({},o);for(const[a,u]of l)s[r(a)]=r(u);return s}case tf:return n(new Date(l),o);case nf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),o)}case rf:{const s=n(new Map,o);for(const[a,u]of l)s.set(r(a),r(u));return s}case of:{const s=n(new Set,o);for(const a of l)s.add(r(a));return s}case f1:{const{name:s,message:a}=l;return n(new Rh[s](a),o)}case p1:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);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 Rh[i](l),o)};return r},Ih=e=>uR(new Map,e)(0),Mr="",{toString:cR}={},{keys:dR}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[Xs,t];const n=cR.call(e).slice(8,-1);switch(n){case"Array":return[ri,Mr];case"Object":return[hs,Mr];case"Date":return[tf,Mr];case"RegExp":return[nf,Mr];case"Map":return[rf,Mr];case"Set":return[of,Mr];case"DataView":return[ri,n]}return n.includes("Array")?[ri,n]:n.includes("Error")?[f1,n]:[hs,n]},fl=([e,t])=>e===Xs&&(t==="function"||t==="symbol"),fR=(e,t,n,r)=>{const o=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},i=l=>{if(n.has(l))return n.get(l);let[s,a]=Bo(l);switch(s){case Xs:{let c=l;switch(a){case"bigint":s=p1,c=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return o([d1],l)}return o([s,c],l)}case ri:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),o([a,[...p]],l)}const c=[],d=o([s,c],l);for(const p of l)c.push(i(p));return d}case hs:{if(a)switch(a){case"BigInt":return o([a,l.toString()],l);case"Boolean":case"Number":case"String":return o([a,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const c=[],d=o([s,c],l);for(const p of dR(l))(e||!fl(Bo(l[p])))&&c.push([i(p),i(l[p])]);return d}case tf:return o([s,l.toISOString()],l);case nf:{const{source:c,flags:d}=l;return o([s,{source:c,flags:d}],l)}case rf:{const c=[],d=o([s,c],l);for(const[p,h]of l)(e||!(fl(Bo(p))||fl(Bo(h))))&&c.push([i(p),i(h)]);return d}case of:{const c=[],d=o([s,c],l);for(const p of l)(e||!fl(Bo(p)))&&c.push(i(p));return d}}const{message:u}=l;return o([s,{name:a,message:u}],l)};return i},Mh=(e,{json:t,lossy:n}={})=>{const r=[];return fR(!(t||n),!!t,new Map,r)(e),r},ms=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ih(Mh(e,t)):structuredClone(e):(e,t)=>Ih(Mh(e,t));function pR(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 hR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pR,r=e.options.footnoteBackLabel||hR,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let m=typeof n=="string"?n:n(a,h);typeof m=="string"&&(m={type:"text",value:m}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const m=S.children[S.children.length-1];m&&m.type==="text"?m.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else c.push(...w);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(c,!0)};e.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ms(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const h1=function(e){if(e==null)return xR;if(typeof e=="function")return qs(e);if(typeof e=="object")return Array.isArray(e)?gR(e):yR(e);if(typeof e=="string")return vR(e);throw new Error("Expected function, string, or object as test")};function gR(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=m1,w,v,S;if((!t||i(a,u,c[c.length-1]||void 0))&&(h=bR(n(a,c)),h[0]===Lh))return h;if("children"in a&&a.children){const g=a;if(g.children&&h[0]!==kR)for(v=(r?g.children.length:-1)+l,S=c.concat(g);v>-1&&v0&&n.push({type:"text",value:` +`}),n}function Oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Dh(e,t){const n=NR(e,t),r=n.one(e,void 0),o=mR(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:` +`},o),i}function AR(e,t){return e&&"run"in e?async function(n,r){const o=Dh(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Dh(n,{file:r,...e||t})}}function zh(e){if(e)throw e}var Rl=Object.prototype.hasOwnProperty,y1=Object.prototype.toString,Fh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,$h=function(t){return typeof Array.isArray=="function"?Array.isArray(t):y1.call(t)==="[object Array]"},Uh=function(t){if(!t||y1.call(t)!=="[object Object]")return!1;var n=Rl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Rl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Rl.call(t,o)},Vh=function(t,n){Fh&&n.name==="__proto__"?Fh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Hh=function(t,n){if(n==="__proto__")if(Rl.call(t,n)){if(Bh)return Bh(t,n).value}else return;return t[n]},RR=function e(){var t,n,r,o,i,l,s=arguments[0],a=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(o);try{a=e.apply(this,l)}catch(u){const c=u;if(s&&n)throw c;return o(c)}s||(a&&a.then&&typeof a.then=="function"?a.then(i,o):a instanceof Error?o(a):i(a))}function o(l,...s){n||(n=!0,t(l,...s))}function i(l){o(null,l)}}const Qt={basename:LR,dirname:OR,extname:DR,join:zR,sep:"/"};function LR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bi(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function OR(e){if(Bi(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 DR(e){Bi(e);let t=e.length,n=-1,r=0,o=-1,i=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?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function zR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function BR(e,t){let n="",r=0,o=-1,i=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("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else s===46&&i>-1?i++:i=-1}return n}function Bi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $R={cwd:UR};function UR(){return"/"}function wc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function VR(e){if(typeof e=="string")e=new URL(e);else if(!wc(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 HR(e)}function HR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...w]=c;const v=r[p][1];xc(v)&&xc(h)&&(h=$a(!0,v,h)),r[p]=[u,h,...w]}}}}const QR=new lf().freeze();function Wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ga(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 Kh(e){if(!xc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pl(e){return YR(e)?e:new v1(e)}function YR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XR(e){return typeof e=="string"||qR(e)}function qR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Qh=[],Yh={allowDangerousHtml:!0},ZR=/^(https?|ircs?|mailto|xmpp)$/i,eI=[{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 tI(e){const t=nI(e),n=rI(e);return oI(t.runSync(t.parse(n),n),e)}function nI(e){const t=e.rehypePlugins||Qh,n=e.remarkPlugins||Qh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yh}:Yh;return QR().use(OA).use(n).use(AR,r).use(t)}function rI(e){const t=e.children||"",n=new v1;return typeof t=="string"&&(n.value=t),n}function oI(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||iI;for(const c of eI)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+JR+c.id,void 0);return g1(e,u),mT(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,d,p){if(c.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:c.value},d;if(c.type==="element"){let h;for(h in za)if(Object.hasOwn(za,h)&&Object.hasOwn(c.properties,h)){const w=c.properties[h],v=za[h];(v===null||v.includes(c.tagName))&&(c.properties[h]=a(String(w||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):i?i.includes(c.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(c,d,p)),h&&p&&typeof d=="number")return s&&c.children?p.children.splice(d,1,...c.children):p.children.splice(d,1),d}}}function iI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||ZR.test(e.slice(0,t))?e:""}const x1=y.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:o,isGenerating:i,stop:l,...s},a)=>{const u=y.useRef(null),c=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return y.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),c()},[t]),f.jsxs("div",{className:se("flex h-full flex-col",e),ref:a,...s,children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?f.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:f.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>f.jsxs("div",{className:se("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:f.jsx(Li,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:se("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:[f.jsxs("div",{className:"text-xs opacity-70",children:[d.role==="user"?"You":"Assistant"," • #",p+1]}),f.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:f.jsx(tI,{components:{p:({children:h})=>f.jsx("p",{className:"mb-2 last:mb-0",children:h}),ul:({children:h})=>f.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:h}),ol:({children:h})=>f.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:h}),li:({children:h})=>f.jsx("li",{className:"mb-1",children:h}),code:({children:h,className:w})=>!w?f.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:h}):f.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:h}),pre:({children:h})=>f.jsx("div",{className:"mb-2 last:mb-0",children:h}),strong:({children:h})=>f.jsx("strong",{className:"font-semibold",children:h}),em:({children:h})=>f.jsx("em",{className:"italic",children:h}),blockquote:({children:h})=>f.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:h}),h1:({children:h})=>f.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:h}),h2:({children:h})=>f.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:h}),h3:({children:h})=>f.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:h})},children:d.content})})]}),d.role==="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:f.jsx(Ly,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),f.jsx("div",{ref:u})]}),f.jsx("div",{className:"border-t p-4",children:f.jsxs("form",{onSubmit:o,className:"flex gap-2",children:[f.jsx(O0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),o(d))}}),i?f.jsx(Xe,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(Eb,{className:"h-4 w-4"})}):f.jsx(Xe,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(yb,{className:"h-4 w-4"})})]})})]})});x1.displayName="Chat";const Kt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function w1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function lI(){return w1()}class sI{getAllSessions(){const t=localStorage.getItem(Kt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const o={id:w1(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},i=this.getAllSessions();return i.unshift(o),localStorage.setItem(Kt.sessions,JSON.stringify(i)),o}updateSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);o!==-1&&(r[o]={...r[o],...n,updatedAt:Date.now()},localStorage.setItem(Kt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(o=>o.id!==t);localStorage.setItem(Kt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Kt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),o=r.findIndex(i=>i.id===t);if(o!==-1){const i={...n,id:lI(),timestamp:Date.now()};r[o].messages.push(i),r[o].updatedAt=Date.now(),localStorage.setItem(Kt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Kt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Kt.currentSession,t)}clear(){localStorage.removeItem(Kt.sessions),localStorage.removeItem(Kt.currentSession)}}const je=new sI;function aI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[o,i]=y.useState([]),[l,s]=y.useState(null),[a,u]=y.useState(""),[c,d]=y.useState({isLoading:!1,error:null}),[p,h]=y.useState(n),[w,v]=y.useState(r),[S,g]=y.useState(.7),[m,x]=y.useState(1024),C=It.useMemo(()=>{var O;const M=o.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!M,messageCount:((O=M==null?void 0:M.messages)==null?void 0:O.length)||0}),M},[o,l]),N=It.useMemo(()=>{const M=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",M.length,M.map(O=>({id:O.id,role:O.role}))),M},[C==null?void 0:C.messages]);y.useEffect(()=>{const M=je.getAllSessions();i(M);const O=je.getCurrentSession();O?s(O.id):M.length>0&&(s(M[0].id),je.setCurrentSession(M[0].id))},[]);const E=y.useCallback(()=>{const M=je.createSession(void 0,p,w),O=je.getAllSessions();return i([...O]),s(M.id),je.setCurrentSession(M.id),M.id},[p,w]),P=y.useCallback(M=>{s(M),je.setCurrentSession(M)},[]),T=y.useCallback(M=>{je.deleteSession(M);const O=je.getAllSessions();i([...O]),l===M&&(O.length>0?(s(O[0].id),je.setCurrentSession(O[0].id)):s(null))},[l]),L=y.useCallback((M,O)=>{je.updateSession(M,{title:O});const $=je.getAllSessions();i([...$])},[]),A=y.useCallback(M=>{if(!l)return;je.addMessageToSession(l,M);const O=je.getAllSessions();i([...O])},[l]),I=y.useCallback(async()=>{var $,W;if(!a.trim()||c.isLoading)return;let M=l;M||(M=E());const O=a.trim();if(u(""),d({isLoading:!0,error:null}),M){je.addMessageToSession(M,{role:"user",content:O});const j=je.getAllSessions();i([...j])}try{const j=je.getSession(M),D=((W=($=j==null?void 0:j.messages)==null?void 0:$.filter(Y=>Y.role!=="system"))==null?void 0:W.map(Y=>({role:Y.role,content:Y.content})))||[],k=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:O,messages:D,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:m})});if(!k.ok){const Y=await k.json();throw new Error(Y.detail||`HTTP error! status: ${k.status}`)}const G=await k.json();if(M){je.addMessageToSession(M,{role:"assistant",content:G.content,thinking_content:G.thinking_content,model_used:G.model_used,supports_thinking:G.supports_thinking});const Y=je.getAllSessions();i([...Y])}d({isLoading:!1,error:null})}catch(j){const D=j instanceof Error?j.message:"An error occurred";if(d({isLoading:!1,error:D}),M){je.addMessageToSession(M,{role:"assistant",content:`Sorry, I encountered an error: ${D}`});const k=je.getAllSessions();i([...k])}}},[a,c.isLoading,l,E,A,w,N.length,t,p,S,m]),_=y.useCallback(()=>{d({isLoading:!1,error:null})},[]),H=y.useCallback(()=>{je.clear(),i([]),s(null)},[]);return{sessions:o,currentSession:C,currentSessionId:l,createNewSession:E,selectSession:P,deleteSession:T,renameSession:L,clearAllSessions:H,messages:N,input:a,setInput:u,sendMessage:I,stopGeneration:_,isLoading:c.isLoading,error:c.error,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:m,setMaxTokens:x}}function uI(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:o,deleteSession:i,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:c,isLoading:d,selectedModel:p,setSelectedModel:h,systemPrompt:w,setSystemPrompt:v,temperature:S,setTemperature:g,maxTokens:m,setMaxTokens:x}=aI(),[C,N]=y.useState(!1),[E,P]=y.useState(null),[T,L]=y.useState(!1),[A,I]=y.useState(null),[_,H]=y.useState([]),[M,O]=y.useState([]),[$,W]=y.useState(null),j=()=>{try{const U=JSON.parse(localStorage.getItem("savedAssistants")||"[]");O(U)}catch(U){console.error("Failed to load saved assistants:",U)}},D=()=>{if(!w.trim())return;const U={id:Date.now().toString(),name:w.substring(0,50)+(w.length>50?"...":""),systemPrompt:w,temperature:S,maxTokens:m,model:p,createdAt:new Date().toISOString()},B=[...M,U];O(B),localStorage.setItem("savedAssistants",JSON.stringify(B))},k=U=>{const B=M.find(Q=>Q.id===U);B&&(v(B.systemPrompt),g(B.temperature),x(B.maxTokens),B.model&&h(B.model))},G=[{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."}],Y=U=>{const B=G.find(Q=>Q.name===U);B&&(v(B.prompt),W(U))};y.useEffect(()=>{Pe(),j()},[]),y.useEffect(()=>{if(p&&!_.find(U=>U.model_name===p)){const U=_[0];U&&h(U.model_name)}},[_,p,h]),y.useEffect(()=>{(async()=>{if(!p||!_.length)return;const B=_.find(X=>X.model_name===p);if(!B)return;const Q=`${window.location.protocol}//${window.location.host}`;if(B.type==="local"&&!B.is_loaded){I(B),L(!0);return}const oe=_.filter(X=>X.type==="local"&&X.is_loaded&&X.model_name!==p);for(const X of oe)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:X.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${X.model_name}`)}catch(te){console.error(`Error auto-unloading model ${X.model_name}:`,te)}oe.length>0&&Pe()})()},[p,_]);const b=async()=>{if(A){L(!1),P(A.model_name);try{const U=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${U}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:A.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${A.model_name}`),Pe();else{console.error(`❌ Failed to load model: ${A.model_name}`);const Q=_.find(oe=>oe.type==="api");Q&&h(Q.model_name)}}catch(U){console.error("Error loading model:",U);const B=_.find(Q=>Q.type==="api");B&&h(B.model_name)}finally{P(null),I(null)}}},de=()=>{L(!1),I(null);const U=_.find(B=>B.type==="api");U&&h(U.model_name)};y.useEffect(()=>{const U=async()=>{const B=`${window.location.protocol}//${window.location.host}`,Q=_.filter(oe=>oe.type==="local"&&oe.is_loaded);for(const oe of Q)try{await fetch(`${B}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:oe.model_name})}),console.log(`✅ Cleanup: unloaded ${oe.model_name}`)}catch(X){console.error(`Error cleaning up model ${oe.model_name}:`,X)}};return()=>{U()}},[_]);const Pe=async()=>{try{const U=`${window.location.protocol}//${window.location.host}`,B=await fetch(`${U}/models`);if(B.ok){const Q=await B.json();if(H(Q.models),Q.current_model&&p!==Q.current_model)h(Q.current_model);else if(!p&&Q.models.length>0){const X=Q.models.find(te=>te.type==="api")||Q.models[0];h(X.model_name)}}}catch(U){console.error("Failed to fetch models:",U)}};return f.jsxs("div",{className:"h-screen bg-background flex",children:[f.jsx("div",{className:` + ${C?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs(Xe,{onClick:r,size:"sm",children:[f.jsx(fb,{className:"h-4 w-4 mr-1"}),"New"]})]}),f.jsx("div",{className:"space-y-2",children:e.map(U=>f.jsxs(it,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===U.id?"bg-accent border-primary":""}`,onClick:()=>o(U.id),children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:U.title}),f.jsx(Xe,{size:"sm",variant:"ghost",onClick:B=>{B.stopPropagation(),i(U.id)},className:"h-6 w-6 p-0",children:f.jsx(Iy,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[U.messages.length," messages"]})]},U.id))})]})}),C&&f.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>N(!1)}),f.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 flex-shrink-0",children:f.jsxs("div",{className:"flex h-14 items-center px-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Sd,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Assistant Studio"}),t&&f.jsxs(be,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),f.jsx("div",{className:"ml-auto flex items-center gap-2",children:f.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>N(!C),className:"flex-shrink-0",children:[f.jsx(ib,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]})})]})}),f.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[f.jsx("div",{className:"flex-1 flex flex-col",children:f.jsx(x1,{messages:l.map(U=>({id:U.id,role:U.role,content:U.content,createdAt:new Date(U.timestamp)})),input:s,handleInputChange:U=>a(U.target.value),handleSubmit:async U=>{U.preventDefault(),!(!p||!_.find(B=>B.model_name===p))&&await u()},isGenerating:d,stop:c,className:"flex-1"})}),f.jsxs("div",{className:"w-[480px] xl:w-[520px] border-l bg-muted/30 flex flex-col h-full",children:[f.jsxs("div",{className:"flex items-center gap-3 p-6 border-b",children:[f.jsx(kd,{className:"h-6 w-6"}),f.jsx("h2",{className:"font-semibold text-xl",children:"Build Your Assistant"})]}),f.jsxs(kE,{defaultValue:"model",className:"flex-1 flex flex-col",children:[f.jsxs(ov,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[f.jsxs(Nl,{value:"model",className:"flex items-center gap-2",children:[f.jsx(Cb,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),f.jsxs(Nl,{value:"assistant",className:"flex items-center gap-2",children:[f.jsx(Li,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Assistant"})]}),f.jsxs(Nl,{value:"presets",className:"flex items-center gap-2",children:[f.jsx(FC,{className:"h-4 w-4"}),f.jsx("span",{className:"hidden sm:inline",children:"Presets"})]})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[f.jsx(Pl,{value:"model",className:"p-6 space-y-6 m-0",children:f.jsx(cI,{models:_,selectedModel:p,setSelectedModel:h,autoLoadingModel:E,temperature:S,setTemperature:g,maxTokens:m,setMaxTokens:x})}),f.jsx(Pl,{value:"assistant",className:"p-6 space-y-6 m-0",children:f.jsx(dI,{savedAssistants:M,loadSavedAssistant:k,saveAssistant:D,systemPrompt:w,setSystemPrompt:v,isLoading:d})}),f.jsx(Pl,{value:"presets",className:"p-6 space-y-6 m-0",children:f.jsx(fI,{selectedPreset:$,presets:G,onPresetSelect:Y})})]})]})]})]})]}),f.jsx(vj,{open:T,onOpenChange:L,children:f.jsxs(T0,{children:[f.jsxs(_0,{children:[f.jsx(R0,{children:"Load Local Model"}),f.jsxs(I0,{children:["Loading ",f.jsx("strong",{children:A==null?void 0:A.name})," will use approximately ",f.jsx("strong",{children:A==null?void 0:A.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),f.jsxs(A0,{children:[f.jsx(L0,{onClick:de,children:"Cancel"}),f.jsx(M0,{onClick:b,children:"Load Model"})]})]})})]})}function cI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:o,setTemperature:i,maxTokens:l,setMaxTokens:s}){return f.jsxs(f.Fragment,{children:[f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsx(Bt,{className:"text-base",children:"Model Selection"})}),f.jsxs(Et,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium mb-3 block",children:"Active Model"}),f.jsxs(Bd,{value:t||"",onValueChange:n,children:[f.jsx(Ws,{className:"w-full",children:f.jsx($d,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(c=>c.model_name===t);if(!a)return t;const u=a.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[u?f.jsx(ls,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?f.jsx(Ci,{className:"h-4 w-4 text-purple-500"}):f.jsx(Gu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:a.name}),r===t?f.jsx(be,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(be,{variant:"outline",className:"text-xs",children:u?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(Ks,{children:[f.jsxs(ih,{children:[f.jsx(uc,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>f.jsx(Ni,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ls,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:a.name}),f.jsx(be,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),f.jsxs(ih,{children:[f.jsx(uc,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>f.jsx(Ni,{value:a.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?f.jsx(Ci,{className:"h-4 w-4 text-purple-500"}):f.jsx(Gu,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:a.name}),r===a.model_name?f.jsx(be,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?f.jsx(be,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(be,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})]}),f.jsx("div",{className:"pt-2",children:f.jsxs(wy,{to:"/models",className:"text-sm text-blue-600 hover:text-blue-800 hover:underline inline-flex items-center gap-1",children:[f.jsx(wd,{className:"h-4 w-4"}),"View Model Catalog"]})})]})]}),f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsx(Bt,{className:"text-base",children:"Generation Parameters"})}),f.jsxs(Et,{className:"space-y-6",children:[f.jsxs("div",{children:[f.jsxs(Ot,{className:"text-sm font-medium mb-3 block",children:["Temperature: ",o]}),f.jsx(Ju,{value:[o],onValueChange:a=>i(a[0]),max:2,min:0,step:.1,className:"w-full"}),f.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mt-1",children:[f.jsx("span",{children:"Lower = more focused"}),f.jsx("span",{children:"Higher = more creative"})]})]}),f.jsxs("div",{children:[f.jsxs(Ot,{className:"text-sm font-medium mb-3 block",children:["Max Tokens: ",l]}),f.jsx(Ju,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full"})]})]})]})]})}function dI({savedAssistants:e,loadSavedAssistant:t,saveAssistant:n,systemPrompt:r,setSystemPrompt:o,isLoading:i}){return f.jsxs(f.Fragment,{children:[f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsxs(Bt,{className:"text-base flex items-center gap-2",children:[f.jsx(Ly,{className:"h-4 w-4"}),"My Assistants",f.jsx(be,{variant:"outline",className:"text-xs",children:e.length})]})}),f.jsx(Et,{className:"space-y-4",children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Load saved assistant"}),f.jsxs(Bd,{value:"",onValueChange:t,children:[f.jsx(Ws,{className:"w-full",children:f.jsx($d,{placeholder:"Load saved assistant..."})}),f.jsxs(Ks,{children:[e.map(l=>f.jsx(Ni,{value:l.id,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Li,{className:"h-4 w-4"}),f.jsx("span",{children:l.name})]})},l.id)),e.length===0&&f.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:"No saved assistants yet"})]})]}),f.jsxs(Xe,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:i,children:[f.jsx(hb,{className:"h-4 w-4 mr-2"}),"Save Current Configuration"]})]})})]}),f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsx(Bt,{className:"text-base",children:"System Instructions"})}),f.jsx(Et,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsx(Ot,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),f.jsx("textarea",{value:r,onChange:l=>o(l.target.value),placeholder:"Define your AI assistant's role, personality, and behavior. For example: 'You are a helpful coding assistant that explains concepts clearly and provides practical examples...'",className:"w-full min-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-y",disabled:i}),f.jsxs("p",{className:"text-base text-blue-600 mt-4 bg-blue-50 p-4 rounded-lg",children:["💡 ",f.jsx("strong",{children:"Tip:"})," Be specific about the assistant's role, tone, and how it should respond to help users."]})]})})]})]})}function fI({selectedPreset:e,presets:t,onPresetSelect:n}){var r;return f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsx(Bt,{className:"text-base",children:"Quick Presets"})}),f.jsx(Et,{children:f.jsxs("div",{className:"space-y-3",children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Choose a preset..."}),f.jsxs(Bd,{value:e||"",onValueChange:n,children:[f.jsx(Ws,{className:"w-full",children:f.jsx($d,{placeholder:"Choose a preset..."})}),f.jsx(Ks,{children:t.map(o=>f.jsx(Ni,{value:o.name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Li,{className:"h-4 w-4"}),f.jsx("span",{children:o.name})]})},o.name))})]}),e&&f.jsx("div",{className:"mt-4 p-3 bg-gray-50 rounded-lg",children:f.jsx("p",{className:"text-sm text-gray-600",children:(r=t.find(o=>o.name===e))==null?void 0:r.prompt})})]})})]})}function pI(){const e=vd(),[t,n]=y.useState([]),[r,o]=y.useState(!0),[i,l]=y.useState(null);y.useEffect(()=>{s()},[]);const s=async()=>{try{const c=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${c}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const p=await d.json();n(p.models)}catch(c){console.error("Error fetching models:",c)}finally{o(!1)}},a=async c=>{l(c);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:c})});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 c=>{l(c);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:c})});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?f.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:f.jsx(Ku,{className:"h-8 w-8 animate-spin"})}):f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:f.jsx(wd,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),f.jsxs(Xe,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[f.jsx(Gu,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[f.jsx(it,{className:"bg-blue-50 border-blue-200",children:f.jsx(Et,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Ry,{className:"h-5 w-5 text-blue-600 mt-0.5"}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),f.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."})]})]})})}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(ls,{className:"h-5 w-5"}),"API Models",f.jsx(be,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(c=>c.type==="api").map(c=>f.jsx(Xh,{model:c,modelLoading:i,onLoad:a,onUnload:u},c.model_name))})]}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(Ay,{className:"h-5 w-5"}),"Local Models",f.jsx(be,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(c=>c.type==="local").map(c=>f.jsx(Xh,{model:c,modelLoading:i,onLoad:a,onUnload:u},c.model_name))})]})]})})]})}function Xh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const o=e.type==="api",i=t===e.model_name,l=e.is_loaded;return f.jsxs(it,{className:"hover:shadow-md transition-shadow",children:[f.jsx(Ft,{className:"pb-3",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1",children:[f.jsxs(Bt,{className:"text-base flex items-center gap-2",children:[o?f.jsx(ls,{className:"h-4 w-4 text-blue-600"}):f.jsx(Ay,{className:"h-4 w-4 text-green-600"}),e.name]}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&f.jsx(QC,{className:"h-5 w-5 text-green-600"})]})}),f.jsxs(Et,{className:"space-y-3",children:[f.jsxs("div",{className:"space-y-2 text-sm",children:[!o&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Size:"}),f.jsx(be,{variant:"outline",className:"text-xs",children:e.size_gb})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),f.jsx(be,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Type:"}),f.jsx(be,{variant:o?"default":"secondary",className:"text-xs",children:o?"API":"Local"})]}),e.supports_thinking&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{className:"text-muted-foreground",children:"Features:"}),f.jsxs(be,{variant:"outline",className:"text-xs",children:[f.jsx(Ci,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),f.jsx("div",{className:"pt-2",children:l?f.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Ku,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(Iy,{className:"h-4 w-4 mr-2"}),i?"Unloading...":"Unload Model"]}):f.jsxs(Xe,{size:"sm",onClick:()=>n(e.model_name),disabled:i,className:"w-full",children:[i?f.jsx(Ku,{className:"h-4 w-4 mr-2 animate-spin"}):f.jsx(JC,{className:"h-4 w-4 mr-2"}),i?"Loading...":"Load Model"]})})]})]})}function hI(){return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsx("div",{className:"max-w-6xl mx-auto p-6",children:f.jsx("div",{className:"flex items-center justify-between",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:f.jsx(kd,{className:"h-5 w-5 text-white"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsxs(Bt,{className:"flex items-center gap-2",children:[f.jsx(xb,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(Et,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Backend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Frontend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsxs(Bt,{className:"flex items-center gap-2",children:[f.jsx(Ap,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(Et,{className:"space-y-4",children:f.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx(Ap,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),f.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),f.jsxs(it,{children:[f.jsx(Ft,{children:f.jsxs(Bt,{className:"flex items-center gap-2",children:[f.jsx(Ry,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(Et,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(be,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(Ot,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(be,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function mI(){return f.jsx(Jk,{children:f.jsx(Wk,{children:f.jsxs(Lr,{path:"/",element:f.jsx(Ob,{}),children:[f.jsx(Lr,{index:!0,element:f.jsx(Gb,{})}),f.jsx(Lr,{path:"playground",element:f.jsx(uI,{})}),f.jsx(Lr,{path:"models",element:f.jsx(pI,{})}),f.jsx(Lr,{path:"settings",element:f.jsx(hI,{})})]})})})}Qa.createRoot(document.getElementById("root")).render(f.jsx(It.StrictMode,{children:f.jsx(mI,{})})); +//# sourceMappingURL=index-0700955c.js.map