@workerdeck/web 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,678 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DHZZDn-j.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
+ function MM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b0={exports:{}},tc={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var B2;function LM(){if(B2)return tc;B2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var c in s)c!=="key"&&(a[c]=s[c])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return tc.Fragment=t,tc.jsx=n,tc.jsxs=n,tc}var z2;function DM(){return z2||(z2=1,b0.exports=LM()),b0.exports}var h=DM(),x0={exports:{}},gt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var H2;function jM(){if(H2)return gt;H2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function S(P,$,j){this.props=P,this.context=$,this.refs=C,this.updater=j||v}S.prototype.isReactComponent={},S.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=S.prototype;function _(P,$,j){this.props=P,this.context=$,this.refs=C,this.updater=j||v}var R=_.prototype=new N;R.constructor=_,k(R,S.prototype),R.isPureReactComponent=!0;var I=Array.isArray;function A(){}var L={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function U(P,$,j){var re=j.ref;return{$$typeof:e,type:P,key:$,ref:re!==void 0?re:null,props:j}}function z(P,$){return U(P.type,$,P.props)}function K(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function W(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(j){return $[j]})}var J=/\/+/g;function te(P,$){return typeof P=="object"&&P!==null&&P.key!=null?W(""+P.key):$.toString(36)}function V(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(A,A):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function B(P,$,j,re,oe){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var de=!1;if(P===null)de=!0;else switch(ce){case"bigint":case"string":case"number":de=!0;break;case"object":switch(P.$$typeof){case e:case t:de=!0;break;case p:return de=P._init,B(de(P._payload),$,j,re,oe)}}if(de)return oe=oe(P),de=re===""?"."+te(P,0):re,I(oe)?(j="",de!=null&&(j=de.replace(J,"$&/")+"/"),B(oe,$,j,"",function(Fe){return Fe})):oe!=null&&(K(oe)&&(oe=z(oe,j+(oe.key==null||P&&P.key===oe.key?"":(""+oe.key).replace(J,"$&/")+"/")+de)),$.push(oe)),1;de=0;var fe=re===""?".":re+":";if(I(P))for(var ve=0;ve<P.length;ve++)re=P[ve],ce=fe+te(re,ve),de+=B(re,$,j,ce,oe);else if(ve=x(P),typeof ve=="function")for(P=ve.call(P),ve=0;!(re=P.next()).done;)re=re.value,ce=fe+te(re,ve++),de+=B(re,$,j,ce,oe);else if(ce==="object"){if(typeof P.then=="function")return B(V(P),$,j,re,oe);throw $=String(P),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(P,$,j){if(P==null)return P;var re=[],oe=0;return B(P,re,"","",function(ce){return $.call(j,ce,oe++)}),re}function X(P){if(P._status===-1){var $=P._result;$=$(),$.then(function(j){(P._status===0||P._status===-1)&&(P._status=1,P._result=j)},function(j){(P._status===0||P._status===-1)&&(P._status=2,P._result=j)}),P._status===-1&&(P._status=0,P._result=$)}if(P._status===1)return P._result.default;throw P._result}var ae=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:G,forEach:function(P,$,j){G(P,function(){$.apply(this,arguments)},j)},count:function(P){var $=0;return G(P,function(){$++}),$},toArray:function(P){return G(P,function($){return $})||[]},only:function(P){if(!K(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=m,gt.Children=M,gt.Component=S,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=_,gt.StrictMode=r,gt.Suspense=d,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return L.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,$,j){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var re=k({},P.props),oe=P.key;if($!=null)for(ce in $.key!==void 0&&(oe=""+$.key),$)!D.call($,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&$.ref===void 0||(re[ce]=$[ce]);var ce=arguments.length-2;if(ce===1)re.children=j;else if(1<ce){for(var de=Array(ce),fe=0;fe<ce;fe++)de[fe]=arguments[fe+2];re.children=de}return U(P.type,oe,re)},gt.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:a,_context:P},P},gt.createElement=function(P,$,j){var re,oe={},ce=null;if($!=null)for(re in $.key!==void 0&&(ce=""+$.key),$)D.call($,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(oe[re]=$[re]);var de=arguments.length-2;if(de===1)oe.children=j;else if(1<de){for(var fe=Array(de),ve=0;ve<de;ve++)fe[ve]=arguments[ve+2];oe.children=fe}if(P&&P.defaultProps)for(re in de=P.defaultProps,de)oe[re]===void 0&&(oe[re]=de[re]);return U(P,ce,oe)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:c,render:P}},gt.isValidElement=K,gt.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:X}},gt.memo=function(P,$){return{$$typeof:f,type:P,compare:$===void 0?null:$}},gt.startTransition=function(P){var $=L.T,j={};L.T=j;try{var re=P(),oe=L.S;oe!==null&&oe(j,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,ae)}catch(ce){ae(ce)}finally{$!==null&&j.types!==null&&($.types=j.types),L.T=$}},gt.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},gt.use=function(P){return L.H.use(P)},gt.useActionState=function(P,$,j){return L.H.useActionState(P,$,j)},gt.useCallback=function(P,$){return L.H.useCallback(P,$)},gt.useContext=function(P){return L.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,$){return L.H.useDeferredValue(P,$)},gt.useEffect=function(P,$){return L.H.useEffect(P,$)},gt.useEffectEvent=function(P){return L.H.useEffectEvent(P)},gt.useId=function(){return L.H.useId()},gt.useImperativeHandle=function(P,$,j){return L.H.useImperativeHandle(P,$,j)},gt.useInsertionEffect=function(P,$){return L.H.useInsertionEffect(P,$)},gt.useLayoutEffect=function(P,$){return L.H.useLayoutEffect(P,$)},gt.useMemo=function(P,$){return L.H.useMemo(P,$)},gt.useOptimistic=function(P,$){return L.H.useOptimistic(P,$)},gt.useReducer=function(P,$,j){return L.H.useReducer(P,$,j)},gt.useRef=function(P){return L.H.useRef(P)},gt.useState=function(P){return L.H.useState(P)},gt.useSyncExternalStore=function(P,$,j){return L.H.useSyncExternalStore(P,$,j)},gt.useTransition=function(){return L.H.useTransition()},gt.version="19.2.7",gt}var U2;function rd(){return U2||(U2=1,x0.exports=jM()),x0.exports}var y=rd();const Ue=dm(y),PM=MM({__proto__:null,default:Ue},[y]);var y0={exports:{}},nc={},E0={exports:{}},v0={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var F2;function BM(){return F2||(F2=1,(function(e){function t(B,G){var X=B.length;B.push(G);e:for(;0<X;){var ae=X-1>>>1,M=B[ae];if(0<s(M,G))B[ae]=G,B[X]=M,X=ae;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],X=B.pop();if(X!==G){B[0]=X;e:for(var ae=0,M=B.length,P=M>>>1;ae<P;){var $=2*(ae+1)-1,j=B[$],re=$+1,oe=B[re];if(0>s(j,X))re<M&&0>s(oe,j)?(B[ae]=oe,B[re]=X,ae=re):(B[ae]=j,B[$]=X,ae=$);else if(re<M&&0>s(oe,X))B[ae]=oe,B[re]=X,ae=re;else break e}}return G}function s(B,G){var X=B.sortIndex-G.sortIndex;return X!==0?X:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,m=null,b=3,x=!1,v=!1,k=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function R(B){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=B)r(f),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(f)}}function I(B){if(k=!1,R(B),!v)if(n(d)!==null)v=!0,A||(A=!0,W());else{var G=n(f);G!==null&&V(I,G.startTime-B)}}var A=!1,L=-1,D=5,U=-1;function z(){return C?!0:!(e.unstable_now()-U<D)}function K(){if(C=!1,A){var B=e.unstable_now();U=B;var G=!0;try{e:{v=!1,k&&(k=!1,N(L),L=-1),x=!0;var X=b;try{t:{for(R(B),m=n(d);m!==null&&!(m.expirationTime>B&&z());){var ae=m.callback;if(typeof ae=="function"){m.callback=null,b=m.priorityLevel;var M=ae(m.expirationTime<=B);if(B=e.unstable_now(),typeof M=="function"){m.callback=M,R(B),G=!0;break t}m===n(d)&&r(d),R(B)}else r(d);m=n(d)}if(m!==null)G=!0;else{var P=n(f);P!==null&&V(I,P.startTime-B),G=!1}}break e}finally{m=null,b=X,x=!1}G=void 0}}finally{G?W():A=!1}}}var W;if(typeof _=="function")W=function(){_(K)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,te=J.port2;J.port1.onmessage=K,W=function(){te.postMessage(null)}}else W=function(){S(K,0)};function V(B,G){L=S(function(){B(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(B){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var X=b;b=G;try{return B()}finally{b=X}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var X=b;b=B;try{return G()}finally{b=X}},e.unstable_scheduleCallback=function(B,G,X){var ae=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?ae+X:ae):X=ae,B){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=X+M,B={id:p++,callback:G,priorityLevel:B,startTime:X,expirationTime:M,sortIndex:-1},X>ae?(B.sortIndex=X,t(f,B),n(d)===null&&B===n(f)&&(k?(N(L),L=-1):k=!0,V(I,X-ae))):(B.sortIndex=M,t(d,B),v||x||(v=!0,A||(A=!0,W()))),B},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(B){var G=b;return function(){var X=b;b=G;try{return B.apply(this,arguments)}finally{b=X}}}})(v0)),v0}var $2;function zM(){return $2||($2=1,E0.exports=BM()),E0.exports}var T0={exports:{}},rr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var V2;function HM(){if(V2)return rr;V2=1;var e=rd();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rr.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},rr.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},rr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},rr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},rr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},rr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},rr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},rr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},rr.requestFormReset=function(d){r.d.r(d)},rr.unstable_batchedUpdates=function(d,f){return d(f)},rr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},rr.useFormStatus=function(){return l.H.useHostTransitionStatus()},rr.version="19.2.7",rr}var q2;function rN(){if(q2)return T0.exports;q2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),T0.exports=HM(),T0.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var Y2;function UM(){if(Y2)return nc;Y2=1;var e=zM(),t=rd(),n=rN();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,u=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(u=o.return),i=o.return;while(i)}return o.tag===3?u:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function c(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(r(188))}function f(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var u=i,g=o;;){var E=u.return;if(E===null)break;var T=E.alternate;if(T===null){if(g=E.return,g!==null){u=g;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===u)return d(E),i;if(T===g)return d(E),o;T=T.sibling}throw Error(r(188))}if(u.return!==g.return)u=E,g=T;else{for(var O=!1,H=E.child;H;){if(H===u){O=!0,u=E,g=T;break}if(H===g){O=!0,g=E,u=T;break}H=H.sibling}if(!O){for(H=T.child;H;){if(H===u){O=!0,u=T,g=E;break}if(H===g){O=!0,g=T,u=E;break}H=H.sibling}if(!O)throw Error(r(189))}}if(u.alternate!==g)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),_=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function W(i){return i===null||typeof i!="object"?null:(i=K&&i[K]||i["@@iterator"],typeof i=="function"?i:null)}var J=Symbol.for("react.client.reference");function te(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===J?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case k:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case I:return"Suspense";case A:return"SuspenseList";case U:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case v:return"Portal";case _:return i.displayName||"Context";case N:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return o=i.displayName||null,o!==null?o:te(i.type)||"Memo";case D:o=i._payload,i=i._init;try{return te(i(o))}catch{}}return null}var V=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},ae=[],M=-1;function P(i){return{current:i}}function $(i){0>M||(i.current=ae[M],ae[M]=null,M--)}function j(i,o){M++,ae[M]=i.current,i.current=o}var re=P(null),oe=P(null),ce=P(null),de=P(null);function fe(i,o){switch(j(ce,o),j(oe,i),j(re,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?o2(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=o2(o),i=l2(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(re),j(re,i)}function ve(){$(re),$(oe),$(ce)}function Fe(i){i.memoizedState!==null&&j(de,i);var o=re.current,u=l2(o,i.type);o!==u&&(j(oe,i),j(re,u))}function De(i){oe.current===i&&($(re),$(oe)),de.current===i&&($(de),Qu._currentValue=X)}var Ee,Ie;function Be(i){if(Ee===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);Ee=o&&o[1]||"",Ie=-1<u.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Ee+i+Ie}var Ge=!1;function $e(i,o){if(!i||Ge)return"";Ge=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(Te){var xe=Te}Reflect.construct(i,[],Ae)}else{try{Ae.call()}catch(Te){xe=Te}i.call(Ae.prototype)}}else{try{throw Error()}catch(Te){xe=Te}(Ae=i())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(Te){if(Te&&xe&&typeof Te.stack=="string")return[Te.stack,xe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=g.DetermineComponentFrameRoot(),O=T[0],H=T[1];if(O&&H){var se=O.split(`
45
+ `),be=H.split(`
46
+ `);for(E=g=0;g<se.length&&!se[g].includes("DetermineComponentFrameRoot");)g++;for(;E<be.length&&!be[E].includes("DetermineComponentFrameRoot");)E++;if(g===se.length||E===be.length)for(g=se.length-1,E=be.length-1;1<=g&&0<=E&&se[g]!==be[E];)E--;for(;1<=g&&0<=E;g--,E--)if(se[g]!==be[E]){if(g!==1||E!==1)do if(g--,E--,0>E||se[g]!==be[E]){var Ne=`
47
+ `+se[g].replace(" at new "," at ");return i.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",i.displayName)),Ne}while(1<=g&&0<=E);break}}}finally{Ge=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Be(u):""}function Me(i,o){switch(i.tag){case 26:case 27:case 5:return Be(i.type);case 16:return Be("Lazy");case 13:return i.child!==o&&o!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return $e(i.type,!1);case 11:return $e(i.type.render,!1);case 1:return $e(i.type,!0);case 31:return Be("Activity");default:return""}}function we(i){try{var o="",u=null;do o+=Me(i,u),u=i,i=i.return;while(i);return o}catch(g){return`
48
+ Error generating stack: `+g.message+`
49
+ `+g.stack}}var ye=Object.prototype.hasOwnProperty,Oe=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,ee=e.unstable_shouldYield,me=e.unstable_requestPaint,ie=e.unstable_now,Q=e.unstable_getCurrentPriorityLevel,Y=e.unstable_ImmediatePriority,F=e.unstable_UserBlockingPriority,le=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,Re=e.unstable_IdlePriority,Ve=e.log,ot=e.unstable_setDisableYieldValue,et=null,dt=null;function ut(i){if(typeof Ve=="function"&&ot(i),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(et,i)}catch{}}var qe=Math.clz32?Math.clz32:lt,Rt=Math.log,jt=Math.LN2;function lt(i){return i>>>=0,i===0?32:31-(Rt(i)/jt|0)|0}var Lt=256,Qt=262144,$t=4194304;function Zt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Xe(i,o,u){var g=i.pendingLanes;if(g===0)return 0;var E=0,T=i.suspendedLanes,O=i.pingedLanes;i=i.warmLanes;var H=g&134217727;return H!==0?(g=H&~T,g!==0?E=Zt(g):(O&=H,O!==0?E=Zt(O):u||(u=H&~i,u!==0&&(E=Zt(u))))):(H=g&~T,H!==0?E=Zt(H):O!==0?E=Zt(O):u||(u=g&~i,u!==0&&(E=Zt(u)))),E===0?0:o!==0&&o!==E&&(o&T)===0&&(T=E&-E,u=o&-o,T>=u||T===32&&(u&4194048)!==0)?o:E}function yt(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ut(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jt(){var i=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),i}function Xn(i){for(var o=[],u=0;31>u;u++)o.push(i);return o}function Et(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function on(i,o,u,g,E,T){var O=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var H=i.entanglements,se=i.expirationTimes,be=i.hiddenUpdates;for(u=O&~u;0<u;){var Ne=31-qe(u),Ae=1<<Ne;H[Ne]=0,se[Ne]=-1;var xe=be[Ne];if(xe!==null)for(be[Ne]=null,Ne=0;Ne<xe.length;Ne++){var Te=xe[Ne];Te!==null&&(Te.lane&=-536870913)}u&=~Ae}g!==0&&Er(i,g,0),T!==0&&E===0&&i.tag!==0&&(i.suspendedLanes|=T&~(O&~o))}function Er(i,o,u){i.pendingLanes|=o,i.suspendedLanes&=~o;var g=31-qe(o);i.entangledLanes|=o,i.entanglements[g]=i.entanglements[g]|1073741824|u&261930}function gn(i,o){var u=i.entangledLanes|=o;for(i=i.entanglements;u;){var g=31-qe(u),E=1<<g;E&o|i[g]&o&&(i[g]|=o),u&=~E}}function Tn(i,o){var u=o&-o;return u=(u&42)!==0?1:ht(u),(u&(i.suspendedLanes|o))!==0?0:u}function ht(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ot(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function bn(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:O2(i.type))}function Un(i,o){var u=G.p;try{return G.p=i,o()}finally{G.p=u}}var jn=Math.random().toString(36).slice(2),en="__reactFiber$"+jn,Wn="__reactProps$"+jn,vs="__reactContainer$"+jn,du="__reactEvents$"+jn,yd="__reactListeners$"+jn,SI="__reactHandles$"+jn,Ky="__reactResources$"+jn,fu="__reactMarker$"+jn;function up(i){delete i[en],delete i[Wn],delete i[du],delete i[yd],delete i[SI]}function Bo(i){var o=i[en];if(o)return o;for(var u=i.parentNode;u;){if(o=u[vs]||u[en]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(i=p2(i);i!==null;){if(u=i[en])return u;i=p2(i)}return o}i=u,u=i.parentNode}return null}function zo(i){if(i=i[en]||i[vs]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function hu(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function Ho(i){var o=i[Ky];return o||(o=i[Ky]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Fn(i){i[fu]=!0}var Xy=new Set,Wy={};function ka(i,o){Uo(i,o),Uo(i+"Capture",o)}function Uo(i,o){for(Wy[i]=o,i=0;i<o.length;i++)Xy.add(o[i])}var CI=RegExp("^[: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]*$"),Qy={},Zy={};function wI(i){return ye.call(Zy,i)?!0:ye.call(Qy,i)?!1:CI.test(i)?Zy[i]=!0:(Qy[i]=!0,!1)}function Ed(i,o,u){if(wI(o))if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+u)}}function vd(i,o,u){if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+u)}}function Vs(i,o,u,g){if(g===null)i.removeAttribute(u);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(o,u,""+g)}}function Xr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Jy(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function kI(i,o,u){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,T=g.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return E.call(this)},set:function(O){u=""+O,T.call(this,O)}}),Object.defineProperty(i,o,{enumerable:g.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function cp(i){if(!i._valueTracker){var o=Jy(i)?"checked":"value";i._valueTracker=kI(i,o,""+i[o])}}function eE(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var u=o.getValue(),g="";return i&&(g=Jy(i)?i.checked?"true":"false":i.value),i=g,i!==u?(o.setValue(i),!0):!1}function Td(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var NI=/[\n"\\]/g;function Wr(i){return i.replace(NI,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function dp(i,o,u,g,E,T,O,H){i.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.type=O:i.removeAttribute("type"),o!=null?O==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Xr(o)):i.value!==""+Xr(o)&&(i.value=""+Xr(o)):O!=="submit"&&O!=="reset"||i.removeAttribute("value"),o!=null?fp(i,O,Xr(o)):u!=null?fp(i,O,Xr(u)):g!=null&&i.removeAttribute("value"),E==null&&T!=null&&(i.defaultChecked=!!T),E!=null&&(i.checked=E&&typeof E!="function"&&typeof E!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?i.name=""+Xr(H):i.removeAttribute("name")}function tE(i,o,u,g,E,T,O,H){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),o!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){cp(i);return}u=u!=null?""+Xr(u):"",o=o!=null?""+Xr(o):u,H||o===i.value||(i.value=o),i.defaultValue=o}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=H?i.checked:!!g,i.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(i.name=O),cp(i)}function fp(i,o,u){o==="number"&&Td(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Fo(i,o,u,g){if(i=i.options,o){o={};for(var E=0;E<u.length;E++)o["$"+u[E]]=!0;for(u=0;u<i.length;u++)E=o.hasOwnProperty("$"+i[u].value),i[u].selected!==E&&(i[u].selected=E),E&&g&&(i[u].defaultSelected=!0)}else{for(u=""+Xr(u),o=null,E=0;E<i.length;E++){if(i[E].value===u){i[E].selected=!0,g&&(i[E].defaultSelected=!0);return}o!==null||i[E].disabled||(o=i[E])}o!==null&&(o.selected=!0)}}function nE(i,o,u){if(o!=null&&(o=""+Xr(o),o!==i.value&&(i.value=o),u==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=u!=null?""+Xr(u):""}function rE(i,o,u,g){if(o==null){if(g!=null){if(u!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}u=g}u==null&&(u=""),o=u}u=Xr(o),i.defaultValue=u,g=i.textContent,g===u&&g!==""&&g!==null&&(i.value=g),cp(i)}function $o(i,o){if(o){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=o;return}}i.textContent=o}var _I=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sE(i,o,u){var g=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?g?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":g?i.setProperty(o,u):typeof u!="number"||u===0||_I.has(o)?o==="float"?i.cssFloat=u:i[o]=(""+u).trim():i[o]=u+"px"}function iE(i,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,u!=null){for(var g in u)!u.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var E in o)g=o[E],o.hasOwnProperty(E)&&u[E]!==g&&sE(i,E,g)}else for(var T in o)o.hasOwnProperty(T)&&sE(i,T,o[T])}function hp(i){if(i.indexOf("-")===-1)return!1;switch(i){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 AI=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),RI=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Sd(i){return RI.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function qs(){}var mp=null;function pp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Vo=null,qo=null;function aE(i){var o=zo(i);if(o&&(i=o.stateNode)){var u=i[Wn]||null;e:switch(i=o.stateNode,o.type){case"input":if(dp(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wr(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var g=u[o];if(g!==i&&g.form===i.form){var E=g[Wn]||null;if(!E)throw Error(r(90));dp(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(o=0;o<u.length;o++)g=u[o],g.form===i.form&&eE(g)}break e;case"textarea":nE(i,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Fo(i,!!u.multiple,o,!1)}}}var gp=!1;function oE(i,o,u){if(gp)return i(o,u);gp=!0;try{var g=i(o);return g}finally{if(gp=!1,(Vo!==null||qo!==null)&&(df(),Vo&&(o=Vo,i=qo,qo=Vo=null,aE(o),i)))for(o=0;o<i.length;o++)aE(i[o])}}function mu(i,o){var u=i.stateNode;if(u===null)return null;var g=u[Wn]||null;if(g===null)return null;u=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var Ys=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bp=!1;if(Ys)try{var pu={};Object.defineProperty(pu,"passive",{get:function(){bp=!0}}),window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{bp=!1}var _i=null,xp=null,Cd=null;function lE(){if(Cd)return Cd;var i,o=xp,u=o.length,g,E="value"in _i?_i.value:_i.textContent,T=E.length;for(i=0;i<u&&o[i]===E[i];i++);var O=u-i;for(g=1;g<=O&&o[u-g]===E[T-g];g++);return Cd=E.slice(i,1<g?1-g:void 0)}function wd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function kd(){return!0}function uE(){return!1}function vr(i){function o(u,g,E,T,O){this._reactName=u,this._targetInst=E,this.type=g,this.nativeEvent=T,this.target=O,this.currentTarget=null;for(var H in i)i.hasOwnProperty(H)&&(u=i[H],this[H]=u?u(T):T[H]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?kd:uE,this.isPropagationStopped=uE,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=kd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=kd)},persist:function(){},isPersistent:kd}),o}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nd=vr(Na),gu=m({},Na,{view:0,detail:0}),OI=vr(gu),yp,Ep,bu,_d=m({},gu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tp,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==bu&&(bu&&i.type==="mousemove"?(yp=i.screenX-bu.screenX,Ep=i.screenY-bu.screenY):Ep=yp=0,bu=i),yp)},movementY:function(i){return"movementY"in i?i.movementY:Ep}}),cE=vr(_d),II=m({},_d,{dataTransfer:0}),MI=vr(II),LI=m({},gu,{relatedTarget:0}),vp=vr(LI),DI=m({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),jI=vr(DI),PI=m({},Na,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),BI=vr(PI),zI=m({},Na,{data:0}),dE=vr(zI),HI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UI={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $I(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=FI[i])?!!o[i]:!1}function Tp(){return $I}var VI=m({},gu,{key:function(i){if(i.key){var o=HI[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=wd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?UI[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tp,charCode:function(i){return i.type==="keypress"?wd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?wd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),qI=vr(VI),YI=m({},_d,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fE=vr(YI),GI=m({},gu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tp}),KI=vr(GI),XI=m({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),WI=vr(XI),QI=m({},_d,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ZI=vr(QI),JI=m({},Na,{newState:0,oldState:0}),e6=vr(JI),t6=[9,13,27,32],Sp=Ys&&"CompositionEvent"in window,xu=null;Ys&&"documentMode"in document&&(xu=document.documentMode);var n6=Ys&&"TextEvent"in window&&!xu,hE=Ys&&(!Sp||xu&&8<xu&&11>=xu),mE=" ",pE=!1;function gE(i,o){switch(i){case"keyup":return t6.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bE(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Yo=!1;function r6(i,o){switch(i){case"compositionend":return bE(o);case"keypress":return o.which!==32?null:(pE=!0,mE);case"textInput":return i=o.data,i===mE&&pE?null:i;default:return null}}function s6(i,o){if(Yo)return i==="compositionend"||!Sp&&gE(i,o)?(i=lE(),Cd=xp=_i=null,Yo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return hE&&o.locale!=="ko"?null:o.data;default:return null}}var i6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xE(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!i6[i.type]:o==="textarea"}function yE(i,o,u,g){Vo?qo?qo.push(g):qo=[g]:Vo=g,o=xf(o,"onChange"),0<o.length&&(u=new Nd("onChange","change",null,u,g),i.push({event:u,listeners:o}))}var yu=null,Eu=null;function a6(i){t2(i,0)}function Ad(i){var o=hu(i);if(eE(o))return i}function EE(i,o){if(i==="change")return o}var vE=!1;if(Ys){var Cp;if(Ys){var wp="oninput"in document;if(!wp){var TE=document.createElement("div");TE.setAttribute("oninput","return;"),wp=typeof TE.oninput=="function"}Cp=wp}else Cp=!1;vE=Cp&&(!document.documentMode||9<document.documentMode)}function SE(){yu&&(yu.detachEvent("onpropertychange",CE),Eu=yu=null)}function CE(i){if(i.propertyName==="value"&&Ad(Eu)){var o=[];yE(o,Eu,i,pp(i)),oE(a6,o)}}function o6(i,o,u){i==="focusin"?(SE(),yu=o,Eu=u,yu.attachEvent("onpropertychange",CE)):i==="focusout"&&SE()}function l6(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ad(Eu)}function u6(i,o){if(i==="click")return Ad(o)}function c6(i,o){if(i==="input"||i==="change")return Ad(o)}function d6(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Dr=typeof Object.is=="function"?Object.is:d6;function vu(i,o){if(Dr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var u=Object.keys(i),g=Object.keys(o);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var E=u[g];if(!ye.call(o,E)||!Dr(i[E],o[E]))return!1}return!0}function wE(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function kE(i,o){var u=wE(i);i=0;for(var g;u;){if(u.nodeType===3){if(g=i+u.textContent.length,i<=o&&g>=o)return{node:u,offset:o-i};i=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=wE(u)}}function NE(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?NE(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function _E(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Td(i.document);o instanceof i.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)i=o.contentWindow;else break;o=Td(i.document)}return o}function kp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var f6=Ys&&"documentMode"in document&&11>=document.documentMode,Go=null,Np=null,Tu=null,_p=!1;function AE(i,o,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;_p||Go==null||Go!==Td(g)||(g=Go,"selectionStart"in g&&kp(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Tu&&vu(Tu,g)||(Tu=g,g=xf(Np,"onSelect"),0<g.length&&(o=new Nd("onSelect","select",null,o,u),i.push({event:o,listeners:g}),o.target=Go)))}function _a(i,o){var u={};return u[i.toLowerCase()]=o.toLowerCase(),u["Webkit"+i]="webkit"+o,u["Moz"+i]="moz"+o,u}var Ko={animationend:_a("Animation","AnimationEnd"),animationiteration:_a("Animation","AnimationIteration"),animationstart:_a("Animation","AnimationStart"),transitionrun:_a("Transition","TransitionRun"),transitionstart:_a("Transition","TransitionStart"),transitioncancel:_a("Transition","TransitionCancel"),transitionend:_a("Transition","TransitionEnd")},Ap={},RE={};Ys&&(RE=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function Aa(i){if(Ap[i])return Ap[i];if(!Ko[i])return i;var o=Ko[i],u;for(u in o)if(o.hasOwnProperty(u)&&u in RE)return Ap[i]=o[u];return i}var OE=Aa("animationend"),IE=Aa("animationiteration"),ME=Aa("animationstart"),h6=Aa("transitionrun"),m6=Aa("transitionstart"),p6=Aa("transitioncancel"),LE=Aa("transitionend"),DE=new Map,Rp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Rp.push("scrollEnd");function cs(i,o){DE.set(i,o),ka(o,[i])}var Rd=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Qr=[],Xo=0,Op=0;function Od(){for(var i=Xo,o=Op=Xo=0;o<i;){var u=Qr[o];Qr[o++]=null;var g=Qr[o];Qr[o++]=null;var E=Qr[o];Qr[o++]=null;var T=Qr[o];if(Qr[o++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}T!==0&&jE(u,E,T)}}function Id(i,o,u,g){Qr[Xo++]=i,Qr[Xo++]=o,Qr[Xo++]=u,Qr[Xo++]=g,Op|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Ip(i,o,u,g){return Id(i,o,u,g),Md(i)}function Ra(i,o){return Id(i,null,null,o),Md(i)}function jE(i,o,u){i.lanes|=u;var g=i.alternate;g!==null&&(g.lanes|=u);for(var E=!1,T=i.return;T!==null;)T.childLanes|=u,g=T.alternate,g!==null&&(g.childLanes|=u),T.tag===22&&(i=T.stateNode,i===null||i._visibility&1||(E=!0)),i=T,T=T.return;return i.tag===3?(T=i.stateNode,E&&o!==null&&(E=31-qe(u),i=T.hiddenUpdates,g=i[E],g===null?i[E]=[o]:g.push(o),o.lane=u|536870912),T):null}function Md(i){if(50<Vu)throw Vu=0,Ug=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Wo={};function g6(i,o,u,g){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(i,o,u,g){return new g6(i,o,u,g)}function Mp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Gs(i,o){var u=i.alternate;return u===null?(u=jr(i.tag,o,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=o,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,o=i.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function PE(i,o){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,o=u.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Ld(i,o,u,g,E,T){var O=0;if(g=i,typeof i=="function")Mp(i)&&(O=1);else if(typeof i=="string")O=vM(i,u,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case U:return i=jr(31,u,o,E),i.elementType=U,i.lanes=T,i;case k:return Oa(u.children,E,T,o);case C:O=8,E|=24;break;case S:return i=jr(12,u,o,E|2),i.elementType=S,i.lanes=T,i;case I:return i=jr(13,u,o,E),i.elementType=I,i.lanes=T,i;case A:return i=jr(19,u,o,E),i.elementType=A,i.lanes=T,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case _:O=10;break e;case N:O=9;break e;case R:O=11;break e;case L:O=14;break e;case D:O=16,g=null;break e}O=29,u=Error(r(130,i===null?"null":typeof i,"")),g=null}return o=jr(O,u,o,E),o.elementType=i,o.type=g,o.lanes=T,o}function Oa(i,o,u,g){return i=jr(7,i,g,o),i.lanes=u,i}function Lp(i,o,u){return i=jr(6,i,null,o),i.lanes=u,i}function BE(i){var o=jr(18,null,null,0);return o.stateNode=i,o}function Dp(i,o,u){return o=jr(4,i.children!==null?i.children:[],i.key,o),o.lanes=u,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var zE=new WeakMap;function Zr(i,o){if(typeof i=="object"&&i!==null){var u=zE.get(i);return u!==void 0?u:(o={value:i,source:o,stack:we(o)},zE.set(i,o),o)}return{value:i,source:o,stack:we(o)}}var Qo=[],Zo=0,Dd=null,Su=0,Jr=[],es=0,Ai=null,Ts=1,Ss="";function Ks(i,o){Qo[Zo++]=Su,Qo[Zo++]=Dd,Dd=i,Su=o}function HE(i,o,u){Jr[es++]=Ts,Jr[es++]=Ss,Jr[es++]=Ai,Ai=i;var g=Ts;i=Ss;var E=32-qe(g)-1;g&=~(1<<E),u+=1;var T=32-qe(o)+E;if(30<T){var O=E-E%5;T=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Ts=1<<32-qe(o)+E|u<<E|g,Ss=T+i}else Ts=1<<T|u<<E|g,Ss=i}function jp(i){i.return!==null&&(Ks(i,1),HE(i,1,0))}function Pp(i){for(;i===Dd;)Dd=Qo[--Zo],Qo[Zo]=null,Su=Qo[--Zo],Qo[Zo]=null;for(;i===Ai;)Ai=Jr[--es],Jr[es]=null,Ss=Jr[--es],Jr[es]=null,Ts=Jr[--es],Jr[es]=null}function UE(i,o){Jr[es++]=Ts,Jr[es++]=Ss,Jr[es++]=Ai,Ts=o.id,Ss=o.overflow,Ai=i}var Qn=null,ln=null,Dt=!1,Ri=null,ts=!1,Bp=Error(r(519));function Oi(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cu(Zr(o,i)),Bp}function FE(i){var o=i.stateNode,u=i.type,g=i.memoizedProps;switch(o[en]=i,o[Wn]=g,u){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(u=0;u<Yu.length;u++)Nt(Yu[u],o);break;case"source":Nt("error",o);break;case"img":case"image":case"link":Nt("error",o),Nt("load",o);break;case"details":Nt("toggle",o);break;case"input":Nt("invalid",o),tE(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Nt("invalid",o);break;case"textarea":Nt("invalid",o),rE(o,g.value,g.defaultValue,g.children)}u=g.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||g.suppressHydrationWarning===!0||i2(o.textContent,u)?(g.popover!=null&&(Nt("beforetoggle",o),Nt("toggle",o)),g.onScroll!=null&&Nt("scroll",o),g.onScrollEnd!=null&&Nt("scrollend",o),g.onClick!=null&&(o.onclick=qs),o=!0):o=!1,o||Oi(i,!0)}function $E(i){for(Qn=i.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:ts=!1;return;case 27:case 3:ts=!0;return;default:Qn=Qn.return}}function Jo(i){if(i!==Qn)return!1;if(!Dt)return $E(i),Dt=!0,!1;var o=i.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||n0(i.type,i.memoizedProps)),u=!u),u&&ln&&Oi(i),$E(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ln=m2(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ln=m2(i)}else o===27?(o=ln,qi(i.type)?(i=o0,o0=null,ln=i):ln=o):ln=Qn?rs(i.stateNode.nextSibling):null;return!0}function Ia(){ln=Qn=null,Dt=!1}function zp(){var i=Ri;return i!==null&&(wr===null?wr=i:wr.push.apply(wr,i),Ri=null),i}function Cu(i){Ri===null?Ri=[i]:Ri.push(i)}var Hp=P(null),Ma=null,Xs=null;function Ii(i,o,u){j(Hp,o._currentValue),o._currentValue=u}function Ws(i){i._currentValue=Hp.current,$(Hp)}function Up(i,o,u){for(;i!==null;){var g=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),i===u)break;i=i.return}}function Fp(i,o,u,g){var E=i.child;for(E!==null&&(E.return=i);E!==null;){var T=E.dependencies;if(T!==null){var O=E.child;T=T.firstContext;e:for(;T!==null;){var H=T;T=E;for(var se=0;se<o.length;se++)if(H.context===o[se]){T.lanes|=u,H=T.alternate,H!==null&&(H.lanes|=u),Up(T.return,u,i),g||(O=null);break e}T=H.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=u,T=O.alternate,T!==null&&(T.lanes|=u),Up(O,u,i),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===i){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function el(i,o,u,g){i=null;for(var E=o,T=!1;E!==null;){if(!T){if((E.flags&524288)!==0)T=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var H=E.type;Dr(E.pendingProps.value,O.value)||(i!==null?i.push(H):i=[H])}}else if(E===de.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(i!==null?i.push(Qu):i=[Qu])}E=E.return}i!==null&&Fp(o,i,u,g),o.flags|=262144}function jd(i){for(i=i.firstContext;i!==null;){if(!Dr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function La(i){Ma=i,Xs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Zn(i){return VE(Ma,i)}function Pd(i,o){return Ma===null&&La(i),VE(i,o)}function VE(i,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},Xs===null){if(i===null)throw Error(r(308));Xs=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else Xs=Xs.next=o;return u}var b6=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(u,g){i.push(g)}};this.abort=function(){o.aborted=!0,i.forEach(function(u){return u()})}},x6=e.unstable_scheduleCallback,y6=e.unstable_NormalPriority,_n={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $p(){return{controller:new b6,data:new Map,refCount:0}}function wu(i){i.refCount--,i.refCount===0&&x6(y6,function(){i.controller.abort()})}var ku=null,Vp=0,tl=0,nl=null;function E6(i,o){if(ku===null){var u=ku=[];Vp=0,tl=Gg(),nl={status:"pending",value:void 0,then:function(g){u.push(g)}}}return Vp++,o.then(qE,qE),o}function qE(){if(--Vp===0&&ku!==null){nl!==null&&(nl.status="fulfilled");var i=ku;ku=null,tl=0,nl=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function v6(i,o){var u=[],g={status:"pending",value:null,reason:null,then:function(E){u.push(E)}};return i.then(function(){g.status="fulfilled",g.value=o;for(var E=0;E<u.length;E++)(0,u[E])(o)},function(E){for(g.status="rejected",g.reason=E,E=0;E<u.length;E++)(0,u[E])(void 0)}),g}var YE=B.S;B.S=function(i,o){AT=ie(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&E6(i,o),YE!==null&&YE(i,o)};var Da=P(null);function qp(){var i=Da.current;return i!==null?i:tn.pooledCache}function Bd(i,o){o===null?j(Da,Da.current):j(Da,o.pool)}function GE(){var i=qp();return i===null?null:{parent:_n._currentValue,pool:i}}var rl=Error(r(460)),Yp=Error(r(474)),zd=Error(r(542)),Hd={then:function(){}};function KE(i){return i=i.status,i==="fulfilled"||i==="rejected"}function XE(i,o,u){switch(u=i[u],u===void 0?i.push(o):u!==o&&(o.then(qs,qs),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,QE(i),i;default:if(typeof o.status=="string")o.then(qs,qs);else{if(i=tn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(g){if(o.status==="pending"){var E=o;E.status="fulfilled",E.value=g}},function(g){if(o.status==="pending"){var E=o;E.status="rejected",E.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,QE(i),i}throw Pa=o,rl}}function ja(i){try{var o=i._init;return o(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Pa=u,rl):u}}var Pa=null;function WE(){if(Pa===null)throw Error(r(459));var i=Pa;return Pa=null,i}function QE(i){if(i===rl||i===zd)throw Error(r(483))}var sl=null,Nu=0;function Ud(i){var o=Nu;return Nu+=1,sl===null&&(sl=[]),XE(sl,i,o)}function _u(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function Fd(i,o){throw o.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function ZE(i){function o(he,ue){if(i){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function u(he,ue){if(!i)return null;for(;ue!==null;)o(he,ue),ue=ue.sibling;return null}function g(he){for(var ue=new Map;he!==null;)he.key!==null?ue.set(he.key,he):ue.set(he.index,he),he=he.sibling;return ue}function E(he,ue){return he=Gs(he,ue),he.index=0,he.sibling=null,he}function T(he,ue,ge){return he.index=ge,i?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=67108866,ue):ge):(he.flags|=67108866,ue)):(he.flags|=1048576,ue)}function O(he){return i&&he.alternate===null&&(he.flags|=67108866),he}function H(he,ue,ge,_e){return ue===null||ue.tag!==6?(ue=Lp(ge,he.mode,_e),ue.return=he,ue):(ue=E(ue,ge),ue.return=he,ue)}function se(he,ue,ge,_e){var st=ge.type;return st===k?Ne(he,ue,ge.props.children,_e,ge.key):ue!==null&&(ue.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===D&&ja(st)===ue.type)?(ue=E(ue,ge.props),_u(ue,ge),ue.return=he,ue):(ue=Ld(ge.type,ge.key,ge.props,null,he.mode,_e),_u(ue,ge),ue.return=he,ue)}function be(he,ue,ge,_e){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=Dp(ge,he.mode,_e),ue.return=he,ue):(ue=E(ue,ge.children||[]),ue.return=he,ue)}function Ne(he,ue,ge,_e,st){return ue===null||ue.tag!==7?(ue=Oa(ge,he.mode,_e,st),ue.return=he,ue):(ue=E(ue,ge),ue.return=he,ue)}function Ae(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=Lp(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ge=Ld(ue.type,ue.key,ue.props,null,he.mode,ge),_u(ge,ue),ge.return=he,ge;case v:return ue=Dp(ue,he.mode,ge),ue.return=he,ue;case D:return ue=ja(ue),Ae(he,ue,ge)}if(V(ue)||W(ue))return ue=Oa(ue,he.mode,ge,null),ue.return=he,ue;if(typeof ue.then=="function")return Ae(he,Ud(ue),ge);if(ue.$$typeof===_)return Ae(he,Pd(he,ue),ge);Fd(he,ue)}return null}function xe(he,ue,ge,_e){var st=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return st!==null?null:H(he,ue,""+ge,_e);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return ge.key===st?se(he,ue,ge,_e):null;case v:return ge.key===st?be(he,ue,ge,_e):null;case D:return ge=ja(ge),xe(he,ue,ge,_e)}if(V(ge)||W(ge))return st!==null?null:Ne(he,ue,ge,_e,null);if(typeof ge.then=="function")return xe(he,ue,Ud(ge),_e);if(ge.$$typeof===_)return xe(he,ue,Pd(he,ge),_e);Fd(he,ge)}return null}function Te(he,ue,ge,_e,st){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return he=he.get(ge)||null,H(ue,he,""+_e,st);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case x:return he=he.get(_e.key===null?ge:_e.key)||null,se(ue,he,_e,st);case v:return he=he.get(_e.key===null?ge:_e.key)||null,be(ue,he,_e,st);case D:return _e=ja(_e),Te(he,ue,ge,_e,st)}if(V(_e)||W(_e))return he=he.get(ge)||null,Ne(ue,he,_e,st,null);if(typeof _e.then=="function")return Te(he,ue,ge,Ud(_e),st);if(_e.$$typeof===_)return Te(he,ue,ge,Pd(ue,_e),st);Fd(ue,_e)}return null}function Ze(he,ue,ge,_e){for(var st=null,zt=null,Je=ue,xt=ue=0,Mt=null;Je!==null&&xt<ge.length;xt++){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Ht=xe(he,Je,ge[xt],_e);if(Ht===null){Je===null&&(Je=Mt);break}i&&Je&&Ht.alternate===null&&o(he,Je),ue=T(Ht,ue,xt),zt===null?st=Ht:zt.sibling=Ht,zt=Ht,Je=Mt}if(xt===ge.length)return u(he,Je),Dt&&Ks(he,xt),st;if(Je===null){for(;xt<ge.length;xt++)Je=Ae(he,ge[xt],_e),Je!==null&&(ue=T(Je,ue,xt),zt===null?st=Je:zt.sibling=Je,zt=Je);return Dt&&Ks(he,xt),st}for(Je=g(Je);xt<ge.length;xt++)Mt=Te(Je,he,xt,ge[xt],_e),Mt!==null&&(i&&Mt.alternate!==null&&Je.delete(Mt.key===null?xt:Mt.key),ue=T(Mt,ue,xt),zt===null?st=Mt:zt.sibling=Mt,zt=Mt);return i&&Je.forEach(function(Wi){return o(he,Wi)}),Dt&&Ks(he,xt),st}function at(he,ue,ge,_e){if(ge==null)throw Error(r(151));for(var st=null,zt=null,Je=ue,xt=ue=0,Mt=null,Ht=ge.next();Je!==null&&!Ht.done;xt++,Ht=ge.next()){Je.index>xt?(Mt=Je,Je=null):Mt=Je.sibling;var Wi=xe(he,Je,Ht.value,_e);if(Wi===null){Je===null&&(Je=Mt);break}i&&Je&&Wi.alternate===null&&o(he,Je),ue=T(Wi,ue,xt),zt===null?st=Wi:zt.sibling=Wi,zt=Wi,Je=Mt}if(Ht.done)return u(he,Je),Dt&&Ks(he,xt),st;if(Je===null){for(;!Ht.done;xt++,Ht=ge.next())Ht=Ae(he,Ht.value,_e),Ht!==null&&(ue=T(Ht,ue,xt),zt===null?st=Ht:zt.sibling=Ht,zt=Ht);return Dt&&Ks(he,xt),st}for(Je=g(Je);!Ht.done;xt++,Ht=ge.next())Ht=Te(Je,he,xt,Ht.value,_e),Ht!==null&&(i&&Ht.alternate!==null&&Je.delete(Ht.key===null?xt:Ht.key),ue=T(Ht,ue,xt),zt===null?st=Ht:zt.sibling=Ht,zt=Ht);return i&&Je.forEach(function(IM){return o(he,IM)}),Dt&&Ks(he,xt),st}function Kt(he,ue,ge,_e){if(typeof ge=="object"&&ge!==null&&ge.type===k&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:e:{for(var st=ge.key;ue!==null;){if(ue.key===st){if(st=ge.type,st===k){if(ue.tag===7){u(he,ue.sibling),_e=E(ue,ge.props.children),_e.return=he,he=_e;break e}}else if(ue.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===D&&ja(st)===ue.type){u(he,ue.sibling),_e=E(ue,ge.props),_u(_e,ge),_e.return=he,he=_e;break e}u(he,ue);break}else o(he,ue);ue=ue.sibling}ge.type===k?(_e=Oa(ge.props.children,he.mode,_e,ge.key),_e.return=he,he=_e):(_e=Ld(ge.type,ge.key,ge.props,null,he.mode,_e),_u(_e,ge),_e.return=he,he=_e)}return O(he);case v:e:{for(st=ge.key;ue!==null;){if(ue.key===st)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){u(he,ue.sibling),_e=E(ue,ge.children||[]),_e.return=he,he=_e;break e}else{u(he,ue);break}else o(he,ue);ue=ue.sibling}_e=Dp(ge,he.mode,_e),_e.return=he,he=_e}return O(he);case D:return ge=ja(ge),Kt(he,ue,ge,_e)}if(V(ge))return Ze(he,ue,ge,_e);if(W(ge)){if(st=W(ge),typeof st!="function")throw Error(r(150));return ge=st.call(ge),at(he,ue,ge,_e)}if(typeof ge.then=="function")return Kt(he,ue,Ud(ge),_e);if(ge.$$typeof===_)return Kt(he,ue,Pd(he,ge),_e);Fd(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,ue!==null&&ue.tag===6?(u(he,ue.sibling),_e=E(ue,ge),_e.return=he,he=_e):(u(he,ue),_e=Lp(ge,he.mode,_e),_e.return=he,he=_e),O(he)):u(he,ue)}return function(he,ue,ge,_e){try{Nu=0;var st=Kt(he,ue,ge,_e);return sl=null,st}catch(Je){if(Je===rl||Je===zd)throw Je;var zt=jr(29,Je,null,he.mode);return zt.lanes=_e,zt.return=he,zt}finally{}}}var Ba=ZE(!0),JE=ZE(!1),Mi=!1;function Gp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kp(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Li(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Di(i,o,u){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Ft&2)!==0){var E=g.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),g.pending=o,o=Md(i),jE(i,null,u),o}return Id(i,g,o,u),Md(i)}function Au(i,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var g=o.lanes;g&=i.pendingLanes,u|=g,o.lanes=u,gn(i,u)}}function Xp(i,o){var u=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var E=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?E=T=O:T=T.next=O,u=u.next}while(u!==null);T===null?E=T=o:T=T.next=o}else E=T=o;u={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=o:i.next=o,u.lastBaseUpdate=o}var Wp=!1;function Ru(){if(Wp){var i=nl;if(i!==null)throw i}}function Ou(i,o,u,g){Wp=!1;var E=i.updateQueue;Mi=!1;var T=E.firstBaseUpdate,O=E.lastBaseUpdate,H=E.shared.pending;if(H!==null){E.shared.pending=null;var se=H,be=se.next;se.next=null,O===null?T=be:O.next=be,O=se;var Ne=i.alternate;Ne!==null&&(Ne=Ne.updateQueue,H=Ne.lastBaseUpdate,H!==O&&(H===null?Ne.firstBaseUpdate=be:H.next=be,Ne.lastBaseUpdate=se))}if(T!==null){var Ae=E.baseState;O=0,Ne=be=se=null,H=T;do{var xe=H.lane&-536870913,Te=xe!==H.lane;if(Te?(It&xe)===xe:(g&xe)===xe){xe!==0&&xe===tl&&(Wp=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ze=i,at=H;xe=o;var Kt=u;switch(at.tag){case 1:if(Ze=at.payload,typeof Ze=="function"){Ae=Ze.call(Kt,Ae,xe);break e}Ae=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=at.payload,xe=typeof Ze=="function"?Ze.call(Kt,Ae,xe):Ze,xe==null)break e;Ae=m({},Ae,xe);break e;case 2:Mi=!0}}xe=H.callback,xe!==null&&(i.flags|=64,Te&&(i.flags|=8192),Te=E.callbacks,Te===null?E.callbacks=[xe]:Te.push(xe))}else Te={lane:xe,tag:H.tag,payload:H.payload,callback:H.callback,next:null},Ne===null?(be=Ne=Te,se=Ae):Ne=Ne.next=Te,O|=xe;if(H=H.next,H===null){if(H=E.shared.pending,H===null)break;Te=H,H=Te.next,Te.next=null,E.lastBaseUpdate=Te,E.shared.pending=null}}while(!0);Ne===null&&(se=Ae),E.baseState=se,E.firstBaseUpdate=be,E.lastBaseUpdate=Ne,T===null&&(E.shared.lanes=0),Hi|=O,i.lanes=O,i.memoizedState=Ae}}function ev(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function tv(i,o){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)ev(u[i],o)}var il=P(null),$d=P(0);function nv(i,o){i=ii,j($d,i),j(il,o),ii=i|o.baseLanes}function Qp(){j($d,ii),j(il,il.current)}function Zp(){ii=$d.current,$(il),$($d)}var Pr=P(null),ns=null;function ji(i){var o=i.alternate;j(Sn,Sn.current&1),j(Pr,i),ns===null&&(o===null||il.current!==null||o.memoizedState!==null)&&(ns=i)}function Jp(i){j(Sn,Sn.current),j(Pr,i),ns===null&&(ns=i)}function rv(i){i.tag===22?(j(Sn,Sn.current),j(Pr,i),ns===null&&(ns=i)):Pi()}function Pi(){j(Sn,Sn.current),j(Pr,Pr.current)}function Br(i){$(Pr),ns===i&&(ns=null),$(Sn)}var Sn=P(0);function Vd(i){for(var o=i;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||i0(u)||a0(u)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Qs=0,bt=null,Yt=null,An=null,qd=!1,al=!1,za=!1,Yd=0,Iu=0,ol=null,T6=0;function xn(){throw Error(r(321))}function eg(i,o){if(o===null)return!1;for(var u=0;u<o.length&&u<i.length;u++)if(!Dr(i[u],o[u]))return!1;return!0}function tg(i,o,u,g,E,T){return Qs=T,bt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=i===null||i.memoizedState===null?Hv:gg,za=!1,T=u(g,E),za=!1,al&&(T=iv(o,u,g,E)),sv(i),T}function sv(i){B.H=Du;var o=Yt!==null&&Yt.next!==null;if(Qs=0,An=Yt=bt=null,qd=!1,Iu=0,ol=null,o)throw Error(r(300));i===null||Rn||(i=i.dependencies,i!==null&&jd(i)&&(Rn=!0))}function iv(i,o,u,g){bt=i;var E=0;do{if(al&&(ol=null),Iu=0,al=!1,25<=E)throw Error(r(301));if(E+=1,An=Yt=null,i.updateQueue!=null){var T=i.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}B.H=Uv,T=o(u,g)}while(al);return T}function S6(){var i=B.H,o=i.useState()[0];return o=typeof o.then=="function"?Mu(o):o,i=i.useState()[0],(Yt!==null?Yt.memoizedState:null)!==i&&(bt.flags|=1024),o}function ng(){var i=Yd!==0;return Yd=0,i}function rg(i,o,u){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~u}function sg(i){if(qd){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}qd=!1}Qs=0,An=Yt=bt=null,al=!1,Iu=Yd=0,ol=null}function dr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?bt.memoizedState=An=i:An=An.next=i,An}function Cn(){if(Yt===null){var i=bt.alternate;i=i!==null?i.memoizedState:null}else i=Yt.next;var o=An===null?bt.memoizedState:An.next;if(o!==null)An=o,Yt=i;else{if(i===null)throw bt.alternate===null?Error(r(467)):Error(r(310));Yt=i,i={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},An===null?bt.memoizedState=An=i:An=An.next=i}return An}function Gd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mu(i){var o=Iu;return Iu+=1,ol===null&&(ol=[]),i=XE(ol,i,o),o=bt,(An===null?o.memoizedState:An.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?Hv:gg),i}function Kd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Mu(i);if(i.$$typeof===_)return Zn(i)}throw Error(r(438,String(i)))}function ig(i){var o=null,u=bt.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var g=bt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(E){return E.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=Gd(),bt.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(i),g=0;g<i;g++)u[g]=z;return o.index++,u}function Zs(i,o){return typeof o=="function"?o(i):o}function Xd(i){var o=Cn();return ag(o,Yt,i)}function ag(i,o,u){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=u;var E=i.baseQueue,T=g.pending;if(T!==null){if(E!==null){var O=E.next;E.next=T.next,T.next=O}o.baseQueue=E=T,g.pending=null}if(T=i.baseState,E===null)i.memoizedState=T;else{o=E.next;var H=O=null,se=null,be=o,Ne=!1;do{var Ae=be.lane&-536870913;if(Ae!==be.lane?(It&Ae)===Ae:(Qs&Ae)===Ae){var xe=be.revertLane;if(xe===0)se!==null&&(se=se.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Ae===tl&&(Ne=!0);else if((Qs&xe)===xe){be=be.next,xe===tl&&(Ne=!0);continue}else Ae={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(H=se=Ae,O=T):se=se.next=Ae,bt.lanes|=xe,Hi|=xe;Ae=be.action,za&&u(T,Ae),T=be.hasEagerState?be.eagerState:u(T,Ae)}else xe={lane:Ae,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},se===null?(H=se=xe,O=T):se=se.next=xe,bt.lanes|=Ae,Hi|=Ae;be=be.next}while(be!==null&&be!==o);if(se===null?O=T:se.next=H,!Dr(T,i.memoizedState)&&(Rn=!0,Ne&&(u=nl,u!==null)))throw u;i.memoizedState=T,i.baseState=O,i.baseQueue=se,g.lastRenderedState=T}return E===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function og(i){var o=Cn(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var g=u.dispatch,E=u.pending,T=o.memoizedState;if(E!==null){u.pending=null;var O=E=E.next;do T=i(T,O.action),O=O.next;while(O!==E);Dr(T,o.memoizedState)||(Rn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),u.lastRenderedState=T}return[T,g]}function av(i,o,u){var g=bt,E=Cn(),T=Dt;if(T){if(u===void 0)throw Error(r(407));u=u()}else u=o();var O=!Dr((Yt||E).memoizedState,u);if(O&&(E.memoizedState=u,Rn=!0),E=E.queue,cg(uv.bind(null,g,E,i),[i]),E.getSnapshot!==o||O||An!==null&&An.memoizedState.tag&1){if(g.flags|=2048,ll(9,{destroy:void 0},lv.bind(null,g,E,u,o),null),tn===null)throw Error(r(349));T||(Qs&127)!==0||ov(g,o,u)}return u}function ov(i,o,u){i.flags|=16384,i={getSnapshot:o,value:u},o=bt.updateQueue,o===null?(o=Gd(),bt.updateQueue=o,o.stores=[i]):(u=o.stores,u===null?o.stores=[i]:u.push(i))}function lv(i,o,u,g){o.value=u,o.getSnapshot=g,cv(o)&&dv(i)}function uv(i,o,u){return u(function(){cv(o)&&dv(i)})}function cv(i){var o=i.getSnapshot;i=i.value;try{var u=o();return!Dr(i,u)}catch{return!0}}function dv(i){var o=Ra(i,2);o!==null&&kr(o,i,2)}function lg(i){var o=dr();if(typeof i=="function"){var u=i;if(i=u(),za){ut(!0);try{u()}finally{ut(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zs,lastRenderedState:i},o}function fv(i,o,u,g){return i.baseState=u,ag(i,Yt,typeof g=="function"?g:Zs)}function C6(i,o,u,g,E){if(Zd(i))throw Error(r(485));if(i=o.action,i!==null){var T={payload:E,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){T.listeners.push(O)}};B.T!==null?u(!0):T.isTransition=!1,g(T),u=o.pending,u===null?(T.next=o.pending=T,hv(o,T)):(T.next=u.next,o.pending=u.next=T)}}function hv(i,o){var u=o.action,g=o.payload,E=i.state;if(o.isTransition){var T=B.T,O={};B.T=O;try{var H=u(E,g),se=B.S;se!==null&&se(O,H),mv(i,o,H)}catch(be){ug(i,o,be)}finally{T!==null&&O.types!==null&&(T.types=O.types),B.T=T}}else try{T=u(E,g),mv(i,o,T)}catch(be){ug(i,o,be)}}function mv(i,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(g){pv(i,o,g)},function(g){return ug(i,o,g)}):pv(i,o,u)}function pv(i,o,u){o.status="fulfilled",o.value=u,gv(o),i.state=u,o=i.pending,o!==null&&(u=o.next,u===o?i.pending=null:(u=u.next,o.next=u,hv(i,u)))}function ug(i,o,u){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=u,gv(o),o=o.next;while(o!==g)}i.action=null}function gv(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function bv(i,o){return o}function xv(i,o){if(Dt){var u=tn.formState;if(u!==null){e:{var g=bt;if(Dt){if(ln){t:{for(var E=ln,T=ts;E.nodeType!==8;){if(!T){E=null;break t}if(E=rs(E.nextSibling),E===null){E=null;break t}}T=E.data,E=T==="F!"||T==="F"?E:null}if(E){ln=rs(E.nextSibling),g=E.data==="F!";break e}}Oi(g)}g=!1}g&&(o=u[0])}}return u=dr(),u.memoizedState=u.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bv,lastRenderedState:o},u.queue=g,u=Pv.bind(null,bt,g),g.dispatch=u,g=lg(!1),T=pg.bind(null,bt,!1,g.queue),g=dr(),E={state:o,dispatch:null,action:i,pending:null},g.queue=E,u=C6.bind(null,bt,E,T,u),E.dispatch=u,g.memoizedState=i,[o,u,!1]}function yv(i){var o=Cn();return Ev(o,Yt,i)}function Ev(i,o,u){if(o=ag(i,o,bv)[0],i=Xd(Zs)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Mu(o)}catch(O){throw O===rl?zd:O}else g=o;o=Cn();var E=o.queue,T=E.dispatch;return u!==o.memoizedState&&(bt.flags|=2048,ll(9,{destroy:void 0},w6.bind(null,E,u),null)),[g,T,i]}function w6(i,o){i.action=o}function vv(i){var o=Cn(),u=Yt;if(u!==null)return Ev(o,u,i);Cn(),o=o.memoizedState,u=Cn();var g=u.queue.dispatch;return u.memoizedState=i,[o,g,!1]}function ll(i,o,u,g){return i={tag:i,create:u,deps:g,inst:o,next:null},o=bt.updateQueue,o===null&&(o=Gd(),bt.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=i.next=i:(g=u.next,u.next=i,i.next=g,o.lastEffect=i),i}function Tv(){return Cn().memoizedState}function Wd(i,o,u,g){var E=dr();bt.flags|=i,E.memoizedState=ll(1|o,{destroy:void 0},u,g===void 0?null:g)}function Qd(i,o,u,g){var E=Cn();g=g===void 0?null:g;var T=E.memoizedState.inst;Yt!==null&&g!==null&&eg(g,Yt.memoizedState.deps)?E.memoizedState=ll(o,T,u,g):(bt.flags|=i,E.memoizedState=ll(1|o,T,u,g))}function Sv(i,o){Wd(8390656,8,i,o)}function cg(i,o){Qd(2048,8,i,o)}function k6(i){bt.flags|=4;var o=bt.updateQueue;if(o===null)o=Gd(),bt.updateQueue=o,o.events=[i];else{var u=o.events;u===null?o.events=[i]:u.push(i)}}function Cv(i){var o=Cn().memoizedState;return k6({ref:o,nextImpl:i}),function(){if((Ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function wv(i,o){return Qd(4,2,i,o)}function kv(i,o){return Qd(4,4,i,o)}function Nv(i,o){if(typeof o=="function"){i=i();var u=o(i);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function _v(i,o,u){u=u!=null?u.concat([i]):null,Qd(4,4,Nv.bind(null,o,i),u)}function dg(){}function Av(i,o){var u=Cn();o=o===void 0?null:o;var g=u.memoizedState;return o!==null&&eg(o,g[1])?g[0]:(u.memoizedState=[i,o],i)}function Rv(i,o){var u=Cn();o=o===void 0?null:o;var g=u.memoizedState;if(o!==null&&eg(o,g[1]))return g[0];if(g=i(),za){ut(!0);try{i()}finally{ut(!1)}}return u.memoizedState=[g,o],g}function fg(i,o,u){return u===void 0||(Qs&1073741824)!==0&&(It&261930)===0?i.memoizedState=o:(i.memoizedState=u,i=OT(),bt.lanes|=i,Hi|=i,u)}function Ov(i,o,u,g){return Dr(u,o)?u:il.current!==null?(i=fg(i,u,g),Dr(i,o)||(Rn=!0),i):(Qs&42)===0||(Qs&1073741824)!==0&&(It&261930)===0?(Rn=!0,i.memoizedState=u):(i=OT(),bt.lanes|=i,Hi|=i,o)}function Iv(i,o,u,g,E){var T=G.p;G.p=T!==0&&8>T?T:8;var O=B.T,H={};B.T=H,pg(i,!1,o,u);try{var se=E(),be=B.S;if(be!==null&&be(H,se),se!==null&&typeof se=="object"&&typeof se.then=="function"){var Ne=v6(se,g);Lu(i,o,Ne,Ur(i))}else Lu(i,o,g,Ur(i))}catch(Ae){Lu(i,o,{then:function(){},status:"rejected",reason:Ae},Ur())}finally{G.p=T,O!==null&&H.types!==null&&(O.types=H.types),B.T=O}}function N6(){}function hg(i,o,u,g){if(i.tag!==5)throw Error(r(476));var E=Mv(i).queue;Iv(i,E,o,X,u===null?N6:function(){return Lv(i),u(g)})}function Mv(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zs,lastRenderedState:X},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zs,lastRenderedState:u},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function Lv(i){var o=Mv(i);o.next===null&&(o=i.alternate.memoizedState),Lu(i,o.next.queue,{},Ur())}function mg(){return Zn(Qu)}function Dv(){return Cn().memoizedState}function jv(){return Cn().memoizedState}function _6(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ur();i=Li(u);var g=Di(o,i,u);g!==null&&(kr(g,o,u),Au(g,o,u)),o={cache:$p()},i.payload=o;return}o=o.return}}function A6(i,o,u){var g=Ur();u={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Zd(i)?Bv(o,u):(u=Ip(i,o,u,g),u!==null&&(kr(u,i,g),zv(u,o,g)))}function Pv(i,o,u){var g=Ur();Lu(i,o,u,g)}function Lu(i,o,u,g){var E={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Zd(i))Bv(o,E);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var O=o.lastRenderedState,H=T(O,u);if(E.hasEagerState=!0,E.eagerState=H,Dr(H,O))return Id(i,o,E,0),tn===null&&Od(),!1}catch{}finally{}if(u=Ip(i,o,E,g),u!==null)return kr(u,i,g),zv(u,o,g),!0}return!1}function pg(i,o,u,g){if(g={lane:2,revertLane:Gg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Zd(i)){if(o)throw Error(r(479))}else o=Ip(i,u,g,2),o!==null&&kr(o,i,2)}function Zd(i){var o=i.alternate;return i===bt||o!==null&&o===bt}function Bv(i,o){al=qd=!0;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}function zv(i,o,u){if((u&4194048)!==0){var g=o.lanes;g&=i.pendingLanes,u|=g,o.lanes=u,gn(i,u)}}var Du={readContext:Zn,use:Kd,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Du.useEffectEvent=xn;var Hv={readContext:Zn,use:Kd,useCallback:function(i,o){return dr().memoizedState=[i,o===void 0?null:o],i},useContext:Zn,useEffect:Sv,useImperativeHandle:function(i,o,u){u=u!=null?u.concat([i]):null,Wd(4194308,4,Nv.bind(null,o,i),u)},useLayoutEffect:function(i,o){return Wd(4194308,4,i,o)},useInsertionEffect:function(i,o){Wd(4,2,i,o)},useMemo:function(i,o){var u=dr();o=o===void 0?null:o;var g=i();if(za){ut(!0);try{i()}finally{ut(!1)}}return u.memoizedState=[g,o],g},useReducer:function(i,o,u){var g=dr();if(u!==void 0){var E=u(o);if(za){ut(!0);try{u(o)}finally{ut(!1)}}}else E=o;return g.memoizedState=g.baseState=E,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:E},g.queue=i,i=i.dispatch=A6.bind(null,bt,i),[g.memoizedState,i]},useRef:function(i){var o=dr();return i={current:i},o.memoizedState=i},useState:function(i){i=lg(i);var o=i.queue,u=Pv.bind(null,bt,o);return o.dispatch=u,[i.memoizedState,u]},useDebugValue:dg,useDeferredValue:function(i,o){var u=dr();return fg(u,i,o)},useTransition:function(){var i=lg(!1);return i=Iv.bind(null,bt,i.queue,!0,!1),dr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,u){var g=bt,E=dr();if(Dt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),tn===null)throw Error(r(349));(It&127)!==0||ov(g,o,u)}E.memoizedState=u;var T={value:u,getSnapshot:o};return E.queue=T,Sv(uv.bind(null,g,T,i),[i]),g.flags|=2048,ll(9,{destroy:void 0},lv.bind(null,g,T,u,o),null),u},useId:function(){var i=dr(),o=tn.identifierPrefix;if(Dt){var u=Ss,g=Ts;u=(g&~(1<<32-qe(g)-1)).toString(32)+u,o="_"+o+"R_"+u,u=Yd++,0<u&&(o+="H"+u.toString(32)),o+="_"}else u=T6++,o="_"+o+"r_"+u.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:mg,useFormState:xv,useActionState:xv,useOptimistic:function(i){var o=dr();o.memoizedState=o.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=pg.bind(null,bt,!0,u),u.dispatch=o,[i,o]},useMemoCache:ig,useCacheRefresh:function(){return dr().memoizedState=_6.bind(null,bt)},useEffectEvent:function(i){var o=dr(),u={impl:i};return o.memoizedState=u,function(){if((Ft&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},gg={readContext:Zn,use:Kd,useCallback:Av,useContext:Zn,useEffect:cg,useImperativeHandle:_v,useInsertionEffect:wv,useLayoutEffect:kv,useMemo:Rv,useReducer:Xd,useRef:Tv,useState:function(){return Xd(Zs)},useDebugValue:dg,useDeferredValue:function(i,o){var u=Cn();return Ov(u,Yt.memoizedState,i,o)},useTransition:function(){var i=Xd(Zs)[0],o=Cn().memoizedState;return[typeof i=="boolean"?i:Mu(i),o]},useSyncExternalStore:av,useId:Dv,useHostTransitionStatus:mg,useFormState:yv,useActionState:yv,useOptimistic:function(i,o){var u=Cn();return fv(u,Yt,i,o)},useMemoCache:ig,useCacheRefresh:jv};gg.useEffectEvent=Cv;var Uv={readContext:Zn,use:Kd,useCallback:Av,useContext:Zn,useEffect:cg,useImperativeHandle:_v,useInsertionEffect:wv,useLayoutEffect:kv,useMemo:Rv,useReducer:og,useRef:Tv,useState:function(){return og(Zs)},useDebugValue:dg,useDeferredValue:function(i,o){var u=Cn();return Yt===null?fg(u,i,o):Ov(u,Yt.memoizedState,i,o)},useTransition:function(){var i=og(Zs)[0],o=Cn().memoizedState;return[typeof i=="boolean"?i:Mu(i),o]},useSyncExternalStore:av,useId:Dv,useHostTransitionStatus:mg,useFormState:vv,useActionState:vv,useOptimistic:function(i,o){var u=Cn();return Yt!==null?fv(u,Yt,i,o):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:ig,useCacheRefresh:jv};Uv.useEffectEvent=Cv;function bg(i,o,u,g){o=i.memoizedState,u=u(g,o),u=u==null?o:m({},o,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var xg={enqueueSetState:function(i,o,u){i=i._reactInternals;var g=Ur(),E=Li(g);E.payload=o,u!=null&&(E.callback=u),o=Di(i,E,g),o!==null&&(kr(o,i,g),Au(o,i,g))},enqueueReplaceState:function(i,o,u){i=i._reactInternals;var g=Ur(),E=Li(g);E.tag=1,E.payload=o,u!=null&&(E.callback=u),o=Di(i,E,g),o!==null&&(kr(o,i,g),Au(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var u=Ur(),g=Li(u);g.tag=2,o!=null&&(g.callback=o),o=Di(i,g,u),o!==null&&(kr(o,i,u),Au(o,i,u))}};function Fv(i,o,u,g,E,T,O){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,T,O):o.prototype&&o.prototype.isPureReactComponent?!vu(u,g)||!vu(E,T):!0}function $v(i,o,u,g){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,g),o.state!==i&&xg.enqueueReplaceState(o,o.state,null)}function Ha(i,o){var u=o;if("ref"in o){u={};for(var g in o)g!=="ref"&&(u[g]=o[g])}if(i=i.defaultProps){u===o&&(u=m({},u));for(var E in i)u[E]===void 0&&(u[E]=i[E])}return u}function Vv(i){Rd(i)}function qv(i){console.error(i)}function Yv(i){Rd(i)}function Jd(i,o){try{var u=i.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function Gv(i,o,u){try{var g=i.onCaughtError;g(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function yg(i,o,u){return u=Li(u),u.tag=3,u.payload={element:null},u.callback=function(){Jd(i,o)},u}function Kv(i){return i=Li(i),i.tag=3,i}function Xv(i,o,u,g){var E=u.type.getDerivedStateFromError;if(typeof E=="function"){var T=g.value;i.payload=function(){return E(T)},i.callback=function(){Gv(o,u,g)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(i.callback=function(){Gv(o,u,g),typeof E!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var H=g.stack;this.componentDidCatch(g.value,{componentStack:H!==null?H:""})})}function R6(i,o,u,g,E){if(u.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=u.alternate,o!==null&&el(o,u,E,!0),u=Pr.current,u!==null){switch(u.tag){case 31:case 13:return ns===null?ff():u.alternate===null&&yn===0&&(yn=3),u.flags&=-257,u.flags|=65536,u.lanes=E,g===Hd?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([g]):o.add(g),Vg(i,g,E)),!1;case 22:return u.flags|=65536,g===Hd?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([g]):u.add(g)),Vg(i,g,E)),!1}throw Error(r(435,u.tag))}return Vg(i,g,E),ff(),!1}if(Dt)return o=Pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=E,g!==Bp&&(i=Error(r(422),{cause:g}),Cu(Zr(i,u)))):(g!==Bp&&(o=Error(r(423),{cause:g}),Cu(Zr(o,u))),i=i.current.alternate,i.flags|=65536,E&=-E,i.lanes|=E,g=Zr(g,u),E=yg(i.stateNode,g,E),Xp(i,E),yn!==4&&(yn=2)),!1;var T=Error(r(520),{cause:g});if(T=Zr(T,u),$u===null?$u=[T]:$u.push(T),yn!==4&&(yn=2),o===null)return!0;g=Zr(g,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,i=E&-E,u.lanes|=i,i=yg(u.stateNode,g,i),Xp(u,i),!1;case 1:if(o=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Ui===null||!Ui.has(T))))return u.flags|=65536,E&=-E,u.lanes|=E,E=Kv(E),Xv(E,i,u,g),Xp(u,E),!1}u=u.return}while(u!==null);return!1}var Eg=Error(r(461)),Rn=!1;function Jn(i,o,u,g){o.child=i===null?JE(o,null,u,g):Ba(o,i.child,u,g)}function Wv(i,o,u,g,E){u=u.render;var T=o.ref;if("ref"in g){var O={};for(var H in g)H!=="ref"&&(O[H]=g[H])}else O=g;return La(o),g=tg(i,o,u,O,T,E),H=ng(),i!==null&&!Rn?(rg(i,o,E),Js(i,o,E)):(Dt&&H&&jp(o),o.flags|=1,Jn(i,o,g,E),o.child)}function Qv(i,o,u,g,E){if(i===null){var T=u.type;return typeof T=="function"&&!Mp(T)&&T.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=T,Zv(i,o,T,g,E)):(i=Ld(u.type,null,g,o,o.mode,E),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,!_g(i,E)){var O=T.memoizedProps;if(u=u.compare,u=u!==null?u:vu,u(O,g)&&i.ref===o.ref)return Js(i,o,E)}return o.flags|=1,i=Gs(T,g),i.ref=o.ref,i.return=o,o.child=i}function Zv(i,o,u,g,E){if(i!==null){var T=i.memoizedProps;if(vu(T,g)&&i.ref===o.ref)if(Rn=!1,o.pendingProps=g=T,_g(i,E))(i.flags&131072)!==0&&(Rn=!0);else return o.lanes=i.lanes,Js(i,o,E)}return vg(i,o,u,g,E)}function Jv(i,o,u,g){var E=g.children,T=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,i!==null){for(g=o.child=i.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~T}else g=0,o.child=null;return eT(i,o,T,u,g)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Bd(o,T!==null?T.cachePool:null),T!==null?nv(o,T):Qp(),rv(o);else return g=o.lanes=536870912,eT(i,o,T!==null?T.baseLanes|u:u,u,g)}else T!==null?(Bd(o,T.cachePool),nv(o,T),Pi(),o.memoizedState=null):(i!==null&&Bd(o,null),Qp(),Pi());return Jn(i,o,E,u),o.child}function ju(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function eT(i,o,u,g,E){var T=qp();return T=T===null?null:{parent:_n._currentValue,pool:T},o.memoizedState={baseLanes:u,cachePool:T},i!==null&&Bd(o,null),Qp(),rv(o),i!==null&&el(i,o,g,!0),o.childLanes=E,null}function ef(i,o){return o=nf({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function tT(i,o,u){return Ba(o,i.child,null,u),i=ef(o,o.pendingProps),i.flags|=2,Br(o),o.memoizedState=null,i}function O6(i,o,u){var g=o.pendingProps,E=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Dt){if(g.mode==="hidden")return i=ef(o,g),o.lanes=536870912,ju(null,i);if(Jp(o),(i=ln)?(i=h2(i,ts),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Ai!==null?{id:Ts,overflow:Ss}:null,retryLane:536870912,hydrationErrors:null},u=BE(i),u.return=o,o.child=u,Qn=o,ln=null)):i=null,i===null)throw Oi(o);return o.lanes=536870912,null}return ef(o,g)}var T=i.memoizedState;if(T!==null){var O=T.dehydrated;if(Jp(o),E)if(o.flags&256)o.flags&=-257,o=tT(i,o,u);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(Rn||el(i,o,u,!1),E=(u&i.childLanes)!==0,Rn||E){if(g=tn,g!==null&&(O=Tn(g,u),O!==0&&O!==T.retryLane))throw T.retryLane=O,Ra(i,O),kr(g,i,O),Eg;ff(),o=tT(i,o,u)}else i=T.treeContext,ln=rs(O.nextSibling),Qn=o,Dt=!0,Ri=null,ts=!1,i!==null&&UE(o,i),o=ef(o,g),o.flags|=4096;return o}return i=Gs(i.child,{mode:g.mode,children:g.children}),i.ref=o.ref,o.child=i,i.return=o,i}function tf(i,o){var u=o.ref;if(u===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(o.flags|=4194816)}}function vg(i,o,u,g,E){return La(o),u=tg(i,o,u,g,void 0,E),g=ng(),i!==null&&!Rn?(rg(i,o,E),Js(i,o,E)):(Dt&&g&&jp(o),o.flags|=1,Jn(i,o,u,E),o.child)}function nT(i,o,u,g,E,T){return La(o),o.updateQueue=null,u=iv(o,g,u,E),sv(i),g=ng(),i!==null&&!Rn?(rg(i,o,T),Js(i,o,T)):(Dt&&g&&jp(o),o.flags|=1,Jn(i,o,u,T),o.child)}function rT(i,o,u,g,E){if(La(o),o.stateNode===null){var T=Wo,O=u.contextType;typeof O=="object"&&O!==null&&(T=Zn(O)),T=new u(g,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=xg,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=g,T.state=o.memoizedState,T.refs={},Gp(o),O=u.contextType,T.context=typeof O=="object"&&O!==null?Zn(O):Wo,T.state=o.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(bg(o,u,O,g),T.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(O=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),O!==T.state&&xg.enqueueReplaceState(T,T.state,null),Ou(o,g,T,E),Ru(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(i===null){T=o.stateNode;var H=o.memoizedProps,se=Ha(u,H);T.props=se;var be=T.context,Ne=u.contextType;O=Wo,typeof Ne=="object"&&Ne!==null&&(O=Zn(Ne));var Ae=u.getDerivedStateFromProps;Ne=typeof Ae=="function"||typeof T.getSnapshotBeforeUpdate=="function",H=o.pendingProps!==H,Ne||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(H||be!==O)&&$v(o,T,g,O),Mi=!1;var xe=o.memoizedState;T.state=xe,Ou(o,g,T,E),Ru(),be=o.memoizedState,H||xe!==be||Mi?(typeof Ae=="function"&&(bg(o,u,Ae,g),be=o.memoizedState),(se=Mi||Fv(o,u,se,g,xe,be,O))?(Ne||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=be),T.props=g,T.state=be,T.context=O,g=se):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,Kp(i,o),O=o.memoizedProps,Ne=Ha(u,O),T.props=Ne,Ae=o.pendingProps,xe=T.context,be=u.contextType,se=Wo,typeof be=="object"&&be!==null&&(se=Zn(be)),H=u.getDerivedStateFromProps,(be=typeof H=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==Ae||xe!==se)&&$v(o,T,g,se),Mi=!1,xe=o.memoizedState,T.state=xe,Ou(o,g,T,E),Ru();var Te=o.memoizedState;O!==Ae||xe!==Te||Mi||i!==null&&i.dependencies!==null&&jd(i.dependencies)?(typeof H=="function"&&(bg(o,u,H,g),Te=o.memoizedState),(Ne=Mi||Fv(o,u,Ne,g,xe,Te,se)||i!==null&&i.dependencies!==null&&jd(i.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Te,se),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Te,se)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=Te),T.props=g,T.state=Te,T.context=se,g=Ne):(typeof T.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(o.flags|=1024),g=!1)}return T=g,tf(i,o),g=(o.flags&128)!==0,T||g?(T=o.stateNode,u=g&&typeof u.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,i!==null&&g?(o.child=Ba(o,i.child,null,E),o.child=Ba(o,null,u,E)):Jn(i,o,u,E),o.memoizedState=T.state,i=o.child):i=Js(i,o,E),i}function sT(i,o,u,g){return Ia(),o.flags|=256,Jn(i,o,u,g),o.child}var Tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sg(i){return{baseLanes:i,cachePool:GE()}}function Cg(i,o,u){return i=i!==null?i.childLanes&~u:0,o&&(i|=Hr),i}function iT(i,o,u){var g=o.pendingProps,E=!1,T=(o.flags&128)!==0,O;if((O=T)||(O=i!==null&&i.memoizedState===null?!1:(Sn.current&2)!==0),O&&(E=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,i===null){if(Dt){if(E?ji(o):Pi(),(i=ln)?(i=h2(i,ts),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Ai!==null?{id:Ts,overflow:Ss}:null,retryLane:536870912,hydrationErrors:null},u=BE(i),u.return=o,o.child=u,Qn=o,ln=null)):i=null,i===null)throw Oi(o);return a0(i)?o.lanes=32:o.lanes=536870912,null}var H=g.children;return g=g.fallback,E?(Pi(),E=o.mode,H=nf({mode:"hidden",children:H},E),g=Oa(g,E,u,null),H.return=o,g.return=o,H.sibling=g,o.child=H,g=o.child,g.memoizedState=Sg(u),g.childLanes=Cg(i,O,u),o.memoizedState=Tg,ju(null,g)):(ji(o),wg(o,H))}var se=i.memoizedState;if(se!==null&&(H=se.dehydrated,H!==null)){if(T)o.flags&256?(ji(o),o.flags&=-257,o=kg(i,o,u)):o.memoizedState!==null?(Pi(),o.child=i.child,o.flags|=128,o=null):(Pi(),H=g.fallback,E=o.mode,g=nf({mode:"visible",children:g.children},E),H=Oa(H,E,u,null),H.flags|=2,g.return=o,H.return=o,g.sibling=H,o.child=g,Ba(o,i.child,null,u),g=o.child,g.memoizedState=Sg(u),g.childLanes=Cg(i,O,u),o.memoizedState=Tg,o=ju(null,g));else if(ji(o),a0(H)){if(O=H.nextSibling&&H.nextSibling.dataset,O)var be=O.dgst;O=be,g=Error(r(419)),g.stack="",g.digest=O,Cu({value:g,source:null,stack:null}),o=kg(i,o,u)}else if(Rn||el(i,o,u,!1),O=(u&i.childLanes)!==0,Rn||O){if(O=tn,O!==null&&(g=Tn(O,u),g!==0&&g!==se.retryLane))throw se.retryLane=g,Ra(i,g),kr(O,i,g),Eg;i0(H)||ff(),o=kg(i,o,u)}else i0(H)?(o.flags|=192,o.child=i.child,o=null):(i=se.treeContext,ln=rs(H.nextSibling),Qn=o,Dt=!0,Ri=null,ts=!1,i!==null&&UE(o,i),o=wg(o,g.children),o.flags|=4096);return o}return E?(Pi(),H=g.fallback,E=o.mode,se=i.child,be=se.sibling,g=Gs(se,{mode:"hidden",children:g.children}),g.subtreeFlags=se.subtreeFlags&65011712,be!==null?H=Gs(be,H):(H=Oa(H,E,u,null),H.flags|=2),H.return=o,g.return=o,g.sibling=H,o.child=g,ju(null,g),g=o.child,H=i.child.memoizedState,H===null?H=Sg(u):(E=H.cachePool,E!==null?(se=_n._currentValue,E=E.parent!==se?{parent:se,pool:se}:E):E=GE(),H={baseLanes:H.baseLanes|u,cachePool:E}),g.memoizedState=H,g.childLanes=Cg(i,O,u),o.memoizedState=Tg,ju(i.child,g)):(ji(o),u=i.child,i=u.sibling,u=Gs(u,{mode:"visible",children:g.children}),u.return=o,u.sibling=null,i!==null&&(O=o.deletions,O===null?(o.deletions=[i],o.flags|=16):O.push(i)),o.child=u,o.memoizedState=null,u)}function wg(i,o){return o=nf({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function nf(i,o){return i=jr(22,i,null,o),i.lanes=0,i}function kg(i,o,u){return Ba(o,i.child,null,u),i=wg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function aT(i,o,u){i.lanes|=o;var g=i.alternate;g!==null&&(g.lanes|=o),Up(i.return,o,u)}function Ng(i,o,u,g,E,T){var O=i.memoizedState;O===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:E,treeForkCount:T}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=u,O.tailMode=E,O.treeForkCount=T)}function oT(i,o,u){var g=o.pendingProps,E=g.revealOrder,T=g.tail;g=g.children;var O=Sn.current,H=(O&2)!==0;if(H?(O=O&1|2,o.flags|=128):O&=1,j(Sn,O),Jn(i,o,g,u),g=Dt?Su:0,!H&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&aT(i,u,o);else if(i.tag===19)aT(i,u,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(E){case"forwards":for(u=o.child,E=null;u!==null;)i=u.alternate,i!==null&&Vd(i)===null&&(E=u),u=u.sibling;u=E,u===null?(E=o.child,o.child=null):(E=u.sibling,u.sibling=null),Ng(o,!1,E,u,T,g);break;case"backwards":case"unstable_legacy-backwards":for(u=null,E=o.child,o.child=null;E!==null;){if(i=E.alternate,i!==null&&Vd(i)===null){o.child=E;break}i=E.sibling,E.sibling=u,u=E,E=i}Ng(o,!0,u,null,T,g);break;case"together":Ng(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function Js(i,o,u){if(i!==null&&(o.dependencies=i.dependencies),Hi|=o.lanes,(u&o.childLanes)===0)if(i!==null){if(el(i,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,u=Gs(i,i.pendingProps),o.child=u,u.return=o;i.sibling!==null;)i=i.sibling,u=u.sibling=Gs(i,i.pendingProps),u.return=o;u.sibling=null}return o.child}function _g(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&jd(i)))}function I6(i,o,u){switch(o.tag){case 3:fe(o,o.stateNode.containerInfo),Ii(o,_n,i.memoizedState.cache),Ia();break;case 27:case 5:Fe(o);break;case 4:fe(o,o.stateNode.containerInfo);break;case 10:Ii(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Jp(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(ji(o),o.flags|=128,null):(u&o.child.childLanes)!==0?iT(i,o,u):(ji(o),i=Js(i,o,u),i!==null?i.sibling:null);ji(o);break;case 19:var E=(i.flags&128)!==0;if(g=(u&o.childLanes)!==0,g||(el(i,o,u,!1),g=(u&o.childLanes)!==0),E){if(g)return oT(i,o,u);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),j(Sn,Sn.current),g)break;return null;case 22:return o.lanes=0,Jv(i,o,u,o.pendingProps);case 24:Ii(o,_n,i.memoizedState.cache)}return Js(i,o,u)}function lT(i,o,u){if(i!==null)if(i.memoizedProps!==o.pendingProps)Rn=!0;else{if(!_g(i,u)&&(o.flags&128)===0)return Rn=!1,I6(i,o,u);Rn=(i.flags&131072)!==0}else Rn=!1,Dt&&(o.flags&1048576)!==0&&HE(o,Su,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(i=ja(o.elementType),o.type=i,typeof i=="function")Mp(i)?(g=Ha(i,g),o.tag=1,o=rT(null,o,i,g,u)):(o.tag=0,o=vg(null,o,i,g,u));else{if(i!=null){var E=i.$$typeof;if(E===R){o.tag=11,o=Wv(null,o,i,g,u);break e}else if(E===L){o.tag=14,o=Qv(null,o,i,g,u);break e}}throw o=te(i)||i,Error(r(306,o,""))}}return o;case 0:return vg(i,o,o.type,o.pendingProps,u);case 1:return g=o.type,E=Ha(g,o.pendingProps),rT(i,o,g,E,u);case 3:e:{if(fe(o,o.stateNode.containerInfo),i===null)throw Error(r(387));g=o.pendingProps;var T=o.memoizedState;E=T.element,Kp(i,o),Ou(o,g,null,u);var O=o.memoizedState;if(g=O.cache,Ii(o,_n,g),g!==T.cache&&Fp(o,[_n],u,!0),Ru(),g=O.element,T.isDehydrated)if(T={element:g,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=sT(i,o,g,u);break e}else if(g!==E){E=Zr(Error(r(424)),o),Cu(E),o=sT(i,o,g,u);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(ln=rs(i.firstChild),Qn=o,Dt=!0,Ri=null,ts=!0,u=JE(o,null,g,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ia(),g===E){o=Js(i,o,u);break e}Jn(i,o,g,u)}o=o.child}return o;case 26:return tf(i,o),i===null?(u=y2(o.type,null,o.pendingProps,null))?o.memoizedState=u:Dt||(u=o.type,i=o.pendingProps,g=yf(ce.current).createElement(u),g[en]=o,g[Wn]=i,er(g,u,i),Fn(g),o.stateNode=g):o.memoizedState=y2(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Fe(o),i===null&&Dt&&(g=o.stateNode=g2(o.type,o.pendingProps,ce.current),Qn=o,ts=!0,E=ln,qi(o.type)?(o0=E,ln=rs(g.firstChild)):ln=E),Jn(i,o,o.pendingProps.children,u),tf(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Dt&&((E=g=ln)&&(g=lM(g,o.type,o.pendingProps,ts),g!==null?(o.stateNode=g,Qn=o,ln=rs(g.firstChild),ts=!1,E=!0):E=!1),E||Oi(o)),Fe(o),E=o.type,T=o.pendingProps,O=i!==null?i.memoizedProps:null,g=T.children,n0(E,T)?g=null:O!==null&&n0(E,O)&&(o.flags|=32),o.memoizedState!==null&&(E=tg(i,o,S6,null,null,u),Qu._currentValue=E),tf(i,o),Jn(i,o,g,u),o.child;case 6:return i===null&&Dt&&((i=u=ln)&&(u=uM(u,o.pendingProps,ts),u!==null?(o.stateNode=u,Qn=o,ln=null,i=!0):i=!1),i||Oi(o)),null;case 13:return iT(i,o,u);case 4:return fe(o,o.stateNode.containerInfo),g=o.pendingProps,i===null?o.child=Ba(o,null,g,u):Jn(i,o,g,u),o.child;case 11:return Wv(i,o,o.type,o.pendingProps,u);case 7:return Jn(i,o,o.pendingProps,u),o.child;case 8:return Jn(i,o,o.pendingProps.children,u),o.child;case 12:return Jn(i,o,o.pendingProps.children,u),o.child;case 10:return g=o.pendingProps,Ii(o,o.type,g.value),Jn(i,o,g.children,u),o.child;case 9:return E=o.type._context,g=o.pendingProps.children,La(o),E=Zn(E),g=g(E),o.flags|=1,Jn(i,o,g,u),o.child;case 14:return Qv(i,o,o.type,o.pendingProps,u);case 15:return Zv(i,o,o.type,o.pendingProps,u);case 19:return oT(i,o,u);case 31:return O6(i,o,u);case 22:return Jv(i,o,u,o.pendingProps);case 24:return La(o),g=Zn(_n),i===null?(E=qp(),E===null&&(E=tn,T=$p(),E.pooledCache=T,T.refCount++,T!==null&&(E.pooledCacheLanes|=u),E=T),o.memoizedState={parent:g,cache:E},Gp(o),Ii(o,_n,E)):((i.lanes&u)!==0&&(Kp(i,o),Ou(o,null,null,u),Ru()),E=i.memoizedState,T=o.memoizedState,E.parent!==g?(E={parent:g,cache:g},o.memoizedState=E,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=E),Ii(o,_n,g)):(g=T.cache,Ii(o,_n,g),g!==E.cache&&Fp(o,[_n],u,!0))),Jn(i,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ei(i){i.flags|=4}function Ag(i,o,u,g,E){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(E&335544128)===E)if(i.stateNode.complete)i.flags|=8192;else if(DT())i.flags|=8192;else throw Pa=Hd,Yp}else i.flags&=-16777217}function uT(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!C2(o))if(DT())i.flags|=8192;else throw Pa=Hd,Yp}function rf(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Jt():536870912,i.lanes|=o,fl|=o)}function Pu(i,o){if(!Dt)switch(i.tailMode){case"hidden":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function un(i){var o=i.alternate!==null&&i.alternate.child===i.child,u=0,g=0;if(o)for(var E=i.child;E!==null;)u|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=i,E=E.sibling;else for(E=i.child;E!==null;)u|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=i,E=E.sibling;return i.subtreeFlags|=g,i.childLanes=u,o}function M6(i,o,u){var g=o.pendingProps;switch(Pp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(o),null;case 1:return un(o),null;case 3:return u=o.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),Ws(_n),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Jo(o)?ei(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,zp())),un(o),null;case 26:var E=o.type,T=o.memoizedState;return i===null?(ei(o),T!==null?(un(o),uT(o,T)):(un(o),Ag(o,E,null,g,u))):T?T!==i.memoizedState?(ei(o),un(o),uT(o,T)):(un(o),o.flags&=-16777217):(i=i.memoizedProps,i!==g&&ei(o),un(o),Ag(o,E,i,g,u)),null;case 27:if(De(o),u=ce.current,E=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&ei(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return un(o),null}i=re.current,Jo(o)?FE(o):(i=g2(E,g,u),o.stateNode=i,ei(o))}return un(o),null;case 5:if(De(o),E=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&ei(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return un(o),null}if(T=re.current,Jo(o))FE(o);else{var O=yf(ce.current);switch(T){case 1:T=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:T=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":T=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":T=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":T=O.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?T.multiple=!0:g.size&&(T.size=g.size);break;default:T=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}T[en]=o,T[Wn]=g;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)T.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=T;e:switch(er(T,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ei(o)}}return un(o),Ag(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,u),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==g&&ei(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(i=ce.current,Jo(o)){if(i=o.stateNode,u=o.memoizedProps,g=null,E=Qn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}i[en]=o,i=!!(i.nodeValue===u||g!==null&&g.suppressHydrationWarning===!0||i2(i.nodeValue,u)),i||Oi(o,!0)}else i=yf(i).createTextNode(g),i[en]=o,o.stateNode=i}return un(o),null;case 31:if(u=o.memoizedState,i===null||i.memoizedState!==null){if(g=Jo(o),u!==null){if(i===null){if(!g)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[en]=o}else Ia(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;un(o),i=!1}else u=zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return o.flags&256?(Br(o),o):(Br(o),null);if((o.flags&128)!==0)throw Error(r(558))}return un(o),null;case 13:if(g=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(E=Jo(o),g!==null&&g.dehydrated!==null){if(i===null){if(!E)throw Error(r(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[en]=o}else Ia(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;un(o),E=!1}else E=zp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(Br(o),o):(Br(o),null)}return Br(o),(o.flags&128)!==0?(o.lanes=u,o):(u=g!==null,i=i!==null&&i.memoizedState!==null,u&&(g=o.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==E&&(g.flags|=2048)),u!==i&&u&&(o.child.flags|=8192),rf(o,o.updateQueue),un(o),null);case 4:return ve(),i===null&&Qg(o.stateNode.containerInfo),un(o),null;case 10:return Ws(o.type),un(o),null;case 19:if($(Sn),g=o.memoizedState,g===null)return un(o),null;if(E=(o.flags&128)!==0,T=g.rendering,T===null)if(E)Pu(g,!1);else{if(yn!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(T=Vd(i),T!==null){for(o.flags|=128,Pu(g,!1),i=T.updateQueue,o.updateQueue=i,rf(o,i),o.subtreeFlags=0,i=u,u=o.child;u!==null;)PE(u,i),u=u.sibling;return j(Sn,Sn.current&1|2),Dt&&Ks(o,g.treeForkCount),o.child}i=i.sibling}g.tail!==null&&ie()>uf&&(o.flags|=128,E=!0,Pu(g,!1),o.lanes=4194304)}else{if(!E)if(i=Vd(T),i!==null){if(o.flags|=128,E=!0,i=i.updateQueue,o.updateQueue=i,rf(o,i),Pu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!Dt)return un(o),null}else 2*ie()-g.renderingStartTime>uf&&u!==536870912&&(o.flags|=128,E=!0,Pu(g,!1),o.lanes=4194304);g.isBackwards?(T.sibling=o.child,o.child=T):(i=g.last,i!==null?i.sibling=T:o.child=T,g.last=T)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=ie(),i.sibling=null,u=Sn.current,j(Sn,E?u&1|2:u&1),Dt&&Ks(o,g.treeForkCount),i):(un(o),null);case 22:case 23:return Br(o),Zp(),g=o.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(u&536870912)!==0&&(o.flags&128)===0&&(un(o),o.subtreeFlags&6&&(o.flags|=8192)):un(o),u=o.updateQueue,u!==null&&rf(o,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==u&&(o.flags|=2048),i!==null&&$(Da),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Ws(_n),un(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function L6(i,o){switch(Pp(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Ws(_n),ve(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return De(o),null;case 31:if(o.memoizedState!==null){if(Br(o),o.alternate===null)throw Error(r(340));Ia()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(Br(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Ia()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return $(Sn),null;case 4:return ve(),null;case 10:return Ws(o.type),null;case 22:case 23:return Br(o),Zp(),i!==null&&$(Da),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Ws(_n),null;case 25:return null;default:return null}}function cT(i,o){switch(Pp(o),o.tag){case 3:Ws(_n),ve();break;case 26:case 27:case 5:De(o);break;case 4:ve();break;case 31:o.memoizedState!==null&&Br(o);break;case 13:Br(o);break;case 19:$(Sn);break;case 10:Ws(o.type);break;case 22:case 23:Br(o),Zp(),i!==null&&$(Da);break;case 24:Ws(_n)}}function Bu(i,o){try{var u=o.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var E=g.next;u=E;do{if((u.tag&i)===i){g=void 0;var T=u.create,O=u.inst;g=T(),O.destroy=g}u=u.next}while(u!==E)}}catch(H){qt(o,o.return,H)}}function Bi(i,o,u){try{var g=o.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var T=E.next;g=T;do{if((g.tag&i)===i){var O=g.inst,H=O.destroy;if(H!==void 0){O.destroy=void 0,E=o;var se=u,be=H;try{be()}catch(Ne){qt(E,se,Ne)}}}g=g.next}while(g!==T)}}catch(Ne){qt(o,o.return,Ne)}}function dT(i){var o=i.updateQueue;if(o!==null){var u=i.stateNode;try{tv(o,u)}catch(g){qt(i,i.return,g)}}}function fT(i,o,u){u.props=Ha(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(g){qt(i,o,g)}}function zu(i,o){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof u=="function"?i.refCleanup=u(g):u.current=g}}catch(E){qt(i,o,E)}}function Cs(i,o){var u=i.ref,g=i.refCleanup;if(u!==null)if(typeof g=="function")try{g()}catch(E){qt(i,o,E)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(E){qt(i,o,E)}else u.current=null}function hT(i){var o=i.type,u=i.memoizedProps,g=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&g.focus();break e;case"img":u.src?g.src=u.src:u.srcSet&&(g.srcset=u.srcSet)}}catch(E){qt(i,i.return,E)}}function Rg(i,o,u){try{var g=i.stateNode;nM(g,i.type,u,o),g[Wn]=o}catch(E){qt(i,i.return,E)}}function mT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&qi(i.type)||i.tag===4}function Og(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||mT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&qi(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Ig(i,o,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(i),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=qs));else if(g!==4&&(g===27&&qi(i.type)&&(u=i.stateNode,o=null),i=i.child,i!==null))for(Ig(i,o,u),i=i.sibling;i!==null;)Ig(i,o,u),i=i.sibling}function sf(i,o,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?u.insertBefore(i,o):u.appendChild(i);else if(g!==4&&(g===27&&qi(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(sf(i,o,u),i=i.sibling;i!==null;)sf(i,o,u),i=i.sibling}function pT(i){var o=i.stateNode,u=i.memoizedProps;try{for(var g=i.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);er(o,g,u),o[en]=i,o[Wn]=u}catch(T){qt(i,i.return,T)}}var ti=!1,On=!1,Mg=!1,gT=typeof WeakSet=="function"?WeakSet:Set,$n=null;function D6(i,o){if(i=i.containerInfo,e0=kf,i=_E(i),kp(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var E=g.anchorOffset,T=g.focusNode;g=g.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var O=0,H=-1,se=-1,be=0,Ne=0,Ae=i,xe=null;t:for(;;){for(var Te;Ae!==u||E!==0&&Ae.nodeType!==3||(H=O+E),Ae!==T||g!==0&&Ae.nodeType!==3||(se=O+g),Ae.nodeType===3&&(O+=Ae.nodeValue.length),(Te=Ae.firstChild)!==null;)xe=Ae,Ae=Te;for(;;){if(Ae===i)break t;if(xe===u&&++be===E&&(H=O),xe===T&&++Ne===g&&(se=O),(Te=Ae.nextSibling)!==null)break;Ae=xe,xe=Ae.parentNode}Ae=Te}u=H===-1||se===-1?null:{start:H,end:se}}else u=null}u=u||{start:0,end:0}}else u=null;for(t0={focusedElem:i,selectionRange:u},kf=!1,$n=o;$n!==null;)if(o=$n,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,$n=i;else for(;$n!==null;){switch(o=$n,T=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)E=i[u],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&T!==null){i=void 0,u=o,E=T.memoizedProps,T=T.memoizedState,g=u.stateNode;try{var Ze=Ha(u.type,E);i=g.getSnapshotBeforeUpdate(Ze,T),g.__reactInternalSnapshotBeforeUpdate=i}catch(at){qt(u,u.return,at)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,u=i.nodeType,u===9)s0(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":s0(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,$n=i;break}$n=o.return}}function bT(i,o,u){var g=u.flags;switch(u.tag){case 0:case 11:case 15:ri(i,u),g&4&&Bu(5,u);break;case 1:if(ri(i,u),g&4)if(i=u.stateNode,o===null)try{i.componentDidMount()}catch(O){qt(u,u.return,O)}else{var E=Ha(u.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(E,o,i.__reactInternalSnapshotBeforeUpdate)}catch(O){qt(u,u.return,O)}}g&64&&dT(u),g&512&&zu(u,u.return);break;case 3:if(ri(i,u),g&64&&(i=u.updateQueue,i!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{tv(i,o)}catch(O){qt(u,u.return,O)}}break;case 27:o===null&&g&4&&pT(u);case 26:case 5:ri(i,u),o===null&&g&4&&hT(u),g&512&&zu(u,u.return);break;case 12:ri(i,u);break;case 31:ri(i,u),g&4&&ET(i,u);break;case 13:ri(i,u),g&4&&vT(i,u),g&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=V6.bind(null,u),cM(i,u))));break;case 22:if(g=u.memoizedState!==null||ti,!g){o=o!==null&&o.memoizedState!==null||On,E=ti;var T=On;ti=g,(On=o)&&!T?si(i,u,(u.subtreeFlags&8772)!==0):ri(i,u),ti=E,On=T}break;case 30:break;default:ri(i,u)}}function xT(i){var o=i.alternate;o!==null&&(i.alternate=null,xT(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&up(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var fn=null,Tr=!1;function ni(i,o,u){for(u=u.child;u!==null;)yT(i,o,u),u=u.sibling}function yT(i,o,u){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:On||Cs(u,o),ni(i,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:On||Cs(u,o);var g=fn,E=Tr;qi(u.type)&&(fn=u.stateNode,Tr=!1),ni(i,o,u),Ku(u.stateNode),fn=g,Tr=E;break;case 5:On||Cs(u,o);case 6:if(g=fn,E=Tr,fn=null,ni(i,o,u),fn=g,Tr=E,fn!==null)if(Tr)try{(fn.nodeType===9?fn.body:fn.nodeName==="HTML"?fn.ownerDocument.body:fn).removeChild(u.stateNode)}catch(T){qt(u,o,T)}else try{fn.removeChild(u.stateNode)}catch(T){qt(u,o,T)}break;case 18:fn!==null&&(Tr?(i=fn,d2(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),El(i)):d2(fn,u.stateNode));break;case 4:g=fn,E=Tr,fn=u.stateNode.containerInfo,Tr=!0,ni(i,o,u),fn=g,Tr=E;break;case 0:case 11:case 14:case 15:Bi(2,u,o),On||Bi(4,u,o),ni(i,o,u);break;case 1:On||(Cs(u,o),g=u.stateNode,typeof g.componentWillUnmount=="function"&&fT(u,o,g)),ni(i,o,u);break;case 21:ni(i,o,u);break;case 22:On=(g=On)||u.memoizedState!==null,ni(i,o,u),On=g;break;default:ni(i,o,u)}}function ET(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{El(i)}catch(u){qt(o,o.return,u)}}}function vT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{El(i)}catch(u){qt(o,o.return,u)}}function j6(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new gT),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new gT),o;default:throw Error(r(435,i.tag))}}function af(i,o){var u=j6(i);o.forEach(function(g){if(!u.has(g)){u.add(g);var E=q6.bind(null,i,g);g.then(E,E)}})}function Sr(i,o){var u=o.deletions;if(u!==null)for(var g=0;g<u.length;g++){var E=u[g],T=i,O=o,H=O;e:for(;H!==null;){switch(H.tag){case 27:if(qi(H.type)){fn=H.stateNode,Tr=!1;break e}break;case 5:fn=H.stateNode,Tr=!1;break e;case 3:case 4:fn=H.stateNode.containerInfo,Tr=!0;break e}H=H.return}if(fn===null)throw Error(r(160));yT(T,O,E),fn=null,Tr=!1,T=E.alternate,T!==null&&(T.return=null),E.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)TT(o,i),o=o.sibling}var ds=null;function TT(i,o){var u=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Sr(o,i),Cr(i),g&4&&(Bi(3,i,i.return),Bu(3,i),Bi(5,i,i.return));break;case 1:Sr(o,i),Cr(i),g&512&&(On||u===null||Cs(u,u.return)),g&64&&ti&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?g:u.concat(g))));break;case 26:var E=ds;if(Sr(o,i),Cr(i),g&512&&(On||u===null||Cs(u,u.return)),g&4){var T=u!==null?u.memoizedState:null;if(g=i.memoizedState,u===null)if(g===null)if(i.stateNode===null){e:{g=i.type,u=i.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":T=E.getElementsByTagName("title")[0],(!T||T[fu]||T[en]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=E.createElement(g),E.head.insertBefore(T,E.querySelector("head > title"))),er(T,g,u),T[en]=i,Fn(T),g=T;break e;case"link":var O=T2("link","href",E).get(g+(u.href||""));if(O){for(var H=0;H<O.length;H++)if(T=O[H],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){O.splice(H,1);break t}}T=E.createElement(g),er(T,g,u),E.head.appendChild(T);break;case"meta":if(O=T2("meta","content",E).get(g+(u.content||""))){for(H=0;H<O.length;H++)if(T=O[H],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){O.splice(H,1);break t}}T=E.createElement(g),er(T,g,u),E.head.appendChild(T);break;default:throw Error(r(468,g))}T[en]=i,Fn(T),g=T}i.stateNode=g}else S2(E,i.type,i.stateNode);else i.stateNode=v2(E,g,i.memoizedProps);else T!==g?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,g===null?S2(E,i.type,i.stateNode):v2(E,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Rg(i,i.memoizedProps,u.memoizedProps)}break;case 27:Sr(o,i),Cr(i),g&512&&(On||u===null||Cs(u,u.return)),u!==null&&g&4&&Rg(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Sr(o,i),Cr(i),g&512&&(On||u===null||Cs(u,u.return)),i.flags&32){E=i.stateNode;try{$o(E,"")}catch(Ze){qt(i,i.return,Ze)}}g&4&&i.stateNode!=null&&(E=i.memoizedProps,Rg(i,E,u!==null?u.memoizedProps:E)),g&1024&&(Mg=!0);break;case 6:if(Sr(o,i),Cr(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,u=i.stateNode;try{u.nodeValue=g}catch(Ze){qt(i,i.return,Ze)}}break;case 3:if(Tf=null,E=ds,ds=Ef(o.containerInfo),Sr(o,i),ds=E,Cr(i),g&4&&u!==null&&u.memoizedState.isDehydrated)try{El(o.containerInfo)}catch(Ze){qt(i,i.return,Ze)}Mg&&(Mg=!1,ST(i));break;case 4:g=ds,ds=Ef(i.stateNode.containerInfo),Sr(o,i),Cr(i),ds=g;break;case 12:Sr(o,i),Cr(i);break;case 31:Sr(o,i),Cr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,af(i,g)));break;case 13:Sr(o,i),Cr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(lf=ie()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,af(i,g)));break;case 22:E=i.memoizedState!==null;var se=u!==null&&u.memoizedState!==null,be=ti,Ne=On;if(ti=be||E,On=Ne||se,Sr(o,i),On=Ne,ti=be,Cr(i),g&8192)e:for(o=i.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(u===null||se||ti||On||Ua(i)),u=null,o=i;;){if(o.tag===5||o.tag===26){if(u===null){se=u=o;try{if(T=se.stateNode,E)O=T.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{H=se.stateNode;var Ae=se.memoizedProps.style,xe=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;H.style.display=xe==null||typeof xe=="boolean"?"":(""+xe).trim()}}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===6){if(u===null){se=o;try{se.stateNode.nodeValue=E?"":se.memoizedProps}catch(Ze){qt(se,se.return,Ze)}}}else if(o.tag===18){if(u===null){se=o;try{var Te=se.stateNode;E?f2(Te,!0):f2(se.stateNode,!1)}catch(Ze){qt(se,se.return,Ze)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=i.updateQueue,g!==null&&(u=g.retryQueue,u!==null&&(g.retryQueue=null,af(i,u))));break;case 19:Sr(o,i),Cr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,af(i,g)));break;case 30:break;case 21:break;default:Sr(o,i),Cr(i)}}function Cr(i){var o=i.flags;if(o&2){try{for(var u,g=i.return;g!==null;){if(mT(g)){u=g;break}g=g.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var E=u.stateNode,T=Og(i);sf(i,T,E);break;case 5:var O=u.stateNode;u.flags&32&&($o(O,""),u.flags&=-33);var H=Og(i);sf(i,H,O);break;case 3:case 4:var se=u.stateNode.containerInfo,be=Og(i);Ig(i,be,se);break;default:throw Error(r(161))}}catch(Ne){qt(i,i.return,Ne)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function ST(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;ST(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function ri(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)bT(i,o.alternate,o),o=o.sibling}function Ua(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Bi(4,o,o.return),Ua(o);break;case 1:Cs(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&fT(o,o.return,u),Ua(o);break;case 27:Ku(o.stateNode);case 26:case 5:Cs(o,o.return),Ua(o);break;case 22:o.memoizedState===null&&Ua(o);break;case 30:Ua(o);break;default:Ua(o)}i=i.sibling}}function si(i,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,E=i,T=o,O=T.flags;switch(T.tag){case 0:case 11:case 15:si(E,T,u),Bu(4,T);break;case 1:if(si(E,T,u),g=T,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(be){qt(g,g.return,be)}if(g=T,E=g.updateQueue,E!==null){var H=g.stateNode;try{var se=E.shared.hiddenCallbacks;if(se!==null)for(E.shared.hiddenCallbacks=null,E=0;E<se.length;E++)ev(se[E],H)}catch(be){qt(g,g.return,be)}}u&&O&64&&dT(T),zu(T,T.return);break;case 27:pT(T);case 26:case 5:si(E,T,u),u&&g===null&&O&4&&hT(T),zu(T,T.return);break;case 12:si(E,T,u);break;case 31:si(E,T,u),u&&O&4&&ET(E,T);break;case 13:si(E,T,u),u&&O&4&&vT(E,T);break;case 22:T.memoizedState===null&&si(E,T,u),zu(T,T.return);break;case 30:break;default:si(E,T,u)}o=o.sibling}}function Lg(i,o){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&wu(u))}function Dg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&wu(i))}function fs(i,o,u,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)CT(i,o,u,g),o=o.sibling}function CT(i,o,u,g){var E=o.flags;switch(o.tag){case 0:case 11:case 15:fs(i,o,u,g),E&2048&&Bu(9,o);break;case 1:fs(i,o,u,g);break;case 3:fs(i,o,u,g),E&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&wu(i)));break;case 12:if(E&2048){fs(i,o,u,g),i=o.stateNode;try{var T=o.memoizedProps,O=T.id,H=T.onPostCommit;typeof H=="function"&&H(O,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(se){qt(o,o.return,se)}}else fs(i,o,u,g);break;case 31:fs(i,o,u,g);break;case 13:fs(i,o,u,g);break;case 23:break;case 22:T=o.stateNode,O=o.alternate,o.memoizedState!==null?T._visibility&2?fs(i,o,u,g):Hu(i,o):T._visibility&2?fs(i,o,u,g):(T._visibility|=2,ul(i,o,u,g,(o.subtreeFlags&10256)!==0||!1)),E&2048&&Lg(O,o);break;case 24:fs(i,o,u,g),E&2048&&Dg(o.alternate,o);break;default:fs(i,o,u,g)}}function ul(i,o,u,g,E){for(E=E&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=i,O=o,H=u,se=g,be=O.flags;switch(O.tag){case 0:case 11:case 15:ul(T,O,H,se,E),Bu(8,O);break;case 23:break;case 22:var Ne=O.stateNode;O.memoizedState!==null?Ne._visibility&2?ul(T,O,H,se,E):Hu(T,O):(Ne._visibility|=2,ul(T,O,H,se,E)),E&&be&2048&&Lg(O.alternate,O);break;case 24:ul(T,O,H,se,E),E&&be&2048&&Dg(O.alternate,O);break;default:ul(T,O,H,se,E)}o=o.sibling}}function Hu(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=i,g=o,E=g.flags;switch(g.tag){case 22:Hu(u,g),E&2048&&Lg(g.alternate,g);break;case 24:Hu(u,g),E&2048&&Dg(g.alternate,g);break;default:Hu(u,g)}o=o.sibling}}var Uu=8192;function cl(i,o,u){if(i.subtreeFlags&Uu)for(i=i.child;i!==null;)wT(i,o,u),i=i.sibling}function wT(i,o,u){switch(i.tag){case 26:cl(i,o,u),i.flags&Uu&&i.memoizedState!==null&&TM(u,ds,i.memoizedState,i.memoizedProps);break;case 5:cl(i,o,u);break;case 3:case 4:var g=ds;ds=Ef(i.stateNode.containerInfo),cl(i,o,u),ds=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=Uu,Uu=16777216,cl(i,o,u),Uu=g):cl(i,o,u));break;default:cl(i,o,u)}}function kT(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Fu(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var g=o[u];$n=g,_T(g,i)}kT(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)NT(i),i=i.sibling}function NT(i){switch(i.tag){case 0:case 11:case 15:Fu(i),i.flags&2048&&Bi(9,i,i.return);break;case 3:Fu(i);break;case 12:Fu(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,of(i)):Fu(i);break;default:Fu(i)}}function of(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var g=o[u];$n=g,_T(g,i)}kT(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Bi(8,o,o.return),of(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,of(o));break;default:of(o)}i=i.sibling}}function _T(i,o){for(;$n!==null;){var u=$n;switch(u.tag){case 0:case 11:case 15:Bi(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var g=u.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:wu(u.memoizedState.cache)}if(g=u.child,g!==null)g.return=u,$n=g;else e:for(u=i;$n!==null;){g=$n;var E=g.sibling,T=g.return;if(xT(g),g===u){$n=null;break e}if(E!==null){E.return=T,$n=E;break e}$n=T}}}var P6={getCacheForType:function(i){var o=Zn(_n),u=o.data.get(i);return u===void 0&&(u=i(),o.data.set(i,u)),u},cacheSignal:function(){return Zn(_n).controller.signal}},B6=typeof WeakMap=="function"?WeakMap:Map,Ft=0,tn=null,kt=null,It=0,Vt=0,zr=null,zi=!1,dl=!1,jg=!1,ii=0,yn=0,Hi=0,Fa=0,Pg=0,Hr=0,fl=0,$u=null,wr=null,Bg=!1,lf=0,AT=0,uf=1/0,cf=null,Ui=null,Pn=0,Fi=null,hl=null,ai=0,zg=0,Hg=null,RT=null,Vu=0,Ug=null;function Ur(){return(Ft&2)!==0&&It!==0?It&-It:B.T!==null?Gg():bn()}function OT(){if(Hr===0)if((It&536870912)===0||Dt){var i=Qt;Qt<<=1,(Qt&3932160)===0&&(Qt=262144),Hr=i}else Hr=536870912;return i=Pr.current,i!==null&&(i.flags|=32),Hr}function kr(i,o,u){(i===tn&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)&&(ml(i,0),$i(i,It,Hr,!1)),Et(i,u),((Ft&2)===0||i!==tn)&&(i===tn&&((Ft&2)===0&&(Fa|=u),yn===4&&$i(i,It,Hr,!1)),ws(i))}function IT(i,o,u){if((Ft&6)!==0)throw Error(r(327));var g=!u&&(o&127)===0&&(o&i.expiredLanes)===0||yt(i,o),E=g?U6(i,o):$g(i,o,!0),T=g;do{if(E===0){dl&&!g&&$i(i,o,0,!1);break}else{if(u=i.current.alternate,T&&!z6(u)){E=$g(i,o,!1),T=!1;continue}if(E===2){if(T=o,i.errorRecoveryDisabledLanes&T)var O=0;else O=i.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var H=i;E=$u;var se=H.current.memoizedState.isDehydrated;if(se&&(ml(H,O).flags|=256),O=$g(H,O,!1),O!==2){if(jg&&!se){H.errorRecoveryDisabledLanes|=T,Fa|=T,E=4;break e}T=wr,wr=E,T!==null&&(wr===null?wr=T:wr.push.apply(wr,T))}E=O}if(T=!1,E!==2)continue}}if(E===1){ml(i,0),$i(i,o,0,!0);break}e:{switch(g=i,T=E,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:$i(g,o,Hr,!zi);break e;case 2:wr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(E=lf+300-ie(),10<E)){if($i(g,o,Hr,!zi),Xe(g,0,!0)!==0)break e;ai=o,g.timeoutHandle=u2(MT.bind(null,g,u,wr,cf,Bg,o,Hr,Fa,fl,zi,T,"Throttled",-0,0),E);break e}MT(g,u,wr,cf,Bg,o,Hr,Fa,fl,zi,T,null,-0,0)}}break}while(!0);ws(i)}function MT(i,o,u,g,E,T,O,H,se,be,Ne,Ae,xe,Te){if(i.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qs},wT(o,T,Ae);var Ze=(T&62914560)===T?lf-ie():(T&4194048)===T?AT-ie():0;if(Ze=SM(Ae,Ze),Ze!==null){ai=T,i.cancelPendingCommit=Ze(UT.bind(null,i,o,T,u,g,E,O,H,se,Ne,Ae,null,xe,Te)),$i(i,T,O,!be);return}}UT(i,o,T,u,g,E,O,H,se)}function z6(i){for(var o=i;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var g=0;g<u.length;g++){var E=u[g],T=E.getSnapshot;E=E.value;try{if(!Dr(T(),E))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function $i(i,o,u,g){o&=~Pg,o&=~Fa,i.suspendedLanes|=o,i.pingedLanes&=~o,g&&(i.warmLanes|=o),g=i.expirationTimes;for(var E=o;0<E;){var T=31-qe(E),O=1<<T;g[T]=-1,E&=~O}u!==0&&Er(i,u,o)}function df(){return(Ft&6)===0?(qu(0),!1):!0}function Fg(){if(kt!==null){if(Vt===0)var i=kt.return;else i=kt,Xs=Ma=null,sg(i),sl=null,Nu=0,i=kt;for(;i!==null;)cT(i.alternate,i),i=i.return;kt=null}}function ml(i,o){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,iM(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),ai=0,Fg(),tn=i,kt=u=Gs(i.current,null),It=o,Vt=0,zr=null,zi=!1,dl=yt(i,o),jg=!1,fl=Hr=Pg=Fa=Hi=yn=0,wr=$u=null,Bg=!1,(o&8)!==0&&(o|=o&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=o;0<g;){var E=31-qe(g),T=1<<E;o|=i[E],g&=~T}return ii=o,Od(),u}function LT(i,o){bt=null,B.H=Du,o===rl||o===zd?(o=WE(),Vt=3):o===Yp?(o=WE(),Vt=4):Vt=o===Eg?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,zr=o,kt===null&&(yn=1,Jd(i,Zr(o,i.current)))}function DT(){var i=Pr.current;return i===null?!0:(It&4194048)===It?ns===null:(It&62914560)===It||(It&536870912)!==0?i===ns:!1}function jT(){var i=B.H;return B.H=Du,i===null?Du:i}function PT(){var i=B.A;return B.A=P6,i}function ff(){yn=4,zi||(It&4194048)!==It&&Pr.current!==null||(dl=!0),(Hi&134217727)===0&&(Fa&134217727)===0||tn===null||$i(tn,It,Hr,!1)}function $g(i,o,u){var g=Ft;Ft|=2;var E=jT(),T=PT();(tn!==i||It!==o)&&(cf=null,ml(i,o)),o=!1;var O=yn;e:do try{if(Vt!==0&&kt!==null){var H=kt,se=zr;switch(Vt){case 8:Fg(),O=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(o=!0);var be=Vt;if(Vt=0,zr=null,pl(i,H,se,be),u&&dl){O=0;break e}break;default:be=Vt,Vt=0,zr=null,pl(i,H,se,be)}}H6(),O=yn;break}catch(Ne){LT(i,Ne)}while(!0);return o&&i.shellSuspendCounter++,Xs=Ma=null,Ft=g,B.H=E,B.A=T,kt===null&&(tn=null,It=0,Od()),O}function H6(){for(;kt!==null;)BT(kt)}function U6(i,o){var u=Ft;Ft|=2;var g=jT(),E=PT();tn!==i||It!==o?(cf=null,uf=ie()+500,ml(i,o)):dl=yt(i,o);e:do try{if(Vt!==0&&kt!==null){o=kt;var T=zr;t:switch(Vt){case 1:Vt=0,zr=null,pl(i,o,T,1);break;case 2:case 9:if(KE(T)){Vt=0,zr=null,zT(o);break}o=function(){Vt!==2&&Vt!==9||tn!==i||(Vt=7),ws(i)},T.then(o,o);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:KE(T)?(Vt=0,zr=null,zT(o)):(Vt=0,zr=null,pl(i,o,T,7));break;case 5:var O=null;switch(kt.tag){case 26:O=kt.memoizedState;case 5:case 27:var H=kt;if(O?C2(O):H.stateNode.complete){Vt=0,zr=null;var se=H.sibling;if(se!==null)kt=se;else{var be=H.return;be!==null?(kt=be,hf(be)):kt=null}break t}}Vt=0,zr=null,pl(i,o,T,5);break;case 6:Vt=0,zr=null,pl(i,o,T,6);break;case 8:Fg(),yn=6;break e;default:throw Error(r(462))}}F6();break}catch(Ne){LT(i,Ne)}while(!0);return Xs=Ma=null,B.H=g,B.A=E,Ft=u,kt!==null?0:(tn=null,It=0,Od(),yn)}function F6(){for(;kt!==null&&!ee();)BT(kt)}function BT(i){var o=lT(i.alternate,i,ii);i.memoizedProps=i.pendingProps,o===null?hf(i):kt=o}function zT(i){var o=i,u=o.alternate;switch(o.tag){case 15:case 0:o=nT(u,o,o.pendingProps,o.type,void 0,It);break;case 11:o=nT(u,o,o.pendingProps,o.type.render,o.ref,It);break;case 5:sg(o);default:cT(u,o),o=kt=PE(o,ii),o=lT(u,o,ii)}i.memoizedProps=i.pendingProps,o===null?hf(i):kt=o}function pl(i,o,u,g){Xs=Ma=null,sg(o),sl=null,Nu=0;var E=o.return;try{if(R6(i,E,o,u,It)){yn=1,Jd(i,Zr(u,i.current)),kt=null;return}}catch(T){if(E!==null)throw kt=E,T;yn=1,Jd(i,Zr(u,i.current)),kt=null;return}o.flags&32768?(Dt||g===1?i=!0:dl||(It&536870912)!==0?i=!1:(zi=i=!0,(g===2||g===9||g===3||g===6)&&(g=Pr.current,g!==null&&g.tag===13&&(g.flags|=16384))),HT(o,i)):hf(o)}function hf(i){var o=i;do{if((o.flags&32768)!==0){HT(o,zi);return}i=o.return;var u=M6(o.alternate,o,ii);if(u!==null){kt=u;return}if(o=o.sibling,o!==null){kt=o;return}kt=o=i}while(o!==null);yn===0&&(yn=5)}function HT(i,o){do{var u=L6(i.alternate,i);if(u!==null){u.flags&=32767,kt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(i=i.sibling,i!==null)){kt=i;return}kt=i=u}while(i!==null);yn=6,kt=null}function UT(i,o,u,g,E,T,O,H,se){i.cancelPendingCommit=null;do mf();while(Pn!==0);if((Ft&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=Op,on(i,u,T,O,H,se),i===tn&&(kt=tn=null,It=0),hl=o,Fi=i,ai=u,zg=T,Hg=E,RT=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Y6(le,function(){return YT(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=B.T,B.T=null,E=G.p,G.p=2,O=Ft,Ft|=4;try{D6(i,o,u)}finally{Ft=O,G.p=E,B.T=g}}Pn=1,FT(),$T(),VT()}}function FT(){if(Pn===1){Pn=0;var i=Fi,o=hl,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var g=G.p;G.p=2;var E=Ft;Ft|=4;try{TT(o,i);var T=t0,O=_E(i.containerInfo),H=T.focusedElem,se=T.selectionRange;if(O!==H&&H&&H.ownerDocument&&NE(H.ownerDocument.documentElement,H)){if(se!==null&&kp(H)){var be=se.start,Ne=se.end;if(Ne===void 0&&(Ne=be),"selectionStart"in H)H.selectionStart=be,H.selectionEnd=Math.min(Ne,H.value.length);else{var Ae=H.ownerDocument||document,xe=Ae&&Ae.defaultView||window;if(xe.getSelection){var Te=xe.getSelection(),Ze=H.textContent.length,at=Math.min(se.start,Ze),Kt=se.end===void 0?at:Math.min(se.end,Ze);!Te.extend&&at>Kt&&(O=Kt,Kt=at,at=O);var he=kE(H,at),ue=kE(H,Kt);if(he&&ue&&(Te.rangeCount!==1||Te.anchorNode!==he.node||Te.anchorOffset!==he.offset||Te.focusNode!==ue.node||Te.focusOffset!==ue.offset)){var ge=Ae.createRange();ge.setStart(he.node,he.offset),Te.removeAllRanges(),at>Kt?(Te.addRange(ge),Te.extend(ue.node,ue.offset)):(ge.setEnd(ue.node,ue.offset),Te.addRange(ge))}}}}for(Ae=[],Te=H;Te=Te.parentNode;)Te.nodeType===1&&Ae.push({element:Te,left:Te.scrollLeft,top:Te.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<Ae.length;H++){var _e=Ae[H];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}kf=!!e0,t0=e0=null}finally{Ft=E,G.p=g,B.T=u}}i.current=o,Pn=2}}function $T(){if(Pn===2){Pn=0;var i=Fi,o=hl,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var g=G.p;G.p=2;var E=Ft;Ft|=4;try{bT(i,o.alternate,o)}finally{Ft=E,G.p=g,B.T=u}}Pn=3}}function VT(){if(Pn===4||Pn===3){Pn=0,me();var i=Fi,o=hl,u=ai,g=RT;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,hl=Fi=null,qT(i,i.pendingLanes));var E=i.pendingLanes;if(E===0&&(Ui=null),Ot(u),o=o.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(et,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=B.T,E=G.p,G.p=2,B.T=null;try{for(var T=i.onRecoverableError,O=0;O<g.length;O++){var H=g[O];T(H.value,{componentStack:H.stack})}}finally{B.T=o,G.p=E}}(ai&3)!==0&&mf(),ws(i),E=i.pendingLanes,(u&261930)!==0&&(E&42)!==0?i===Ug?Vu++:(Vu=0,Ug=i):Vu=0,qu(0)}}function qT(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,wu(o)))}function mf(){return FT(),$T(),VT(),YT()}function YT(){if(Pn!==5)return!1;var i=Fi,o=zg;zg=0;var u=Ot(ai),g=B.T,E=G.p;try{G.p=32>u?32:u,B.T=null,u=Hg,Hg=null;var T=Fi,O=ai;if(Pn=0,hl=Fi=null,ai=0,(Ft&6)!==0)throw Error(r(331));var H=Ft;if(Ft|=4,NT(T.current),CT(T,T.current,O,u),Ft=H,qu(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(et,T)}catch{}return!0}finally{G.p=E,B.T=g,qT(i,o)}}function GT(i,o,u){o=Zr(u,o),o=yg(i.stateNode,o,2),i=Di(i,o,2),i!==null&&(Et(i,2),ws(i))}function qt(i,o,u){if(i.tag===3)GT(i,i,u);else for(;o!==null;){if(o.tag===3){GT(o,i,u);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ui===null||!Ui.has(g))){i=Zr(u,i),u=Kv(2),g=Di(o,u,2),g!==null&&(Xv(u,g,o,i),Et(g,2),ws(g));break}}o=o.return}}function Vg(i,o,u){var g=i.pingCache;if(g===null){g=i.pingCache=new B6;var E=new Set;g.set(o,E)}else E=g.get(o),E===void 0&&(E=new Set,g.set(o,E));E.has(u)||(jg=!0,E.add(u),i=$6.bind(null,i,o,u),o.then(i,i))}function $6(i,o,u){var g=i.pingCache;g!==null&&g.delete(o),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,tn===i&&(It&u)===u&&(yn===4||yn===3&&(It&62914560)===It&&300>ie()-lf?(Ft&2)===0&&ml(i,0):Pg|=u,fl===It&&(fl=0)),ws(i)}function KT(i,o){o===0&&(o=Jt()),i=Ra(i,o),i!==null&&(Et(i,o),ws(i))}function V6(i){var o=i.memoizedState,u=0;o!==null&&(u=o.retryLane),KT(i,u)}function q6(i,o){var u=0;switch(i.tag){case 31:case 13:var g=i.stateNode,E=i.memoizedState;E!==null&&(u=E.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),KT(i,u)}function Y6(i,o){return Oe(i,o)}var pf=null,gl=null,qg=!1,gf=!1,Yg=!1,Vi=0;function ws(i){i!==gl&&i.next===null&&(gl===null?pf=gl=i:gl=gl.next=i),gf=!0,qg||(qg=!0,K6())}function qu(i,o){if(!Yg&&gf){Yg=!0;do for(var u=!1,g=pf;g!==null;){if(i!==0){var E=g.pendingLanes;if(E===0)var T=0;else{var O=g.suspendedLanes,H=g.pingedLanes;T=(1<<31-qe(42|i)+1)-1,T&=E&~(O&~H),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,ZT(g,T))}else T=It,T=Xe(g,g===tn?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(T&3)===0||yt(g,T)||(u=!0,ZT(g,T));g=g.next}while(u);Yg=!1}}function G6(){XT()}function XT(){gf=qg=!1;var i=0;Vi!==0&&sM()&&(i=Vi);for(var o=ie(),u=null,g=pf;g!==null;){var E=g.next,T=WT(g,o);T===0?(g.next=null,u===null?pf=E:u.next=E,E===null&&(gl=u)):(u=g,(i!==0||(T&3)!==0)&&(gf=!0)),g=E}Pn!==0&&Pn!==5||qu(i),Vi!==0&&(Vi=0)}function WT(i,o){for(var u=i.suspendedLanes,g=i.pingedLanes,E=i.expirationTimes,T=i.pendingLanes&-62914561;0<T;){var O=31-qe(T),H=1<<O,se=E[O];se===-1?((H&u)===0||(H&g)!==0)&&(E[O]=Ut(H,o)):se<=o&&(i.expiredLanes|=H),T&=~H}if(o=tn,u=It,u=Xe(i,i===o?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,u===0||i===o&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&je(g),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||yt(i,u)){if(o=u&-u,o===i.callbackPriority)return o;switch(g!==null&&je(g),Ot(u)){case 2:case 8:u=F;break;case 32:u=le;break;case 268435456:u=Re;break;default:u=le}return g=QT.bind(null,i),u=Oe(u,g),i.callbackPriority=o,i.callbackNode=u,o}return g!==null&&g!==null&&je(g),i.callbackPriority=2,i.callbackNode=null,2}function QT(i,o){if(Pn!==0&&Pn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(mf()&&i.callbackNode!==u)return null;var g=It;return g=Xe(i,i===tn?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(IT(i,g,o),WT(i,ie()),i.callbackNode!=null&&i.callbackNode===u?QT.bind(null,i):null)}function ZT(i,o){if(mf())return null;IT(i,o,!0)}function K6(){aM(function(){(Ft&6)!==0?Oe(Y,G6):XT()})}function Gg(){if(Vi===0){var i=tl;i===0&&(i=Lt,Lt<<=1,(Lt&261888)===0&&(Lt=256)),Vi=i}return Vi}function JT(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Sd(""+i)}function e2(i,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,i.id&&u.setAttribute("form",i.id),o.parentNode.insertBefore(u,o),i=new FormData(i),u.parentNode.removeChild(u),i}function X6(i,o,u,g,E){if(o==="submit"&&u&&u.stateNode===E){var T=JT((E[Wn]||null).action),O=g.submitter;O&&(o=(o=O[Wn]||null)?JT(o.formAction):O.getAttribute("formAction"),o!==null&&(T=o,O=null));var H=new Nd("action","action",null,g,E);i.push({event:H,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Vi!==0){var se=O?e2(E,O):new FormData(E);hg(u,{pending:!0,data:se,method:E.method,action:T},null,se)}}else typeof T=="function"&&(H.preventDefault(),se=O?e2(E,O):new FormData(E),hg(u,{pending:!0,data:se,method:E.method,action:T},T,se))},currentTarget:E}]})}}for(var Kg=0;Kg<Rp.length;Kg++){var Xg=Rp[Kg],W6=Xg.toLowerCase(),Q6=Xg[0].toUpperCase()+Xg.slice(1);cs(W6,"on"+Q6)}cs(OE,"onAnimationEnd"),cs(IE,"onAnimationIteration"),cs(ME,"onAnimationStart"),cs("dblclick","onDoubleClick"),cs("focusin","onFocus"),cs("focusout","onBlur"),cs(h6,"onTransitionRun"),cs(m6,"onTransitionStart"),cs(p6,"onTransitionCancel"),cs(LE,"onTransitionEnd"),Uo("onMouseEnter",["mouseout","mouseover"]),Uo("onMouseLeave",["mouseout","mouseover"]),Uo("onPointerEnter",["pointerout","pointerover"]),Uo("onPointerLeave",["pointerout","pointerover"]),ka("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ka("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ka("onBeforeInput",["compositionend","keypress","textInput","paste"]),ka("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ka("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ka("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Z6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function t2(i,o){o=(o&4)!==0;for(var u=0;u<i.length;u++){var g=i[u],E=g.event;g=g.listeners;e:{var T=void 0;if(o)for(var O=g.length-1;0<=O;O--){var H=g[O],se=H.instance,be=H.currentTarget;if(H=H.listener,se!==T&&E.isPropagationStopped())break e;T=H,E.currentTarget=be;try{T(E)}catch(Ne){Rd(Ne)}E.currentTarget=null,T=se}else for(O=0;O<g.length;O++){if(H=g[O],se=H.instance,be=H.currentTarget,H=H.listener,se!==T&&E.isPropagationStopped())break e;T=H,E.currentTarget=be;try{T(E)}catch(Ne){Rd(Ne)}E.currentTarget=null,T=se}}}}function Nt(i,o){var u=o[du];u===void 0&&(u=o[du]=new Set);var g=i+"__bubble";u.has(g)||(n2(o,i,2,!1),u.add(g))}function Wg(i,o,u){var g=0;o&&(g|=4),n2(u,i,g,o)}var bf="_reactListening"+Math.random().toString(36).slice(2);function Qg(i){if(!i[bf]){i[bf]=!0,Xy.forEach(function(u){u!=="selectionchange"&&(Z6.has(u)||Wg(u,!1,i),Wg(u,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[bf]||(o[bf]=!0,Wg("selectionchange",!1,o))}}function n2(i,o,u,g){switch(O2(o)){case 2:var E=kM;break;case 8:E=NM;break;default:E=f0}u=E.bind(null,o,u,i),E=void 0,!bp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),g?E!==void 0?i.addEventListener(o,u,{capture:!0,passive:E}):i.addEventListener(o,u,!0):E!==void 0?i.addEventListener(o,u,{passive:E}):i.addEventListener(o,u,!1)}function Zg(i,o,u,g,E){var T=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var H=g.stateNode.containerInfo;if(H===E)break;if(O===4)for(O=g.return;O!==null;){var se=O.tag;if((se===3||se===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;H!==null;){if(O=Bo(H),O===null)return;if(se=O.tag,se===5||se===6||se===26||se===27){g=T=O;continue e}H=H.parentNode}}g=g.return}oE(function(){var be=T,Ne=pp(u),Ae=[];e:{var xe=DE.get(i);if(xe!==void 0){var Te=Nd,Ze=i;switch(i){case"keypress":if(wd(u)===0)break e;case"keydown":case"keyup":Te=qI;break;case"focusin":Ze="focus",Te=vp;break;case"focusout":Ze="blur",Te=vp;break;case"beforeblur":case"afterblur":Te=vp;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=cE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=MI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=KI;break;case OE:case IE:case ME:Te=jI;break;case LE:Te=WI;break;case"scroll":case"scrollend":Te=OI;break;case"wheel":Te=ZI;break;case"copy":case"cut":case"paste":Te=BI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=fE;break;case"toggle":case"beforetoggle":Te=e6}var at=(o&4)!==0,Kt=!at&&(i==="scroll"||i==="scrollend"),he=at?xe!==null?xe+"Capture":null:xe;at=[];for(var ue=be,ge;ue!==null;){var _e=ue;if(ge=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||ge===null||he===null||(_e=mu(ue,he),_e!=null&&at.push(Gu(ue,_e,ge))),Kt)break;ue=ue.return}0<at.length&&(xe=new Te(xe,Ze,null,u,Ne),Ae.push({event:xe,listeners:at}))}}if((o&7)===0){e:{if(xe=i==="mouseover"||i==="pointerover",Te=i==="mouseout"||i==="pointerout",xe&&u!==mp&&(Ze=u.relatedTarget||u.fromElement)&&(Bo(Ze)||Ze[vs]))break e;if((Te||xe)&&(xe=Ne.window===Ne?Ne:(xe=Ne.ownerDocument)?xe.defaultView||xe.parentWindow:window,Te?(Ze=u.relatedTarget||u.toElement,Te=be,Ze=Ze?Bo(Ze):null,Ze!==null&&(Kt=a(Ze),at=Ze.tag,Ze!==Kt||at!==5&&at!==27&&at!==6)&&(Ze=null)):(Te=null,Ze=be),Te!==Ze)){if(at=cE,_e="onMouseLeave",he="onMouseEnter",ue="mouse",(i==="pointerout"||i==="pointerover")&&(at=fE,_e="onPointerLeave",he="onPointerEnter",ue="pointer"),Kt=Te==null?xe:hu(Te),ge=Ze==null?xe:hu(Ze),xe=new at(_e,ue+"leave",Te,u,Ne),xe.target=Kt,xe.relatedTarget=ge,_e=null,Bo(Ne)===be&&(at=new at(he,ue+"enter",Ze,u,Ne),at.target=ge,at.relatedTarget=Kt,_e=at),Kt=_e,Te&&Ze)t:{for(at=J6,he=Te,ue=Ze,ge=0,_e=he;_e;_e=at(_e))ge++;_e=0;for(var st=ue;st;st=at(st))_e++;for(;0<ge-_e;)he=at(he),ge--;for(;0<_e-ge;)ue=at(ue),_e--;for(;ge--;){if(he===ue||ue!==null&&he===ue.alternate){at=he;break t}he=at(he),ue=at(ue)}at=null}else at=null;Te!==null&&r2(Ae,xe,Te,at,!1),Ze!==null&&Kt!==null&&r2(Ae,Kt,Ze,at,!0)}}e:{if(xe=be?hu(be):window,Te=xe.nodeName&&xe.nodeName.toLowerCase(),Te==="select"||Te==="input"&&xe.type==="file")var zt=EE;else if(xE(xe))if(vE)zt=c6;else{zt=l6;var Je=o6}else Te=xe.nodeName,!Te||Te.toLowerCase()!=="input"||xe.type!=="checkbox"&&xe.type!=="radio"?be&&hp(be.elementType)&&(zt=EE):zt=u6;if(zt&&(zt=zt(i,be))){yE(Ae,zt,u,Ne);break e}Je&&Je(i,xe,be),i==="focusout"&&be&&xe.type==="number"&&be.memoizedProps.value!=null&&fp(xe,"number",xe.value)}switch(Je=be?hu(be):window,i){case"focusin":(xE(Je)||Je.contentEditable==="true")&&(Go=Je,Np=be,Tu=null);break;case"focusout":Tu=Np=Go=null;break;case"mousedown":_p=!0;break;case"contextmenu":case"mouseup":case"dragend":_p=!1,AE(Ae,u,Ne);break;case"selectionchange":if(f6)break;case"keydown":case"keyup":AE(Ae,u,Ne)}var xt;if(Sp)e:{switch(i){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Yo?gE(i,u)&&(Mt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Mt="onCompositionStart");Mt&&(hE&&u.locale!=="ko"&&(Yo||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Yo&&(xt=lE()):(_i=Ne,xp="value"in _i?_i.value:_i.textContent,Yo=!0)),Je=xf(be,Mt),0<Je.length&&(Mt=new dE(Mt,i,null,u,Ne),Ae.push({event:Mt,listeners:Je}),xt?Mt.data=xt:(xt=bE(u),xt!==null&&(Mt.data=xt)))),(xt=n6?r6(i,u):s6(i,u))&&(Mt=xf(be,"onBeforeInput"),0<Mt.length&&(Je=new dE("onBeforeInput","beforeinput",null,u,Ne),Ae.push({event:Je,listeners:Mt}),Je.data=xt)),X6(Ae,i,be,u,Ne)}t2(Ae,o)})}function Gu(i,o,u){return{instance:i,listener:o,currentTarget:u}}function xf(i,o){for(var u=o+"Capture",g=[];i!==null;){var E=i,T=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||T===null||(E=mu(i,u),E!=null&&g.unshift(Gu(i,E,T)),E=mu(i,o),E!=null&&g.push(Gu(i,E,T))),i.tag===3)return g;i=i.return}return[]}function J6(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function r2(i,o,u,g,E){for(var T=o._reactName,O=[];u!==null&&u!==g;){var H=u,se=H.alternate,be=H.stateNode;if(H=H.tag,se!==null&&se===g)break;H!==5&&H!==26&&H!==27||be===null||(se=be,E?(be=mu(u,T),be!=null&&O.unshift(Gu(u,be,se))):E||(be=mu(u,T),be!=null&&O.push(Gu(u,be,se)))),u=u.return}O.length!==0&&i.push({event:o,listeners:O})}var eM=/\r\n?/g,tM=/\u0000|\uFFFD/g;function s2(i){return(typeof i=="string"?i:""+i).replace(eM,`
50
+ `).replace(tM,"")}function i2(i,o){return o=s2(o),s2(i)===o}function Gt(i,o,u,g,E,T){switch(u){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||$o(i,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&$o(i,""+g);break;case"className":vd(i,"class",g);break;case"tabIndex":vd(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":vd(i,u,g);break;case"style":iE(i,g,T);break;case"data":if(o!=="object"){vd(i,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||u!=="href")){i.removeAttribute(u);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Sd(""+g),i.setAttribute(u,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof T=="function"&&(u==="formAction"?(o!=="input"&&Gt(i,o,"name",E.name,E,null),Gt(i,o,"formEncType",E.formEncType,E,null),Gt(i,o,"formMethod",E.formMethod,E,null),Gt(i,o,"formTarget",E.formTarget,E,null)):(Gt(i,o,"encType",E.encType,E,null),Gt(i,o,"method",E.method,E,null),Gt(i,o,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Sd(""+g),i.setAttribute(u,g);break;case"onClick":g!=null&&(i.onclick=qs);break;case"onScroll":g!=null&&Nt("scroll",i);break;case"onScrollEnd":g!=null&&Nt("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(u=g.__html,u!=null){if(E.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}u=Sd(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""+g):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":g===!0?i.setAttribute(u,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,g):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(u,g):i.removeAttribute(u);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(u):i.setAttribute(u,g);break;case"popover":Nt("beforetoggle",i),Nt("toggle",i),Ed(i,"popover",g);break;case"xlinkActuate":Vs(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Vs(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Vs(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Vs(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Vs(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Vs(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Vs(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Vs(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Vs(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Ed(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=AI.get(u)||u,Ed(i,u,g))}}function Jg(i,o,u,g,E,T){switch(u){case"style":iE(i,g,T);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(u=g.__html,u!=null){if(E.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof g=="string"?$o(i,g):(typeof g=="number"||typeof g=="bigint")&&$o(i,""+g);break;case"onScroll":g!=null&&Nt("scroll",i);break;case"onScrollEnd":g!=null&&Nt("scrollend",i);break;case"onClick":g!=null&&(i.onclick=qs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wy.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(E=u.endsWith("Capture"),o=u.slice(2,E?u.length-7:void 0),T=i[Wn]||null,T=T!=null?T[u]:null,typeof T=="function"&&i.removeEventListener(o,T,E),typeof g=="function")){typeof T!="function"&&T!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(o,g,E);break e}u in i?i[u]=g:g===!0?i.setAttribute(u,""):Ed(i,u,g)}}}function er(i,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",i),Nt("load",i);var g=!1,E=!1,T;for(T in u)if(u.hasOwnProperty(T)){var O=u[T];if(O!=null)switch(T){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(i,o,T,O,u,null)}}E&&Gt(i,o,"srcSet",u.srcSet,u,null),g&&Gt(i,o,"src",u.src,u,null);return;case"input":Nt("invalid",i);var H=T=O=E=null,se=null,be=null;for(g in u)if(u.hasOwnProperty(g)){var Ne=u[g];if(Ne!=null)switch(g){case"name":E=Ne;break;case"type":O=Ne;break;case"checked":se=Ne;break;case"defaultChecked":be=Ne;break;case"value":T=Ne;break;case"defaultValue":H=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,o));break;default:Gt(i,o,g,Ne,u,null)}}tE(i,T,H,se,be,O,E,!1);return;case"select":Nt("invalid",i),g=O=T=null;for(E in u)if(u.hasOwnProperty(E)&&(H=u[E],H!=null))switch(E){case"value":T=H;break;case"defaultValue":O=H;break;case"multiple":g=H;default:Gt(i,o,E,H,u,null)}o=T,u=O,i.multiple=!!g,o!=null?Fo(i,!!g,o,!1):u!=null&&Fo(i,!!g,u,!0);return;case"textarea":Nt("invalid",i),T=E=g=null;for(O in u)if(u.hasOwnProperty(O)&&(H=u[O],H!=null))switch(O){case"value":g=H;break;case"defaultValue":E=H;break;case"children":T=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(91));break;default:Gt(i,o,O,H,u,null)}rE(i,g,E,T);return;case"option":for(se in u)if(u.hasOwnProperty(se)&&(g=u[se],g!=null))switch(se){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Gt(i,o,se,g,u,null)}return;case"dialog":Nt("beforetoggle",i),Nt("toggle",i),Nt("cancel",i),Nt("close",i);break;case"iframe":case"object":Nt("load",i);break;case"video":case"audio":for(g=0;g<Yu.length;g++)Nt(Yu[g],i);break;case"image":Nt("error",i),Nt("load",i);break;case"details":Nt("toggle",i);break;case"embed":case"source":case"link":Nt("error",i),Nt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(be in u)if(u.hasOwnProperty(be)&&(g=u[be],g!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Gt(i,o,be,g,u,null)}return;default:if(hp(o)){for(Ne in u)u.hasOwnProperty(Ne)&&(g=u[Ne],g!==void 0&&Jg(i,o,Ne,g,u,void 0));return}}for(H in u)u.hasOwnProperty(H)&&(g=u[H],g!=null&&Gt(i,o,H,g,u,null))}function nM(i,o,u,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,T=null,O=null,H=null,se=null,be=null,Ne=null;for(Te in u){var Ae=u[Te];if(u.hasOwnProperty(Te)&&Ae!=null)switch(Te){case"checked":break;case"value":break;case"defaultValue":se=Ae;default:g.hasOwnProperty(Te)||Gt(i,o,Te,null,g,Ae)}}for(var xe in g){var Te=g[xe];if(Ae=u[xe],g.hasOwnProperty(xe)&&(Te!=null||Ae!=null))switch(xe){case"type":T=Te;break;case"name":E=Te;break;case"checked":be=Te;break;case"defaultChecked":Ne=Te;break;case"value":O=Te;break;case"defaultValue":H=Te;break;case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(r(137,o));break;default:Te!==Ae&&Gt(i,o,xe,Te,g,Ae)}}dp(i,O,H,se,be,Ne,T,E);return;case"select":Te=O=H=xe=null;for(T in u)if(se=u[T],u.hasOwnProperty(T)&&se!=null)switch(T){case"value":break;case"multiple":Te=se;default:g.hasOwnProperty(T)||Gt(i,o,T,null,g,se)}for(E in g)if(T=g[E],se=u[E],g.hasOwnProperty(E)&&(T!=null||se!=null))switch(E){case"value":xe=T;break;case"defaultValue":H=T;break;case"multiple":O=T;default:T!==se&&Gt(i,o,E,T,g,se)}o=H,u=O,g=Te,xe!=null?Fo(i,!!u,xe,!1):!!g!=!!u&&(o!=null?Fo(i,!!u,o,!0):Fo(i,!!u,u?[]:"",!1));return;case"textarea":Te=xe=null;for(H in u)if(E=u[H],u.hasOwnProperty(H)&&E!=null&&!g.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Gt(i,o,H,null,g,E)}for(O in g)if(E=g[O],T=u[O],g.hasOwnProperty(O)&&(E!=null||T!=null))switch(O){case"value":xe=E;break;case"defaultValue":Te=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==T&&Gt(i,o,O,E,g,T)}nE(i,xe,Te);return;case"option":for(var Ze in u)if(xe=u[Ze],u.hasOwnProperty(Ze)&&xe!=null&&!g.hasOwnProperty(Ze))switch(Ze){case"selected":i.selected=!1;break;default:Gt(i,o,Ze,null,g,xe)}for(se in g)if(xe=g[se],Te=u[se],g.hasOwnProperty(se)&&xe!==Te&&(xe!=null||Te!=null))switch(se){case"selected":i.selected=xe&&typeof xe!="function"&&typeof xe!="symbol";break;default:Gt(i,o,se,xe,g,Te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in u)xe=u[at],u.hasOwnProperty(at)&&xe!=null&&!g.hasOwnProperty(at)&&Gt(i,o,at,null,g,xe);for(be in g)if(xe=g[be],Te=u[be],g.hasOwnProperty(be)&&xe!==Te&&(xe!=null||Te!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,o));break;default:Gt(i,o,be,xe,g,Te)}return;default:if(hp(o)){for(var Kt in u)xe=u[Kt],u.hasOwnProperty(Kt)&&xe!==void 0&&!g.hasOwnProperty(Kt)&&Jg(i,o,Kt,void 0,g,xe);for(Ne in g)xe=g[Ne],Te=u[Ne],!g.hasOwnProperty(Ne)||xe===Te||xe===void 0&&Te===void 0||Jg(i,o,Ne,xe,g,Te);return}}for(var he in u)xe=u[he],u.hasOwnProperty(he)&&xe!=null&&!g.hasOwnProperty(he)&&Gt(i,o,he,null,g,xe);for(Ae in g)xe=g[Ae],Te=u[Ae],!g.hasOwnProperty(Ae)||xe===Te||xe==null&&Te==null||Gt(i,o,Ae,xe,g,Te)}function a2(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rM(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,u=performance.getEntriesByType("resource"),g=0;g<u.length;g++){var E=u[g],T=E.transferSize,O=E.initiatorType,H=E.duration;if(T&&H&&a2(O)){for(O=0,H=E.responseEnd,g+=1;g<u.length;g++){var se=u[g],be=se.startTime;if(be>H)break;var Ne=se.transferSize,Ae=se.initiatorType;Ne&&a2(Ae)&&(se=se.responseEnd,O+=Ne*(se<H?1:(H-be)/(se-be)))}if(--g,o+=8*(T+O)/(E.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var e0=null,t0=null;function yf(i){return i.nodeType===9?i:i.ownerDocument}function o2(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function l2(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function n0(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var r0=null;function sM(){var i=window.event;return i&&i.type==="popstate"?i===r0?!1:(r0=i,!0):(r0=null,!1)}var u2=typeof setTimeout=="function"?setTimeout:void 0,iM=typeof clearTimeout=="function"?clearTimeout:void 0,c2=typeof Promise=="function"?Promise:void 0,aM=typeof queueMicrotask=="function"?queueMicrotask:typeof c2<"u"?function(i){return c2.resolve(null).then(i).catch(oM)}:u2;function oM(i){setTimeout(function(){throw i})}function qi(i){return i==="head"}function d2(i,o){var u=o,g=0;do{var E=u.nextSibling;if(i.removeChild(u),E&&E.nodeType===8)if(u=E.data,u==="/$"||u==="/&"){if(g===0){i.removeChild(E),El(o);return}g--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")g++;else if(u==="html")Ku(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Ku(u);for(var T=u.firstChild;T;){var O=T.nextSibling,H=T.nodeName;T[fu]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=O}}else u==="body"&&Ku(i.ownerDocument.body);u=E}while(u);El(o)}function f2(i,o){var u=i;i=0;do{var g=u.nextSibling;if(u.nodeType===1?o?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(o?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=g}while(u)}function s0(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":s0(u),up(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function lM(i,o,u,g){for(;i.nodeType===1;){var E=u;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[fu])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(T=i.getAttribute("rel"),T==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(T!==E.rel||i.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||i.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||i.getAttribute("title")!==(E.title==null?null:E.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(T=i.getAttribute("src"),(T!==(E.src==null?null:E.src)||i.getAttribute("type")!==(E.type==null?null:E.type)||i.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&T&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var T=E.name==null?null:""+E.name;if(E.type==="hidden"&&i.getAttribute("name")===T)return i}else return i;if(i=rs(i.nextSibling),i===null)break}return null}function uM(i,o,u){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=rs(i.nextSibling),i===null))return null;return i}function h2(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=rs(i.nextSibling),i===null))return null;return i}function i0(i){return i.data==="$?"||i.data==="$~"}function a0(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function cM(i,o){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||u.readyState!=="loading")o();else{var g=function(){o(),u.removeEventListener("DOMContentLoaded",g)};u.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function rs(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var o0=null;function m2(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(o===0)return rs(i.nextSibling);o--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||o++}i=i.nextSibling}return null}function p2(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(o===0)return i;o--}else u!=="/$"&&u!=="/&"||o++}i=i.previousSibling}return null}function g2(i,o,u){switch(o=yf(u),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Ku(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);up(i)}var ss=new Map,b2=new Set;function Ef(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var oi=G.d;G.d={f:dM,r:fM,D:hM,C:mM,L:pM,m:gM,X:xM,S:bM,M:yM};function dM(){var i=oi.f(),o=df();return i||o}function fM(i){var o=zo(i);o!==null&&o.tag===5&&o.type==="form"?Lv(o):oi.r(i)}var bl=typeof document>"u"?null:document;function x2(i,o,u){var g=bl;if(g&&typeof o=="string"&&o){var E=Wr(o);E='link[rel="'+i+'"][href="'+E+'"]',typeof u=="string"&&(E+='[crossorigin="'+u+'"]'),b2.has(E)||(b2.add(E),i={rel:i,crossOrigin:u,href:o},g.querySelector(E)===null&&(o=g.createElement("link"),er(o,"link",i),Fn(o),g.head.appendChild(o)))}}function hM(i){oi.D(i),x2("dns-prefetch",i,null)}function mM(i,o){oi.C(i,o),x2("preconnect",i,o)}function pM(i,o,u){oi.L(i,o,u);var g=bl;if(g&&i&&o){var E='link[rel="preload"][as="'+Wr(o)+'"]';o==="image"&&u&&u.imageSrcSet?(E+='[imagesrcset="'+Wr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(E+='[imagesizes="'+Wr(u.imageSizes)+'"]')):E+='[href="'+Wr(i)+'"]';var T=E;switch(o){case"style":T=xl(i);break;case"script":T=yl(i)}ss.has(T)||(i=m({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:i,as:o},u),ss.set(T,i),g.querySelector(E)!==null||o==="style"&&g.querySelector(Xu(T))||o==="script"&&g.querySelector(Wu(T))||(o=g.createElement("link"),er(o,"link",i),Fn(o),g.head.appendChild(o)))}}function gM(i,o){oi.m(i,o);var u=bl;if(u&&i){var g=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Wr(g)+'"][href="'+Wr(i)+'"]',T=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=yl(i)}if(!ss.has(T)&&(i=m({rel:"modulepreload",href:i},o),ss.set(T,i),u.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Wu(T)))return}g=u.createElement("link"),er(g,"link",i),Fn(g),u.head.appendChild(g)}}}function bM(i,o,u){oi.S(i,o,u);var g=bl;if(g&&i){var E=Ho(g).hoistableStyles,T=xl(i);o=o||"default";var O=E.get(T);if(!O){var H={loading:0,preload:null};if(O=g.querySelector(Xu(T)))H.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},u),(u=ss.get(T))&&l0(i,u);var se=O=g.createElement("link");Fn(se),er(se,"link",i),se._p=new Promise(function(be,Ne){se.onload=be,se.onerror=Ne}),se.addEventListener("load",function(){H.loading|=1}),se.addEventListener("error",function(){H.loading|=2}),H.loading|=4,vf(O,o,g)}O={type:"stylesheet",instance:O,count:1,state:H},E.set(T,O)}}}function xM(i,o){oi.X(i,o);var u=bl;if(u&&i){var g=Ho(u).hoistableScripts,E=yl(i),T=g.get(E);T||(T=u.querySelector(Wu(E)),T||(i=m({src:i,async:!0},o),(o=ss.get(E))&&u0(i,o),T=u.createElement("script"),Fn(T),er(T,"link",i),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(E,T))}}function yM(i,o){oi.M(i,o);var u=bl;if(u&&i){var g=Ho(u).hoistableScripts,E=yl(i),T=g.get(E);T||(T=u.querySelector(Wu(E)),T||(i=m({src:i,async:!0,type:"module"},o),(o=ss.get(E))&&u0(i,o),T=u.createElement("script"),Fn(T),er(T,"link",i),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(E,T))}}function y2(i,o,u,g){var E=(E=ce.current)?Ef(E):null;if(!E)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=xl(u.href),u=Ho(E).hoistableStyles,g=u.get(o),g||(g={type:"style",instance:null,count:0,state:null},u.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=xl(u.href);var T=Ho(E).hoistableStyles,O=T.get(i);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,O),(T=E.querySelector(Xu(i)))&&!T._p&&(O.instance=T,O.state.loading=5),ss.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ss.set(i,u),T||EM(E,i,u,O.state))),o&&g===null)throw Error(r(528,""));return O}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=yl(u),u=Ho(E).hoistableScripts,g=u.get(o),g||(g={type:"script",instance:null,count:0,state:null},u.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function xl(i){return'href="'+Wr(i)+'"'}function Xu(i){return'link[rel="stylesheet"]['+i+"]"}function E2(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function EM(i,o,u,g){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=i.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),er(o,"link",u),Fn(o),i.head.appendChild(o))}function yl(i){return'[src="'+Wr(i)+'"]'}function Wu(i){return"script[async]"+i}function v2(i,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var g=i.querySelector('style[data-href~="'+Wr(u.href)+'"]');if(g)return o.instance=g,Fn(g),g;var E=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Fn(g),er(g,"style",E),vf(g,u.precedence,i),o.instance=g;case"stylesheet":E=xl(u.href);var T=i.querySelector(Xu(E));if(T)return o.state.loading|=4,o.instance=T,Fn(T),T;g=E2(u),(E=ss.get(E))&&l0(g,E),T=(i.ownerDocument||i).createElement("link"),Fn(T);var O=T;return O._p=new Promise(function(H,se){O.onload=H,O.onerror=se}),er(T,"link",g),o.state.loading|=4,vf(T,u.precedence,i),o.instance=T;case"script":return T=yl(u.src),(E=i.querySelector(Wu(T)))?(o.instance=E,Fn(E),E):(g=u,(E=ss.get(T))&&(g=m({},u),u0(g,E)),i=i.ownerDocument||i,E=i.createElement("script"),Fn(E),er(E,"link",g),i.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,vf(g,u.precedence,i));return o.instance}function vf(i,o,u){for(var g=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,T=E,O=0;O<g.length;O++){var H=g[O];if(H.dataset.precedence===o)T=H;else if(T!==E)break}T?T.parentNode.insertBefore(i,T.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(i,o.firstChild))}function l0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function u0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Tf=null;function T2(i,o,u){if(Tf===null){var g=new Map,E=Tf=new Map;E.set(u,g)}else E=Tf,g=E.get(u),g||(g=new Map,E.set(u,g));if(g.has(i))return g;for(g.set(i,null),u=u.getElementsByTagName(i),E=0;E<u.length;E++){var T=u[E];if(!(T[fu]||T[en]||i==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var O=T.getAttribute(o)||"";O=i+O;var H=g.get(O);H?H.push(T):g.set(O,[T])}}return g}function S2(i,o,u){i=i.ownerDocument||i,i.head.insertBefore(u,o==="title"?i.querySelector("head > title"):null)}function vM(i,o,u){if(u===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function C2(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function TM(i,o,u,g){if(u.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var E=xl(g.href),T=o.querySelector(Xu(E));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=Sf.bind(i),o.then(i,i)),u.state.loading|=4,u.instance=T,Fn(T);return}T=o.ownerDocument||o,g=E2(g),(E=ss.get(E))&&l0(g,E),T=T.createElement("link"),Fn(T);var O=T;O._p=new Promise(function(H,se){O.onload=H,O.onerror=se}),er(T,"link",g),u.instance=T}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Sf.bind(i),o.addEventListener("load",u),o.addEventListener("error",u))}}var c0=0;function SM(i,o){return i.stylesheets&&i.count===0&&wf(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var g=setTimeout(function(){if(i.stylesheets&&wf(i,i.stylesheets),i.unsuspend){var T=i.unsuspend;i.unsuspend=null,T()}},6e4+o);0<i.imgBytes&&c0===0&&(c0=62500*rM());var E=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&wf(i,i.stylesheets),i.unsuspend)){var T=i.unsuspend;i.unsuspend=null,T()}},(i.imgBytes>c0?50:800)+o);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Sf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Cf=null;function wf(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Cf=new Map,o.forEach(CM,i),Cf=null,Sf.call(i))}function CM(i,o){if(!(o.state.loading&4)){var u=Cf.get(i);if(u)var g=u.get(null);else{u=new Map,Cf.set(i,u);for(var E=i.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<E.length;T++){var O=E[T];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),g=O)}g&&u.set(null,g)}E=o.instance,O=E.getAttribute("data-precedence"),T=u.get(O)||g,T===g&&u.set(null,E),u.set(O,E),this.count++,g=Sf.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),T?T.parentNode.insertBefore(E,T.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(E,i.firstChild)),o.state.loading|=4}}var Qu={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function wM(i,o,u,g,E,T,O,H,se){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=T,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function w2(i,o,u,g,E,T,O,H,se,be,Ne,Ae){return i=new wM(i,o,u,O,se,be,Ne,Ae,H),o=1,T===!0&&(o|=24),T=jr(3,null,null,o),i.current=T,T.stateNode=i,o=$p(),o.refCount++,i.pooledCache=o,o.refCount++,T.memoizedState={element:g,isDehydrated:u,cache:o},Gp(T),i}function k2(i){return i?(i=Wo,i):Wo}function N2(i,o,u,g,E,T){E=k2(E),g.context===null?g.context=E:g.pendingContext=E,g=Li(o),g.payload={element:u},T=T===void 0?null:T,T!==null&&(g.callback=T),u=Di(i,g,o),u!==null&&(kr(u,i,o),Au(u,i,o))}function _2(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<o?u:o}}function d0(i,o){_2(i,o),(i=i.alternate)&&_2(i,o)}function A2(i){if(i.tag===13||i.tag===31){var o=Ra(i,67108864);o!==null&&kr(o,i,67108864),d0(i,67108864)}}function R2(i){if(i.tag===13||i.tag===31){var o=Ur();o=ht(o);var u=Ra(i,o);u!==null&&kr(u,i,o),d0(i,o)}}var kf=!0;function kM(i,o,u,g){var E=B.T;B.T=null;var T=G.p;try{G.p=2,f0(i,o,u,g)}finally{G.p=T,B.T=E}}function NM(i,o,u,g){var E=B.T;B.T=null;var T=G.p;try{G.p=8,f0(i,o,u,g)}finally{G.p=T,B.T=E}}function f0(i,o,u,g){if(kf){var E=h0(g);if(E===null)Zg(i,o,g,Nf,u),I2(i,g);else if(AM(E,i,o,u,g))g.stopPropagation();else if(I2(i,g),o&4&&-1<_M.indexOf(i)){for(;E!==null;){var T=zo(E);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var O=Zt(T.pendingLanes);if(O!==0){var H=T;for(H.pendingLanes|=2,H.entangledLanes|=2;O;){var se=1<<31-qe(O);H.entanglements[1]|=se,O&=~se}ws(T),(Ft&6)===0&&(uf=ie()+500,qu(0))}}break;case 31:case 13:H=Ra(T,2),H!==null&&kr(H,T,2),df(),d0(T,2)}if(T=h0(g),T===null&&Zg(i,o,g,Nf,u),T===E)break;E=T}E!==null&&g.stopPropagation()}else Zg(i,o,g,null,u)}}function h0(i){return i=pp(i),m0(i)}var Nf=null;function m0(i){if(Nf=null,i=Bo(i),i!==null){var o=a(i);if(o===null)i=null;else{var u=o.tag;if(u===13){if(i=l(o),i!==null)return i;i=null}else if(u===31){if(i=c(o),i!==null)return i;i=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Nf=i,null}function O2(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Q()){case Y:return 2;case F:return 8;case le:case Ce:return 32;case Re:return 268435456;default:return 32}default:return 32}}var p0=!1,Yi=null,Gi=null,Ki=null,Zu=new Map,Ju=new Map,Xi=[],_M="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function I2(i,o){switch(i){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Gi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":Zu.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ju.delete(o.pointerId)}}function ec(i,o,u,g,E,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:u,eventSystemFlags:g,nativeEvent:T,targetContainers:[E]},o!==null&&(o=zo(o),o!==null&&A2(o)),i):(i.eventSystemFlags|=g,o=i.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),i)}function AM(i,o,u,g,E){switch(o){case"focusin":return Yi=ec(Yi,i,o,u,g,E),!0;case"dragenter":return Gi=ec(Gi,i,o,u,g,E),!0;case"mouseover":return Ki=ec(Ki,i,o,u,g,E),!0;case"pointerover":var T=E.pointerId;return Zu.set(T,ec(Zu.get(T)||null,i,o,u,g,E)),!0;case"gotpointercapture":return T=E.pointerId,Ju.set(T,ec(Ju.get(T)||null,i,o,u,g,E)),!0}return!1}function M2(i){var o=Bo(i.target);if(o!==null){var u=a(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){i.blockedOn=o,Un(i.priority,function(){R2(u)});return}}else if(o===31){if(o=c(u),o!==null){i.blockedOn=o,Un(i.priority,function(){R2(u)});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function _f(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var u=h0(i.nativeEvent);if(u===null){u=i.nativeEvent;var g=new u.constructor(u.type,u);mp=g,u.target.dispatchEvent(g),mp=null}else return o=zo(u),o!==null&&A2(o),i.blockedOn=u,!1;o.shift()}return!0}function L2(i,o,u){_f(i)&&u.delete(o)}function RM(){p0=!1,Yi!==null&&_f(Yi)&&(Yi=null),Gi!==null&&_f(Gi)&&(Gi=null),Ki!==null&&_f(Ki)&&(Ki=null),Zu.forEach(L2),Ju.forEach(L2)}function Af(i,o){i.blockedOn===o&&(i.blockedOn=null,p0||(p0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RM)))}var Rf=null;function D2(i){Rf!==i&&(Rf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rf===i&&(Rf=null);for(var o=0;o<i.length;o+=3){var u=i[o],g=i[o+1],E=i[o+2];if(typeof g!="function"){if(m0(g||u)===null)continue;break}var T=zo(u);T!==null&&(i.splice(o,3),o-=3,hg(T,{pending:!0,data:E,method:u.method,action:g},g,E))}}))}function El(i){function o(se){return Af(se,i)}Yi!==null&&Af(Yi,i),Gi!==null&&Af(Gi,i),Ki!==null&&Af(Ki,i),Zu.forEach(o),Ju.forEach(o);for(var u=0;u<Xi.length;u++){var g=Xi[u];g.blockedOn===i&&(g.blockedOn=null)}for(;0<Xi.length&&(u=Xi[0],u.blockedOn===null);)M2(u),u.blockedOn===null&&Xi.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(g=0;g<u.length;g+=3){var E=u[g],T=u[g+1],O=E[Wn]||null;if(typeof T=="function")O||D2(u);else if(O){var H=null;if(T&&T.hasAttribute("formAction")){if(E=T,O=T[Wn]||null)H=O.formAction;else if(m0(E)!==null)continue}else H=O.action;typeof H=="function"?u[g+1]=H:(u.splice(g,3),g-=3),D2(u)}}}function j2(){function i(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function o(){E!==null&&(E(),E=null),g||setTimeout(u,20)}function u(){if(!g&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(u,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),E!==null&&(E(),E=null)}}}function g0(i){this._internalRoot=i}Of.prototype.render=g0.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,g=Ur();N2(u,g,i,o,null,null)},Of.prototype.unmount=g0.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;N2(i.current,2,null,i,null,null),df(),o[vs]=null}};function Of(i){this._internalRoot=i}Of.prototype.unstable_scheduleHydration=function(i){if(i){var o=bn();i={blockedOn:null,target:i,priority:o};for(var u=0;u<Xi.length&&o!==0&&o<Xi[u].priority;u++);Xi.splice(u,0,i),u===0&&M2(i)}};var P2=t.version;if(P2!=="19.2.7")throw Error(r(527,P2,"19.2.7"));G.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var OM={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var If=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!If.isDisabled&&If.supportsFiber)try{et=If.inject(OM),dt=If}catch{}}return nc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var u=!1,g="",E=Vv,T=qv,O=Yv;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(E=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=w2(i,1,!1,null,null,u,g,null,E,T,O,j2),i[vs]=o.current,Qg(i),new g0(o)},nc.hydrateRoot=function(i,o,u){if(!s(i))throw Error(r(299));var g=!1,E="",T=Vv,O=qv,H=Yv,se=null;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(E=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(H=u.onRecoverableError),u.formState!==void 0&&(se=u.formState)),o=w2(i,1,!0,o,u??null,g,E,se,T,O,H,j2),o.context=k2(null),u=o.current,g=Ur(),g=ht(g),E=Li(g),E.callback=null,Di(u,E,g),u=g,o.current.lanes=u,Et(o,u),ws(o),i[vs]=o.current,Qg(i),new Of(o)},nc.version="19.2.7",nc}var G2;function FM(){if(G2)return y0.exports;G2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),y0.exports=UM(),y0.exports}var $M=FM();const sN="workerdeck.theme";function W1(){try{const e=localStorage.getItem(sN);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function iN(e=W1()){document.documentElement.setAttribute("data-theme",e)}function VM(e){try{localStorage.setItem(sN,e)}catch{}iN(e)}function qM(){const e=W1()==="dark"?"light":"dark";return VM(e),e}var xc=typeof window<"u"?y.useLayoutEffect:y.useEffect;function S0(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function YM(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([a])=>{t(a)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function GM(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}const aN=!1;function Uc(e){return e[e.length-1]}function KM(e){return typeof e=="function"}function Ja(e,t){return KM(e)?e(t):e}const oN=Object.prototype.hasOwnProperty,K2=Object.prototype.propertyIsEnumerable;function lN(e){for(const t in e)if(oN.call(e,t))return!0;return!1}const XM=()=>Object.create(null),$a=(e,t)=>eo(e,t,XM);function eo(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,a=Q2(e)&&Q2(s);if(!a&&!(_h(e)&&_h(s)))return s;const l=a?e:X2(e);if(!l)return s;const c=a?s:X2(s);if(!c)return s;const d=l.length,f=c.length,p=a?new Array(f):n();let m=0;for(let b=0;b<f;b++){const x=a?b:c[b],v=e[x],k=s[x];if(v===k){p[x]=v,(a?b<d:oN.call(e,x))&&m++;continue}if(v===null||k===null||typeof v!="object"||typeof k!="object"){p[x]=k;continue}const C=eo(v,k,n,r+1);p[x]=C,C===v&&m++}return d===f&&m===d?e:p}function X2(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!K2.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!K2.call(e,s))return!1;r.push(s)}return r}function _h(e){if(!W2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!W2(n)||!n.hasOwnProperty("isPrototypeOf"))}function W2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Q2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function io(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!io(e[r],t[r],n))return!1;return!0}if(_h(e)&&_h(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!io(e[l],t[l],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&s++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>s||!io(e[l],t[l],n)))return!1;return s===a}return!1}function Hl(e){let t,n;const r=new Promise((s,a)=>{t=s,n=a});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function Fc(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const WM=/[\x00-\x1f\x7f"<>`{}]/g;function QM(e){return e.replace(WM,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function Z2(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return QM(t)}const ZM=["http:","https:","mailto:","tel:"];function Ah(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function rc(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=Z2(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+Z2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function JM(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function e5(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function mi(){throw new Error("Invariant failed")}function $c(e){const t=new Map;let n,r;const s=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return s(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=l,s(c);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const oa=4,uN=5;function t5(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function cN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,a=e.substring(t,s);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const l=t5(a);if(l){const[c,d]=l,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=s,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function fm(e,t,n,r,s,a,l){l?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=n.options?.params?.parse??n.options?.parseParams;for(;c<f;){const x=cN(d,c,t);let v;const k=c,C=x[5];switch(c=C+1,a++,x[0]){case 0:{const S=d.substring(x[2],x[3]);if(p){const N=s.static?.get(S);if(N)v=N;else{s.static??=new Map;const _=to(n.fullPath??n.from);_.parent=s,_.depth=a,v=_,s.static.set(S,_)}}else{const N=S.toLowerCase(),_=s.staticInsensitive?.get(N);if(_)v=_;else{s.staticInsensitive??=new Map;const R=to(n.fullPath??n.from);R.parent=s,R.depth=a,v=R,s.staticInsensitive.set(N,R)}}break}case 1:{const S=d.substring(k,x[1]),N=d.substring(x[4],C),_=p&&!!(S||N),R=S?_?S:S.toLowerCase():void 0,I=N?_?N:N.toLowerCase():void 0,A=!m&&s.dynamic?.find(L=>!L.parse&&L.caseSensitive===_&&L.prefix===R&&L.suffix===I);if(A)v=A;else{const L=w0(1,n.fullPath??n.from,_,R,I);v=L,L.depth=a,L.parent=s,s.dynamic??=[],s.dynamic.push(L)}break}case 3:{const S=d.substring(k,x[1]),N=d.substring(x[4],C),_=p&&!!(S||N),R=S?_?S:S.toLowerCase():void 0,I=N?_?N:N.toLowerCase():void 0,A=!m&&s.optional?.find(L=>!L.parse&&L.caseSensitive===_&&L.prefix===R&&L.suffix===I);if(A)v=A;else{const L=w0(3,n.fullPath??n.from,_,R,I);v=L,L.parent=s,L.depth=a,s.optional??=[],s.optional.push(L)}break}case 2:{const S=d.substring(k,x[1]),N=d.substring(x[4],C),_=p&&!!(S||N),R=S?_?S:S.toLowerCase():void 0,I=N?_?N:N.toLowerCase():void 0,A=w0(2,n.fullPath??n.from,_,R,I);v=A,A.parent=s,A.depth=a,s.wildcard??=[],s.wildcard.push(A)}}s=v}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=to(n.fullPath??n.from);x.kind=uN,x.parent=s,a++,x.depth=a,s.pathless??=[],s.pathless.push(x),s=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=to(n.fullPath??n.from);x.kind=oa,x.parent=s,a++,x.depth=a,s.index=x,s=x}s.parse=m??null,s.priority=n.options?.params?.priority??0,b&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)fm(e,t,d,c,s,a,l)}function C0(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ia(e){if(e.pathless)for(const t of e.pathless)ia(t);if(e.static)for(const t of e.static.values())ia(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ia(t);if(e.dynamic?.length){e.dynamic.sort(C0);for(const t of e.dynamic)ia(t)}if(e.optional?.length){e.optional.sort(C0);for(const t of e.optional)ia(t)}if(e.wildcard?.length){e.wildcard.sort(C0);for(const t of e.wildcard)ia(t)}}function to(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function w0(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function n5(e,t){const n=to("/"),r=new Uint16Array(6);for(const s of e)fm(!1,r,s,1,n,0);ia(n),t.masksTree=n,t.flatCache=$c(1e3)}function r5(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Q1(e,t.masksTree);return t.flatCache.set(e,r),r}function s5(e,t,n,r,s){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=s.singleCache.get(a);return l||(l=to("/"),fm(t,new Uint16Array(6),{from:e},1,l,0),s.singleCache.set(a,l)),Q1(r,l,n)}function i5(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let a;try{a=Q1(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=fN(a.route)),t.matchCache.set(r,a),a}function a5(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function o5(e,t=!1,n){const r=to(e.fullPath),s=new Uint16Array(6),a={},l={};let c=0;return fm(t,s,e,1,r,0,d=>{if(n?.(d,c),d.id in a&&mi(),a[d.id]=d,c!==0&&d.path){const f=a5(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}c++}),ia(r),{processedTree:{segmentTree:r,singleCache:$c(1e3),matchCache:$c(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Q1(e,t,n=!1){const r=e.split("/"),s=u5(e,r,t,n);if(!s)return null;const[a]=dN(e,r,s);return{route:s.node.route,rawParams:a}}function dN(e,t,n){const r=l5(n.node);let s=null;const a=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;l++,c++,d++,f++){const p=r[c];if(p.kind===oa)break;if(p.kind===uN){f--,l--,d--;continue}const m=t[l],b=d;if(m&&(d+=m.length),p.kind===1){s??=n.node.fullPath.split("/");const x=s[f],v=p.prefix?.length??0;if(x.charCodeAt(v)===123){const k=p.suffix?.length??0,C=x.substring(v+2,x.length-k-1),S=m.substring(v,m.length-k);a[C]=decodeURIComponent(S)}else{const k=x.substring(1);a[k]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){l--,d=b-1;continue}s??=n.node.fullPath.split("/");const x=s[f],v=p.prefix?.length??0,k=p.suffix?.length??0,C=x.substring(v+3,x.length-k-1),S=p.suffix||p.prefix?m.substring(v,m.length-k):m;S&&(a[C]=decodeURIComponent(S))}else if(p.kind===2){const x=p,v=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),k=decodeURIComponent(v);a["*"]=k,a._splat=k;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:c,path:d,segment:f}]}function fN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function l5(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function u5(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Uc(t),a=s&&e!=="/",l=t.length-(s?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,f=null;for(;c.length;){const p=c.pop(),{node:m,index:b,skipped:x,depth:v,statics:k,dynamics:C,optionals:S}=p;let{extract:N,rawParams:_}=p;if(m.kind===2&&m.route&&!Lf(f,p))continue;if(m.parse){if(!J2(e,t,p))continue;_=p.rawParams,N=p.extract}r&&m.route&&m.kind!==oa&&Lf(d,p)&&(d=p);const R=b===l;if(R&&(m.route&&(!a||m.kind===oa||m.kind===2)&&Lf(f,p)&&(f=p),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const I=R?void 0:t[b];let A;if(R&&m.index){const L={node:m.index,index:b,skipped:x,depth:v+1,statics:k,dynamics:C,optionals:S,extract:N,rawParams:_};let D=!0;if(m.index.parse&&(J2(e,t,L)||(D=!1)),D){if(!C&&!S&&!x&&c5(k,l))return L;Lf(f,L)&&(f=L)}}if(m.wildcard)for(let L=m.wildcard.length-1;L>=0;L--){const D=m.wildcard[L],{prefix:U,suffix:z}=D;if(!(U&&(R||!(D.caseSensitive?I:A??=I.toLowerCase()).startsWith(U)))){if(z){if(R)continue;const K=t.slice(b).join("/").slice(-z.length);if((D.caseSensitive?K:K.toLowerCase())!==z)continue}c.push({node:D,index:l,skipped:x,depth:v+1,statics:k,dynamics:C,optionals:S,extract:N,rawParams:_})}}if(m.optional){const L=x|1<<v,D=v+1;for(let U=m.optional.length-1;U>=0;U--){const z=m.optional[U];c.push({node:z,index:b,skipped:L,depth:D,statics:k,dynamics:C,optionals:S,extract:N,rawParams:_})}if(!R)for(let U=m.optional.length-1;U>=0;U--){const z=m.optional[U],{prefix:K,suffix:W}=z;if(K||W){const J=z.caseSensitive?I:A??=I.toLowerCase();if(K&&!J.startsWith(K)||W&&!J.endsWith(W))continue}c.push({node:z,index:b+1,skipped:x,depth:D,statics:k,dynamics:C,optionals:S+Mf(l,b),extract:N,rawParams:_})}}if(!R&&m.dynamic&&I)for(let L=m.dynamic.length-1;L>=0;L--){const D=m.dynamic[L],{prefix:U,suffix:z}=D;if(U||z){const K=D.caseSensitive?I:A??=I.toLowerCase();if(U&&!K.startsWith(U)||z&&!K.endsWith(z))continue}c.push({node:D,index:b+1,skipped:x,depth:v+1,statics:k,dynamics:C+Mf(l,b),optionals:S,extract:N,rawParams:_})}if(!R&&m.staticInsensitive){const L=m.staticInsensitive.get(A??=I.toLowerCase());L&&c.push({node:L,index:b+1,skipped:x,depth:v+1,statics:k+Mf(l,b),dynamics:C,optionals:S,extract:N,rawParams:_})}if(!R&&m.static){const L=m.static.get(I);L&&c.push({node:L,index:b+1,skipped:x,depth:v+1,statics:k+Mf(l,b),dynamics:C,optionals:S,extract:N,rawParams:_})}if(m.pathless){const L=v+1;for(let D=m.pathless.length-1;D>=0;D--){const U=m.pathless[D];c.push({node:U,index:b,skipped:x,depth:L,statics:k,dynamics:C,optionals:S,extract:N,rawParams:_})}}}if(f)return f;if(r&&d){let p=d.index;for(let b=0;b<d.index;b++)p+=t[b].length;const m=p===e.length?"/":e.slice(p);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}function Mf(e,t){return 2**(e-t-1)}function c5(e,t){return e===2**(t-1)-1}function J2(e,t,n){let r,s;try{[r,s]=dN(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Lf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===oa)>(e.node.kind===oa)||t.node.kind===oa==(e.node.kind===oa)&&t.depth>e.depth))):!0}function mh(e){return Z1(e.filter(t=>t!==void 0).join("/"))}function Z1(e){return e.replace(/\/{2,}/g,"/")}function hN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function hi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function mN(e){return hi(hN(e))}function Rh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function d5(e,t,n){return Rh(e,n)===Rh(t,n)}function f5({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),a=!s&&t===".";let l;if(r){l=s?t:a?e:e+"\0"+t;const f=r.get(l);if(f)return f}let c;if(a)c=e.split("/");else if(s)c=t.split("/");else{for(c=e.split("/");c.length>1&&Uc(c)==="";)c.pop();const f=t.split("/");for(let p=0,m=f.length;p<m;p++){const b=f[p];b===""?p?p===m-1&&c.push(b):c=[b]:b===".."?c.pop():b==="."||c.push(b)}}c.length>1&&(Uc(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));const d=Z1(c.join("/"))||"/";return l&&r&&r.set(l,d),d}function h5(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,a=>t.get(a)??a)}function k0(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>tS(s,n)).join("/"):tS(r,n)}function eS({path:e,params:t,decoder:n,...r}){let s=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:s};const l=e.length;let c=0,d,f="";for(;c<l;){const p=c;d=cN(e,p,d);const m=d[5];if(c=m+1,p===m)continue;const b=d[0];if(b===0){f+="/"+e.substring(p,m);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const v=e.substring(p,d[1]),k=e.substring(d[4],m);if(!x){s=!0,(v||k)&&(f+="/"+v+k);continue}const C=k0("_splat",t,n);f+="/"+v+C+k;continue}if(b===1){const x=e.substring(d[2],d[3]);!s&&!(x in t)&&(s=!0),a[x]=t[x];const v=e.substring(p,d[1]),k=e.substring(d[4],m),C=k0(x,t,n)??"undefined";f+="/"+v+C+k;continue}if(b===3){const x=e.substring(d[2],d[3]),v=t[x];if(v==null)continue;a[x]=v;const k=e.substring(p,d[1]),C=e.substring(d[4],m),S=k0(x,t,n)??"";f+="/"+k+S+C;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:s}}function tS(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function or(e){return e?.isNotFound===!0}function m5(){try{return sessionStorage}catch{return}}const p5="tsr-scroll-restoration-v1_3",pN=m5();function g5(){try{return JSON.parse(pN?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function b5(){try{pN?.setItem(p5,JSON.stringify(Nl))}catch{}}const Nl=g5(),nS="data-scroll-restoration-id",x5=e=>e.state.__TSR_key||e.href;function y5(e){const t=e.getAttribute(nS);if(t)return`[${nS}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const c=`${r.localName}:nth-child(${a})`;n=n?`${c} > ${n}`:c,r=s}return n}let Df=!1;const ph="window";function Pb(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function rS(e){const t=new Set;for(const n of e){if(n===ph)continue;const r=Pb(n);r&&t.add(r)}return t}function E5(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||x5,a=new Set,l=c=>{const d=Nl[c]||={};for(const f of a)f===document?d[ph]={scrollX,scrollY}:f.isConnected&&(d[y5(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Df=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{Df||a.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(s(c.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),b5()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{const d=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,p=r.next,m=r.hash;let b;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=s(c.toLocation),v=c.fromLocation&&s(c.fromLocation);if(r.restoring&&v&&v!==x){const k=Nl[v];if(k){let C=Nl[x];for(const S in k){if(S===ph){if(p)continue}else{const N=Pb(S);if(!N||p&&f&&(b??=rS(f),b.has(N)))continue}C||(C=Nl[x]={}),C[S]??=k[S]}}}Df=!0;try{const k=c.toLocation.hash,C=c.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(p){!k&&f&&(b??=rS(f));const N=k&&C&&m,_=r.restoring?Nl[x]:void 0;if(_)for(const R in _){const{scrollX:I,scrollY:A}=_[R];if(R===ph){if(N)continue;scrollTo({top:A,left:I,behavior:d}),S=!0}else{const L=Pb(R);L&&(L.scrollLeft=I,L.scrollTop=A,b?.delete(L))}}if(!k){const R={top:0,left:0,behavior:d};if(S||scrollTo(R),b)for(const I of b)I.scrollTo(R)}}!S&&k&&C&&document.getElementById(k)?.scrollIntoView(C)}finally{Df=!1}}))}function v5(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function N0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function T5(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const a=n[r];a==null?n[r]=N0(s):Array.isArray(a)?a.push(N0(s)):n[r]=[a,N0(s)]}return n}const S5=w5(JSON.parse),C5=k5(JSON.stringify,JSON.parse);function w5(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=T5(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function k5(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const a=v5(s,r);return a?`?${a}`:""}}const ao="__root__";function gN(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Or(e){return e instanceof Response&&!!e.options}function N5(e){return{input:({url:t})=>{for(const n of e)t=Bb(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=bN(e[n],t);return t}}}function _5(e){const t=mN(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),s=`${r}/`;return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===r?a.pathname="/":l.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=mh(["/",t,a.pathname]),a)}}function Bb(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function bN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function A5(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:a}=t,l=new Map,c=new Map,d=new Map,f=n(e.status),p=n(e.loadedAt),m=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),v=n(e.resolvedLocation),k=n(e.statusCode),C=n(e.redirect),S=n([]),N=n([]),_=n([]),R=r(()=>_0(l,S.get())),I=r(()=>_0(c,N.get())),A=r(()=>_0(d,_.get())),L=r(()=>S.get()[0]),D=r(()=>S.get().some(G=>l.get(G)?.get().status==="pending")),U=r(()=>({locationHref:x.get().href,resolvedLocationHref:v.get()?.href,status:f.get()})),z=r(()=>({status:f.get(),loadedAt:p.get(),isLoading:m.get(),isTransitioning:b.get(),matches:R.get(),location:x.get(),resolvedLocation:v.get(),statusCode:k.get(),redirect:C.get()})),K=$c(64);function W(G){let X=K.get(G);return X||(X=r(()=>{const ae=S.get();for(const M of ae){const P=l.get(M);if(P&&P.routeId===G)return P.get()}}),K.set(G,X)),X}const J={status:f,loadedAt:p,isLoading:m,isTransitioning:b,location:x,resolvedLocation:v,statusCode:k,redirect:C,matchesId:S,pendingIds:N,cachedIds:_,matches:R,pendingMatches:I,cachedMatches:A,firstId:L,hasPending:D,matchRouteDeps:U,matchStores:l,pendingMatchStores:c,cachedMatchStores:d,__store:z,getRouteMatchStore:W,setMatches:te,setPending:V,setCached:B};te(e.matches),a?.(J);function te(G){A0(G,l,S,n,s)}function V(G){A0(G,c,N,n,s)}function B(G){A0(G,d,_,n,s)}return J}function _0(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function A0(e,t,n,r,s){const a=e.map(c=>c.id),l=new Set(a);s(()=>{for(const c of t.keys())l.has(c)||t.delete(c);for(const c of e){const d=t.get(c.id);if(!d){const f=r(c);f.routeId=c.routeId,t.set(c.id,f);continue}d.routeId=c.routeId,d.get()!==c&&d.set(c)}e5(n.get(),a)||n.set(a)})}const zb=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},R5=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),hm=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),oo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let a=0;a<=s;a++){const l=e.matches[a];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},sS=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),s=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=s);for(let l=a;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?a:s},la=(e,t,n)=>{if(!(!Or(n)&&!or(n)))throw Or(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Or(n)?"redirected":or(n)?"notFound":r.status==="pending"?"success":r.status,context:oo(e,t.index),isFetching:!1,error:n})),or(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Or(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},xN=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},iS=(e,t,n)=>{const r=oo(e,n);e.updateMatch(t,s=>({...s,context:r}))},sc=(e,t,n)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,la(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,la(e,e.router.getMatch(r),n)}e.updateMatch(r,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Or(n)&&!or(n)&&(e.serialError??=n)},yN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!hm(e,t)&&(n.options.loader||n.options.beforeLoad||vN(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{zb(e)},s);r._nonReactive.pendingTimeout=a}},O5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;yN(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&la(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},I5=(e,t,n,r)=>{const s=e.router.getMatch(t);let a=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Hl(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=s;l&&sc(e,n,l),c&&sc(e,n,c),yN(e,t,r,s);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},m=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{p(),m()});return}s._nonReactive.beforeLoadPromise=Hl();const b={...oo(e,n,!1),...s.__routeContext},{search:x,params:v,cause:k}=s,C=hm(e,t),S={search:x,abortController:d,params:v,preload:C,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":k,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},N=R=>{if(R===void 0){e.router.batch(()=>{p(),m()});return}(Or(R)||or(R))&&(p(),sc(e,n,R)),e.router.batch(()=>{p(),e.updateMatch(t,I=>({...I,__beforeLoadContext:R})),m()})};let _;try{if(_=r.options.beforeLoad(S),Fc(_))return p(),_.catch(R=>{sc(e,n,R)}).then(N)}catch(R){p(),sc(e,n,R)}N(_)},M5=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>c(),l=()=>I5(e,n,t,s),c=()=>{if(xN(e,n))return;const d=O5(e,n,s);return Fc(d)?d.then(l):l()};return a()},L5=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([a,l,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},EN=(e,t,n,r,s)=>{const a=t[r-1],{params:l,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=oo(e,r),m=hm(e,n);return{params:l,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:m?"preload":f,route:s,...e.router.options.additionalContext}},aS=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(aN??e.router.isServer)||a.ssr===!0)&&Vc(s);const l=s.options.loader,c=typeof l=="function"?l:l?.handler,d=c?.(EN(e,t,n,r,s)),f=!!c&&Fc(d);if((f||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;la(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,b=>({...b,loaderData:m}))}s._lazyPromise&&await s._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:oo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:oo(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,or(l)&&await s.options.notFoundComponent?.preload?.(),la(e,e.router.getMatch(n),l);try{s.options.onError?.(l)}catch(f){c=f,la(e,e.router.getMatch(n),f)}!Or(c)&&!or(c)&&await Vc(s,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:oo(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),la(e,l,a)}},D5=async(e,t,n)=>{async function r(x,v,k,C,S){const N=Date.now()-v.updatedAt,_=x?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,R=S.options.shouldReload,I=typeof R=="function"?R(EN(e,t,s,n,S)):R,{status:A,invalid:L}=C,D=N>=_&&(!!e.forceStaleReload||C.cause==="enter"||k!==void 0&&k!==C.id);l=A==="success"&&(L||(I??D)),x&&S.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await aS(e,t,s,n,S);const U=e.router.getMatch(s);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){Or(U)&&await e.router.navigate(U.options)}})()):A!=="success"||l?await aS(e,t,s,n,S):iS(e,s,n))}const{id:s,routeId:a}=e.matches[n];let l=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(xN(e,s)){if(!e.router.getMatch(s))return e.matches[n];iS(e,s,n)}else{const x=e.router.getMatch(s),v=e.router.stores.matchesId.get()[n],k=(v&&e.router.stores.matchStores.get(v)||null)?.routeId===a?v:e.router.stores.matches.get().find(S=>S.routeId===a)?.id,C=hm(e,s);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&p)return x;await x._nonReactive.loaderPromise;const S=e.router.getMatch(s),N=S._nonReactive.error||S.error;N&&la(e,S,N),S.status==="pending"&&await r(C,x,k,S,d)}else{const S=C&&!e.router.stores.matchStores.has(s),N=e.router.getMatch(s);N._nonReactive.loaderPromise=Hl(),S!==N.preload&&e.updateMatch(s,_=>({..._,preload:S})),await r(C,x,k,N,d)}}const m=e.router.getMatch(s);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const b=c?m.isFetching:!1;return b!==m.isFetching||m.invalid!==!1?(e.updateMatch(s,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(s)):m};async function oS(e){const t=e,n=[];R5(t.router)&&zb(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=M5(t,b);Fc(x)&&await x}catch(x){if(Or(x))throw x;if(or(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?sS(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,s):s;let c,d;for(let b=0;b<l;b++)n.push(D5(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const x of b){if(x.status!=="rejected")continue;const v=x.reason;if(Or(v))throw v;or(v)?c??=v:d??=v}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let p=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const b=sS(t,f);b===void 0&&mi();const x=t.matches[b],v=t.router.looseRoutesById[x.routeId],k=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&k&&(v.options.notFoundComponent=k),f.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,S=>({...S,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=b,await Vc(v,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Vc(b,["errorComponent"])}for(let b=0;b<=p;b++){const{id:x,routeId:v}=t.matches[b],k=t.router.looseRoutesById[v];try{const C=L5(t,x,k);if(C){const S=await C;t.updateMatch(x,N=>({...N,...S}))}}catch(C){console.error(`Error executing head for route ${v}:`,C)}}const m=zb(t);if(Fc(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function lS(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Vc(e,t=gh){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===gh?(()=>{if(e._componentsPromise===void 0){const r=lS(e,gh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():lS(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function vN(e){for(const t of gh)if(e.options[t]?.preload)return!0;return!1}const gh=["component","errorComponent","pendingComponent","notFoundComponent"];var da="__TSR_index",uS="popstate",cS="beforeunload";function j5(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const b=qc(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,d)=>{const f=t.state[da];c=dS(f+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:c})},replace:(l,c,d)=>{const f=t.state[da];c=dS(f,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),s({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[da]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function dS(e,t){t||(t={});const n=J1();return{...t,key:n,__TSR_key:n,[da]:e}}function TN(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let s=[];const a=()=>s,l=D=>s=D,c=e?.createHref??(D=>D),d=e?.parseLocation??(()=>qc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const D=J1();t.history.replaceState({[da]:0,key:D,__TSR_key:D},"")}let f=d(),p,m=!1,b=!1,x=!1,v=!1;const k=()=>f;let C,S;const N=()=>{C&&(L._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),L._ignoreSubscribers=!1,C=void 0,S=void 0,p=void 0)},_=(D,U,z)=>{const K=c(U);S||(p=f),f=qc(U,z),C={href:K,state:z,isPush:C?.isPush||D==="push"},S||(S=Promise.resolve().then(()=>N()))},R=D=>{f=d(),L.notify({type:D})},I=async()=>{if(b){b=!1;return}const D=d(),U=D.state[da]-f.state[da],z=U===1,K=U===-1,W=!z&&!K||m;m=!1;const J=W?"GO":K?"BACK":"FORWARD",te=W?{type:"GO",index:U}:{type:K?"BACK":"FORWARD"};if(x)x=!1;else{const V=a();if(typeof document<"u"&&V.length){for(const B of V)if(await B.blockerFn({currentLocation:f,nextLocation:D,action:J})){b=!0,t.history.go(1),L.notify(te);return}}}f=d(),L.notify(te)},A=D=>{if(v){v=!1;return}let U=!1;const z=a();if(typeof document<"u"&&z.length)for(const K of z){const W=K.enableBeforeUnload??!0;if(W===!0){U=!0;break}if(typeof W=="function"&&W()===!0){U=!0;break}}if(U)return D.preventDefault(),D.returnValue=""},L=j5({getLocation:k,getLength:()=>t.history.length,pushState:(D,U)=>_("push",D,U),replaceState:(D,U)=>_("replace",D,U),back:D=>(D&&(x=!0),v=!0,t.history.back()),forward:D=>{D&&(x=!0),v=!0,t.history.forward()},go:D=>{m=!0,t.history.go(D)},createHref:D=>c(D),flush:N,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(cS,A,{capture:!0}),t.removeEventListener(uS,I)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(cS,A,{capture:!0}),t.addEventListener(uS,I),t.history.pushState=function(...D){const U=n.apply(t.history,D);return L._ignoreSubscribers||R("PUSH"),U},t.history.replaceState=function(...D){const U=r.apply(t.history,D);return L._ignoreSubscribers||R("REPLACE"),U},L}function P5(e){const t=typeof document<"u"?window:void 0;return TN({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",s=t.location.search,a=n.slice(1);return qc(`${r}${s}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function B5(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function qc(e,t){const n=B5(e),r=n.indexOf("#"),s=n.indexOf("?"),a=J1();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[da]:0,key:a,__TSR_key:a}}}function J1(){return(Math.random()+1).toString(36).substring(7)}function Ll(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var z5=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",a=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=h5(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=TN()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=$c(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=A5(U5(this.latestLocation),p),E5(this)}let c=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(a||s!==d||l!==f){this.basepath=d;const p=[],m=mN(d);m&&m!=="/"&&p.push(_5({basepath:d})),f&&p.push(f),this.rewrite=p.length===0?void 0:p.length===1?p[0]:N5(p),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=o5(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&n5(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:d,search:f,hash:p,href:m,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(f),N=this.options.stringifySearch(S);return{href:d+N+p,publicHref:d+N+p,pathname:rc(d).path,external:!1,searchStr:N,search:$a(r?.search,S),hash:rc(p.slice(1)).path,state:eo(r?.state,b)}}const x=new URL(m,this.origin),v=Bb(this.rewrite,x),k=this.options.parseSearch(v.search),C=this.options.stringifySearch(k);return v.search=C,{href:v.href.replace(v.origin,""),publicHref:m,pathname:rc(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:C,search:$a(r?.search,k),hash:rc(v.hash.slice(1)).path,state:eo(r?.state,b)}},a=s(n),{__tempLocation:l,__tempKey:c}=a.state;if(l&&(!c||c===this.tempLocationKey)){const d=s(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,r)=>f5({base:n,to:r.includes("//")?Z1(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>F5({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??c.fullPath,f=a.to?`${a.to}`:void 0,p=c.search,m=Object.assign(Object.create(null),c.params),b=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=f?this.resolvePathWithBase(b,f):b,v=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?m:Object.assign(m,Ja(a.params,m)),k=this.routesByPath[hi(x)];let C;if(k)C=this.getRouteBranch(k);else if(x.includes("$"))C=[];else{const K=this.getMatchedRoutes(x);C=K.matchedRoutes,this.options.notFoundRoute&&(!K.foundRoute||K.foundRoute.path!=="/"&&K.routeParams["**"])&&(C=[...C,this.options.notFoundRoute])}if(C.length&&lN(v))for(const K of C){const W=K.options.params?.stringify??K.options.stringifyParams;if(W)try{Object.assign(v,W(v))}catch{}}const S=n.leaveParams?x:rc(eS({path:x,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=p;if(n._includeValidateSearch&&this.options.search?.strict){const K={};C.forEach(W=>{if(W.options.validateSearch)try{Object.assign(K,bh(W.options.validateSearch,{...K,...N}))}catch{}}),N=K}N=$5({search:N,dest:a,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),N=$a(p,N);const _=this.options.stringifySearch(N),R=a.hash===!0?l.hash:a.hash?Ja(a.hash,l.hash):void 0,I=R?`#${R}`:"";let A=a.state===!0?l.state:a.state?Ja(a.state,l.state):{};A=eo(l.state,A);const L=`${S}${_}${I}`;let D,U,z=!1;if(this.rewrite){const K=new URL(L,this.origin),W=bN(this.rewrite,K);D=K.href.replace(K.origin,""),W.origin!==this.origin?(U=W.href,z=!0):U=W.pathname+W.search+W.hash}else D=JM(L),U=D;return{publicHref:U,href:D,pathname:S,search:N,searchStr:_,state:A,hash:R??"",external:z,unmaskOnReload:a.unmaskOnReload}},s=(a={},l)=>{const c=r(a);let d=l?r(l):void 0;if(!d){const f=Object.create(null);if(this.options.routeMasks){const p=r5(c.pathname,this.processedTree);if(p){Object.assign(f,p.rawParams);const{from:m,params:b,...x}=p.route,v=b===!1||b===null?Object.create(null):(b??!0)===!0?f:Object.assign(f,Ja(b,f));l={from:n.from,...x,params:v},d=r(l)}}}return d&&(c.maskedLocation=d),c};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{let a;const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{s.state[m]=this.latestLocation.state[m]});const p=io(s.state,this.latestLocation.state);return f.forEach(m=>{delete s.state[m]}),p},c=hi(this.latestLocation.href)===hi(s.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Hl(()=>{d?.resolve(),d=void 0}),c&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=s;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=s.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this._scroll.next=s.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:a,ignoreBlocker:l,href:c,...d}={})=>{if(c){const m=this.history.location.state.__TSR_index,b=qc(c,{__TSR_index:n?m:m+1}),x=new URL(b.pathname,this.origin);d.to=Bb(this.rewrite,x).pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const p=this.commitLocation({...f,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:a,...l})=>{let c=!1;if(s)try{new URL(`${s}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...l});s=s??f.publicHref,a=a??f.publicHref}const d=!c&&a?a:s;if(Ah(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const p of f)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}l.replace?window.location.replace(d):window.location.href=d;return}return this.buildAndCommitLocation({...l,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(a=>a.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let s,a,l;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const p=this.latestLocation,m=Ll(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await oS({router:this,sync:n?.sync,forceStaleReload:c.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,v=null,k=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),S=C.length,N=this.stores.matches.get();b=S?N.filter(I=>!this.stores.pendingMatchStores.has(I.id)):null;const _=new Set;for(const I of this.stores.pendingMatchStores.values())I.routeId&&_.add(I.routeId);const R=new Set;for(const I of this.stores.matchStores.values())I.routeId&&R.add(I.routeId);x=S?N.filter(I=>!_.has(I.routeId)):null,v=S?C.filter(I=>!R.has(I.routeId)):null,k=S?C.filter(I=>R.has(I.routeId)):N,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(I=>I.status!=="error"&&I.status!=="notFound"&&I.status!=="redirected")]),this.clearExpiredCache())});for(const[C,S]of[[x,"onLeave"],[v,"onEnter"],[k,"onStay"]])if(C)for(const N of C)this.looseRoutesById[N.routeId].options[S]?.(N)})})}})}catch(p){Or(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):or(p)&&(a=p);const m=s?s.status:a?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(m),this.stores.redirect.set(s)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(f=>f.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(Ll(a,l)):r.types;if(c===!1){n();return}s={update:n,types:c}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const a=this.stores.matchStores.get(n);if(a){a.set(r);return}const l=this.stores.cachedMatchStores.get(n);if(l){const c=r(l.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(f=>f!==n)):l.set(c)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(s);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const a=s.pathname+s.search+s.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&Ah(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const l=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=Vc,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...a,...this.stores.cachedIds.get()]),c=s.filter(d=>!l.has(d.id));if(c.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...c])}try{return s=await oS({router:this,matches:s,location:r,preload:!0,updateMatch:(d,f)=>{a.has(d)?s=s.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),s}catch(d){if(Or(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});or(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(s);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=s5(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!c||n.params&&!io(c.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?io(l.search,a.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??C5,parseSearch:e.parseSearch??S5,protocolAllowlist:e.protocolAllowlist??ZM}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=fN(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s}=n;let{matchedRoutes:a}=n,l=!1;(r?r.path!=="/"&&s["**"]:hi(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?q5(this.options.notFoundMode,a):void 0,d=new Array(a.length),f=new Map;for(const p of this.stores.matchStores.values())p.routeId&&f.set(p.routeId,p.get());for(let p=0;p<a.length;p++){const m=a[p],b=d[p-1];let x,v,k;{const W=b?.search??e.search,J=b?._strictSearch??void 0;try{const te=bh(m.options.validateSearch,{...W})??void 0;x={...W,...te},v={...J,...te},k=void 0}catch(te){let V=te;if(te instanceof Oh||(V=new Oh(te.message,{cause:te})),t?.throwOnError)throw V;x=W,v={},k=V}}const C=m.options.loaderDeps?.({search:x})??"",S=C?JSON.stringify(C):"",{interpolatedPath:N,usedParams:_}=eS({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),R=m.id+N+S,I=this.getMatch(R),A=f.get(m.id),L=I?._strictParams??_;let D;if(!I)try{fS(m,L)}catch(W){if(or(W)||Or(W)?D=W:D=new H5(W.message,{cause:W}),t?.throwOnError)throw D}Object.assign(s,L);const U=A?"stay":"enter";let z;if(I)z={...I,cause:U,params:A?.params??s,_strictParams:L,search:$a(A?A.search:I.search,x),_strictSearch:v};else{const W=m.options.loader||m.options.beforeLoad||m.lazyFn||vN(m)?"pending":"success";z={id:R,ssr:m.options.ssr,index:p,routeId:m.id,params:A?.params??s,_strictParams:L,pathname:N,updatedAt:Date.now(),search:A?$a(A.search,x):x,_strictSearch:v,searchError:void 0,status:W,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:A?eo(A.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t?.preload||(z.globalNotFound=c===m.id),z.searchError=k;const K=this.getParentContext(b);z.context={...K,...z.__routeContext,...z.__beforeLoadContext},d[p]=z}for(let p=0;p<d.length;p++){const m=d[p],b=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),v=f.get(m.routeId);if(m.params=v?$a(v.params,s):s,!x){const k=d[p-1],C=this.getParentContext(k);if(b.options.context){const S={deps:m.loaderDeps,params:m.params,context:C??{},location:e,navigate:N=>this.navigate({...N,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:b.id};m.__routeContext=b.options.context(S)??void 0}m.context={...C,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Uc(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:s}=this.getMatchedRoutes(e.pathname),a=Uc(r),l={...e.search};for(const m of r)try{Object.assign(l,bh(m.options.validateSearch,l))}catch{}const c=t&&this.stores.matchStores.get(t)?.get(),d=c&&c.routeId===a.id&&c.pathname===e.pathname;let f;if(d)f=c.params;else{const m=Object.assign(Object.create(null),s);for(const b of r)try{fS(b,m)}catch{}f=m}const p={matchedRoutes:r,fullPath:a.fullPath,search:l,params:f};return this.lightweightCache.set(e,[t,p]),p}},Oh=class extends Error{},H5=class extends Error{};function U5(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function bh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Oh("Async validation not supported");if(n.issues)throw new Oh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function F5({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=hi(e);let a;const l=i5(s,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function $5({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return V5(n)(e,t,r??!1)}function V5(e){let t,n;const r=[];for(const a of e){const l=a.options;if("search"in l)l.search?.middlewares&&r.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const d=({search:f,next:p})=>{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),f):f);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),m):m};r.push(d)}const c=l.validateSearch;if(c){const d=({search:f,next:p,meta:m})=>{const b=p(f);if(n)try{const x=bh(c,b);if(m&&x)for(const v in x)v in b||(m.defaulted||=new Map).set(v,x[v]);return{...b,...x}}catch{}return b};r.push(d)}}const s=(a,l,c)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const f=Ja(t.search,l);return c&&(c.explicit=f),f}const d=(f,p)=>{if(p){const m=c||{};return{search:s(a+1,f,m),meta:m}}return s(a+1,f,c)};return r[a]({search:l,next:d,meta:c})};return function(l,c,d){return t=c,n=d,s(0,l)}}function q5(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return ao}function fS(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const Y5="Error preloading route! ☝️";var SN=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=ao:this.parentRoute||mi();let s=r?ao:n?.path;s&&s!=="/"&&(s=hN(s));const a=n?.id||s;let l=r?ao:mh([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);s==="__root__"&&(s="/"),l!=="__root__"&&(l=mh(["/",l]));const c=l==="__root__"?"/":mh([this.parentRoute.fullPath,s]);this._path=s,this._id=l,this._fullPath=c,this._to=hi(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>gN({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},G5=class extends SN{constructor(e){super(e)}};function ex(e){const t=e.errorComponent??tx;return h.jsx(K5,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}var K5=class extends y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function tx({error:e}){const[t,n]=y.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function X5({children:e,fallback:t=null}){return CN()?h.jsx(Ue.Fragment,{children:e}):h.jsx(Ue.Fragment,{children:t})}function CN(){return Ue.useSyncExternalStore(W5,()=>!0,()=>!1)}function W5(){return()=>{}}var wN=y.createContext(null);function Gr(e){return y.useContext(wN)}var mm=y.createContext(void 0),Q5=y.createContext(void 0),mn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(mn||{});function Z5({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:a,checkDirty:l,shallowPropagate:c};function r(f,p,m){const b=p.depsTail;if(b!==void 0&&b.dep===f)return;const x=b!==void 0?b.nextDep:p.deps;if(x!==void 0&&x.dep===f){x.version=m,p.depsTail=x;return}const v=f.subsTail;if(v!==void 0&&v.version===m&&v.sub===p)return;const k=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:b,nextDep:x,prevSub:v,nextSub:void 0};x!==void 0&&(x.prevDep=k),b!==void 0?b.nextDep=k:p.deps=k,v!==void 0?v.nextSub=k:f.subs=k}function s(f,p=f.sub){const m=f.dep,b=f.prevDep,x=f.nextDep,v=f.nextSub,k=f.prevSub;return x!==void 0?x.prevDep=b:p.depsTail=b,b!==void 0?b.nextDep=x:p.deps=x,v!==void 0?v.prevSub=k:m.subsTail=k,k!==void 0?k.nextSub=v:(m.subs=v)===void 0&&n(m),x}function a(f){let p=f.nextSub,m;e:do{const b=f.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(f,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const v=b.subs;if(v!==void 0){const k=(f=v).nextSub;k!==void 0&&(m={value:p,prev:m},p=k);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function l(f,p){let m,b=0,x=!1;e:do{const v=f.dep,k=v.flags;if(p.flags&16)x=!0;else if((k&17)===17){if(e(v)){const C=v.subs;C.nextSub!==void 0&&c(C),x=!0}}else if((k&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=v.deps,p=v,++b;continue}if(!x){const C=f.nextDep;if(C!==void 0){f=C;continue}}for(;b--;){const C=p.subs,S=C.nextSub!==void 0;if(S?(f=m.value,m=m.prev):f=C,x){if(e(p)){S&&c(C),p=f.sub;continue}x=!1}else p.flags&=-33;p=f.sub;const N=f.nextDep;if(N!==void 0){f=N;continue e}}return x}while(!0)}function c(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}function J5(e,t,n){const r=typeof e=="object",s=r?e:void 0;return{next:(r?e.next:e)?.bind(s),error:(r?e.error:t)?.bind(s),complete:(r?e.complete:n)?.bind(s)}}const Hb=[];let xh=0;const{link:hS,unlink:eL,propagate:tL,checkDirty:kN,shallowPropagate:mS}=Z5({update(e){return e._update()},notify(e){Hb[Ub++]=e,e.flags&=~mn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=mn.Mutable|mn.Dirty,Ih(e))}});let jf=0,Ub=0,Rs,Fb=0;function NN(e){try{++Fb,e()}finally{--Fb||_N()}}function Ih(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=eL(n,e)}function _N(){if(!(Fb>0)){for(;jf<Ub;){const e=Hb[jf];Hb[jf++]=void 0,e.notify()}jf=0,Ub=0}}function pS(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?mn.None:mn.Mutable,get(){return Rs!==void 0&&hS(s,Rs,xh),s._snapshot},subscribe(a){const l=J5(a),c={current:!1},d=nL(()=>{s.get(),c.current?l.next?.(s._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Rs,c=t?.compare??Object.is;if(n)Rs=s,++xh,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=mn.Mutable|mn.RecursedCheck);try{const d=s._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(s._snapshot=f,!0):!1}finally{Rs=l,n&&(s.flags&=~mn.RecursedCheck),Ih(s)}}};return n?(s.flags=mn.Mutable|mn.Dirty,s.get=function(){const a=s.flags;if(a&mn.Dirty||a&mn.Pending&&kN(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&mS(l)}}else a&mn.Pending&&(s.flags=a&~mn.Pending);return Rs!==void 0&&hS(s,Rs,xh),s._snapshot}):s.set=function(a){if(s._update(a)){const l=s.subs;l!==void 0&&(tL(l),mS(l),_N())}},s}function nL(e){const t=()=>{const r=Rs;Rs=n,++xh,n.depsTail=void 0,n.flags=mn.Watching|mn.RecursedCheck;try{return e()}finally{Rs=r,n.flags&=~mn.RecursedCheck,Ih(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:mn.Watching|mn.RecursedCheck,notify(){const r=this.flags;r&mn.Dirty||r&mn.Pending&&kN(this.deps,this)?t():this.flags=mn.Watching},stop(){this.flags=mn.None,this.depsTail=void 0,Ih(this)}};return t(),n}var R0={exports:{}},O0={},I0={exports:{}},M0={};/**
51
+ * @license React
52
+ * use-sync-external-store-shim.production.js
53
+ *
54
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */var gS;function rL(){if(gS)return M0;gS=1;var e=rd();function t(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(m,b){var x=b(),v=r({inst:{value:x,getSnapshot:b}}),k=v[0].inst,C=v[1];return a(function(){k.value=x,k.getSnapshot=b,d(k)&&C({inst:k})},[m,x,b]),s(function(){return d(k)&&C({inst:k}),m(function(){d(k)&&C({inst:k})})},[m]),l(x),x}function d(m){var b=m.getSnapshot;m=m.value;try{var x=b();return!n(m,x)}catch{return!0}}function f(m,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return M0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,M0}var bS;function AN(){return bS||(bS=1,I0.exports=rL()),I0.exports}/**
59
+ * @license React
60
+ * use-sync-external-store-shim/with-selector.production.js
61
+ *
62
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */var xS;function sL(){if(xS)return O0;xS=1;var e=rd(),t=AN();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return O0.useSyncExternalStoreWithSelector=function(f,p,m,b,x){var v=a(null);if(v.current===null){var k={hasValue:!1,value:null};v.current=k}else k=v.current;v=c(function(){function S(A){if(!N){if(N=!0,_=A,A=b(A),x!==void 0&&k.hasValue){var L=k.value;if(x(L,A))return R=L}return R=A}if(L=R,r(_,A))return L;var D=b(A);return x!==void 0&&x(L,D)?(_=A,L):(_=A,R=D)}var N=!1,_,R,I=m===void 0?null:m;return[function(){return S(p())},I===null?void 0:function(){return S(I())}]},[p,m,b,x]);var C=s(f,v[0],v[1]);return l(function(){k.hasValue=!0,k.value=C},[C]),d(C),C},O0}var yS;function iL(){return yS||(yS=1,R0.exports=sL()),R0.exports}var RN=iL();function aL(e,t){return e===t}function br(e,t,n=aL){const r=y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),s=y.useCallback(()=>e?.get(),[e]);return RN.useSyncExternalStoreWithSelector(r,s,s,t,n)}var L0={get(){},subscribe(){return{unsubscribe(){}}}};function ON(e,t){const n=y.useRef();return r=>{const s=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=eo(n.current,s):s}}function To(e){const t=Gr(),n=y.useContext(e.from?Q5:mm),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),s=ON(e,t),a=br(r??L0,l=>l?s(l):L0);if(a!==L0)return a;(e.shouldThrow??!0)&&mi()}function IN(e){return To({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function MN(e){const{select:t,...n}=e;return To({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function pm(e){return To({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function LN(e){return To({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Jl(e){const t=Gr();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function DN(e){return To({...e,select:t=>e.select?e.select(t.context):t.context})}var lr=rN();const oL=dm(lr);function lL(e,t){const n=Gr(),r=GM(t),{activeProps:s,inactiveProps:a,activeOptions:l,to:c,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:m,replace:b,startTransition:x,resetScroll:v,viewTransition:k,children:C,target:S,disabled:N,style:_,className:R,onClick:I,onBlur:A,onFocus:L,onMouseEnter:D,onMouseLeave:U,onTouchStart:z,ignoreBlocker:K,params:W,search:J,hash:te,state:V,mask:B,reloadDocument:G,unsafeRelative:X,from:ae,_fromLocation:M,...P}=e,$=CN(),j=y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),re=br(n.stores.location,Q=>Q,(Q,Y)=>Q.href===Y.href),oe=y.useMemo(()=>{const Q={_fromLocation:re,...j};return n.buildLocation(Q)},[n,re,j]),ce=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,de=oe.maskedLocation?oe.maskedLocation.external:oe.external,fe=y.useMemo(()=>mL(ce,de,n.history,N),[N,de,ce,n.history]),ve=y.useMemo(()=>{if(fe?.external)return Ah(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!pL(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Ah(c,n.protocolAllowlist)?void 0:c}catch{}},[c,fe,n.protocolAllowlist]),Fe=y.useMemo(()=>{if(ve)return!1;if(l?.exact){if(!d5(re.pathname,oe.pathname,n.basepath))return!1}else{const Q=Rh(re.pathname,n.basepath),Y=Rh(oe.pathname,n.basepath);if(!(Q.startsWith(Y)&&(Q.length===Y.length||Q[Y.length]==="/")))return!1}return(l?.includeSearch??!0)&&!io(re.search,oe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?$&&re.hash===oe.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,re,ve,$,oe.hash,oe.pathname,oe.search,n.basepath]),De=Fe?Ja(s,{})??uL:D0,Ee=Fe?D0:Ja(a,{})??D0,Ie=[R,De.className,Ee.className].filter(Boolean).join(" "),Be=(_||De.style||Ee.style)&&{..._,...De.style,...Ee.style},[Ge,$e]=y.useState(!1),Me=y.useRef(!1),we=e.reloadDocument||ve?!1:d??n.options.defaultPreload,ye=f??n.options.defaultPreloadDelay??0,Oe=y.useCallback(()=>{n.preloadRoute({...j,_builtLocation:oe}).catch(Q=>{console.warn(Q),console.warn(Y5)})},[n,j,oe]);YM(r,y.useCallback(Q=>{Q?.isIntersecting&&Oe()},[Oe]),hL,{disabled:!!N||we!=="viewport"}),y.useEffect(()=>{Me.current||!N&&we==="render"&&(Oe(),Me.current=!0)},[N,Oe,we]);const je=Q=>{const Y=Q.currentTarget.getAttribute("target"),F=S!==void 0?S:Y;if(!N&&!gL(Q)&&!Q.defaultPrevented&&(!F||F==="_self")&&Q.button===0){Q.preventDefault(),lr.flushSync(()=>{$e(!0)});const le=n.subscribe("onResolved",()=>{le(),$e(!1)});n.navigate({...j,replace:b,resetScroll:v,hashScrollIntoView:m,startTransition:x,viewTransition:k,ignoreBlocker:K})}};if(ve)return{...P,ref:r,href:ve,...C&&{children:C},...S&&{target:S},...N&&{disabled:N},..._&&{style:_},...R&&{className:R},...I&&{onClick:I},...A&&{onBlur:A},...L&&{onFocus:L},...D&&{onMouseEnter:D},...U&&{onMouseLeave:U},...z&&{onTouchStart:z}};const ee=Q=>{if(N||we!=="intent")return;if(!ye){Oe();return}const Y=Q.currentTarget;if(ic.has(Y))return;const F=setTimeout(()=>{ic.delete(Y),Oe()},ye);ic.set(Y,F)},me=Q=>{N||we!=="intent"||Oe()},ie=Q=>{if(N||!we||!ye)return;const Y=Q.currentTarget,F=ic.get(Y);F&&(clearTimeout(F),ic.delete(Y))};return{...P,...De,...Ee,href:fe?.href,ref:r,onClick:vl([I,je]),onBlur:vl([A,ie]),onFocus:vl([L,ee]),onMouseEnter:vl([D,ee]),onMouseLeave:vl([U,ie]),onTouchStart:vl([z,me]),disabled:!!N,target:S,...Be&&{style:Be},...Ie&&{className:Ie},...N&&cL,...Fe&&dL,...$&&Ge&&fL}}var D0={},uL={className:"active"},cL={role:"link","aria-disabled":!0},dL={"data-status":"active","aria-current":"page"},fL={"data-transitioning":"transitioning"},ic=new WeakMap,hL={rootMargin:"100px"},vl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function mL(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function pL(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var sd=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=lL(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return y.createElement("a",d,l)}return y.createElement(n,a,l)});function gL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var bL=class extends SN{constructor(e){super(e),this.useMatch=t=>To({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>DN({...t,from:this.id}),this.useSearch=t=>LN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>pm({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>MN({...t,from:this.id}),this.useLoaderData=t=>IN({...t,from:this.id}),this.useNavigate=()=>Jl({from:this.fullPath}),this.Link=Ue.forwardRef((t,n)=>h.jsx(sd,{ref:n,from:this.fullPath,...t}))}};function So(e){return new bL(e)}var xL=class extends G5{constructor(e){super(e),this.useMatch=t=>To({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>DN({...t,from:this.id}),this.useSearch=t=>LN({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>pm({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>MN({...t,from:this.id}),this.useLoaderData=t=>IN({...t,from:this.id}),this.useNavigate=()=>Jl({from:this.fullPath}),this.Link=Ue.forwardRef((t,n)=>h.jsx(sd,{ref:n,from:this.fullPath,...t}))}};function yL(e){return new xL(e)}function EL(e){const t=Gr(),n=`not-found-${br(t.stores.location,r=>r.pathname)}-${br(t.stores.status,r=>r)}`;return h.jsx(ex,{getResetKey:()=>n,onCatch:(r,s)=>{if(or(r))e.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(or(r))return e.fallback?.(r);throw r},children:e.children})}function vL(){return h.jsx("p",{children:"Not Found"})}function _l(e){return h.jsx(h.Fragment,{children:e.children})}function jN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(vL,{})}function TL(e){return null}function SL(){return TL(Gr()),null}var CL=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,wL=(e,t)=>e[0]===t[0]&&e[1]===t[1],PN=y.memo(function({matchId:t}){const n=Gr(),r=n.stores.matchStores.get(t);r||mi();const s=br(n.stores.loadedAt,l=>l),a=br(r,l=>l,CL);return h.jsx(kL,{router:n,matchId:t,resetKey:s,matchState:y.useMemo(()=>{const l=a.routeId,c=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function kL({router:e,matchId:t,resetKey:n,matchState:r}){const s=e.routesById[r.routeId],a=s.options.pendingComponent??e.options.defaultPendingComponent,l=a?h.jsx(a,{}):null,c=s.options.errorComponent??e.options.defaultErrorComponent,d=s.options.onCatch??e.options.defaultOnCatch,f=s.isRoot?s.options.notFoundComponent??e.options.notFoundRoute?.options.component:s.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!s.isRoot||s.options.wrapInSuspense||p)&&(s.options.wrapInSuspense??a??(s.options.errorComponent?.preload||p))?y.Suspense:_l,b=c?ex:_l,x=f?EL:_l;return h.jsxs(s.isRoot?s.options.shellComponent??_l:_l,{children:[h.jsx(mm.Provider,{value:t,children:h.jsx(m,{fallback:l,children:h.jsx(b,{getResetKey:()=>n,errorComponent:c||tx,onCatch:(v,k)=>{if(or(v))throw v.routeId??=r.routeId,v;d?.(v,k)},children:h.jsx(x,{fallback:v=>{if(v.routeId??=r.routeId,!f||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return y.createElement(f,v)},children:p||r._displayPending?h.jsx(X5,{fallback:l,children:h.jsx(ES,{matchId:t})}):h.jsx(ES,{matchId:t})})})})}),r.parentRouteId===ao?h.jsxs(h.Fragment,{children:[h.jsx(NL,{}),e.options.scrollRestoration&&aN?h.jsx(SL,{}):null]}):null]})}function NL(){const e=Gr(),t=y.useRef();return xc(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...Ll(e.stores.location.get(),r??n)}),t.current=n},[br(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var ES=y.memo(function({matchId:t}){const n=Gr(),r=(p,m)=>n.getMatch(p.id)?._nonReactive[m]??p._nonReactive[m],s=n.stores.matchStores.get(t);s||mi();const a=br(s,p=>p),l=a.routeId,c=n.routesById[l],d=y.useMemo(()=>{const p=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return p?JSON.stringify(p):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),f=y.useMemo(()=>{const p=c.options.component??n.options.defaultComponent;return p?h.jsx(p,{},d):h.jsx(BN,{})},[d,c.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const p=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(p){const m=n.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const b=Hl();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw r(a,"loadPromise")}if(a.status==="notFound")return or(a.error)||mi(),jN(n,c,a.error);if(a.status==="redirected")throw Or(a.error)||mi(),r(a,"loadPromise");if(a.status==="error")throw a.error;return f}),BN=y.memo(function(){const t=Gr(),n=y.useContext(mm);let r,s=!1,a;{const f=n?t.stores.matchStores.get(n):void 0;[r,s]=br(f,p=>[p?.routeId,p?.globalNotFound??!1],wL),a=br(t.stores.matchesId,p=>p[p.findIndex(m=>m===n)+1])}const l=r?t.routesById[r]:void 0,c=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(s)return l||mi(),jN(t,l,void 0);if(!a)return null;const d=h.jsx(PN,{matchId:a});return r===ao?h.jsx(y.Suspense,{fallback:c,children:d}):d});function _L(){const e=Gr(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),s=br(e.stores.isLoading,m=>m),a=br(e.stores.hasPending,m=>m),l=S0(s),c=s||n||a,d=S0(c),f=s||a,p=S0(f);return e.startTransition=m=>{r(!0),y.startTransition(()=>{m(),r(!1)})},y.useEffect(()=>{const m=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return hi(e.latestLocation.publicHref)!==hi(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{m()}},[e,e.history]),xc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),xc(()=>{l&&!s&&e.emit({type:"onLoad",...Ll(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,s]),xc(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Ll(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,p,e]),xc(()=>{if(d&&!c){const m=Ll(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),NN(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,d,e]),null}function AL(){const e=Gr(),t=e.routesById[ao].options.pendingComponent??e.options.defaultPendingComponent,n=t?h.jsx(t,{}):null,r=h.jsxs(typeof document<"u"&&e.ssr?_l:y.Suspense,{fallback:n,children:[h.jsx(_L,{}),h.jsx(RL,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:r}):r}function RL(){const e=Gr(),t=br(e.stores.firstId,s=>s),n=br(e.stores.loadedAt,s=>s),r=t?h.jsx(PN,{matchId:t}):null;return h.jsx(mm.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:h.jsx(ex,{getResetKey:()=>n,errorComponent:tx,onCatch:void 0,children:r})})}var OL=e=>({createMutableStore:pS,createReadonlyStore:pS,batch:NN}),IL=e=>new ML(e),ML=class extends z5{constructor(e){super(e,OL)}};function LL({router:e,children:t,...n}){lN(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=h.jsx(wN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:r}):r}function DL({router:e,...t}){return h.jsx(LL,{router:e,...t,children:h.jsx(AL,{})})}function jL(e){const t=Gr({warn:e?.router===void 0}),n=e?.router||t;return br(n.stores.__store,ON(e,n))}function zN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=zN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gm(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=zN(e))&&(r&&(r+=" "),r+=t);return r}const vS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TS=gm,HN=(e,t)=>n=>{var r;if(t?.variants==null)return TS(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const b=vS(p)||vS(m);return s[f][b]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,b]=p;return b===void 0||(f[m]=b),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:b,...x}=p;return Object.entries(x).every(v=>{let[k,C]=v;return Array.isArray(C)?C.includes({...a,...c}[k]):{...a,...c}[k]===C})?[...f,m,b]:f},[]);return TS(e,l,d,n?.class,n?.className)},PL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},BL=(e,t)=>({classGroupId:e,validator:t}),UN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Mh="-",SS=[],zL="arbitrary..",HL=e=>{const t=FL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return UL(l);const c=l.split(Mh),d=c[0]===""&&c.length>1?1:0;return FN(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?PL(f,d):d:f||SS}return n[l]||SS}}},FN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const f=FN(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(Mh):e.slice(t).join(Mh),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},UL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zL+r:void 0})(),FL=e=>{const{theme:t,classGroups:n}=e;return $L(n,t)},$L=(e,t)=>{const n=UN();for(const r in e){const s=e[r];nx(s,n,r,t)}return n},nx=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];VL(l,t,n,r)}},VL=(e,t,n,r)=>{if(typeof e=="string"){qL(e,t,n);return}if(typeof e=="function"){YL(e,t,n,r);return}GL(e,t,n,r)},qL=(e,t,n)=>{const r=e===""?t:$N(t,e);r.classGroupId=n},YL=(e,t,n,r)=>{if(KL(e)){nx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(BL(n,e))},GL=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[c,d]=s[l];nx(d,$N(t,c),n,r)}},$N=(e,t)=>{let n=e;const r=t.split(Mh),s=r.length;for(let a=0;a<s;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=UN(),n.nextPart.set(l,c)),n=c}return n},KL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},$b="!",CS=":",WL=[],wS=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),QL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,c=0,d=0,f;const p=s.length;for(let k=0;k<p;k++){const C=s[k];if(l===0&&c===0){if(C===CS){a.push(s.slice(d,k)),d=k+1;continue}if(C==="/"){f=k;continue}}C==="["?l++:C==="]"?l--:C==="("?c++:C===")"&&c--}const m=a.length===0?s:s.slice(d);let b=m,x=!1;m.endsWith($b)?(b=m.slice(0,-1),x=!0):m.startsWith($b)&&(b=m.slice(1),x=!0);const v=f&&f>d?f-d:void 0;return wS(a,x,b,v)};if(t){const s=t+CS,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):wS(WL,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},ZL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",d=t.has(l);c||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},JL=e=>({cache:XL(e.cacheSize),parseClassName:QL(e),sortModifiers:ZL(e),postfixLookupClassGroupIds:eD(e),...HL(e)}),eD=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},tD=/\s+/,nD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:l}=t,c=[],d=e.trim().split(tD);let f="";for(let p=d.length-1;p>=0;p-=1){const m=d[p],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:k,maybePostfixModifierPosition:C}=n(m);if(b){f=m+(f.length>0?" "+f:f);continue}let S=!!C,N;if(S){const L=k.substring(0,C);N=r(L);const D=N&&l[N]?r(k):void 0;D&&D!==N&&(N=D,S=!1)}else N=r(k);if(!N){if(!S){f=m+(f.length>0?" "+f:f);continue}if(N=r(k),!N){f=m+(f.length>0?" "+f:f);continue}S=!1}const _=x.length===0?"":x.length===1?x[0]:a(x).join(":"),R=v?_+$b:_,I=R+N;if(c.indexOf(I)>-1)continue;c.push(I);const A=s(N,S);for(let L=0;L<A.length;++L){const D=A[L];c.push(R+D)}f=m+(f.length>0?" "+f:f)}return f},rD=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=VN(n))&&(s&&(s+=" "),s+=r);return s},VN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=VN(e[r]))&&(n&&(n+=" "),n+=t);return n},Vb=(e,...t)=>{let n,r,s,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=JL(f),r=n.cache.get,s=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=nD(d,n);return s(d,p),p};return a=l,(...d)=>a(rD(...d))},sD=[],Bn=e=>{const t=n=>n[e]||sD;return t.isThemeGetter=!0,t},qN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qi=e=>iD.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),ks=e=>!!e&&Number.isInteger(Number(e)),j0=e=>e.endsWith("%")&&vt(e.slice(0,-1)),li=e=>aD.test(e),GN=()=>!0,dD=e=>oD.test(e)&&!lD.test(e),rx=()=>!1,fD=e=>uD.test(e),hD=e=>cD.test(e),mD=e=>!We(e)&&!Qe(e),pD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),gD=e=>ga(e,WN,rx),We=e=>qN.test(e),Va=e=>ga(e,QN,dD),kS=e=>ga(e,CD,vt),bD=e=>ga(e,JN,GN),xD=e=>ga(e,ZN,rx),NS=e=>ga(e,KN,rx),yD=e=>ga(e,XN,hD),Pf=e=>ga(e,e3,fD),Qe=e=>YN.test(e),ac=e=>Co(e,QN),ED=e=>Co(e,ZN),_S=e=>Co(e,KN),vD=e=>Co(e,WN),TD=e=>Co(e,XN),Bf=e=>Co(e,e3,!0),SD=e=>Co(e,JN,!0),ga=(e,t,n)=>{const r=qN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Co=(e,t,n=!1)=>{const r=YN.exec(e);return r?r[1]?t(r[1]):n:!1},KN=e=>e==="position"||e==="percentage",XN=e=>e==="image"||e==="url",WN=e=>e==="length"||e==="size"||e==="bg-size",QN=e=>e==="length",CD=e=>e==="number",ZN=e=>e==="family-name",JN=e=>e==="number"||e==="weight",e3=e=>e==="shadow",qb=()=>{const e=Bn("color"),t=Bn("font"),n=Bn("text"),r=Bn("font-weight"),s=Bn("tracking"),a=Bn("leading"),l=Bn("breakpoint"),c=Bn("container"),d=Bn("spacing"),f=Bn("radius"),p=Bn("shadow"),m=Bn("inset-shadow"),b=Bn("text-shadow"),x=Bn("drop-shadow"),v=Bn("blur"),k=Bn("perspective"),C=Bn("aspect"),S=Bn("ease"),N=Bn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...R(),Qe,We],A=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],D=()=>[Qe,We,d],U=()=>[Qi,"full","auto",...D()],z=()=>[ks,"none","subgrid",Qe,We],K=()=>["auto",{span:["full",ks,Qe,We]},ks,Qe,We],W=()=>[ks,"auto",Qe,We],J=()=>["auto","min","max","fr",Qe,We],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...D()],G=()=>[Qi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],X=()=>[Qi,"screen","full","dvw","lvw","svw","min","max","fit",...D()],ae=()=>[Qi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],M=()=>[e,Qe,We],P=()=>[...R(),_S,NS,{position:[Qe,We]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",vD,gD,{size:[Qe,We]}],re=()=>[j0,ac,Va],oe=()=>["","none","full",f,Qe,We],ce=()=>["",vt,ac,Va],de=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[vt,j0,_S,NS],Fe=()=>["","none",v,Qe,We],De=()=>["none",vt,Qe,We],Ee=()=>["none",vt,Qe,We],Ie=()=>[vt,Qe,We],Be=()=>[Qi,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[li],breakpoint:[li],color:[GN],container:[li],"drop-shadow":[li],ease:["in","out","in-out"],font:[mD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[li],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[li],shadow:[li],spacing:["px",vt],text:[li],"text-shadow":[li],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qi,We,Qe,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Qe,We]}],"container-named":[pD],columns:[{columns:[vt,We,Qe,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[ks,"auto",Qe,We]}],basis:[{basis:[Qi,"full","auto",c,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,Qi,"auto","initial","none",We]}],grow:[{grow:["",vt,Qe,We]}],shrink:[{shrink:["",vt,Qe,We]}],order:[{order:[ks,"first","last","none",Qe,We]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[c,"screen",...G()]}],"min-w":[{"min-w":[c,"screen","none",...G()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,ac,Va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,SD,bD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",j0,We]}],"font-family":[{font:[ED,xD,t]}],"font-features":[{"font-features":[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Qe,We]}],"line-clamp":[{"line-clamp":[vt,"none",Qe,kS]}],leading:[{leading:[a,...D()]}],"list-image":[{"list-image":["none",Qe,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Qe,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Qe,Va]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[vt,"auto",Qe,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"tab-size":[{tab:[ks,Qe,We]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ks,Qe,We],radial:["",Qe,We],conic:[ks,Qe,We]},TD,yD]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Qe,We]}],"outline-w":[{outline:["",vt,ac,Va]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,Bf,Pf]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",m,Bf,Pf]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[vt,Va]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",b,Bf,Pf]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[vt,Qe,We]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qe,We]}],filter:[{filter:["","none",Qe,We]}],blur:[{blur:Fe()}],brightness:[{brightness:[vt,Qe,We]}],contrast:[{contrast:[vt,Qe,We]}],"drop-shadow":[{"drop-shadow":["","none",x,Bf,Pf]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",vt,Qe,We]}],"hue-rotate":[{"hue-rotate":[vt,Qe,We]}],invert:[{invert:["",vt,Qe,We]}],saturate:[{saturate:[vt,Qe,We]}],sepia:[{sepia:["",vt,Qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Qe,We]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Qe,We]}],"backdrop-invert":[{"backdrop-invert":["",vt,Qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Qe,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Qe,We]}],ease:[{ease:["linear","initial",S,Qe,We]}],delay:[{delay:[vt,Qe,We]}],animate:[{animate:["none",N,Qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Qe,We]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[Qe,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],zoom:[{zoom:[ks,Qe,We]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe,We]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[vt,ac,Va,kS]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wD=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Al(e,"cacheSize",t),Al(e,"prefix",n),Al(e,"experimentalParseClassName",r),zf(e.theme,a.theme),zf(e.classGroups,a.classGroups),zf(e.conflictingClassGroups,a.conflictingClassGroups),zf(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Al(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Al(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),Hf(e.theme,s.theme),Hf(e.classGroups,s.classGroups),Hf(e.conflictingClassGroups,s.conflictingClassGroups),Hf(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Yb(e,s,"postfixLookupClassGroups"),Yb(e,s,"orderSensitiveModifiers"),e),Al=(e,t,n)=>{n!==void 0&&(e[t]=n)},zf=(e,t)=>{if(t)for(const n in t)Al(e,n,t[n])},Hf=(e,t)=>{if(t)for(const n in t)Yb(e,t,n)},Yb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},kD=(e,...t)=>typeof e=="function"?Vb(qb,e,...t):Vb(()=>wD(qb(),e),...t),t3=Vb(qb),ND=kD({extend:{classGroups:{"font-size":[{text:["display-xl","display-lg","display-md","display-sm","heading-1","heading-2","heading-3","body","body-sm","label","code"]}]}}});function Se(...e){return ND(gm(e))}const _D=HN("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-accent-hover",outline:"border-border bg-surface hover:border-border-strong hover:bg-surface-hover",secondary:"bg-secondary text-secondary-foreground hover:bg-surface-hover",ghost:"text-fg-2 hover:bg-surface-hover hover:text-foreground",destructive:"text-danger hover:bg-danger-bg",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3",xs:"h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-2.5 text-xs",lg:"h-9 gap-1.5 px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}}),rt=y.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...s},a)=>h.jsx("button",{ref:a,type:r,"data-slot":"button",className:Se(_D({variant:t,size:n,className:e})),...s}));rt.displayName="Button";const AD=HN("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap",{variants:{variant:{neutral:"border-border bg-surface text-fg-2",accent:"border-transparent bg-accent-bg text-fg-1",success:"border-transparent bg-success-bg text-success",warning:"border-transparent bg-warning-bg text-warning",danger:"border-transparent bg-danger-bg text-danger",info:"border-transparent bg-info-bg text-info"},mono:{true:"font-mono text-code",false:""}},defaultVariants:{variant:"neutral",mono:!1}});function pn({className:e,variant:t="neutral",mono:n,dot:r,children:s,...a}){return h.jsxs("span",{"data-slot":"badge",className:Se(AD({variant:t,mono:n,className:e})),...a,children:[r?h.jsx("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-current"}):null,s]})}function pi({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Se("rounded-lg border border-border bg-surface",e),...t})}function gi({className:e,...t}){return h.jsx("div",{className:Se("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function bi({className:e,...t}){return h.jsx("h3",{className:Se("text-heading-3 font-semibold text-text",e),...t})}function xi({className:e,...t}){return h.jsx("div",{className:Se("px-4 pb-4",e),...t})}const sn=y.forwardRef(({className:e,...t},n)=>h.jsx("input",{ref:n,"data-slot":"input",className:Se("h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));sn.displayName="Input";const n3=y.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,"data-slot":"textarea",className:Se("w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));n3.displayName="Textarea";const r3={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},s3={...r3,position:"fixed",top:0,left:0},RD={...r3,position:"absolute"},AS={};function xr(e,t){const n=y.useRef(AS);return n.current===AS&&(n.current=e(t)),n}function co(e,t,n,r){const s=xr(i3).current;return ID(s,e,t,n,r)&&a3(s,[e,t,n,r]),s.callback}function OD(e){const t=xr(i3).current;return MD(t,e)&&a3(t,e),t.callback}function i3(){return{callback:null,cleanup:null,refs:[]}}function ID(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function MD(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function a3(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[s]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=r[s];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function sx(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}function LD(e){const[t,n]=y.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function DD(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function RS({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=y.useRef(e!==void 0),[a,l]=y.useState(t),c=s?e:a,d=y.useCallback(f=>{s||l(f)},[]);return[c,d]}const jD=()=>{},Ye=typeof document<"u"?y.useLayoutEffect:jD,ix={...PM},P0=ix.useInsertionEffect,PD=P0&&P0!==ix.useLayoutEffect?P0:e=>e();function tt(e){const t=xr(BD).current;return t.next=e,PD(t.effect),t.trampoline}function BD(){const e={next:void 0,callback:zD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zD(){}function En(e){const t=xr(HD,e).current;return t.next=e,Ye(t.effect),t}function HD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function UD(e,t){return function(r,...s){const a=new URL(e);return a.searchParams.set("code",r.toString()),s.forEach(l=>a.searchParams.append("args[]",l)),`${t} error #${r}; visit ${a} for the full message.`}}const Dn=UD("https://base-ui.com/production-error","Base UI"),ze=(e,t,n,r,s,a,...l)=>{if(l.length>0)throw new Error(Dn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var o3=AN();const FD=parseInt(y.version,10);function ax(e){return FD>=e}const Gb=[];let Kb;function $D(){return Kb}function VD(e){Gb.push(e)}function ox(e){const t=(n,r)=>{const s=xr(qD).current;let a;try{Kb=s;for(const l of Gb)l.before(s);a=e(n,r);for(const l of Gb)l.after(s);s.didInitialize=!0}finally{Kb=void 0}return a};return t.displayName=e.displayName||e.name,t}function l3(e){return y.forwardRef(ox(e))}function qD(){return{didInitialize:!1}}const YD=ax(19),GD=YD?XD:WD;function ft(e,t,n,r,s){return GD(e,t,n,r,s)}function KD(e,t,n,r,s){const a=y.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return o3.useSyncExternalStore(e.subscribe,a,a)}VD({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),o3.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function XD(e,t,n,r,s){const a=$D();if(!a)return KD(e,t,n,r,s);const l=a.syncIndex;a.syncIndex+=1;let c;return a.didInitialize?(c=a.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,s))&&(c.store!==e&&(a.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=s,c.value=t(e.getSnapshot(),n,r,s))):(c={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},a.syncHooks.push(c)),c.value}function WD(e,t,n,r,s){return RN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,s))}class u3{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return ft(this,t,n,r,s)}}function qn(){}const Ul=Object.freeze([]),dn=Object.freeze({});class bm extends u3{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){y.useDebugValue(t);const r=this;Ye(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ye(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ye(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){y.useDebugValue(t);const r=this,s=n!==void 0;Ye(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const a=this.selectors[t];return a(this.state,n,r,s)}useState(t,n,r,s){return y.useDebugValue(t),ft(this,this.selectors[t],n,r,s)}useContextCallback(t,n){y.useDebugValue(t);const r=tt(n??qn);this.context[t]=r}useStateSetter(t){const n=y.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(a=>{const l=r(a);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}function xm(){return typeof window<"u"}function nr(e){return lx(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wi(e){var t;return(t=(lx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lx(e){return xm()?e instanceof Node||e instanceof an(e).Node:!1}function St(e){return xm()?e instanceof Element||e instanceof an(e).Element:!1}function cn(e){return xm()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function Fl(e){return!xm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}function wo(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function QD(e){return/^(table|td|th)$/.test(nr(e))}function ym(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ZD=/transform|translate|scale|rotate|perspective|filter/,JD=/paint|layout|strict|content/,qa=e=>!!e&&e!=="none";let B0;function ux(e){const t=St(e)?qr(e):e;return qa(t.transform)||qa(t.translate)||qa(t.scale)||qa(t.rotate)||qa(t.perspective)||!cx()&&(qa(t.backdropFilter)||qa(t.filter))||ZD.test(t.willChange||"")||JD.test(t.contain||"")}function ej(e){let t=Ti(e);for(;cn(t)&&!yi(t);){if(ux(t))return t;if(ym(t))return null;t=Ti(t)}return null}function cx(){return B0==null&&(B0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),B0}function yi(e){return/^(html|body|#document)$/.test(nr(e))}function qr(e){return an(e).getComputedStyle(e)}function Em(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ti(e){if(nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fl(e)&&e.host||wi(e);return Fl(t)?t.host:t}function c3(e){const t=Ti(e);return yi(t)?(e.ownerDocument||e).body:cn(t)&&wo(t)?t:c3(t)}function Yc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=c3(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=an(s);if(a){const c=Xb(l);return t.concat(l,l.visualViewport||[],wo(s)?s:[],c&&n?Yc(c):[])}else return t.concat(s,Yc(s,[],n))}function Xb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ds(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function _t(e){return e?.ownerDocument||document}function Tt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const tj=[];function dx(e){y.useEffect(e,tj)}const Uf=null;class nj{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ff=new nj;class Is{static create(){return new Is}static request(t){return Ff.request(t)}static cancel(t){return Ff.cancel(t)}currentId=Uf;request(t){this.cancel(),this.currentId=Ff.request(()=>{this.currentId=Uf,t()})}cancel=()=>{this.currentId!==Uf&&(Ff.cancel(this.currentId),this.currentId=Uf)};disposeEffect=()=>this.cancel}function $l(){const e=xr(Is.create).current;return dx(e.disposeEffect),e}const oc=0;class gs{static create(){return new gs}currentId=oc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oc,n()},t)}isStarted(){return this.currentId!==oc}clear=()=>{this.currentId!==oc&&(clearTimeout(this.currentId),this.currentId=oc)};disposeEffect=()=>this.clear}function Kn(){const e=xr(gs.create).current;return dx(e.disposeEffect),e}function rj(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:sj,platform:ij,maxTouchPoints:aj}=rj(),vm=sj.toLowerCase(),Gc=ij.toLowerCase(),Tm=/^i(os$|p)/.test(Gc)||Gc==="macintel"&&aj>1,OS="android",Wb=Gc===OS||vm.includes(OS),fx=!Tm&&Gc.startsWith("mac");Gc.startsWith("win");const oj=fx||Tm,ba=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ba&&vm.includes("firefox");!ba&&vm.includes("chrom");const lj=oj,hx=/jsdom|happydom/.test(vm);function Os(e){e.preventDefault(),e.stopPropagation()}function uj(e){return"nativeEvent"in e}function mx(e){return e.pointerType===""&&e.isTrusted?!0:Wb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function d3(e){return hx?!1:!Wb&&e.width===0&&e.height===0||Wb&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function fo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function cj(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Qb="data-base-ui-focusable",f3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Sm="ArrowLeft",Cm="ArrowRight",h3="ArrowUp",px="ArrowDown";function Rr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function nt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Fl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function gr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Lh(e,t){if(!St(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function z0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function dj(e){return e.matches("html,body")}function wm(e){return cn(e)&&e.matches(f3)}function fj(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${f3}`)!=null}function Zb(e){return e?e.getAttribute("role")==="combobox"&&wm(e):!1}function hj(e){if(!e||hx)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Dh(e){return e?e.hasAttribute(Qb)?e:e.querySelector(`[${Qb}]`)||e:null}function mj(e,t){return t!=null&&!fo(t)?0:typeof e=="function"?e():e}function Vl(e,t,n){const r=mj(e,n);return typeof r=="number"?r:r?.[t]}function IS(e){return typeof e=="function"?e():e}function m3(e,t){return t||e==="click"||e==="mousedown"}function pj(e){return e?.includes("mouse")&&e!=="mousedown"}const eu="none",tu="trigger-press",Yn="trigger-hover",Dl="trigger-focus",km="outside-press",_c="item-press",gj="close-press",ho="focus-out",Nm="escape-key",Jb="list-navigation",p3="cancel-open",yc="sibling-open",bj="disabled",gx="imperative-action",xj="window-resize";function mt(e,t,n,r){let s=!1,a=!1;const l=dn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...l}}const g3=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new gs,currentIdRef:{current:null},currentContextRef:{current:null}});function yj(e,t){e.current=t.current}function Ej(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=y.useRef(n),a=y.useRef(n),l=y.useRef(null),c=y.useRef(null),d=Kn();return Ye(()=>{if(a.current=n,!l.current){s.current=n;return}s.current={open:Vl(s.current,"open"),close:Vl(n,"close")}},[n,l,s,a]),h.jsx(g3.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:c,timeout:d}),[r,d]),children:t})}function vj(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),a=y.useContext(g3),{currentIdRef:l,delayRef:c,timeoutMs:d,initialDelayRef:f,currentContextRef:p,hasProvider:m,timeout:b}=a,[x,v]=y.useState(!1),k=y.useRef(n),C=y.useRef(!1);return Ye(()=>{k.current=n},[n]),Ye(()=>()=>{C.current=!0},[]),Ye(()=>{function S(){C.current||v(!1),p.current?.setIsInstantPhase(!1),l.current=null,p.current=null,c.current=f.current,b.clear()}if(l.current&&!n&&l.current===s){if(v(!1),d){const N=s;return b.start(d,()=>{r.select("open")||l.current&&l.current!==N||S()}),()=>{(k.current||l.current!==N)&&b.clear()}}S()}},[n,s,l,c,d,f,p,b,r]),Ye(()=>{if(!n)return;const S=p.current,N=l.current;b.clear(),p.current={onOpenChange:r.setOpen,setIsInstantPhase:v},l.current=s,c.current={open:0,close:Vl(f.current,"close")},N!==null&&N!==s?(v(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,mt(eu))):(v(!1),S?.setIsInstantPhase(!1))},[n,s,r,l,c,f,p,b]),Ye(()=>()=>{if(l.current===s){if(p.current=null,!k.current)return;l.current=null,yj(c,f),b.clear()}},[p,l,c,s,f,b]),y.useMemo(()=>({hasProvider:m,delayRef:c,isInstantPhase:x}),[m,c,x])}const ql=y.forwardRef(function(t,n){const[r,s]=y.useState();Ye(()=>{lj&&ba&&s("button")},[]);const a={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:s3,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),Tj=["top","right","bottom","left"],Yl=Math.min,Ei=Math.max,jh=Math.round,$f=Math.floor,vi=e=>({x:e,y:e}),Sj={left:"right",right:"left",bottom:"top",top:"bottom"};function b3(e,t,n){return Ei(e,Yl(t,n))}function Si(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function xa(e){return e.split("-")[1]}function bx(e){return e==="x"?"y":"x"}function xx(e){return e==="y"?"height":"width"}function ls(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yx(e){return bx(ls(e))}function Cj(e,t,n){n===void 0&&(n=!1);const r=xa(e),s=yx(e),a=xx(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Ph(l)),[l,Ph(l)]}function wj(e){const t=Ph(e);return[e1(e),t,e1(t)]}function e1(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const MS=["left","right"],LS=["right","left"],kj=["top","bottom"],Nj=["bottom","top"];function _j(e,t,n){switch(e){case"top":case"bottom":return n?t?LS:MS:t?MS:LS;case"left":case"right":return t?kj:Nj;default:return[]}}function Aj(e,t,n,r){const s=xa(e);let a=_j($r(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(e1)))),a}function Ph(e){const t=$r(e);return Sj[t]+e.slice(t.length)}function Rj(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function x3(e){return typeof e!="number"?Rj(e):{top:e,right:e,bottom:e,left:e}}function Kc(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function DS(e,t){return t<0||t>=e.length}function H0(e,t){return Ol(e.current,{disabledIndices:t})}function jS(e,t){return Ol(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ol(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let a=t;do a+=n?-s:s;while(a>=0&&a<=e.length-1&&y3(e,a,r));return a}function y3(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const s=e[t];return s?_m(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function Oj(e){return e.visibility==="hidden"||e.visibility==="collapse"}function _m(e,t=e?qr(e):null){return!e||!e.isConnected||!t||Oj(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Ij='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Mj(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Fl(n)?n.host:null}function t1(e){for(const t of Array.from(e.children))if(nr(t)==="summary")return t;return null}function Lj(e,t){const n=t1(t);return!!n&&(e===n||nt(n,e))}function E3(e){const t=e?nr(e):"";return e!=null&&e.matches(Ij)&&(t!=="summary"||e.parentElement!=null&&nr(e.parentElement)==="details"&&t1(e.parentElement)===e)&&(t!=="details"||t1(e)==null)&&(t!=="input"||e.type!=="hidden")}function v3(e){if(!E3(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Mj(t)){const n=t!==e,r=nr(t)==="slot";if(t.hasAttribute("inert")||n&&nr(t)==="details"&&!t.open&&!Lj(e,t)||t.hasAttribute("hidden")||!r&&!Dj(t,n))return!1}return!0}function Dj(e,t){const n=qr(e);return t?n.display!=="none":_m(e,n)}function T3(e){const t=e.tabIndex;if(t<0){const n=nr(e);if(n==="details"||n==="audio"||n==="video"||cn(e)&&e.isContentEditable)return 0}return t}function U0(e){if(nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function jj(e,t){const n=U0(e);if(!n)return!0;const r=t.find(s=>{const a=U0(s);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(s=>{const a=U0(s);return a?.name===n.name&&a.form===n.form})===n}function S3(e){if(cn(e)&&nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return cn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function C3(e,t){S3(e).forEach(n=>{E3(n)&&t.push(n),C3(n,t)})}function w3(e,t,n){S3(e).forEach(r=>{cn(r)&&r.matches(t)&&n.push(r),w3(r,t,n)})}function Ex(e){return v3(e)&&T3(e)>=0}function k3(e){const t=[];return C3(e,t),t.filter(v3)}function id(e){const t=k3(e);return t.filter(n=>T3(n)>=0&&jj(n,t))}function N3(e,t){const n=id(e),r=n.length;if(r===0)return;const s=Rr(_t(e)),a=n.indexOf(s),l=a===-1?t===1?0:r-1:a+t;return n[l]}function vx(e){return N3(_t(e).body,1)||e}function _3(e){return N3(_t(e).body,-1)||e}function A3(e,t){if(!e)return null;const n=id(_t(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const a=(s+t+r)%r;return n[a]}function Pj(e){return A3(e,1)}function Bj(e){return A3(e,-1)}function jl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!nt(n,r)}function zj(e){id(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function PS(e){const t=[];w3(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ha(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...ha(e,s.id,n)])}function BS(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(a=>a.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function Xc(e){return`data-base-ui-${e}`}let Vf=0;function yh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(Vf);function a(){s&&!s()||e?.focus({preventScroll:n})}if(r)return a(),qn;const l=requestAnimationFrame(a);return Vf=l,()=>{Vf===l&&(cancelAnimationFrame(l),Vf=0)}}const F0={inert:new WeakMap,"aria-hidden":new WeakMap},zS="data-base-ui-inert",n1={inert:new WeakSet,"aria-hidden":new WeakSet};let lc=new WeakMap,$0=0;function Hj(e){return n1[e]}function R3(e){return e?Fl(e)?e.host:R3(e.parentNode):null}const HS=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=R3(n);return e.contains(r)?r:null}).filter(n=>n!=null),US=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},FS=(e,t,n)=>{const r=[],s=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{nr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function Uj(e,t,n,r,{mark:s=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,c=null;const d=HS(t,e),f=s?FS(t,US(d),new Set(d)):[],p=[],m=[];if(a){const b=F0[a],x=Hj(a);c=x,l=b;const v=HS(t,Array.from(t.querySelectorAll("[aria-live]"))),k=d.concat(v);FS(t,US(k),new Set(k)).forEach(S=>{const N=S.getAttribute(a),_=N!==null&&N!=="false",R=(b.get(S)||0)+1;b.set(S,R),p.push(S),R===1&&_&&x.add(S),_||S.setAttribute(a,a==="inert"?"":"true")})}return s&&f.forEach(b=>{const x=(lc.get(b)||0)+1;lc.set(b,x),m.push(b),x===1&&b.setAttribute(zS,"")}),$0+=1,()=>{l&&p.forEach(b=>{const v=(l.get(b)||0)-1;l.set(b,v),v||(!c?.has(b)&&a&&b.removeAttribute(a),c?.delete(b))}),s&&m.forEach(b=>{const x=(lc.get(b)||0)-1;lc.set(b,x),x||b.removeAttribute(zS)}),$0-=1,$0||(F0.inert=new WeakMap,F0["aria-hidden"]=new WeakMap,n1.inert=new WeakSet,n1["aria-hidden"]=new WeakSet,lc=new WeakMap)}}function $S(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,a=_t(e[0]).body;return Uj(e,a,n,r,{mark:s})}let VS=0;function Fj(e,t="mui"){const[n,r]=y.useState(e),s=e||n;return y.useEffect(()=>{n==null&&(VS+=1,r(`${t}-${VS}`))},[n,t]),s}const qS=ix.useId;function mo(e,t){if(qS!==void 0){const n=qS();return e??(t?`${t}-${n}`:n)}return Fj(e,t)}function YS(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(ax(19)?n?.ref:t.ref)??null}function r1(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $j(e,t){const n={};for(const r in e){const s=e[r];if(t?.hasOwnProperty(r)){const a=t[r](s);a!=null&&Object.assign(n,a);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Vj(e,t){return typeof e=="function"?e(t):e}function qj(e,t){return typeof e=="function"?e(t):e}const Tx={};function Ir(e,t,n,r,s){if(!n&&!r&&!s&&!e)return Bh(t);let a=Bh(e);return t&&(a=Ec(a,t)),n&&(a=Ec(a,n)),r&&(a=Ec(a,r)),s&&(a=Ec(a,s)),a}function Yj(e){if(e.length===0)return Tx;if(e.length===1)return Bh(e[0]);let t=Bh(e[0]);for(let n=1;n<e.length;n+=1)t=Ec(t,e[n]);return t}function Bh(e){return Sx(e)?{...I3(e,Tx)}:Gj(e)}function Ec(e,t){return Sx(t)?I3(t,e):Kj(e,t)}function Gj(e){const t={...e};for(const n in t){const r=t[n];O3(n,r)&&(t[n]=M3(r))}return t}function Kj(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=r1(e.style,r);break}case"className":{e[n]=L3(e.className,r);break}default:O3(n,r)?e[n]=Xj(e[n],r):e[n]=r}}return e}function O3(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Sx(e){return typeof e=="function"}function I3(e,t){return Sx(e)?e(t):e??Tx}function Xj(e,t){return t?e?(...n)=>{const r=n[0];if(D3(r)){const a=r;zh(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const s=t(...n);return e?.(...n),s}:M3(t):e}function M3(e){return e&&((...t)=>{const n=t[0];return D3(n)&&zh(n),e(...t)})}function zh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function L3(e,t){return t?e?t+" "+e:t:e}function D3(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Nn(e,t,n={}){const r=t.render,s=Wj(t,n);if(n.enabled===!1)return null;const a=n.state??dn;return Jj(e,r,s,a)}function Wj(e,t={}){const{className:n,style:r,render:s}=e,{state:a=dn,ref:l,props:c,stateAttributesMapping:d,enabled:f=!0}=t,p=f?Vj(n,a):void 0,m=f?qj(r,a):void 0,b=f?$j(a,d):dn,x=f&&c?Qj(c):void 0,v=f?r1(b,x)??{}:dn;return typeof document<"u"&&(f?Array.isArray(l)?v.ref=OD([v.ref,YS(s),...l]):v.ref=co(v.ref,YS(s),l):co(null,null)),f?(p!==void 0&&(v.className=L3(v.className,p)),m!==void 0&&(v.style=r1(v.style,m)),v):dn}function Qj(e){return Array.isArray(e)?Yj(e):Ir(void 0,e)}const Zj=Symbol.for("react.lazy");function Jj(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Ir(n,t.props);s.ref=n.ref;let a=t;return a?.$$typeof===Zj&&(a=y.Children.toArray(t)[0]),y.cloneElement(a,s)}if(e&&typeof e=="string")return e8(e,n);throw new Error(Dn(8))}function e8(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}const t8=500,n8=500,r8={style:{transition:"none"}},j3="data-base-ui-click-trigger",P3={fallbackAxisSide:"none"},B3={fallbackAxisSide:"end"},s8={clipPath:"inset(50%)",position:"fixed",top:0,left:0},z3=y.createContext(null),H3=()=>y.useContext(z3),i8=Xc("portal");function U3(e={}){const{ref:t,container:n,componentProps:r=dn,elementProps:s}=e,a=mo(),c=H3()?.portalNode,[d,f]=y.useState(null),[p,m]=y.useState(null),b=tt(C=>{C!==null&&m(C)}),x=y.useRef(null);Ye(()=>{if(n===null){x.current&&(x.current=null,m(null),f(null));return}if(a==null)return;const C=(n&&(lx(n)?n:n.current))??c??document.body;if(C==null){x.current&&(x.current=null,m(null),f(null));return}x.current!==C&&(x.current=C,m(null),f(C))},[n,c,a]);const v=Nn("div",r,{ref:[t,b],props:[{id:a,[i8]:""},s]});return{portalNode:p,portalSubtree:d&&v?lr.createPortal(v,d):null}}const Cx=y.forwardRef(function(t,n){const{render:r,className:s,style:a,children:l,container:c,renderGuards:d,...f}=t,{portalNode:p,portalSubtree:m}=U3({container:c,ref:n,componentProps:t,elementProps:f}),b=y.useRef(null),x=y.useRef(null),v=y.useRef(null),k=y.useRef(null),[C,S]=y.useState(null),N=y.useRef(!1),_=C?.modal,R=C?.open,I=typeof d=="boolean"?d:!!C&&!C.modal&&C.open&&!!p;y.useEffect(()=>{if(!p||_)return;function L(D){p&&D.relatedTarget&&jl(D)&&(D.type==="focusin"?N.current&&(PS(p),N.current=!1):(zj(p),N.current=!0))}return Ds(Tt(p,"focusin",L,!0),Tt(p,"focusout",L,!0))},[p,_]),Ye(()=>{!p||R!==!0||!N.current||(PS(p),N.current=!1)},[R,p]);const A=y.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:k,portalNode:p,setFocusManagerState:S}),[p]);return h.jsxs(y.Fragment,{children:[m,h.jsxs(z3.Provider,{value:A,children:[I&&p&&h.jsx(ql,{"data-type":"outside",ref:b,onFocus:L=>{if(jl(L,p))v.current?.focus();else{const D=C?C.domReference:null;_3(D)?.focus()}}}),I&&p&&h.jsx("span",{"aria-owns":p.id,style:s8}),p&&lr.createPortal(l,p),I&&p&&h.jsx(ql,{"data-type":"outside",ref:x,onFocus:L=>{if(jl(L,p))k.current?.focus();else{const D=C?C.domReference:null;vx(D)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,mt(ho,L.nativeEvent))}}})]})]})});function F3(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class wx{nodesRef={current:[]};events=F3();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const $3=y.createContext(null),V3=y.createContext(null),ya=()=>y.useContext($3)?.id||null,Ea=e=>{const t=y.useContext(V3);return e??t};function q3(e){const t=mo(),n=Ea(e),r=ya();return Ye(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function a8(e){const{children:t,id:n}=e,r=ya();return h.jsx($3.Provider,{value:y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function o8(e){const{children:t,externalTree:n}=e,r=xr(()=>n??new wx).current;return h.jsx(V3.Provider,{value:r,children:t})}function ui(e){return e==null?e:"current"in e?e.current:e}function l8(e,t){const n=an(gr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const GS=20;let ua=[];function kx(){ua=ua.filter(e=>e.deref()?.isConnected)}function KS(e){kx(),e&&nr(e)!=="body"&&(ua.push(new WeakRef(e)),ua.length>GS&&(ua=ua.slice(-GS)))}function XS(){return kx(),ua[ua.length-1]?.deref()}function u8(e){return e?Ex(e)?e:id(e)[0]||e:null}function WS(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=k3(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return Ex(s)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Nx(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:f="",nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:v}=e,k="rootStore"in t?t.rootStore:t,C=k.useState("open"),S=k.useState("domReferenceElement"),N=k.useState("floatingElement"),{events:_,dataRef:R}=k.context,I=tt(()=>R.current.floatingContext?.nodeId),A=s===!1,L=Zb(S)&&A,D=En(s),U=En(a),z=En(f),K=En(C),W=Ea(x),J=H3(),te=y.useRef(!1),V=y.useRef(!1),B=y.useRef(!1),G=y.useRef(null),X=y.useRef(""),ae=y.useRef(""),M=y.useRef(null),P=y.useRef(null),$=co(M,b,J?.beforeInsideRef),j=co(P,J?.afterInsideRef),re=Kn(),oe=Kn(),ce=$l(),de=J!=null,fe=Dh(N),ve=tt((Ee=fe)=>Ee?id(Ee):[]),Fe=tt(()=>v?.().filter(Ee=>Ee!=null)??[]);y.useEffect(()=>{if(r||!c)return;function Ee(Be){Be.key==="Tab"&&nt(fe,Rr(_t(fe)))&&ve().length===0&&!L&&Os(Be)}const Ie=_t(fe);return Tt(Ie,"keydown",Ee)},[r,fe,c,L,ve]),y.useEffect(()=>{if(r||!C)return;const Ee=_t(fe);function Ie(){B.current=!1}function Be($e){const Me=gr($e),we=Fe(),ye=nt(N,Me)||nt(S,Me)||nt(J?.portalNode,Me)||we.some(Oe=>Oe===Me||nt(Oe,Me));B.current=!ye,ae.current=$e.pointerType||"keyboard",Me?.closest(`[${j3}]`)&&(V.current=!0,oe.start(0,()=>{V.current=!1}))}function Ge(){ae.current="keyboard"}return Ds(Tt(Ee,"pointerdown",Be,!0),Tt(Ee,"pointerup",Ie,!0),Tt(Ee,"pointercancel",Ie,!0),Tt(Ee,"keydown",Ge,!0),Ie)},[r,N,S,fe,C,J,oe,Fe]),y.useEffect(()=>{if(r||!d)return;const Ee=_t(fe);function Ie(){V.current=!0,oe.start(0,()=>{V.current=!1})}function Be(we){const ye=gr(we);Ex(ye)&&(G.current=ye)}function Ge(we){const ye=we.relatedTarget,Oe=we.currentTarget,je=gr(we);c&&ye==null&&je!=null&&nt(N,je)&&KS(je),queueMicrotask(()=>{const ee=I(),me=k.context.triggerElements,ie=Fe(),Q=ye?.hasAttribute(Xc("focus-guard"))&&[M.current,P.current,J?.beforeInsideRef.current,J?.afterInsideRef.current,J?.beforeOutsideRef.current,J?.afterOutsideRef.current,ui(m),ui(p)].includes(ye),Y=!(nt(S,ye)||nt(N,ye)||nt(ye,N)||nt(J?.portalNode,ye)||ie.some(F=>F===ye||nt(F,ye))||ye!=null&&me.hasElement(ye)||me.hasMatchingElement(F=>nt(F,ye))||Q||W&&(ha(W.nodesRef.current,ee).find(F=>nt(F.context?.elements.floating,ye)||nt(F.context?.elements.domReference,ye))||BS(W.nodesRef.current,ee).find(F=>[F.context?.elements.floating,Dh(F.context?.elements.floating)].includes(ye)||F.context?.elements.domReference===ye)));if(Oe===S&&fe&&WS(fe),l&&Oe!==S&&!_m(je)&&Rr(Ee)===Ee.body){if(cn(fe)&&(fe.focus(),l==="popup")){ce.request(()=>{fe.focus()});return}const F=ve(),le=G.current,Ce=(le&&F.includes(le)?le:null)||F[F.length-1]||fe;cn(Ce)&&Ce.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(L||!c)&&ye&&Y&&!V.current&&(L||ye!==XS())&&(te.current=!0,k.setOpen(!1,mt(ho,we)))})}function $e(){B.current||(R.current.insideReactTree=!0,re.start(0,()=>{R.current.insideReactTree=!1}))}const Me=cn(S)?S:null;if(!(!N&&!Me))return Ds(Me&&Tt(Me,"focusout",Ge),Me&&Tt(Me,"pointerdown",Ie),N&&Tt(N,"focusin",Be),N&&Tt(N,"focusout",Ge),N&&J&&Tt(N,"focusout",$e,!0))},[r,S,N,fe,c,W,J,k,d,l,ve,L,I,R,re,oe,ce,p,m,Fe]),y.useEffect(()=>{if(r||!N||!C)return;const Ee=Array.from(J?.portalNode?.querySelectorAll(`[${Xc("portal")}]`)||[]),Be=(W?BS(W.nodesRef.current,I()):[]).find(Oe=>Zb(Oe.context?.elements.domReference||null))?.context?.elements.domReference,$e=[...[N,...Ee,M.current,P.current,J?.beforeOutsideRef.current,J?.afterOutsideRef.current,...Fe()],Be,ui(m),ui(p),L?S:null].filter(Oe=>Oe!=null),Me=$S($e,{ariaHidden:c||L,mark:!1}),we=[N,...Ee].filter(Oe=>Oe!=null),ye=$S(we);return()=>{ye(),Me()}},[C,r,S,N,c,J,L,W,I,p,m,Fe]),Ye(()=>{if(!C||r||!cn(fe))return;const Ee=_t(fe),Ie=Rr(Ee);queueMicrotask(()=>{const Be=D.current,Ge=typeof Be=="function"?Be(z.current||""):Be;if(Ge===void 0||Ge===!1||nt(fe,Ie))return;let Me=null;const we=()=>(Me==null&&(Me=ve(fe)),Me[0]||fe);let ye;Ge===!0||Ge===null?ye=we():ye=ui(Ge),ye=ye||we();const Oe=nt(fe,Rr(Ee));yh(ye,{preventScroll:ye===fe,shouldFocus(){if(!K.current)return!1;if(Oe)return!0;const je=Rr(Ee);return!(je!==ye&&nt(fe,je))}})})},[r,C,fe,ve,D,z,K]),Ye(()=>{if(r||!fe)return;const Ee=_t(fe),Ie=Rr(Ee),Be=z.current==null;KS(Ie);function Ge(Me){if(Me.open||(X.current=l8(Me.nativeEvent,ae.current)),Me.reason===Yn&&Me.nativeEvent.type==="mouseleave"&&(te.current=!0),Me.reason===km)if(Me.nested)te.current=!1;else if(mx(Me.nativeEvent)||d3(Me.nativeEvent))te.current=!1;else{let we=!1;_t(fe).createElement("div").focus({get preventScroll(){return we=!0,!1}}),we?te.current=!1:te.current=!0}}_.on("openchange",Ge);function $e(){const Me=U.current;let we=typeof Me=="function"?Me(X.current):Me;if(we===void 0||we===!1)return null;we===null&&(we=!0);const ye=S?.isConnected?S:null,Oe=Ie?.isConnected&&nr(Ie)!=="body"?Ie:null;let je=Be?Oe||ye:ye||Oe;return je||(je=XS()||null),typeof we=="boolean"?je:ui(we)||je||null}return()=>{_.off("openchange",Ge);const Me=Rr(Ee),we=Fe(),ye=nt(N,Me)||we.some(ee=>ee===Me||nt(ee,Me))||W&&ha(W.nodesRef.current,I(),!1).some(ee=>nt(ee.context?.elements.floating,Me)),Oe=U.current,je=$e();queueMicrotask(()=>{const ee=u8(je),me=typeof Oe!="boolean";Oe&&!te.current&&cn(ee)&&(!(!me&&ee!==Me&&Me!==Ee.body)||ye)&&ee.focus({preventScroll:!0}),te.current=!1})}},[r,N,fe,U,z,_,W,S,I,Fe]),Ye(()=>{if(!ba||C||!N)return;const Ee=Rr(_t(N));!cn(Ee)||!wm(Ee)||nt(N,Ee)&&Ee.blur()},[C,N]),Ye(()=>{if(!(r||!J))return J.setFocusManagerState({modal:c,closeOnFocusOut:d,open:C,onOpenChange:k.setOpen,domReference:S}),()=>{J.setFocusManagerState(null)}},[r,J,c,C,k,d,S]),Ye(()=>{if(!(r||!fe))return WS(fe),()=>{queueMicrotask(kx)}},[r,fe]);const De=!r&&(c?!L:!0)&&(de||c);return h.jsxs(y.Fragment,{children:[De&&h.jsx(ql,{"data-type":"inside",ref:$,onFocus:Ee=>{if(c){const Ie=ve();yh(Ie[Ie.length-1])}else J?.portalNode&&(te.current=!1,jl(Ee,J.portalNode)?vx(S)?.focus():ui(m??J.beforeOutsideRef)?.focus())}}),n,De&&h.jsx(ql,{"data-type":"inside",ref:j,onFocus:Ee=>{c?yh(ve()[0]):J?.portalNode&&(d&&(te.current=!0),jl(Ee,J.portalNode)?_3(S)?.focus():ui(p??J.afterOutsideRef)?.focus())}})]})}function _x(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:d=tu}=t,f="rootStore"in e?e.rootStore:e,p=f.context.dataRef,m=y.useRef(void 0),b=$l(),x=Kn(),v=y.useMemo(()=>{function k(S,N,_,R){const I=mt(d,N,_);S&&R==="touch"&&c>0?x.start(c,()=>{f.setOpen(!0,I)}):f.setOpen(S,I)}function C(S,N,_){const R=p.current.openEvent,I=f.select("domReferenceElement")!==N;return S&&I||!S||!s?!0:R&&l?!_(R.type):!1}return{onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const N=m.current,_=S.nativeEvent,R=f.select("open");if(S.button!==0||r==="click"||fo(N,!0)&&a)return;const I=C(R,S.currentTarget,D=>D==="click"||D==="mousedown"),A=gr(_);if(wm(A)){k(I,_,A,N);return}const L=S.currentTarget;b.request(()=>{k(I,_,L,N)})},onClick(S){if(r==="mousedown-only")return;const N=m.current;if(r==="mousedown"&&N){m.current=void 0;return}if(fo(N,!0)&&a)return;const _=f.select("open"),R=C(_,S.currentTarget,I=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");k(R,S.nativeEvent,S.currentTarget,N)},onKeyDown(){m.current=void 0}}},[p,r,a,d,f,l,s,b,x,c]);return y.useMemo(()=>n?{reference:v}:dn,[n,v])}function c8(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){const a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let f=a.width,p=a.height,m=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&c&&(r=a.y-t.y),m-=n||0,b-=r||0,f=0,p=0,!s||d?(f=t.axis==="y"?a.width:0,p=t.axis==="x"?a.height:0,m=l&&t.x!=null?t.x:m,b=c&&t.y!=null?t.y:b):s&&!d&&(p=t.axis==="x"?a.height:p,f=t.axis==="y"?a.width:f),s=!0,{width:f,height:p,x:m,y:b,top:b,right:m+f,bottom:b+p,left:m}}}}function QS(e){return e!=null&&e.clientX!=null}function d8(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,a=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),d=s.context.dataRef,f=y.useRef(!1),p=y.useRef(null),[m,b]=y.useState(),[x,v]=y.useState([]),k=tt(R=>{s.set("positionReference",R)}),C=tt((R,I,A)=>{f.current||d.current.openEvent&&!QS(d.current.openEvent)||s.set("positionReference",c8(A??c,{x:R,y:I,axis:r,dataRef:d,pointerType:m}))}),S=tt(R=>{a?p.current||(C(R.clientX,R.clientY,R.currentTarget),v([])):C(R.clientX,R.clientY,R.currentTarget)}),N=fo(m)?l:a;y.useEffect(()=>{if(!n){k(c);return}if(!N)return;function R(){p.current?.(),p.current=null}const I=an(l);function A(L){const D=gr(L);nt(l,D)?R():C(L.clientX,L.clientY)}return!d.current.openEvent||QS(d.current.openEvent)?p.current=Tt(I,"mousemove",A):k(c),R},[N,n,l,d,c,s,C,k,x]),y.useEffect(()=>()=>{s.set("positionReference",null)},[s]),y.useEffect(()=>{n&&!l&&(f.current=!1)},[n,l]),y.useEffect(()=>{!n&&a&&(f.current=!0)},[n,a]);const _=y.useMemo(()=>{function R(I){b(I.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:S,onMouseEnter:S}},[S]);return y.useMemo(()=>n?{reference:_,trigger:_}:{},[n,_])}function f8(){return!1}function h8(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Am(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:a="sloppy",referencePress:l=f8,bubbles:c,externalTree:d}=t,f="rootStore"in e?e.rootStore:e,p=f.useState("open"),m=f.useState("floatingElement"),{dataRef:b}=f.context,x=Ea(d),v=tt(typeof s=="function"?s:()=>!1),k=typeof s=="function"?v:s,C=k!==!1,S=tt(()=>a),{escapeKey:N,outsidePress:_}=h8(c),R=y.useRef(!1),I=y.useRef(!1),A=y.useRef(!1),L=y.useRef(!1),D=y.useRef(""),U=y.useRef(null),z=Kn(),K=Kn(),W=tt(()=>{K.clear(),b.current.insideReactTree=!1}),J=tt($=>{const j=b.current.floatingContext?.nodeId;return(x?ha(x.nodesRef.current,j):[]).some(oe=>oe.context?.open&&!oe.context.dataRef.current[$])}),te=tt($=>z0($,f.select("floatingElement"))||z0($,f.select("domReferenceElement"))),V=tt($=>{l()&&f.setOpen(!1,mt(tu,$.nativeEvent))}),B=tt($=>{if(!p||!n||!r||$.key!=="Escape"||L.current||!N&&J("__escapeKeyBubbles"))return;const j=uj($)?$.nativeEvent:$,re=mt(Nm,j);f.setOpen(!1,re),re.isCanceled||$.preventDefault(),!N&&!re.isPropagationAllowed&&$.stopPropagation()}),G=tt(()=>{b.current.insideReactTree=!0,K.start(0,W)}),X=tt($=>{if(!p||!n||$.button!==0)return;const j=gr($.nativeEvent);nt(f.select("floatingElement"),j)&&(R.current||(R.current=!0,I.current=!1))}),ae=tt($=>{!p||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&R.current&&(I.current=!0)});y.useEffect(()=>{if(!p||!n)return;b.current.__escapeKeyBubbles=N,b.current.__outsidePressBubbles=_;const $=new gs,j=new gs;function re(){$.clear(),L.current=!0}function oe(){$.start(ba?5:0,()=>{L.current=!1})}function ce(){A.current=!0,j.start(0,()=>{A.current=!1})}function de(){R.current=!1,I.current=!1}function fe(){const ie=D.current,Q=ie==="pen"||!ie?"mouse":ie,Y=S(),F=typeof Y=="function"?Y():Y;return typeof F=="string"?F:F[Q]}function ve(ie){const Q=fe();return Q==="intentional"&&ie.type!=="click"||Q==="sloppy"&&ie.type==="click"}function Fe(ie){const Q=b.current.floatingContext?.nodeId,Y=x&&ha(x.nodesRef.current,Q).some(F=>z0(ie,F.context?.elements.floating));return te(ie)||Y}function De(ie){if(ve(ie)){ie.type!=="click"&&!te(ie)&&(j.clear(),A.current=!1),W();return}if(b.current.insideReactTree){W();return}const Q=gr(ie),Y=`[${Xc("inert")}]`,F=St(Q)?Q.getRootNode():null,le=Array.from((Fl(F)?F:_t(f.select("floatingElement"))).querySelectorAll(Y)),Ce=f.context.triggerElements;if(Q&&(Ce.hasElement(Q)||Ce.hasMatchingElement(Ve=>nt(Ve,Q))))return;let Re=St(Q)?Q:null;for(;Re&&!yi(Re);){const Ve=Ti(Re);if(yi(Ve)||!St(Ve))break;Re=Ve}if(!(le.length&&St(Q)&&!dj(Q)&&!nt(Q,f.select("floatingElement"))&&le.every(Ve=>!nt(Re,Ve)))){if(cn(Q)&&!("touches"in ie)){const Ve=yi(Q),ot=qr(Q),et=/auto|scroll/,dt=Ve||et.test(ot.overflowX),ut=Ve||et.test(ot.overflowY),qe=dt&&Q.clientWidth>0&&Q.scrollWidth>Q.clientWidth,Rt=ut&&Q.clientHeight>0&&Q.scrollHeight>Q.clientHeight,jt=ot.direction==="rtl",lt=Rt&&(jt?ie.offsetX<=Q.offsetWidth-Q.clientWidth:ie.offsetX>Q.clientWidth),Lt=qe&&ie.offsetY>Q.clientHeight;if(lt||Lt)return}if(!Fe(ie)){if(fe()==="intentional"&&A.current){j.clear(),A.current=!1;return}typeof k=="function"&&!k(ie)||J("__outsidePressBubbles")||(f.setOpen(!1,mt(km,ie)),W())}}}function Ee(ie){fe()!=="sloppy"||ie.pointerType==="touch"||!f.select("open")||!n||te(ie)||De(ie)}function Ie(ie){if(fe()!=="sloppy"||!f.select("open")||!n||te(ie))return;const Q=ie.touches[0];Q&&(U.current={startTime:Date.now(),startX:Q.clientX,startY:Q.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{U.current&&(U.current.dismissOnTouchEnd=!1,U.current.dismissOnMouseDown=!1)}))}function Be(ie,Q){const Y=gr(ie);if(!Y)return;const F=Tt(Y,ie.type,()=>{Q(ie),F()})}function Ge(ie){D.current="touch",Be(ie,Ie)}function $e(ie){z.clear(),ie.type==="pointerdown"&&(D.current=ie.pointerType),!(ie.type==="mousedown"&&U.current&&!U.current.dismissOnMouseDown)&&Be(ie,Q=>{Q.type==="pointerdown"?Ee(Q):De(Q)})}function Me(ie){if(!R.current)return;const Q=I.current;if(de(),fe()==="intentional"){if(ie.type==="pointercancel"){Q&&ce();return}if(!Fe(ie)){if(Q){ce();return}typeof k=="function"&&!k(ie)||(j.clear(),A.current=!0,W())}}}function we(ie){if(fe()!=="sloppy"||!U.current||te(ie))return;const Q=ie.touches[0];if(!Q)return;const Y=Math.abs(Q.clientX-U.current.startX),F=Math.abs(Q.clientY-U.current.startY),le=Math.sqrt(Y*Y+F*F);le>5&&(U.current.dismissOnTouchEnd=!0),le>10&&(De(ie),z.clear(),U.current=null)}function ye(ie){Be(ie,we)}function Oe(ie){fe()!=="sloppy"||!U.current||te(ie)||(U.current.dismissOnTouchEnd&&De(ie),z.clear(),U.current=null)}function je(ie){Be(ie,Oe)}const ee=_t(m),me=Ds(r&&Ds(Tt(ee,"keydown",B),Tt(ee,"compositionstart",re),Tt(ee,"compositionend",oe)),C&&Ds(Tt(ee,"click",$e,!0),Tt(ee,"pointerdown",$e,!0),Tt(ee,"pointerup",Me,!0),Tt(ee,"pointercancel",Me,!0),Tt(ee,"mousedown",$e,!0),Tt(ee,"mouseup",Me,!0),Tt(ee,"touchstart",Ge,!0),Tt(ee,"touchmove",ye,!0),Tt(ee,"touchend",je,!0)));return()=>{me(),$.clear(),j.clear(),de(),A.current=!1}},[b,m,r,C,k,p,n,N,_,B,W,S,J,te,x,f,z]),y.useEffect(W,[k,W]);const M=y.useMemo(()=>({onKeyDown:B,onPointerDown:V,onClick:V}),[B,V]),P=y.useMemo(()=>({onKeyDown:B,onPointerDown:ae,onMouseDown:ae,onClickCapture:G,onMouseDownCapture($){G(),X($)},onPointerDownCapture($){G(),X($)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[B,G,X,ae]);return y.useMemo(()=>n?{reference:M,floating:P,trigger:M}:{},[n,M,P])}function ZS(e,t,n){let{reference:r,floating:s}=e;const a=ls(t),l=yx(t),c=xx(l),d=$r(t),f=a==="y",p=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,b=r[c]/2-s[c]/2;let x;switch(d){case"top":x={x:p,y:r.y-s.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-s.width,y:m};break;default:x={x:r.x,y:r.y}}const v=xa(t);return v&&(x[l]+=b*(v==="end"?1:-1)*(n&&f?-1:1)),x}async function m8(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:b=!1,padding:x=0}=Si(t,e),v=x3(x),C=c[b?m==="floating"?"reference":"floating":m],S=Kc(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),N=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),R=await(a.isElement==null?void 0:a.isElement(_))&&await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1},I=Kc(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(S.top-I.top+v.top)/R.y,bottom:(I.bottom-S.bottom+v.bottom)/R.y,left:(S.left-I.left+v.left)/R.x,right:(I.right-S.right+v.right)/R.x}}const p8=50,g8=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:m8},d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=ZS(f,r,d),b=r,x=0;const v={};for(let k=0;k<a.length;k++){const C=a[k];if(!C)continue;const{name:S,fn:N}=C,{x:_,y:R,data:I,reset:A}=await N({x:p,y:m,initialPlacement:r,placement:b,strategy:s,middlewareData:v,rects:f,platform:c,elements:{reference:e,floating:t}});p=_??p,m=R??m,v[S]={...v[S],...I},A&&x<p8&&(x++,typeof A=="object"&&(A.placement&&(b=A.placement),A.rects&&(f=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:p,y:m}=ZS(f,b,d)),k=-1)}return{x:p,y:m,placement:b,strategy:s,middlewareData:v}},b8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:k=!0,...C}=Si(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=$r(s),N=ls(c),_=$r(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),I=b||(_||!k?[Ph(c)]:wj(c)),A=v!=="none";!b&&A&&I.push(...Aj(c,k,v,R));const L=[c,...I],D=await d.detectOverflow(t,C),U=[];let z=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&U.push(D[S]),m){const te=Cj(s,l,R);U.push(D[te[0]],D[te[1]])}if(z=[...z,{placement:s,overflows:U}],!U.every(te=>te<=0)){var K,W;const te=(((K=a.flip)==null?void 0:K.index)||0)+1,V=L[te];if(V&&(!(m==="alignment"?N!==ls(V):!1)||z.every(X=>ls(X.placement)===N?X.overflows[0]>0:!0)))return{data:{index:te,overflows:z},reset:{placement:V}};let B=(W=z.filter(G=>G.overflows[0]<=0).sort((G,X)=>G.overflows[1]-X.overflows[1])[0])==null?void 0:W.placement;if(!B)switch(x){case"bestFit":{var J;const G=(J=z.filter(X=>{if(A){const ae=ls(X.placement);return ae===N||ae==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ae=>ae>0).reduce((ae,M)=>ae+M,0)]).sort((X,ae)=>X[1]-ae[1])[0])==null?void 0:J[0];G&&(B=G);break}case"initialPlacement":B=c;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function JS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eC(e){return Tj.some(t=>e[t]>=0)}const x8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=Si(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),c=JS(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:eC(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),c=JS(l,n.floating);return{data:{escapedOffsets:c,escaped:eC(c)}}}default:return{}}}}},Y3=new Set(["left","top"]);async function y8(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=$r(n),c=xa(n),d=ls(n)==="y",f=Y3.has(l)?-1:1,p=a&&d?-1:1,m=Si(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof v=="number"&&(x=c==="end"?v*-1:v),d?{x:x*p,y:b*f}:{x:b*f,y:x*p}}const E8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:c}=t,d=await y8(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},v8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:N=>{let{x:_,y:R}=N;return{x:_,y:R}}},...f}=Si(e,t),p={x:n,y:r},m=await a.detectOverflow(t,f),b=ls(s),x=bx(b);let v=p[x],k=p[b];const C=(N,_)=>b3(_+m[N==="y"?"top":"left"],_,_-m[N==="y"?"bottom":"right"]);l&&(v=C(x,v)),c&&(k=C(b,k));const S=d.fn({...t,[x]:v,[b]:k});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:l,[b]:c}}}}}},T8=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:l,rects:c,middlewareData:d}=t,{offset:f=0,mainAxis:p=!0,crossAxis:m=!0}=Si(e,t),b={x:s,y:a},x=ls(l),v=bx(x);let k=b[v],C=b[x];const S=Si(f,t),N=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(p){const I=v==="y"?"height":"width",A=c.reference[v]-c.floating[I]+N.mainAxis,L=c.reference[v]+c.reference[I]-N.mainAxis;k<A?k=A:k>L&&(k=L)}if(m){var _,R;const I=v==="y"?"width":"height",A=Y3.has($r(l)),L=c.reference[x]-c.floating[I]+(A&&((_=d.offset)==null?void 0:_[x])||0)+(A?0:N.crossAxis),D=c.reference[x]+c.reference[I]+(A?0:((R=d.offset)==null?void 0:R[x])||0)-(A?N.crossAxis:0);C<L?C=L:C>D&&(C=D)}return{[v]:k,[x]:C}}}},S8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Si(e,t),d=await s.detectOverflow(t,c),f=$r(n),p=xa(n),m=ls(n)==="y",{width:b,height:x}=r.floating;let v,k;f==="top"||f==="bottom"?(v=f,k=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(k=f,v=p==="end"?"top":"bottom");const C=x-d.top-d.bottom,S=b-d.left-d.right,N=Yl(x-d[v],C),_=Yl(b-d[k],S),R=t.middlewareData.shift,I=!R;let A=N,L=_;R!=null&&R.enabled.x&&(L=S),R!=null&&R.enabled.y&&(A=C),I&&!p&&(m?L=b-2*Ei(d.left,d.right):A=x-2*Ei(d.top,d.bottom)),await l({...t,availableWidth:L,availableHeight:A});const D=await s.getDimensions(a.floating);return b!==D.width||x!==D.height?{reset:{rects:!0}}:{}}}};function G3(e){const t=qr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=cn(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=jh(n)!==a||jh(r)!==l;return c&&(n=a,r=l),{width:n,height:r,$:c}}function Ax(e){return St(e)?e:e.contextElement}function Pl(e){const t=Ax(e);if(!cn(t))return vi(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=G3(t);let l=(a?jh(n.width):n.width)/r,c=(a?jh(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const C8=vi(0);function K3(e){const t=an(e);return!cx()||!t.visualViewport?C8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w8(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===an(e)}function po(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Ax(e);let l=vi(1);t&&(r?St(r)&&(l=Pl(r)):l=Pl(e));const c=w8(a,n,r)?K3(a):vi(0);let d=(s.left+c.x)/l.x,f=(s.top+c.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(a&&r){const b=an(a),x=St(r)?an(r):r;let v=b,k=Xb(v);for(;k&&x!==v;){const C=Pl(k),S=k.getBoundingClientRect(),N=qr(k),_=S.left+(k.clientLeft+parseFloat(N.paddingLeft))*C.x,R=S.top+(k.clientTop+parseFloat(N.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,m*=C.y,d+=_,f+=R,v=an(k),k=Xb(v)}}return Kc({width:p,height:m,x:d,y:f})}function Rm(e,t){const n=Em(e).scrollLeft;return t?t.left+n:po(wi(e)).left+n}function X3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Rm(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function k8(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=wi(r),c=t?ym(t.floating):!1;if(r===l||c&&a)return n;let d={scrollLeft:0,scrollTop:0},f=vi(1);const p=vi(0),m=cn(r);if((m||!a)&&((nr(r)!=="body"||wo(l))&&(d=Em(r)),m)){const x=po(r);f=Pl(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const b=l&&!m&&!a?X3(l,d):vi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+b.x,y:n.y*f.y-d.scrollTop*f.y+p.y+b.y}}function N8(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _8(e){const t=Em(e),n=e.ownerDocument.body,r=Ei(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Ei(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+Rm(e);const l=-t.scrollTop;return qr(n).direction==="rtl"&&(a+=Ei(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:a,y:l}}const A8=25;function R8(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=an(e),a=wi(e),l=s.visualViewport;let c=a.clientWidth,d=a.clientHeight,f=0,p=0;if(l){const b=!cx()||t==="fixed";r?b||(f=-l.offsetLeft,p=-l.offsetTop):(c=l.width,d=l.height,b&&(f=l.offsetLeft,p=l.offsetTop))}if(Rm(a)<=0){const b=a.ownerDocument,x=b.body,v=getComputedStyle(x),k=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,C=Math.abs(a.clientWidth-x.clientWidth-k),S=getComputedStyle(a).scrollbarGutter==="stable both-edges"?C/2:C;S<=A8&&(c-=S)}return{width:c,height:d,x:f,y:p}}function O8(e,t){const n=po(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Pl(e),l=e.clientWidth*a.x,c=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:l,height:c,x:d,y:f}}function tC(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=R8(e,n,t);else if(t==="document")r=_8(wi(e));else if(St(t))r=O8(t,n);else{const s=K3(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Kc(r)}function I8(e,t){const n=t.get(e);if(n)return n;let r=Yc(e,[],!1).filter(c=>St(c)&&nr(c)!=="body"),s=null;const a=qr(e).position==="fixed";let l=a?Ti(e):e;for(;St(l)&&!yi(l);){const c=qr(l),d=ux(l),f=s?s.position:a?"fixed":"";!d&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(m=>m!==l):s=c,l=Ti(l)}return t.set(e,r),r}function M8(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?ym(t)?[]:I8(t,this._c):[].concat(n),r],c=tC(t,l[0],s);let d=c.top,f=c.right,p=c.bottom,m=c.left;for(let b=1;b<l.length;b++){const x=tC(t,l[b],s);d=Ei(x.top,d),f=Yl(x.right,f),p=Yl(x.bottom,p),m=Ei(x.left,m)}return{width:f-m,height:p-d,x:m,y:d}}function L8(e){const{width:t,height:n}=G3(e);return{width:t,height:n}}function D8(e,t,n){const r=cn(t),s=wi(t),a=n==="fixed",l=po(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=vi(0);if((r||!a)&&((nr(t)!=="body"||wo(s))&&(c=Em(t)),r)){const b=po(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&s&&(d.x=Rm(s));const f=s&&!r&&!a?X3(s,c):vi(0),p=l.left+c.scrollLeft-d.x-f.x,m=l.top+c.scrollTop-d.y-f.y;return{x:p,y:m,width:l.width,height:l.height}}function V0(e){return qr(e).position==="static"}function nC(e,t){if(!cn(e)||qr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wi(e)===n&&(n=n.ownerDocument.body),n}function W3(e,t){const n=an(e);if(ym(e))return n;if(!cn(e)){let s=Ti(e);for(;s&&!yi(s);){if(St(s)&&!V0(s))return s;s=Ti(s)}return n}let r=nC(e,t);for(;r&&QD(r)&&V0(r);)r=nC(r,t);return r&&yi(r)&&V0(r)&&!ux(r)?n:r||ej(e)||n}const j8=async function(e){const t=this.getOffsetParent||W3,n=this.getDimensions,r=await n(e.floating);return{reference:D8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function P8(e){return qr(e).direction==="rtl"}const Q3={convertOffsetParentRelativeRectToViewportRelativeRect:k8,getDocumentElement:wi,getClippingRect:M8,getOffsetParent:W3,getElementRects:j8,getClientRects:N8,getDimensions:L8,getScale:Pl,isElement:St,isRTL:P8};function Z3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function B8(e,t,n){let r=null,s;const a=wi(e);function l(){var p;clearTimeout(s),(p=r)==null||p.disconnect(),r=null}function c(p,m){p===void 0&&(p=!1),m===void 0&&(m=1),l();const b=e.getBoundingClientRect(),{left:x,top:v,width:k,height:C}=b;if(p||t(),!k||!C)return;const S=$f(v),N=$f(a.clientWidth-(x+k)),_=$f(a.clientHeight-(v+C)),R=$f(x),A={rootMargin:-S+"px "+-N+"px "+-_+"px "+-R+"px",threshold:Ei(0,Yl(1,m))||1};let L=!0;function D(U){const z=U[0].intersectionRatio;if(!Z3(b,e.getBoundingClientRect()))return c();if(z!==m){if(!L)return c();z?c(!1,z):s=setTimeout(()=>{c(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(D,{...A,root:a.ownerDocument})}catch{r=new IntersectionObserver(D,A)}r.observe(e)}const d=an(e),f=()=>c(n);return d.addEventListener("resize",f),c(!0),()=>{d.removeEventListener("resize",f),l()}}function rC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Ax(e),p=s||a?[...f?Yc(f):[],...t?Yc(t):[]]:[];p.forEach(S=>{s&&S.addEventListener("scroll",n),a&&S.addEventListener("resize",n)});const m=f&&c?B8(f,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var _;(_=x)==null||_.observe(t)})),n()}),f&&!d&&x.observe(f),t&&x.observe(t));let v,k=d?po(e):null;d&&C();function C(){const S=po(e);k&&!Z3(k,S)&&n(),k=S,v=requestAnimationFrame(C)}return n(),()=>{var S;p.forEach(N=>{s&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),m?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(v)}}const z8=E8,H8=v8,U8=b8,F8=S8,$8=x8,V8=T8,q8=(e,t,n)=>{const r=new Map,s=n??{},a={...Q3,...s.platform,_c:r};return g8(e,t,{...s,platform:a})};var Y8=typeof document<"u",G8=function(){},Eh=Y8?y.useLayoutEffect:G8;function Hh(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,s;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(!Hh(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Hh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function J3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sC(e,t){const n=J3(e);return Math.round(t*n)/n}function q0(e){const t=y.useRef(e);return Eh(()=>{t.current=e}),t}function K8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(r);Hh(b,r)||x(r);const[v,k]=y.useState(null),[C,S]=y.useState(null),N=y.useCallback(X=>{X!==A.current&&(A.current=X,k(X))},[]),_=y.useCallback(X=>{X!==L.current&&(L.current=X,S(X))},[]),R=a||v,I=l||C,A=y.useRef(null),L=y.useRef(null),D=y.useRef(p),U=d!=null,z=q0(d),K=q0(s),W=q0(f),J=y.useCallback(()=>{if(!A.current||!L.current)return;const X={placement:t,strategy:n,middleware:b};K.current&&(X.platform=K.current),q8(A.current,L.current,X).then(ae=>{const M={...ae,isPositioned:W.current!==!1};te.current&&!Hh(D.current,M)&&(D.current=M,lr.flushSync(()=>{m(M)}))})},[b,t,n,K,W]);Eh(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(X=>({...X,isPositioned:!1})))},[f]);const te=y.useRef(!1);Eh(()=>(te.current=!0,()=>{te.current=!1}),[]),Eh(()=>{if(R&&(A.current=R),I&&(L.current=I),R&&I){if(z.current)return z.current(R,I,J);J()}},[R,I,J,z,U]);const V=y.useMemo(()=>({reference:A,floating:L,setReference:N,setFloating:_}),[N,_]),B=y.useMemo(()=>({reference:R,floating:I}),[R,I]),G=y.useMemo(()=>{const X={position:n,left:0,top:0};if(!B.floating)return X;const ae=sC(B.floating,p.x),M=sC(B.floating,p.y);return c?{...X,transform:"translate("+ae+"px, "+M+"px)",...J3(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:M}},[n,c,B.floating,p.x,p.y]);return y.useMemo(()=>({...p,update:J,refs:V,elements:B,floatingStyles:G}),[p,J,V,B,G])}const X8=(e,t)=>{const n=z8(e);return{name:n.name,fn:n.fn,options:[e,t]}},W8=(e,t)=>{const n=H8(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q8=(e,t)=>({fn:V8(e).fn,options:[e,t]}),Z8=(e,t)=>{const n=U8(e);return{name:n.name,fn:n.fn,options:[e,t]}},J8=(e,t)=>{const n=F8(e);return{name:n.name,fn:n.fn,options:[e,t]}},eP=(e,t)=>{const n=$8(e);return{name:n.name,fn:n.fn,options:[e,t]}},tP={open:ze(e=>e.open),transitionStatus:ze(e=>e.transitionStatus),domReferenceElement:ze(e=>e.domReferenceElement),referenceElement:ze(e=>e.positionReference??e.referenceElement),floatingElement:ze(e=>e.floatingElement),floatingId:ze(e=>e.floatingId)};class Om extends bm{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:F3(),nested:r,triggerElements:a},tP),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&cj(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function e_(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:a,onOpenChange:l}=e,c=t.useState("open"),d=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),p=t.context.triggerElements,m=l,b=y.useRef(null);r===void 0&&b.current===null&&(b.current=new Om({open:c,transitionStatus:void 0,referenceElement:d,floatingElement:f,triggerElements:p,onOpenChange:m,floatingId:s,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",s),Ye(()=>{const v={open:c,floatingId:s,referenceElement:d,floatingElement:f};St(d)&&(v.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(v.positionReference=d),x.update(v)},[c,s,d,f,x]),x.context.onOpenChange=m,x.context.nested=a,x}function Rx(e,t=!1,n=!1){const[r,s]=y.useState(e&&t?"idle":void 0),[a,l]=y.useState(e);return e&&!a&&(l(!0),s("starting")),!e&&a&&r!=="ending"&&!n&&s("ending"),!e&&!a&&r==="ending"&&s(void 0),Ye(()=>{if(!e&&a&&r!=="ending"&&n){const c=Is.request(()=>{s("ending")});return()=>{Is.cancel(c)}}},[e,a,r,n]),Ye(()=>{if(!e||t)return;const c=Is.request(()=>{s(void 0)});return()=>{Is.cancel(c)}},[t,e]),Ye(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&s("starting");const c=Is.request(()=>{s("idle")});return()=>{Is.cancel(c)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let Wc=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const nP={[Wc.startingStyle]:""},rP={[Wc.endingStyle]:""},nu={transitionStatus(e){return e==="starting"?nP:e==="ending"?rP:null}};function t_(e,t=!1,n=!0){const r=$l();return tt((s,a=null)=>{r.cancel();const l=ui(e);if(l==null)return;const c=l,d=()=>{lr.flushSync(s)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function f(){Promise.all(c.getAnimations().map(p=>p.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const p=c.getAnimations();!a?.aborted&&p.length>0&&p.some(m=>m.pending||m.playState!=="finished")&&f()})}if(t){const p=Wc.startingStyle;if(!c.hasAttribute(p)){r.request(f);return}const m=new MutationObserver(()=>{c.hasAttribute(p)||(m.disconnect(),f())});m.observe(c,{attributes:!0,attributeFilter:[p]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(f)})}function ko(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,a=tt(s),l=t_(r,n,!1);y.useEffect(()=>{if(!t)return;const c=new AbortController;return l(a,c.signal),()=>{c.abort()}},[t,n,a,l])}const Im={tabIndex:-1,[Qb]:""};function sP(e){return t=>t==="touch"?e.current:!0}function n_(e,t,n=!1){const r=mo(),s=ya()!=null,a=y.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,s));const l=e??a.current;return e_({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function iP(e,t){const n=y.useRef(null),r=y.useRef(null);return y.useCallback(s=>{if(e===void 0)return;let a=!1;if(n.current!==null){const l=n.current,c=r.current,d=t.context.triggerElements.getById(l);c&&d===c&&(t.context.triggerElements.delete(l),a=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),a=!0),a){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function Ox(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function r_(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function aP(e,t,n,r={}){const s=n.reason,a=s===Yn,l=t&&s===Dl,c=!t&&(s===tu||s===Nm),d=r_(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const f=()=>{const p={...r.extraState,open:t};l?p.instantType="focus":c?p.instantType="dismiss":a&&(p.instantType=void 0),Ox(p,t,n.trigger,d()),e.update(p)};a?lr.flushSync(f):f()}function s_(e,t,n,r){sx(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function Ix(e,t,n,r){const s=n.useState("isMountedByTrigger",e),a=iP(e,n),l=tt(c=>{if(a(c),!c)return;const d=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...d?r:null});return}f==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return Ye(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function Mx(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");Ye(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,l={};e.state.triggerCount!==a&&(l.triggerCount=a);const c=e.select("activeTriggerId");let d=null;if(c){const f=e.context.triggerElements.getById(c);f?f!==e.state.activeTriggerElement&&(l.activeTriggerElement=f):d=c}if(!d&&!c&&a===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[p,m]=f.value;l.activeTriggerId=p,l.activeTriggerElement=m}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=mt(eu);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function Lx(e,t,n){const{mounted:r,setMounted:s,transitionStatus:a}=Rx(e),l=t.useState("preventUnmountingOnClose"),c=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:c});const d=tt(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return ko({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function Dx(e,t){e.useSyncedValues(t),Ye(()=>()=>{e.update({activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn})},[e])}function oP(e,t){Ye(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Ye(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class ad{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function lP(){return new Om({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new ad,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function jx(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:lP(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dn,inactiveTriggerProps:dn,popupProps:dn}}function i_(e,t,n=!1){return new Om({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Ac=ze(e=>e.triggerIdProp??e.activeTriggerId),Px=ze(e=>e.openProp??e.open),iC=ze(e=>(e.popupElement?.id??e.floatingId)||void 0);function a_(e,t){return t!==void 0&&Px(e)&&Ac(e)===t}function uP(e,t){return a_(e,t)?!0:t!==void 0&&Px(e)&&Ac(e)==null&&e.triggerCount===1}const Bx={open:Px,mounted:ze(e=>e.mounted),transitionStatus:ze(e=>e.transitionStatus),floatingRootContext:ze(e=>e.floatingRootContext),triggerCount:ze(e=>e.triggerCount),preventUnmountingOnClose:ze(e=>e.preventUnmountingOnClose),payload:ze(e=>e.payload),activeTriggerId:Ac,activeTriggerElement:ze(e=>e.mounted?e.activeTriggerElement:null),popupId:iC,isTriggerActive:ze((e,t)=>t!==void 0&&Ac(e)===t),isOpenedByTrigger:ze((e,t)=>a_(e,t)),isMountedByTrigger:ze((e,t)=>t!==void 0&&Ac(e)===t&&e.mounted),triggerProps:ze((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:ze((e,t)=>uP(e,t)?iC(e):void 0),popupProps:ze(e=>e.popupProps),popupElement:ze(e=>e.popupElement),positionerElement:ze(e=>e.positionerElement)};function o_(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=mo(),a=ya()!=null,l=xr(()=>new Om({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ad,floatingId:s,syncOnly:!1,nested:a})).current;return Ye(()=>{const c={open:t,floatingId:s};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=St(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,s,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function cP(e={}){const{nodeId:t,externalTree:n}=e,r=o_(e),s=e.rootContext||r,a=s.useState("referenceElement"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),d=s.useState("open"),f=s.useState("floatingId"),[p,m]=y.useState(null),[b,x]=y.useState(void 0),[v,k]=y.useState(void 0),C=y.useRef(null),S=Ea(n),N=y.useMemo(()=>({reference:a,floating:l,domReference:c}),[a,l,c]),_=K8({...e,elements:{...N,...p&&{reference:p}}}),R=St(b)?b:null,I=v===void 0?s.state.floatingElement:v;s.useSyncedValue("referenceElement",b??null),s.useSyncedValue("domReferenceElement",b===void 0?c:R),s.useSyncedValue("floatingElement",I);const A=y.useCallback(W=>{const J=St(W)?{getBoundingClientRect:()=>W.getBoundingClientRect(),getClientRects:()=>W.getClientRects(),contextElement:W}:W;m(J),_.refs.setReference(J)},[_.refs]),L=y.useCallback(W=>{(St(W)||W===null)&&(C.current=W,x(W)),(St(_.refs.reference.current)||_.refs.reference.current===null||W!==null&&!St(W))&&_.refs.setReference(W)},[_.refs,x]),D=y.useCallback(W=>{k(W),_.refs.setFloating(W)},[_.refs]),U=y.useMemo(()=>({..._.refs,setReference:L,setFloating:D,setPositionReference:A,domReference:C}),[_.refs,L,D,A]),z=y.useMemo(()=>({..._.elements,domReference:c}),[_.elements,c]),K=y.useMemo(()=>({..._,dataRef:s.context.dataRef,open:d,onOpenChange:s.setOpen,events:s.context.events,floatingId:f,refs:U,elements:z,nodeId:t,rootStore:s}),[_,U,z,t,s,d,f]);return Ye(()=>{c&&(C.current=c)},[c]),Ye(()=>{s.context.dataRef.current.floatingContext=K;const W=S?.nodesRef.current.find(J=>J.id===t);W&&(W.context=K)}),y.useMemo(()=>({..._,context:K,refs:U,elements:z,rootStore:s}),[_,U,z,K,s])}const Y0=fx&&ba;function l_(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=s.context,c=y.useRef(!1),d=y.useRef(null),f=y.useRef(!0),p=Kn();y.useEffect(()=>{const b=s.select("domReferenceElement");if(!n)return;const x=an(b);function v(){const S=s.select("domReferenceElement");!s.select("open")&&cn(S)&&S===Rr(_t(S))&&(c.current=!0)}function k(){f.current=!0}function C(){f.current=!1}return Ds(Tt(x,"blur",v),Y0&&Tt(x,"keydown",k,!0),Y0&&Tt(x,"pointerdown",C,!0))},[s,n]),y.useEffect(()=>{if(!n)return;function b(x){if(x.reason===tu||x.reason===Nm){const v=s.select("domReferenceElement");St(v)&&(d.current=v,c.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,s]);const m=y.useMemo(()=>{function b(){c.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const v=x.currentTarget;if(c.current){if(d.current===v)return;b()}const k=gr(x.nativeEvent);if(St(k)){if(Y0&&!x.relatedTarget){if(!f.current&&!wm(k))return}else if(!hj(k))return}const C=Lh(x.relatedTarget,s.context.triggerElements),{nativeEvent:S,currentTarget:N}=x,_=typeof r=="function"?r():r;if(s.select("open")&&C||_===0||_===void 0){s.setOpen(!0,mt(Dl,S,N));return}p.start(_,()=>{c.current||s.setOpen(!0,mt(Dl,S,N))})},onBlur(x){b();const v=x.relatedTarget,k=x.nativeEvent,C=St(v)&&v.hasAttribute(Xc("focus-guard"))&&v.getAttribute("data-type")==="outside";p.start(0,()=>{const S=s.select("domReferenceElement"),N=Rr(_t(S));!v&&N===S||nt(l.current.floatingContext?.refs.floating.current,N)||nt(S,N)||C||Lh(v??N,s.context.triggerElements)||s.setOpen(!1,mt(Dl,k))})}}},[l,r,s,p]);return y.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class zx{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new gs,this.restTimeout=new gs,this.handleCloseOptions=void 0}static create(){return new zx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Uh=new WeakMap;function Fh(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Uh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Uh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function u_(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,a=Uh.get(n);a&&a!==e&&Fh(a),Fh(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Uh.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Hx(e){const t=e.context.dataRef.current,n=xr(()=>t.hoverInteractionState??zx.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),dx(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function c_(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),c=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:f}=a.context,p=Ea(),m=ya(),b=Hx(a),x=Kn(),v=tt(()=>m3(f.current.openEvent?.type,b.interactedInside)),k=tt(()=>pj(f.current.openEvent?.type)),C=tt(()=>{Fh(b)});Ye(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,C())},[l,b,C]),y.useEffect(()=>C,[C]),Ye(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&k()&&St(d)&&c){const S=d,N=c,_=_t(c),R=p?.nodesRef.current.find(D=>D.id===m)?.context?.elements.floating;R&&(R.style.pointerEvents="");const I=b.pointerEventsScopeElement!==N?b.pointerEventsScopeElement:null,A=R!==N?R:null,L=b.handleCloseOptions?.getScope?.()??I??A??S.closest("[data-rootownerid]")??_.body;return u_(b,{scopeElement:L,referenceElement:S,floatingElement:N}),()=>{C()}}},[n,l,d,c,b,k,p,m,C]),y.useEffect(()=>{if(!n)return;function S(){return!!(p&&m&&ha(p.nodesRef.current,m).length>0)}function N(D){const U=Vl(r,"close",b.pointerType),z=()=>{a.setOpen(!1,mt(Yn,D)),p?.events.emit("floating.closed",D)};U?b.openChangeTimeout.start(U,z):(b.openChangeTimeout.clear(),z())}function _(D){const U=gr(D);if(!fj(U)){b.interactedInside=!1;return}b.interactedInside=U?.closest("[aria-haspopup]")!=null}function R(){b.openChangeTimeout.clear(),x.clear(),p?.events.off("floating.closed",A),C()}function I(D){if(S()&&p){p.events.on("floating.closed",A);return}if(Lh(D.relatedTarget,a.context.triggerElements))return;const U=f.current.floatingContext?.nodeId??s,z=D.relatedTarget;if(!(p&&U&&St(z)&&ha(p.nodesRef.current,U,!1).some(W=>nt(W.context?.elements.floating,z)))){if(b.handler){b.handler(D);return}C(),k()&&!v()&&N(D)}}function A(D){!p||!m||S()||x.start(0,()=>{p.events.off("floating.closed",A),a.setOpen(!1,mt(Yn,D)),p.events.emit("floating.closed",D)})}const L=c;return Ds(L&&Tt(L,"mouseenter",R),L&&Tt(L,"mouseleave",I),L&&Tt(L,"pointerdown",_,!0),()=>{p?.events.off("floating.closed",A)})},[n,c,a,f,r,s,k,v,C,b,p,m,x])}const dP={current:null};function d_(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:a=!1,restMs:l=0,move:c=!0,triggerElementRef:d=dP,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:b,shouldOpen:x}=t,v="rootStore"in e?e.rootStore:e,{dataRef:k,events:C}=v.context,S=Ea(f),N=Hx(v),_=y.useRef(!1),R=En(s),I=En(r),A=En(l),L=En(n),D=En(x),U=En(b),z=tt(()=>m3(k.current.openEvent?.type,N.interactedInside)),K=tt(()=>D.current?.()!==!1),W=tt((V,B,G)=>{const X=v.context.triggerElements;if(X.hasElement(B))return!V||!nt(V,B);if(!St(G))return!1;const ae=G;return X.hasMatchingElement(M=>nt(M,ae))&&(!V||!nt(V,ae))}),J=tt(()=>{if(!N.handler)return;_t(v.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),te=tt(()=>{Fh(N)});return p&&(N.handleCloseOptions=R.current?.__options),y.useEffect(()=>J,[J]),y.useEffect(()=>{if(!n)return;function V(B){B.open?_.current=!1:(_.current=B.reason===Yn,J(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return C.on("openchange",V),()=>{C.off("openchange",V)}},[n,C,N,J]),y.useEffect(()=>{if(!n)return;function V(ae,M=!0){const P=Vl(I.current,"close",N.pointerType);P?N.openChangeTimeout.start(P,()=>{v.setOpen(!1,mt(Yn,ae)),S?.events.emit("floating.closed",ae)}):M&&(N.openChangeTimeout.clear(),v.setOpen(!1,mt(Yn,ae)),S?.events.emit("floating.closed",ae))}const B=d.current??(p?v.select("domReferenceElement"):null);if(!St(B))return;function G(ae){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,a&&!fo(N.pointerType))return;const M=IS(A.current),P=Vl(I.current,"open",N.pointerType),$=gr(ae),j=ae.currentTarget??null,re=v.select("domReferenceElement");let oe=j;if(St($)&&!v.context.triggerElements.hasElement($)){for(const Be of v.context.triggerElements.elements())if(nt(Be,$)){oe=Be;break}}St(j)&&St(re)&&!v.context.triggerElements.hasElement(j)&&nt(j,re)&&(oe=re);const ce=oe==null?!1:W(re,oe,$),de=v.select("open"),fe=U.current?.()??v.select("transitionStatus")==="ending",ve=!de&&fe&&_.current,Fe=!ce&&St(oe)&&St(re)&&nt(re,oe)&&ve,De=M>0&&!P,Ee=ce&&(de||ve)||Fe,Ie=!de||ce;if(Ee){K()&&v.setOpen(!0,mt(Yn,ae,oe));return}De||(P?N.openChangeTimeout.start(P,()=>{Ie&&K()&&v.setOpen(!0,mt(Yn,ae,oe))}):Ie&&K()&&v.setOpen(!0,mt(Yn,ae,oe)))}function X(ae){if(z()){te();return}J();const M=v.select("domReferenceElement"),P=_t(M);N.restTimeout.clear(),N.restTimeoutPending=!1;const $=k.current.floatingContext??m?.();if(Lh(ae.relatedTarget,v.context.triggerElements))return;if(R.current&&$){v.select("open")||N.openChangeTimeout.clear();const re=d.current;N.handler=R.current({...$,tree:S,x:ae.clientX,y:ae.clientY,onClose(){te(),J(),L.current&&!z()&&re===v.select("domReferenceElement")&&V(ae,!0)}}),P.addEventListener("mousemove",N.handler),N.handler(ae);return}(N.pointerType==="touch"?!nt(v.select("floatingElement"),ae.relatedTarget):!0)&&V(ae)}return c?Ds(Tt(B,"mousemove",G,{once:!0}),Tt(B,"mouseenter",G),Tt(B,"mouseleave",X)):Ds(Tt(B,"mouseenter",G),Tt(B,"mouseleave",X))},[J,te,k,I,v,n,R,N,p,W,z,a,c,A,d,S,L,m,U,K]),y.useMemo(()=>{if(!n)return;function V(B){N.pointerType=B.pointerType}return{onPointerDown:V,onPointerEnter:V,onMouseMove(B){const{nativeEvent:G}=B,X=B.currentTarget,ae=v.select("domReferenceElement"),M=v.select("open"),P=W(ae,X,B.target);if(a&&!fo(N.pointerType))return;if(M&&P&&N.handleCloseOptions?.blockPointerEvents){const re=v.select("floatingElement");if(re){const oe=N.handleCloseOptions?.getScope?.()??X.ownerDocument.body;u_(N,{scopeElement:oe,referenceElement:X,floatingElement:re})}}const $=IS(A.current);if(M&&!P||$===0||!P&&N.restTimeoutPending&&B.movementX**2+B.movementY**2<2)return;N.restTimeout.clear();function j(){if(N.restTimeoutPending=!1,z())return;const re=v.select("open");!N.blockMouseMove&&(!re||P)&&K()&&v.setOpen(!0,mt(Yn,G,X))}N.pointerType==="touch"?lr.flushSync(()=>{j()}):P&&M?j():(N.restTimeoutPending=!0,N.restTimeout.start($,j))}}},[n,N,z,W,a,v,A,K])}const fP="Escape";function Mm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qf(e,t){return Mm(t,e===h3||e===px,e===Sm||e===Cm)}function G0(e,t,n){return Mm(t,e===px,n?e===Sm:e===Cm)||e==="Enter"||e===" "||e===""}function hP(e,t,n){return Mm(t,n?e===Sm:e===Cm,e===px)}function mP(e,t,n,r){const s=n?e===Cm:e===Sm,a=e===h3;return t==="both"||t==="horizontal"&&r?e===fP:Mm(t,s,a)}function f_(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:d=!1,nested:f=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:v=!0,disabledIndices:k=void 0,orientation:C="vertical",parentOrientation:S,id:N,resetOnPointerLeave:_=!0,externalTree:R,grid:I}=t,A=I!=null,L="rootStore"in e?e.rootStore:e,D=L.useState("open"),U=L.useState("floatingElement"),z=L.useState("domReferenceElement"),K=L.context.dataRef,W=Dh(U),J=Zb(z),te=En(W),V=ya(),B=Ea(R),G=y.useRef(b),X=y.useRef(l??-1),ae=y.useRef(null),M=y.useRef(!0),P=tt(ie=>{s(X.current===-1?null:X.current,ie)}),$=y.useRef(!!U),j=y.useRef(D),re=y.useRef(!1),oe=y.useRef(!1),ce=y.useRef(null),de=En(k),fe=En(D),ve=En(l),Fe=En(_),De=$l(),Ee=$l(),Ie=tt(()=>{function ie(le){m?B?.events.emit("virtualfocus",le):ce.current=yh(le,{sync:re.current,preventScroll:!0})}const Q=n.current[X.current],Y=oe.current;Q&&ie(Q),(re.current?le=>le():le=>De.request(le))(()=>{const le=n.current[X.current]||Q;if(!le)return;Q||ie(le),ye&&(Y||!M.current)&&le.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ye(()=>{K.current.orientation=C},[K,C]),Ye(()=>{a&&(D&&U?(X.current=l??-1,G.current&&l!=null&&(oe.current=!0,P())):$.current&&(X.current=-1,P()))},[a,D,U,l,P]),Ye(()=>{if(a){if(!D){re.current=!1;return}if(U)if(r==null){if(re.current=!1,ve.current!=null)return;if($.current&&(X.current=-1,Ie()),(!j.current||!$.current)&&G.current&&(ae.current!=null||G.current===!0&&ae.current==null)){let ie=0;const Q=()=>{n.current[0]==null?(ie<2&&(ie?F=>Ee.request(F):queueMicrotask)(Q),ie+=1):(X.current=ae.current==null||G0(ae.current,C,p)||f?H0(n):jS(n),ae.current=null,P())};Q()}}else DS(n.current,r)||(X.current=r,Ie(),oe.current=!1)}},[a,D,U,r,ve,f,n,C,p,P,Ie,Ee]),Ye(()=>{if(!a||U||!B||m||!$.current)return;const ie=B.nodesRef.current,Q=ie.find(le=>le.id===V)?.context?.elements.floating,Y=Rr(_t(z??Q??null)),F=ie.some(le=>le.context&&nt(le.context.elements.floating,Y));Q&&!F&&M.current&&Q.focus({preventScroll:!0})},[a,U,z,B,V,m]),Ye(()=>{j.current=D,$.current=!!U}),Ye(()=>{D||(ae.current=null,G.current=b)},[D,b]);const Be=r!=null,Ge=tt(ie=>{if(!fe.current)return;const Q=n.current.indexOf(ie.currentTarget);Q!==-1&&(X.current!==Q||r!==Q)&&(X.current=Q,P(ie))}),$e=tt(()=>S??B?.nodesRef.current.find(ie=>ie.id===V)?.context?.dataRef?.current.orientation),Me=tt(()=>H0(n,de.current)),we=tt(ie=>{if(M.current=!1,re.current=!0,ie.which===229||!fe.current&&ie.currentTarget===te.current)return;if(f&&mP(ie.key,C,p,A)){qf(ie.key,$e())||Os(ie),L.setOpen(!1,mt(Jb,ie.nativeEvent)),cn(z)&&(m?B?.events.emit("virtualfocus",z):z.focus());return}const Q=X.current,Y=H0(n,k),F=jS(n,k);if(J||(ie.key==="Home"&&(Os(ie),X.current=Y,P(ie)),ie.key==="End"&&(Os(ie),X.current=F,P(ie))),I!=null){const le=I(ie,X.current,n,C,d,p,k,Y,F);if(le!=null&&(X.current=le,P(ie)),C==="both")return}if(qf(ie.key,C)){if(Os(ie),D&&!m&&Rr(ie.currentTarget.ownerDocument)===ie.currentTarget){X.current=G0(ie.key,C,p)?Y:F,P(ie);return}G0(ie.key,C,p)?d?Q>=F?c&&Q!==n.current.length?X.current=-1:(re.current=!1,X.current=Y):X.current=Ol(n.current,{startingIndex:Q,disabledIndices:k}):X.current=Math.min(F,Ol(n.current,{startingIndex:Q,disabledIndices:k})):d?Q<=Y?c&&Q!==-1?X.current=n.current.length:(re.current=!1,X.current=F):X.current=Ol(n.current,{startingIndex:Q,decrement:!0,disabledIndices:k}):X.current=Math.max(Y,Ol(n.current,{startingIndex:Q,decrement:!0,disabledIndices:k})),DS(n.current,X.current)&&(X.current=-1),P(ie)}}),ye=y.useMemo(()=>({onFocus(Q){re.current=!0,Ge(Q)},onClick:({currentTarget:Q})=>Q.focus({preventScroll:!0}),onMouseMove(Q){re.current=!0,oe.current=!1,x&&Ge(Q)},onPointerLeave(Q){if(!fe.current||!M.current||Q.pointerType==="touch")return;re.current=!0;const Y=Q.relatedTarget;if(!(!x||n.current.includes(Y))&&Fe.current&&(ce.current?.(),ce.current=null,X.current=-1,P(Q),!m)){const F=te.current,le=Rr(_t(F));F&&nt(F,le)&&F.focus({preventScroll:!0})}}}),[Ge,fe,te,x,n,P,Fe,m]),Oe=y.useMemo(()=>m&&D&&Be&&{"aria-activedescendant":`${N}-${r}`},[m,D,Be,N,r]),je=y.useMemo(()=>({"aria-orientation":C==="both"?void 0:C,...J?{}:Oe,onKeyDown(ie){if(ie.key==="Tab"&&ie.shiftKey&&D&&!m){const Q=gr(ie.nativeEvent);if(Q&&!nt(te.current,Q))return;Os(ie),L.setOpen(!1,mt(ho,ie.nativeEvent)),cn(z)&&z.focus();return}we(ie)},onPointerMove(){M.current=!0}}),[Oe,we,te,C,J,L,D,m,z]),ee=y.useMemo(()=>{function ie(F){L.setOpen(!0,mt(Jb,F.nativeEvent,F.currentTarget))}function Q(F){b==="auto"&&mx(F.nativeEvent)&&(G.current=!m)}function Y(F){G.current=b,b==="auto"&&d3(F.nativeEvent)&&(G.current=!0)}return{onKeyDown(F){const le=L.select("open");M.current=!1;const Ce=F.key.startsWith("Arrow"),Re=hP(F.key,$e(),p),Ve=qf(F.key,C),ot=(f?Re:Ve)||F.key==="Enter"||F.key.trim()==="";if(m&&le)return we(F);if(!(!le&&!v&&Ce)){if(ot){const et=qf(F.key,$e());ae.current=f&&et?null:F.key}if(f){Re&&(Os(F),le?(X.current=Me(),P(F)):ie(F));return}Ve&&(ve.current!=null&&(X.current=ve.current),Os(F),!le&&v?ie(F):we(F),le&&P(F))}},onFocus(F){L.select("open")&&!m&&(X.current=-1,P(F))},onPointerDown:Y,onPointerEnter:Y,onMouseDown:Q,onClick:Q}},[we,b,Me,f,P,L,v,C,$e,p,ve,m]),me=y.useMemo(()=>({...Oe,...ee}),[Oe,ee]);return y.useMemo(()=>a?{reference:me,floating:je,item:ye,trigger:ee}:{},[a,me,je,ee,ye])}function h_(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:a,disabledIndices:l,onTyping:c,enabled:d=!0,resetMs:f=750,selectedIndex:p=null}=t,m="rootStore"in e?e.rootStore:e,b=m.useState("open"),x=Kn(),v=y.useRef(""),k=y.useRef(p??s??-1),C=y.useRef(null),S=tt(R=>{function I(te){const V=r?.current[te];return!V||_m(V)}function A(te){return I(te)?l==null||!y3(Ul,te,l):!1}function L(te,V,B=0){if(te.length===0)return-1;const G=(B%te.length+te.length)%te.length,X=V.toLowerCase();for(let ae=0;ae<te.length;ae+=1){const M=(G+ae)%te.length;if(!(!te[M]?.toLowerCase().startsWith(X)||!A(M)))return M}return-1}const D=n.current;if(v.current.length>0&&R.key===" "&&(Os(R),c?.(!0)),v.current.length>0&&v.current[0]!==" "&&L(D,v.current)===-1&&R.key!==" "&&c?.(!1),D==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;b&&R.key!==" "&&(Os(R),c?.(!0));const U=v.current==="";U&&(k.current=p??s??-1),D.every((te,V)=>te&&A(V)?te[0]?.toLowerCase()!==te[1]?.toLowerCase():!0)&&v.current===R.key&&(v.current="",k.current=C.current),v.current+=R.key,x.start(f,()=>{v.current="",k.current=C.current,c?.(!1)});const W=((U?p??s??-1:k.current)??0)+1,J=L(D,v.current,W);J!==-1?(a?.(J),C.current=J):R.key!==" "&&(v.current="",c?.(!1))}),N=tt(R=>{const I=R.relatedTarget,A=m.select("domReferenceElement"),L=m.select("floatingElement");nt(A,I)||nt(L,I)||(x.clear(),v.current="",k.current=C.current,c?.(!1))});Ye(()=>{!b&&p!==null||(x.clear(),C.current=null,v.current!==""&&(v.current=""))},[b,p,x]),Ye(()=>{b&&v.current===""&&(k.current=p??s??-1)},[b,p,s]);const _=y.useMemo(()=>({onKeyDown:S,onBlur:N}),[S,N]);return y.useMemo(()=>d?{reference:_,floating:_}:{},[d,_])}const aC=.1,pP=aC*aC,Xt=.5;function Yf(e,t,n,r,s,a){return r>=t!=a>=t&&e<=(s-n)*(t-r)/(a-r)+n}function Gf(e,t,n,r,s,a,l,c,d,f){let p=!1;return Yf(e,t,n,r,s,a)&&(p=!p),Yf(e,t,s,a,l,c)&&(p=!p),Yf(e,t,l,c,d,f)&&(p=!p),Yf(e,t,d,f,n,r)&&(p=!p),p}function gP(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Kf(e,t,n,r,s,a){const l=Math.min(n,s),c=Math.max(n,s),d=Math.min(r,a),f=Math.max(r,a);return e>=l&&e<=c&&t>=d&&t<=f}function m_(e={}){const{blockPointerEvents:t=!1}=e,n=new gs,r=({x:s,y:a,placement:l,elements:c,onClose:d,nodeId:f,tree:p})=>{const m=l?.split("-")[0];let b=!1,x=null,v=null,k=typeof performance<"u"?performance.now():0;function C(N,_){const R=performance.now(),I=R-k;if(x===null||v===null||I===0)return x=N,v=_,k=R,!1;const A=N-x,L=_-v,D=A*A+L*L,U=I*I*pP;return x=N,v=_,k=R,D<U}function S(){n.clear(),d()}return function(_){n.clear();const R=c.domReference,I=c.floating;if(!R||!I||m==null||s==null||a==null)return;const{clientX:A,clientY:L}=_,D=gr(_),U=_.type==="mouseleave",z=nt(I,D),K=nt(R,D);if(z&&(b=!0,!U))return;if(K&&(b=!1,!U)){b=!0;return}if(U&&St(_.relatedTarget)&&nt(I,_.relatedTarget))return;function W(){return!!(p&&ha(p.nodesRef.current,f).length>0)}function J(){W()||S()}if(W())return;const te=R.getBoundingClientRect(),V=I.getBoundingClientRect(),B=s>V.right-V.width/2,G=a>V.bottom-V.height/2,X=V.width>te.width,ae=V.height>te.height,M=(X?te:V).left,P=(X?te:V).right,$=(ae?te:V).top,j=(ae?te:V).bottom;if(m==="top"&&a>=te.bottom-1||m==="bottom"&&a<=te.top+1||m==="left"&&s>=te.right-1||m==="right"&&s<=te.left+1){J();return}let re=!1;switch(m){case"top":re=Kf(A,L,M,te.top+1,P,V.bottom-1);break;case"bottom":re=Kf(A,L,M,V.top+1,P,te.bottom-1);break;case"left":re=Kf(A,L,V.right-1,j,te.left+1,$);break;case"right":re=Kf(A,L,te.right-1,j,V.left+1,$);break}if(re)return;if(b&&!gP(A,L,te)){J();return}if(!U&&C(A,L)){J();return}let oe=!1;switch(m){case"top":{const ce=X?Xt/2:Xt*4,de=X||B?s+ce:s-ce,fe=X?s-ce:B?s+ce:s-ce,ve=a+Xt+1,Fe=B||X?V.bottom-Xt:V.top,De=B?X?V.bottom-Xt:V.top:V.bottom-Xt;oe=Gf(A,L,de,ve,fe,ve,V.left,Fe,V.right,De);break}case"bottom":{const ce=X?Xt/2:Xt*4,de=X||B?s+ce:s-ce,fe=X?s-ce:B?s+ce:s-ce,ve=a-Xt,Fe=B||X?V.top+Xt:V.bottom,De=B?X?V.top+Xt:V.bottom:V.top+Xt;oe=Gf(A,L,de,ve,fe,ve,V.left,Fe,V.right,De);break}case"left":{const ce=ae?Xt/2:Xt*4,de=ae||G?a+ce:a-ce,fe=ae?a-ce:G?a+ce:a-ce,ve=s+Xt+1,Fe=G||ae?V.right-Xt:V.left,De=G?ae?V.right-Xt:V.left:V.right-Xt;oe=Gf(A,L,Fe,V.top,De,V.bottom,ve,de,ve,fe);break}case"right":{const ce=ae?Xt/2:Xt*4,de=ae||G?a+ce:a-ce,fe=ae?a-ce:G?a+ce:a-ce,ve=s-Xt,Fe=G||ae?V.left+Xt:V.right,De=G?ae?V.left+Xt:V.right:V.left+Xt;oe=Gf(A,L,ve,de,ve,fe,Fe,V.top,De,V.bottom);break}}oe?b||n.start(40,J):J()}};return r.__options={...e,blockPointerEvents:t},r}const p_=y.createContext(null),g_=y.createContext(null);function va(){const e=y.useContext(p_);if(e===null)throw new Error(Dn(60));return e}function b_(){const e=y.useContext(g_);if(e===null)throw new Error(Dn(61));return e}let oC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const bP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},xP={disabled:!1,...vc},yP={valid(e){return e===null?null:e?{[oC.valid]:""}:{[oC.invalid]:""}}},EP={invalid:void 0,name:void 0,validityData:{state:bP,errors:[],error:"",value:"",initialValue:null},setValidityData:qn,disabled:void 0,touched:vc.touched,setTouched:qn,dirty:vc.dirty,setDirty:qn,filled:vc.filled,setFilled:qn,focused:vc.focused,setFocused:qn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:xP,markedDirtyRef:{current:!1},registerFieldControl:qn,validation:{getValidationProps:(e,t=dn)=>t,inputRef:{current:null},registerInput:qn,commit:async()=>{},change:qn}},vP=y.createContext(EP);function Ux(e=!0){const t=y.useContext(vP);if(t.setValidityData===qn&&!e)throw new Error(Dn(28));return t}function TP(e,t,n,r,s=!0,a){const{registerFieldControl:l}=Ux(),c=y.useRef(null);c.current||(c.current=Symbol()),Ye(()=>{const d=c.current;return!d||!s?void 0:(l(d,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{l(d,void 0)})},[e,s,r,t,a,l,n])}function No(e){return mo(e,"base-ui")}const SP=y.createContext({controlId:void 0,registerControlId:qn,labelId:void 0,setLabelId:qn,messageIds:[],setMessageIds:qn,getDescriptionProps:e=>e});function x_(){return y.useContext(SP)}function y_(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=x_(),l=No(t),c=n?s:void 0,d=xr(()=>Symbol("labelable-control")),f=y.useRef(!1),p=y.useRef(t!=null),m=tt(()=>{!f.current||a===qn||(f.current=!1,a(d.current,void 0))});return Ye(()=>{if(a===qn)return;let b;if(n){const x=r?.current;St(x)&&x.closest("label")!=null?b=t??null:b=c??l}else if(t!=null)p.current=!0,b=t;else if(p.current)b=l;else{m();return}if(b===void 0){m();return}f.current=!0,a(d.current,b)},[t,r,c,a,n,l,d,m]),y.useEffect(()=>m,[m]),s??l}const CP=(e,t)=>Object.is(e,t);function go(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wP(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:go(t,r,n))}function Rc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:go(r,t,n))}function kP(e,t,n){return e.filter(r=>!go(t,r,n))}function s1(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function E_(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function NP(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(E_(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function v_(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return s1(e)}function Xa(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?s1(e.value):s1(e)}function T_(e,t,n){function r(){return v_(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const s=t,a=E_(s)?s.flatMap(l=>l.items):s;if(e==null||typeof e!="object"){const l=a.find(c=>c.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(c=>c&&c.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function _P(e,t,n){return e.reduce((r,s,a)=>(a>0&&r.push(", "),r.push(h.jsx(y.Fragment,{children:T_(s,t,n)},a)),r),[])}const ct={id:ze(e=>e.id),labelId:ze(e=>e.labelId),modal:ze(e=>e.modal),multiple:ze(e=>e.multiple),items:ze(e=>e.items),itemToStringLabel:ze(e=>e.itemToStringLabel),itemToStringValue:ze(e=>e.itemToStringValue),isItemEqualToValue:ze(e=>e.isItemEqualToValue),value:ze(e=>e.value),hasSelectedValue:ze(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xa(t,r)!==""}),hasNullItemLabel:ze((e,t)=>t?NP(e.items):!1),open:ze(e=>e.open),mounted:ze(e=>e.mounted),forceMount:ze(e=>e.forceMount),transitionStatus:ze(e=>e.transitionStatus),openMethod:ze(e=>e.openMethod),activeIndex:ze(e=>e.activeIndex),selectedIndex:ze(e=>e.selectedIndex),isActive:ze((e,t)=>e.activeIndex===t),isSelected:ze((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>go(t,s,n)):go(t,r,n)}),isSelectedByFocus:ze((e,t)=>e.selectedIndex===t),popupProps:ze(e=>e.popupProps),triggerProps:ze(e=>e.triggerProps),triggerElement:ze(e=>e.triggerElement),positionerElement:ze(e=>e.positionerElement),listElement:ze(e=>e.listElement),popupSide:ze(e=>e.popupSide),scrollUpArrowVisible:ze(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ze(e=>e.scrollDownArrowVisible),hasScrollArrows:ze(e=>e.hasScrollArrows)},AP=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:qn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function RP(){return y.useContext(AP)}function OP(e,t,n=(r,s)=>r===s){return e.length===t.length&&e.every((r,s)=>n(r,t[s]))}function S_(e,t){const n=y.useRef(e),r=tt(t);Ye(()=>{n.current!==e&&r(n.current)},[e,r]),Ye(()=>{n.current=e},[e])}function IP(e){const t=y.useRef(""),n=y.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:y.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function C_(e,t){const n=tt((a,l)=>{(typeof e=="function"?e():e)||t(l||(Tm?"touch":""))}),{onClick:r,onPointerDown:s}=IP(n);return y.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function w_(e){const[t,n]=y.useState(null),r=C_(e,n);return S_(e,s=>{s&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Tc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const ci=1;function k_(e,t){return Math.max(0,e-t)}function MP(e,t){if(t<=0)return 0;const n=Tc(e,0,t),r=n,s=t-n,a=r<=ci,l=s<=ci;return a&&l?r<=s?0:t:a?0:l?t:n}function LP(e){const{id:t,value:n,defaultValue:r=null,onValueChange:s,open:a,defaultOpen:l=!1,onOpenChange:c,name:d,form:f,autoComplete:p,disabled:m=!1,readOnly:b=!1,required:x=!1,modal:v=!0,actionsRef:k,inputRef:C,onOpenChangeComplete:S,items:N,multiple:_=!1,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:A=CP,highlightItemOnHover:L=!0,children:D}=e,{clearErrors:U}=RP(),{setDirty:z,setTouched:K,setFocused:W,validityData:J,setFilled:te,name:V,disabled:B,validation:G,validationMode:X}=Ux(),ae=y_({id:t}),M=B||m,P=V??d,[$,j]=RS({controlled:n,default:_?r??Ul:r,name:"Select",state:"value"}),[re,oe]=RS({controlled:a,default:l,name:"Select",state:"open"}),ce=y.useRef([]),de=y.useRef([]),fe=y.useRef(null),ve=y.useRef(null),Fe=y.useRef(0),De=y.useRef(null),Ee=y.useRef([]),Ie=y.useRef(!1),Be=y.useRef(null),Ge=y.useRef(null),$e=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Me=y.useRef(!1),{mounted:we,setMounted:ye,transitionStatus:Oe}=Rx(re),{openMethod:je,triggerProps:ee}=w_(re),me=xr(()=>new u3({id:ae,labelId:void 0,modal:v,multiple:_,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:A,value:$,open:re,mounted:we,transitionStatus:Oe,items:N,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ie=ft(me,ct.activeIndex),Q=ft(me,ct.selectedIndex),Y=ft(me,ct.triggerElement),F=ft(me,ct.positionerElement),le=LD(je),Ce=je??le??null,Re=y.useMemo(()=>_?"":Xa($,I),[_,$,I]),Ve=y.useMemo(()=>_&&Array.isArray($)?$.map(ht=>Xa(ht,I)):Xa($,I),[_,$,I]),ot=En(me.state.triggerElement),et=tt(()=>Ve);TP(ot,ae,$,et,!M,d);const dt=y.useRef($),ut=_?Array.isArray($)&&$.length>0:$!=null&&Xa($,I)!=="";Ye(()=>{$!==dt.current&&me.set("forceMount",!0)},[me,$]),Ye(()=>{te(ut)},[ut,te]),Ye(function(){const Ot=Ee.current;let bn;if(_){const Un=Array.isArray($)?$:[];if(Un.length===0)bn=null;else{const jn=Un[Un.length-1],en=Rc(Ot,jn,A);bn=en===-1?null:en}}else{const Un=Rc(Ot,$,A);bn=Un===-1?null:Un}bn===null&&(Ge.current=null),!re&&me.set("selectedIndex",bn)},[ut,_,re,$,Ee,A,me,Ge]);function qe(ht){const Ot=J.initialValue;return Array.isArray(ht)&&Array.isArray(Ot)?!OP(ht,Ot,(bn,Un)=>go(bn,Un,A)):ht!==Ot}S_($,()=>{U(P),z(qe($)),G.change($)});const Rt=tt((ht,Ot)=>{c?.(ht,Ot),!Ot.isCanceled&&(oe(ht),!ht&&(Ot.reason===ho||Ot.reason===km)&&(K(!0),W(!1),X==="onBlur"&&G.commit($)))}),jt=tt(()=>{ye(!1),me.update({activeIndex:null,openMethod:null}),S?.(!1)});ko({enabled:!k,open:re,ref:fe,onComplete(){re||jt()}}),y.useImperativeHandle(k,()=>({unmount:jt}),[jt]);const lt=tt((ht,Ot)=>{s?.(ht,Ot),!Ot.isCanceled&&j(ht)}),Lt=tt(()=>{const ht=me.state.listElement||fe.current;if(!ht)return;const Ot=k_(ht.scrollHeight,ht.clientHeight),bn=MP(ht.scrollTop,Ot),Un=bn>0,jn=bn<Ot;me.state.scrollUpArrowVisible!==Un&&me.set("scrollUpArrowVisible",Un),me.state.scrollDownArrowVisible!==jn&&me.set("scrollDownArrowVisible",jn)}),Qt=o_({open:re,onOpenChange:Rt,elements:{reference:Y,floating:F}}),$t=_x(Qt,{enabled:!b&&!M,event:"mousedown"}),Zt=Am(Qt),Xe=f_(Qt,{enabled:!b&&!M,listRef:ce,activeIndex:ie,selectedIndex:Q,disabledIndices:Ul,onNavigate(ht){ht===null&&!re||me.set("activeIndex",ht)},focusItemOnHover:L}),yt=h_(Qt,{enabled:!b&&!M&&(re||!_),listRef:de,activeIndex:ie,selectedIndex:Q,disabledIndices:ht=>DD(ce.current[ht]),onMatch(ht){re?me.set("activeIndex",ht):lt(Ee.current[ht],mt("none"))},onTyping(ht){Ie.current=ht}}),Ut=y.useMemo(()=>{const ht=Ir(yt.reference,Xe.reference,Zt.reference,$t.reference,ee);return ae&&(ht.id=ae),ht},[$t.reference,yt.reference,Xe.reference,Zt.reference,ee,ae]),Jt=y.useMemo(()=>Ir(Im,yt.floating,Xe.floating,Zt.floating),[yt.floating,Xe.floating,Zt.floating]),Xn=Xe.item??dn;sx(()=>{me.update({popupProps:Jt,triggerProps:Ut})}),Ye(()=>{me.update({id:ae,modal:v,multiple:_,value:$,open:re,mounted:we,transitionStatus:Oe,popupProps:Jt,triggerProps:Ut,items:N,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:A,openMethod:Ce})},[me,ae,v,_,$,re,we,Oe,Jt,Ut,N,R,I,A,Ce]);const Et=y.useMemo(()=>({store:me,name:P,required:x,disabled:M,readOnly:b,multiple:_,highlightItemOnHover:L,setValue:lt,setOpen:Rt,listRef:ce,popupRef:fe,scrollHandlerRef:ve,handleScrollArrowVisibility:Lt,scrollArrowsMountedCountRef:Fe,itemProps:Xn,valueRef:De,valuesRef:Ee,labelsRef:de,typingRef:Ie,selectionRef:$e,firstItemTextRef:Be,selectedItemTextRef:Ge,validation:G,onOpenChangeComplete:S,alignItemWithTriggerActiveRef:Me,initialValueRef:dt}),[me,P,x,M,b,_,L,lt,Rt,Xn,G,S,Lt]),on=co(C,G.inputRef),Er=_&&Array.isArray($)&&$.length>0,gn=_?void 0:P,Tn=y.useMemo(()=>!_||!Array.isArray($)||!P?null:$.map(ht=>{const Ot=Xa(ht,I);return h.jsx("input",{type:"hidden",form:f,name:P,value:Ot,disabled:M},Ot)}),[_,$,f,P,I,M]);return h.jsx(p_.Provider,{value:Et,children:h.jsxs(g_.Provider,{value:Qt,children:[D,h.jsx("input",{...G.getValidationProps(M,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(ht){if(ht.nativeEvent.defaultPrevented||M||b)return;const Ot=ht.currentTarget.value,bn=mt(eu,ht.nativeEvent);function Un(){if(_)return;const jn=Ot.toLowerCase();let en=Ee.current.findIndex(vs=>Xa(vs,I).toLowerCase()===jn||v_(vs,R).toLowerCase()===jn);en===-1&&(en=Ee.current.findIndex((vs,du)=>{const yd=de.current[du];return yd!=null&&yd.toLowerCase()===jn}));const Wn=en===-1?void 0:Ee.current[en];Wn!=null&&lt(Wn,bn)}me.set("forceMount",!0),queueMicrotask(Un)}}),id:ae&&gn==null?`${ae}-hidden-input`:void 0,form:f,name:gn,autoComplete:p,value:Re,disabled:M,required:x&&!Er,readOnly:b,ref:on,style:P?RD:s3,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tn]})})}function DP(e,t){return e??t}let no=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Wc.startingStyle]="startingStyle",e[e.endingStyle=Wc.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),$h=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const jP={[$h.popupOpen]:""},PP={[$h.popupOpen]:"",[$h.pressed]:""},BP={[no.open]:""},zP={[no.closed]:""},HP={[no.anchorHidden]:""},Fx={open(e){return e?jP:null}},i1={open(e){return e?PP:null}},ru={open(e){return e?BP:zP},anchorHidden(e){return e?HP:null}};function N_(e){const t=e.getBoundingClientRect(),n=an(e);if(hx)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,d=parseFloat(s.width)||0,f=parseFloat(s.height)||0,p=Math.max(t.width,l,d),m=Math.max(t.height,c,f),b=p-t.width,x=m-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-x/2,bottom:t.bottom+x/2}}const UP=y.createContext(void 0);function $x(e=!1){const t=y.useContext(UP);if(t===void 0&&!e)throw new Error(Dn(16));return t}function FP(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,l=r&&t!==!1,c=r&&t===!1;return{props:y.useMemo(()=>{const f={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return r||(f.tabIndex=s,!a&&n&&(f.tabIndex=t?s:-1)),(a&&(t||l)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||c)&&(f.disabled=n),f},[r,n,t,l,c,a,s])}}function su(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,l=y.useRef(null),c=$x(!0),d=a??c!==void 0,{props:f}=FP({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:s}),p=y.useCallback(()=>{const x=l.current;K0(x)&&d&&t&&f.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,f.disabled,d]);Ye(p,[p]);const m=y.useCallback((x={})=>{const{onClick:v,onMouseDown:k,onKeyUp:C,onKeyDown:S,onPointerDown:N,..._}=x;return Ir({onClick(R){if(t){R.preventDefault();return}v?.(R)},onMouseDown(R){t||k?.(R)},onKeyDown(R){if(t||(zh(R),S?.(R),R.baseUIHandlerPrevented))return;const I=R.target===R.currentTarget,A=R.currentTarget,L=K0(A),D=!s&&$P(A),U=I&&(s?L:!D),z=R.key==="Enter",K=R.key===" ",W=A.getAttribute("role"),J=W?.startsWith("menuitem")||W==="option"||W==="gridcell";if(I&&d&&K){if(R.defaultPrevented&&J)return;R.preventDefault(),D||s&&L?(A.click(),R.preventBaseUIHandler()):U&&(v?.(R),R.preventBaseUIHandler());return}U&&(!s&&(K||z)&&R.preventDefault(),!s&&z&&v?.(R))},onKeyUp(R){if(!t){if(zh(R),C?.(R),R.target===R.currentTarget&&s&&d&&K0(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!d&&R.key===" "&&v?.(R)}},onPointerDown(R){if(t){R.preventDefault();return}N?.(R)}},s?{type:"button"}:{role:"button"},f,_)},[t,f,d,s]),b=tt(x=>{l.current=x,p()});return{getButtonProps:m,buttonRef:b}}function K0(e){return cn(e)&&e.tagName==="BUTTON"}function $P(e){return!!(e?.tagName==="A"&&e?.href)}const Xf=2,VP=400,qP={...i1,...yP,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},YP=y.forwardRef(function(t,n){const{render:r,className:s,id:a,disabled:l=!1,nativeButton:c=!0,style:d,...f}=t,{setTouched:p,setFocused:m,validationMode:b,state:x,disabled:v}=Ux(),{labelId:k}=x_(),{store:C,setOpen:S,selectionRef:N,validation:_,readOnly:R,required:I,alignItemWithTriggerActiveRef:A,disabled:L}=va(),D=v||L||l,U=ft(C,ct.open),z=ft(C,ct.mounted),K=ft(C,ct.value),W=ft(C,ct.triggerProps),J=ft(C,ct.positionerElement),te=ft(C,ct.listElement),V=ft(C,ct.popupSide),B=ft(C,ct.id),G=ft(C,ct.labelId),X=ft(C,ct.hasSelectedValue),ae=z&&J?V:null,M=a??B,P=DP(k,G);y_({id:M});const $=En(J),j=y.useRef(null),{getButtonProps:re,buttonRef:oe}=su({disabled:D,native:c}),ce=tt(Ie=>{C.set("triggerElement",Ie)}),de=Kn(),fe=Kn(),ve=Kn();y.useEffect(()=>{if(U)return ve.start(VP,()=>{N.current.allowUnselectedMouseUp=!0,N.current.allowSelectedMouseUp=!0}),()=>{ve.clear()};N.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},fe.clear()},[U,N,fe,ve]);const Fe=Ir(W,{id:M,role:"combobox","aria-expanded":U?"true":"false","aria-haspopup":"listbox","aria-controls":U?te?.id??Dh(J)?.id:void 0,"aria-labelledby":P,"aria-readonly":R||void 0,"aria-required":I||void 0,tabIndex:D?-1:0,onFocus(Ie){m(!0),U&&A.current&&S(!1,mt(eu,Ie.nativeEvent)),de.start(0,()=>{C.set("forceMount",!0)})},onBlur(Ie){nt(J,Ie.relatedTarget)||(p(!0),m(!1),b==="onBlur"&&_.commit(K))},onMouseDown(Ie){if(U)return;const Be=_t(Ie.currentTarget);function Ge($e){if(!j.current)return;const Me=$e.target;if(nt(j.current,Me)||nt($.current,Me))return;const we=N_(j.current);$e.clientX>=we.left-Xf&&$e.clientX<=we.right+Xf&&$e.clientY>=we.top-Xf&&$e.clientY<=we.bottom+Xf||S(!1,mt(p3,$e))}fe.start(0,()=>{Be.addEventListener("mouseup",Ge,{once:!0})})}},f,re),De=_.getValidationProps(D,Fe);De.role="combobox";const Ee={...x,open:U,disabled:D,value:K,readOnly:R,popupSide:ae,placeholder:!X};return Nn("button",t,{ref:[n,j,oe,ce],state:Ee,stateAttributesMapping:qP,props:De})}),GP={value:()=>null},KP=y.forwardRef(function(t,n){const{className:r,render:s,children:a,placeholder:l,style:c,...d}=t,{store:f,valueRef:p}=va(),m=ft(f,ct.value),b=ft(f,ct.items),x=ft(f,ct.itemToStringLabel),v=ft(f,ct.hasSelectedValue),k=!v&&l!=null&&a==null,C=ft(f,ct.hasNullItemLabel,k),S={value:m,placeholder:!v};let N=null;return typeof a=="function"?N=a(m):a!=null?N=a:!v&&l!=null&&!C?N=l:Array.isArray(m)?N=_P(m,b,x):N=T_(m,b,x),Nn("span",t,{state:S,ref:[n,p],props:[{children:N},d],stateAttributesMapping:GP})}),XP=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,{store:c}=va(),f={open:ft(c,ct.open)};return Nn("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:Fx})}),WP=y.createContext(void 0),QP=y.forwardRef(function(t,n){const{store:r}=va(),s=ft(r,ct.mounted),a=ft(r,ct.forceMount);return s||a?h.jsx(WP.Provider,{value:!0,children:h.jsx(Cx,{ref:n,...t})}):null});function Vx(e){return ax(19)?e:e?"true":void 0}const __=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ZP(){return y.useContext(__)}function A_(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,a=tt(s),l=y.useRef(0),c=xr(e9).current,d=xr(JP).current,[f,p]=y.useState(0),m=y.useRef(f),b=tt((S,N)=>{d.set(S,N??null),m.current+=1,p(m.current)}),x=tt(S=>{d.delete(S),m.current+=1,p(m.current)}),v=y.useMemo(()=>{const S=new Map;return Array.from(d.keys()).filter(_=>_.isConnected).sort(t9).forEach((_,R)=>{const I=d.get(_)??{};S.set(_,{...I,index:R})}),S},[d,f]);Ye(()=>{if(typeof MutationObserver!="function"||v.size===0)return;const S=new MutationObserver(N=>{const _=new Set,R=I=>_.has(I)?_.delete(I):_.add(I);N.forEach(I=>{I.removedNodes.forEach(R),I.addedNodes.forEach(R)}),_.size===0&&(m.current+=1,p(m.current))});return v.forEach((N,_)=>{_.parentElement&&S.observe(_.parentElement,{childList:!0})}),()=>{S.disconnect()}},[v]),Ye(()=>{m.current===f&&(n.current.length!==v.size&&(n.current.length=v.size),r&&r.current.length!==v.size&&(r.current.length=v.size),l.current=v.size),a(v)},[a,v,n,r,f]),Ye(()=>()=>{n.current=[]},[n]),Ye(()=>()=>{r&&(r.current=[])},[r]);const k=tt(S=>(c.add(S),()=>{c.delete(S)}));Ye(()=>{c.forEach(S=>S(v))},[c,v]);const C=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:k,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,k,n,r,l]);return h.jsx(__.Provider,{value:C,children:t})}function JP(){return new Map}function e9(){return new Set}function t9(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const n9=y.createContext(void 0);function qx(){return y.useContext(n9)?.direction??"ltr"}const r9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:c,middlewareData:d}=t,{element:f,padding:p=0,offsetParent:m="real"}=Si(e,t)||{};if(f==null)return{};const b=x3(p),x={x:n,y:r},v=yx(s),k=xx(v),C=await l.getDimensions(f),S=v==="y",N=S?"top":"left",_=S?"bottom":"right",R=S?"clientHeight":"clientWidth",I=a.reference[k]+a.reference[v]-x[v]-a.floating[k],A=x[v]-a.reference[v],L=m==="real"?await l.getOffsetParent?.(f):c.floating;let D=c.floating[R]||a.floating[k];(!D||!await l.isElement?.(L))&&(D=c.floating[R]||a.floating[k]);const U=I/2-A/2,z=D/2-C[k]/2-1,K=Math.min(b[N],z),W=Math.min(b[_],z),J=K,te=D-C[k]-W,V=D/2-C[k]/2+U,B=b3(J,V,te),G=!d.arrow&&xa(s)!=null&&V!==B&&a.reference[k]/2-(V<J?K:W)-C[k]/2<0,X=G?V<J?V-J:V-te:0;return{[v]:x[v]+X,data:{[v]:B,centerOffset:V-B-X,...G&&{alignmentOffset:X}},reset:G}}}),s9=(e,t)=>({...r9(e),options:[e,t]}),i9=eP().fn,a9={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,a=t===0&&n===0&&r===0&&s===0;return{data:{referenceHidden:(await i9(e)).data?.referenceHidden||a}}}},vh={sideX:"left",sideY:"top"},R_={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:s},platform:a,strategy:l,placement:c}=e,d=an(s),f=d.getComputedStyle(s);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:vh};const m=await a.getOffsetParent?.(s);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(m===d){const N=_t(s);b={width:N.documentElement.clientWidth,height:N.documentElement.clientHeight}}else await a.isElement?.(m)&&(b=await a.getDimensions(m));const x=$r(c);let v=t,k=n;x==="left"&&(v=b.width-(t+r.width)),x==="top"&&(k=b.height-(n+r.height));const C=x==="left"?"right":vh.sideX,S=x==="top"?"bottom":vh.sideY;return{x:v,y:k,data:{sideX:C,sideY:S}}}};function O_(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function lC(e,t,n){const{rects:r,placement:s}=e;return{side:O_(t,$r(s),n),align:xa(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Yx(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:d=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:b,keepMounted:x=!1,floatingRootContext:v,mounted:k,collisionAvoidance:C,shiftCrossAxis:S=!1,nodeId:N,adaptiveOrigin:_,lazyFlip:R=!1,externalTree:I}=e,[A,L]=y.useState(null);!k&&A!==null&&L(null);const D=C.side||"flip",U=C.align||"flip",z=C.fallbackAxisSide||"end",K=typeof t=="function"?t:void 0,W=tt(K),J=K?W:t,te=En(t),V=En(k),G=qx()==="rtl",X=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"}[r],ae=a==="center"?X:`${X}-${a}`;let M=d;const P=1,$=r==="bottom"?P:0,j=r==="top"?P:0,re=r==="right"?P:0,oe=r==="left"?P:0;typeof M=="number"?M={top:M+$,right:M+oe,bottom:M+j,left:M+re}:M&&(M={top:(M.top||0)+$,right:(M.right||0)+oe,bottom:(M.bottom||0)+j,left:(M.left||0)+re});const ce={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:M},de=y.useRef(null),fe=En(s),ve=En(l),Fe=typeof s!="function"?s:0,De=typeof l!="function"?l:0,Ee=[];b&&Ee.push(b),Ee.push(X8(lt=>{const Lt=lC(lt,r,G),Qt=typeof fe.current=="function"?fe.current(Lt):fe.current,$t=typeof ve.current=="function"?ve.current(Lt):ve.current;return{mainAxis:Qt,crossAxis:$t,alignmentAxis:$t}},[Fe,De,G,r]));const Ie=U==="none"&&D!=="shift",Be=!Ie&&(f||S||D==="shift"),Ge=D==="none"?null:Z8({...ce,padding:{top:M.top+P,right:M.right+P,bottom:M.bottom+P,left:M.left+P},mainAxis:!S&&D==="flip",crossAxis:U==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),$e=Ie?null:W8(lt=>{const Lt=_t(lt.elements.floating).documentElement;return{...ce,rootBoundary:S?{x:0,y:0,width:Lt.clientWidth,height:Lt.clientHeight}:void 0,mainAxis:U!=="none",crossAxis:Be,limiter:f||S?void 0:Q8(Qt=>{if(!de.current)return{};const{width:$t,height:Zt}=de.current.getBoundingClientRect(),Xe=ls($r(Qt.placement)),yt=Xe==="y"?$t:Zt,Ut=Xe==="y"?M.left+M.right:M.top+M.bottom;return{offset:yt/2+Ut/2}})}},[ce,f,S,M,U]);D==="shift"||U==="shift"||a==="center"?Ee.push($e,Ge):Ee.push(Ge,$e),Ee.push(J8({...ce,apply({elements:{floating:lt},availableWidth:Lt,availableHeight:Qt,rects:$t}){if(!V.current)return;const Zt=lt.style;Zt.setProperty("--available-width",`${Lt}px`),Zt.setProperty("--available-height",`${Qt}px`);const Xe=an(lt).devicePixelRatio||1,{x:yt,y:Ut,width:Jt,height:Xn}=$t.reference,Et=(Math.round((yt+Jt)*Xe)-Math.round(yt*Xe))/Xe,on=(Math.round((Ut+Xn)*Xe)-Math.round(Ut*Xe))/Xe;Zt.setProperty("--anchor-width",`${Et}px`),Zt.setProperty("--anchor-height",`${on}px`)}}),s9(lt=>({element:de.current||_t(lt.elements.floating).createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(lt){const{elements:Lt,middlewareData:Qt,placement:$t,rects:Zt,y:Xe}=lt,yt=$r($t),Ut=ls(yt),Jt=de.current,Xn=Qt.arrow?.x||0,Et=Qt.arrow?.y||0,on=Jt?.clientWidth||0,Er=Jt?.clientHeight||0,gn=Xn+on/2,Tn=Et+Er/2,ht=Math.abs(Qt.shift?.y||0),Ot=Zt.reference.height/2,bn=typeof s=="function"?s(lC(lt,r,G)):s,Un=ht>bn,jn={top:`${gn}px calc(100% + ${bn}px)`,bottom:`${gn}px ${-bn}px`,left:`calc(100% + ${bn}px) ${Tn}px`,right:`${-bn}px ${Tn}px`}[yt],en=`${gn}px ${Zt.reference.y+Ot-Xe}px`;return Lt.floating.style.setProperty("--transform-origin",Be&&Ut==="y"&&Un?en:jn),{}}},a9,_),Ye(()=>{!k&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[k,v]);const Me=y.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:we,elements:ye,x:Oe,y:je,middlewareData:ee,update:me,placement:ie,context:Q,isPositioned:Y,floatingStyles:F}=cP({rootContext:v,open:x?k:void 0,placement:ae,middleware:Ee,strategy:n,whileElementsMounted:x?void 0:(...lt)=>rC(...lt,Me),nodeId:N,externalTree:I}),{sideX:le,sideY:Ce}=ee.adaptiveOrigin||vh,Re=Y?n:"fixed",Ve=y.useMemo(()=>{const lt=_?{position:Re,[le]:Oe,[Ce]:je}:{position:Re,...F};return Y||(lt.opacity=0),lt},[_,Re,le,Oe,Ce,je,F,Y]),ot=y.useRef(null);Ye(()=>{if(!k)return;const lt=te.current,Lt=typeof lt=="function"?lt():lt,$t=(uC(Lt)?Lt.current:Lt)||null||null;$t!==ot.current&&(we.setPositionReference($t),ot.current=$t)},[k,we,J,te]),y.useEffect(()=>{if(!k)return;const lt=te.current;typeof lt!="function"&&uC(lt)&&lt.current!==ot.current&&(we.setPositionReference(lt.current),ot.current=lt.current)},[k,we,J,te]),y.useEffect(()=>{if(x&&k&&ye.reference&&ye.floating)return rC(ye.reference,ye.floating,me,Me)},[x,k,ye,me,Me]);const et=$r(ie),dt=O_(r,et,G),ut=xa(ie)||"center",qe=!!ee.hide?.referenceHidden;Ye(()=>{R&&k&&Y&&L(et)},[R,k,Y,et]);const Rt=y.useMemo(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),jt=ee.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:Ve,arrowStyles:Rt,arrowRef:de,arrowUncentered:jt,side:dt,align:ut,physicalSide:et,anchorHidden:qe,refs:we,context:Q,isPositioned:Y,update:me}),[Ve,Rt,de,jt,dt,ut,et,qe,we,Q,Y,me])}function uC(e){return e!=null&&"current"in e}const I_=y.createContext(void 0);function o9(){const e=y.useContext(I_);if(!e)throw new Error(Dn(59));return e}const Gx=y.forwardRef(function(t,n){const{cutout:r,...s}=t;let a;if(r){const l=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Vh(e,t){e&&Object.assign(e.style,t)}const l9={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Lm(e){return e==="starting"?r8:dn}function Kx(e,t,{styles:n,transitionStatus:r,props:s,refs:a,hidden:l,inert:c=!1}){const d={...n};return c&&(d.pointerEvents="none"),Nn("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},Lm(r),s],stateAttributesMapping:ru})}let cC={},dC={},fC="";function u9(e){if(typeof document>"u")return!1;const t=_t(e);return an(t).innerWidth-t.documentElement.clientWidth>0}function c9(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=_t(e),r=n.documentElement,s=n.body,a=wo(r)?r:s,l=a.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const f=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=c,d===f}function d9(e){const t=_t(e),n=t.documentElement,r=t.body,s=wo(n)?n:r,a={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,a)}}function f9(e){const t=_t(e),n=t.documentElement,r=t.body,s=an(n);let a=0,l=0,c=!1;const d=Is.create();if(ba&&(s.visualViewport?.scale??1)!==1)return()=>{};function f(){const x=s.getComputedStyle(n),v=s.getComputedStyle(r),S=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,cC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},fC=n.style.scrollBehavior,dC={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const N=n.scrollHeight>n.clientHeight,_=n.scrollWidth>n.clientWidth,R=x.overflowY==="scroll"||v.overflowY==="scroll",I=x.overflowX==="scroll"||v.overflowX==="scroll",A=Math.max(0,s.innerWidth-r.clientWidth),L=Math.max(0,s.innerHeight-r.clientHeight),D=parseFloat(v.marginTop)+parseFloat(v.marginBottom),U=parseFloat(v.marginLeft)+parseFloat(v.marginRight),z=wo(n)?n:r;if(c=c9(e),c){n.style.scrollbarGutter=S,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(N||R)&&(n.style.overflowY="scroll"),(_||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:D||L?`calc(100dvh - ${D+L}px)`:"100dvh",width:U||A?`calc(100vw - ${U+A}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,cC),Object.assign(r.style,dC),c||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=fC)}function m(){p(),d.request(f)}f();const b=Tt(s,"resize",m);return()=>{d.cancel(),p(),typeof s.removeEventListener=="function"&&b()}}class h9{lockCount=0;restore=null;timeoutLock=gs.create();timeoutUnlock=gs.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=_t(t).documentElement,s=an(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=qn;return}const a=Tm||!u9(t);this.restore=a?d9(t):f9(t)}}const m9=new h9;function M_(e=!0,t=null){Ye(()=>{if(e)return m9.acquire(t)},[e,t])}const p9=20;function L_(e,t,n,r){const[s,a]=y.useState(!1);Ye(()=>{if(!e||!t||n==null){a(!1);return}const l=_t(n).documentElement.clientWidth,c=n.offsetWidth;a(l>0&&c>0&&c>=l-p9)},[e,t,n]),M_(e&&(!t||s),r)}const g9={position:"fixed"},b9=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:c="bottom",align:d="center",sideOffset:f=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k,alignItemWithTrigger:C=!0,collisionAvoidance:S=P3,style:N,..._}=t,{store:R,listRef:I,labelsRef:A,alignItemWithTriggerActiveRef:L,selectedItemTextRef:D,valuesRef:U,initialValueRef:z,popupRef:K,setValue:W}=va(),J=b_(),te=ft(R,ct.open),V=ft(R,ct.mounted),B=ft(R,ct.modal),G=ft(R,ct.value),X=ft(R,ct.openMethod),ae=ft(R,ct.positionerElement),M=ft(R,ct.triggerElement),P=ft(R,ct.isItemEqualToValue),$=ft(R,ct.transitionStatus),j=y.useRef(null),re=y.useRef(null),[oe,ce]=y.useState(C),de=V&&oe&&X!=="touch";!V&&oe!==C&&ce(C),Ye(()=>{V||(ct.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),ct.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,V]),y.useImperativeHandle(L,()=>de),L_((de||B)&&te,X==="touch",ae,M);const fe=Yx({anchor:r,floatingRootContext:J,positionMethod:s,mounted:V,side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:x,collisionBoundary:m,collisionPadding:b,sticky:v,disableAnchorTracking:k??de,collisionAvoidance:S,keepMounted:!0}),ve=de?"none":fe.side,Fe=de?g9:fe.positionerStyles,De={open:te,side:ve,align:fe.align,anchorHidden:fe.anchorHidden};Ye(()=>{R.set("popupSide",fe.side)},[R,fe.side]);const Ee=tt(Me=>{R.set("positionerElement",Me)}),Ie=Kx(t,De,{styles:Fe,transitionStatus:$,props:_,refs:[n,Ee],hidden:!V,inert:!te}),Be=y.useRef(0),Ge=tt(Me=>{if(Me.size===0&&Be.current===0||U.current.length===0)return;const we=Be.current;if(Be.current=Me.size,Me.size===we)return;const ye=mt(eu);if(we!==0&&!R.state.multiple&&G!==null&&Rc(U.current,G,P)===-1){const je=z.current,me=je!=null&&Rc(U.current,je,P)!==-1?je:null;W(me,ye),me===null&&(R.set("selectedIndex",null),D.current=null)}if(we!==0&&R.state.multiple&&Array.isArray(G)){const Oe=ee=>Rc(U.current,ee,P)!==-1,je=G.filter(ee=>Oe(ee));(je.length!==G.length||je.some(ee=>!wP(G,ee,P)))&&(W(je,ye),je.length===0&&(R.set("selectedIndex",null),D.current=null))}if(te&&de){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Oe={height:""};Vh(ae,Oe),Vh(K.current,Oe)}}),$e=y.useMemo(()=>({...fe,side:ve,alignItemWithTriggerActive:de,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:j,scrollDownArrowRef:re}),[fe,ve,de,ce]);return h.jsx(A_,{elementsRef:I,labelsRef:A,onMapChange:Ge,children:h.jsxs(I_.Provider,{value:$e,children:[V&&B&&h.jsx(Gx,{inert:Vx(!te),cutout:M}),Ie]})})}),Wf="base-ui-disable-scrollbar",hC={className:Wf,getElement(e){return h.jsx("style",{nonce:e,href:Wf,precedence:"base-ui:low",children:`.${Wf}{scrollbar-width:none}.${Wf}::-webkit-scrollbar{display:none}`})}},x9=y.createContext(void 0);function D_(e){return y.useContext(x9)}const y9="ArrowUp",E9="ArrowDown",v9="ArrowLeft",T9="ArrowRight",S9="Home",C9="End",w9=new Set([v9,T9]),k9=new Set([y9,E9]),N9=new Set([...w9,...k9]),Xx=new Set([...N9,S9,C9]),_9=y.createContext(void 0),A9={disableStyleElements:!1};function R9(){return y.useContext(_9)??A9}const O9={...ru,...nu},I9=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...c}=t,{store:d,popupRef:f,onOpenChangeComplete:p,setOpen:m,valueRef:b,firstItemTextRef:x,selectedItemTextRef:v,multiple:k,handleScrollArrowVisibility:C,scrollHandlerRef:S,listRef:N,highlightItemOnHover:_}=va(),{side:R,align:I,alignItemWithTriggerActive:A,isPositioned:L,setControlledAlignItemWithTrigger:D}=o9(),U=D_()!=null,z=b_(),K=qx(),{nonce:W,disableStyleElements:J}=R9(),te=ft(d,ct.id),V=ft(d,ct.open),B=ft(d,ct.openMethod),G=ft(d,ct.mounted),X=ft(d,ct.popupProps),ae=ft(d,ct.transitionStatus),M=ft(d,ct.triggerElement),P=ft(d,ct.positionerElement),$=ft(d,ct.listElement),j=y.useRef(!1),re=y.useRef(!1),oe=y.useRef({}),ce=$l(),de=tt(De=>{if(!P||!f.current||!re.current)return;if(j.current||!A){C();return}const Ee=P.style.top==="0px",Ie=P.style.bottom==="0px";if(!Ee&&!Ie){C();return}const Be=pC(P),Ge=Sc(P.getBoundingClientRect().height,"y",Be),$e=_t(P),Me=an(P),we=Me.getComputedStyle(P),ye=parseFloat(we.marginTop),Oe=parseFloat(we.marginBottom),je=mC(Me.getComputedStyle(f.current)),ee=Math.min($e.documentElement.clientHeight-ye-Oe,je),me=De.scrollTop,ie=Qf(De);let Q=0,Y=null,F=!1,le=!1;const Ce=et=>{P.style.height=`${et}px`},Re=(et,dt)=>{const ut=Tc(et,0,ee-Ge);ut>0&&Ce(Ge+ut),De.scrollTop=dt,ee-(Ge+ut)<=ci&&(j.current=!0),C()},Ve=Ee?ie-me:me,ot=Math.min(Ge+Ve,ee);if(Q=ot,Ve<=ci){Re(Ve,Ee?ie:0);return}if(ee-ot>ci)Ee?le=!0:Y=0;else if(F=!0,Ie&&me<ie){const et=Ge+Ve-ee;Y=me-(Ve-et)}if(Q=Math.ceil(Q),Q!==0&&Ce(Q),le||Y!=null){const et=Qf(De),dt=le?et:Tc(Y,0,et);Math.abs(De.scrollTop-dt)>ci&&(De.scrollTop=dt)}(F||Q>=ee-ci)&&(j.current=!0),C()});y.useImperativeHandle(S,()=>de,[de]),ko({open:V,ref:f,onComplete(){V&&p?.(!0)}});const fe={open:V,transitionStatus:ae,side:R,align:I};Ye(()=>{!P||!f.current||Object.keys(oe.current).length||(oe.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[f,P]),Ye(()=>{V||A||(re.current=!1,j.current=!1,Vh(P,oe.current))},[V,A,P,f]),Ye(()=>{const De=f.current;if(!V||!M||!P||!De||A&&!L||d.state.transitionStatus==="ending")return;if(!A){re.current=!0,ce.request(C),De.style.removeProperty("--transform-origin");return}const Ee=M9(De);De.style.removeProperty("--transform-origin");try{let Ie=v.current;Ie?.isConnected||(Ie=!ct.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const Be=b.current,Ge=an(P),$e=Ge.getComputedStyle(P),Me=Ge.getComputedStyle(De),we=_t(M),ye=pC(M),Oe=Zf(M.getBoundingClientRect(),ye),je=Zf(P.getBoundingClientRect(),ye),ee=Oe.height,me=$||De,ie=me.scrollHeight,Q=parseFloat(Me.borderBottomWidth),Y=parseFloat($e.marginTop)||10,F=parseFloat($e.marginBottom)||10,le=parseFloat($e.minHeight)||100,Ce=mC(Me),Re=5,Ve=5,ot=20,et=we.documentElement.clientHeight-Y-F,dt=we.documentElement.clientWidth,ut=et-Oe.bottom+ee;let qe,Rt=K==="rtl"?Oe.right-je.width:Oe.left,jt=0;if(Ie&&Be){const Et=Zf(Be.getBoundingClientRect(),ye);qe=Zf(Ie.getBoundingClientRect(),ye),Rt=je.left+(K==="rtl"?Et.right-qe.right:Et.left-qe.left);const on=Et.top-Oe.top+Et.height/2;jt=qe.top-je.top+qe.height/2-on}const lt=ut+jt+F+Q;let Lt=Math.min(et,lt);const Qt=et-Y-F,$t=lt-Lt,Zt=dt-Ve;P.style.left=`${Tc(Rt,Re,Zt-je.width)}px`,P.style.height=`${Lt}px`,P.style.maxHeight="none",P.style.marginTop=`${Y}px`,P.style.marginBottom=`${F}px`,De.style.height="100%";const Xe=Qf(me),yt=$t>=Xe-ci;yt&&(Lt=Math.min(et,je.height)-($t-Xe));const Ut=Oe.top<ot||Oe.bottom>et-ot||Math.ceil(Lt)+ci<Math.min(ie,le),Jt=(Ge.visualViewport?.scale??1)!==1&&ba;if(Ut||Jt){re.current=!0,Vh(P,oe.current),D(!1);return}const Xn=Math.max(le,Lt);if(yt){const Et=Math.max(0,et-lt);P.style.top=je.height>=Qt?"0":`${Et}px`,P.style.height=`${Lt}px`,me.scrollTop=Qf(me)}else P.style.bottom="0",me.scrollTop=$t;if(qe){const Et=je.top,on=je.height,Er=qe.top+qe.height/2,gn=on>0?(Er-Et)/on*100:50,Tn=Tc(gn,0,100);De.style.setProperty("--transform-origin",`50% ${Tn}%`)}(Xn===et||Lt>=Ce)&&(j.current=!0),C(),_&&d.state.selectedIndex===null&&d.state.activeIndex===null&&N.current[0]!=null&&d.set("activeIndex",0),re.current=!0}finally{Ee()}},[d,V,P,M,b,x,v,f,C,A,D,ce,$,N,_,K,L]),y.useEffect(()=>{if(!A||!P||!V)return;const De=an(P);function Ee(Ie){m(!1,mt(xj,Ie))}return Tt(De,"resize",Ee)},[m,A,P,V]);const ve={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${te}-list`},onKeyDown(De){U&&Xx.has(De.key)&&De.stopPropagation()},onScroll(De){$||de(De.currentTarget)},...A&&{style:$?{height:"100%"}:l9}},Fe=Nn("div",t,{ref:[n,f],state:fe,stateAttributesMapping:O9,props:[X,ve,Lm(ae),{className:!$&&A?hC.className:void 0},c]});return h.jsxs(y.Fragment,{children:[!J&&hC.getElement(W),h.jsx(Nx,{context:z,modal:!1,disabled:!G,openInteractionType:B,returnFocus:l,restoreFocus:!0,children:Fe})]})});function mC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Qf(e){return k_(e.scrollHeight,e.clientHeight)}function pC(e){return Q3.getScale(e)}function Sc(e,t,n){return e/n[t]}function Zf(e,t){return Kc({x:Sc(e.x,"x",t),y:Sc(e.y,"y",t),width:Sc(e.width,"x",t),height:Sc(e.height,"y",t)})}const gC=[["transform","none"],["scale","1"],["translate","0 0"]];function M9(e){const{style:t}=e,n={};for(const[r,s]of gC)n[r]=t.getPropertyValue(r),t.setProperty(r,s,"important");return()=>{for(const[r]of gC){const s=n[r];s?t.setProperty(r,s):t.removeProperty(r)}}}let j_=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Wx(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:a}=e,{register:l,unregister:c,subscribeMapChange:d,elementsRef:f,labelsRef:p,nextIndexRef:m}=ZP(),b=y.useRef(-1),[x,v]=y.useState(a??(s===j_.GuessFromOrder?()=>{if(b.current===-1){const S=m.current;m.current+=1,b.current=S}return b.current}:-1)),k=y.useRef(null),C=y.useCallback(S=>{if(k.current=S,x!==-1&&S!==null&&(f.current[x]=S,p)){const N=t!==void 0;p.current[x]=N?t:r?.current?.textContent??S.textContent}},[x,f,p,t,r]);return Ye(()=>{if(a!=null)return;const S=k.current;if(S)return l(S,n),()=>{c(S)}},[a,l,c,n]),Ye(()=>{if(a==null)return d(S=>{const N=k.current?S.get(k.current)?.index:null;N!=null&&v(N)})},[a,d,v]),{ref:C,index:x}}const P_=y.createContext(void 0);function Qx(){const e=y.useContext(P_);if(!e)throw new Error(Dn(57));return e}const L9=y.memo(y.forwardRef(function(t,n){const{render:r,className:s,style:a,value:l=null,label:c,disabled:d=!1,nativeButton:f=!1,...p}=t,m=y.useRef(null),b=Wx({label:c,textRef:m,indexGuessBehavior:j_.GuessFromOrder}),{store:x,itemProps:v,setOpen:k,setValue:C,selectionRef:S,typingRef:N,valuesRef:_,multiple:R,selectedItemTextRef:I,disabled:A,readOnly:L}=va(),D=ft(x,ct.isActive,b.index),U=ft(x,ct.open),z=ft(x,ct.isSelected,l),K=ft(x,ct.isSelectedByFocus,b.index),W=ft(x,ct.isItemEqualToValue),J=b.index,te=J!==-1,V=y.useRef(null);Ye(()=>{if(!te)return;const de=_.current;return de[J]=l,()=>{delete de[J]}},[te,J,l,_]),Ye(()=>{if(!te)return;const de=x.state.value;let fe=de;R&&Array.isArray(de)&&(fe=de.length>0?de[de.length-1]:void 0),fe!==void 0&&go(l,fe,W)&&(x.set("selectedIndex",J),m.current&&(I.current=m.current))},[te,J,R,W,x,l,I]);const B=y.useRef(null),G=y.useRef("mouse"),X=y.useRef(!1),{getButtonProps:ae,buttonRef:M}=su({disabled:d,focusableWhenDisabled:!0,native:f,composite:!0}),P={disabled:d,selected:z,highlighted:D};function $(de){if(A||L)return;const fe=x.state.value;if(R){const ve=Array.isArray(fe)?fe:[],Fe=z?kP(ve,l,W):[...ve,l];C(Fe,mt(_c,de))}else C(l,mt(_c,de)),k(!1,mt(_c,de))}function j(){S.current.dragY=0}const re={role:"option","aria-selected":z,tabIndex:U&&D?0:-1,onKeyDown(de){B.current=de.key,x.set("activeIndex",J),de.key===" "&&N.current&&de.preventDefault()},onClick(de){const fe=de.type==="click"&&G.current!=="touch",ve=de.nativeEvent.pointerType,Fe=fe&&mx(de.nativeEvent)&&(ve!==void 0||D),De=fe&&!Fe&&!X.current;X.current=!1,!(de.type==="keydown"&&B.current===null)&&(d||de.type==="keydown"&&B.current===" "&&N.current||De||(B.current=null,$(de.nativeEvent)))},onPointerEnter(de){G.current=de.pointerType},onPointerMove(de){if(de.pointerType==="mouse"&&de.buttons===1){const fe=S.current;fe.dragY+=de.movementY,fe.dragY**2>=64&&(fe.allowUnselectedMouseUp=!0)}},onPointerDown(de){G.current=de.pointerType,X.current=!0,j()},onMouseUp(){if(j(),d||G.current==="touch"||X.current)return;const de=!S.current.allowSelectedMouseUp&&z,fe=!S.current.allowUnselectedMouseUp&&!z;de||fe||(X.current=!0,V.current?.click(),X.current=!1)}},oe=Nn("div",t,{ref:[M,n,b.ref,V],state:P,props:[v,re,p,ae]}),ce=y.useMemo(()=>({selected:z,index:J,textRef:m,selectedByFocus:K,hasRegistered:te}),[z,J,m,K,te]);return h.jsx(P_.Provider,{value:ce,children:oe})})),D9=y.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:s}=Qx();return r||s?h.jsx(j9,{...t,ref:n}):null}),j9=y.memo(y.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:a,...l}=e,{selected:c}=Qx(),d=y.useRef(null),{transitionStatus:f,setMounted:p}=Rx(c),b=Nn("span",e,{ref:[t,d],state:{selected:c,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:nu});return ko({open:c,ref:d,onComplete(){c||p(!1)}}),b})),P9=y.memo(y.forwardRef(function(t,n){const{index:r,textRef:s,selectedByFocus:a,hasRegistered:l}=Qx(),{firstItemTextRef:c,selectedItemTextRef:d}=va(),{render:f,className:p,style:m,...b}=t,x=y.useCallback(k=>{k&&(l&&r===0&&(c.current=k),l&&a&&(d.current=k))},[c,d,r,a,l]);return Nn("div",t,{ref:[x,n,s],props:b})}));/**
67
+ * @license lucide-react v1.25.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const B_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
72
+ * @license lucide-react v1.25.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const B9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
77
+ * @license lucide-react v1.25.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const z9=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
82
+ * @license lucide-react v1.25.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const bC=e=>{const t=z9(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
87
+ * @license lucide-react v1.25.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */var X0={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"};/**
92
+ * @license lucide-react v1.25.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const H9=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},U9=y.createContext({}),F9=()=>y.useContext(U9),$9=y.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...c},d)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:b="currentColor",className:x=""}=F9()??{},v=r??m?Number(n??p)*24/Number(t??f):n??p;return y.createElement("svg",{ref:d,...X0,width:t??f??X0.width,height:t??f??X0.height,stroke:e??b,strokeWidth:v,className:B_("lucide",x,s),...!a&&!H9(c)&&{"aria-hidden":"true"},...c},[...l.map(([k,C])=>y.createElement(k,C)),...Array.isArray(a)?a:[a]])});/**
97
+ * @license lucide-react v1.25.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Ke=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement($9,{ref:a,iconNode:t,className:B_(`lucide-${B9(bC(e))}`,`lucide-${e}`,r),...s}));return n.displayName=bC(e),n};/**
102
+ * @license lucide-react v1.25.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const V9=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],q9=Ke("arrow-down",V9);/**
107
+ * @license lucide-react v1.25.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Y9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],z_=Ke("arrow-left",Y9);/**
112
+ * @license lucide-react v1.25.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const G9=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],K9=Ke("arrow-up",G9);/**
117
+ * @license lucide-react v1.25.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const X9=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],W9=Ke("at-sign",X9);/**
122
+ * @license lucide-react v1.25.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const Q9=[["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"}]],Z9=Ke("brain",Q9);/**
127
+ * @license lucide-react v1.25.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const J9=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],e7=Ke("calendar-clock",J9);/**
132
+ * @license lucide-react v1.25.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const t7=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],n7=Ke("chart-pie",t7);/**
137
+ * @license lucide-react v1.25.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const r7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],H_=Ke("check",r7);/**
142
+ * @license lucide-react v1.25.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const s7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],U_=Ke("chevron-down",s7);/**
147
+ * @license lucide-react v1.25.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const i7=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],qh=Ke("chevron-left",i7);/**
152
+ * @license lucide-react v1.25.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const a7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dm=Ke("chevron-right",a7);/**
157
+ * @license lucide-react v1.25.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const o7=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],l7=Ke("chevrons-up-down",o7);/**
162
+ * @license lucide-react v1.25.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const u7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],c7=Ke("circle-arrow-down",u7);/**
167
+ * @license lucide-react v1.25.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const d7=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],f7=Ke("clipboard-list",d7);/**
172
+ * @license lucide-react v1.25.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const h7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],xC=Ke("clock",h7);/**
177
+ * @license lucide-react v1.25.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const m7=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Zx=Ke("code",m7);/**
182
+ * @license lucide-react v1.25.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const p7=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],g7=Ke("copy",p7);/**
187
+ * @license lucide-react v1.25.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const b7=[["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"}]],F_=Ke("download",b7);/**
192
+ * @license lucide-react v1.25.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const x7=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],y7=Ke("ellipsis",x7);/**
197
+ * @license lucide-react v1.25.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const E7=[["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"}]],$_=Ke("eye",E7);/**
202
+ * @license lucide-react v1.25.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const v7=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],T7=Ke("file-diff",v7);/**
207
+ * @license lucide-react v1.25.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const S7=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C7=Ke("file-exclamation-point",S7);/**
212
+ * @license lucide-react v1.25.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const w7=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jx=Ke("file-text",w7);/**
217
+ * @license lucide-react v1.25.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const k7=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],jm=Ke("file",k7);/**
222
+ * @license lucide-react v1.25.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const N7=[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],_7=Ke("folder-cog",N7);/**
227
+ * @license lucide-react v1.25.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const A7=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],R7=Ke("folder-open",A7);/**
232
+ * @license lucide-react v1.25.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const O7=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],I7=Ke("folder-search",O7);/**
237
+ * @license lucide-react v1.25.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const M7=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],L7=Ke("folder-tree",M7);/**
242
+ * @license lucide-react v1.25.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const D7=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],V_=Ke("folder",D7);/**
247
+ * @license lucide-react v1.25.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const j7=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],P7=Ke("gauge",j7);/**
252
+ * @license lucide-react v1.25.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const B7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yC=Ke("globe",B7);/**
257
+ * @license lucide-react v1.25.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const z7=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],q_=Ke("hand",z7);/**
262
+ * @license lucide-react v1.25.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const H7=[["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"}]],U7=Ke("history",H7);/**
267
+ * @license lucide-react v1.25.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const F7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],$7=Ke("image",F7);/**
272
+ * @license lucide-react v1.25.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const V7=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],q7=Ke("info",V7);/**
277
+ * @license lucide-react v1.25.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Y7=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Y_=Ke("link-2",Y7);/**
282
+ * @license lucide-react v1.25.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const G7=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],G_=Ke("list-checks",G7);/**
287
+ * @license lucide-react v1.25.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const K7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],X7=Ke("loader-circle",K7);/**
292
+ * @license lucide-react v1.25.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const W7=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],K_=Ke("message-circle-question-mark",W7);/**
297
+ * @license lucide-react v1.25.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Q7=[["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"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],Z7=Ke("message-square-text",Q7);/**
302
+ * @license lucide-react v1.25.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const J7=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],eB=Ke("moon",J7);/**
307
+ * @license lucide-react v1.25.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const tB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],X_=Ke("panel-left-close",tB);/**
312
+ * @license lucide-react v1.25.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const nB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],W_=Ke("panel-left-open",nB);/**
317
+ * @license lucide-react v1.25.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const rB=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],sB=Ke("paperclip",rB);/**
322
+ * @license lucide-react v1.25.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const iB=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aB=Ke("pencil-line",iB);/**
327
+ * @license lucide-react v1.25.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const oB=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],lB=Ke("pencil",oB);/**
332
+ * @license lucide-react v1.25.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const uB=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],cB=Ke("plug",uB);/**
337
+ * @license lucide-react v1.25.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const dB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pm=Ke("plus",dB);/**
342
+ * @license lucide-react v1.25.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const fB=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hB=Ke("power-off",fB);/**
347
+ * @license lucide-react v1.25.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const mB=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],pB=Ke("power",mB);/**
352
+ * @license lucide-react v1.25.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const gB=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],bB=Ke("puzzle",gB);/**
357
+ * @license lucide-react v1.25.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const xB=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Bm=Ke("refresh-cw",xB);/**
362
+ * @license lucide-react v1.25.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const yB=[["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"}]],EB=Ke("rotate-ccw",yB);/**
367
+ * @license lucide-react v1.25.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const vB=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],ey=Ke("rotate-cw",vB);/**
372
+ * @license lucide-react v1.25.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const TB=[["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"}]],SB=Ke("save",TB);/**
377
+ * @license lucide-react v1.25.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const CB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zm=Ke("search",CB);/**
382
+ * @license lucide-react v1.25.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */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"}]],kB=Ke("settings",wB);/**
387
+ * @license lucide-react v1.25.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const NB=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_B=Ke("shield-check",NB);/**
392
+ * @license lucide-react v1.25.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const AB=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Hm=Ke("sparkles",AB);/**
397
+ * @license lucide-react v1.25.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const RB=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],OB=Ke("square-check-big",RB);/**
402
+ * @license lucide-react v1.25.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const IB=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],MB=Ke("square-pen",IB);/**
407
+ * @license lucide-react v1.25.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const LB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],DB=Ke("square-slash",LB);/**
412
+ * @license lucide-react v1.25.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const jB=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],PB=Ke("square-terminal",jB);/**
417
+ * @license lucide-react v1.25.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const BB=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],zB=Ke("square",BB);/**
422
+ * @license lucide-react v1.25.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const HB=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],UB=Ke("sun",HB);/**
427
+ * @license lucide-react v1.25.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const FB=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a1=Ke("terminal",FB);/**
432
+ * @license lucide-react v1.25.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const $B=[["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"}]],ty=Ke("trash-2",$B);/**
437
+ * @license lucide-react v1.25.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const VB=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bl=Ke("triangle-alert",VB);/**
442
+ * @license lucide-react v1.25.0 - ISC
443
+ *
444
+ * This source code is licensed under the ISC license.
445
+ * See the LICENSE file in the root directory of this source tree.
446
+ */const qB=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],YB=Ke("user-round",qB);/**
447
+ * @license lucide-react v1.25.0 - ISC
448
+ *
449
+ * This source code is licensed under the ISC license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */const GB=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Q_=Ke("users-round",GB);/**
452
+ * @license lucide-react v1.25.0 - ISC
453
+ *
454
+ * This source code is licensed under the ISC license.
455
+ * See the LICENSE file in the root directory of this source tree.
456
+ */const KB=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],XB=Ke("wifi-off",KB);/**
457
+ * @license lucide-react v1.25.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const WB=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],QB=Ke("wrench",WB);/**
462
+ * @license lucide-react v1.25.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const ZB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],js=Ke("x",ZB);/**
467
+ * @license lucide-react v1.25.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */const JB=[["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"}]],ez=Ke("zap",JB),Bs=LP,zs=KP,bs=P9,Hs=({className:e,children:t,...n})=>h.jsxs(YP,{"data-slot":"select-trigger",className:Se("inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text","transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t,h.jsx(XP,{className:"text-fg-4",children:h.jsx(l7,{className:"size-3.5"})})]}),Us=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:s=6,...a})=>h.jsx(QP,{children:h.jsx(b9,{align:t,alignItemWithTrigger:n,side:r,sideOffset:s,className:"isolate z-60 outline-none",children:h.jsx(I9,{"data-slot":"select-content",className:Se("max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto","rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none",e),...a})})}),xs=({className:e,children:t,...n})=>h.jsxs(L9,{"data-slot":"select-item",className:Se("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none","data-highlighted:bg-surface-hover",e),...n,children:[h.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),h.jsx(D9,{className:"mt-0.5 text-fg-1",children:h.jsx(H_,{className:"size-3.5"})})]});function tz(e){const{store:t,actionsRef:n}=e,r=t.useState("open");oP(t,r),Mx(t);const{forceUnmount:s}=Lx(r,t),a=y.useCallback(()=>{t.setOpen(!1,mt(gx))},[t]);y.useImperativeHandle(n,()=>({unmount:s,close:a}),[s,a])}function nz({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[d,f]=y.useState(0),[p,m]=y.useState(0),b=d===0,x=Am(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current||"button"in S&&S.button!==0||"touches"in S&&S.touches.length!==1)return!1;const N=gr(S);return b&&!s?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===N||e.context.backdropRef.current===N||nt(N,l)&&!N?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});M_(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(S,N)=>{f(S),m(N)}),e.useContextCallback("onNestedDialogClose",()=>{f(0),m(0)}),y.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,p+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,p,t]);const v=x.reference??dn,k=x.trigger??dn,C=x.floating??dn;return Dx(e,{activeTriggerProps:v,inactiveTriggerProps:k,popupProps:C,nestedOpenDialogCount:d,nestedOpenDrawerCount:p}),null}const Z_=y.createContext(!1),J_=y.createContext(void 0);function Ta(e){const t=y.useContext(J_);if(e===!1&&t===void 0)throw new Error(Dn(27));return t}const rz={...Bx,modal:ze(e=>e.modal),nested:ze(e=>e.nested),nestedOpenDialogCount:ze(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ze(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ze(e=>e.disablePointerDismissal),openMethod:ze(e=>e.openMethod),descriptionElementId:ze(e=>e.descriptionElementId),titleElementId:ze(e=>e.titleElementId),viewportElement:ze(e=>e.viewportElement),role:ze(e=>e.role)};class ny extends bm{constructor(t,n,r=!1){const s=new ad,a=sz(t);a.floatingRootContext=i_(s,n,r),super(a,{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:s,onOpenChange:void 0,onOpenChangeComplete:void 0},rz)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Ox(r,t,n.trigger),this.update(r)};static useStore(t,n){return n_(t,(s,a)=>new ny(n,s,a),!0).store}}function sz(e={}){return{...jx(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function eA(e,t="dialog"){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:d=!0,actionsRef:f,handle:p,triggerId:m,defaultTriggerId:b=null}=e,x=t==="drawer",v=t==="alert-dialog",k=v?!0:d,C=v||c,S=v?"alertdialog":"dialog",N=Ta(!0),R={modal:k,disablePointerDismissal:C,nested:!!N,role:S},I=ny.useStore(p?.store,{open:s,openProp:r,activeTriggerId:b,triggerIdProp:m,...R});sx(()=>{const K=r===void 0&&I.state.open===!1&&s===!0?{open:!0,activeTriggerId:b}:null;v?I.update(K?{...R,...K}:R):K&&I.update(K)}),I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",m),I.useSyncedValues(R),I.useContextCallback("onOpenChange",a),I.useContextCallback("onOpenChangeComplete",l);const A=I.useState("open"),L=I.useState("mounted"),D=I.useState("payload");tz({store:I,actionsRef:f});const U=A||L,z=y.useMemo(()=>({store:I}),[I]);return h.jsx(Z_.Provider,{value:!1,children:h.jsxs(J_.Provider,{value:z,children:[U&&h.jsx(nz,{store:I,parentContext:N?.store.context,isDrawer:x}),typeof n=="function"?n({payload:D}):n]})})}function iz(e){return eA(e,"alert-dialog")}const az={...ru,...nu},tA=y.forwardRef(function(t,n){const{render:r,className:s,style:a,forceRender:l=!1,...c}=t,{store:d}=Ta(),f=d.useState("open"),p=d.useState("nested"),m=d.useState("mounted"),b=d.useState("transitionStatus");return Nn("div",t,{state:{open:f,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:az,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!p})}),nA=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:c=!0,...d}=t,{store:f}=Ta(),p=f.useState("open"),{getButtonProps:m,buttonRef:b}=su({disabled:l,native:c}),x={disabled:l};function v(k){p&&f.setOpen(!1,mt(gj,k.nativeEvent))}return Nn("button",t,{state:x,ref:[n,b],props:[{onClick:v},d,m]})}),rA=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...c}=t,{store:d}=Ta(),f=No(l);return d.useSyncedValueWithCleanup("descriptionElementId",f),Nn("p",t,{ref:n,props:[{id:f},c]})});let oz=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),lz=(function(e){return e[e.open=no.open]="open",e[e.closed=no.closed]="closed",e[e.startingStyle=no.startingStyle]="startingStyle",e[e.endingStyle=no.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const sA=y.createContext(void 0);function uz(){const e=y.useContext(sA);if(e===void 0)throw new Error(Dn(26));return e}const cz={...ru,...nu,nestedDialogOpen(e){return e?{[lz.nestedDialogOpen]:""}:null}},iA=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,initialFocus:c,...d}=t,{store:f}=Ta(),p=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),b=f.useState("floatingRootContext"),x=f.useState("popupProps"),v=f.useState("modal"),k=f.useState("mounted"),C=f.useState("nested"),S=f.useState("nestedOpenDialogCount"),N=f.useState("open"),_=f.useState("openMethod"),R=f.useState("titleElementId"),I=f.useState("transitionStatus"),A=f.useState("role"),L=b.useState("floatingId"),D=d.id??L;uz(),ko({open:N,ref:f.context.popupRef,onComplete(){N&&f.context.onOpenChangeComplete?.(!0)}});const U=c===void 0?sP(f.context.popupRef):c,z=S>0,K=f.useStateSetter("popupElement"),J=Nn("div",t,{state:{open:N,nested:C,transitionStatus:I,nestedDialogOpen:z},props:[x,{id:D,"aria-labelledby":R??void 0,"aria-describedby":p??void 0,role:A,...Im,hidden:!k,onKeyDown(te){Xx.has(te.key)&&te.stopPropagation()},style:{[oz.nestedDialogs]:S}},d],ref:[n,f.context.popupRef,K],stateAttributesMapping:cz});return h.jsx(Nx,{context:b,openInteractionType:_,disabled:!k,closeOnFocusOut:!m,initialFocus:U,returnFocus:l,modal:v!==!1,restoreFocus:"popup",children:J})}),aA=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Ta(),l=a.useState("mounted"),c=a.useState("modal"),d=a.useState("open");return l||r?h.jsx(sA.Provider,{value:r,children:h.jsxs(Cx,{ref:n,...s,children:[l&&c===!0&&h.jsx(Gx,{ref:a.context.internalBackdropRef,inert:Vx(!d)}),t.children]})}):null}),oA=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...c}=t,{store:d}=Ta(),f=No(l);return d.useSyncedValueWithCleanup("titleElementId",f),Nn("h2",t,{ref:n,props:[{id:f},c]})}),dz=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:c=!0,id:d,payload:f,handle:p,...m}=t,b=Ta(!0),x=p?.store??b?.store;if(!x)throw new Error(Dn(79));const v=No(d),k=x.useState("floatingRootContext"),C=x.useState("isOpenedByTrigger",v),S=x.useState("triggerPopupId",v),N=y.useRef(null),{registerTrigger:_,isMountedByThisTrigger:R}=Ix(v,N,x,{payload:f}),{getButtonProps:I,buttonRef:A}=su({disabled:l,native:c}),L=_x(k,{enabled:k!=null}),D=C_(()=>x.select("open"),K=>{x.set("openMethod",K)}),U={disabled:l,open:C},z=x.useState("triggerProps",R);return Nn("button",t,{state:U,ref:[A,n,_,N],props:[L.reference,z,D,{[j3]:"",id:v,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":S},m,I],stateAttributesMapping:Fx})}),fz=dz,hz=iz,mz=fz,pz=nA,gz=({className:e,children:t,...n})=>h.jsxs(aA,{children:[h.jsx(tA,{className:Se("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),h.jsx(iA,{"data-slot":"alert-dialog-content",className:Se("fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2","rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...n,children:t})]}),bz=({className:e,...t})=>h.jsx(oA,{className:Se("text-heading-3 font-semibold text-text",e),...t}),xz=({className:e,...t})=>h.jsx(rA,{className:Se("mt-1.5 text-body-sm text-muted-foreground",e),...t}),lA=y.createContext(void 0);function uA(e){const t=y.useContext(lA);if(t===void 0&&!e)throw new Error(Dn(33));return t}const cA=y.createContext(void 0);function _o(e){const t=y.useContext(cA);if(t===void 0&&!e)throw new Error(Dn(36));return t}const yz=y.createContext(void 0);function Um(e=!0){const t=y.useContext(yz);if(t===void 0&&!e)throw new Error(Dn(25));return t}function Ez(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:a,typingRef:l,itemRef:c,itemMetadata:d}=e,{events:f}=a.useState("floatingTreeRoot"),p=a.useState("open"),m=Um(!0),b=m!==void 0;return y.useMemo(()=>({id:r,role:"menuitem",tabIndex:p&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){s&&f.emit("itemhover",{nodeId:s,target:x.currentTarget})},onClick(x){t&&f.emit("close",{domEvent:x,reason:_c})},onMouseUp(x){if(m){const v=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,b&&v&&Math.abs(x.clientX-v.x)<=1&&Math.abs(x.clientY-v.y)<=1||b&&!fx&&x.button===2)return}c.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&c.current.click()}}),[t,n,r,f,s,p,a,l,c,m,b,d])}const vz={type:"regular-item"};function Tz(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:s,store:a,typingRef:l=a.context.typingRef,nativeButton:c,itemMetadata:d,nodeId:f}=e,p=a.useState("disabled"),m=n||p,b=y.useRef(null),{getButtonProps:x,buttonRef:v}=su({disabled:m,focusableWhenDisabled:!0,native:c,composite:!0}),k=Ez({closeOnClick:t,highlighted:r,id:s,nodeId:f,store:a,typingRef:l,itemRef:b,itemMetadata:d}),C=y.useCallback(N=>Ir(k,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},N,x),[k,x,d]),S=co(b,v);return y.useMemo(()=>({getItemProps:C,itemRef:S}),[C,S])}const Sz=y.forwardRef(function(t,n){const{render:r,className:s,id:a,label:l,nativeButton:c=!1,disabled:d=!1,closeOnClick:f=!0,style:p,...m}=t,b=Wx({label:l}),x=uA(!0),v=No(a),{store:k}=_o(),C=k.useState("isActive",b.index),S=k.useState("itemProps"),{getItemProps:N,itemRef:_}=Tz({closeOnClick:f,disabled:d,highlighted:C,id:v,store:k,nativeButton:c,nodeId:x?.context.nodeId,itemMetadata:vz});return Nn("div",t,{state:{disabled:d,highlighted:C},props:[S,m,N],ref:[_,n,b.ref]})}),Cz={...ru,...nu},wz=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...c}=t,{store:d}=_o(),{side:f,align:p}=uA(),m=D_()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),v=d.useState("popupProps"),k=d.useState("mounted"),C=d.useState("instantType"),S=d.useState("activeTriggerElement"),N=d.useState("parent"),_=d.useState("lastOpenChangeReason"),R=d.useState("rootId"),I=d.useState("floatingRootContext"),A=d.useState("floatingTreeRoot"),L=d.useState("closeDelay"),D=d.useState("activeTriggerElement"),U=d.useState("hoverEnabled"),z=d.useState("disabled"),K=d.useState("openMethod"),W=N.type==="context-menu";ko({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),y.useEffect(()=>{function G(X){d.setOpen(!1,mt(X.reason,X.domEvent))}return A.events.on("close",G),()=>{A.events.off("close",G)}},[A.events,d]),c_(I,{enabled:U&&!z&&!W&&N.type!=="menubar",closeDelay:L});const J=y.useCallback(G=>{d.set("popupElement",G)},[d]),te={transitionStatus:x,side:f,align:p,open:b,nested:N.type==="menu",instant:C},V=Nn("div",t,{state:te,ref:[n,d.context.popupRef,J],stateAttributesMapping:Cz,props:[v,{onKeyDown(G){m&&Xx.has(G.key)&&G.stopPropagation()}},Lm(x),c,{"data-rootownerid":R}]});let B=N.type===void 0||W;return(S||N.type==="menubar"&&_!==km)&&(B=!0),h.jsx(Nx,{context:I,openInteractionType:K,modal:W,disabled:!k,returnFocus:l===void 0?B:l,initialFocus:N.type!=="menu",restoreFocus:!0,externalTree:N.type!=="menubar"?A:void 0,previousFocusableElement:D,nextFocusableElement:N.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:N.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:V})}),dA=y.createContext(void 0);function kz(){const e=y.useContext(dA);if(e===void 0)throw new Error(Dn(32));return e}const Nz=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=_o();return a.useState("mounted")||r?h.jsx(dA.Provider,{value:r,children:h.jsx(Cx,{ref:n,...s})}):null}),_z=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:c,align:d,sideOffset:f=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k=!1,collisionAvoidance:C=P3,style:S,...N}=t,{store:_}=_o(),R=kz(),I=Um(!0),A=_.useState("parent"),L=_.useState("floatingRootContext"),D=_.useState("floatingTreeRoot"),U=_.useState("mounted"),z=_.useState("open"),K=_.useState("modal"),W=_.useState("openMethod"),J=_.useState("activeTriggerElement"),te=_.useState("transitionStatus"),V=_.useState("positionerElement"),B=_.useState("instantType"),G=_.useState("hasViewport"),X=_.useState("lastOpenChangeReason"),ae=_.useState("floatingNodeId"),M=_.useState("floatingParentNodeId"),P=L.useState("domReferenceElement"),$=y.useRef(null),j=t_(V,!1,!1);let re=r,oe=f,ce=p,de=d,fe=C;A.type==="context-menu"&&(re=r??A.context?.anchor,de=de??"start",!c&&de!=="center"&&(ce=t.alignOffset??2,oe=t.sideOffset??-5));let ve=c,Fe=de;A.type==="menu"?(ve=ve??"inline-end",Fe=Fe??"start",fe=t.collisionAvoidance??B3):A.type==="menubar"&&(ve=ve??(A.context.orientation==="vertical"?"inline-end":"bottom"),Fe=Fe??"start");const De=A.type==="context-menu",Ee=Yx({anchor:re,floatingRootContext:L,positionMethod:I?"fixed":s,mounted:U,side:ve,sideOffset:oe,align:Fe,alignOffset:ce,arrowPadding:De?0:x,collisionBoundary:m,collisionPadding:b,sticky:v,nodeId:ae,keepMounted:R,disableAnchorTracking:k,collisionAvoidance:fe,shiftCrossAxis:De&&!("side"in fe&&fe.side==="flip"),externalTree:D,adaptiveOrigin:G?R_:void 0});y.useEffect(()=>{function Oe(je){je.open&&(je.parentNodeId===ae&&_.set("hoverEnabled",!1),je.nodeId!==ae&&je.parentNodeId===_.select("floatingParentNodeId")&&_.setOpen(!1,mt(yc)))}return D.events.on("menuopenchange",Oe),()=>{D.events.off("menuopenchange",Oe)}},[_,D.events,ae]),y.useEffect(()=>{if(_.select("floatingParentNodeId")==null)return;function Oe(je){if(je.open||je.nodeId!==_.select("floatingParentNodeId"))return;const ee=je.reason??yc;_.setOpen(!1,mt(ee))}return D.events.on("menuopenchange",Oe),()=>{D.events.off("menuopenchange",Oe)}},[D.events,_]);const Ie=Kn();y.useEffect(()=>{z||Ie.clear()},[z,Ie]),y.useEffect(()=>{function Oe(je){if(!(!z||je.nodeId!==_.select("floatingParentNodeId")))if(je.target&&J&&J!==je.target){const ee=_.select("closeDelay");ee>0?Ie.isStarted()||Ie.start(ee,()=>{_.setOpen(!1,mt(yc))}):_.setOpen(!1,mt(yc))}else Ie.clear()}return D.events.on("itemhover",Oe),()=>{D.events.off("itemhover",Oe)}},[D.events,z,J,_,Ie]),y.useEffect(()=>{const Oe={open:z,nodeId:ae,parentNodeId:M,reason:_.select("lastOpenChangeReason")};D.events.emit("menuopenchange",Oe)},[D.events,z,_,ae,M]),Ye(()=>{const Oe=P,je=$.current;if(Oe&&($.current=Oe),je&&Oe&&Oe!==je){_.set("instantType",void 0);const ee=new AbortController;return j(()=>{_.set("instantType","trigger-change")},ee.signal),()=>{ee.abort()}}},[P,j,_]);const Be={open:z,side:Ee.side,align:Ee.align,anchorHidden:Ee.anchorHidden,nested:A.type==="menu",instant:B},Ge=A.type==="menubar"&&A.context.modal;L_(z&&(Ge||K&&X!==Yn),W==="touch",V,J);const Me=Kx(t,Be,{styles:Ee.positionerStyles,transitionStatus:te,props:N,refs:[n,_.useStateSetter("positionerElement")],hidden:!U,inert:!z}),we=U&&A.type!=="menu"&&(A.type!=="menubar"&&K&&X!==Yn||A.type==="menubar"&&A.context.modal);let ye=null;return A.type==="menubar"?ye=A.context.contentElement:A.type===void 0&&(ye=J),h.jsxs(lA.Provider,{value:Ee,children:[we&&h.jsx(Gx,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:Vx(!z),cutout:ye}),h.jsx(a8,{id:ae,children:h.jsx(A_,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:Me})})]})}),Az=y.createContext(null);function fA(e){return y.useContext(Az)}const Rz={...Bx,disabled:ze(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:ze(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:ze(e=>e.openMethod),allowMouseEnter:ze(e=>e.allowMouseEnter),highlightItemOnHover:ze(e=>e.highlightItemOnHover),stickIfOpen:ze(e=>e.stickIfOpen),parent:ze(e=>e.parent),rootId:ze(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:ze(e=>e.activeIndex),isActive:ze((e,t)=>e.activeIndex===t),hoverEnabled:ze(e=>e.hoverEnabled),instantType:ze(e=>e.instantType),lastOpenChangeReason:ze(e=>e.openChangeReason),floatingTreeRoot:ze(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:ze(e=>e.floatingNodeId),floatingParentNodeId:ze(e=>e.floatingParentNodeId),itemProps:ze(e=>e.itemProps),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport),keyboardEventRelay:ze(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class ry extends bm{constructor(t){super({...Oz(),...t},{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:new ad},Rz),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),s=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&s===c&&a===d||(r=l,s=c,a=d,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const r=xr(()=>new ry(n)).current;return t??r}unsubscribeParentListener=null}function Oz(){return{...jx(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new wx,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const Iz=y.createContext(void 0);function Mz(){return y.useContext(Iz)}const Lz=ox(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:c=!1,modal:d,loopFocus:f=!0,orientation:p="vertical",actionsRef:m,closeParentOnEsc:b=!1,handle:x,triggerId:v,defaultTriggerId:k=null,highlightItemOnHover:C=!0}=t,S=Um(!0),N=_o(!0),_=fA(!0),R=Mz(),I=y.useMemo(()=>R&&N?{type:"menu",store:N.store}:_?{type:"menubar",context:_}:S&&!N?{type:"context-menu",context:S}:{type:void 0},[S,N,_,R]),A=ry.useStore(x?.store,{open:l,openProp:r,activeTriggerId:k,triggerIdProp:v,parent:I});s_(A,r,l,k),A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",v),A.useContextCallback("onOpenChangeComplete",a);const L=mo(),D=mo(),U=A.useState("floatingTreeRoot"),z=q3(U),K=ya(),W=A.useState("open"),J=A.useState("activeTriggerElement"),te=A.useState("positionerElement"),V=A.useState("hoverEnabled"),B=A.useState("disabled"),G=A.useState("lastOpenChangeReason"),X=A.useState("parent"),ae=A.useState("activeIndex"),M=A.useState("payload"),P=A.useState("floatingParentNodeId"),$=y.useRef(null),j=y.useRef(X.type!=="context-menu"),re=Kn(),oe=y.useRef(!0),ce=Kn(),de=P!=null,{openMethod:fe,triggerProps:ve}=w_(W);A.useSyncedValues({disabled:c,highlightItemOnHover:C,modal:X.type===void 0?d:void 0,openMethod:fe,rootId:L}),Mx(A);const{forceUnmount:Fe}=Lx(W,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0})});Ye(()=>{S&&!N?A.update({parent:{type:"context-menu",context:S},floatingNodeId:z,floatingParentNodeId:K}):N&&A.update({floatingNodeId:z,floatingParentNodeId:K})},[S,N,z,K,A]),y.useEffect(()=>{if(W||($.current=null),X.type==="context-menu"){if(!W){re.clear(),j.current=!1;return}re.start(500,()=>{j.current=!0})}},[re,W,X.type]),Ye(()=>{!W&&!V&&A.set("hoverEnabled",!0)},[W,V,A]);const De=tt((le,Ce)=>{const Re=Ce.reason;if(W===le&&Ce.trigger===J&&G===Re)return;const Ve=r_(Ce);if(!le&&Ce.trigger==null&&(Ce.trigger=J??void 0),s?.(le,Ce),Ce.isCanceled)return;A.state.floatingRootContext.dispatchOpenChange(le,Ce);const ot=Ce.event;if(le===!1&&ot?.type==="click"&&ot.pointerType==="touch"&&!oe.current)return;le&&Re===Dl?(oe.current=!1,ce.start(300,()=>{oe.current=!0})):(oe.current=!0,ce.clear());const et=(Re===tu||Re===_c)&&ot.detail===0&&ot?.isTrusted,dt=!le&&(Re===Nm||Re==null),ut={open:le,openChangeReason:Re};$.current=Ce.event??null,Ox(ut,le,Ce.trigger,Ve()),A.update(ut),X.type==="menubar"&&(Re===Dl||Re===ho||Re===Yn||Re===Jb||Re===yc)?A.set("instantType","group"):et||dt?A.set("instantType",et?"click":"dismiss"):A.set("instantType",void 0)}),Ee=e_({popupStore:A,floatingId:D,nested:K!=null,onOpenChange:De}),Ie=Ee.context.events;y.useEffect(()=>{const le=({open:Ce,eventDetails:Re})=>De(Ce,Re);return Ie.on("setOpen",le),()=>{Ie?.off("setOpen",le)}},[Ie,De]);const Be=y.useCallback(()=>{A.setOpen(!1,mt(gx))},[A]);y.useImperativeHandle(m,()=>({unmount:Fe,close:Be}),[Fe,Be]);let Ge;X.type==="context-menu"&&(Ge=X.context),y.useImperativeHandle(Ge?.positionerRef,()=>te,[te]),y.useImperativeHandle(Ge?.actionsRef,()=>({setOpen:De}),[De]);const $e=Am(Ee,{enabled:!B,bubbles:{escapeKey:b&&X.type==="menu"},outsidePress(){return X.type!=="context-menu"||$.current?.type==="contextmenu"?!0:j.current},externalTree:de?U:void 0}),Me=qx(),we=y.useCallback(le=>{A.select("activeIndex")!==le&&A.set("activeIndex",le)},[A]),ye=f_(Ee,{enabled:!B,listRef:A.context.itemDomElements,activeIndex:ae,nested:X.type!==void 0,loopFocus:f,orientation:p,parentOrientation:X.type==="menubar"?X.context.orientation:void 0,rtl:Me==="rtl",disabledIndices:Ul,onNavigate:we,openOnArrowKeyDown:X.type!=="context-menu",externalTree:de?U:void 0,focusItemOnHover:C}),Oe=y.useCallback(le=>{A.context.typingRef.current=le},[A]),je=h_(Ee,{enabled:!B,listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:ae,resetMs:t8,onMatch:le=>{W&&le!==ae&&A.set("activeIndex",le)},onTyping:Oe}),ee=y.useMemo(()=>{const le=Ir(je.reference,ye.reference,$e.reference,{onMouseMove(){A.set("allowMouseEnter",!0)}},ve);return le["aria-haspopup"]="menu",le["aria-expanded"]=W,le},[A,je.reference,ye.reference,$e.reference,ve,W]),me=y.useMemo(()=>{const le=Ir(ye.trigger,$e.trigger,ve);return le["aria-haspopup"]="menu",le["aria-expanded"]=!1,le},[ye.trigger,$e.trigger,ve]),ie=y.useMemo(()=>Ir(Im,{id:D,role:"menu","aria-labelledby":J?.id,onMouseMove(){A.set("allowMouseEnter",!0),X.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(le){const Ce=A.select("keyboardEventRelay");Ce&&!le.isPropagationStopped()&&Ce(le)}},je.floating,ye.floating,$e.floating),[J,D,X.type,A,je.floating,ye.floating,$e.floating]),Q=ye.item??dn;Dx(A,{floatingRootContext:Ee,activeTriggerProps:ee,inactiveTriggerProps:me,popupProps:ie,itemProps:Q});const Y=y.useMemo(()=>({store:A,parent:I}),[A,I]),F=h.jsx(cA.Provider,{value:Y,children:typeof n=="function"?n({payload:M}):n});return X.type===void 0||X.type==="context-menu"?h.jsx(o8,{externalTree:U,children:F}):F});function Dz(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=$x(),{ref:s,index:a}=Wx(e),l=n===a,c=y.useRef(null),d=co(s,c);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const p=c.current;if(!t||!p)return;const m=p.hasAttribute("disabled")||p.ariaDisabled==="true";!l&&!m&&p.focus()}},compositeRef:d,index:a}}function jz(e){const{render:t,className:n,style:r,state:s=dn,props:a=Ul,refs:l=Ul,metadata:c,stateAttributesMapping:d,tag:f="div",...p}=e,{compositeProps:m,compositeRef:b}=Dz({metadata:c});return Nn(f,e,{state:s,ref:[...l,b],props:[m,...a,p],stateAttributesMapping:d})}function hA(e){if(cn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!yi(e))return hA(Ti(e))}function Pz(e,t){const n=y.useRef(null);function r(a){lr.flushSync(()=>{e.setOpen(!1,mt(ho,a.nativeEvent,a.currentTarget))}),Bj(n.current)?.focus()}function s(a){const l=e.select("positionerElement");if(l&&jl(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{lr.flushSync(()=>{e.setOpen(!1,mt(ho,a.nativeEvent,a.currentTarget))});let c=Pj(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&nt(l,c);){const d=c;if(c=vx(c),c===d)break}c?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function Bz(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,s=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(s.current=!0,_t(a.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:a=>{s.current&&(s.current=!1,a.preventBaseUIHandler())}}:dn,[t,n,r])}const Jf=2,zz=l3(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:c=!0,id:d,openOnHover:f,delay:p=100,closeDelay:m=0,handle:b,payload:x,...v}=t,k=_o(!0),C=b?.store??k?.store;if(!C)throw new Error(Dn(85));const S=No(d),N=C.useState("isTriggerActive",S),_=C.useState("floatingRootContext"),R=C.useState("isOpenedByTrigger",S),I=C.useState("triggerPopupId",S),A=y.useRef(null),L=Uz(),D=$x(!0),U=Ea(),z=y.useMemo(()=>U??new wx,[U]),K=q3(z),W=ya(),{registerTrigger:J,isMountedByThisTrigger:te}=Ix(S,A,C,{payload:x,closeDelay:m,parent:L,floatingTreeRoot:z,floatingNodeId:K,floatingParentNodeId:W,keyboardEventRelay:D?.relayKeyboardEvent}),V=L.type==="menubar",B=C.useState("disabled"),G=l||B||V&&L.context.disabled,{getButtonProps:X,buttonRef:ae}=su({disabled:G,native:c});y.useEffect(()=>{!R&&L.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,R,L.type]);const M=y.useRef(null),P=Kn(),$=tt(ye=>{if(!M.current)return;P.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Oe=ye.target;if(nt(M.current,Oe)||nt(C.select("positionerElement"),Oe)||Oe===M.current||Oe!=null&&hA(Oe)===C.select("rootId"))return;const je=N_(M.current);ye.clientX>=je.left-Jf&&ye.clientX<=je.right+Jf&&ye.clientY>=je.top-Jf&&ye.clientY<=je.bottom+Jf||z.events.emit("close",{domEvent:ye,reason:p3})});y.useEffect(()=>{R&&C.select("lastOpenChangeReason")===Yn&&_t(M.current).addEventListener("mouseup",$,{once:!0})},[R,$,C]);const j=V&&L.context.hasSubmenuOpen,oe=d_(_,{enabled:(f??j)&&!G&&L.type!=="context-menu"&&(!V||j&&!te),handleClose:m_({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:L.type===void 0?p:void 0,delay:{close:m},triggerElementRef:A,externalTree:z,isActiveTrigger:N,isClosing:()=>C.select("transitionStatus")==="ending"}),ce=Hz(R,C.select("lastOpenChangeReason")),de=_x(_,{enabled:!G&&L.type!=="context-menu",event:R&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:L.type===void 0?ce:!1}),fe=l_(_,{enabled:!G&&j}),ve=Bz({open:R,enabled:V,mouseDownAction:"open"}),Fe=y.useMemo(()=>Ir(fe.reference,de.reference),[fe.reference,de.reference]),De=C.useState("triggerProps",te),{preFocusGuardRef:Ee,handlePreFocusGuardFocus:Ie,handleFocusTargetFocus:Be}=Pz(C,A),Ge={disabled:G,open:R},$e=[M,n,ae,J,A],Me=[Fe,oe??dn,De,{"aria-haspopup":"menu","aria-controls":I,id:S,onMouseDown:ye=>{if(C.select("open"))return;P.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),_t(ye.currentTarget).addEventListener("mouseup",$,{once:!0})}},V?{role:"menuitem"}:{},ve,v,X],we=Nn("button",t,{enabled:!V,stateAttributesMapping:i1,state:Ge,ref:$e,props:Me});return V?h.jsx(jz,{tag:"button",render:r,className:s,style:a,state:Ge,refs:$e,props:Me,stateAttributesMapping:i1}):R?h.jsxs(y.Fragment,{children:[h.jsx(ql,{ref:Ee,onFocus:Ie},`${S}-pre-focus-guard`),h.jsx(y.Fragment,{children:we},S),h.jsx(ql,{ref:C.context.triggerFocusTargetRef,onFocus:Be},`${S}-post-focus-guard`)]}):h.jsx(y.Fragment,{children:we},S)});function Hz(e,t){const n=Kn(),[r,s]=y.useState(!1);return Ye(()=>{e&&t==="trigger-hover"?(s(!0),n.start(n8,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function Uz(){const e=Um(!0),t=_o(!0),n=fA();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const Fz=Lz,$z=zz,Vz=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...s})=>h.jsx(Nz,{children:h.jsx(_z,{align:t,side:n,sideOffset:r,className:"isolate z-60 outline-none",children:h.jsx(wz,{"data-slot":"menu-content",className:Se("min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...s})})}),Tl=({className:e,destructive:t,...n})=>h.jsx(Sz,{"data-slot":"menu-item",className:Se("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none","data-highlighted:bg-surface-hover",t?"text-danger":"text-text",e),...n});function qz(e){const t=y.useContext(Z_)?"drawer":"dialog";return eA(e,t)}const Ao=qz,Ro=({className:e,children:t,size:n="md",...r})=>h.jsxs(aA,{children:[h.jsx(tA,{className:Se("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),h.jsx(iA,{"data-slot":"dialog-content",className:Se("fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col",n==="sm"&&"w-[min(24rem,calc(100vw-2rem))]",n==="md"&&"w-[min(32rem,calc(100vw-2rem))]",n==="lg"&&"w-[min(46rem,calc(100vw-2rem))]","rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...r,children:t})]}),Oo=({title:e,description:t,actions:n})=>h.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx(oA,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?h.jsx(rA,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,h.jsx(nA,{"aria-label":"Close",className:"-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:h.jsx(js,{className:"size-3.5"})})]}),Io=({className:e,...t})=>h.jsx("div",{className:Se("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),ir=({label:e,children:t,mono:n})=>h.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[h.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),h.jsx("span",{className:Se("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),mA=y.createContext(void 0);function Fm(e){const t=y.useContext(mA);if(t===void 0&&!e)throw new Error(Dn(72));return t}const Yz={...Bx,disabled:ze(e=>e.disabled),instantType:ze(e=>e.instantType),isInstantPhase:ze(e=>e.isInstantPhase),trackCursorAxis:ze(e=>e.trackCursorAxis),disableHoverablePopup:ze(e=>e.disableHoverablePopup),lastOpenChangeReason:ze(e=>e.openChangeReason),closeOnClick:ze(e=>e.closeOnClick),closeDelay:ze(e=>e.closeDelay),hasViewport:ze(e=>e.hasViewport)};class sy extends bm{constructor(t,n,r=!1){const s=new ad,a={...Gz(),...t};a.floatingRootContext=i_(s,n,r),super(a,{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s},Yz)}setOpen=(t,n)=>{aP(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,mt(tu,t))}static useStore(t,n){return n_(t,(s,a)=>new sy(n,s,a)).store}}function Gz(){return{...jx(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const Kz=ox(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:d,onOpenChangeComplete:f,handle:p,triggerId:m,defaultTriggerId:b=null,children:x}=t,v=sy.useStore(p?.store,{open:r,openProp:s,activeTriggerId:b,triggerIdProp:m});s_(v,s,r,b),v.useControlledProp("openProp",s),v.useControlledProp("triggerIdProp",m),v.useContextCallback("onOpenChange",d),v.useContextCallback("onOpenChangeComplete",f);const k=v.useState("open"),C=!n&&k,S=v.useState("activeTriggerId"),N=v.useState("mounted"),_=v.useState("payload");v.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),v.useSyncedValue("disabled",n),Mx(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:I}=Lx(C,v),A=v.useState("isInstantPhase"),L=v.useState("instantType"),D=v.useState("lastOpenChangeReason"),U=y.useRef(null);Ye(()=>{k&&n&&v.setOpen(!1,mt(bj))},[k,n,v]),Ye(()=>{I==="ending"&&D===eu||I!=="ending"&&A?(L!=="delay"&&(U.current=L),v.set("instantType","delay")):U.current!==null&&(v.set("instantType",U.current),U.current=null)},[I,A,D,L,v]),Ye(()=>{C&&S==null&&v.set("payload",void 0)},[v,S,C]);const z=y.useCallback(()=>{v.setOpen(!1,mt(gx))},[v]);y.useImperativeHandle(c,()=>({unmount:R,close:z}),[R,z]);const K=C||N||!n&&l!=="none";return h.jsxs(mA.Provider,{value:v,children:[K&&h.jsx(Xz,{store:v,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:_}):x]})});function Xz({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Am(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=d8(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=y.useMemo(()=>Ir(a.reference,s.reference),[a.reference,s.reference]),c=y.useMemo(()=>Ir(a.trigger,s.trigger),[a.trigger,s.trigger]),d=y.useMemo(()=>Ir(Im,a.floating,s.floating),[a.floating,s.floating]);return Dx(e,{activeTriggerProps:l,inactiveTriggerProps:c,popupProps:d}),null}const pA=y.createContext(void 0);function Wz(){return y.useContext(pA)}let Qz=(function(e){return e[e.popupOpen=$h.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const Zz=600,gA="data-base-ui-tooltip-trigger";function EC(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(St(s))return s}}const t=e.target;return St(t)?t:null}function Jz(e){let t=e;for(;t;){if(t.hasAttribute(gA))return t;const n=t.parentElement;if(n){t=n;continue}const r=t.getRootNode();t="host"in r&&St(r.host)?r.host:null}return null}const eH=l3(function(t,n){const{render:r,className:s,style:a,handle:l,payload:c,disabled:d,delay:f,closeOnClick:p=!0,closeDelay:m,id:b,...x}=t,v=Fm(!0),k=l?.store??v;if(!k)throw new Error(Dn(82));const C=No(b),S=k.useState("isTriggerActive",C),N=k.useState("isOpenedByTrigger",C),_=k.useState("floatingRootContext"),R=y.useRef(null),I=f??Zz,A=m??0,{registerTrigger:L,isMountedByThisTrigger:D}=Ix(C,R,k,{payload:c,closeOnClick:p,closeDelay:A}),U=Wz(),{delayRef:z,isInstantPhase:K,hasProvider:W}=vj(_,{open:N}),J=Hx(_);k.useSyncedValue("isInstantPhase",K);const te=k.useState("disabled"),V=d??te,B=En(V),G=k.useState("trackCursorAxis"),X=k.useState("disableHoverablePopup"),ae=y.useRef(!1),M=Kn(),P=y.useRef(void 0);function $(){const Ee=U?.delay,Ie=typeof z.current=="object"?z.current.open:void 0;let Be=I;return W&&(Ie!==0?Be=f??Ee??I:Be=0),Be}function j(Ee){const Ie=R.current;if(!Ie||!Ee)return!1;const Be=Jz(Ee);return Be!==null&&Be!==Ie&&nt(Ie,Be)}function re(Ee){const Ie=j(Ee);return ae.current=Ie,Ie&&(J.openChangeTimeout.clear(),J.restTimeout.clear(),J.restTimeoutPending=!1,M.clear()),Ie}const oe=d_(_,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!X&&G!=="both"?m_():null,restMs:$,delay(){const Ee=typeof z.current=="object"?z.current.close:void 0;let Ie=A;return m==null&&W&&(Ie=Ee),{close:Ie}},triggerElementRef:R,isActiveTrigger:S,isClosing:()=>k.select("transitionStatus")==="ending",shouldOpen(){return!ae.current}}),ce=l_(_,{enabled:!V}).reference,de=Ee=>{const Ie=ae.current,Be=EC(Ee),Ge=re(Be),$e=R.current,Me=$e&&Be&&nt($e,Be);if(Ge&&k.select("open")&&k.select("lastOpenChangeReason")===Yn){k.setOpen(!1,mt(Yn,Ee));return}if(Ie&&!Ge&&Me&&!B.current&&!k.select("open")&&$e&&fo(P.current)){const we=()=>{!ae.current&&!B.current&&!k.select("open")&&k.setOpen(!0,mt(Yn,Ee,$e))},ye=$();ye===0?(M.clear(),we()):M.start(ye,we)}},fe=k.useState("triggerProps",D);return Nn("button",t,{state:{open:N},ref:[n,L,R],props:[oe,ce,D||G!=="none"?fe:void 0,{onMouseOver(Ee){de(Ee.nativeEvent)},onFocus(Ee){j(EC(Ee.nativeEvent))&&Ee.preventBaseUIHandler()},onMouseLeave(){ae.current=!1,M.clear(),P.current=void 0},onPointerEnter(Ee){P.current=Ee.pointerType},onPointerDown(Ee){P.current=Ee.pointerType,k.set("closeOnClick",p),p&&!k.select("open")&&k.cancelPendingOpen(Ee.nativeEvent)},onClick(Ee){p&&!k.select("open")&&k.cancelPendingOpen(Ee.nativeEvent)},id:C,[Qz.triggerDisabled]:V?"":void 0,[gA]:V?void 0:""},x],stateAttributesMapping:Fx})}),bA=y.createContext(void 0);function tH(){const e=y.useContext(bA);if(e===void 0)throw new Error(Dn(70));return e}const nH=y.forwardRef(function(t,n){const{children:r,container:s,className:a,render:l,style:c,...d}=t,{portalNode:f,portalSubtree:p}=U3({container:s,ref:n,componentProps:t,elementProps:d});return!p&&!f?null:h.jsxs(y.Fragment,{children:[p,f&&lr.createPortal(r,f)]})}),rH=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Fm().useState("mounted")||r?h.jsx(bA.Provider,{value:r,children:h.jsx(nH,{ref:n,...s})}):null}),xA=y.createContext(void 0);function sH(){const e=y.useContext(xA);if(e===void 0)throw new Error(Dn(71));return e}const iH=y.forwardRef(function(t,n){const{render:r,className:s,anchor:a,positionMethod:l="absolute",side:c="top",align:d="center",sideOffset:f=0,alignOffset:p=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:k=!1,collisionAvoidance:C=B3,style:S,...N}=t,_=Fm(),R=tH(),I=_.useState("open"),A=_.useState("mounted"),L=_.useState("trackCursorAxis"),D=_.useState("disableHoverablePopup"),U=_.useState("floatingRootContext"),z=_.useState("instantType"),K=_.useState("transitionStatus"),W=_.useState("hasViewport"),J=Yx({anchor:a,positionMethod:l,floatingRootContext:U,mounted:A,side:c,sideOffset:f,align:d,alignOffset:p,collisionBoundary:m,collisionPadding:b,sticky:v,arrowPadding:x,disableAnchorTracking:k,keepMounted:R,collisionAvoidance:C,adaptiveOrigin:W?R_:void 0}),te=y.useMemo(()=>({open:I,side:J.side,align:J.align,anchorHidden:J.anchorHidden,instant:L!=="none"?"tracking-cursor":z}),[I,J.side,J.align,J.anchorHidden,L,z]),V=Kx(t,te,{styles:J.positionerStyles,transitionStatus:K,props:N,refs:[n,_.useStateSetter("positionerElement")],hidden:!A,inert:!I||L==="both"||D});return h.jsx(xA.Provider,{value:J,children:V})}),aH={...ru,...nu},oH=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,c=Fm(),{side:d,align:f}=sH(),p=c.useState("open"),m=c.useState("instantType"),b=c.useState("transitionStatus"),x=c.useState("popupProps"),v=c.useState("floatingRootContext"),k=c.useState("disabled"),C=c.useState("closeDelay");ko({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),c_(v,{enabled:!k,closeDelay:C});const S=c.useStateSetter("popupElement");return Nn("div",t,{state:{open:p,side:d,align:f,instant:m,transitionStatus:b},ref:[n,c.context.popupRef,S],props:[x,Lm(b),l],stateAttributesMapping:aH})}),lH=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,a=y.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=y.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(pA.Provider,{value:a,children:h.jsx(Ej,{delay:l,timeoutMs:s,children:t.children})})},uH=lH,cH=({className:e,side:t="top",sideOffset:n=6,...r})=>h.jsx(rH,{children:h.jsx(iH,{side:t,sideOffset:n,className:"isolate z-60",children:h.jsx(oH,{"data-slot":"tooltip-content",className:Se("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function iy({content:e,render:t,side:n,children:r}){return h.jsxs(Kz,{children:[h.jsx(eH,{render:t??h.jsx("span",{className:"inline-flex"}),children:r}),h.jsx(cH,{side:n,children:e})]})}function dH(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const fH=e=>{switch(e){case"success":return pH;case"info":return bH;case"warning":return gH;case"error":return xH;default:return null}},hH=Array(12).fill(0),mH=({visible:e,className:t})=>Ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ue.createElement("div",{className:"sonner-spinner"},hH.map((n,r)=>Ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pH=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),gH=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),bH=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),xH=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yH=Ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),EH=()=>{const[e,t]=Ue.useState(document.hidden);return Ue.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let o1=1;class vH{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:o1++,l=this.toasts.find(d=>d.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:r}),{...d,...t,id:a,dismissible:c,title:r}):d):this.addToast({title:r,...s,dismissible:c,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const c=s.then(async f=>{if(l=["resolve",f],Ue.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(SH(f)&&!f.ok){a=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...v})}else if(f instanceof Error){a=!1;const m=typeof n.error=="function"?await n.error(f):n.error,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:b,...v})}else if(n.success!==void 0){a=!1;const m=typeof n.success=="function"?await n.success(f):n.success,b=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!Ue.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:b,...v})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){a=!1;const p=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!Ue.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,p)=>c.then(()=>l[0]==="reject"?p(l[1]):f(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||o1++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ar=new vH,TH=(e,t)=>{const n=t?.id||o1++;return Ar.addToast({title:e,...t,id:n}),n},SH=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",CH=TH,wH=()=>Ar.toasts,kH=()=>Ar.getActiveToasts(),Ln=Object.assign(CH,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:wH,getToasts:kH});dH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function eh(e){return e.label!==void 0}const NH=3,_H="24px",AH="16px",vC=4e3,RH=356,OH=14,IH=45,MH=200;function Ns(...e){return e.filter(Boolean).join(" ")}function LH(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const DH=e=>{var t,n,r,s,a,l,c,d,f;const{invert:p,toast:m,unstyled:b,interacting:x,setHeights:v,visibleToasts:k,heights:C,index:S,toasts:N,expanded:_,removeToast:R,defaultRichColors:I,closeButton:A,style:L,cancelButtonStyle:D,actionButtonStyle:U,className:z="",descriptionClassName:K="",duration:W,position:J,gap:te,expandByDefault:V,classNames:B,icons:G,closeButtonAriaLabel:X="Close toast"}=e,[ae,M]=Ue.useState(null),[P,$]=Ue.useState(null),[j,re]=Ue.useState(!1),[oe,ce]=Ue.useState(!1),[de,fe]=Ue.useState(!1),[ve,Fe]=Ue.useState(!1),[De,Ee]=Ue.useState(!1),[Ie,Be]=Ue.useState(0),[Ge,$e]=Ue.useState(0),Me=Ue.useRef(m.duration||W||vC),we=Ue.useRef(null),ye=Ue.useRef(null),Oe=S===0,je=S+1<=k,ee=m.type,me=m.dismissible!==!1,ie=m.className||"",Q=m.descriptionClassName||"",Y=Ue.useMemo(()=>C.findIndex(Xe=>Xe.toastId===m.id)||0,[C,m.id]),F=Ue.useMemo(()=>{var Xe;return(Xe=m.closeButton)!=null?Xe:A},[m.closeButton,A]),le=Ue.useMemo(()=>m.duration||W||vC,[m.duration,W]),Ce=Ue.useRef(0),Re=Ue.useRef(0),Ve=Ue.useRef(0),ot=Ue.useRef(null),[et,dt]=J.split("-"),ut=Ue.useMemo(()=>C.reduce((Xe,yt,Ut)=>Ut>=Y?Xe:Xe+yt.height,0),[C,Y]),qe=EH(),Rt=m.invert||p,jt=ee==="loading";Re.current=Ue.useMemo(()=>Y*te+ut,[Y,ut]),Ue.useEffect(()=>{Me.current=le},[le]),Ue.useEffect(()=>{re(!0)},[]),Ue.useEffect(()=>{const Xe=ye.current;if(Xe){const yt=Xe.getBoundingClientRect().height;return $e(yt),v(Ut=>[{toastId:m.id,height:yt,position:m.position},...Ut]),()=>v(Ut=>Ut.filter(Jt=>Jt.toastId!==m.id))}},[v,m.id]),Ue.useLayoutEffect(()=>{if(!j)return;const Xe=ye.current,yt=Xe.style.height;Xe.style.height="auto";const Ut=Xe.getBoundingClientRect().height;Xe.style.height=yt,$e(Ut),v(Jt=>Jt.find(Et=>Et.toastId===m.id)?Jt.map(Et=>Et.toastId===m.id?{...Et,height:Ut}:Et):[{toastId:m.id,height:Ut,position:m.position},...Jt])},[j,m.title,m.description,v,m.id,m.jsx,m.action,m.cancel]);const lt=Ue.useCallback(()=>{ce(!0),Be(Re.current),v(Xe=>Xe.filter(yt=>yt.toastId!==m.id)),setTimeout(()=>{R(m)},MH)},[m,R,v,Re]);Ue.useEffect(()=>{if(m.promise&&ee==="loading"||m.duration===1/0||m.type==="loading")return;let Xe;return _||x||qe?(()=>{if(Ve.current<Ce.current){const Jt=new Date().getTime()-Ce.current;Me.current=Me.current-Jt}Ve.current=new Date().getTime()})():(()=>{Me.current!==1/0&&(Ce.current=new Date().getTime(),Xe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),lt()},Me.current))})(),()=>clearTimeout(Xe)},[_,x,m,ee,qe,lt]),Ue.useEffect(()=>{m.delete&&(lt(),m.onDismiss==null||m.onDismiss.call(m,m))},[lt,m.delete]);function Lt(){var Xe;if(G?.loading){var yt;return Ue.createElement("div",{className:Ns(B?.loader,m==null||(yt=m.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":ee==="loading"},G.loading)}return Ue.createElement(mH,{className:Ns(B?.loader,m==null||(Xe=m.classNames)==null?void 0:Xe.loader),visible:ee==="loading"})}const Qt=m.icon||G?.[ee]||fH(ee);var $t,Zt;return Ue.createElement("li",{tabIndex:0,ref:ye,className:Ns(z,ie,B?.toast,m==null||(t=m.classNames)==null?void 0:t.toast,B?.default,B?.[ee],m==null||(n=m.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":($t=m.richColors)!=null?$t:I,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":j,"data-promise":!!m.promise,"data-swiped":De,"data-removed":oe,"data-visible":je,"data-y-position":et,"data-x-position":dt,"data-index":S,"data-front":Oe,"data-swiping":de,"data-dismissible":me,"data-type":ee,"data-invert":Rt,"data-swipe-out":ve,"data-swipe-direction":P,"data-expanded":!!(_||V&&j),"data-testid":m.testId,style:{"--index":S,"--toasts-before":S,"--z-index":N.length-S,"--offset":`${oe?Ie:Re.current}px`,"--initial-height":V?"auto":`${Ge}px`,...L,...m.style},onDragEnd:()=>{fe(!1),M(null),ot.current=null},onPointerDown:Xe=>{Xe.button!==2&&(jt||!me||(we.current=new Date,Be(Re.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(fe(!0),ot.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,yt,Ut;if(ve||!me)return;ot.current=null;const Jt=Number(((Xe=ye.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xn=Number(((yt=ye.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Et=new Date().getTime()-((Ut=we.current)==null?void 0:Ut.getTime()),on=ae==="x"?Jt:Xn,Er=Math.abs(on)/Et;if(Math.abs(on)>=IH||Er>.11){Be(Re.current),m.onDismiss==null||m.onDismiss.call(m,m),$(ae==="x"?Jt>0?"right":"left":Xn>0?"down":"up"),lt(),Fe(!0);return}else{var gn,Tn;(gn=ye.current)==null||gn.style.setProperty("--swipe-amount-x","0px"),(Tn=ye.current)==null||Tn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),fe(!1),M(null)},onPointerMove:Xe=>{var yt,Ut,Jt;if(!ot.current||!me||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;const Et=Xe.clientY-ot.current.y,on=Xe.clientX-ot.current.x;var Er;const gn=(Er=e.swipeDirections)!=null?Er:LH(J);!ae&&(Math.abs(on)>1||Math.abs(Et)>1)&&M(Math.abs(on)>Math.abs(Et)?"x":"y");let Tn={x:0,y:0};const ht=Ot=>1/(1.5+Math.abs(Ot)/20);if(ae==="y"){if(gn.includes("top")||gn.includes("bottom"))if(gn.includes("top")&&Et<0||gn.includes("bottom")&&Et>0)Tn.y=Et;else{const Ot=Et*ht(Et);Tn.y=Math.abs(Ot)<Math.abs(Et)?Ot:Et}}else if(ae==="x"&&(gn.includes("left")||gn.includes("right")))if(gn.includes("left")&&on<0||gn.includes("right")&&on>0)Tn.x=on;else{const Ot=on*ht(on);Tn.x=Math.abs(Ot)<Math.abs(on)?Ot:on}(Math.abs(Tn.x)>0||Math.abs(Tn.y)>0)&&Ee(!0),(Ut=ye.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Tn.x}px`),(Jt=ye.current)==null||Jt.style.setProperty("--swipe-amount-y",`${Tn.y}px`)}},F&&!m.jsx&&ee!=="loading"?Ue.createElement("button",{"aria-label":X,"data-disabled":jt,"data-close-button":!0,onClick:jt||!me?()=>{}:()=>{lt(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Ns(B?.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(Zt=G?.close)!=null?Zt:yH):null,(ee||m.icon||m.promise)&&m.icon!==null&&(G?.[ee]!==null||m.icon)?Ue.createElement("div",{"data-icon":"",className:Ns(B?.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Lt():null,m.type!=="loading"?Qt:null):null,Ue.createElement("div",{"data-content":"",className:Ns(B?.content,m==null||(a=m.classNames)==null?void 0:a.content)},Ue.createElement("div",{"data-title":"",className:Ns(B?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?Ue.createElement("div",{"data-description":"",className:Ns(K,Q,B?.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),Ue.isValidElement(m.cancel)?m.cancel:m.cancel&&eh(m.cancel)?Ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Xe=>{eh(m.cancel)&&me&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Xe),lt())},className:Ns(B?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,Ue.isValidElement(m.action)?m.action:m.action&&eh(m.action)?Ue.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||U,onClick:Xe=>{eh(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Xe),!Xe.defaultPrevented&&lt())},className:Ns(B?.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function TC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function jH(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,l=a?"--mobile-offset":"--offset",c=a?AH:_H;function d(f){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=c:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const PH=Ue.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:p,mobileOffset:m,theme:b="light",richColors:x,duration:v,style:k,visibleToasts:C=NH,toastOptions:S,dir:N=TC(),gap:_=OH,icons:R,containerAriaLabel:I="Notifications"}=t,[A,L]=Ue.useState([]),D=Ue.useMemo(()=>r?A.filter(j=>j.toasterId===r):A.filter(j=>!j.toasterId),[A,r]),U=Ue.useMemo(()=>Array.from(new Set([a].concat(D.filter(j=>j.position).map(j=>j.position)))),[D,a]),[z,K]=Ue.useState([]),[W,J]=Ue.useState(!1),[te,V]=Ue.useState(!1),[B,G]=Ue.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Ue.useRef(null),ae=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=Ue.useRef(null),P=Ue.useRef(!1),$=Ue.useCallback(j=>{L(re=>{var oe;return(oe=re.find(ce=>ce.id===j.id))!=null&&oe.delete||Ar.dismiss(j.id),re.filter(({id:ce})=>ce!==j.id)})},[]);return Ue.useEffect(()=>Ar.subscribe(j=>{if(j.dismiss){requestAnimationFrame(()=>{L(re=>re.map(oe=>oe.id===j.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{oL.flushSync(()=>{L(re=>{const oe=re.findIndex(ce=>ce.id===j.id);return oe!==-1?[...re.slice(0,oe),{...re[oe],...j},...re.slice(oe+1)]:[j,...re]})})})}),[A]),Ue.useEffect(()=>{if(b!=="system"){G(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:re})=>{G(re?"dark":"light")})}catch{j.addListener(({matches:oe})=>{try{G(oe?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),Ue.useEffect(()=>{A.length<=1&&J(!1)},[A]),Ue.useEffect(()=>{const j=re=>{var oe;if(l.every(fe=>re[fe]||re.code===fe)){var de;J(!0),(de=X.current)==null||de.focus()}re.code==="Escape"&&(document.activeElement===X.current||(oe=X.current)!=null&&oe.contains(document.activeElement))&&J(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[l]),Ue.useEffect(()=>{if(X.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,P.current=!1)}},[X.current]),Ue.createElement("section",{ref:n,"aria-label":`${I} ${ae}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((j,re)=>{var oe;const[ce,de]=j.split("-");return D.length?Ue.createElement("ol",{key:j,dir:N==="auto"?TC():N,tabIndex:-1,ref:X,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ce,"data-x-position":de,style:{"--front-toast-height":`${((oe=z[0])==null?void 0:oe.height)||0}px`,"--width":`${RH}px`,"--gap":`${_}px`,...k,...jH(p,m)},onBlur:fe=>{P.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(P.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||P.current||(P.current=!0,M.current=fe.relatedTarget)},onMouseEnter:()=>J(!0),onMouseMove:()=>J(!0),onMouseLeave:()=>{te||J(!1)},onDragEnd:()=>J(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},D.filter(fe=>!fe.position&&re===0||fe.position===j).map((fe,ve)=>{var Fe,De;return Ue.createElement(DH,{key:fe.id,icons:R,index:ve,toast:fe,defaultRichColors:x,duration:(Fe=S?.duration)!=null?Fe:v,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:s,visibleToasts:C,closeButton:(De=S?.closeButton)!=null?De:d,interacting:te,position:j,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:$,toasts:D.filter(Ee=>Ee.position==fe.position),heights:z.filter(Ee=>Ee.position==fe.position),setHeights:K,expandByDefault:c,gap:_,expanded:W,swipeDirections:t.swipeDirections})})):null}))});function BH(){return h.jsx(PH,{position:"bottom-right",toastOptions:{style:{background:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)",boxShadow:"var(--shadow-md)",fontFamily:"var(--cw-font-sans)",fontSize:"var(--text-body-sm)"}}})}async function zH(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return HH(e)}function HH(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t);const n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function Yh({value:e,glyph:t,className:n,variant:r="ghost",size:s="icon-sm",...a}){const[l,c]=y.useState(!1);return h.jsx(rt,{variant:r,size:s,"aria-label":"Copy",className:Se("text-fg-3",n),onClick:()=>{zH(e).then(d=>{d&&(c(!0),setTimeout(()=>c(!1),1500))})},...a,children:t?h.jsx("span",{className:Se("font-mono text-body-sm leading-5",l&&"text-success"),children:l?"✓":"⧉"}):l?h.jsx(H_,{className:"size-3.5 text-success"}):h.jsx(g7,{className:"size-3.5"})})}function kn({className:e}){return h.jsx(X7,{"aria-label":"Loading",className:Se("size-4 animate-spin text-fg-3",e)})}function yA({code:e,label:t,copyable:n=!0,variant:r="panel",className:s}){const a=r==="plain",l=t!==void 0||n;return a?h.jsxs("div",{"data-slot":"code-block","data-variant":"plain",className:Se("min-w-0",s),children:[l?h.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[h.jsx("span",{className:"truncate text-label leading-5 text-fg-4",children:t}),n?h.jsx(Yh,{glyph:!0,value:e,className:"size-5 shrink-0 rounded-sm"}):null]}):null,h.jsx("pre",{className:"max-h-64 overflow-auto bg-code-bg px-2 font-mono text-label leading-5 whitespace-pre-wrap text-fg-2",children:e})]}):h.jsxs("div",{"data-slot":"code-block",className:Se("overflow-hidden rounded-md border border-border bg-code-bg",s),children:[l?h.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[h.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?h.jsx(Yh,{value:e}):null]}):null,h.jsx("pre",{className:"max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2",children:e})]})}function SC({orientation:e,value:t,onValueChange:n,min:r,max:s,step:a=16,inverted:l,"aria-label":c,className:d}){const f=y.useRef(null),p=e==="vertical",m=y.useCallback(C=>Math.min(s,Math.max(r,C)),[r,s]),b=C=>{C.button===0&&(C.preventDefault(),C.currentTarget.setPointerCapture(C.pointerId),f.current={origin:p?C.clientX:C.clientY,start:t})},x=C=>{const S=f.current;if(!S)return;const N=(p?C.clientX:C.clientY)-S.origin;n(m(S.start+(l?-N:N)))},v=C=>{f.current&&(f.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))},k=C=>{const S=p?"ArrowRight":"ArrowDown",N=p?"ArrowLeft":"ArrowUp",_=l?-1:1;if(C.key===S)n(m(t+a*_));else if(C.key===N)n(m(t-a*_));else if(C.key==="Home")n(r);else if(C.key==="End")n(s);else return;C.preventDefault()};return h.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":s,onPointerDown:b,onPointerMove:x,onPointerUp:v,onPointerCancel:v,onKeyDown:k,className:Se("group relative shrink-0 touch-none bg-border transition-colors","hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none",p?"w-px cursor-col-resize":"h-px cursor-row-resize",d),children:h.jsx("span",{"aria-hidden":!0,className:Se("absolute",p?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function EA({value:e,size:t=13,strokeWidth:n=2,className:r}){const s=Math.min(100,Math.max(0,e)),a=(t-n)/2,l=2*Math.PI*a;return h.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(s)}%`,className:Se("shrink-0 -rotate-90",r),children:[h.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),h.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-s/100)})]})}function zn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function UH(e){return e?[{type:"text",text:e}]:[]}function FH(e,t){if(t<=0)return[];const n=[];let r=0;for(const s of e){const a=s.type==="text"?s.text.length:s.trigger.length+s.displayText.length;if(r+a<=t){n.push(s),r+=a;continue}if(s.type==="text"){let l=t-r;if(l>0){const c=s.text.charCodeAt(l-1);c>=55296&&c<=56319&&(l-=1),l>0&&n.push({type:"text",text:s.text.slice(0,l)})}}break}return n}function Oc(e){return e===" "||e===`
472
+ `||e===" "}function vA(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function Gh(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
473
+ `:Oc(r)}function $H(e,t,n){if(!e||t===0||n.length===0)return null;const r=vA(n);for(let s=t-1;s>=0;s--){const a=e[s];if(Oc(a)){if(s+1<t){const c=e[s+1],d=r.get(c);if(d&&Gh(e,s+1,d.position))return{config:d,startOffset:s+1,query:e.slice(s+2,t)}}return null}const l=r.get(a);if(l&&Gh(e,s,l.position))return{config:l,startOffset:s,query:e.slice(s+1,t)}}return null}function W0(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0;for(const m of e)if(m.type==="chip"){const b=`${m.trigger}${m.displayText}`,x=l,v=l+b.length;(v<=r||x>=s)&&a.push(m),l=v}else{const b=l,x=l+m.text.length;if(x<=r)a.push(m);else if(b>=s)a.push(m);else{const v=m.text.slice(0,Math.max(0,r-b)),k=m.text.slice(Math.min(m.text.length,s-b));v&&a.push({type:"text",text:v});const C={type:"chip",trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data!==void 0?{data:n.data}:{},...n.autoResolved?{autoResolved:!0}:{}};a.push(C),k?a.push({type:"text",text:" "+k.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const c=Mo(a);let d=-1,f=0;for(const m of c)m.type==="text"?f+=m.text.length:(f+=m.trigger.length+m.displayText.length,m.value===n.value&&m.displayText===n.displayText&&m.trigger===t.config.char&&(d=f));const p=d===-1?f:d+1;return{segments:c,cursorOffset:p}}function VH(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0,c=r+n.length;for(const p of e){if(p.type==="chip"){const x=l+`${p.trigger}${p.displayText}`.length;(x<=r||l>=s)&&a.push(p),l=x;continue}const m=l,b=l+p.text.length;if(b<=r||m>=s)a.push(p);else{const x=p.text.slice(0,Math.max(0,r-m)),v=p.text.slice(Math.min(p.text.length,s-m));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),v&&a.push({type:"text",text:v})}l=b}const d=Mo(a),f=zn(d).length;return c>f&&(c=f),{segments:d,cursorOffset:c}}function qH(e,t){if(t<0||t>=e.length||e[t].type!=="chip")return e;const n=[...e.slice(0,t),...e.slice(t+1)];return Mo(n)}function YH(e,t){if(t<0||t>=e.length)return null;const n=e[t];if(n.type!=="chip"||!n.autoResolved)return null;const r=`${n.trigger}${n.displayText}`,s=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:Mo(s),revertedText:r}}function GH(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=vA(n),s=[];for(const a of e){if(a.type==="chip"){s.push(a);continue}const l=KH(a.text,r);s.push(...l)}return Mo(s)}function KH(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const s=e[r];if(t.has(s)&&(r===0||Oc(e[r-1]))){const c=t.get(s);if(c&&Gh(e,r,c.position)){let d=r+1;for(;d<e.length&&!Oc(e[d]);)d++;const f=e.slice(r+1,d);if(f.length>0){const p=c.onSelect?.({value:f,label:f})||f;n.push({type:"chip",trigger:s,value:f,displayText:p,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Oc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function mr(e,t,n,r){const s=[];let a=0,l=!1;for(const c of e)if(c.type==="chip"){const d=`${c.trigger}${c.displayText}`,f=a,p=a+d.length;!l&&t===n&&f===t&&(s.push({type:"text",text:r}),l=!0),(p<=t||f>=n)&&s.push(c),a=p}else{const d=a,f=a+c.text.length,p=t===n?f<t:f<=t,m=t===n?d>n:d>=n;if(p)s.push(c);else if(m)s.push(c);else{const b=c.text.slice(0,Math.max(0,t-d)),x=c.text.slice(Math.min(c.text.length,n-d));b&&s.push({type:"text",text:b}),!l&&d<=t&&(s.push({type:"text",text:r}),l=!0),x&&s.push({type:"text",text:x})}a=f}return!l&&r&&s.push({type:"text",text:r}),Mo(s)}function XH(e,t,n,r){if(t===n)return null;const s=zn(e),a=r.length,l=t>=a&&s.slice(t-a,t)===r,c=n+a<=s.length&&s.slice(n,n+a)===r;let d=l&&c;if(d&&a===1){const m=t>a?s[t-a-1]:"",b=n+a<s.length?s[n+a]:"";(m===r||b===r)&&(d=!1)}if(d){const m=mr(e,n,n+a,"");return{segments:mr(m,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const f=mr(e,n,n,r);return{segments:mr(f,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function WH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r.type!==s.type)return!1;if(r.type==="text"){if(s.type!=="text"||r.text!==s.text)return!1}else if(s.type!=="chip"||r.trigger!==s.trigger||r.value!==s.value||r.displayText!==s.displayText||r.autoResolved!==s.autoResolved)return!1}return!0}function Mo(e){const t=[];for(const n of e){if(n.type==="text"&&n.text==="")continue;const r=t[t.length-1];n.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+n.text}:t.push(n)}return t}function $m(e){const t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:"bullet",indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};const n=e.match(/^(\s*)(\d+)\. /);if(n){const r=n[1].length;return{kind:"numbered",indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:r,numberEnd:r+n[2].length,prefixLen:n[0].length}}return null}function Gl(e,t){const n=e.lastIndexOf(`
474
+ `,t-1)+1,r=e.indexOf(`
475
+ `,t),s=e.slice(n,r===-1?e.length:r),a=$m(s);return a?{lineStart:n,prefix:s.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind==="bullet"?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function QH(e,t){const n=zn(e),r=n.lastIndexOf(`
476
+ `,t-1)+1,s=n.slice(r,t),a=s.match(/^(\s*)[-*] $/);if(!a)return null;const c=`${a[1]}• `,d=r,f=r+s.length;return{segments:mr(e,d,f,c),cursorOffset:r+c.length}}function ZH(e,t){const n=zn(e),r=Gl(n,t);if(!r)return null;const s=n.indexOf(`
477
+ `,t);if(n.slice(r.contentStart,s===-1?n.length:s).trim()==="")return r.indent>0?{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:mr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let c;if(r.listType==="bullet")c=`${l}${r.marker??"•"} `;else{const p=(r.number??1)+1;c=`${l}${p}. `}const d=`
478
+ ${c}`;return{segments:mr(e,t,t,d),cursorOffset:t+d.length}}function JH(e,t){if(t===0)return null;const n=e.lastIndexOf(`
479
+ `,t-2)+1,r=$m(e.slice(n,t-1));return r?r.indent:null}function eU(e,t){const n=zn(e),r=Gl(n,t);if(!r)return null;const s=JH(n,r.lineStart),a=s===null?0:s+1;return r.indent>=a?null:{segments:mr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function tU(e,t){const n=zn(e),r=Gl(n,t);return!r||r.indent===0?null:{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function nU(e,t){const n=zn(e),r=Gl(n,t);return!r||t>r.contentStart?null:{segments:mr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const rU=/^\s*```/;function TA(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function SA(e){const t=new Set;let n=-1;return e.forEach((r,s)=>{if(rU.test(r))if(n===-1)n=s;else{for(let a=n;a<=s;a++)t.add(a);n=-1}}),t}function sU(e,t){const n=e.split(`
480
+ `),r=SA(n);return n.map((s,a)=>r.has(a)?s:TA(s,t)).join(`
481
+ `)}function CC(e,t){const n=[];e.forEach(c=>{c.type==="text"&&n.push(...c.text.split(`
482
+ `))});const r=SA(n);let s=0,a=!1;const l=e.map(c=>{if(c.type!=="text")return c;const d=c.text.split(`
483
+ `).map(f=>{const p=r.has(s)?f:TA(f,t);return s++,p}).join(`
484
+ `);return d===c.text?c:(a=!0,{...c,text:d})});return a?l:e}function CA(e){let t=null,n=0,r=0,s=0,a=!0;for(const l of e.split(`
485
+ `)){const c=$m(l);if(c?.kind==="numbered"&&c.indent===t){if(a=a&&c.number===r+1,r=c.number,s++,s>=2&&(n===1||a))return!0}else c?.kind==="numbered"?(t=c.indent,n=c.number,r=c.number,s=1,a=!0):(t=null,s=0)}return!1}function wA(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
486
+ `);let s="",a=0;const l=(c,d)=>{for(const f of t.keys())(d?f>=c:f>c)&&t.delete(f)};for(let c=0;c<r.length;c++){const d=r[c],f=$m(d);if(!f)t.clear(),s+=d;else if(f.kind==="bullet")l(f.indent,!0),s+=d;else{const p=f.indent;l(p,!1);const m=t.get(p),b=m===void 0?1:m+1;t.set(p,b);const x=String(b);x===String(f.number)?s+=d:(n.push({oldStart:a+f.numberStart,oldEnd:a+f.numberEnd,newText:x}),s+=d.slice(0,f.numberStart)+x+d.slice(f.numberEnd))}c<r.length-1&&(s+=`
487
+ `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:s,edits:n}}function wC(e,t){let n=0;for(const r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else{if(r.oldStart>=e)break;return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length)}return e+n}function kC(e){const{edits:t}=wA(zn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=mr(n,s.oldStart,s.oldEnd,s.newText)}return{segments:n,edits:t}}function Ci(e){return e instanceof HTMLElement}function tr(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function Kh(e){return e instanceof HTMLBRElement}function od(e){return e instanceof Text}function l1(e){return tr(e)&&e.dataset.chipAutoResolved==="true"}function iU(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function aU(e){try{return JSON.parse(e)}catch{return}}function Th(e){try{return JSON.stringify(e)}catch{return}}function kA(e){if(tr(e))return e.dataset.chipTrigger}function oU(e){if(tr(e))return e.dataset.chipValue}function NA(e){if(tr(e))return e.dataset.chipDisplay??e.textContent??void 0}function lU(e){if(!tr(e))return;const t=e.dataset.chipData;if(t)return aU(t)}function _A(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function Xh(e){if(!tr(e))return null;const t=kA(e),n=oU(e),r=NA(e);if(!t||n===void 0||!r)return null;const s=lU(e),a=l1(e);return{type:"chip",trigger:t,value:n,displayText:r,...s!==void 0?{data:s}:{},...a?{autoResolved:!0}:{}}}function Sh(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function uU(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":Kh(e)?!e.dataset.sentinel:tr(e)?Xh(e)!==null:Ci(e)?(e.textContent??"")!=="":!1}function Q0(e,t){let n=0;for(let r=0;r<t;r++)uU(e.childNodes[r])&&n++;return n}function u1(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function cU(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function c1(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const s=e.childNodes[r];if(!(s instanceof HTMLElement)||s.dataset.chipTrigger!==void 0||s instanceof HTMLBRElement)continue;const a=s.tagName;if(n.has(a))cU(e,s),t=!0;else if(a==="FONT"||a==="B"||a==="I"||a==="U"||a==="STRONG"||a==="EM"||a==="A"||a==="SPAN"){const l=s.textContent??"";l?e.replaceChild(document.createTextNode(l),s):e.removeChild(s),t=!0}}return e.normalize(),t}const NC=/https?:\/\/[^\s),]+/g;function dU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];od(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";NC.lastIndex=0;const a=[];let l;for(;(l=NC.exec(s))!==null;){let m=l[0];for(;m.length>0&&/[.;:!?]$/.test(m);)m=m.slice(0,-1);m.length>0&&a.push({url:m,index:l.index})}if(a.length===0)continue;const c=r.parentNode;if(!c)continue;const d=[];for(const{url:m,index:b}of a)try{const x=new URL(m);(x.protocol==="http:"||x.protocol==="https:")&&d.push({url:m,href:x.href,index:b})}catch{}if(d.length===0)continue;t=!0;const f=document.createDocumentFragment();let p=0;for(const{url:m,href:b,index:x}of d){x>p&&f.appendChild(document.createTextNode(s.slice(p,x)));const v=document.createElement("a");v.href=b,v.target="_blank",v.rel="noopener noreferrer",v.dataset.url="true",v.className="text-accent hover:text-accent-hover underline cursor-pointer",v.textContent=m,f.appendChild(v),p=x+m.length}p<s.length&&f.appendChild(document.createTextNode(s.slice(p))),c.replaceChild(f,r)}return t}const _C=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function fU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];od(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";_C.lastIndex=0;const a=[];let l;for(;(l=_C.exec(s))!==null;)l[1]&&l[2]?a.push({fullMatch:l[0],marker:l[1],content:l[2],index:l.index,className:"font-bold italic"}):l[3]&&l[4]?a.push({fullMatch:l[0],marker:l[3],content:l[4],index:l.index,className:"font-bold"}):l[5]&&l[6]&&a.push({fullMatch:l[0],marker:l[5],content:l[6],index:l.index,className:"italic"});if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{fullMatch:p,marker:m,content:b,index:x,className:v}of a){x>f&&d.appendChild(document.createTextNode(s.slice(f,x)));const k=document.createElement("span");k.dataset.md="true";const C=document.createElement("span");C.className="prompt-area-md-marker",C.textContent=m;const S=document.createElement("span");S.className=v,S.textContent=b;const N=document.createElement("span");N.className="prompt-area-md-marker",N.textContent=m,k.appendChild(C),k.appendChild(S),k.appendChild(N),d.appendChild(k),f=x+p.length}f<s.length&&d.appendChild(document.createTextNode(s.slice(f))),c.replaceChild(d,r)}return t}const AC=/(^|\n)([ \t]*)•/g;function hU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];od(s)&&s.textContent?.includes("•")&&n.push(s)}for(const r of n){const s=r.textContent??"";AC.lastIndex=0;const a=[];let l;for(;(l=AC.exec(s))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const p of a){p>f&&d.appendChild(document.createTextNode(s.slice(f,p)));const m=document.createElement("span");m.dataset.md="true",m.className="prompt-area-list-bullet",m.textContent="•",d.appendChild(m),f=p+1}f<s.length&&d.appendChild(document.createTextNode(s.slice(f))),c.replaceChild(d,r)}return t}const RC=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function mU(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];od(s)&&n.push(s)}for(const r of n){const s=r.textContent??"";RC.lastIndex=0;const a=[];let l;for(;(l=RC.exec(s))!==null;){const p=l.index+l[1].length;a.push({start:p,end:p+l[2].length})}if(a.length===0)continue;t=!0;const c=r.parentNode;if(!c)continue;const d=document.createDocumentFragment();let f=0;for(const{start:p,end:m}of a){p>f&&d.appendChild(document.createTextNode(s.slice(f,p)));const b=s.slice(p,m),x=Math.floor(b.length/2),v=document.createElement("span");v.dataset.md="true",v.className="prompt-area-list-indent",v.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,v.textContent=b,d.appendChild(v),f=m}f<s.length&&d.appendChild(document.createTextNode(s.slice(f))),c.replaceChild(d,r)}return t}function OC(e,t){t&&(mU(e),hU(e)),dU(e),t&&fU(e)}function Ls(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function pU(e){const t=Ls();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=u1(e,n);return r?{nodeIndex:Sh(e,r),offset:t.startOffset}:null}function gU(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const s=document.createRange();if(t.nodeIndex>=r.length){const a=r[r.length-1];a.nodeType===Node.TEXT_NODE?s.setStart(a,(a.textContent??"").length):s.setStartAfter(a)}else{const a=r[t.nodeIndex];if(a.nodeType===Node.TEXT_NODE){const l=(a.textContent??"").length;s.setStart(a,Math.min(t.offset,l))}else s.setStartAfter(a)}s.collapse(!0),n.removeAllRanges(),n.addRange(s)}function Zi(e){const t=Ls();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),Wh(n)}function bU(e,t){const n=Qc(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function sr(e,t){const n=window.getSelection();if(!n)return;const r=Qc(e,t);if(r){const a=document.createRange();a.setStart(r.node,r.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}const s=document.createRange();s.selectNodeContents(e),s.collapse(!1),n.removeAllRanges(),n.addRange(s)}function Wh(e){const t=e.cloneContents();let n=0;const r=s=>{if(s.nodeType===Node.TEXT_NODE)n+=(s.textContent??"").length;else if(tr(s))n+=_A(s);else if(Ci(s)&&s.tagName==="BR"){if(s.dataset.sentinel)return;n+=1}else Ci(s)&&s.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function th(e){const t=Ls();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=Wh(n);if(t.collapsed)return{start:r,end:r};const s=document.createRange();s.selectNodeContents(e),s.setEnd(t.endContainer,t.endOffset);const a=Wh(s);return{start:r,end:a}}function IC(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){sr(e,t);return}const s=Qc(e,t),a=Qc(e,n);if(!s||!a)return;const l=document.createRange();l.setStart(s.node,s.offset),l.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(l)}function Qc(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];if(s.nodeType===Node.TEXT_NODE){const a=(s.textContent??"").length;if(n<=a)return{node:s,offset:n};n-=a}else if(tr(s)){const a=_A(s);if(n<=a)return{node:e,offset:r+1};n-=a}else if(Kh(s)){if(s.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(Ci(s)){const a=(s.textContent??"").length;if(n<=a){const l=Qc(s,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function xU(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function AA(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):tr(r)?t.onChip(r):Ci(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function yU(e){let t="";return AA(e,{onText:n=>{t+=n},onChip:n=>{t+=(kA(n)??"")+(NA(n)??"")},onBreak:()=>{t+=`
488
+ `}}),t}function EU(e){const t=[];return AA(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=Xh(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
489
+ `})}}),t}function vU(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!xU(r))return null;if(r.type==="text"&&typeof r.text=="string")n.push({type:"text",text:r.text});else if(r.type==="chip"&&typeof r.trigger=="string"&&typeof r.value=="string"&&typeof r.displayText=="string"){const s={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(s)}else return null}return n}catch{return null}}function TU(e,t,n){const r=Ls();if(!r)return[...e,...t];const s=document.createRange();s.selectNodeContents(n),s.setEnd(r.startContainer,r.startOffset);const a=Wh(s),l=[];let c=0,d=!1;const f=()=>{d||(l.push(...t),d=!0)};for(const p of e){if(p.type==="chip"){const b=p.trigger.length+p.displayText.length;c>=a&&f(),l.push(p),c+=b;continue}const m=c+p.text.length;if(m<=a)l.push(p);else if(c>=a)f(),l.push(p);else{const b=a-c,x=p.text.slice(0,b),v=p.text.slice(b);x&&l.push({type:"text",text:x}),f(),v&&l.push({type:"text",text:v})}c=m}return f(),Mo(l)}function Z0(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function SU(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function CU(e){const t=e.tagName,n=e.getAttribute("style")??"",r=Z0(n,"font-weight"),s=r?SU(r):t==="B"||t==="STRONG",a=Z0(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",c=Z0(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||c.includes("line-through"),f=(d?"~~":"")+(s?"**":"")+(l?"*":""),p=(l?"*":"")+(s?"**":"")+(d?"~~":"");return{prefix:f,suffix:p}}function wU(e){return e.replace(/\s+/g," ")}function kU(e){return e.replace(/\*/g,"\\*")}function NU(e){const t=e.querySelector("code"),n=`${e.className} ${t?.className??""}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute("lang")??t?.getAttribute("lang")??""}function _U(e){const t=NU(e),n=(e.textContent??"").replace(/\n$/,"");return`
490
+
491
+ \`\`\`${t}
492
+ ${n}
493
+ \`\`\`
494
+
495
+ `}function AU(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function RA(e){return/^(https?:|mailto:)/i.test(e)}function RU(e,t){const n=e.getAttribute("href")??"",r=di(e,t).trim();return RA(n)?!r||r===n?n:`[${r}](${n})`:r}function OU(e){const t=e.getAttribute("src")??"";return!t||!RA(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function IU(e,t){return`
496
+
497
+ ${di(e,t).trim().split(`
498
+ `).map(s=>s?`> ${s}`:">").join(`
499
+ `)}
500
+
501
+ `}function OA(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let s=Number.isNaN(r)?1:r;const a=" ".repeat(t),l=[];for(const c of Array.from(e.childNodes)){if(!Ci(c)||c.tagName!=="LI")continue;const d=n?`${s}. `:"- ";s++;let f="",p="";for(const m of Array.from(c.childNodes))Ci(m)&&(m.tagName==="UL"||m.tagName==="OL")?p+=`
502
+ ${OA(m,t+1)}`:f+=IA(m,t);l.push(`${a}${d}${f.trim()}${p}`)}return l.join(`
503
+ `)}function MU(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(c=>Array.from(c.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>di(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),s=r[0],a=s.map(()=>"---"),l=c=>`| ${c.join(" | ")} |`;return[l(s),l(a),...r.slice(1).map(l)].join(`
504
+ `)}function di(e,t){let n="";return e.childNodes.forEach(r=>{n+=IA(r,t)}),n}function IA(e,t){if(od(e))return kU(wU(e.textContent??""));if(!Ci(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
505
+ `;case"HR":return`
506
+
507
+ ---
508
+
509
+ `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
510
+
511
+ ${"#".repeat(Number(n[1]))} ${di(e,t).trim()}
512
+
513
+ `;case"P":return`
514
+
515
+ ${di(e,t).trim()}
516
+
517
+ `;case"DIV":return`
518
+ ${di(e,t).trim()}
519
+ `;case"BLOCKQUOTE":return IU(e,t);case"UL":case"OL":return`
520
+
521
+ ${OA(e,t)}
522
+
523
+ `;case"LI":return`${di(e,t).trim()}
524
+ `;case"PRE":return _U(e);case"CODE":return AU(e);case"A":return RU(e,t);case"IMG":return OU(e);case"TABLE":return`
525
+
526
+ ${MU(e,t)}
527
+
528
+ `;default:{const{prefix:r,suffix:s}=CU(e);return r+di(e,t)+s}}}function LU(e){return e.replace(/[ \t]+\n/g,`
529
+ `).replace(/\n[ \t]*\n[ \t\n]*/g,`
530
+
531
+ `).trim()}function DU(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?LU(di(t.body,0)):""}const jU=100,MA=150;function PU(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:s,runTriggerDetection:a,dismissTrigger:l,triggers:c,markdownEnabled:d,normalizeBullets:f,onPaste:p,onUndo:m,onRedo:b,onChipAdd:x,onImagePaste:v,onRawPaste:k}=e,C=y.useRef(!1),S=y.useRef({undoStack:[],redoStack:[]}),N=y.useCallback(J=>{const te=S.current;te.undoStack.push(J),te.undoStack.length>jU&&te.undoStack.shift(),te.redoStack=[]},[]),_=y.useCallback(()=>{S.current={undoStack:[],redoStack:[]}},[]),R=y.useCallback(J=>{if(k?.(J),J.defaultPrevented)return;J.preventDefault();const te=t.current;if(!te)return;const V=Array.from(J.clipboardData.files).find(oe=>oe.type.startsWith("image/"))??(Array.from(J.clipboardData.items).find(ce=>ce.type.startsWith("image/"))?.getAsFile()??null);if(V){v?.(V);return}const B=n();N(B);const G=J.clipboardData.getData("text/prompt-area-segments");if(G){const oe=vU(G);if(oe&&oe.length>0){const ce=Ls();if(!ce)return;ce.deleteContents();const de=n(),fe=TU(de,oe,te);r(fe),s(fe),p?.({segments:fe,source:"internal"});for(const ve of oe)ve.type==="chip"&&x?.(ve);a();return}}let X="";if(d)if(X=J.clipboardData.getData("text/markdown"),X)X=X.replace(/\\([()])/g,"$1");else{const oe=J.clipboardData.getData("text/html");if(oe)try{X=DU(oe)}catch{X=""}}if(X||(X=J.clipboardData.getData("text/plain")),!X)return;d&&f&&(X=sU(X,!0)),d&&CA(X)&&(X=wA(X).text);const ae=Ls();if(!ae)return;ae.deleteContents();const M=X.split(`
532
+ `),P=document.createDocumentFragment();for(let oe=0;oe<M.length;oe++)M[oe]&&P.appendChild(document.createTextNode(M[oe])),oe<M.length-1&&P.appendChild(document.createElement("br"));ae.insertNode(P),ae.collapse(!1);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(ae),c1(te);const j=n(),re=GH(j,c);if(re!==j){r(re),s(re);for(const oe of re)oe.type==="chip"&&!j.some(ce=>ce.type==="chip"&&ce.trigger===oe.trigger&&ce.value===oe.value&&ce.displayText===oe.displayText)&&x?.(oe)}else r(j);p?.({segments:re,source:"external"}),a()},[t,n,r,N,a,s,c,d,f,p,x,v,k]),I=y.useCallback(J=>{J.preventDefault();const te=Ls();if(!te)return;const V=te.cloneContents(),B=yU(V);J.clipboardData.setData("text/plain",B);const G=EU(V);if(G.some(ae=>ae.type==="chip")){const ae=Th(G);ae&&J.clipboardData.setData("text/prompt-area-segments",ae)}},[]),A=y.useCallback(J=>{I(J);const te=Ls();if(!te)return;const V=n();N(V),te.deleteContents();const B=t.current;B&&c1(B);const G=n();r(G),a()},[I,t,n,r,N,a]),L=y.useCallback(J=>{J.preventDefault()},[]),D=y.useCallback(J=>{J.preventDefault()},[]),U=y.useCallback(()=>{C.current=!0},[]),z=y.useCallback(()=>{C.current=!1,a()},[a]),K=y.useCallback(()=>{setTimeout(()=>{const J=t.current;if(!J)return;const te=document.activeElement;te&&J.parentElement?.contains(te)||l()},MA)},[t,l]),W=y.useCallback(J=>{if(!(J.metaKey||J.ctrlKey)||J.key!=="z")return!1;J.preventDefault();const V=S.current;if(J.shiftKey){if(V.redoStack.length===0)return!0;const B=V.redoStack.pop();if(!B)return!0;const G=n();V.undoStack.push(G),r(B),s(B),b?.(B)}else{if(V.undoStack.length===0)return!0;const B=V.undoStack.pop();if(!B)return!0;const G=n();V.redoStack.push(G),r(B),s(B),m?.(B)}return!0},[n,r,s,m,b]);return{handlePaste:R,handleCopy:I,handleCut:A,handleDrop:L,handleDragOver:D,handleCompositionStart:U,handleCompositionEnd:z,handleBlur:K,handleKeyDownForUndoRedo:W,pushUndo:N,resetUndoHistory:_,isComposing:C}}function BU(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[s,a]=y.useState(null),l=y.useRef(0),c=y.useRef(null),d=y.useRef(null),f=y.useCallback(()=>{c.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),p=y.useCallback((m,b)=>{if(!b.onSearch)return;c.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,v=new AbortController;c.current=v;const{onSearch:k,onSearchError:C,searchDebounceMs:S}=b,N=()=>{const _=k(m,{signal:v.signal});_ instanceof Promise?_.then(R=>{v.signal.aborted||l.current!==x||(t(R),r(!1))},R=>{v.signal.aborted||l.current!==x||R instanceof DOMException&&R.name==="AbortError"||(a(R instanceof Error?R.message:"Search failed"),r(!1),C?.(R))}):(t(_),r(!1))};S&&S>0&&m.length>0?d.current=setTimeout(N,S):N()},[]);return y.useEffect(()=>()=>{c.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:s,search:p,reset:f}}const zU=300;function HU({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:s,onEscape:a,onChipClick:l,onChipAdd:c,onChipDelete:d,onLinkClick:f,onPaste:p,onRawPaste:m,onUndo:b,onRedo:x,onImagePaste:v,markdown:k=!0,normalizeBullets:C=!0,submitOnEnter:S=!0,maxLength:N}){const _=y.useRef(null),[R,I]=y.useState(null),[A,L]=y.useState(0),[D,U]=y.useState(null),z=y.useRef(null),K=y.useRef(null),W=y.useRef(null),{suggestions:J,suggestionsLoading:te,suggestionsError:V,search:B,reset:G}=BU(),X=y.useRef(!1),ae=y.useRef([]),M=y.useRef(null),P=y.useRef(null),$=y.useCallback(()=>{const ee=_.current;if(!ee)return[];const me=[];let ie=!1,Q=!1;for(let Y=0;Y<ee.childNodes.length;Y++){const F=ee.childNodes[Y];if(F.nodeType===Node.TEXT_NODE){const le=F.textContent??"";le&&(me.push({type:"text",text:le}),ie=!0)}else if(tr(F)){const le=Xh(F);le&&(me.push(le),ie=!0)}else if(Kh(F)){if(F.dataset.sentinel){Q=!0;continue}me.push({type:"text",text:`
533
+ `})}else if(Ci(F)){const le=F.textContent??"";le&&(me.push({type:"text",text:le}),ie=!0)}}return!ie&&!Q?[]:me},[]),j=y.useCallback(ee=>{const me=_.current;if(!me)return;X.current=!0;const ie=pU(me);for(;me.firstChild;)me.removeChild(me.firstChild);for(const Q of ee)if(Q.type==="text"){const Y=Q.text.split(`
534
+ `);for(let F=0;F<Y.length;F++)Y[F]&&me.appendChild(document.createTextNode(Y[F])),F<Y.length-1&&me.appendChild(document.createElement("br"))}else{const Y=document.createElement("span");if(Y.contentEditable="false",Y.dataset.chipTrigger=Q.trigger,Y.dataset.chipValue=Q.value,Y.dataset.chipDisplay=Q.displayText,Q.data!==void 0){const Ce=Th(Q.data);Ce&&(Y.dataset.chipData=Ce)}Q.autoResolved&&(Y.dataset.chipAutoResolved="true");const F=n.find(Ce=>Ce.char===Q.trigger),le=F?.chipStyle??"pill";Y.dataset.chipStyle=le,Y.className=Se("prompt-area-chip",le==="inline"&&"prompt-area-chip--inline",F?.chipClassName),Y.textContent=`${Q.trigger}${Q.displayText}`,Y.setAttribute("role","button"),Y.setAttribute("tabindex","-1"),me.appendChild(Y)}if(me.lastChild&&Kh(me.lastChild)){const Q=document.createElement("br");Q.dataset.sentinel="true",me.appendChild(Q)}OC(me,k),ie&&gU(me,ie),ae.current=ee,X.current=!1},[n,k]),re=y.useCallback((ee,me)=>ie=>{const Q=W0(ee,me,{value:ie.value,displayText:ie.displayText,data:ie.data});t(Q.segments),j(Q.segments),c?.({type:"chip",trigger:me.config.char,value:ie.value,displayText:ie.displayText,...ie.data!==void 0?{data:ie.data}:{}});const Y=_.current;Y&&sr(Y,Q.cursorOffset)},[t,j,c]),oe=y.useCallback(()=>{const ee=_.current;if(!ee)return;const me=$(),ie=zn(me),Q=Zi(ee);if(Q===null)return;const Y=$H(ie,Q,n);if(z.current=null,K.current=null,Y){I(Y),L(0);const F=bU(ee,Y.startOffset);if(F){const le=F.getBoundingClientRect();(le.height>0||le.left>0||le.top>0)&&U(le)}Y.config.mode==="dropdown"&&Y.config.onSearch&&B(Y.query,Y.config),Y.config.mode==="callback"&&Y.config.onActivate&&Y.config.onActivate({text:ie,cursorPosition:Q,insertChip:re(me,Y)})}else I(null),G()},[n,$,re,G,B]),ce=y.useCallback(()=>{z.current=null,K.current=null,I(null),L(0),G()},[G]),de=PU({editorRef:_,readSegmentsFromDOM:$,onChange:t,renderSegmentsToDOM:j,runTriggerDetection:oe,dismissTrigger:ce,triggers:n,markdownEnabled:k,normalizeBullets:C,onPaste:p,onRawPaste:m,onUndo:b,onRedo:x,onChipAdd:c,onImagePaste:v});y.useEffect(()=>{if(!X.current&&!WH(e,ae.current)){if(k&&C){const ee=CC(e,!0);if(ee!==e){t(ee);return}}j(e)}},[e,j,k,C,t]);const fe=y.useRef(k);y.useEffect(()=>{if(fe.current===k)return;fe.current=k;const ee=C?CC(e,k):e;ee!==e?t(ee):j(e)},[k,C,j,e,t]),y.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]);const ve=y.useCallback(()=>{if(X.current)return;if(de.isComposing.current){const F=$();ae.current=F,t(F);return}const ee=_.current,me=ee?Zi(ee):null;ee&&c1(ee);const ie=$();if(N!=null&&ee&&zn(ie).length>N){const F=Zi(ee),le=FH(ie,N);ae.current=le,t(le),j(le),sr(ee,F!=null?Math.min(F,N):N),oe();return}if(k&&C&&ee&&me!==null){const F=QH(ie,me);if(F){ae.current=F.segments,t(F.segments),j(F.segments),sr(ee,F.cursorOffset),oe();return}}let Q=ie,Y=null;if(k&&me!==null&&CA(zn(ie))){const F=kC(ie);F.edits.length>0&&(Q=F.segments,Y=wC(me,F.edits))}P.current||(P.current=ae.current),ae.current=Q,t(Q),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{P.current&&(de.pushUndo(P.current),P.current=null),M.current=null},zU),ee&&(Y!==null?(j(Q),sr(ee,Y)):(OC(ee,k),me!==null&&sr(ee,me))),oe()},[t,$,oe,j,k,C,N,de]),Fe=y.useCallback(ee=>{const me=ee.target;if(!(me instanceof Node))return;const ie=_.current;if(!ie)return;let Q=me;for(;Q&&Q!==ie;){if(iU(Q)){if(ee.metaKey||ee.ctrlKey){ee.preventDefault(),f?.(Q.href),window.open(Q.href,"_blank","noopener,noreferrer");return}break}if(tr(Q)){const Y=Q.getBoundingClientRect(),F=document.createElement("span");F.className="prompt-area-chip-ripple";const le=Math.max(Y.width,Y.height);F.style.width=`${le}px`,F.style.height=`${le}px`,F.style.left=`${ee.clientX-Y.left-le/2}px`,F.style.top=`${ee.clientY-Y.top-le/2}px`,Q.appendChild(F),F.addEventListener("animationend",()=>F.remove());const Ce=Xh(Q);if(Ce){const Re=n.find(ot=>ot.char===Ce.trigger),Ve=W.current===Q;if(W.current=null,!r&&!Ve&&Re?.reopenOnChipClick&&Re.mode==="dropdown"&&Re.onSearch){const ot=Sh(ie,Q);z.current={chip:Ce,segIndex:Q0(ie,ot)},K.current=Q,I({config:Re,startOffset:0,query:""}),L(0),U(Y),B("",Re)}l?.(Ce)}return}Q=Q.parentNode}},[l,f,n,B,r]),De=y.useCallback(ee=>{const me=ee.target,ie=_.current;if(!ie||!(me instanceof Node)){W.current=null;return}let Q=me;for(;Q&&Q!==ie;){if(tr(Q)){W.current=K.current===Q?Q:null;return}Q=Q.parentNode}W.current=null},[]),Ee=y.useCallback((ee,me)=>{const ie=$(),Q=Sh(ee,me);if(Q===-1)return!1;const Y=Q0(ee,Q),F=ie[Y],le=qH(ie,Y);return t(le),j(le),F?.type==="chip"&&d?.(F),!0},[$,t,j,d]),Ie=y.useCallback((ee,me)=>{const ie=$(),Q=Sh(ee,me);if(Q===-1)return!1;const Y=Q0(ee,Q),F=ie[Y],le=YH(ie,Y);if(!le)return!1;let Ce=0;for(let Re=0;Re<Y;Re++){const Ve=ie[Re];Ve.type==="text"?Ce+=Ve.text.length:Ce+=Ve.trigger.length+Ve.displayText.length}return Ce+=le.revertedText.length,t(le.segments),j(le.segments),sr(ee,Ce),F?.type==="chip"&&d?.(F),!0},[$,t,j,d]),Be=y.useCallback(()=>{const ee=_.current;if(!ee)return!1;const me=Ls();if(!me||!me.collapsed)return!1;const ie=me.startContainer,Q=me.startOffset;if(ie===ee&&Q>0){const Y=ee.childNodes[Q-1];if(Y&&tr(Y))return l1(Y)?Ie(ee,Y):Ee(ee,Y)}if(ie.nodeType===Node.TEXT_NODE&&Q===0){const Y=u1(ee,ie);if(!Y)return!1;let F=Y.previousSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.previousSibling;if(F&&tr(F))return l1(F)?Ie(ee,F):Ee(ee,F)}return!1},[Ee,Ie]),Ge=y.useCallback(()=>{const ee=_.current;if(!ee)return!1;const me=Ls();if(!me||!me.collapsed)return!1;const ie=me.startContainer,Q=me.startOffset;if(ie===ee&&Q<ee.childNodes.length){const Y=ee.childNodes[Q];if(Y&&tr(Y))return Ee(ee,Y)}if(ie.nodeType===Node.TEXT_NODE&&Q===(ie.textContent??"").length){const Y=u1(ee,ie);if(!Y)return!1;let F=Y.nextSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.nextSibling;if(F&&tr(F))return Ee(ee,F)}return!1},[Ee]),$e=y.useCallback(ee=>{const me=$(),ie=ee.query,Q={value:ie,label:ie},Y=ee.config.onSelect?.(Q)??ie,F={value:ie,displayText:Y||ie,autoResolved:!0},le=W0(me,ee,F);t(le.segments),j(le.segments),c?.({type:"chip",trigger:ee.config.char,...F});const Ce=_.current;Ce&&sr(Ce,le.cursorOffset),ce()},[$,t,j,ce,c]),Me=y.useCallback(ee=>{if(!R)return;const me=$(),ie=R.config.insertAsText?.(ee);if(ie!==void 0){const Re=VH(me,R,ie);de.pushUndo(me),t(Re.segments),j(Re.segments);const Ve=_.current;Ve&&sr(Ve,Re.cursorOffset),ce(),setTimeout(()=>{_.current?.focus()},0);return}const Q=R.config.onSelect?.(ee)??ee.label,Y={value:ee.value,displayText:Q||ee.label,data:ee.data},F=z.current;if(F){const Re=_.current;if(Re&&!r){const Ve=me[F.segIndex],et=Ve?.type==="chip"&&Ve.trigger===F.chip.trigger&&Ve.value===F.chip.value?F.segIndex:(()=>{const ut=[];return me.forEach((qe,Rt)=>{qe.type==="chip"&&qe.trigger===F.chip.trigger&&qe.value===F.chip.value&&ut.push(Rt)}),ut.length===1?ut[0]:-1})(),dt=et!==-1?me[et]:void 0;if(dt?.type==="chip"){const ut={type:"chip",trigger:R.config.char,...Y};let qe=me.map((Qt,$t)=>$t===et?ut:Qt);const Rt=qe[et+1],jt=!Rt||Rt.type!=="text"||Rt.text.length===0;jt&&(qe=[...qe.slice(0,et+1),{type:"text",text:" "},...qe.slice(et+1)]),de.pushUndo(me),t(qe),j(qe),dt.value===ut.value&&dt.displayText===ut.displayText&&Th(dt.data)===Th(ut.data)||(d?.(dt),c?.(ut));const Lt=zn(qe.slice(0,et+1)).length+(jt?1:0);sr(Re,Lt)}}ce(),setTimeout(()=>{_.current?.focus()},0);return}const le=W0(me,R,Y);t(le.segments),j(le.segments),c?.({type:"chip",trigger:R.config.char,...Y});const Ce=_.current;Ce&&sr(Ce,le.cursorOffset),ce(),setTimeout(()=>{_.current?.focus()},0)},[R,$,t,j,ce,c,d,de,r]),we=Me;y.useEffect(()=>{const ee=z.current;if(!ee||!R?.config.reopenOnChipClick)return;const me=J.findIndex(ie=>ie.value===ee.chip.value);me>0&&L(me)},[J,R]);const ye=y.useCallback(ee=>{const me=(F,le)=>{let{segments:Ce,cursorOffset:Re}=le;if(k){const Ve=kC(Ce);Ce=Ve.segments,Re=wC(Re,Ve.edits)}ae.current=Ce,t(Ce),j(Ce),sr(F,Re)},ie=F=>{if(!k)return!1;const le=$(),Ce=Zi(F);if(Ce===null)return!1;const Re=zn(le);if(!Gl(Re,Ce))return!1;const Ve=ZH(le,Ce);return Ve&&me(F,Ve),!0};if((ee.metaKey||ee.ctrlKey)&&ee.key==="z"&&P.current&&(M.current&&(clearTimeout(M.current),M.current=null),de.pushUndo(P.current),P.current=null),de.handleKeyDownForUndoRedo(ee))return;if(k&&(ee.metaKey||ee.ctrlKey)&&!ee.shiftKey&&(ee.key==="b"||ee.key==="i")){ee.preventDefault();const F=_.current;if(!F)return;const le=th(F);if(!le||le.start===le.end)return;const Ce=ee.key==="b"?"**":"*",Re=$();de.pushUndo(Re);const Ve=XH(Re,le.start,le.end,Ce);if(!Ve)return;ae.current=Ve.segments,t(Ve.segments),j(Ve.segments),IC(F,Ve.selectionStart,Ve.selectionEnd);return}if(!ee.metaKey&&!ee.ctrlKey&&!ee.altKey&&!ee.nativeEvent.isComposing&&ee.key.length===1){const F=n.find(Ce=>Ce.mode==="launch"&&Ce.char===ee.key),le=_.current;if(F?.onActivate&&le){const Ce=Zi(le);if(Ce!==null){const Re=$(),Ve=zn(Re);if(Gh(Ve,Ce,F.position)){ee.preventDefault(),F.onActivate({text:Ve,cursorPosition:Ce,insertChip:re(mr(Re,Ce,Ce,F.char),{config:F,startOffset:Ce,query:""})});return}}}}if(R&&R.config.mode==="dropdown"&&(J.length>0||te||V!==null||!!R.config.emptyMessage)){if(ee.key==="ArrowDown"){ee.preventDefault(),J.length>0&&L(F=>Math.min(F+1,J.length-1));return}if(ee.key==="ArrowUp"){ee.preventDefault(),J.length>0&&L(F=>Math.max(F-1,0));return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const F=J[A];F&&Me(F);return}if(ee.key==="Escape"){ee.preventDefault(),ce();return}}if(ee.key===" "&&R&&R.config.resolveOnSpace&&R.query.trim().length>0){ee.preventDefault(),$e(R);return}if(k&&ee.key==="Tab"&&!R){const F=_.current;if(F){const le=$(),Ce=zn(le),Re=Zi(F);if(Re!==null&&Gl(Ce,Re)){ee.preventDefault();const ot=ee.shiftKey?tU(le,Re):eU(le,Re);ot&&me(F,ot);return}}}const Y=F=>{const le=th(F);if(!le)return;const Ce=$();de.pushUndo(Ce);const Re=mr(Ce,le.start,le.end,`
535
+ `);me(F,{segments:Re,cursorOffset:le.start+1})};if(ee.key==="Enter"&&ee.shiftKey&&!ee.nativeEvent.isComposing){ee.preventDefault();const F=_.current;F&&!ie(F)&&Y(F);return}if(ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing){const F=_.current;if(F&&ie(F)){ee.preventDefault();return}if(S){ee.preventDefault(),s?.($());return}ee.preventDefault(),F&&Y(F);return}if(ee.key==="Escape"&&a){a();return}if((ee.key==="Backspace"||ee.key==="Delete")&&!ee.nativeEvent.isComposing){const F=_.current;if(F){const le=th(F);if(le&&le.start!==le.end){ee.preventDefault();const Ce=$();de.pushUndo(Ce);const Re=mr(Ce,le.start,le.end,"");me(F,{segments:Re,cursorOffset:le.start}),oe();return}}}if(ee.key==="Backspace"){const F=_.current;if(F){const le=$(),Ce=Zi(F);if(k&&Ce!==null){const Re=nU(le,Ce);if(Re){ee.preventDefault(),me(F,Re),oe();return}}}if(Be()){ee.preventDefault(),oe();return}}if(ee.key==="Delete"&&Ge()){ee.preventDefault(),oe();return}},[R,J,te,V,A,s,S,a,$,t,j,k,ce,Be,Ge,$e,oe,Me,de,n,re]),Oe=y.useMemo(()=>({focus:()=>_.current?.focus(),blur:()=>_.current?.blur(),insertChip:ee=>{const me=$(),ie={type:"chip",...ee},Q=[...me,ie,{type:"text",text:" "}];t(Q),j(Q),c?.(ie)},getPlainText:()=>zn($()),clear:()=>{t([]);const ee=_.current;if(ee)for(;ee.firstChild;)ee.removeChild(ee.firstChild);de.resetUndoHistory(),M.current&&(clearTimeout(M.current),M.current=null),P.current=null},setText:ee=>{de.pushUndo($());const me=UH(ee);t(me),j(me);const ie=_.current;ie&&sr(ie,ee.length)},appendText:ee=>{const me=$();de.pushUndo(me);const ie=me[me.length-1],Q=ie?.type==="text"?[...me.slice(0,-1),{type:"text",text:ie.text+ee}]:[...me,{type:"text",text:ee}];t(Q),j(Q);const Y=_.current;Y&&sr(Y,zn(Q).length)},getCursorPosition:()=>{const ee=_.current;return ee?Zi(ee):null},setCursorPosition:ee=>{const me=_.current;me&&sr(me,ee)},setCursorToEnd:()=>{const ee=_.current;ee&&sr(ee,zn($()).length)},getSelection:()=>{const ee=_.current;return ee?th(ee):null},setSelection:(ee,me)=>{const ie=_.current;ie&&IC(ie,ee,me)}}),[$,t,j,c,de]),je=y.useMemo(()=>({onPaste:de.handlePaste,onCopy:de.handleCopy,onCut:de.handleCut,onDrop:de.handleDrop,onDragOver:de.handleDragOver,onCompositionStart:de.handleCompositionStart,onCompositionEnd:de.handleCompositionEnd,onBlur:de.handleBlur}),[de.handlePaste,de.handleCopy,de.handleCut,de.handleDrop,de.handleDragOver,de.handleCompositionStart,de.handleCompositionEnd,de.handleBlur]);return{editorRef:_,activeTrigger:R,suggestions:J,suggestionsLoading:te,suggestionsError:V,selectedSuggestionIndex:A,handleInput:ve,handleKeyDown:ye,handleClick:Fe,handleMouseDown:De,selectSuggestion:we,dismissTrigger:ce,handle:Oe,triggerRect:D,eventHandlers:je}}const MC=240;function UU({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:s,onSelect:a,onDismiss:l,triggerRect:c,triggerChar:d}){const f=y.useRef(null),p=y.useRef(null);if(y.useEffect(()=>{p.current?.scrollIntoView({block:"nearest"})},[s]),y.useEffect(()=>{const C=S=>{const N=S.target;f.current&&N instanceof Node&&!f.current.contains(N)&&l()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),!c||e.length===0&&!t&&!n&&!r)return null;const m=Math.min(320,window.innerWidth-16),b=Math.min(c.left,window.innerWidth-m-8),x=window.innerHeight-c.bottom,v=x<MC&&c.top>x,k={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${m}px`,maxHeight:`${MC}px`,...v?{bottom:`${window.innerHeight-c.top+4}px`}:{top:`${c.bottom+4}px`}};return h.jsx("div",{ref:f,className:Se("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:k,role:"listbox","aria-label":`${d} suggestions`,children:t?h.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?h.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?h.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((C,S)=>h.jsxs("button",{ref:S===s?p:void 0,type:"button",role:"option","aria-selected":S===s,className:Se("text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm","hover:bg-surface-hover cursor-pointer transition-colors",S===s&&"bg-surface-hover"),onMouseDown:N=>{N.preventDefault(),a(C)},children:[C.icon&&h.jsx("span",{className:"mt-0.5 shrink-0",children:C.icon}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate font-medium",children:C.label}),C.description&&h.jsx("div",{className:"text-muted-foreground truncate text-xs",children:C.description})]})]},C.value))})}function FU({texts:e,interval:t=3e3}){const[n,r]=y.useState(0);return y.useEffect(()=>{if(e.length<=1)return;const s=setInterval(()=>{r(a=>(a+1)%e.length)},t);return()=>clearInterval(s)},[e.length,t]),h.jsx("div",{className:"pointer-events-none absolute top-0 left-0 overflow-hidden select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:h.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function LA({onClick:e,label:t,className:n}){return h.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:Se("absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center","rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80","transition-colors",n),"aria-label":t,children:h.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[h.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),h.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function $U({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:h.jsx("div",{className:Se("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(s=>h.jsxs("div",{role:"listitem",className:Se("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(s),children:[h.jsx("img",{src:s.url,alt:s.alt??"Attached image",className:"h-full w-full object-cover"}),s.loading&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&h.jsx(LA,{onClick:()=>t(s),label:`Remove ${s.alt??"image"}`})]},s.id))})}function ld({className:e,children:t}){return h.jsx("svg",{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","aria-hidden":"true",className:e,children:t})}const Vm=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),h.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),VU=({className:e})=>h.jsx(ld,{className:e,children:Vm}),qU=({className:e})=>h.jsxs(ld,{className:e,children:[Vm,h.jsx("path",{d:"M10 9H8"}),h.jsx("path",{d:"M16 13H8"}),h.jsx("path",{d:"M16 17H8"})]}),YU=({className:e})=>h.jsxs(ld,{className:e,children:[Vm,h.jsx("path",{d:"M8 13h2"}),h.jsx("path",{d:"M14 13h2"}),h.jsx("path",{d:"M8 17h2"}),h.jsx("path",{d:"M14 17h2"})]}),GU=({className:e})=>h.jsxs(ld,{className:e,children:[Vm,h.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),h.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),KU=({className:e})=>h.jsxs(ld,{className:e,children:[h.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),h.jsx("circle",{cx:"9",cy:"9",r:"2"}),h.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),nh=3;function XU(e){return e?e==="application/pdf"?"pdf":e.includes("spreadsheet")||e==="text/csv"?"spreadsheet":e.startsWith("text/")||e.includes("javascript")||e.includes("json")||e.includes("xml")?"code":e.startsWith("image/")?"image":"default":"default"}const WU={pdf:qU,spreadsheet:YU,code:GU,image:KU,default:VU};function QU(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function ZU(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function LC({file:e,compact:t,onRemove:n,onClick:r}){const s=ZU(e.name),a=e.size!=null?QU(e.size):null,l=[s,a].filter(Boolean).join(" · ");return h.jsxs("div",{role:"listitem",className:Se("border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors","hover:bg-surface-hover",t?"h-10 w-36 px-2":"h-14 w-48 px-3",r&&"cursor-pointer"),onClick:()=>r?.(e),children:[(()=>{const c=WU[XU(e.type)];return h.jsx(c,{className:Se("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:Se("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&h.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:h.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&h.jsx(LA,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function JU({files:e,onRemove:t,onClick:n,className:r}){const[s,a]=y.useState(!1),l=y.useRef(null),c=y.useRef(null);if(y.useEffect(()=>{if(!s)return;const b=x=>{const v=x.target;v instanceof Node&&l.current&&!l.current.contains(v)&&!c.current?.contains(v)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),e.length===0)return null;const d=e.length>nh,f=d,p=e.length-nh,m=e.slice(0,nh);return h.jsxs("div",{className:Se("relative",r),children:[h.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?m:e).map(b=>h.jsx(LC,{file:b,compact:f,onRemove:t,onClick:n},b.id)),d&&h.jsx("div",{role:"listitem",children:h.jsx("button",{ref:c,type:"button",onClick:()=>a(b=>!b),className:Se("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",f?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:s?"Show less":`+${p} more`})})]}),s&&h.jsx("div",{ref:l,className:Se("bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg"),children:h.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(nh).map(b=>h.jsx(LC,{file:b,compact:f,onRemove:t,onClick:n},b.id))})})]})}function DC({value:e,onChange:t,triggers:n,placeholder:r,className:s,disabled:a=!1,markdown:l,normalizeBullets:c,onSubmit:d,onEscape:f,onChipClick:p,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:v,onUndo:k,onRedo:C,minHeight:S=80,maxHeight:N,autoFocus:_=!1,autoGrow:R=!1,"aria-label":I,"data-test-id":A,images:L=[],imagePosition:D="above",onImagePaste:U,onImageRemove:z,onImageClick:K,files:W=[],filePosition:J="above",onFileRemove:te,onFileClick:V,onKeyDown:B,onBlur:G,onRawPaste:X,submitOnEnter:ae,spellCheck:M,maxLength:P,"aria-describedby":$,ref:j}){const{editorRef:re,activeTrigger:oe,suggestions:ce,suggestionsLoading:de,suggestionsError:fe,selectedSuggestionIndex:ve,handleInput:Fe,handleKeyDown:De,handleClick:Ee,handleMouseDown:Ie,selectSuggestion:Be,dismissTrigger:Ge,handle:$e,triggerRect:Me,eventHandlers:we}=HU({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:f,onChipClick:p,onChipAdd:m,onChipDelete:b,onLinkClick:x,onPaste:v,onRawPaste:X,onUndo:k,onRedo:C,onImagePaste:U,markdown:l,normalizeBullets:c,submitOnEnter:ae,maxLength:P});y.useImperativeHandle(j,()=>$e,[$e]),y.useEffect(()=>{_&&re.current?.focus()},[_,re]);const[ye,Oe]=y.useState(!1),[je,ee]=y.useState(void 0),me=y.useCallback(()=>{const qe=re.current;if(!qe)return;qe.style.height="auto";const Rt=qe.scrollHeight;qe.style.height=`${Rt}px`,ee(Rt)},[re]),ie=y.useCallback(()=>{R&&(Oe(!0),me())},[R,me]),Q=y.useCallback(()=>{we.onBlur(),R&&setTimeout(()=>{const qe=re.current;if(!qe)return;const Rt=document.activeElement;Rt&&qe.parentElement?.contains(Rt)||(Oe(!1),ee(void 0))},MA)},[we,R,re]),Y=y.useCallback(()=>{Fe(),R&&ye&&me()},[Fe,R,ye,me]);y.useEffect(()=>{R&&ye&&requestAnimationFrame(()=>me())},[e,R,ye,me]);const[F,le]=y.useState(!1),Ce=y.useRef(null);y.useEffect(()=>{if(!R)return;const qe=()=>{if(ye){le(!1);return}const jt=re.current;jt&&le(jt.scrollHeight>jt.clientHeight)},Rt=ye?0:160;return Ce.current=setTimeout(qe,Rt),()=>{Ce.current!==null&&clearTimeout(Ce.current)}},[R,ye,e,re]);const Re=y.useMemo(()=>{if(!R){const qe={minHeight:`${S}px`};return N&&(qe.maxHeight=`${N}px`,qe.overflowY="auto"),qe}return{height:ye&&je?`${je}px`:`${S}px`,minHeight:`${S}px`,maxHeight:N?`${N}px`:"70dvh",overflowY:ye?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[R,S,N,ye,je]),Ve=y.useCallback(qe=>{B?.(qe),!qe.defaultPrevented&&De(qe)},[B,De]),ot=y.useCallback(qe=>{G?.(qe),Q()},[G,Q]),et=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",dt=L.length>0?h.jsx($U,{images:L,onRemove:z,onClick:K,className:D==="above"?"pb-2":"pt-2"}):null,ut=W.length>0?h.jsx(JU,{files:W,onRemove:te,onClick:V,className:J==="above"?"pb-2":"pt-2"}):null;return h.jsxs("div",{className:Se("prompt-area-container relative text-sm leading-relaxed",s),children:[D==="above"&&dt,J==="above"&&ut,h.jsxs("div",{className:"relative",children:[h.jsx("div",{ref:re,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":I??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":$,"data-test-id":A,spellCheck:M,className:Se("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:Re,onFocus:ie,onInput:R?Y:Fe,onKeyDown:Ve,onMouseDown:Ie,onClick:Ee,onPaste:we.onPaste,onCopy:we.onCopy,onCut:we.onCut,onDrop:we.onDrop,onDragOver:we.onDragOver,onCompositionStart:we.onCompositionStart,onCompositionEnd:we.onCompositionEnd,onBlur:ot}),R&&F&&!ye&&h.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>re.current?.focus(),children:h.jsx("div",{className:"h-full w-full",style:{background:"linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))"}})}),et&&r&&(Array.isArray(r)?h.jsx(FU,{texts:r}):h.jsx("div",{className:"pointer-events-none absolute top-0 left-0 select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:r}))]}),J==="below"&&ut,D==="below"&&dt,oe&&oe.config.mode==="dropdown"&&h.jsx(UU,{suggestions:ce,loading:de,error:fe,emptyMessage:oe.config.emptyMessage,selectedIndex:ve,onSelect:Be,onDismiss:Ge,triggerRect:Me,triggerChar:oe.config.char})]})}function eF(e={}){const{initialValue:t=[]}=e,[n,r]=y.useState(t),s=y.useRef(null),a=y.useMemo(()=>zn(n),[n]),l=y.useMemo(()=>n.length===0?!0:n.every(v=>v.type==="text"&&v.text.trim()===""),[n]),c=y.useMemo(()=>n.some(v=>v.type==="chip"),[n]),d=y.useMemo(()=>n.filter(v=>v.type==="chip"),[n]),f=y.useMemo(()=>({ref:s,value:n,onChange:r}),[n]),p=y.useCallback(()=>{s.current?s.current.clear():r([])},[]),m=y.useCallback(()=>s.current?.focus(),[]),b=y.useCallback(()=>s.current?.blur(),[]),x=y.useCallback(v=>s.current?.insertChip(v),[]);return{bind:f,plainText:a,isEmpty:l,hasChips:c,chips:d,clear:p,focus:m,blur:b,insertChip:x}}function tF(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function jC(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const DA=["attention","working","idle","ended"],jA={attention:"Needs attention",working:"Working",idle:"Idle",ended:"Ended"};function PA(e){return e.pendingPermissionCount>0||e.status==="awaiting_approval"?"attention":e.status==="running"||e.status==="starting"?"working":e.status==="failed"||e.status==="closed"?"ended":"idle"}const d1={search:"",gateways:[],adapters:[],states:[],scoped:!0,groupBy:"state",sortBy:"recent"};function nF(e){return[...new Set(e.map(t=>t.adapter))].sort()}function Qh(e){return e.title??e.id.slice(0,8)}function rF(e,t){return t?Qh(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t):!0}function PC(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function sF(e,t){const n=PC(e),r=PC(t);return r===n||r.startsWith(`${n}/`)}function iF(e,t){return t.roots.some(n=>(n.hostId?n.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&sF(n.path,e.info.cwd))}function BA(e,t){return e.scoped&&t!==void 0}function aF(e,t,n){const r=t.search.trim().toLowerCase(),s=BA(t,n)?n:void 0;return e.filter(a=>(t.gateways.length===0||t.gateways.includes(a.hostId))&&(t.adapters.length===0||t.adapters.includes(a.adapter))&&(t.states.length===0||t.states.includes(a.state))&&(!s||iF(a,s))&&rF(a,r))}function oF(e,t){return t==="gateway"?e.hostId:t==="adapter"?e.adapter:e.state}function zA(e,t){return t==="gateway"?e.hostName:t==="adapter"?e.adapter:jA[e.state]}function f1(e,t){return t==="state"?String(DA.indexOf(e.state)):zA(e,t).toLowerCase()}const J0=(e,t)=>(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt);function lF(e,t,n){return n==="recent"?J0(e,t):n==="name"?Qh(e.info).localeCompare(Qh(t.info),void 0,{sensitivity:"base"})||J0(e,t):f1(e,n).localeCompare(f1(t,n))||J0(e,t)}function uF(e,t){const n=[...e].sort((a,l)=>lF(a,l,t.sortBy));if(t.groupBy==="none")return n.length?[{key:"all",rows:n}]:[];const r=t.groupBy,s=new Map;for(const a of n){const l=oF(a,r),c=s.get(l);c?c.rows.push(a):s.set(l,{key:l,label:zA(a,r),rank:f1(a,r),rows:[a]})}return[...s.values()].sort((a,l)=>a.rank.localeCompare(l.rank))}function cF(e,t,n,r){if(n>=r)return;const s=[];t&&BA(e,t)&&s.push(t.label);const a=(e.gateways.length?1:0)+(e.adapters.length?1:0)+(e.states.length?1:0);return a>0&&s.push(`${a} filter${a===1?"":"s"}`),e.search.trim()&&s.push("search"),{shown:n,total:r,causes:s}}function dF(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0}function BC(e){return{...d1,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}const fF=720*60*60*1e3,hF=6e4,eb=(e,t)=>`${e}:${t}`;class mF{#t;#n;constructor(t){this.#t=t,this.#n={...t.read()}}get(t,n){return this.#n[eb(t,n)]}all(){return this.#n}mark(t,n,r,s=Date.now()){const a=eb(t,n),l=this.#n[a],c={itemCount:Math.max(l?.itemCount??0,r.itemCount??0),activity:Math.max(l?.activity??0,r.activity??0),turns:Math.max(l?.turns??0,r.turns??0),seenAt:s};return l&&l.itemCount===c.itemCount&&l.activity===c.activity&&l.turns===c.turns&&c.seenAt-l.seenAt<hF?!1:(this.#n[a]=c,this.#t.write(this.#r(s)),!0)}forget(t,n){const r=eb(t,n);r in this.#n&&(delete this.#n[r],this.#t.write(this.#n))}#r(t){const n=t-fF;for(const[r,s]of Object.entries(this.#n))s.seenAt<n&&delete this.#n[r];return this.#n}}function pF(e,t){return e?t.activityCount!==void 0?Math.max(0,t.activityCount-e.activity):Math.max(0,(t.turns??0)-e.turns):0}const HA=7,ud={claude:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions","plan","dontAsk","auto"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:["image","pdf","text"],reasoningEfforts:["low","medium","high","xhigh","max"],vfs:!1,streaming:"token"},codex:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!0,settingSources:!1,budgets:!1,attachments:["image","text"],reasoningEfforts:["minimal","low","medium","high","xhigh"],vfs:!1,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!1,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,streaming:"token"}};ud.provider.permissionModes;const gF={status:"starting",capabilities:ud.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},tb="streaming",rh="streaming-thinking";function bF(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
536
+ `)}function zC(e){return typeof e=="string"?[{type:"text",text:e}]:e}function xF(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const yF=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function Ya(e,t){const n=e.findIndex(s=>s.id===t.id&&s.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function EF(e,t){const n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??ud[n??"claude"],session:t}}function vF(e){const t=Object.entries(e.rateLimits??{}).filter(([,s])=>s.utilization!==void 0).map(([s,a])=>({key:s,info:a})),n=["five_hour","seven_day"].flatMap(s=>t.filter(a=>a.key===s)),r=t.filter(s=>s.key.startsWith("seven_day_")).sort((s,a)=>s.key.localeCompare(a.key));return[...n,...r]}function TF(e,t){if(t.seq<=e.lastSeq)return e;const n={...e,lastSeq:t.seq};switch(t.type){case"system_init":return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case"status_changed":return{...n,status:t.status,statusDetail:t.detail};case"capabilities":return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case"skills":return{...n,skills:t.skills};case"file_produced":return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes!==void 0?{bytes:t.bytes}:{}}}};case"model_changed":return t.model===void 0?n:{...n,model:t.model};case"permission_mode_changed":return{...n,permissionMode:t.mode};case"context_usage":return{...n,contextUsage:t.usage};case"rate_limit":{const r=t.info.rateLimitType;return r?{...n,rateLimits:{...n.rateLimits,[r]:t.info},rateLimitsUpdatedAt:t.ts}:n}case"plan_info":return{...n,subscriptionType:t.subscriptionType};case"user_message":{let r=n.items;for(const s of zC(t.message.content))if(s.type==="tool_result"){const a=s,l=a.is_error===!0;r=r.map(c=>c.kind==="tool_call"&&c.id===a.tool_use_id?{...c,status:l?"failed":"settled",result:{text:bF(a.content),isError:l}}:c)}else if(s.type==="text"&&!t.synthetic){const a=s.text,l=yF.exec(a.trim());l?r=Ya(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=Ya(r,{kind:"user",id:t.uuid??`user-${t.seq}`,text:a,attachments:t.attachments})}return{...n,items:r}}case"assistant_message":{let r=n.items.find(l=>l.kind==="thinking"&&l.id===rh)?.text??"",s=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===tb)&&!(l.kind==="thinking"&&l.id===rh));return zC(t.message.content).forEach((l,c)=>{const d=`${t.uuid}-${c}`;if(l.type==="text")s=Ya(s,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const f=l.thinking||r;if(r="",f.trim()==="")return;s=Ya(s,{kind:"thinking",id:d,text:f,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const f=l;s=Ya(s,{kind:"tool_call",id:f.id,name:f.name,input:f.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:s}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const s=n.items.find(l=>l.kind==="assistant_text"&&l.id===tb),a={kind:"assistant_text",id:tb,text:(s?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:Ya(n.items,a)}}if(r.delta?.type==="thinking_delta"){const s=n.items.find(l=>l.kind==="thinking"&&l.id===rh),a={kind:"thinking",id:rh,text:(s?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:Ya(n.items,a)}}return n}case"turn_result":return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items,{kind:"turn_result",id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case"permission_requested":return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case"permission_resolved":return{...n,pendingApprovals:n.pendingApprovals.filter(r=>r.id!==t.requestId)};case"execution_dispatched":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:t.deferred?"deferred":"pending",executionId:t.executionId,backend:t.backend}:r)};case"execution_result":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"settled",executionId:t.executionId,result:{text:xF(t.output),isError:!1},logs:t.logs??r.logs}:r)};case"execution_failed":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"failed",executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??r.logs}:r)};case"file_delivered":return{...n,items:[...n.items,{kind:"file_delivered",id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case"session_error":return{...n,items:[...n.items,{kind:"notice",id:`err-${t.seq}`,level:"error",text:t.message}]};case"session_closed":return{...n,items:[...n.items,{kind:"notice",id:`closed-${t.seq}`,level:"info",text:`Session closed (${t.reason})`}]};case"sdk_event":default:return n}}function SF(e,t){return t.type==="attached"?EF(e,t.session):TF(e,t)}const CF=3;function wF(e,t,n){const[r,s]=y.useReducer(SF,gF),[a,l]=y.useState("reconnecting"),[c,d]=y.useState(),[f,p]=y.useState(),m=y.useRef(null),b=y.useRef(n?.onProtocolError);b.current=n?.onProtocolError,y.useEffect(()=>{if(!t)return;const C=e.attach(t);m.current=C,p(C);const S=C.on("event",A=>s(A)),N=C.on("attached",A=>{s(A),d(A.protocolVersion===HA?void 0:A.protocolVersion)}),_=C.on("connectionChange",A=>l(A?"live":"reconnecting")),R=C.on("reconnectAttempt",A=>l(A>=CF?"offline":"reconnecting")),I=C.on("protocolError",A=>{b.current?.(A)});return()=>{S(),N(),_(),R(),I(),C.detach(),m.current=null,p(void 0),l("reconnecting"),d(void 0)}},[e,t]);const x=kF(e,t,r),v=a==="live",k=y.useCallback(()=>m.current?.reconnectNow(),[]);return y.useMemo(()=>({state:r,connected:v,connection:a,protocolMismatch:c,models:x,effectiveModel:r.model??r.defaultModel,handle:f,send:(C,S)=>m.current?.send(C,S),approve:(C,S)=>m.current?.approve(C,S),deny:(C,S,N)=>m.current?.deny(C,S,N),interrupt:()=>m.current?.interrupt(),setPermissionMode:C=>m.current?.setPermissionMode(C),setModel:C=>m.current?.setModel(C),closeSession:()=>m.current?.closeSession(),reconnectNow:k}),[r,v,a,c,x,f,k])}function kF(e,t,n){const[r,s]=y.useState([]),a=n.session?.profile,l=n.models,c=!!l?.length;return y.useEffect(()=>s([]),[t]),y.useEffect(()=>{if(!a||c)return;let d=!1;return e.listProfiles().then(f=>{d||s(f.profiles.find(p=>p.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,c]),c?l:r}function NF(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||_F.has(t))return"text"}const _F=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),HC=1568;function AF(e,t,{capabilities:n,engine:r}){const[s,a]=y.useState([]),[l,c]=y.useState(),d=y.useRef(0),f=y.useRef(new Map),p=y.useRef([]);p.current=s.flatMap(_=>_.previewUrl?[_.previewUrl]:[]);const m=n.attachments;y.useEffect(()=>()=>{for(const _ of p.current)URL.revokeObjectURL(_)},[]);const b=y.useCallback((_,R)=>{a(I=>I.map(A=>A.key===_?{...A,...R}:A))},[]),x=y.useCallback((_,R)=>{t&&(b(_,{status:"uploading",error:void 0}),(async()=>{try{const I=await IF(R),A=await e.uploadAttachment(t,{name:R.name,mediaType:I.mediaType,data:I.body});b(_,{status:"ready",id:A.id,bytes:A.bytes??R.size})}catch(I){b(_,{status:"failed",error:I instanceof Error?I.message:"Upload failed"})}})())},[e,b,t]),v=y.useCallback(_=>{const R=[],I=[];for(const A of _){const L=A.type||"application/octet-stream",D=NF(L);if(D&&!m.includes(D)){c(`The ${r??"claude"} engine does not take ${D} attachments.`);continue}const U=`att-${++d.current}`;R.push({key:U,name:A.name,mediaType:L,bytes:A.size,previewUrl:D==="image"?URL.createObjectURL(A):void 0,status:"uploading"}),I.push({key:U,file:A})}if(R.length!==0){a(A=>[...A,...R]),f.current=new Map([...f.current,...I.map(({key:A,file:L})=>[A,L])]);for(const{key:A,file:L}of I)x(A,L)}},[m,r,x]),k=y.useCallback(_=>{a(R=>{for(const I of R)_.includes(I.key)&&I.previewUrl&&URL.revokeObjectURL(I.previewUrl);return R.filter(I=>!_.includes(I.key))});for(const R of _)f.current.delete(R)},[]),C=y.useCallback(_=>k([_]),[k]),S=y.useCallback(()=>{a(_=>{for(const R of _)R.previewUrl&&URL.revokeObjectURL(R.previewUrl);return[]}),f.current.clear()},[]),N=y.useCallback(_=>{const R=f.current.get(_);R&&x(_,R)},[x]);return y.useMemo(()=>({items:s,readyIds:s.flatMap(_=>_.id?[_.id]:[]),uploading:s.some(_=>_.status==="uploading"),hasFailure:s.some(_=>_.status==="failed"),accept:RF(m),disabled:m.length===0||!t,add:v,retry:N,remove:C,clear:S,error:l,dismissError:()=>c(void 0)}),[s,m,t,v,N,C,S,l])}function RF(e){if(e.length===0)return"";const t=[];return e.includes("image")&&t.push("image/*"),e.includes("pdf")&&t.push("application/pdf"),e.includes("text")&&t.push("text/*",".md",".json",".yaml",".yml",".toml"),e.length===3?"":t.join(",")}const OF=globalThis;async function IF(e){const t=e.type||"application/octet-stream",{createImageBitmap:n,document:r}=OF;if(!n||!r||!t.startsWith("image/"))return{body:e,mediaType:t};if(t==="image/gif")return{body:e,mediaType:t};try{const s=await n(e),a=Math.max(s.width,s.height);if(a<=HC)return s.close(),{body:e,mediaType:t};const l=HC/a,c=r.createElement("canvas");c.width=Math.round(s.width*l),c.height=Math.round(s.height*l);const d=c.getContext("2d");if(!d)return s.close(),{body:e,mediaType:t};d.drawImage(s,0,0,c.width,c.height),s.close();const f=await new Promise(p=>c.toBlob(p,"image/jpeg",.85));return f?{body:f,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const MF=/^[A-Za-z0-9\-_.:]+$/,LF=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function DF(e){const t=[],n=/\S+/g;let r;for(;(r=n.exec(e))!==null;){const s=r[0],a=s[0]==="@"?"file":s[0]==="/"?"command":void 0;if(!a)continue;let l=r.index+s.length;for(;l>r.index&&LF.has(e[l-1]);)l--;const c=e.slice(r.index+1,l);c&&(a==="command"&&!MF.test(c)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}class ro extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class jF{sessionId;#t;#n;#r;#e=new Map;#s;#u=!1;#o=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#n={reconnect:!0,...r},this.#s=r.afterSeq??0,this.#c=setTimeout(()=>this.#d(),0)}get lastSeq(){return this.#s}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}send(t,n){this.#a({type:"user_message",text:t,attachmentIds:n?.length?n:void 0})}approve(t,n){this.#a({type:"permission_decision",requestId:t,behavior:"allow",updatedInput:n})}deny(t,n,r){this.#a({type:"permission_decision",requestId:t,behavior:"deny",message:n,interrupt:r})}interrupt(){this.#a({type:"interrupt"})}setPermissionMode(t){this.#a({type:"set_permission_mode",mode:t})}setModel(t){this.#a({type:"set_model",model:t})}sendToolCallResult(t,n,r){this.#a({type:"tool_call_result",executionId:t,output:n,logs:r})}sendToolCallError(t,n,r,s){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:s})}closeSession(){this.#a({type:"close"}),this.detach()}reconnectNow(){this.#u||this.#r&&this.#r.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#d())}detach(){this.#u=!0,clearTimeout(this.#c),this.#r?.close(),this.#r=void 0}#l(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#r&&this.#r.readyState===1?this.#r.send(n):this.#i.push(n)}#d(){if(this.#u)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#r=t,t.onopen=()=>{this.#o=0,this.#l("connectionChange",!0);for(const n of this.#i.splice(0))t.send(n)},t.onmessage=n=>{const r=JSON.parse(String(n.data));if(r.type==="attached")this.#l("attached",r);else if(r.type==="event"){if(r.event.seq<=this.#s)return;this.#s=r.event.seq,this.#l("event",r.event)}else r.type==="tool_call_request"?this.#l("toolCallRequest",r):r.type==="tool_call_canceled"?this.#l("toolCallCanceled",{executionId:r.executionId,reason:r.reason}):r.type==="protocol_error"&&this.#l("protocolError",r.message)},t.onclose=()=>{if(this.#l("connectionChange",!1),this.#u||!this.#n.reconnect)return;const n=Math.min(500*2**this.#o++,1e4);this.#l("reconnectAttempt",this.#o),this.#c=setTimeout(()=>this.#d(),n)},t.onerror=()=>{}}}class PF{#t;#n;#r;#e=new Map;#s=!1;#u=0;#o;constructor(t,n={}){this.#t=t,this.#n=n.reconnect??!0,this.#o=setTimeout(()=>this.#c(),0)}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}detach(){this.#s=!0,clearTimeout(this.#o),this.#r?.close(),this.#r=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#r=t,t.onopen=()=>{this.#u=0,this.#i("connectionChange",!0)},t.onmessage=n=>{const r=JSON.parse(String(n.data));r.type==="queue_attached"?(this.#i("attached",r.stats),this.#i("stats",r.stats)):r.type==="job_event"?this.#i("event",r.event):r.type==="queue_stats"&&this.#i("stats",r.stats)},t.onclose=()=>{if(this.#i("connectionChange",!1),this.#s||!this.#n)return;const n=Math.min(500*2**this.#u++,1e4);this.#o=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class BF{#t;#n;#r;constructor(t){this.#t=t,this.#n=t.fetchImpl??fetch.bind(globalThis),this.#r=t.WebSocketImpl??WebSocket}async createSession(t){return(await this.#e("POST","/sessions",t)).session}async listSessions(){return(await this.#e("GET","/sessions")).sessions}async getSession(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}`)).session}async updateSession(t,n){return(await this.#e("PATCH",`/sessions/${encodeURIComponent(t)}`,n)).session}async deleteSession(t){return(await this.#e("DELETE",`/sessions/${encodeURIComponent(t)}`)).session}async listSessionFiles(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/files`)).files}async fetchSessionFile(t,n){const r=await this.#n(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const s=await r.json().catch(()=>({}));throw new ro(s.error??`GET file failed with ${r.status}`,r.status)}return await r.text()}async uploadAttachment(t,n){const r=`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments?name=${encodeURIComponent(n.name)}`,s=await this.#n(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!s.ok){const a=await s.json().catch(()=>({}));throw new ro(a.error??`upload failed with ${s.status}`,s.status)}return(await s.json()).attachment}attachmentUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`}producedFileUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/produced/${encodeURIComponent(n)}`}async readProducedFile(t,n){const r=await this.#n(this.producedFileUrl(t,n),{headers:{...this.#t.headers}});if(!r.ok){const s=await r.json().catch(()=>({}));throw new ro(s.error??`produced file request failed with ${r.status}`,r.status)}return await r.blob()}async listMcpServers(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/mcp`)).servers}async mcpServerAction(t,n,r){return(await this.#e("POST",`/sessions/${encodeURIComponent(t)}/mcp/${encodeURIComponent(n)}`,{action:r})).servers}sessionFileUrl(t,n){const r=n.split("/").filter(Boolean).map(encodeURIComponent).join("/");return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/files/${r}`}async resolvePermission(t,n,r){await this.#e("POST",`/sessions/${encodeURIComponent(t)}/permissions/${encodeURIComponent(n)}`,r)}async submitExecutionResult(t,n){return await this.#e("POST",`/executions/${encodeURIComponent(t)}/result`,n)}async listProfiles(){return await this.#e("GET","/profiles")}async getProfile(t){return await this.#e("GET",`/profiles/${encodeURIComponent(t)}`)}async createProfile(t){return(await this.#e("POST","/profiles",t)).profile}async updateProfile(t,n){return(await this.#e("PATCH",`/profiles/${encodeURIComponent(t)}`,n)).profile}async deleteProfile(t){await this.#e("DELETE",`/profiles/${encodeURIComponent(t)}`)}async listSdkSessions(t){const n=new URLSearchParams;t?.dir&&n.set("dir",t.dir),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&n.set("offset",String(t.offset)),t?.profile&&n.set("profile",t.profile);const r=n.size>0?`?${n.toString()}`:"";return(await this.#e("GET",`/sdk-sessions${r}`)).sdkSessions}async listHostRoots(){return await this.#e("GET","/fs/roots")}async listHostDir(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/list${n}`)}async findHostFiles(t,n="",r){const s=new URLSearchParams({path:t,q:n});return r!==void 0&&s.set("limit",String(r)),await this.#e("GET",`/fs/find?${s.toString()}`)}async readHostFile(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/read${n}`)}async writeHostFile(t){return await this.#e("PUT","/fs/write",t)}async createJob(t){return(await this.#e("POST","/jobs",t)).job}async listJobs(){return(await this.#e("GET","/jobs")).jobs}async getJob(t){return(await this.#e("GET",`/jobs/${encodeURIComponent(t)}`)).job}async cancelJob(t){return(await this.#e("DELETE",`/jobs/${encodeURIComponent(t)}`)).job}async queueStats(){return(await this.#e("GET","/queue")).stats}attach(t,n){return new jF(this,t,n)}attachQueue(t){return new PF(this,t)}openSocket(t,n){const r=this.#t.buildWsUrl?.(t,n)??`${this.#t.baseUrl.replace(/^http/,"ws")}/sessions/${encodeURIComponent(t)}/ws?afterSeq=${n}`;return new this.#r(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#r(t)}async#e(t,n,r){const s=await this.#n(`${this.#t.baseUrl}${n}`,{method:t,headers:{...r!==void 0?{"content-type":"application/json"}:{},...this.#t.headers},body:r!==void 0?JSON.stringify(r):void 0}),a=await s.json().catch(()=>({}));if(!s.ok)throw new ro(a.error??`${t} ${n} failed with ${s.status}`,s.status);return a}}function zF(e,t,n){const r=[],s=(a,l)=>{const c=t.get(a);if(c)for(const d of c.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const f=n.has(d.path),p=t.get(d.path);r.push({entry:d,depth:l,expanded:f,loading:f&&!p,truncated:f?p?.truncated:void 0}),f&&p&&s(d.path,l+1)}};return s(e,0),r}function HF(e,t){const n=e.endsWith("/")?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];const r=t.slice(n.length+1).split("/"),s=[];let a=n;for(const l of r.slice(0,-1))a=`${a}/${l}`,s.push(a);return s}function UA(e,t){const[n,r]=y.useState(!1),s=y.useRef(t);y.useEffect(()=>{s.current!==t&&(s.current=t,r(!1))},[t]);const a=y.useCallback(async(l,c)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,c?.limit??8);return c?.signal?.aborted?[]:d.matches}catch(d){return d instanceof ro&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function UF(e){const[t,n]=y.useState({available:!1,canWrite:!1});return y.useEffect(()=>{let r=!1;return e.listHostRoots().then(s=>{r||n({available:!0,canWrite:s.canWrite})}).catch(()=>{r||n({available:!1,canWrite:!1})}),()=>{r=!0}},[e]),t}function FF(e,t){const[n,r]=y.useState(()=>new Map),[s,a]=y.useState(()=>new Set),[l,c]=y.useState(!1),[d,f]=y.useState(),p=y.useRef(t);y.useEffect(()=>{p.current!==t&&(p.current=t,r(new Map),a(new Set),c(!1),f(void 0))},[t]);const m=y.useRef(!0);y.useEffect(()=>(m.current=!0,()=>{m.current=!1}),[]);const b=y.useRef(new Set),x=y.useCallback((N,{force:_=!1}={})=>{l||!_&&b.current.has(N)||(b.current.add(N),e.listHostDir(N).then(R=>{m.current&&r(I=>{const A=new Map(I);return A.set(N,{entries:R.entries,truncated:R.truncated}),A})}).catch(R=>{if(m.current){if(b.current.delete(N),R instanceof ro&&R.status===404){c(!0);return}f(R instanceof Error?R.message:"Could not read that directory")}}))},[e,l]);y.useEffect(()=>{t&&x(t)},[t,x]);const v=y.useCallback(N=>{a(_=>{const R=new Set(_);return R.has(N)?R.delete(N):R.add(N),R}),x(N)},[x]),k=y.useCallback(N=>{if(!t)return;const _=HF(t,N);if(_.length!==0){for(const R of _)x(R);a(R=>{const I=new Set(R);for(const A of _)I.add(A);return I})}},[t,x]),C=y.useCallback(N=>{const _=N??t;_&&(f(void 0),x(_,{force:!0}))},[t,x]),S=y.useMemo(()=>t?zF(t,n,s):[],[t,n,s]);return{available:!!t&&!l,root:t,rows:S,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:v,reveal:k,refresh:C}}function FA(e,t){const[n,r]=y.useState(),[s,a]=y.useState(!!t),[l,c]=y.useState();return y.useEffect(()=>{if(!t){r(void 0),a(!1),c(void 0);return}let d=!1;return a(!0),c(void 0),r(void 0),e.getSession(t).then(f=>{d||(r(f),a(!1))}).catch(f=>{d||(c(f instanceof Error?f.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:s,error:l}}function Zc(e){return e.draft!==void 0&&e.draft!==e.content}function h1(e){return e.draft??e.content??""}const $A={files:[]};function $F(e,t){switch(t.type){case"open":{if(e.files.some(r=>r.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};const n={path:t.path,name:UC(t.path),status:"loading"};return{files:[...e.files,n],activePath:t.path}}case"close":{const n=e.files.findIndex(a=>a.path===t.path);if(n===-1)return e;const r=e.files.filter(a=>a.path!==t.path);if(e.activePath!==t.path)return{...e,files:r};const s=r[n]??r[n-1];return{files:r,activePath:s?.path}}case"closeAll":return $A;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return Ji(e,t.path,()=>({path:t.path,name:UC(t.path),status:t.encoding==="utf8"?"ready":"binary",content:t.encoding==="utf8"?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case"failed":return Ji(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return Ji(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return Ji(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return Ji(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return Ji(e,t.path,n=>({...n,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:n.draft===t.content?void 0:n.draft}));case"saveFailed":return Ji(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return Ji(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function Ji(e,t,n){const r=e.files.findIndex(c=>c.path===t);if(r===-1)return e;const s=e.files[r],a=n(s);if(a===s)return e;const l=e.files.slice();return l[r]=a,{...e,files:l}}function UC(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function VF(e){const[t,n]=y.useReducer($F,$A),r=y.useRef(new Set),s=y.useRef(!0);y.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]);const a=y.useRef(t);y.useEffect(()=>{a.current=t},[t]);const c=t.files.filter(A=>A.status==="loading").map(A=>A.path).join(`
537
+ `),d=y.useCallback(A=>e.readHostFile(A).then(L=>{if(s.current)return n({type:"loaded",path:A,content:L.content,encoding:L.encoding,bytes:L.bytes,hash:L.hash,modifiedAt:L.modifiedAt}),L}),[e]);y.useEffect(()=>{for(const A of c?c.split(`
538
+ `):[])r.current.has(A)||(r.current.add(A),d(A).catch(L=>{s.current&&n({type:"failed",path:A,error:L instanceof Error?L.message:"Could not read that file"})}))},[d,c]);const f=y.useCallback(A=>n({type:"open",path:A}),[]),p=y.useCallback(A=>{r.current.delete(A),n({type:"close",path:A})},[]),m=y.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=y.useCallback(A=>n({type:"activate",path:A}),[]),x=y.useCallback((A,L)=>n({type:"edit",path:A,content:L}),[]),v=y.useCallback(A=>n({type:"revert",path:A}),[]),k=y.useCallback(A=>n({type:"dismissConflict",path:A}),[]),C=y.useCallback(A=>{r.current.add(A),d(A).catch(L=>{s.current&&n({type:"failed",path:A,error:L instanceof Error?L.message:"Could not re-read that file"})})},[d]),S=y.useCallback(async(A,L,D)=>{try{const U=await e.writeHostFile({path:A,content:L,expectedHash:D});if(!s.current)return;n({type:"saved",path:A,content:L,bytes:U.bytes,hash:U.hash,modifiedAt:U.modifiedAt})}catch(U){if(!s.current)return;const z=U instanceof ro&&U.status===409;n({type:"saveFailed",path:A,conflict:z,error:z?"This file changed on disk since you opened it.":U instanceof Error?U.message:"Could not save that file"})}},[e]),N=y.useCallback(async A=>{const L=a.current.files.find(D=>D.path===A);!L||L.saving||!Zc(L)||(n({type:"saveStart",path:A}),await S(A,h1(L),L.hash))},[S]),_=y.useCallback(async A=>{const L=a.current.files.find(U=>U.path===A);if(!L||L.saving)return;const D=h1(L);n({type:"saveStart",path:A});try{const U=await e.readHostFile(A);if(!s.current)return;await S(A,D,U.hash)}catch(U){if(!s.current)return;n({type:"saveFailed",path:A,error:U instanceof Error?U.message:"Could not save that file"})}},[e,S]),R=y.useMemo(()=>t.files.find(A=>A.path===t.activePath),[t.files,t.activePath]),I=y.useMemo(()=>t.files.some(Zc),[t.files]);return{...t,active:R,hasUnsaved:I,open:f,close:p,closeAll:m,activate:b,edit:x,save:N,revert:v,reload:C,overwrite:_,dismissConflict:k}}const qF="modulepreload",YF=function(e){return"/"+e},FC={},Kl=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=l(n.map(f=>{if(f=YF(f),f in FC)return;FC[f]=!0;const p=f.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":qF,p||(b.as="script"),b.crossOrigin="",b.href=f,d&&b.setAttribute("nonce",d),document.head.appendChild(b),p)return new Promise((x,v)=>{b.addEventListener("load",x),b.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};function GF(e,t={}){const n=new Map;let r,s=!1;const a=p=>t.onExecution?.(p),l=(p,m,b,x)=>{e.sendToolCallError(p.executionId,m,b),a({executionId:p.executionId,toolName:p.toolName,status:"failed",reason:m,startedAt:x,endedAt:Date.now()})},c=async p=>{const m=Date.now();if(!(t.tools??["eval_script"]).includes(p.toolName)){l(p,"unsupported_tool",`this client does not execute '${p.toolName}'`,m);return}const x=p.input?.script;if(typeof x!="string"){l(p,"invalid_input","expected a string `script` input",m);return}const v=new AbortController;n.set(p.executionId,v),a({executionId:p.executionId,toolName:p.toolName,status:"running",startedAt:m});try{const k=await Kl(()=>import("./index-DtGYZOMX.js"),[]),C=k.createVfs(p.vfsSeed),S=Math.min(p.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),N=Math.min(p.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),_=t.execute?await t.execute({script:x,vfs:C,timeoutMs:S,memoryLimitBytes:N,signal:v.signal}):await(async()=>(r??=(t.loadEngine??KF)(),k.runScript(await r,{script:x,vfs:C,timeoutMs:S,memoryLimitBytes:N,signal:v.signal,fetchText:t.fetchText})))();if(s||!n.has(p.executionId))return;const R=_.logs.map(I=>`[${I.level}] ${I.text}`);_.ok?(e.sendToolCallResult(p.executionId,{type:"json",value:_.value},R),a({executionId:p.executionId,toolName:p.toolName,status:"settled",startedAt:m,endedAt:Date.now()})):(e.sendToolCallError(p.executionId,_.reason,_.error,R),a({executionId:p.executionId,toolName:p.toolName,status:"failed",reason:_.reason,startedAt:m,endedAt:Date.now()}))}catch(k){if(s||!n.has(p.executionId))return;l(p,"host_error",k instanceof Error?k.message:String(k),m)}finally{n.delete(p.executionId)}},d=e.on("toolCallRequest",p=>void c(p)),f=e.on("toolCallCanceled",({executionId:p,reason:m})=>{const b=n.get(p);b&&(b.abort(),n.delete(p),a({executionId:p,toolName:"",status:"canceled",reason:m,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{s=!0,d(),f();for(const p of n.values())p.abort();n.clear()}}}async function KF(){const[e,t]=await Promise.all([Kl(()=>import("./index-DtGYZOMX.js"),[]),Kl(()=>import("./index-tf9F3QXQ.js"),[])]);return e.loadEngine(t)}function XF(e,t={}){const[n,r]=y.useState([]),s=y.useRef(t);return s.current=t,y.useEffect(()=>{if(!e||t.enabled===!1)return;const a=GF(e,{get tools(){return s.current.tools},get timeoutMs(){return s.current.timeoutMs},get memoryLimitBytes(){return s.current.memoryLimitBytes},get loadEngine(){return s.current.loadEngine},get execute(){return s.current.execute},get fetchText(){return s.current.fetchText},onExecution:l=>{s.current.onExecution?.(l);const c=s.current.historyLimit??50;r(d=>[...d.filter(f=>f.executionId!==l.executionId),l].slice(-c))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function WF(e,t){const n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),s=new Map;let a=0,l=0,c=0,d=0,f=0;for(const b of r)switch(b.kind){case"turn_result":a+=1,b.isError&&(f+=1);break;case"assistant_text":l+=1;break;case"tool_call":c+=1,s.set(b.name,(s.get(b.name)??0)+1),(b.status==="failed"||b.result?.isError)&&(f+=1);break;case"file_delivered":d+=1;break;case"notice":b.level==="error"&&(f+=1);break}const p=[...s.entries()].sort((b,x)=>x[1]-b[1]||b[0].localeCompare(x[0])).map(([b])=>b),m=e.pendingApprovals?.length??0;return{turns:a,replies:l,tools:c,toolNames:p,files:d,errors:f,pending:m,any:a+l+c+d+f+m>0}}function QF(e){if(!e.any)return;const t=[];if(e.turns>0?t.push(Sl(e.turns,"turn")):e.replies>0&&t.push(Sl(e.replies,"reply","replies")),e.tools>0){const n=e.toolNames.slice(0,3).join(", "),r=e.toolNames.length-3;t.push(`${Sl(e.tools,"tool call")}${n?` (${n}${r>0?`, +${r}`:""})`:""}`)}return e.files>0&&t.push(Sl(e.files,"file")),e.errors>0&&t.push(Sl(e.errors,"error")),e.pending>0&&t.push(`${Sl(e.pending,"approval")} waiting`),t.join(" · ")}function Sl(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function bo(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function m1(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function us(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function xo(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function p1(e,t=Date.now()){const n=e-t;if(n<=0)return"now";const r=Math.ceil(n/6e4);if(r<1)return"<1m";if(r<60)return`${r}m`;const s=Math.floor(r/1440);return s>=1?`${s}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function cd(e,t=Date.now()){if(!e)return"—";const n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return"just now";const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function ZF(e){if(e==="five_hour")return"5-hour session";if(e==="seven_day")return"Weekly";if(e==="seven_day_oauth_apps")return"Weekly · apps";const t=n=>n.replace(/\b\w/g,r=>r.toUpperCase());return e.startsWith("seven_day_")?`Weekly · ${t(e.slice(10).replaceAll("_"," "))}`:t(e.replaceAll("_"," "))}function JF(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function e$(e,t=Date.now()){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?"":"s"} ago`;if(n<3600){const s=Math.floor(n/60);return`${s} min${s===1?"":"s"} ago`}const r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}function g1(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,s=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof s=="string")return s.length>t?s.slice(0,t-1)+"…":s}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const t$=e=>e.replace(/\s*\(MCP\)$/i,"");function VA(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function $C(e,t){const n=e.toLowerCase(),r=t.map(s=>s.toLowerCase());return r.some(s=>s.startsWith(n))?2:r.some(s=>s.includes(n))?1:0}function n$({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:s="Message the agent…",commands:a,skills:l,onSearchFiles:c,attachments:d,toolbar:f,layout:p="stacked",className:m,ref:b}){const x=p==="inline",{bind:v,plainText:k,isEmpty:C,clear:S,focus:N}=eF(),_=y.useRef(null),[R,I]=y.useState(!1);y.useImperativeHandle(b,()=>({insertText:B=>{const G=k.length>0&&!/\s$/.test(k)?" ":"";v.ref.current?.appendText(G+B),N()},focus:N}),[v.ref,k,N]);const A=y.useMemo(()=>{const B=[],G=(l??[]).filter(X=>X.enabled);if(a&&a.length>0){const X=new Set,ae=a.flatMap(M=>{const P=t$(M.name);return X.has(P)?[]:(X.add(P),[{...M,name:P}])});B.push(jC({onSearch:M=>{const P=[];for(const $ of ae){const j=$C(M,[$.name,...$.aliases??[],...$.name.split(":")]);j!==0&&P.push({score:j,suggestion:{value:$.name,label:`/${$.name}${$.argumentHint?` ${$.argumentHint}`:""}`,description:$.description}})}return P.sort(($,j)=>j.score-$.score),P.map(({suggestion:$})=>$)},onSelect:M=>M.value,chipClassName:"font-mono"}))}return G.length>0&&B.push(jC({char:"$",accessibilityLabel:"skill",onSearch:X=>{const ae=[];for(const M of G){const P=$C(X,[M.name,...M.name.split(/[-:_]/)]);if(P===0)continue;const $=M.shortDescription??M.description;ae.push({score:P,suggestion:{value:M.name,label:M.displayName??M.name,description:$?`Skill · ${$}`:"Skill · inserts a message you can edit",icon:h.jsx(Hm,{className:"size-3.5 text-fg-3"})}})}return ae.sort((M,P)=>P.score-M.score),ae.map(({suggestion:M})=>M)},insertAsText:X=>{const ae=G.find(M=>M.name===X.value);return ae?VA(ae):`$${X.value} `}})),c&&B.push(tF({searchDebounceMs:150,onSearch:async(X,ae)=>(await c(X,ae)).map(P=>({value:P.relative,label:P.relative,description:P.path})),onSelect:X=>X.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),B.length>0?B:void 0},[a,l,c]),L=d?.items??[],D=!r&&(!C||L.length>0)&&!d?.uploading&&!d?.hasFailure,U=()=>{D&&(e(k.trim(),d?.readyIds??[]),d?.clear(),S(),N())},z=B=>{B&&B.length>0&&d?.add(B)},K=d&&!d.disabled?h.jsx("input",{ref:_,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:B=>{z(B.target.files),B.target.value=""}}):null,J=!!d&&!d.disabled?h.jsxs(h.Fragment,{children:[K,x?h.jsx(VC,{label:"Attach files",disabled:r,onClick:()=>_.current?.click(),children:"+"}):h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>_.current?.click(),children:h.jsx(sB,{className:"size-4"})})]}):null,te=n&&!D,V=x?h.jsx(VC,{label:te?"Interrupt":"Send",disabled:!te&&!D,onClick:te?t:U,className:te?"text-warning":D?"text-accent":void 0,children:te?"■":"↵"}):te?h.jsx(rt,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:h.jsx(zB,{className:"size-3"})}):h.jsx(rt,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!D,onClick:U,children:h.jsx(K9,{className:"size-4"})});return h.jsxs("div",{"data-slot":"composer",className:Se("px-3 pb-3",m),children:[h.jsxs("div",{onDragOver:B=>{d&&!d.disabled&&(B.preventDefault(),I(!0))},onDragLeave:()=>I(!1),onDrop:B=>{!d||d.disabled||(B.preventDefault(),I(!1),z(B.dataTransfer.files))},className:Se("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] overflow-hidden rounded-lg border border-border bg-bg shadow-(--shadow-xs)","transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",R&&"border-ring ring-2 ring-ring/30",r&&"opacity-60"),children:[L.length>0&&d?h.jsx(r$,{attachments:d}):null,x?h.jsxs("div",{className:"flex items-end gap-1 p-1",children:[J,h.jsx(DC,{...v,triggers:A,onSubmit:U,disabled:r,placeholder:r?"Session ended":s,minHeight:20,maxHeight:192,"aria-label":"Message the agent",className:"min-w-0 flex-1 py-0.5 text-body-sm text-text",onImagePaste:B=>d?.add([B])}),V]}):h.jsxs(h.Fragment,{children:[h.jsx(DC,{...v,triggers:A,onSubmit:U,disabled:r,placeholder:r?"Session ended":s,minHeight:28,maxHeight:192,"aria-label":"Message the agent",className:"px-3 pt-2.5 pb-1 text-body-sm text-text",onImagePaste:B=>d?.add([B])}),h.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[J,f]}),V]})]})]}),d?.error?h.jsxs("div",{className:"mx-auto mt-1 flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-danger",children:[h.jsx(Bl,{className:"size-3 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1",children:d.error}),h.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:h.jsx(js,{className:"size-3"})})]}):h.jsx("div",{"data-slot":"composer-hint",className:"mx-auto mt-1 w-full max-w-[var(--wd-content-max-w,48rem)] text-center text-label text-fg-4",children:"Enter to send · Shift+Enter for a new line"})]})}function VC({label:e,disabled:t,onClick:n,className:r,children:s}){return h.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:Se("flex size-6 shrink-0 items-center justify-center rounded-sm font-mono text-body-sm leading-none","text-fg-3 transition-colors outline-none select-none","hover:bg-surface-hover hover:text-fg-1 focus-visible:bg-surface-hover focus-visible:text-fg-1","active:bg-accent-bg disabled:pointer-events-none disabled:opacity-40",r),children:s})}function r$({attachments:e}){return h.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-border px-2 py-2",children:e.items.map(t=>h.jsx(s$,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function s$({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed";return h.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${xo(e.bytes)}`,children:[h.jsx("div",{className:Se("flex size-14 items-center justify-center overflow-hidden rounded-md border border-border bg-surface",r&&"border-danger/50"),children:e.previewUrl?h.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):h.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[h.jsx(Jx,{className:"size-4"}),h.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:i$(e.name)})]})}),e.status==="uploading"?h.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/35",children:h.jsx(kn,{className:"size-4 text-white"})}):null,r?h.jsx("button",{type:"button",onClick:t,"aria-label":`Retry ${e.name}`,className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/45 text-warning",children:h.jsx(ey,{className:"size-4"})}):null,h.jsx("button",{type:"button",onClick:n,"aria-label":`Remove ${e.name}`,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full border border-border bg-surface text-fg-3 shadow-(--shadow-xs) hover:text-fg-1",children:h.jsx(js,{className:"size-2.5"})})]})}const i$=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},a$=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,o$=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function l$({usage:e,open:t,onOpenChange:n}){return h.jsx(Ao,{open:t,onOpenChange:n,children:h.jsxs(Ro,{children:[h.jsx(Oo,{title:"Context",description:e?.model}),h.jsx(Io,{children:e?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[h.jsx("span",{className:"text-label text-fg-3",children:"Used"}),h.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[us(e.totalTokens)," / ",us(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),h.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:h.jsx("div",{className:Se("h-full rounded-full",o$(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?h.jsxs("div",{className:"mt-5",children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),h.jsx("div",{className:"mt-2 flex flex-col gap-3",children:e.categories.map(r=>{const s=r.tokens/Math.max(e.maxTokens,1)*100,a=a$(r.color);return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),h.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),h.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:us(r.tokens)})]}),h.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:h.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,s)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No reading yet — the context window is measured after a turn completes."})})]})})}function u$({client:e,cwd:t,open:n,onOpenChange:r}){const[s,a]=y.useState(t),[l,c]=y.useState([]),[d,f]=y.useState(!1),[p,m]=y.useState(""),[b,x]=y.useState(),[v,k]=y.useState(),[C,S]=y.useState(!1),[N,_]=y.useState(),R=y.useCallback(async D=>{S(!0),_(void 0);try{const U=await e.listHostDir(D);a(U.path),c(U.entries),f(U.truncated??!1)}catch(U){_(U instanceof Error?U.message:"Could not read that directory")}finally{S(!1)}},[e]);y.useEffect(()=>{n&&(k(void 0),m(""),x(void 0),_(void 0),t&&R(t))},[n,t,R]),y.useEffect(()=>{if(!n||!t)return;const D=p.trim();if(!D){x(void 0);return}const U=setTimeout(()=>{e.findHostFiles(t,D,40).then(z=>x(z.matches)).catch(()=>x([]))},150);return()=>clearTimeout(U)},[e,t,p,n]);const I=async D=>{S(!0),_(void 0);try{const U=await e.readHostFile(D);k({path:U.path,bytes:U.bytes,content:U.encoding==="utf8"?U.content:"(binary file — not shown)"})}catch(U){_(U instanceof Error?U.message:"Could not read that file")}finally{S(!1)}},A=s&&t&&s!==t?s.slice(0,s.lastIndexOf("/"))||"/":void 0,L=b??l;return h.jsx(Ao,{open:n,onOpenChange:r,children:h.jsxs(Ro,{size:"lg",children:[h.jsx(Oo,{title:v?v.path.split("/").pop():"Files",description:v?v.path:s,actions:v?h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>k(void 0),children:[h.jsx(qh,{className:"size-3.5"}),"Back"]}):A?h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>void R(A),children:[h.jsx(qh,{className:"size-3.5"}),"Up"]}):null}),h.jsxs(Io,{className:"flex flex-col gap-3",children:[N?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:N}):null,v?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-label text-fg-4",children:xo(v.bytes)}),h.jsx(yA,{code:v.content,label:v.path.split("/").pop()})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"relative",children:[h.jsx(zm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),h.jsx(sn,{value:p,onChange:D=>m(D.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),C&&L.length===0?h.jsx("div",{className:"py-6 text-center",children:h.jsx(kn,{className:"size-4 text-fg-4"})}):L.length===0?h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):h.jsx("ul",{className:"flex flex-col",children:b?b.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>void I(D.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[h.jsx(jm,{className:"size-3.5 shrink-0 text-fg-4"}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:D.relative})]})},D.path)):l.map(D=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>D.type==="dir"?void R(D.path):void I(D.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[h.jsx(c$,{type:D.type}),h.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[D.name,D.type==="dir"?"/":""]}),D.bytes!==void 0?h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:xo(D.bytes)}):null]})},D.path))}),d&&!b?h.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function c$({type:e}){return e==="dir"?h.jsx(V_,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?h.jsx(Y_,{className:"size-3.5 shrink-0 text-fg-4"}):h.jsx(jm,{className:"size-3.5 shrink-0 text-fg-4"})}const qA={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function d$({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:s=!0}){const[a,l]=y.useState(),[c,d]=y.useState(),[f,p]=y.useState(!1),[m,b]=y.useState(),[x,v]=y.useState(),[k,C]=y.useState(),S=y.useCallback(async()=>{if(t){p(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(A){d(A instanceof Error?A.message:"Could not read MCP status")}finally{p(!1)}}},[e,t]);y.useEffect(()=>{n&&(v(void 0),C(void 0),S())},[n,S]);const N=async(A,L)=>{if(t){b(A),d(void 0);try{l(await e.mcpServerAction(t,A,L))}catch(D){d(D instanceof Error?D.message:`Could not ${L} ${A}`)}finally{b(void 0)}}},_=a?.find(A=>A.name===x),R=_?.tools?.find(A=>A.name===k),I=R?.name??_?.name??"MCP servers";return h.jsx(Ao,{open:n,onOpenChange:r,children:h.jsxs(Ro,{children:[h.jsx(Oo,{title:I,description:R?`${_?.name} tool`:_?_.serverInfo?.name:void 0,actions:x?h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>k?C(void 0):v(void 0),children:[h.jsx(qh,{className:"size-3.5"}),"Back"]}):h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>void S(),disabled:f,children:[f?h.jsx(kn,{className:"size-3 text-current"}):h.jsx(ey,{className:"size-3"}),"Refresh"]})}),h.jsxs(Io,{children:[c?h.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:c}):null,R?h.jsx(m$,{tool:R}):_?h.jsx(h$,{server:_,busy:m===_.name,canManage:s,onAct:A=>void N(_.name,A),onSelectTool:C}):c&&!a?null:h.jsx(f$,{servers:a,loading:f,onSelect:v})]})]})})}function f$({servers:e,loading:t,onSelect:n}){if(t&&!e)return h.jsx("div",{className:"py-6 text-center",children:h.jsx(kn,{className:"size-4 text-fg-4"})});if(!e?.length)return h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No MCP servers configured for this session."});const r=[...new Set(e.map(s=>s.scope??"other"))];return h.jsx("div",{className:"flex flex-col gap-4",children:r.map(s=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:s}),h.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===s).map(a=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>n(a.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?h.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,h.jsx(pn,{variant:qA[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),h.jsx(Dm,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},s))})}function h$({server:e,busy:t,canManage:n,onAct:r,onSelectTool:s}){const a=e.status==="disabled";return h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx(ir,{label:"Status",children:h.jsx(pn,{variant:qA[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?h.jsx(ir,{label:"Transport",children:e.transport}):null,e.scope?h.jsx(ir,{label:"Scope",children:e.scope}):null,e.serverInfo?h.jsxs(ir,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?h.jsx(ir,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?h.jsx(ir,{label:"URL",mono:!0,children:e.url}):null]}),e.error?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(rt,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?h.jsx(kn,{className:"size-3 text-current"}):h.jsx(ey,{className:"size-3"}),"Reconnect"]}),h.jsxs(rt,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?h.jsx(pB,{className:"size-3"}):h.jsx(hB,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?h.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>s(l.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),h.jsx(Dm,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):h.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:e.status==="connected"?"This server exposes no tools.":"Tools are listed once the server connects."})]})]})}function m$({tool:e}){const t=e.annotations;return h.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?h.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):h.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?h.jsx(pn,{variant:"success",children:"read-only"}):null,t.destructive?h.jsx(pn,{variant:"danger",children:"destructive"}):null,t.openWorld?h.jsx(pn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),h.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:p$(e.inputSchema)})]}):h.jsx("p",{className:Se("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function p$(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const YA={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function g$({skills:e,open:t,onOpenChange:n,onUse:r}){const[s,a]=y.useState(),l=e?.find(c=>c.name===s);return h.jsx(Ao,{open:t,onOpenChange:c=>{c||a(void 0),n(c)},children:h.jsxs(Ro,{children:[h.jsx(Oo,{title:l?l.displayName??l.name:"Skills",description:l?l.name!==(l.displayName??l.name)?l.name:void 0:"Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.",actions:l?h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[h.jsx(qh,{className:"size-3.5"}),"Back"]}):void 0}),h.jsx(Io,{children:l?h.jsx(x$,{skill:l,onUse:r,onUsed:()=>n(!1)}):h.jsx(b$,{skills:e,onSelect:a})})]})})}function b$({skills:e,onSelect:t}){if(!e)return h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"Skills are listed once the session connects — send a message first."});if(e.length===0)return h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"This session found no skills."});const n=[...new Set(e.map(r=>r.scope??"other"))];return h.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:YA[r]??r}),h.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(s=>(s.scope??"other")===r).map(s=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>t(s.name),className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:s.displayName??s.name}),s.shortDescription??s.description?h.jsx("span",{className:"block truncate text-label text-fg-4",children:s.shortDescription??s.description}):null]}),s.enabled?null:h.jsx(pn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),h.jsx(Dm,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},s.name))})]},r))})}function x$({skill:e,onUse:t,onUsed:n}){return h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[e.scope?h.jsx(ir,{label:"Scope",children:YA[e.scope]??e.scope}):null,h.jsx(ir,{label:"Status",children:h.jsx(pn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?h.jsxs("div",{children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),h.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):h.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?h.jsxs("div",{children:[h.jsx(rt,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),h.jsx("p",{className:"mt-1.5 text-label text-fg-4",children:"Writes an opening message into the composer for you to edit — it isn’t sent, and there is no command that runs a skill directly."})]}):null]})}const b1=e=>e==="default",nb=e=>e.replace(/\[.*\]$/,"");function qC(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function y$(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=nb(t);if(e.resolvedModel)return n===nb(e.resolvedModel);const r=qC(n);return r!==""&&r===qC(nb(e.value))}function E$(e,t){if(t)return e.filter(n=>!b1(n.value)).find(n=>y$(n,t))}function GA({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:s,className:a}){const l=E$(e,t)??(t?void 0:e.find(c=>b1(c.value)));return h.jsxs(Bs,{items:e.map(c=>({value:c.value,label:c.displayName})),value:l?.value??null,onValueChange:c=>{typeof c!="string"||c===l?.value||n(b1(c)?void 0:c)},disabled:s,children:[h.jsx(Hs,{"aria-label":"Model",className:Se(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:h.jsx("span",{className:Se("truncate",r==="toolbar"&&"font-mono text-label"),children:h.jsx(zs,{placeholder:t??"model"})})}),h.jsx(Us,{className:"min-w-72",children:e.map(c=>h.jsxs(xs,{value:c.value,children:[h.jsx(bs,{children:h.jsx("span",{className:"font-medium",children:c.displayName})}),c.description?h.jsx("span",{className:"text-label text-fg-4",children:c.description}):null]},c.value))})]})}const Xl=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:q_},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:Zx},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:f7},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:ez},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:_B},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:Bl,dangerous:!0}],v$=e=>Xl.find(t=>t.value===e);function T$(e,t){return(e?Xl.filter(r=>e.includes(r.value)):Xl).map(r=>({value:r.value,label:r.label,description:r.value==="bypassPermissions"&&t===!1?"Only available to a session started in this mode":r.description,dangerous:r.dangerous,disabled:r.value==="bypassPermissions"&&t===!1}))}function qm({mode:e,onModeChange:t,modes:n,canBypass:r,variant:s="toolbar",disabled:a,className:l}){const c=e==="bypassPermissions",d=n?Xl.filter(p=>n.includes(p.value)):Xl,f=p=>p.value==="bypassPermissions"&&r===!1;return h.jsxs(Bs,{items:d.map(p=>({value:p.value,label:p.label})),value:e??null,onValueChange:p=>{typeof p=="string"&&p!==e&&t(p)},disabled:a,children:[h.jsx(Hs,{"aria-label":"Permission mode",className:Se(s==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",c?"text-danger":s==="toolbar"?"text-fg-3":void 0,l),children:h.jsx("span",{className:Se("truncate",s==="toolbar"&&"text-label"),children:h.jsx(zs,{placeholder:"permissions"})})}),h.jsx(Us,{className:"min-w-64",children:d.map(p=>{const m=f(p);return h.jsxs(xs,{value:p.value,disabled:m,children:[h.jsx(bs,{children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(p.icon,{className:Se("size-3.5 shrink-0",p.dangerous?"text-danger":"text-fg-3")}),h.jsx("span",{className:Se("font-medium",p.dangerous&&"text-danger"),children:p.label})]})}),h.jsx("span",{className:Se("pl-5.5 text-label",m?"text-fg-4":p.dangerous?"text-danger/80":"text-fg-4"),children:m?"Only available to a session started in this mode":p.description})]},p.value)})})]})}function KA(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return a1;case"Read":return Jx;case"Write":return MB;case"Edit":case"MultiEdit":case"NotebookEdit":return aB;case"Glob":return I7;case"Grep":return zm;case"WebFetch":return c7;case"WebSearch":return yC;case"Task":case"Agent":return Q_;case"TodoWrite":return OB;case"Skill":return Hm;case"AskUserQuestion":return K_;case"CodexCommand":return a1;case"CodexFileChange":return T7;case"CodexWebSearch":return yC;case"CodexImageGeneration":case"CodexImageView":return $7;default:return e.startsWith("mcp__")?bB:QB}}function S$(e){switch(e){case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":case"Update":case"CodexFileChange":return!0;default:return!1}}const Ym=(function(e){if(e==null)return N$;if(typeof e=="function")return Gm(e);if(typeof e=="object")return Array.isArray(e)?C$(e):w$(e);if(typeof e=="string")return k$(e);throw new Error("Expected function, string, or object as test")});function C$(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ym(e[n]);return Gm(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function w$(e){const t=e;return Gm(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function k$(e){return Gm(t);function t(n){return n&&n.type===e}}function Gm(e){return t;function t(n,r,s){return!!(_$(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function N$(){return!0}function _$(e){return e!==null&&typeof e=="object"&&"type"in e}const XA=[],Cc=!0,x1=!1,Il="skip";function ay(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Ym(s),l=r?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=XA,v,k,C;if((!t||a(d,f,p[p.length-1]||void 0))&&(x=A$(n(d,p)),x[0]===x1))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==Il)for(k=(r?S.children.length:-1)+l,C=p.concat(S);k>-1&&k<S.children.length;){const N=S.children[k];if(v=c(N,k,C)(),v[0]===x1)return v;k=typeof v[1]=="number"?v[1]:k+l}}return x}}}function A$(e){return Array.isArray(e)?e:typeof e=="number"?[Cc,e]:e==null?XA:[e]}function Ps(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),ay(e,a,c,s);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const Wl={indicator:"indicator",textOnly:"text-only",remove:"remove"};function R$({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:l="text-gray-500",linkBlockPolicy:c=Wl.indicator,imageBlockPolicy:d=Wl.indicator}){const f=t.length&&!t.every(m=>m==="*"),p=n.length&&!n.every(m=>m==="*");if(!e&&(f||p))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return m=>{const b=j$(e,t,n,r,s,a,l,c,d);WA(m),Ps(m,b)}}function YC(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function O$(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const I$=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),M$=new Set(["javascript:","data:","file:","vbscript:"]);function GC(e,t,n,r=!1,s=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const p=e.substring(5);if(p&&p.length>0&&p!=="invalid")return e}}catch{return null}return null}const l=YC(e,n);if(!l||M$.has(l.protocol)||!(I$.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=O$(e);return l&&t.some(f=>{const p=YC(f,n);return!p||p.origin!==l.origin?!1:l.href.startsWith(p.href)})?d?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:d?l.pathname+l.search+l.hash:l.href:null}function WA(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)WA(t)}}const rb=Symbol("node-seen");function L$(e,t,n){return t===Wl.remove?{type:"remove"}:t===Wl.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function D$(e,t,n){if(t===Wl.remove)return{type:"remove"};if(t===Wl.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const j$=(e,t,n,r,s,a,l,c,d)=>{const f=(p,m,b)=>{if(p.type!=="element"||p[rb])return Cc;if(p.tagName==="a"){const x=GC(p.properties.href,t,e,!1,!1,s);if(x===null){if(p[rb]=!0,Ps(p,f),b&&typeof m=="number"){const v=L$(p,c,l);if(v.type==="remove")return b.children.splice(m,1),[Il,m];b.children[m]=v.element}return Il}else return p.properties.href=x,p.properties.target="_blank",p.properties.rel="noopener noreferrer",Cc}if(p.tagName==="img"){const x=GC(p.properties.src,n,e,r,!0,s);if(x===null){if(p[rb]=!0,Ps(p,f),b&&typeof m=="number"){const v=D$(p,d,a);if(v.type==="remove")return b.children.splice(m,1),[Il,m];b.children[m]=v.element}return Il}else return p.properties.src=x,Cc}return Cc};return f},QA=-1,Km=0,Ic=1,Zh=2,oy=3,ly=4,uy=5,cy=6,ZA=7,JA=8,eR=typeof self=="object"?self:globalThis,KC=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new eR[e](t)},P$=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Km:case QA:return n(l,s);case Ic:{const c=n([],s);for(const d of l)c.push(r(d));return c}case Zh:{const c=n({},s);for(const[d,f]of l)c[r(d)]=r(f);return c}case oy:return n(new Date(l),s);case ly:{const{source:c,flags:d}=l;return n(new RegExp(c,d),s)}case uy:{const c=n(new Map,s);for(const[d,f]of l)c.set(r(d),r(f));return c}case cy:{const c=n(new Set,s);for(const d of l)c.add(r(d));return c}case ZA:{const{name:c,message:d}=l;return n(typeof eR[c]=="function"?KC(c,d):new Error(d),s)}case JA:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(KC(a,l),s)};return r},XC=e=>P$(new Map,e)(0),Wa="",{toString:B$}={},{keys:z$}=Object,uc=e=>{const t=typeof e;if(t!=="object"||!e)return[Km,t];const n=B$.call(e).slice(8,-1);switch(n){case"Array":return[Ic,Wa];case"Object":return[Zh,Wa];case"Date":return[oy,Wa];case"RegExp":return[ly,Wa];case"Map":return[uy,Wa];case"Set":return[cy,Wa];case"DataView":return[Ic,n]}return n.includes("Array")?[Ic,n]:e instanceof Error?[ZA,e.name||"Error"]:[Zh,n]},sh=([e,t])=>e===Km&&(t==="function"||t==="symbol"),H$=(e,t,n,r)=>{const s=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=uc(l);switch(c){case Km:{let p=l;switch(d){case"bigint":c=JA,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([QA],l)}return s([c,p],l)}case Ic:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),s([d,[...b]],l)}const p=[],m=s([c,p],l);for(const b of l)p.push(a(b));return m}case Zh:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=s([c,p],l);for(const b of z$(l))(e||!sh(uc(l[b])))&&p.push([a(b),a(l[b])]);return m}case oy:return s([c,isNaN(l.getTime())?Wa:l.toISOString()],l);case ly:{const{source:p,flags:m}=l;return s([c,{source:p,flags:m}],l)}case uy:{const p=[],m=s([c,p],l);for(const[b,x]of l)(e||!(sh(uc(b))||sh(uc(x))))&&p.push([a(b),a(x)]);return m}case cy:{const p=[],m=s([c,p],l);for(const b of l)(e||!sh(uc(b)))&&p.push(a(b));return m}}const{message:f}=l;return s([c,{name:d,message:f}],l)};return a},WC=(e,{json:t,lossy:n}={})=>{const r=[];return H$(!(t||n),!!t,new Map,r)(e),r},yo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?XC(WC(e,t)):structuredClone(e):(e,t)=>XC(WC(e,t));class dd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dd.prototype.normal={};dd.prototype.property={};dd.prototype.space=void 0;function tR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new dd(n,r,t)}function Jc(e){return e.toLowerCase()}class Lr{constructor(t,n){this.attribute=n,this.property=t}}Lr.prototype.attribute="";Lr.prototype.booleanish=!1;Lr.prototype.boolean=!1;Lr.prototype.commaOrSpaceSeparated=!1;Lr.prototype.commaSeparated=!1;Lr.prototype.defined=!1;Lr.prototype.mustUseProperty=!1;Lr.prototype.number=!1;Lr.prototype.overloadedBoolean=!1;Lr.prototype.property="";Lr.prototype.spaceSeparated=!1;Lr.prototype.space=void 0;let U$=0;const pt=Lo(),Mn=Lo(),y1=Lo(),He=Lo(),nn=Lo(),lo=Lo(),Fr=Lo();function Lo(){return 2**++U$}const E1=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Mn,commaOrSpaceSeparated:Fr,commaSeparated:lo,number:He,overloadedBoolean:y1,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),sb=Object.keys(E1);class dy extends Lr{constructor(t,n,r,s){let a=-1;if(super(t,n),QC(this,"space",s),typeof r=="number")for(;++a<sb.length;){const l=sb[a];QC(this,sb[a],(r&E1[l])===E1[l])}}}dy.prototype.defined=!0;function QC(e,t,n){n&&(e[t]=n)}function iu(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new dy(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Jc(r)]=r,n[Jc(a.attribute)]=r}return new dd(t,n,e.space)}const nR=iu({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:nn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:He,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:nn,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:Mn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rR(e,t){return t in e?e[t]:t}function sR(e,t){return rR(e,t.toLowerCase())}const F$=iu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lo,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alpha:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:nn,autoFocus:pt,autoPlay:pt,blocking:nn,capture:null,charSet:null,checked:pt,cite:null,className:nn,closedBy:null,colorSpace:null,cols:He,colSpan:He,command:null,commandFor:null,content:null,contentEditable:Mn,controls:pt,controlsList:nn,coords:He|lo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:y1,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:nn,height:He,hidden:y1,high:He,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:nn,itemRef:nn,itemScope:pt,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:pt,optimum:He,pattern:null,ping:nn,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:nn,required:pt,reversed:pt,rows:He,rowSpan:He,sandbox:nn,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootCustomElementRegistry:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shadowRootSerializable:pt,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Mn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pt,disablePictureInPicture:pt,disableRemotePlayback:pt,exportParts:lo,part:nn,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:sR}),$$=iu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Fr,accentHeight:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:lo,g2:lo,glyphName:lo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:He,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rR}),iR=iu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),aR=iu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sR}),oR=iu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),V$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},q$=/[A-Z]/g,ZC=/-[a-z]/g,Y$=/^data[-\w.:]+$/i;function Xm(e,t){const n=Jc(t);let r=t,s=Lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Y$.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ZC,K$);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ZC.test(a)){let l=a.replace(q$,G$);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=dy}return new s(r,t)}function G$(e){return"-"+e.toLowerCase()}function K$(e){return e.charAt(1).toUpperCase()}const fd=tR([nR,F$,iR,aR,oR],"html"),Sa=tR([nR,$$,iR,aR,oR],"svg");function JC(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(s,r).trim();(l||!a)&&t.push(l),s=r+1,r=n.indexOf(",",s)}return t}function lR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ew=/[#.]/g;function X$(e,t){const n=e||"",r={};let s=0,a,l;for(;s<n.length;){ew.lastIndex=s;const c=ew.exec(n),d=n.slice(s,c?c.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,s+=d.length),c&&(a=c[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function tw(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function uR(e){return e.join(" ").trim()}function cR(e,t,n){const r=n?J$(n):void 0;function s(a,l,...c){let d;if(a==null){d={type:"root",children:[]};const f=l;c.unshift(f)}else{d=X$(a,t);const f=d.tagName.toLowerCase(),p=r?r.get(f):void 0;if(d.tagName=p||f,W$(l))c.unshift(l);else for(const[m,b]of Object.entries(l))Q$(e,d.properties,m,b)}for(const f of c)v1(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function W$(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const l of a)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Q$(e,t,n,r){const s=Xm(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=tw(r):s.commaSeparated?a=JC(r):s.commaOrSpaceSeparated?a=tw(JC(r).join(" ")):a=nw(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?Z$(r):String(r);if(Array.isArray(a)){const l=[];for(const c of a)l.push(nw(s,s.property,c));a=l}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function v1(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)v1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?v1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function nw(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Jc(n)===Jc(t)))return!0}return n}function Z$(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function J$(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const eV=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],tV=cR(fd,"div"),nV=cR(Sa,"g",eV);function rV(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=rw(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>a)return{line:l+1,column:a-(l>0?n[l-1]:0)+1,offset:a};l++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const c=n[n.length-1],d=rw(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function rw(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
539
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const so={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},dR={}.hasOwnProperty,sV=Object.prototype;function iV(e,t){const n=t||{};return fy({file:n.file||void 0,location:!1,schema:n.space==="svg"?Sa:fd,verbose:n.verbose||!1},e)}function fy(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Ch(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:fR(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),l=rV(a),c=l.toPoint(0),d=l.toPoint(a.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Ch(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Ch(e,r,n),n}default:return n=aV(e,t),n}}function fR(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=fy(e,t[n]);r.push(s)}return r}function aV(e,t){const n=e.schema;e.schema=t.namespaceURI===so.svg?Sa:fd;let r=-1;const s={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;dR.call(sV,d)||(s[d]=c.value)}const l=(e.schema.space==="svg"?nV:tV)(t.tagName,s,fR(e,t.childNodes));if(Ch(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Ml(d.startTag),p=d&&d.endTag&&Ml(d.endTag),m=fy(e,c.content);f&&p&&e.file&&(m.position={start:f.end,end:p.start}),l.content=m}return e.schema=n,l}function Ch(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=oV(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function oV(e,t,n){const r=Ml(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let l;if(n.attrs)for(l in n.attrs)dR.call(n.attrs,l)&&(a[Xm(e.schema,l).property]=Ml(n.attrs[l]));n.startTag;const c=Ml(n.startTag),d=n.endTag?Ml(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function Ml(e){const t=sw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=sw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function sw(e){return e.line&&e.column?e:void 0}const iw={}.hasOwnProperty;function hR(e,t){const n=t||{};function r(s,...a){let l=r.invalid;const c=r.handlers;if(s&&iw.call(s,e)){const d=String(s[e]);l=iw.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const lV={},uV={}.hasOwnProperty,mR=hR("type",{handlers:{root:dV,element:gV,text:mV,comment:pV,doctype:hV}});function cV(e,t){const r=(t||lV).space;return mR(e,r==="svg"?Sa:fd)}function dV(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=hy(e.children,n,t),au(e,n),n}function fV(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=hy(e.children,n,t),au(e,n),n}function hV(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return au(e,t),t}function mV(e){const t={nodeName:"#text",value:e.value,parentNode:null};return au(e,t),t}function pV(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return au(e,t),t}function gV(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Sa);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&uV.call(e.properties,a)){const d=bV(r,a,e.properties[a]);d&&s.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:so[l],childNodes:[],parentNode:null};return c.childNodes=hy(e.children,c,r),au(e,c),e.tagName==="template"&&e.content&&(c.content=fV(e.content,r)),c}function bV(e,t,n){const r=Xm(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?lR(n):uR(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=so[r.space]}return s}function hy(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=mR(e[r],n);a.parentNode=t,s.push(a)}return s}function au(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const xV=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],yV=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),hn="�";var q;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(q||(q={}));const Nr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function pR(e){return e>=55296&&e<=57343}function EV(e){return e>=56320&&e<=57343}function vV(e,t){return(e-55296)*1024+9216+t}function gR(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function bR(e){return e>=64976&&e<=65007||yV.has(e)}var ke;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ke||(ke={}));const TV=65536;class SV{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=TV,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,l=s+n,c=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(EV(n))return this.pos++,this._addGap(),vV(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,q.EOF;return this._err(ke.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,q.EOF;const r=this.html.charCodeAt(n);return r===q.CARRIAGE_RETURN?q.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,q.EOF;let t=this.html.charCodeAt(this.pos);return t===q.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,q.LINE_FEED):t===q.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,pR(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===q.LINE_FEED||t===q.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gR(t)?this._err(ke.controlCharacterInInputStream):bR(t)&&this._err(ke.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ct;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Ct||(Ct={}));function xR(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const CV=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),wV=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function kV(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wV.get(e))!==null&&t!==void 0?t:e}var Gn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Gn||(Gn={}));const NV=32;var ca;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ca||(ca={}));function T1(e){return e>=Gn.ZERO&&e<=Gn.NINE}function _V(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_F||e>=Gn.LOWER_A&&e<=Gn.LOWER_F}function AV(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_Z||e>=Gn.LOWER_A&&e<=Gn.LOWER_Z||T1(e)}function RV(e){return e===Gn.EQUALS||AV(e)}var Vn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Vn||(Vn={}));var fi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fi||(fi={}));class OV{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Vn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fi.Strict}startEntity(t){this.decodeMode=t,this.state=Vn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Vn.EntityStart:return t.charCodeAt(n)===Gn.NUM?(this.state=Vn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Vn.NamedEntity,this.stateNamedEntity(t,n));case Vn.NumericStart:return this.stateNumericStart(t,n);case Vn.NumericDecimal:return this.stateNumericDecimal(t,n);case Vn.NumericHex:return this.stateNumericHex(t,n);case Vn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|NV)===Gn.LOWER_X?(this.state=Vn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Vn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(T1(s)||_V(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(T1(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Gn.SEMI)this.consumed+=1;else if(this.decodeMode===fi.Strict)return 0;return this.emitCodePoint(kV(this.result),this.consumed),this.errors&&(t!==Gn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&ca.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=IV(r,s,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===fi.Attribute&&(a===0||RV(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ca.VALUE_LENGTH)>>14,a!==0){if(l===Gn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==fi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&ca.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~ca.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Vn.NamedEntity:return this.result!==0&&(this.decodeMode!==fi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Vn.NumericDecimal:return this.emitNumericEntity(0,2);case Vn.NumericHex:return this.emitNumericEntity(0,3);case Vn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Vn.EntityStart:return 0}}}function IV(e,t,n,r){const s=(t&ca.BRANCH_LENGTH)>>7,a=t&ca.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let l=n,c=l+s-1;for(;l<=c;){const d=l+c>>>1,f=e[d];if(f<r)l=d+1;else if(f>r)c=d-1;else return e[d+s]}return-1}var Le;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Le||(Le={}));var uo;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(uo||(uo={}));var is;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(is||(is={}));var pe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(pe||(pe={}));var w;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(w||(w={}));const MV=new Map([[pe.A,w.A],[pe.ADDRESS,w.ADDRESS],[pe.ANNOTATION_XML,w.ANNOTATION_XML],[pe.APPLET,w.APPLET],[pe.AREA,w.AREA],[pe.ARTICLE,w.ARTICLE],[pe.ASIDE,w.ASIDE],[pe.B,w.B],[pe.BASE,w.BASE],[pe.BASEFONT,w.BASEFONT],[pe.BGSOUND,w.BGSOUND],[pe.BIG,w.BIG],[pe.BLOCKQUOTE,w.BLOCKQUOTE],[pe.BODY,w.BODY],[pe.BR,w.BR],[pe.BUTTON,w.BUTTON],[pe.CAPTION,w.CAPTION],[pe.CENTER,w.CENTER],[pe.CODE,w.CODE],[pe.COL,w.COL],[pe.COLGROUP,w.COLGROUP],[pe.DD,w.DD],[pe.DESC,w.DESC],[pe.DETAILS,w.DETAILS],[pe.DIALOG,w.DIALOG],[pe.DIR,w.DIR],[pe.DIV,w.DIV],[pe.DL,w.DL],[pe.DT,w.DT],[pe.EM,w.EM],[pe.EMBED,w.EMBED],[pe.FIELDSET,w.FIELDSET],[pe.FIGCAPTION,w.FIGCAPTION],[pe.FIGURE,w.FIGURE],[pe.FONT,w.FONT],[pe.FOOTER,w.FOOTER],[pe.FOREIGN_OBJECT,w.FOREIGN_OBJECT],[pe.FORM,w.FORM],[pe.FRAME,w.FRAME],[pe.FRAMESET,w.FRAMESET],[pe.H1,w.H1],[pe.H2,w.H2],[pe.H3,w.H3],[pe.H4,w.H4],[pe.H5,w.H5],[pe.H6,w.H6],[pe.HEAD,w.HEAD],[pe.HEADER,w.HEADER],[pe.HGROUP,w.HGROUP],[pe.HR,w.HR],[pe.HTML,w.HTML],[pe.I,w.I],[pe.IMG,w.IMG],[pe.IMAGE,w.IMAGE],[pe.INPUT,w.INPUT],[pe.IFRAME,w.IFRAME],[pe.KEYGEN,w.KEYGEN],[pe.LABEL,w.LABEL],[pe.LI,w.LI],[pe.LINK,w.LINK],[pe.LISTING,w.LISTING],[pe.MAIN,w.MAIN],[pe.MALIGNMARK,w.MALIGNMARK],[pe.MARQUEE,w.MARQUEE],[pe.MATH,w.MATH],[pe.MENU,w.MENU],[pe.META,w.META],[pe.MGLYPH,w.MGLYPH],[pe.MI,w.MI],[pe.MO,w.MO],[pe.MN,w.MN],[pe.MS,w.MS],[pe.MTEXT,w.MTEXT],[pe.NAV,w.NAV],[pe.NOBR,w.NOBR],[pe.NOFRAMES,w.NOFRAMES],[pe.NOEMBED,w.NOEMBED],[pe.NOSCRIPT,w.NOSCRIPT],[pe.OBJECT,w.OBJECT],[pe.OL,w.OL],[pe.OPTGROUP,w.OPTGROUP],[pe.OPTION,w.OPTION],[pe.P,w.P],[pe.PARAM,w.PARAM],[pe.PLAINTEXT,w.PLAINTEXT],[pe.PRE,w.PRE],[pe.RB,w.RB],[pe.RP,w.RP],[pe.RT,w.RT],[pe.RTC,w.RTC],[pe.RUBY,w.RUBY],[pe.S,w.S],[pe.SCRIPT,w.SCRIPT],[pe.SEARCH,w.SEARCH],[pe.SECTION,w.SECTION],[pe.SELECT,w.SELECT],[pe.SOURCE,w.SOURCE],[pe.SMALL,w.SMALL],[pe.SPAN,w.SPAN],[pe.STRIKE,w.STRIKE],[pe.STRONG,w.STRONG],[pe.STYLE,w.STYLE],[pe.SUB,w.SUB],[pe.SUMMARY,w.SUMMARY],[pe.SUP,w.SUP],[pe.TABLE,w.TABLE],[pe.TBODY,w.TBODY],[pe.TEMPLATE,w.TEMPLATE],[pe.TEXTAREA,w.TEXTAREA],[pe.TFOOT,w.TFOOT],[pe.TD,w.TD],[pe.TH,w.TH],[pe.THEAD,w.THEAD],[pe.TITLE,w.TITLE],[pe.TR,w.TR],[pe.TRACK,w.TRACK],[pe.TT,w.TT],[pe.U,w.U],[pe.UL,w.UL],[pe.SVG,w.SVG],[pe.VAR,w.VAR],[pe.WBR,w.WBR],[pe.XMP,w.XMP]]);function ou(e){var t;return(t=MV.get(e))!==null&&t!==void 0?t:w.UNKNOWN}const Pe=w,LV={[Le.HTML]:new Set([Pe.ADDRESS,Pe.APPLET,Pe.AREA,Pe.ARTICLE,Pe.ASIDE,Pe.BASE,Pe.BASEFONT,Pe.BGSOUND,Pe.BLOCKQUOTE,Pe.BODY,Pe.BR,Pe.BUTTON,Pe.CAPTION,Pe.CENTER,Pe.COL,Pe.COLGROUP,Pe.DD,Pe.DETAILS,Pe.DIR,Pe.DIV,Pe.DL,Pe.DT,Pe.EMBED,Pe.FIELDSET,Pe.FIGCAPTION,Pe.FIGURE,Pe.FOOTER,Pe.FORM,Pe.FRAME,Pe.FRAMESET,Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6,Pe.HEAD,Pe.HEADER,Pe.HGROUP,Pe.HR,Pe.HTML,Pe.IFRAME,Pe.IMG,Pe.INPUT,Pe.LI,Pe.LINK,Pe.LISTING,Pe.MAIN,Pe.MARQUEE,Pe.MENU,Pe.META,Pe.NAV,Pe.NOEMBED,Pe.NOFRAMES,Pe.NOSCRIPT,Pe.OBJECT,Pe.OL,Pe.P,Pe.PARAM,Pe.PLAINTEXT,Pe.PRE,Pe.SCRIPT,Pe.SECTION,Pe.SELECT,Pe.SOURCE,Pe.STYLE,Pe.SUMMARY,Pe.TABLE,Pe.TBODY,Pe.TD,Pe.TEMPLATE,Pe.TEXTAREA,Pe.TFOOT,Pe.TH,Pe.THEAD,Pe.TITLE,Pe.TR,Pe.TRACK,Pe.UL,Pe.WBR,Pe.XMP]),[Le.MATHML]:new Set([Pe.MI,Pe.MO,Pe.MN,Pe.MS,Pe.MTEXT,Pe.ANNOTATION_XML]),[Le.SVG]:new Set([Pe.TITLE,Pe.FOREIGN_OBJECT,Pe.DESC]),[Le.XLINK]:new Set,[Le.XML]:new Set,[Le.XMLNS]:new Set},S1=new Set([Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6]);pe.STYLE,pe.SCRIPT,pe.XMP,pe.IFRAME,pe.NOEMBED,pe.NOFRAMES,pe.PLAINTEXT;var Z;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Z||(Z={}));const wn={DATA:Z.DATA,RCDATA:Z.RCDATA,RAWTEXT:Z.RAWTEXT,SCRIPT_DATA:Z.SCRIPT_DATA,PLAINTEXT:Z.PLAINTEXT,CDATA_SECTION:Z.CDATA_SECTION};function DV(e){return e>=q.DIGIT_0&&e<=q.DIGIT_9}function wc(e){return e>=q.LATIN_CAPITAL_A&&e<=q.LATIN_CAPITAL_Z}function jV(e){return e>=q.LATIN_SMALL_A&&e<=q.LATIN_SMALL_Z}function ra(e){return jV(e)||wc(e)}function aw(e){return ra(e)||DV(e)}function ih(e){return e+32}function yR(e){return e===q.SPACE||e===q.LINE_FEED||e===q.TABULATION||e===q.FORM_FEED}function ow(e){return yR(e)||e===q.SOLIDUS||e===q.GREATER_THAN_SIGN}function PV(e){return e===q.NULL?ke.nullCharacterReference:e>1114111?ke.characterReferenceOutsideUnicodeRange:pR(e)?ke.surrogateCharacterReference:bR(e)?ke.noncharacterCharacterReference:gR(e)||e===q.CARRIAGE_RETURN?ke.controlCharacterReference:null}class BV{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Z.DATA,this.returnState=Z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new SV(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new OV(CV,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ke.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ke.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=PV(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ct.START_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ct.END_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Ct.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Ct.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(xR(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ke.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=ou(t.tagName),t.type===Ct.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ke.endTagWithAttributes),t.selfClosing&&this._err(ke.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ct.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ct.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ct.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ct.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=yR(t)?Ct.WHITESPACE_CHARACTER:t===q.NULL?Ct.NULL_CHARACTER:Ct.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ct.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fi.Attribute:fi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Z.DATA:{this._stateData(t);break}case Z.RCDATA:{this._stateRcdata(t);break}case Z.RAWTEXT:{this._stateRawtext(t);break}case Z.SCRIPT_DATA:{this._stateScriptData(t);break}case Z.PLAINTEXT:{this._statePlaintext(t);break}case Z.TAG_OPEN:{this._stateTagOpen(t);break}case Z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Z.TAG_NAME:{this._stateTagName(t);break}case Z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Z.COMMENT_START:{this._stateCommentStart(t);break}case Z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Z.COMMENT:{this._stateComment(t);break}case Z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Z.COMMENT_END:{this._stateCommentEnd(t);break}case Z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Z.DOCTYPE:{this._stateDoctype(t);break}case Z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Z.CDATA_SECTION:{this._stateCdataSection(t);break}case Z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case q.LESS_THAN_SIGN:{this.state=Z.TAG_OPEN;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitCodePoint(t);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case q.AMPERSAND:{this._startCharacterReference();break}case q.LESS_THAN_SIGN:{this.state=Z.RCDATA_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case q.LESS_THAN_SIGN:{this.state=Z.RAWTEXT_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ra(t))this._createStartTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case q.EXCLAMATION_MARK:{this.state=Z.MARKUP_DECLARATION_OPEN;break}case q.SOLIDUS:{this.state=Z.END_TAG_OPEN;break}case q.QUESTION_MARK:{this._err(ke.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t);break}case q.EOF:{this._err(ke.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ke.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ra(t))this._createEndTagToken(),this.state=Z.TAG_NAME,this._stateTagName(t);else switch(t){case q.GREATER_THAN_SIGN:{this._err(ke.missingEndTagName),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ke.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case q.SOLIDUS:{this.state=Z.SELF_CLOSING_START_TAG;break}case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.tagName+=hn;break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(wc(t)?ih(t):t)}}_stateRcdataLessThanSign(t){t===q.SOLIDUS?this.state=Z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ra(t)?(this.state=Z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=Z.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Z.BEFORE_ATTRIBUTE_NAME,!1;case q.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Z.SELF_CLOSING_START_TAG,!1;case q.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===q.SOLIDUS?this.state=Z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ra(t)?(this.state=Z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case q.SOLIDUS:{this.state=Z.SCRIPT_DATA_END_TAG_OPEN;break}case q.EXCLAMATION_MARK:{this.state=Z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ra(t)?(this.state=Z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===q.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===q.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=Z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case q.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case q.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case q.HYPHEN_MINUS:{this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===q.SOLIDUS?this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ra(t)?(this._emitChars("<"),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ra(t)?(this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&ow(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case q.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case q.HYPHEN_MINUS:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case q.HYPHEN_MINUS:{this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.GREATER_THAN_SIGN:{this.state=Z.SCRIPT_DATA,this._emitChars(">");break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hn);break}case q.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===q.SOLIDUS?(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Nr.SCRIPT,!1)&&ow(this.preprocessor.peek(Nr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Nr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:{this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case q.EQUALS_SIGN:{this._err(ke.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=Z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:{this._leaveAttrName(),this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case q.EQUALS_SIGN:{this._leaveAttrName(),this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:{this._err(ke.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.name+=hn;break}default:this.currentAttr.name+=String.fromCodePoint(wc(t)?ih(t):t)}}_stateAfterAttributeName(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:{this.state=Z.SELF_CLOSING_START_TAG;break}case q.EQUALS_SIGN:{this.state=Z.BEFORE_ATTRIBUTE_VALUE;break}case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:{this.state=Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this.state=Z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingAttributeValue),this.state=Z.DATA,this.emitCurrentTagToken();break}default:this.state=Z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case q.QUOTATION_MARK:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case q.APOSTROPHE:{this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=hn;break}case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:case q.EQUALS_SIGN:case q.GRAVE_ACCENT:{this._err(ke.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break}case q.SOLIDUS:{this._leaveAttrValue(),this.state=Z.SELF_CLOSING_START_TAG;break}case q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._err(ke.missingWhitespaceBetweenAttributes),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case q.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=Z.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._err(ke.unexpectedSolidusInTag),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case q.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.data+=hn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Nr.DASH_DASH,!0)?(this._createCommentToken(Nr.DASH_DASH.length+1),this.state=Z.COMMENT_START):this._consumeSequenceIfMatch(Nr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Nr.DOCTYPE.length+1),this.state=Z.DOCTYPE):this._consumeSequenceIfMatch(Nr.CDATA_START,!0)?this.inForeignNode?this.state=Z.CDATA_SECTION:(this._err(ke.cdataInHtmlContent),this._createCommentToken(Nr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=Z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ke.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case q.HYPHEN_MINUS:{this.state=Z.COMMENT_START_DASH;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptClosingOfEmptyComment),this.state=Z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptClosingOfEmptyComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case q.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=Z.COMMENT_END_DASH;break}case q.LESS_THAN_SIGN:{n.data+="<",this.state=Z.COMMENT_LESS_THAN_SIGN;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.data+=hn;break}case q.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case q.EXCLAMATION_MARK:{n.data+="!",this.state=Z.COMMENT_LESS_THAN_SIGN_BANG;break}case q.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===q.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===q.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==q.GREATER_THAN_SIGN&&t!==q.EOF&&this._err(ke.nestedComment),this.state=Z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=Z.COMMENT_END;break}case q.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentComment(n);break}case q.EXCLAMATION_MARK:{this.state=Z.COMMENT_END_BANG;break}case q.HYPHEN_MINUS:{n.data+="-";break}case q.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=Z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{n.data+="--!",this.state=Z.COMMENT_END_DASH;break}case q.GREATER_THAN_SIGN:{this._err(ke.incorrectlyClosedComment),this.state=Z.DATA,this.emitCurrentComment(n);break}case q.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=Z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case q.EOF:{this._err(ke.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingWhitespaceBeforeDoctypeName),this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(wc(t))this._createDoctypeToken(String.fromCharCode(ih(t))),this.state=Z.DOCTYPE_NAME;else switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.NULL:{this._err(ke.unexpectedNullCharacter),this._createDoctypeToken(hn),this.state=Z.DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=Z.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.AFTER_DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.name+=hn;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(wc(t)?ih(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Nr.PUBLIC,!1)?this.state=Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Nr.SYSTEM,!1)?this.state=Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ke.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.QUOTATION_MARK:{this._err(ke.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(ke.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:{n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.publicId="",this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case q.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.publicId+=hn;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case q.APOSTROPHE:{this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.publicId+=hn;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case q.GREATER_THAN_SIGN:{this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.QUOTATION_MARK:{this._err(ke.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(ke.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.QUOTATION_MARK:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.QUOTATION_MARK:{this._err(ke.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(ke.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.systemId="",this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case q.QUOTATION_MARK:{this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.systemId+=hn;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case q.APOSTROPHE:{this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.NULL:{this._err(ke.unexpectedNullCharacter),n.systemId+=hn;break}case q.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=Z.DATA;break}case q.NULL:{this._err(ke.unexpectedNullCharacter);break}case q.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case q.RIGHT_SQUARE_BRACKET:{this.state=Z.CDATA_SECTION_BRACKET;break}case q.EOF:{this._err(ke.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===q.RIGHT_SQUARE_BRACKET?this.state=Z.CDATA_SECTION_END:(this._emitChars("]"),this.state=Z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case q.GREATER_THAN_SIGN:{this.state=Z.DATA;break}case q.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=Z.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(q.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&aw(this.preprocessor.peek(1))?Z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){aw(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===q.SEMICOLON&&this._err(ke.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const ER=new Set([w.DD,w.DT,w.LI,w.OPTGROUP,w.OPTION,w.P,w.RB,w.RP,w.RT,w.RTC]),lw=new Set([...ER,w.CAPTION,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]),Jh=new Set([w.APPLET,w.CAPTION,w.HTML,w.MARQUEE,w.OBJECT,w.TABLE,w.TD,w.TEMPLATE,w.TH]),zV=new Set([...Jh,w.OL,w.UL]),HV=new Set([...Jh,w.BUTTON]),uw=new Set([w.ANNOTATION_XML,w.MI,w.MN,w.MO,w.MS,w.MTEXT]),cw=new Set([w.DESC,w.FOREIGN_OBJECT,w.TITLE]),UV=new Set([w.TR,w.TEMPLATE,w.HTML]),FV=new Set([w.TBODY,w.TFOOT,w.THEAD,w.TEMPLATE,w.HTML]),$V=new Set([w.TABLE,w.TEMPLATE,w.HTML]),VV=new Set([w.TD,w.TH]);class qV{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=w.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===w.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Le.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Le.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(S1,Le.HTML)}popUntilTableCellPopped(){this.popUntilPopped(VV,Le.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo($V,Le.HTML)}clearBackToTableBodyContext(){this.clearBackTo(FV,Le.HTML)}clearBackToTableRowContext(){this.clearBackTo(UV,Le.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===w.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===w.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Le.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Le.SVG:{if(cw.has(s))return!1;break}case Le.MATHML:{if(uw.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Jh)}hasInListItemScope(t){return this.hasInDynamicScope(t,zV)}hasInButtonScope(t){return this.hasInDynamicScope(t,HV)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Le.HTML:{if(S1.has(n))return!0;if(Jh.has(n))return!1;break}case Le.SVG:{if(cw.has(n))return!1;break}case Le.MATHML:{if(uw.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Le.HTML)switch(this.tagIDs[t]){case w.TBODY:case w.THEAD:case w.TFOOT:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.OPTION:case w.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&ER.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&lw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&lw.has(this.currentTagId);)this.pop()}}const ib=3;var Ms;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ms||(Ms={}));const dw={type:Ms.Marker};class YV{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Ms.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===l){const p=this.treeAdapter.getAttrList(f);p.length===s&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<ib)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<ib)return;const s=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=ib&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(dw)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ms.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ms.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(dw);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ms.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ms.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ms.Element&&n.element===t)}}const sa={createDocument(){return{nodeName:"#document",mode:is.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};sa.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(sa.isTextNode(n)){n.value+=t;return}}sa.appendChild(e,sa.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&sa.isTextNode(r)?r.value+=t:sa.insertBefore(e,sa.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},vR="html",GV="about:legacy-compat",KV="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",TR=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],XV=[...TR,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],WV=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),SR=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],QV=[...SR,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function fw(e,t){return t.some(n=>e.startsWith(n))}function ZV(e){return e.name===vR&&e.publicId===null&&(e.systemId===null||e.systemId===GV)}function JV(e){if(e.name!==vR)return is.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===KV)return is.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),WV.has(n))return is.QUIRKS;let r=t===null?XV:TR;if(fw(n,r))return is.QUIRKS;if(r=t===null?SR:QV,fw(n,r))return is.LIMITED_QUIRKS}return is.NO_QUIRKS}const hw={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},eq="definitionurl",tq="definitionURL",nq=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),rq=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Le.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Le.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Le.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Le.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Le.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Le.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Le.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Le.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Le.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Le.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Le.XMLNS}]]),sq=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),iq=new Set([w.B,w.BIG,w.BLOCKQUOTE,w.BODY,w.BR,w.CENTER,w.CODE,w.DD,w.DIV,w.DL,w.DT,w.EM,w.EMBED,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HR,w.I,w.IMG,w.LI,w.LISTING,w.MENU,w.META,w.NOBR,w.OL,w.P,w.PRE,w.RUBY,w.S,w.SMALL,w.SPAN,w.STRONG,w.STRIKE,w.SUB,w.SUP,w.TABLE,w.TT,w.U,w.UL,w.VAR]);function aq(e){const t=e.tagID;return t===w.FONT&&e.attrs.some(({name:r})=>r===uo.COLOR||r===uo.SIZE||r===uo.FACE)||iq.has(t)}function CR(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===eq){e.attrs[t].name=tq;break}}function wR(e){for(let t=0;t<e.attrs.length;t++){const n=nq.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function my(e){for(let t=0;t<e.attrs.length;t++){const n=rq.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function oq(e){const t=sq.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ou(e.tagName))}function lq(e,t){return t===Le.MATHML&&(e===w.MI||e===w.MO||e===w.MN||e===w.MS||e===w.MTEXT)}function uq(e,t,n){if(t===Le.MATHML&&e===w.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===uo.ENCODING){const s=n[r].value.toLowerCase();return s===hw.TEXT_HTML||s===hw.APPLICATION_XML}}return t===Le.SVG&&(e===w.FOREIGN_OBJECT||e===w.DESC||e===w.TITLE)}function cq(e,t,n,r){return(!r||r===Le.HTML)&&uq(e,t,n)||(!r||r===Le.MATHML)&&lq(e,t)}const dq="hidden",fq=8,hq=3;var ne;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(ne||(ne={}));const mq={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},kR=new Set([w.TABLE,w.TBODY,w.TFOOT,w.THEAD,w.TR]),mw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:sa,onParseError:null};class pw{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=ne.INITIAL,this.originalInsertionMode=ne.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...mw,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new BV(this.options,this),this.activeFormattingElements=new YV(this.treeAdapter),this.fragmentContextID=r?ou(this.treeAdapter.getTagName(r)):w.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new qV(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...mw,...n};t??(t=r.treeAdapter.createElement(pe.TEMPLATE,Le.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Le.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===w.TEMPLATE&&a.tmplInsertionModeStack.unshift(ne.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:mq,l={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(l)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,l;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,l=this.fragmentContextID):{current:a,currentTagId:l}=this.openElements,this._setContextModes(a,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Le.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Le.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=ne.TEXT}switchToPlaintextParsing(){this.insertionMode=ne.TEXT,this.originalInsertionMode=ne.IN_BODY,this.tokenizer.state=wn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===pe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Le.HTML))switch(this.fragmentContextID){case w.TITLE:case w.TEXTAREA:{this.tokenizer.state=wn.RCDATA;break}case w.STYLE:case w.XMP:case w.IFRAME:case w.NOEMBED:case w.NOFRAMES:case w.NOSCRIPT:{this.tokenizer.state=wn.RAWTEXT;break}case w.SCRIPT:{this.tokenizer.state=wn.SCRIPT_DATA;break}case w.PLAINTEXT:{this.tokenizer.state=wn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Le.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Le.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(pe.HTML,Le.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,w.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,l=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===Ct.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===w.SVG&&this.treeAdapter.getTagName(n)===pe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Le.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===w.MGLYPH||t.tagID===w.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Le.HTML)}_processToken(t){switch(t.type){case Ct.CHARACTER:{this.onCharacter(t);break}case Ct.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ct.COMMENT:{this.onComment(t);break}case Ct.DOCTYPE:{this.onDoctype(t);break}case Ct.START_TAG:{this._processStartTag(t);break}case Ct.END_TAG:{this.onEndTag(t);break}case Ct.EOF:{this.onEof(t);break}case Ct.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return cq(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ms.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ne.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(w.P),this.openElements.popUntilTagNamePopped(w.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case w.TR:{this.insertionMode=ne.IN_ROW;return}case w.TBODY:case w.THEAD:case w.TFOOT:{this.insertionMode=ne.IN_TABLE_BODY;return}case w.CAPTION:{this.insertionMode=ne.IN_CAPTION;return}case w.COLGROUP:{this.insertionMode=ne.IN_COLUMN_GROUP;return}case w.TABLE:{this.insertionMode=ne.IN_TABLE;return}case w.BODY:{this.insertionMode=ne.IN_BODY;return}case w.FRAMESET:{this.insertionMode=ne.IN_FRAMESET;return}case w.SELECT:{this._resetInsertionModeForSelect(t);return}case w.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case w.HTML:{this.insertionMode=this.headElement?ne.AFTER_HEAD:ne.BEFORE_HEAD;return}case w.TD:case w.TH:{if(t>0){this.insertionMode=ne.IN_CELL;return}break}case w.HEAD:{if(t>0){this.insertionMode=ne.IN_HEAD;return}break}}this.insertionMode=ne.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===w.TEMPLATE)break;if(r===w.TABLE){this.insertionMode=ne.IN_SELECT_IN_TABLE;return}}this.insertionMode=ne.IN_SELECT}_isElementCausesFosterParenting(t){return kR.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case w.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Le.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case w.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return LV[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){VY(this,t);return}switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(this,t);break}case ne.IN_BODY:case ne.IN_CAPTION:case ne.IN_CELL:case ne.IN_TEMPLATE:{_R(this,t);break}case ne.TEXT:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{ab(this,t);break}case ne.IN_TABLE_TEXT:{LR(this,t);break}case ne.IN_COLUMN_GROUP:{em(this,t);break}case ne.AFTER_BODY:{tm(this,t);break}case ne.AFTER_AFTER_BODY:{wh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$Y(this,t);return}switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(this,t);break}case ne.TEXT:{this._insertCharacters(t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{ab(this,t);break}case ne.IN_COLUMN_GROUP:{em(this,t);break}case ne.AFTER_BODY:{tm(this,t);break}case ne.AFTER_AFTER_BODY:{wh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){C1(this,t);return}switch(this.insertionMode){case ne.INITIAL:case ne.BEFORE_HTML:case ne.BEFORE_HEAD:case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:case ne.IN_BODY:case ne.IN_TABLE:case ne.IN_CAPTION:case ne.IN_COLUMN_GROUP:case ne.IN_TABLE_BODY:case ne.IN_ROW:case ne.IN_CELL:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:case ne.IN_TEMPLATE:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:{C1(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.AFTER_BODY:{vq(this,t);break}case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{Tq(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ne.INITIAL:{Sq(this,t);break}case ne.BEFORE_HEAD:case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:{this._err(t,ke.misplacedDoctype);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ke.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?qY(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Cq(this,t);break}case ne.BEFORE_HEAD:{kq(this,t);break}case ne.IN_HEAD:{ys(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{Aq(this,t);break}case ne.AFTER_HEAD:{Oq(this,t);break}case ne.IN_BODY:{ur(this,t);break}case ne.IN_TABLE:{Ql(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_CAPTION:{NY(this,t);break}case ne.IN_COLUMN_GROUP:{by(this,t);break}case ne.IN_TABLE_BODY:{Zm(this,t);break}case ne.IN_ROW:{Jm(this,t);break}case ne.IN_CELL:{RY(this,t);break}case ne.IN_SELECT:{PR(this,t);break}case ne.IN_SELECT_IN_TABLE:{IY(this,t);break}case ne.IN_TEMPLATE:{LY(this,t);break}case ne.AFTER_BODY:{jY(this,t);break}case ne.IN_FRAMESET:{PY(this,t);break}case ne.AFTER_FRAMESET:{zY(this,t);break}case ne.AFTER_AFTER_BODY:{UY(this,t);break}case ne.AFTER_AFTER_FRAMESET:{FY(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?YY(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{wq(this,t);break}case ne.BEFORE_HEAD:{Nq(this,t);break}case ne.IN_HEAD:{_q(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{Rq(this,t);break}case ne.AFTER_HEAD:{Iq(this,t);break}case ne.IN_BODY:{Qm(this,t);break}case ne.TEXT:{bY(this,t);break}case ne.IN_TABLE:{ed(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_CAPTION:{_Y(this,t);break}case ne.IN_COLUMN_GROUP:{AY(this,t);break}case ne.IN_TABLE_BODY:{w1(this,t);break}case ne.IN_ROW:{jR(this,t);break}case ne.IN_CELL:{OY(this,t);break}case ne.IN_SELECT:{BR(this,t);break}case ne.IN_SELECT_IN_TABLE:{MY(this,t);break}case ne.IN_TEMPLATE:{DY(this,t);break}case ne.AFTER_BODY:{HR(this,t);break}case ne.IN_FRAMESET:{BY(this,t);break}case ne.AFTER_FRAMESET:{HY(this,t);break}case ne.AFTER_AFTER_BODY:{wh(this,t);break}}}onEof(t){switch(this.insertionMode){case ne.INITIAL:{cc(this,t);break}case ne.BEFORE_HTML:{Mc(this,t);break}case ne.BEFORE_HEAD:{Lc(this,t);break}case ne.IN_HEAD:{Dc(this,t);break}case ne.IN_HEAD_NO_SCRIPT:{jc(this,t);break}case ne.AFTER_HEAD:{Pc(this,t);break}case ne.IN_BODY:case ne.IN_TABLE:case ne.IN_CAPTION:case ne.IN_COLUMN_GROUP:case ne.IN_TABLE_BODY:case ne.IN_ROW:case ne.IN_CELL:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:{IR(this,t);break}case ne.TEXT:{xY(this,t);break}case ne.IN_TABLE_TEXT:{dc(this,t);break}case ne.IN_TEMPLATE:{zR(this,t);break}case ne.AFTER_BODY:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{gy(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===q.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case ne.IN_HEAD:case ne.IN_HEAD_NO_SCRIPT:case ne.AFTER_HEAD:case ne.TEXT:case ne.IN_COLUMN_GROUP:case ne.IN_SELECT:case ne.IN_SELECT_IN_TABLE:case ne.IN_FRAMESET:case ne.AFTER_FRAMESET:{this._insertCharacters(t);break}case ne.IN_BODY:case ne.IN_CAPTION:case ne.IN_CELL:case ne.IN_TEMPLATE:case ne.AFTER_BODY:case ne.AFTER_AFTER_BODY:case ne.AFTER_AFTER_FRAMESET:{NR(this,t);break}case ne.IN_TABLE:case ne.IN_TABLE_BODY:case ne.IN_ROW:{ab(this,t);break}case ne.IN_TABLE_TEXT:{MR(this,t);break}}}}function pq(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):OR(e,t),n}function gq(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function bq(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,l=s;l!==n;a++,l=s){s=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&a>=hq;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=xq(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function xq(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function yq(e,t,n){const r=e.treeAdapter.getTagName(t),s=ou(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===w.TEMPLATE&&a===Le.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Eq(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function py(e,t){for(let n=0;n<fq;n++){const r=pq(e,t);if(!r)break;const s=gq(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=bq(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&yq(e,l,a),Eq(e,s,r)}}function C1(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function vq(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Tq(e,t){e._appendCommentNode(t,e.document)}function gy(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(a);l&&!l.endTag&&e._setEndLocation(a,t)}}}}function Sq(e,t){e._setDocumentType(t);const n=t.forceQuirks?is.QUIRKS:JV(t);ZV(t)||e._err(t,ke.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ne.BEFORE_HTML}function cc(e,t){e._err(t,ke.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,is.QUIRKS),e.insertionMode=ne.BEFORE_HTML,e._processToken(t)}function Cq(e,t){t.tagID===w.HTML?(e._insertElement(t,Le.HTML),e.insertionMode=ne.BEFORE_HEAD):Mc(e,t)}function wq(e,t){const n=t.tagID;(n===w.HTML||n===w.HEAD||n===w.BODY||n===w.BR)&&Mc(e,t)}function Mc(e,t){e._insertFakeRootElement(),e.insertionMode=ne.BEFORE_HEAD,e._processToken(t)}function kq(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.HEAD:{e._insertElement(t,Le.HTML),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD;break}default:Lc(e,t)}}function Nq(e,t){const n=t.tagID;n===w.HEAD||n===w.BODY||n===w.HTML||n===w.BR?Lc(e,t):e._err(t,ke.endTagWithoutMatchingOpenElement)}function Lc(e,t){e._insertFakeElement(pe.HEAD,w.HEAD),e.headElement=e.openElements.current,e.insertionMode=ne.IN_HEAD,e._processToken(t)}function ys(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TITLE:{e._switchToTextParsing(t,wn.RCDATA);break}case w.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,wn.RAWTEXT):(e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_HEAD_NO_SCRIPT);break}case w.NOFRAMES:case w.STYLE:{e._switchToTextParsing(t,wn.RAWTEXT);break}case w.SCRIPT:{e._switchToTextParsing(t,wn.SCRIPT_DATA);break}case w.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ne.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ne.IN_TEMPLATE);break}case w.HEAD:{e._err(t,ke.misplacedStartTagForHeadElement);break}default:Dc(e,t)}}function _q(e,t){switch(t.tagID){case w.HEAD:{e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD;break}case w.BODY:case w.BR:case w.HTML:{Dc(e,t);break}case w.TEMPLATE:{Do(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function Do(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==w.TEMPLATE&&e._err(t,ke.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ke.endTagWithoutMatchingOpenElement)}function Dc(e,t){e.openElements.pop(),e.insertionMode=ne.AFTER_HEAD,e._processToken(t)}function Aq(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.BASEFONT:case w.BGSOUND:case w.HEAD:case w.LINK:case w.META:case w.NOFRAMES:case w.STYLE:{ys(e,t);break}case w.NOSCRIPT:{e._err(t,ke.nestedNoscriptInHead);break}default:jc(e,t)}}function Rq(e,t){switch(t.tagID){case w.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ne.IN_HEAD;break}case w.BR:{jc(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function jc(e,t){const n=t.type===Ct.EOF?ke.openElementsLeftAfterEof:ke.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ne.IN_HEAD,e._processToken(t)}function Oq(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.BODY:{e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_BODY;break}case w.FRAMESET:{e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_FRAMESET;break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{e._err(t,ke.abandonedHeadElementChild),e.openElements.push(e.headElement,w.HEAD),ys(e,t),e.openElements.remove(e.headElement);break}case w.HEAD:{e._err(t,ke.misplacedStartTagForHeadElement);break}default:Pc(e,t)}}function Iq(e,t){switch(t.tagID){case w.BODY:case w.HTML:case w.BR:{Pc(e,t);break}case w.TEMPLATE:{Do(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function Pc(e,t){e._insertFakeElement(pe.BODY,w.BODY),e.insertionMode=ne.IN_BODY,Wm(e,t)}function Wm(e,t){switch(t.type){case Ct.CHARACTER:{_R(e,t);break}case Ct.WHITESPACE_CHARACTER:{NR(e,t);break}case Ct.COMMENT:{C1(e,t);break}case Ct.START_TAG:{ur(e,t);break}case Ct.END_TAG:{Qm(e,t);break}case Ct.EOF:{IR(e,t);break}}}function NR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _R(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Mq(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Lq(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Dq(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_FRAMESET)}function jq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function Pq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&S1.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Le.HTML)}function Bq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function zq(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),n||(e.formElement=e.openElements.current))}function Hq(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===w.LI&&s===w.LI||(n===w.DD||n===w.DT)&&(s===w.DD||s===w.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==w.ADDRESS&&s!==w.DIV&&s!==w.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function Uq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.tokenizer.state=wn.PLAINTEXT}function Fq(e,t){e.openElements.hasInScope(w.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1}function $q(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(pe.A);n&&(py(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Vq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function qq(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(w.NOBR)&&(py(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Yq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Gq(e,t){e.treeAdapter.getDocumentMode(e.document)!==is.QUIRKS&&e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=ne.IN_TABLE}function AR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function RR(e){const t=xR(e,uo.TYPE);return t!=null&&t.toLowerCase()===dq}function Kq(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),RR(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Xq(e,t){e._appendElement(t,Le.HTML),t.ackSelfClosing=!0}function Wq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Qq(e,t){t.tagName=pe.IMG,t.tagID=w.IMG,AR(e,t)}function Zq(e,t){e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.tokenizer.state=wn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ne.TEXT}function Jq(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,wn.RAWTEXT)}function eY(e,t){e.framesetOk=!1,e._switchToTextParsing(t,wn.RAWTEXT)}function gw(e,t){e._switchToTextParsing(t,wn.RAWTEXT)}function tY(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===ne.IN_TABLE||e.insertionMode===ne.IN_CAPTION||e.insertionMode===ne.IN_TABLE_BODY||e.insertionMode===ne.IN_ROW||e.insertionMode===ne.IN_CELL?ne.IN_SELECT_IN_TABLE:ne.IN_SELECT}function nY(e,t){e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function rY(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Le.HTML)}function sY(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(w.RTC),e._insertElement(t,Le.HTML)}function iY(e,t){e._reconstructActiveFormattingElements(),CR(t),my(t),t.selfClosing?e._appendElement(t,Le.MATHML):e._insertElement(t,Le.MATHML),t.ackSelfClosing=!0}function aY(e,t){e._reconstructActiveFormattingElements(),wR(t),my(t),t.selfClosing?e._appendElement(t,Le.SVG):e._insertElement(t,Le.SVG),t.ackSelfClosing=!0}function bw(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function ur(e,t){switch(t.tagID){case w.I:case w.S:case w.B:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.SMALL:case w.STRIKE:case w.STRONG:{Vq(e,t);break}case w.A:{$q(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{Pq(e,t);break}case w.P:case w.DL:case w.OL:case w.UL:case w.DIV:case w.DIR:case w.NAV:case w.MAIN:case w.MENU:case w.ASIDE:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.DETAILS:case w.ADDRESS:case w.ARTICLE:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{jq(e,t);break}case w.LI:case w.DD:case w.DT:{Hq(e,t);break}case w.BR:case w.IMG:case w.WBR:case w.AREA:case w.EMBED:case w.KEYGEN:{AR(e,t);break}case w.HR:{Wq(e,t);break}case w.RB:case w.RTC:{rY(e,t);break}case w.RT:case w.RP:{sY(e,t);break}case w.PRE:case w.LISTING:{Bq(e,t);break}case w.XMP:{Jq(e,t);break}case w.SVG:{aY(e,t);break}case w.HTML:{Mq(e,t);break}case w.BASE:case w.LINK:case w.META:case w.STYLE:case w.TITLE:case w.SCRIPT:case w.BGSOUND:case w.BASEFONT:case w.TEMPLATE:{ys(e,t);break}case w.BODY:{Lq(e,t);break}case w.FORM:{zq(e,t);break}case w.NOBR:{qq(e,t);break}case w.MATH:{iY(e,t);break}case w.TABLE:{Gq(e,t);break}case w.INPUT:{Kq(e,t);break}case w.PARAM:case w.TRACK:case w.SOURCE:{Xq(e,t);break}case w.IMAGE:{Qq(e,t);break}case w.BUTTON:{Fq(e,t);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{Yq(e,t);break}case w.IFRAME:{eY(e,t);break}case w.SELECT:{tY(e,t);break}case w.OPTION:case w.OPTGROUP:{nY(e,t);break}case w.NOEMBED:case w.NOFRAMES:{gw(e,t);break}case w.FRAMESET:{Dq(e,t);break}case w.TEXTAREA:{Zq(e,t);break}case w.NOSCRIPT:{e.options.scriptingEnabled?gw(e,t):bw(e,t);break}case w.PLAINTEXT:{Uq(e,t);break}case w.COL:case w.TH:case w.TD:case w.TR:case w.HEAD:case w.FRAME:case w.TBODY:case w.TFOOT:case w.THEAD:case w.CAPTION:case w.COLGROUP:break;default:bw(e,t)}}function oY(e,t){if(e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ne.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function lY(e,t){e.openElements.hasInScope(w.BODY)&&(e.insertionMode=ne.AFTER_BODY,HR(e,t))}function uY(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function cY(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(w.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(w.FORM):n&&e.openElements.remove(n))}function dY(e){e.openElements.hasInButtonScope(w.P)||e._insertFakeElement(pe.P,w.P),e._closePElement()}function fY(e){e.openElements.hasInListItemScope(w.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(w.LI),e.openElements.popUntilTagNamePopped(w.LI))}function hY(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function mY(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function pY(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function gY(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(pe.BR,w.BR),e.openElements.pop(),e.framesetOk=!1}function OR(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],l=e.openElements.tagIDs[s];if(r===l&&(r!==w.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,l))break}}function Qm(e,t){switch(t.tagID){case w.A:case w.B:case w.I:case w.S:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.NOBR:case w.SMALL:case w.STRIKE:case w.STRONG:{py(e,t);break}case w.P:{dY(e);break}case w.DL:case w.UL:case w.OL:case w.DIR:case w.DIV:case w.NAV:case w.PRE:case w.MAIN:case w.MENU:case w.ASIDE:case w.BUTTON:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.ADDRESS:case w.ARTICLE:case w.DETAILS:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.LISTING:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{uY(e,t);break}case w.LI:{fY(e);break}case w.DD:case w.DT:{hY(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{mY(e);break}case w.BR:{gY(e);break}case w.BODY:{oY(e,t);break}case w.HTML:{lY(e,t);break}case w.FORM:{cY(e);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{pY(e,t);break}case w.TEMPLATE:{Do(e,t);break}default:OR(e,t)}}function IR(e,t){e.tmplInsertionModeStack.length>0?zR(e,t):gy(e,t)}function bY(e,t){var n;t.tagID===w.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function xY(e,t){e._err(t,ke.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ab(e,t){if(e.openElements.currentTagId!==void 0&&kR.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=ne.IN_TABLE_TEXT,t.type){case Ct.CHARACTER:{LR(e,t);break}case Ct.WHITESPACE_CHARACTER:{MR(e,t);break}}else hd(e,t)}function yY(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_CAPTION}function EY(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_COLUMN_GROUP}function vY(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.COLGROUP,w.COLGROUP),e.insertionMode=ne.IN_COLUMN_GROUP,by(e,t)}function TY(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_TABLE_BODY}function SY(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.TBODY,w.TBODY),e.insertionMode=ne.IN_TABLE_BODY,Zm(e,t)}function CY(e,t){e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function wY(e,t){RR(t)?e._appendElement(t,Le.HTML):hd(e,t),t.ackSelfClosing=!0}function kY(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Le.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ql(e,t){switch(t.tagID){case w.TD:case w.TH:case w.TR:{SY(e,t);break}case w.STYLE:case w.SCRIPT:case w.TEMPLATE:{ys(e,t);break}case w.COL:{vY(e,t);break}case w.FORM:{kY(e,t);break}case w.TABLE:{CY(e,t);break}case w.TBODY:case w.TFOOT:case w.THEAD:{TY(e,t);break}case w.INPUT:{wY(e,t);break}case w.CAPTION:{yY(e,t);break}case w.COLGROUP:{EY(e,t);break}default:hd(e,t)}}function ed(e,t){switch(t.tagID){case w.TABLE:{e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode());break}case w.TEMPLATE:{Do(e,t);break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:hd(e,t)}}function hd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Wm(e,t),e.fosterParentingEnabled=n}function MR(e,t){e.pendingCharacterTokens.push(t)}function LR(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function dc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)hd(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const DR=new Set([w.CAPTION,w.COL,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]);function NY(e,t){const n=t.tagID;DR.has(n)?e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,Ql(e,t)):ur(e,t)}function _Y(e,t){const n=t.tagID;switch(n){case w.CAPTION:case w.TABLE:{e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_TABLE,n===w.TABLE&&ed(e,t));break}case w.BODY:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Qm(e,t)}}function by(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.COL:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TEMPLATE:{ys(e,t);break}default:em(e,t)}}function AY(e,t){switch(t.tagID){case w.COLGROUP:{e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case w.TEMPLATE:{Do(e,t);break}case w.COL:break;default:em(e,t)}}function em(e,t){e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=ne.IN_TABLE,e._processToken(t))}function Zm(e,t){switch(t.tagID){case w.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_ROW;break}case w.TH:case w.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(pe.TR,w.TR),e.insertionMode=ne.IN_ROW,Jm(e,t);break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,Ql(e,t));break}default:Ql(e,t)}}function w1(e,t){const n=t.tagID;switch(t.tagID){case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE);break}case w.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE,ed(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:case w.TR:break;default:ed(e,t)}}function Jm(e,t){switch(t.tagID){case w.TH:case w.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Le.HTML),e.insertionMode=ne.IN_CELL,e.activeFormattingElements.insertMarker();break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,Zm(e,t));break}default:Ql(e,t)}}function jR(e,t){switch(t.tagID){case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY);break}case w.TABLE:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,w1(e,t));break}case w.TBODY:case w.TFOOT:case w.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(w.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ne.IN_TABLE_BODY,w1(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:break;default:ed(e,t)}}function RY(e,t){const n=t.tagID;DR.has(n)?(e.openElements.hasInTableScope(w.TD)||e.openElements.hasInTableScope(w.TH))&&(e._closeTableCell(),Jm(e,t)):ur(e,t)}function OY(e,t){const n=t.tagID;switch(n){case w.TD:case w.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ne.IN_ROW);break}case w.TABLE:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),jR(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:break;default:Qm(e,t)}}function PR(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.OPTGROUP:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.HR:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.INPUT:case w.KEYGEN:case w.TEXTAREA:case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),t.tagID!==w.SELECT&&e._processStartTag(t));break}case w.SCRIPT:case w.TEMPLATE:{ys(e,t);break}}}function BR(e,t){switch(t.tagID){case w.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===w.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===w.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop();break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop();break}case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode());break}case w.TEMPLATE:{Do(e,t);break}}}function IY(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e._processStartTag(t)):PR(e,t)}function MY(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e.onEndTag(t)):BR(e,t)}function LY(e,t){switch(t.tagID){case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{ys(e,t);break}case w.CAPTION:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.tmplInsertionModeStack[0]=ne.IN_TABLE,e.insertionMode=ne.IN_TABLE,Ql(e,t);break}case w.COL:{e.tmplInsertionModeStack[0]=ne.IN_COLUMN_GROUP,e.insertionMode=ne.IN_COLUMN_GROUP,by(e,t);break}case w.TR:{e.tmplInsertionModeStack[0]=ne.IN_TABLE_BODY,e.insertionMode=ne.IN_TABLE_BODY,Zm(e,t);break}case w.TD:case w.TH:{e.tmplInsertionModeStack[0]=ne.IN_ROW,e.insertionMode=ne.IN_ROW,Jm(e,t);break}default:e.tmplInsertionModeStack[0]=ne.IN_BODY,e.insertionMode=ne.IN_BODY,ur(e,t)}}function DY(e,t){t.tagID===w.TEMPLATE&&Do(e,t)}function zR(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):gy(e,t)}function jY(e,t){t.tagID===w.HTML?ur(e,t):tm(e,t)}function HR(e,t){var n;if(t.tagID===w.HTML){if(e.fragmentContext||(e.insertionMode=ne.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===w.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else tm(e,t)}function tm(e,t){e.insertionMode=ne.IN_BODY,Wm(e,t)}function PY(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.FRAMESET:{e._insertElement(t,Le.HTML);break}case w.FRAME:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.NOFRAMES:{ys(e,t);break}}}function BY(e,t){t.tagID===w.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==w.FRAMESET&&(e.insertionMode=ne.AFTER_FRAMESET))}function zY(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.NOFRAMES:{ys(e,t);break}}}function HY(e,t){t.tagID===w.HTML&&(e.insertionMode=ne.AFTER_AFTER_FRAMESET)}function UY(e,t){t.tagID===w.HTML?ur(e,t):wh(e,t)}function wh(e,t){e.insertionMode=ne.IN_BODY,Wm(e,t)}function FY(e,t){switch(t.tagID){case w.HTML:{ur(e,t);break}case w.NOFRAMES:{ys(e,t);break}}}function $Y(e,t){t.chars=hn,e._insertCharacters(t)}function VY(e,t){e._insertCharacters(t),e.framesetOk=!1}function UR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Le.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function qY(e,t){if(aq(t))UR(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Le.MATHML?CR(t):r===Le.SVG&&(oq(t),wR(t)),my(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function YY(e,t){if(t.tagID===w.P||t.tagID===w.BR){UR(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Le.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}pe.AREA,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BR,pe.COL,pe.EMBED,pe.FRAME,pe.HR,pe.IMG,pe.INPUT,pe.KEYGEN,pe.LINK,pe.META,pe.PARAM,pe.SOURCE,pe.TRACK,pe.WBR;const ep=FR("end"),Fs=FR("start");function FR(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 $R(e){const t=Fs(e),n=ep(e);if(t&&n)return{start:t,end:n}}const GY=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,KY=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),xw={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function VR(e,t){const n=sG(e),r=hR("type",{handlers:{root:XY,element:WY,text:QY,comment:YR,doctype:ZY,raw:eG},unknown:tG}),s={parser:n?new pw(xw):pw.getFragmentParser(void 0,xw),handle(c){r(c,s)},stitches:!1,options:t||{}};r(e,s),lu(s,Fs());const a=n?s.parser.document:s.parser.getFragment(),l=iV(a,{file:s.options.file});return s.stitches&&Ps(l,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const m=f.children;return m[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function qR(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function XY(e,t){qR(e.children,t)}function WY(e,t){nG(e,t),qR(e.children,t),rG(e,t)}function QY(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ct.CHARACTER,chars:e.value,location:md(e)};lu(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ZY(e,t){const n={type:Ct.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:md(e)};lu(t,Fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function JY(e,t){t.stitches=!0;const n=iG(e);if("children"in e&&"children"in n){const r=VR({type:"root",children:e.children},t.options);n.children=r.children}YR({type:"comment",value:{stitch:n}},t)}function YR(e,t){const n=e.value,r={type:Ct.COMMENT,data:n,location:md(e)};lu(t,Fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function eG(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,GR(t,Fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(GY,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function tG(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))JY(n,t);else{let r="";throw KY.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function lu(e,t){GR(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=wn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function GR(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function nG(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===wn.PLAINTEXT)return;lu(t,Fs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:so.html;s===so.html&&n==="svg"&&(s=so.svg);const a=cV({...e,children:[]},{space:s===so.svg?"svg":"html"}),l={type:Ct.START_TAG,tagName:n,tagID:ou(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:md(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function rG(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&xV.includes(n)||t.parser.tokenizer.state===wn.PLAINTEXT)return;lu(t,ep(e));const r={type:Ct.END_TAG,tagName:n,tagID:ou(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:md(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===wn.RCDATA||t.parser.tokenizer.state===wn.RAWTEXT||t.parser.tokenizer.state===wn.SCRIPT_DATA)&&(t.parser.tokenizer.state=wn.DATA)}function sG(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function md(e){const t=Fs(e)||{line:void 0,column:void 0,offset:void 0},n=ep(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function iG(e){return"children"in e?yo({...e,children:[]}):yo(e)}function k1(e){return function(t,n){return VR(t,{...e,file:n})}}const Ga=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Qa={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ga,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ga],h2:[["className","sr-only"]],img:[...Ga,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ga,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ga],table:[...Ga],ul:[...Ga,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},aa={}.hasOwnProperty;function aG(e,t){let n={type:"root",children:[]};const r={schema:t?{...Qa,...t}:Qa,stack:[]},s=KR(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function KR(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return oG(e,n);case"doctype":return lG(e,n);case"element":return uG(e,n);case"root":return cG(e,n);case"text":return dG(e,n)}}}function oG(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return pd(a,t),a}}function lG(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return pd(n,t),n}}function uG(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=XR(e,t.children),s=fG(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&aa.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(a=!1;++d<c.length;)e.stack.includes(c[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:s,children:r};return pd(l,t),l}function cG(e,t){const r={type:"root",children:XR(e,t.children)};return pd(r,t),r}function dG(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return pd(r,t),r}function XR(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=KR(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function fG(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&aa.call(r,n)?r[n]:void 0,l=r&&aa.call(r,"*")?r["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(aa.call(c,f)){const p=c[f];let m=yw(e,Ew(a,f),f,p);m==null&&(m=yw(e,Ew(l,f),f,p)),m!=null&&(d[f]=m)}if(s&&aa.call(s,n)){const p=s[n];for(f in p)aa.call(p,f)&&!aa.call(d,f)&&(d[f]=p[f])}return d}function yw(e,t,n,r){return t?Array.isArray(r)?hG(e,t,n,r):WR(e,t,n,r):void 0}function hG(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const l=WR(e,t,n,r[s]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function WR(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&mG(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const l=t[a];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){s=!0;break}}else if(l===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function mG(e,t,n){const r=e.schema.protocols&&aa.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),l=s.indexOf("?"),c=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||c>-1&&a>c)return!0;let f=-1;for(;++f<r.length;){const p=r[f];if(a===p.length&&s.slice(0,p.length)===p)return!0}return!1}function pd(e,t){const n=$R(t);t.data&&(e.data=yo(t.data)),n&&(e.position=n)}function Ew(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function QR(e){return function(t){return aG(t,e)}}function vw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const hr=Ca(/[A-Za-z]/),ar=Ca(/[\dA-Za-z]/),pG=Ca(/[#-'*+\--9=?A-Z^-~]/);function nm(e){return e!==null&&(e<32||e===127)}const N1=Ca(/\d/),gG=Ca(/[\dA-Fa-f]/),bG=Ca(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function rn(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const tp=Ca(/\p{P}|\p{S}/u),Eo=Ca(/\s/);function Ca(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function xG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function yG(e,t,n){const s=Ym((n||{}).ignore||[]),a=EG(t);let l=-1;for(;++l<a.length;)ay(e,"text",c);function c(f,p){let m=-1,b;for(;++m<p.length;){const x=p[m],v=b?b.children:void 0;if(s(x,v?v.indexOf(x):void 0,b))return;b=x}if(b)return d(f,p)}function d(f,p){const m=p[p.length-1],b=a[l][0],x=a[l][1];let v=0;const C=m.children.indexOf(f);let S=!1,N=[];b.lastIndex=0;let _=b.exec(f.value);for(;_;){const R=_.index,I={index:_.index,input:_.input,stack:[...p,f]};let A=x(..._,I);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?b.lastIndex=R+1:(v!==R&&N.push({type:"text",value:f.value.slice(v,R)}),Array.isArray(A)?N.push(...A):A&&N.push(A),v=R+_[0].length,S=!0),!b.global)break;_=b.exec(f.value)}return S?(v<f.value.length&&N.push({type:"text",value:f.value.slice(v)}),m.children.splice(C,1,...N)):N=[f],C+N.length}}function EG(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([vG(s[0]),TG(s[1])])}return t}function vG(e){return typeof e=="string"?new RegExp(xG(e),"g"):e}function TG(e){return typeof e=="function"?e:function(){return e}}const ob="phrasing",lb=["autolink","link","image","label"];function SG(){return{transforms:[RG],enter:{literalAutolink:wG,literalAutolinkEmail:ub,literalAutolinkHttp:ub,literalAutolinkWww:ub},exit:{literalAutolink:AG,literalAutolinkEmail:_G,literalAutolinkHttp:kG,literalAutolinkWww:NG}}}function CG(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ob,notInConstruct:lb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ob,notInConstruct:lb},{character:":",before:"[ps]",after:"\\/",inConstruct:ob,notInConstruct:lb}]}}function wG(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ub(e){this.config.enter.autolinkProtocol.call(this,e)}function kG(e){this.config.exit.autolinkProtocol.call(this,e)}function NG(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _G(e){this.config.exit.autolinkEmail.call(this,e)}function AG(e){this.exit(e)}function RG(e){yG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OG],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,IG]],{ignore:["link","linkReference"]})}function OG(e,t,n,r,s){let a="";if(!ZR(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!MG(n)))return!1;const l=LG(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function IG(e,t,n,r){return!ZR(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function MG(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function LG(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=vw(e,"(");let a=vw(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function ZR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Eo(n)||tp(n))&&(!t||n!==47)}function ps(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}JR.peek=$G;function DG(){this.buffer()}function jG(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PG(){this.buffer()}function BG(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ps(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HG(e){this.exit(e)}function UG(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ps(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FG(e){this.exit(e)}function $G(){return"["}function JR(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=s.move("]"),a}function VG(){return{enter:{gfmFootnoteCallString:DG,gfmFootnoteCall:jG,gfmFootnoteDefinitionLabelString:PG,gfmFootnoteDefinition:BG},exit:{gfmFootnoteCallString:zG,gfmFootnoteCall:HG,gfmFootnoteDefinitionLabelString:UG,gfmFootnoteDefinition:FG}}}function qG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:JR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const c=a.createTracker(l);let d=c.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return d+=c.move(a.safe(a.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
540
+ `:" ")+a.indentLines(a.containerFlow(r,c.current()),t?e4:YG))),f(),d}}function YG(e,t,n){return t===0?e:e4(e,t,n)}function e4(e,t,n){return(n?"":" ")+e}const GG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];t4.peek=ZG;function KG(){return{canContainEols:["delete"],enter:{strikethrough:WG},exit:{strikethrough:QG}}}function XG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GG}],handlers:{delete:t4}}}function WG(e){this.enter({type:"delete",children:[]},e)}function QG(e){this.exit(e)}function t4(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function ZG(){return"~"}function JG(e){return e.length}function eK(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||JG,a=[],l=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const k=[],C=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const N=tK(e[p][S]);if(n.alignDelimiters!==!1){const _=s(N);C[S]=_,(d[S]===void 0||_>d[S])&&(d[S]=_)}k.push(N)}l[p]=k,c[p]=C}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)a[m]=Tw(r[m]);else{const k=Tw(r);for(;++m<f;)a[m]=k}m=-1;const b=[],x=[];for(;++m<f;){const k=a[m];let C="",S="";k===99?(C=":",S=":"):k===108?C=":":k===114&&(S=":");let N=n.alignDelimiters===!1?1:Math.max(1,d[m]-C.length-S.length);const _=C+"-".repeat(N)+S;n.alignDelimiters!==!1&&(N=C.length+N+S.length,N>d[m]&&(d[m]=N),x[m]=N),b[m]=_}l.splice(1,0,b),c.splice(1,0,x),p=-1;const v=[];for(;++p<l.length;){const k=l[p],C=c[p];m=-1;const S=[];for(;++m<f;){const N=k[m]||"";let _="",R="";if(n.alignDelimiters!==!1){const I=d[m]-(C[m]||0),A=a[m];A===114?_=" ".repeat(I):A===99?I%2?(_=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(_=" ".repeat(I/2),R=_):R=" ".repeat(I)}n.delimiterStart!==!1&&!m&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||m)&&S.push(" "),n.alignDelimiters!==!1&&S.push(_),S.push(N),n.alignDelimiters!==!1&&S.push(R),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||m!==f-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
541
+ `)}function tK(e){return e==null?"":String(e)}function Tw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function nK(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),rK);return s(),l}function rK(e,t,n){return">"+(n?"":" ")+e}function sK(e,t){return Sw(e,t.inConstruct,!0)&&!Sw(e,t.notInConstruct,!1)}function Sw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Cw(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
542
+ `&&sK(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
543
+ `}function iK(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function aK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function oK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lK(e,t,n,r){const s=oK(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(aK(e,n)){const m=n.enter("codeIndented"),b=n.indentLines(a,uK);return m(),b}const c=n.createTracker(r),d=s.repeat(Math.max(iK(a,s)+1,3)),f=n.enter("codeFenced");let p=c.move(d);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
544
+ `,encode:["`"],...c.current()})),m()}return p+=c.move(`
545
+ `),a&&(p+=c.move(a+`
546
+ `)),p+=c.move(d),f(),p}function uK(e,t,n){return(n?"":" ")+e}function xy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function cK(e,t,n,r){const s=xy(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
547
+ `,...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),l(),f}function dK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function td(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Zl(e){if(e===null||rn(e)||Eo(e))return 1;if(tp(e))return 2}function rm(e,t,n){const r=Zl(e),s=Zl(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}n4.peek=fK;function n4(e,t,n,r){const s=dK(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const f=d.charCodeAt(0),p=rm(r.before.charCodeAt(r.before.length-1),f,s);p.inside&&(d=td(f)+d.slice(1));const m=d.charCodeAt(d.length-1),b=rm(r.after.charCodeAt(0),m,s);b.inside&&(d=d.slice(0,-1)+td(m));const x=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+x}function fK(e,t,n){return n.options.emphasis||"*"}const hK={};function yy(e,t){const n=hK,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return r4(e,r,s)}function r4(e,t,n){if(mK(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ww(e.children,t,n)}return Array.isArray(e)?ww(e,t,n):""}function ww(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=r4(e[s],t,n);return r.join("")}function mK(e){return!!(e&&typeof e=="object")}function pK(e,t){let n=!1;return Ps(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,x1}),!!((!e.depth||e.depth<3)&&yy(e)&&(t.options.setext||n))}function gK(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(pK(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
548
+ `,after:`
549
+ `});return m(),p(),b+`
550
+ `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
551
+ `))+1))}const l="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
552
+ `,...a.current()});return/^[\t ]/.test(f)&&(f=td(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}s4.peek=bK;function s4(e){return e.value||""}function bK(){return"<"}i4.peek=xK;function i4(e,t,n,r){const s=xy(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),f+=d.move(")"),l(),f}function xK(){return"!"}a4.peek=yK;function a4(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),s==="full"||!f||f!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function yK(){return"!"}o4.peek=EK;function o4(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return s+r+s}function EK(){return"`"}function l4(e,t){const n=yy(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}u4.peek=vK;function u4(e,t,n,r){const s=xy(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,d;if(l4(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),c(),n.stack=p,m}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),f+=l.move(" "+s),f+=l.move(n.safe(e.title,{before:f,after:s,...l.current()})),f+=l.move(s),d()),f+=l.move(")"),c(),f}function vK(e,t,n){return l4(e,n)?"<":"["}c4.peek=TK;function c4(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,a(),s==="full"||!f||f!==m?d+=c.move(m+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function TK(){return"["}function Ey(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SK(e){const t=Ey(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function CK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function d4(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wK(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?CK(n):Ey(n);const c=e.ordered?l==="."?")":".":SK(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),d4(n)===l&&p){let m=-1;for(;++m<e.children.length;){const b=e.children[m];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),f}function kK(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function NK(e,t,n,r){const s=kK(n);let a=n.bulletCurrent||Ey(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(m,b,x){return b?(x?"":" ".repeat(l))+m:(x?a:a+" ".repeat(l-a.length))+m}}function _K(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const AK=Ym(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RK(e,t,n,r){return(e.children.some(function(l){return AK(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}f4.peek=IK;function f4(e,t,n,r){const s=OK(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:c,...l.current()}));const f=d.charCodeAt(0),p=rm(r.before.charCodeAt(r.before.length-1),f,s);p.inside&&(d=td(f)+d.slice(1));const m=d.charCodeAt(d.length-1),b=rm(r.after.charCodeAt(0),m,s);b.inside&&(d=d.slice(0,-1)+td(m));const x=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+x}function IK(e,t,n){return n.options.strong||"*"}function MK(e,t,n,r){return n.safe(e.value,r)}function LK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function DK(e,t,n){const r=(d4(n)+(n.options.ruleSpaces?" ":"")).repeat(LK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const h4={blockquote:nK,break:Cw,code:lK,definition:cK,emphasis:n4,hardBreak:Cw,heading:gK,html:s4,image:i4,imageReference:a4,inlineCode:o4,link:u4,linkReference:c4,list:wK,listItem:NK,paragraph:_K,root:RK,strong:f4,text:MK,thematicBreak:DK},kw=document.createElement("i");function vy(e){const t="&"+e+";";kw.innerHTML=t;const n=kw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function m4(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&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)}const jK=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PK(e){return e.replace(jK,BK)}function BK(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return m4(n.slice(a?2:1),a?16:10)}return vy(n)||e}function zK(){return{enter:{table:HK,tableData:Nw,tableHeader:Nw,tableRow:FK},exit:{codeText:$K,table:UK,tableData:cb,tableHeader:cb,tableRow:cb}}}function HK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function UK(e){this.exit(e),this.data.inTable=void 0}function FK(e){this.enter({type:"tableRow",children:[]},e)}function cb(e){this.exit(e)}function Nw(e){this.enter({type:"tableCell",children:[]},e)}function $K(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function VK(e,t){return t==="|"?t:e}function qK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
553
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(x,v,k,C){return f(p(x,k,C),x.align)}function c(x,v,k,C){const S=m(x,k,C),N=f([S]);return N.slice(0,N.indexOf(`
554
+ `))}function d(x,v,k,C){const S=k.enter("tableCell"),N=k.enter("phrasing"),_=k.containerPhrasing(x,{...C,before:a,after:a});return N(),S(),_}function f(x,v){return eK(x,{align:v,alignDelimiters:r,padding:n,stringLength:s})}function p(x,v,k){const C=x.children;let S=-1;const N=[],_=v.enter("table");for(;++S<C.length;)N[S]=m(C[S],v,k);return _(),N}function m(x,v,k){const C=x.children;let S=-1;const N=[],_=v.enter("tableRow");for(;++S<C.length;)N[S]=d(C[S],x,v,k);return _(),N}function b(x,v,k){let C=h4.inlineCode(x,v,k);return k.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function YK(){return{exit:{taskListCheckValueChecked:_w,taskListCheckValueUnchecked:_w,paragraph:KK}}}function GK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:XK}}}function _w(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function KK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const c=s[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function XK(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let d=h4.listItem(e,t,n,{...r,...c.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function WK(){return[SG(),VG(),KG(),zK(),YK()]}function QK(e){return{extensions:[CG(),qG(e),XG(),qK(e),GK()]}}function Vr(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s: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);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function as(e,t){return e.length>0?(Vr(e,e.length,0,t),e):t}const Aw={}.hasOwnProperty;function p4(e){const t={};let n=-1;for(;++n<e.length;)ZK(t,e[n]);return t}function ZK(e,t){let n;for(n in t){const s=(Aw.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Aw.call(s,l)||(s[l]=[]);const c=a[l];JK(s[l],Array.isArray(c)?c:c?[c]:[])}}}function JK(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Vr(e,0,0,r)}const eX={tokenize:aX,partial:!0},g4={tokenize:oX,partial:!0},b4={tokenize:lX,partial:!0},x4={tokenize:uX,partial:!0},tX={tokenize:cX,partial:!0},y4={name:"wwwAutolink",tokenize:sX,previous:v4},E4={name:"protocolAutolink",tokenize:iX,previous:T4},ki={name:"emailAutolink",tokenize:rX,previous:S4},$s={};function nX(){return{text:$s}}let Ka=48;for(;Ka<123;)$s[Ka]=ki,Ka++,Ka===58?Ka=65:Ka===91&&(Ka=97);$s[43]=ki;$s[45]=ki;$s[46]=ki;$s[95]=ki;$s[72]=[ki,E4];$s[104]=[ki,E4];$s[87]=[ki,y4];$s[119]=[ki,y4];function rX(e,t,n){const r=this;let s,a;return l;function l(m){return!_1(m)||!S4.call(r,r.previous)||Ty(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return _1(m)?(e.consume(m),c):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(tX,p,f)(m):m===45||m===95||ar(m)?(a=!0,e.consume(m),d):p(m)}function f(m){return e.consume(m),s=!0,d}function p(m){return a&&s&&hr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function sX(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!v4.call(r,r.previous)||Ty(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eX,e.attempt(g4,e.attempt(b4,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function iX(e,t,n){const r=this;let s="",a=!1;return l;function l(m){return(m===72||m===104)&&T4.call(r,r.previous)&&!Ty(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(hr(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),a?f:(a=!0,d)):n(m)}function f(m){return m===null||nm(m)||rn(m)||Eo(m)||tp(m)?n(m):e.attempt(g4,e.attempt(b4,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function aX(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function oX(e,t,n){let r,s,a;return l;function l(f){return f===46||f===95?e.check(x4,d,c)(f):f===null||rn(f)||Eo(f)||f!==45&&tp(f)?d(f):(a=!0,e.consume(f),l)}function c(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),l}function d(f){return s||r||!a?n(f):t(f)}}function lX(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(x4,t,a)(l):l===null||rn(l)||Eo(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function uX(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),s):c===60||c===null||rn(c)||Eo(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||rn(c)||Eo(c)?t(c):r(c)}function a(c){return hr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):hr(c)?(e.consume(c),l):n(c)}}function cX(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return ar(a)?n(a):t(a)}}function v4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rn(e)}function T4(e){return!hr(e)}function S4(e){return!(e===47||_1(e))}function _1(e){return e===43||e===45||e===46||e===95||ar(e)}function Ty(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function uu(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ar(e.charCodeAt(n+1))&&ar(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function np(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const A1={name:"attention",resolveAll:dX,tokenize:fX};function dX(e,t){let n=-1,r,s,a,l,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},b={...e[n][1].start};Rw(m,-d),Rw(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=as(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=as(f,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=as(f,np(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=as(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=as(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Vr(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function fX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Zl(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=Zl(d),m=!p||p===2&&s||n.includes(d),b=!s||s===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(s||!b)),f._close=!!(a===42?b:b&&(p||!m)),t(d)}}function Rw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hX={name:"autolink",tokenize:mX};function mX(e,t,n){let r=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return hr(x)?(e.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||ar(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||ar(x))&&r++<32?(e.consume(x),c):(r=0,f(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||nm(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),p):pG(x)?(e.consume(x),f):n(x)}function p(x){return ar(x)?m(x):n(x)}function m(x){return x===46?(e.consume(x),r=0,p):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||ar(x))&&r++<63){const v=x===45?b:m;return e.consume(x),v}return n(x)}}function Pt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return At(d)?(e.enter(n),c(d)):t(d)}function c(d){return At(d)&&a++<s?(e.consume(d),c):(e.exit(n),t(d))}}const gd={partial:!0,tokenize:pX};function pX(e,t,n){return r;function r(a){return At(a)?Pt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||it(a)?t(a):n(a)}}const C4={continuation:{tokenize:bX},exit:xX,name:"blockQuote",tokenize:gX};function gX(e,t,n){const r=this;return s;function s(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return At(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function bX(e,t,n){const r=this;return s;function s(l){return At(l)?Pt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(C4,t,n)(l)}}function xX(e){e.exit("blockQuote")}const w4={name:"characterEscape",tokenize:yX};function yX(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return bG(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const k4={name:"characterReference",tokenize:EX};function EX(e,t,n){const r=this;let s=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=ar,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=gG,p):(e.enter("characterReferenceValue"),a=7,l=N1,p(m))}function p(m){if(m===59&&s){const b=e.exit("characterReferenceValue");return l===ar&&!vy(r.sliceSerialize(b))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&s++<a?(e.consume(m),p):n(m)}}const Ow={partial:!0,tokenize:TX},Iw={concrete:!0,name:"codeFenced",tokenize:vX};function vX(e,t,n){const r=this,s={partial:!0,tokenize:I};let a=0,l=0,c;return d;function d(A){return f(A)}function f(A){const L=r.events[r.events.length-1];return a=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===c?(l++,e.consume(A),p):l<3?n(A):(e.exit("codeFencedFenceSequence"),At(A)?Pt(e,m,"whitespace")(A):m(A))}function m(A){return A===null||it(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(Ow,k,R)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||it(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):At(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,x,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),b)}function x(A){return A===null||it(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(A))}function v(A){return A===null||it(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===c?n(A):(e.consume(A),v)}function k(A){return e.attempt(s,R,C)(A)}function C(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return a>0&&At(A)?Pt(e,N,"linePrefix",a+1)(A):N(A)}function N(A){return A===null||it(A)?e.check(Ow,k,R)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||it(A)?(e.exit("codeFlowValue"),N(A)):(e.consume(A),_)}function R(A){return e.exit("codeFenced"),t(A)}function I(A,L,D){let U=0;return z;function z(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),K}function K(V){return A.enter("codeFencedFence"),At(V)?Pt(A,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):W(V)}function W(V){return V===c?(A.enter("codeFencedFenceSequence"),J(V)):D(V)}function J(V){return V===c?(U++,A.consume(V),J):U>=l?(A.exit("codeFencedFenceSequence"),At(V)?Pt(A,te,"whitespace")(V):te(V)):D(V)}function te(V){return V===null||it(V)?(A.exit("codeFencedFence"),L(V)):D(V)}}}function TX(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const db={name:"codeIndented",tokenize:CX},SX={partial:!0,tokenize:wX};function CX(e,t,n){const r=this;return s;function s(f){return e.enter("codeIndented"),Pt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):it(f)?e.attempt(SX,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||it(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function wX(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Pt(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):it(l)?s(l):n(l)}}const kX={name:"codeText",previous:_X,resolve:NX,tokenize:AX};function NX(e){let t=e.length-4,n=3,r,s;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<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function _X(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AX(e,t,n){let r=0,s,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),s=0,p(m)):it(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||it(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class RX{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=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 t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.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 s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&fc(this.left,r),a.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),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(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<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);fc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fc(this.left,n.reverse())}}}function fc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function N4(e){const t={};let n=-1,r,s,a,l,c,d,f;const p=new RX(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,OX(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return Vr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function OX(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let p,m,b=-1,x=n,v=0,k=0;const C=[k];for(;x;){for(;e.get(++s)[1]!==x;);a.push(s),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),m&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(k=b+1,C.push(k),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),b=C.length;b--;){const S=c.slice(C[b],C[b+1]),N=a.pop();d.push([N,N+S.length-1]),e.splice(N,2,S)}for(d.reverse(),b=-1;++b<d.length;)f[v+d[b][0]]=v+d[b][1],v+=d[b][1]-d[b][0]-1;return f}const IX={resolve:LX,tokenize:DX},MX={partial:!0,tokenize:jX};function LX(e){return N4(e),e}function DX(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?a(c):it(c)?e.check(MX,l,a)(c):(e.consume(c),s)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function jX(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Pt(e,a,"linePrefix")}function a(l){if(l===null||it(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function _4(e,t,n,r,s,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(S){return S===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||nm(S)?n(S):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(c),b(S)):S===null||S===60||it(S)?n(S):(e.consume(S),S===92?v:x)}function v(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function k(S){return!p&&(S===null||S===41||rn(S))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,k):S===41?(e.consume(S),p--,k):S===null||S===32||S===40||nm(S)?n(S):(e.consume(S),S===92?C:k)}function C(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function A4(e,t,n,r,s,a){const l=this;let c=0,d;return f;function f(x){return e.enter(r),e.enter(s),e.consume(x),e.exit(s),e.enter(a),p}function p(x){return c>999||x===null||x===91||x===93&&!d||x===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(a),e.enter(s),e.consume(x),e.exit(s),e.exit(r),t):it(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||it(x)||c++>999?(e.exit("chunkString"),p(x)):(e.consume(x),d||(d=!At(x)),x===92?b:m)}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function R4(e,t,n,r,s,a){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(a),f(b))}function f(b){return b===l?(e.exit(a),d(l)):b===null?n(b):it(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Pt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||it(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?m:p)}function m(b){return b===l||b===92?(e.consume(b),p):p(b)}}function Bc(e,t){let n;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):At(s)?Pt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const PX={name:"definition",tokenize:zX},BX={partial:!0,tokenize:HX};function zX(e,t,n){const r=this;let s;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return A4.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return s=ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return rn(x)?Bc(e,f)(x):f(x)}function f(x){return _4(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return e.attempt(BX,m,m)(x)}function m(x){return At(x)?Pt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||it(x)?(e.exit("definition"),r.parser.defined.push(s),t(x)):n(x)}}function HX(e,t,n){return r;function r(c){return rn(c)?Bc(e,s)(c):n(c)}function s(c){return R4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return At(c)?Pt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||it(c)?t(c):n(c)}}const UX={name:"hardBreakEscape",tokenize:FX};function FX(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return it(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const $X={name:"headingAtx",resolve:VX,tokenize:qX};function VX(e,t){let n=e.length-2,r=3,s,a;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Vr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function qX(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||rn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):At(p)?Pt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||rn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const YX=["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"],Mw=["pre","script","style","textarea"],GX={concrete:!0,name:"htmlFlow",resolveTo:WX,tokenize:QX},KX={partial:!0,tokenize:JX},XX={partial:!0,tokenize:ZX};function WX(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 QX(e,t,n){const r=this;let s,a,l,c,d;return f;function f(j){return p(j)}function p(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),m}function m(j){return j===33?(e.consume(j),b):j===47?(e.consume(j),a=!0,k):j===63?(e.consume(j),s=3,r.interrupt?t:M):hr(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function b(j){return j===45?(e.consume(j),s=2,x):j===91?(e.consume(j),s=5,c=0,v):hr(j)?(e.consume(j),s=4,r.interrupt?t:M):n(j)}function x(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function v(j){const re="CDATA[";return j===re.charCodeAt(c++)?(e.consume(j),c===re.length?r.interrupt?t:W:v):n(j)}function k(j){return hr(j)?(e.consume(j),l=String.fromCharCode(j),C):n(j)}function C(j){if(j===null||j===47||j===62||rn(j)){const re=j===47,oe=l.toLowerCase();return!re&&!a&&Mw.includes(oe)?(s=1,r.interrupt?t(j):W(j)):YX.includes(l.toLowerCase())?(s=6,re?(e.consume(j),S):r.interrupt?t(j):W(j)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):a?N(j):_(j))}return j===45||ar(j)?(e.consume(j),l+=String.fromCharCode(j),C):n(j)}function S(j){return j===62?(e.consume(j),r.interrupt?t:W):n(j)}function N(j){return At(j)?(e.consume(j),N):z(j)}function _(j){return j===47?(e.consume(j),z):j===58||j===95||hr(j)?(e.consume(j),R):At(j)?(e.consume(j),_):z(j)}function R(j){return j===45||j===46||j===58||j===95||ar(j)?(e.consume(j),R):I(j)}function I(j){return j===61?(e.consume(j),A):At(j)?(e.consume(j),I):_(j)}function A(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),d=j,L):At(j)?(e.consume(j),A):D(j)}function L(j){return j===d?(e.consume(j),d=null,U):j===null||it(j)?n(j):(e.consume(j),L)}function D(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rn(j)?I(j):(e.consume(j),D)}function U(j){return j===47||j===62||At(j)?_(j):n(j)}function z(j){return j===62?(e.consume(j),K):n(j)}function K(j){return j===null||it(j)?W(j):At(j)?(e.consume(j),K):n(j)}function W(j){return j===45&&s===2?(e.consume(j),B):j===60&&s===1?(e.consume(j),G):j===62&&s===4?(e.consume(j),P):j===63&&s===3?(e.consume(j),M):j===93&&s===5?(e.consume(j),ae):it(j)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(KX,$,J)(j)):j===null||it(j)?(e.exit("htmlFlowData"),J(j)):(e.consume(j),W)}function J(j){return e.check(XX,te,$)(j)}function te(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),V}function V(j){return j===null||it(j)?J(j):(e.enter("htmlFlowData"),W(j))}function B(j){return j===45?(e.consume(j),M):W(j)}function G(j){return j===47?(e.consume(j),l="",X):W(j)}function X(j){if(j===62){const re=l.toLowerCase();return Mw.includes(re)?(e.consume(j),P):W(j)}return hr(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),X):W(j)}function ae(j){return j===93?(e.consume(j),M):W(j)}function M(j){return j===62?(e.consume(j),P):j===45&&s===2?(e.consume(j),M):W(j)}function P(j){return j===null||it(j)?(e.exit("htmlFlowData"),$(j)):(e.consume(j),P)}function $(j){return e.exit("htmlFlow"),t(j)}}function ZX(e,t,n){const r=this;return s;function s(l){return it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function JX(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(gd,t,n)}}const eW={name:"htmlText",tokenize:tW};function tW(e,t,n){const r=this;let s,a,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),I):M===63?(e.consume(M),_):hr(M)?(e.consume(M),D):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),a=0,v):hr(M)?(e.consume(M),N):n(M)}function p(M){return M===45?(e.consume(M),x):n(M)}function m(M){return M===null?n(M):M===45?(e.consume(M),b):it(M)?(l=m,G(M)):(e.consume(M),m)}function b(M){return M===45?(e.consume(M),x):m(M)}function x(M){return M===62?B(M):M===45?b(M):m(M)}function v(M){const P="CDATA[";return M===P.charCodeAt(a++)?(e.consume(M),a===P.length?k:v):n(M)}function k(M){return M===null?n(M):M===93?(e.consume(M),C):it(M)?(l=k,G(M)):(e.consume(M),k)}function C(M){return M===93?(e.consume(M),S):k(M)}function S(M){return M===62?B(M):M===93?(e.consume(M),S):k(M)}function N(M){return M===null||M===62?B(M):it(M)?(l=N,G(M)):(e.consume(M),N)}function _(M){return M===null?n(M):M===63?(e.consume(M),R):it(M)?(l=_,G(M)):(e.consume(M),_)}function R(M){return M===62?B(M):_(M)}function I(M){return hr(M)?(e.consume(M),A):n(M)}function A(M){return M===45||ar(M)?(e.consume(M),A):L(M)}function L(M){return it(M)?(l=L,G(M)):At(M)?(e.consume(M),L):B(M)}function D(M){return M===45||ar(M)?(e.consume(M),D):M===47||M===62||rn(M)?U(M):n(M)}function U(M){return M===47?(e.consume(M),B):M===58||M===95||hr(M)?(e.consume(M),z):it(M)?(l=U,G(M)):At(M)?(e.consume(M),U):B(M)}function z(M){return M===45||M===46||M===58||M===95||ar(M)?(e.consume(M),z):K(M)}function K(M){return M===61?(e.consume(M),W):it(M)?(l=K,G(M)):At(M)?(e.consume(M),K):U(M)}function W(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,J):it(M)?(l=W,G(M)):At(M)?(e.consume(M),W):(e.consume(M),te)}function J(M){return M===s?(e.consume(M),s=void 0,V):M===null?n(M):it(M)?(l=J,G(M)):(e.consume(M),J)}function te(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||rn(M)?U(M):(e.consume(M),te)}function V(M){return M===47||M===62||rn(M)?U(M):n(M)}function B(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function G(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),X}function X(M){return At(M)?Pt(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):ae(M)}function ae(M){return e.enter("htmlTextData"),l(M)}}const Sy={name:"labelEnd",resolveAll:iW,resolveTo:aW,tokenize:oW},nW={tokenize:lW},rW={tokenize:uW},sW={tokenize:cW};function iW(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Vr(e,0,e.length,n),e}function aW(e,t){let n=e.length,r=0,s,a,l,c;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=as(c,e.slice(a+1,a+r+3)),c=as(c,[["enter",p,t]]),c=as(c,np(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=as(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=as(c,e.slice(l+1)),c=as(c,[["exit",d,t]]),Vr(e,a,e.length,c),e}function oW(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return c;function c(b){return a?a._inactive?m(b):(l=r.parser.defined.includes(ps(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(nW,p,l?p:m)(b):b===91?e.attempt(rW,p,l?f:m)(b):l?p(b):m(b)}function f(b){return e.attempt(sW,p,m)(b)}function p(b){return t(b)}function m(b){return a._balanced=!0,n(b)}}function lW(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return rn(m)?Bc(e,a)(m):a(m)}function a(m){return m===41?p(m):_4(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return rn(m)?Bc(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?R4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return rn(m)?Bc(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function uW(e,t,n){const r=this;return s;function s(c){return A4.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function cW(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const dW={name:"labelStartImage",resolveAll:Sy.resolveAll,tokenize:fW};function fW(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const hW={name:"labelStartLink",resolveAll:Sy.resolveAll,tokenize:mW};function mW(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const fb={name:"lineEnding",tokenize:pW};function pW(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const kh={name:"thematicBreak",tokenize:gW};function gW(e,t,n){let r=0,s;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return s=f,c(f)}function c(f){return f===s?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||it(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===s?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),At(f)?Pt(e,c,"whitespace")(f):c(f))}}const _r={continuation:{tokenize:EW},exit:TW,name:"list",tokenize:yW},bW={partial:!0,tokenize:SW},xW={partial:!0,tokenize:vW};function yW(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:N1(x)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(kh,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return N1(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(gd,r.interrupt?n:p,e.attempt(bW,b,m))}function p(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function m(x){return At(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function EW(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gd,s,a);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!At(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(xW,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pt(e,e.attempt(_r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function vW(e,t,n){const r=this;return Pt(e,s,"listItemIndent",r.containerState.size+1);function s(a){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(a):n(a)}}function TW(e){e.exit(this.containerState.type)}function SW(e,t,n){const r=this;return Pt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!At(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Lw={name:"setextUnderline",resolveTo:CW,tokenize:wW};function CW(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function wW(e,t,n){const r=this;let s;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===s?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),At(f)?Pt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||it(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const kW={tokenize:LW,partial:!0};function NW(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OW,continuation:{tokenize:IW},exit:MW}},text:{91:{name:"gfmFootnoteCall",tokenize:RW},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_W,resolveTo:AW}}}}function _W(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=ps(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function AW(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function RW(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(a>999||m===93&&!l||m===null||m===91||rn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(ps(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return rn(m)||(l=!0),a++,e.consume(m),m===92?p:f}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}}function OW(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(v)}function p(v){if(l>999||v===93&&!c||v===null||v===91||rn(v))return n(v);if(v===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=ps(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return rn(v)||(c=!0),l++,e.consume(v),v===92?m:p}function m(v){return v===91||v===92||v===93?(e.consume(v),l++,p):p(v)}function b(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),s.includes(a)||s.push(a),Pt(e,x,"gfmFootnoteDefinitionWhitespace")):n(v)}function x(v){return t(v)}}function IW(e,t,n){return e.check(gd,t,e.attempt(kW,t,n))}function MW(e){e.exit("gfmFootnoteDefinition")}function LW(e,t,n){const r=this;return Pt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function DW(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},m={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",m,c]],x=c.parser.constructs.insideSpan.null;x&&Vr(b,b.length,0,np(x,l.slice(f+1,d),c)),Vr(b,b.length,0,[["exit",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),Vr(l,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,c,d){const f=this.previous,p=this.events;let m=0;return b;function b(v){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(v):(l.enter("strikethroughSequenceTemporary"),x(v))}function x(v){const k=Zl(f);if(v===126)return m>1?d(v):(l.consume(v),m++,x);if(m<2&&!n)return d(v);const C=l.exit("strikethroughSequenceTemporary"),S=Zl(v);return C._open=!S||S===2&&!!k,C._close=!k||k===2&&!!S,c(v)}}}class jW{constructor(){this.map=[]}add(t,n,r){PW(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function PW(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function BW(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function zW(){return{flow:{null:{name:"table",tokenize:HW,resolveAll:UW}}}}function HW(e,t,n){const r=this;let s=0,a=0,l;return c;function c(z){let K=r.events.length-1;for(;K>-1;){const te=r.events[K][1].type;if(te==="lineEnding"||te==="linePrefix")K--;else break}const W=K>-1?r.events[K][1].type:null,J=W==="tableHead"||W==="tableRow"?A:d;return J===A&&r.parser.lazy[r.now().line]?n(z):J(z)}function d(z){return e.enter("tableHead"),e.enter("tableRow"),f(z)}function f(z){return z===124||(l=!0,a+=1),p(z)}function p(z){return z===null?n(z):it(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),x):n(z):At(z)?Pt(e,p,"whitespace")(z):(a+=1,l&&(l=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||rn(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?b:m)}function b(z){return z===92||z===124?(e.consume(z),m):m(z)}function x(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),l=!1,At(z)?Pt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):v(z))}function v(z){return z===45||z===58?C(z):z===124?(l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),k):I(z)}function k(z){return At(z)?Pt(e,C,"whitespace")(z):C(z)}function C(z){return z===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),S):z===45?(a+=1,S(z)):z===null||it(z)?R(z):I(z)}function S(z){return z===45?(e.enter("tableDelimiterFiller"),N(z)):I(z)}function N(z){return z===45?(e.consume(z),N):z===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(z))}function _(z){return At(z)?Pt(e,R,"whitespace")(z):R(z)}function R(z){return z===124?v(z):z===null||it(z)?!l||s!==a?I(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):I(z)}function I(z){return n(z)}function A(z){return e.enter("tableRow"),L(z)}function L(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),L):z===null||it(z)?(e.exit("tableRow"),t(z)):At(z)?Pt(e,L,"whitespace")(z):(e.enter("data"),D(z))}function D(z){return z===null||z===124||rn(z)?(e.exit("data"),L(z)):(e.consume(z),z===92?U:D)}function U(z){return z===92||z===124?(e.consume(z),D):D(z)}}function UW(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,p,m;const b=new jW;for(;++n<e.length;){const x=e[n],v=x[1];x[0]==="enter"?v.type==="tableHead"?(c=!1,d!==0&&(Dw(b,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",f,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,m=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",p,t]])),s=v.type==="tableDelimiterRow"?2:p?3:1):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],m=ah(b,t,a,s,void 0,m),a=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],m=ah(b,t,a,s,void 0,m)),a=l,l=[a[1],n,0,0])):v.type==="tableHead"?(c=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],m=ah(b,t,a,s,n,m)):l[1]!==0&&(m=ah(b,t,l,s,n,m)),s=0):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&Dw(b,t,d,f,p),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=BW(t.events,n))}return e}function ah(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Rl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Rl(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=Rl(t.events,n[2]),p=Rl(t.events,n[3]),m={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,k=n[3]-n[2]-1;e.add(v,k,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(a.end=Object.assign({},Rl(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function Dw(e,t,n,r,s){const a=[],l=Rl(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Rl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const FW={name:"tasklistCheck",tokenize:VW};function $W(){return{text:{91:FW}}}function VW(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return rn(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return it(d)?t(d):At(d)?e.check({tokenize:qW},t,n)(d):n(d)}}function qW(e,t,n){return Pt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function YW(e){return p4([nX(),NW(),DW(e),zW(),$W()])}const GW={};function KW(e){const t=this,n=e||GW,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(YW(n)),a.push(WK()),l.push(QK(n))}var XW=Object.defineProperty,WW=Object.defineProperties,QW=Object.getOwnPropertyDescriptors,jw=Object.getOwnPropertySymbols,ZW=Object.prototype.hasOwnProperty,JW=Object.prototype.propertyIsEnumerable,Pw=(e,t,n)=>t in e?XW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O4=(e,t)=>{for(var n in t||(t={}))ZW.call(t,n)&&Pw(e,n,t[n]);if(jw)for(var n of jw(t))JW.call(t,n)&&Pw(e,n,t[n]);return e},I4=(e,t)=>WW(e,QW(t)),yr=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},eQ=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},tQ=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!eQ(e,n)&&(t+=1)}return t},ma=(e,t)=>{let n=!1,r=!1,s=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(s<t&&t<a)return!0;n=!1,s=-1}else n=!0,s=a}return!1},nQ=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,rQ=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(nQ,(t,n,r,s)=>yr(e,s)?t:`${n}\\>${r}`),sQ=/(\*\*)([^*]*\*?)$/,iQ=/(__)([^_]*?)$/,aQ=/(\*\*\*)([^*]*?)$/,oQ=/(\*)([^*]*?)$/,lQ=/(_)([^_]*?)$/,uQ=/(`)([^`]*?)$/,cQ=/(~~)([^~]*?)$/,jo=/^[\s_~*`]*$/,M4=/^[\s]*[-*+][\s]+$/,dQ=/[\p{L}\p{N}_]/u,fQ=/^```[^`\n]*```?$/,hQ=/^\*{4,}$/,mQ=/(__)([^_]+)_$/,pQ=/(~~)([^~]+)~$/,Bw=/~~/g,pa=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:dQ.test(e)},gQ=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},L4=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},rp=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},bQ=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
555
+ `)return!1}return!1},D4=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?bQ(e,t):!1;if(e[n]===`
556
+ `)return!1}return!1},xQ=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
557
+ `)return!1}return!1},Cy=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
558
+ `){r=d+1;break}let s=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
559
+ `){s=d;break}let a=e.substring(r,s),l=0,c=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){c=!0;break}return l>=3&&!c},yQ=(e,t,n,r)=>n==="\\"||e.includes("$")&&rp(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&pa(n)&&pa(r)||(!n||n===" "||n===" "||n===`
560
+ `)&&(!r||r===" "||r===" "||r===`
561
+ `)),j4=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";yQ(e,s,a,l)||(t+=1)}return t},EQ=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&rp(e,t)||D4(e,t)||xQ(e,t)||n==="_"||r==="_"||n&&r&&pa(n)&&pa(r)),vQ=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";EQ(e,s,a,l)||(t+=1)}return t},TQ=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},wy=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},zw=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},SQ=(e,t,n)=>{if(!t||jo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
562
+ `),s=r===-1?0:r+1,a=e.substring(s,n);return M4.test(a)&&t.includes(`
563
+ `)?!0:Cy(e,n,"*")},CQ=e=>{let t=e.match(sQ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||ma(e,r)||SQ(e,n,r)?e:wy(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},wQ=(e,t,n)=>{if(!t||jo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
564
+ `),s=r===-1?0:r+1,a=e.substring(s,n);return M4.test(a)&&t.includes(`
565
+ `)?!0:Cy(e,n,"_")},kQ=e=>{let t=e.match(iQ);if(!t){let s=e.match(mQ);if(s){let a=e.lastIndexOf(s[1]);if(!(yr(e,a)||ma(e,a))&&zw(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return yr(e,r)||ma(e,r)||wQ(e,n,r)?e:zw(e)%2===1?`${e}__`:e},NQ=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!rp(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
566
+ `)&&(!s||s===" "||s===" "||s===`
567
+ `)||r&&s&&pa(r)&&pa(s))continue;return n}}return-1},_Q=e=>{if(!e.match(oQ))return e;let t=NQ(e);if(t===-1||yr(e,t)||ma(e,t))return e;let n=e.substring(t+1);return!n||jo.test(n)?e:j4(e)%2===1?`${e}*`:e},P4=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!rp(e,n)&&!D4(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&pa(r)&&pa(s))continue;return n}}return-1},AQ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
568
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},RQ=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(wy(t)%2!==1)return null;let n=t.indexOf("**"),r=P4(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},OQ=e=>{if(!e.match(lQ))return e;let t=P4(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||jo.test(n)||yr(e,t)||ma(e,t))return e;if(vQ(e)%2===1){let r=RQ(e);return r!==null?r:AQ(e)}return e},IQ=e=>{let t=wy(e),n=j4(e);return t%2===0&&n%2===0},MQ=(e,t,n)=>!t||jo.test(t)||yr(e,n)||ma(e,n)?!0:Cy(e,n,"*"),LQ=e=>{if(hQ.test(e))return e;let t=e.match(aQ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return MQ(e,n,r)?e:TQ(e)%2===1?IQ(e)?e:`${e}***`:e},DQ=/<[a-zA-Z/][^>]*$/,jQ=e=>{let t=e.match(DQ);return!t||t.index===void 0||yr(e,t.index)?e:e.substring(0,t.index).trimEnd()},PQ=e=>!e.match(fQ)||e.includes(`
569
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,BQ=e=>(e.match(/```/g)||[]).length%2===1,zQ=e=>{let t=PQ(e);if(t!==null)return t;let n=e.match(uQ);if(n&&!BQ(e)){let r=n[2];if(!r||jo.test(r))return e;if(tQ(e)%2===1)return`${e}\``}return e},B4=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",HQ=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!B4(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},UQ=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!B4(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},FQ=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
570
+ `,t)!==-1&&!e.endsWith(`
571
+ `)?`${e}
572
+ $$`:`${e}$$`},$Q=e=>HQ(e)%2===0?e:FQ(e),VQ=e=>UQ(e)%2===1?`${e}$`:e,qQ=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=gQ(e,t);if(r===-1||yr(e,r))return null;let s=r>0&&e[r-1]==="!",a=s?r-1:r,l=e.substring(0,a);if(s)return l;let c=e.substring(r+1,t);return n==="text-only"?`${l}${c}`:`${l}[${c}](streamdown:incomplete-link)`},Hw=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!yr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=L4(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},YQ=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=Hw(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(L4(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=Hw(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},z4=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!yr(e,n)){let r=qQ(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!yr(e,r)){let s=YQ(e,r,t);if(s!==null)return s}return e},GQ=/^-{1,2}$/,KQ=/^[\s]*-{1,2}[\s]+$/,XQ=/^={1,2}$/,WQ=/^[\s]*={1,2}[\s]+$/,QQ=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
573
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(GQ.test(s)&&!n.match(KQ)){let a=r.split(`
574
+ `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(XQ.test(s)&&!n.match(WQ)){let a=r.split(`
575
+ `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},ZQ=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),JQ=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(ZQ,(t,n)=>yr(e,n)?t:"\\~"),eZ=e=>{var t,n;let r=e.match(cQ);if(r){let s=r[2];if(!s||jo.test(s))return e;let a=e.lastIndexOf(r[1]);if(yr(e,a)||ma(e,a))return e;if(((t=e.match(Bw))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(pQ);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(yr(e,a)||ma(e,a))return e;if(((n=e.match(Bw))==null?void 0:n.length)%2===1)return`${e}~`}}return e},hb=e=>e!==!1,tZ=e=>e===!0,fr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},nZ=[{handler:{name:"singleTilde",handle:JQ,priority:fr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:rQ,priority:fr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:jQ,priority:fr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:QQ,priority:fr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:z4,priority:fr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:LQ,priority:fr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:CQ,priority:fr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:kQ,priority:fr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:_Q,priority:fr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:OQ,priority:fr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:zQ,priority:fr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:eZ,priority:fr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:$Q,priority:fr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:VQ,priority:fr.INLINE_KATEX},optionKey:"inlineKatex"}],rZ=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return nZ.filter(({handler:r,optionKey:s})=>r.name==="links"?hb(e?.links)||hb(e?.images):r.name==="inlineKatex"?tZ(e?.inlineKatex):hb(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:I4(O4({},r),{handle:a=>z4(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},sZ=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=rZ(t),a=((n=t?.handlers)!=null?n:[]).map(c=>{var d;return{handler:I4(O4({},c),{priority:(d=c.priority)!=null?d:fr.DEFAULT}),earlyReturn:void 0}}),l=[...s,...a].sort((c,d)=>{var f,p;return((f=c.handler.priority)!=null?f:0)-((p=d.handler.priority)!=null?p:0)});for(let{handler:c,earlyReturn:d}of l)if(r=c.handle(r),d!=null&&d(r))return r;return r},iZ=sZ;const aZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lZ={};function Uw(e,t){return(lZ.jsx?oZ:aZ).test(e)}const uZ=/[ \t\n\f\r]/g;function cZ(e){return typeof e=="object"?e.type==="text"?Fw(e.value):!1:Fw(e)}function Fw(e){return e.replace(uZ,"")===""}var Cl={},mb,$w;function dZ(){if($w)return mb;$w=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
576
+ `,f="/",p="*",m="",b="comment",x="declaration";function v(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var N=1,_=1;function R(te){var V=te.match(t);V&&(N+=V.length);var B=te.lastIndexOf(d);_=~B?te.length-B:_+te.length}function I(){var te={line:N,column:_};return function(V){return V.position=new A(te),U(),V}}function A(te){this.start=te,this.end={line:N,column:_},this.source=S.source}A.prototype.content=C;function L(te){var V=new Error(S.source+":"+N+":"+_+": "+te);if(V.reason=te,V.filename=S.source,V.line=N,V.column=_,V.source=C,!S.silent)throw V}function D(te){var V=te.exec(C);if(V){var B=V[0];return R(B),C=C.slice(B.length),V}}function U(){D(n)}function z(te){var V;for(te=te||[];V=K();)V!==!1&&te.push(V);return te}function K(){var te=I();if(!(f!=C.charAt(0)||p!=C.charAt(1))){for(var V=2;m!=C.charAt(V)&&(p!=C.charAt(V)||f!=C.charAt(V+1));)++V;if(V+=2,m===C.charAt(V-1))return L("End of comment missing");var B=C.slice(2,V-2);return _+=2,R(B),C=C.slice(V),_+=2,te({type:b,comment:B})}}function W(){var te=I(),V=D(r);if(V){if(K(),!D(s))return L("property missing ':'");var B=D(a),G=te({type:x,property:k(V[0].replace(e,m)),value:B?k(B[0].replace(e,m)):m});return D(l),G}}function J(){var te=[];z(te);for(var V;V=W();)V!==!1&&(te.push(V),z(te));return te}return U(),J()}function k(C){return C?C.replace(c,m):m}return mb=v,mb}var Vw;function fZ(){if(Vw)return Cl;Vw=1;var e=Cl&&Cl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.default=n;const t=e(dZ());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?s(f,p,d):p&&(a=a||{},a[f]=p)}),a}return Cl}var hc={},qw;function hZ(){if(qw)return hc;qw=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(s,c):f=f.replace(r,c),f.replace(t,l))};return hc.camelCase=d,hc}var mc,Yw;function mZ(){if(Yw)return mc;Yw=1;var e=mc&&mc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(fZ()),n=hZ();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,mc=r,mc}var pZ=mZ();const gZ=dm(pZ);function zc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gw(e.position):"start"in e||"end"in e?Gw(e):"line"in e||"column"in e?R1(e):""}function R1(e){return Kw(e&&e.line)+":"+Kw(e&&e.column)}function Gw(e){return R1(e&&e.start)+"-"+R1(e&&e.end)}function Kw(e){return e&&typeof e=="number"?e:1}class cr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=zc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cr.prototype.file="";cr.prototype.name="";cr.prototype.reason="";cr.prototype.message="";cr.prototype.stack="";cr.prototype.column=void 0;cr.prototype.line=void 0;cr.prototype.ancestors=void 0;cr.prototype.cause=void 0;cr.prototype.fatal=void 0;cr.prototype.place=void 0;cr.prototype.ruleId=void 0;cr.prototype.source=void 0;const ky={}.hasOwnProperty,bZ=new Map,xZ=/[A-Z]/g,yZ=new Set(["table","tbody","thead","tfoot","tr"]),EZ=new Set(["td","th"]),H4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vZ(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=AZ(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=_Z(n,t.jsx,t.jsxs)}const s={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"?Sa:fd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=U4(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function U4(e,t,n){if(t.type==="element")return TZ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return SZ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wZ(e,t,n);if(t.type==="mdxjsEsm")return CZ(e,t);if(t.type==="root")return kZ(e,t,n);if(t.type==="text")return NZ(e,t)}function TZ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Sa,e.schema=s),e.ancestors.push(t);const a=$4(e,t.tagName,!1),l=RZ(e,t);let c=_y(e,t);return yZ.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!cZ(d):!0})),F4(e,l,a,t),Ny(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function SZ(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)}nd(e,t.position)}function CZ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nd(e,t.position)}function wZ(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Sa,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:$4(e,t.name,!0),l=OZ(e,t),c=_y(e,t);return F4(e,l,a,t),Ny(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function kZ(e,t,n){const r={};return Ny(r,_y(e,t)),e.create(t,e.Fragment,r,n)}function NZ(e,t){return t.value}function F4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ny(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _Z(e,t,n){return r;function r(s,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function AZ(e,t){return n;function n(r,s,a,l){const c=Array.isArray(a.children),d=Fs(r);return t(s,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function RZ(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&ky.call(t.properties,s)){const a=IZ(e,s,t.properties[s]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&EZ.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function OZ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else nd(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else nd(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function _y(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:bZ;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=s.get(d)||0;l=d+"-"+f,s.set(d,f+1)}}const c=U4(e,a,l);c!==void 0&&n.push(c)}return n}function IZ(e,t,n){const r=Xm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?lR(n):uR(n)),r.property==="style"){let s=typeof n=="object"?n:MZ(e,String(n));return e.stylePropertyNameCase==="css"&&(s=LZ(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?V$[r.property]||r.property:r.attribute,n]}}function MZ(e,t){try{return gZ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new cr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=H4+"#cannot-parse-style-attribute",s}}function $4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const c=Uw(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=Uw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return ky.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);nd(e)}function nd(e,t){const n=new cr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=H4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function LZ(e){const t={};let n;for(n in e)ky.call(e,n)&&(t[DZ(n)]=e[n]);return t}function DZ(e){let t=e.replace(xZ,jZ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jZ(e){return"-"+e.toLowerCase()}const pb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},PZ={tokenize:BZ};function BZ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const zZ={tokenize:HZ},Xw={tokenize:UZ};function HZ(e){const t=this,n=[];let r=0,s,a,l;return c;function c(_){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&N();const R=t.events.length;let I=R,A;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){A=t.events[I][1].end;break}S(r);let L=R;for(;L<t.events.length;)t.events[L][1].end={...A},L++;return Vr(t.events,I+1,0,t.events.slice(R)),t.events.length=L,f(_)}return c(_)}function f(_){if(r===n.length){if(!s)return b(_);if(s.currentConstruct&&s.currentConstruct.concrete)return v(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xw,p,m)(_)}function p(_){return s&&N(),S(r),b(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,v(_)}function b(_){return t.containerState={},e.attempt(Xw,x,v)(_)}function x(_){return r++,n.push([t.currentConstruct,t.containerState]),b(_)}function v(_){if(_===null){s&&N(),S(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),k(_)}function k(_){if(_===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(_);return}return it(_)?(e.consume(_),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),k)}function C(_,R){const I=t.sliceStream(_);if(R&&I.push(null),_.previous=a,a&&(a.next=_),a=_,s.defineSkip(_.start),s.write(I),t.parser.lazy[_.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<l&&(!s.events[A][1].end||s.events[A][1].end.offset>l))return;const L=t.events.length;let D=L,U,z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(U){z=t.events[D][1].end;break}U=!0}for(S(r),A=L;A<t.events.length;)t.events[A][1].end={...z},A++;Vr(t.events,D+1,0,t.events.slice(L)),t.events.length=A}}function S(_){let R=n.length;for(;R-- >_;){const I=n[R];t.containerState=I[1],I[0].exit.call(t,e)}n.length=_}function N(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function UZ(e,t,n){return Pt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const FZ={tokenize:$Z};function $Z(e){const t=this,n=e.attempt(gd,r,e.attempt(this.parser.constructs.flowInitial,s,Pt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(IX,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const VZ={resolveAll:q4()},qZ=V4("string"),YZ=V4("text");function V4(e){return{resolveAll:q4(e==="text"?GZ:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,c);return l;function l(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=s[p];let b=-1;if(m)for(;++b<m.length;){const x=m[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function q4(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function GZ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,c=0,d;for(;a--;){const f=s[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const KZ={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:C4},XZ={91:PX},WZ={[-2]:db,[-1]:db,32:db},QZ={35:$X,42:kh,45:[Lw,kh],60:GX,61:Lw,95:kh,96:Iw,126:Iw},ZZ={38:k4,92:w4},JZ={[-5]:fb,[-4]:fb,[-3]:fb,33:dW,38:k4,42:A1,60:[hX,eW],91:hW,92:[UX,w4],93:Sy,95:A1,96:kX},eJ={null:[A1,VZ]},tJ={null:[42,95]},nJ={null:[]},rJ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tJ,contentInitial:XZ,disable:nJ,document:KZ,flow:QZ,flowInitial:WZ,insideSpan:eJ,string:ZZ,text:JZ},Symbol.toStringTag,{value:"Module"}));function sJ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],c=[];const d={attempt:L(I),check:L(A),consume:N,enter:_,exit:R,interrupt:L(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:k,events:[],now:v,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(K){return l=as(l,K),C(),l[l.length-1]!==null?[]:(D(t,0),f.events=np(a,f.events,f),f.events)}function b(K,W){return aJ(x(K),W)}function x(K){return iJ(l,K)}function v(){const{_bufferIndex:K,_index:W,line:J,column:te,offset:V}=r;return{_bufferIndex:K,_index:W,line:J,column:te,offset:V}}function k(K){s[K.line]=K.column,z()}function C(){let K;for(;r._index<l.length;){const W=l[r._index];if(typeof W=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<W.length;)S(W.charCodeAt(r._bufferIndex));else S(W)}}function S(K){p=p(K)}function N(K){it(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,z()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=K}function _(K,W){const J=W||{};return J.type=K,J.start=v(),f.events.push(["enter",J,f]),c.push(J),J}function R(K){const W=c.pop();return W.end=v(),f.events.push(["exit",W,f]),W}function I(K,W){D(K,W.from)}function A(K,W){W.restore()}function L(K,W){return J;function J(te,V,B){let G,X,ae,M;return Array.isArray(te)?$(te):"tokenize"in te?$([te]):P(te);function P(ce){return de;function de(fe){const ve=fe!==null&&ce[fe],Fe=fe!==null&&ce.null,De=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return $(De)(fe)}}function $(ce){return G=ce,X=0,ce.length===0?B:j(ce[X])}function j(ce){return de;function de(fe){return M=U(),ae=ce,ce.partial||(f.currentConstruct=ce),ce.name&&f.parser.constructs.disable.null.includes(ce.name)?oe():ce.tokenize.call(W?Object.assign(Object.create(f),W):f,d,re,oe)(fe)}}function re(ce){return K(ae,M),V}function oe(ce){return M.restore(),++X<G.length?j(G[X]):B}}}function D(K,W){K.resolveAll&&!a.includes(K)&&a.push(K),K.resolve&&Vr(f.events,W,f.events.length-W,K.resolve(f.events.slice(W),f)),K.resolveTo&&(f.events=K.resolveTo(f.events,f))}function U(){const K=v(),W=f.previous,J=f.currentConstruct,te=f.events.length,V=Array.from(c);return{from:te,restore:B};function B(){r=K,f.previous=W,f.currentConstruct=J,f.events.length=te,c=V,z()}}function z(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function iJ(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function aJ(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
577
+ `;break}case-3:{l=`\r
578
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function oJ(e){const r={constructs:p4([rJ,...(e||{}).extensions||[]]),content:s(PZ),defined:[],document:s(zZ),flow:s(FZ),lazy:{},string:s(qZ),text:s(YZ)};return r;function s(a){return l;function l(c){return sJ(r,a,c)}}}function lJ(e){for(;!N4(e););return e}const Ww=/[\0\t\n\r]/g;function uJ(){let e=1,t="",n=!0,r;return s;function s(a,l,c){const d=[];let f,p,m,b,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Ww.lastIndex=m,f=Ww.exec(a),b=f&&f.index!==void 0?f.index:a.length,x=a.charCodeAt(b),!f){t=a.slice(m);break}if(x===10&&m===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<b&&(d.push(a.slice(m,b)),e+=b-m),x){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=b+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Y4={}.hasOwnProperty;function cJ(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),dJ(n)(lJ(oJ(n).document().write(uJ()(e,t,!0))))}function dJ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ye),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Ge),blockQuote:a(Fe),characterEscape:U,characterReference:U,codeFenced:a(De),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(De,l),codeText:a(Ee,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Ie),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Be),hardBreakEscape:a($e),hardBreakTrailing:a($e),htmlFlow:a(Me,l),htmlFlowData:U,htmlText:a(Me,l),htmlTextData:U,image:a(we),label:l,link:a(ye),listItem:a(je),listItemValue:b,listOrdered:a(Oe,m),listUnordered:a(Oe),paragraph:a(ee),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ge),strong:a(me),thematicBreak:a(Q)},exit:{atxHeading:d(),atxHeadingSequence:I,autolink:d(),autolinkEmail:ve,autolinkProtocol:fe,blockQuote:d(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:ce,characterReference:de,codeFenced:d(C),codeFencedFence:k,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:z,codeIndented:d(S),codeText:d(V),codeTextData:z,data:z,definition:d(),definitionDestinationString:R,definitionLabelString:N,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(W),hardBreakTrailing:d(W),htmlFlow:d(J),htmlFlowData:z,htmlText:d(te),htmlTextData:z,image:d(G),label:ae,labelText:X,lineEnding:K,link:d(B),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:re,resourceDestinationString:M,resourceTitleString:P,resource:$,setextHeading:d(D),setextHeadingLineSequence:L,setextHeadingText:A,strong:d(),thematicBreak:d()}};G4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let F={type:"root",children:[]};const le={stack:[F],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Ce=[];let Re=-1;for(;++Re<Y.length;)if(Y[Re][1].type==="listOrdered"||Y[Re][1].type==="listUnordered")if(Y[Re][0]==="enter")Ce.push(Re);else{const Ve=Ce.pop();Re=s(Y,Ve,Re)}for(Re=-1;++Re<Y.length;){const Ve=t[Y[Re][0]];Y4.call(Ve,Y[Re][1].type)&&Ve[Y[Re][1].type].call(Object.assign({sliceSerialize:Y[Re][2].sliceSerialize},le),Y[Re][1])}if(le.tokenStack.length>0){const Ve=le.tokenStack[le.tokenStack.length-1];(Ve[1]||Qw).call(le,void 0,Ve[0])}for(F.position={start:ea(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:ea(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)F=t.transforms[Re](F)||F;return F}function s(Y,F,le){let Ce=F-1,Re=-1,Ve=!1,ot,et,dt,ut;for(;++Ce<=le;){const qe=Y[Ce];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?Re++:Re--,ut=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(ot&&!ut&&!Re&&!dt&&(dt=Ce),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Re&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||Re===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(ot){let Rt=Ce;for(et=void 0;Rt--;){const jt=Y[Rt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;et&&(Y[et][1].type="lineEndingBlank",Ve=!0),jt[1].type="lineEnding",et=Rt}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}dt&&(!et||dt<et)&&(ot._spread=!0),ot.end=Object.assign({},et?Y[et][1].start:qe[1].end),Y.splice(et||Ce,0,["exit",ot,qe[2]]),Ce++,le++}if(qe[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};ot=Rt,Y.splice(Ce,0,["enter",Rt,qe[2]]),Ce++,le++,dt=void 0,ut=!0}}}return Y[F][1]._spread=Ve,le}function a(Y,F){return le;function le(Ce){c.call(this,Y(Ce),Ce),F&&F.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Y,F,le){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([F,le||void 0]),Y.position={start:ea(F.start),end:void 0}}function d(Y){return F;function F(le){Y&&Y.call(this,le),f.call(this,le)}}function f(Y,F){const le=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==Y.type&&(F?F.call(this,Y,Ce[0]):(Ce[1]||Qw).call(this,Y,Ce[0]));else throw new Error("Cannot close `"+Y.type+"` ("+zc({start:Y.start,end:Y.end})+"): it’s not open");le.position.end=ea(Y.end)}function p(){return yy(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function b(Y){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function x(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.lang=Y}function v(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.meta=Y}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.value=Y.replace(/(\r?\n|\r)$/g,"")}function N(Y){const F=this.resume(),le=this.stack[this.stack.length-1];le.label=F,le.identifier=ps(this.sliceSerialize(Y)).toLowerCase()}function _(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.title=Y}function R(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.url=Y}function I(Y){const F=this.stack[this.stack.length-1];if(!F.depth){const le=this.sliceSerialize(Y).length;F.depth=le}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function L(Y){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function U(Y){const le=this.stack[this.stack.length-1].children;let Ce=le[le.length-1];(!Ce||Ce.type!=="text")&&(Ce=ie(),Ce.position={start:ea(Y.start),end:void 0},le.push(Ce)),this.stack.push(Ce)}function z(Y){const F=this.stack.pop();F.value+=this.sliceSerialize(Y),F.position.end=ea(Y.end)}function K(Y){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=F.children[F.children.length-1];le.position.end=ea(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&(U.call(this,Y),z.call(this,Y))}function W(){this.data.atHardBreak=!0}function J(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.value=Y}function te(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.value=Y}function V(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.value=Y}function B(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=F,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function G(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=F,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function X(Y){const F=this.sliceSerialize(Y),le=this.stack[this.stack.length-2];le.label=PK(F),le.identifier=ps(F).toLowerCase()}function ae(){const Y=this.stack[this.stack.length-1],F=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const Ce=Y.children;le.children=Ce}else le.alt=F}function M(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.url=Y}function P(){const Y=this.resume(),F=this.stack[this.stack.length-1];F.title=Y}function $(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function re(Y){const F=this.resume(),le=this.stack[this.stack.length-1];le.label=F,le.identifier=ps(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function oe(Y){this.data.characterReferenceType=Y.type}function ce(Y){const F=this.sliceSerialize(Y),le=this.data.characterReferenceType;let Ce;le?(Ce=m4(F,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=vy(F);const Re=this.stack[this.stack.length-1];Re.value+=Ce}function de(Y){const F=this.stack.pop();F.position.end=ea(Y.end)}function fe(Y){z.call(this,Y);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(Y)}function ve(Y){z.call(this,Y);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(Y)}function Fe(){return{type:"blockquote",children:[]}}function De(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ge(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function Me(){return{type:"html",value:""}}function we(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function Oe(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function je(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function ee(){return{type:"paragraph",children:[]}}function me(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function Q(){return{type:"thematicBreak"}}}function ea(e){return{line:e.line,column:e.column,offset:e.offset}}function G4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?G4(e,r):fJ(e,r)}}function fJ(e,t){let n;for(n in t)if(Y4.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Qw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zc({start:t.start,end:t.end})+") is still open")}function hJ(e){const t=this;t.parser=n;function n(r){return cJ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function mJ(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function pJ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
579
+ `}]}function gJ(e,t){const n=t.value?t.value+`
580
+ `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function bJ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xJ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yJ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=uu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function EJ(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 vJ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function K4(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 s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function TJ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return K4(e,t);const s={src:uu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function SJ(e,t){const n={src:uu(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 CJ(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 wJ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return K4(e,t);const s={href:uu(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kJ(e,t){const n={href:uu(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 NJ(e,t,n){const r=e.all(t),s=n?_J(n):X4(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
581
+ `}),p.type==="element"&&p.tagName==="p"&&!s?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
582
+ `});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function _J(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=X4(n[r])}return t}function X4(e){const t=e.spread;return t??e.children.length>1}function AJ(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function RJ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OJ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function IJ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MJ(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Fs(t.children[1]),d=ep(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function LJ(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let v={type:"element",tagName:a,properties:b,children:[]};m&&(v.children=e.all(m),e.patch(m,v),v=e.applyData(m,v)),f.push(v)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function DJ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Zw=9,Jw=32;function jJ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(ek(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(ek(t.slice(s),s>0,!1)),a.join("")}function ek(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Zw||a===Jw;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Zw||a===Jw;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function PJ(e,t){const n={type:"text",value:jJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function BJ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zJ={blockquote:mJ,break:pJ,code:gJ,delete:bJ,emphasis:xJ,footnoteReference:yJ,heading:EJ,html:vJ,imageReference:TJ,image:SJ,inlineCode:CJ,linkReference:wJ,link:kJ,listItem:NJ,list:AJ,paragraph:RJ,root:OJ,strong:IJ,table:MJ,tableCell:DJ,tableRow:LJ,text:PJ,thematicBreak:BJ,toml:oh,yaml:oh,definition:oh,footnoteDefinition:oh};function oh(){}function HJ(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 UJ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||HJ,r=e.options.footnoteBackLabel||UJ,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),b=uu(m.toLowerCase());let x=0;const v=[],k=e.footnoteCounts.get(m);for(;k!==void 0&&++x<=k;){v.length>0&&v.push({type:"text",value:" "});let N=typeof n=="string"?n:n(d,x);typeof N=="string"&&(N={type:"text",value:N}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const N=C.children[C.children.length-1];N&&N.type==="text"?N.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...v)}else p.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(f,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...yo(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
583
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
584
+ `}]}}const O1={}.hasOwnProperty,$J={};function VJ(e,t){const n=t||$J,r=new Map,s=new Map,a=new Map,l={...zJ,...n.handlers},c={all:f,applyData:YJ,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:qJ,wrap:KJ};return Ps(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:s,b=String(p.identifier).toUpperCase();m.has(b)||m.set(b,p)}}),c;function d(p,m){const b=p.type,x=c.handlers[b];if(O1.call(c.handlers,b)&&x)return x(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in p){const{children:k,...C}=p,S=yo(C);return S.children=c.all(p),S}return yo(p)}return(c.options.unknownHandler||GJ)(c,p,m)}function f(p){const m=[];if("children"in p){const b=p.children;let x=-1;for(;++x<b.length;){const v=c.one(b[x],p);if(v){if(x&&b[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=tk(v.value)),!Array.isArray(v)&&v.type==="element")){const k=v.children[0];k&&k.type==="text"&&(k.value=tk(k.value))}Array.isArray(v)?m.push(...v):m.push(v)}}}return m}}function qJ(e,t){e.position&&(t.position=$R(e))}function YJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,yo(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function GJ(e,t){const n=t.data||{},r="value"in t&&!(O1.call(n,"hProperties")||O1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
585
+ `});++r<e.length;)r&&n.push({type:"text",value:`
586
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
587
+ `}),n}function tk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nk(e,t){const n=VJ(e,t),r=n.one(e,void 0),s=FJ(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
588
+ `},s),a}function XJ(e,t){return e&&"run"in e?async function(n,r){const s=nk(n,{file:r,...t});await e.run(s,r)}:function(n,r){return nk(n,{file:r,...e||t})}}function rk(e){if(e)throw e}var gb,sk;function WJ(){if(sk)return gb;sk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return gb=function d(){var f,p,m,b,x,v,k=arguments[0],C=1,S=arguments.length,N=!1;for(typeof k=="boolean"&&(N=k,k=arguments[1]||{},C=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});C<S;++C)if(f=arguments[C],f!=null)for(p in f)m=c(k,p),b=c(f,p),k!==b&&(N&&b&&(a(b)||(x=s(b)))?(x?(x=!1,v=m&&s(m)?m:[]):v=m&&a(m)?m:{},l(k,{name:p,newValue:d(N,v,b)})):typeof b<"u"&&l(k,{name:p,newValue:b}));return k},gb}var QJ=WJ();const bb=dm(QJ);function I1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZJ(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<s.length;)(f[m]===null||f[m]===void 0)&&(f[m]=s[m]);s=f,p?JJ(p,c)(...f):l(null,...f)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function JJ(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(s);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return s(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...c){n||(n=!0,t(l,...c))}function a(l){s(null,l)}}const As={basename:eee,dirname:tee,extname:nee,join:ree,sep:"/"};function eee(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bd(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function tee(e){if(bd(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 nee(e){bd(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function ree(...e){let t=-1,n;for(;++t<e.length;)bd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":see(n)}function see(e){bd(e);const t=e.codePointAt(0)===47;let n=iee(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iee(e,t){let n="",r=0,s=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function bd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aee={cwd:oee};function oee(){return"/"}function M1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lee(e){if(typeof e=="string")e=new URL(e);else if(!M1(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 uee(e)}function uee(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(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const xb=["history","path","basename","stem","extname","dirname"];class cee{constructor(t){let n;t?M1(t)?n={path:t}:typeof t=="string"||dee(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aee.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xb.length;){const a=xb[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)xb.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?As.basename(this.path):void 0}set basename(t){Eb(t,"basename"),yb(t,"basename"),this.path=As.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?As.dirname(this.path):void 0}set dirname(t){ik(this.basename,"dirname"),this.path=As.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?As.extname(this.path):void 0}set extname(t){if(yb(t,"extname"),ik(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=As.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){M1(t)&&(t=lee(t)),Eb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?As.basename(this.path,this.extname):void 0}set stem(t){Eb(t,"stem"),yb(t,"stem"),this.path=As.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new cr(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function yb(e,t){if(e&&e.includes(As.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+As.sep+"`")}function Eb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ik(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function dee(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fee=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),hee={}.hasOwnProperty;class Ay extends fee{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZJ()}copy(){const t=new Ay;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Sb("data",this.frozen),this.namespace[t]=n,this):hee.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=lh(t),r=this.parser||this.Parser;return vb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vb("process",this.parser||this.Parser),Tb("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const c=lh(t),d=r.parse(c);r.run(d,c,function(p,m,b){if(p||!m||!b)return f(p);const x=m,v=r.stringify(x,b);gee(v)?b.value=v:b.result=v,f(p,b)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),vb("processSync",this.parser||this.Parser),Tb("processSync",this.compiler||this.Compiler),this.process(t,s),ok("processSync","process",n),r;function s(a,l){n=!0,rk(a),r=l}}run(t,n,r){ak(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const d=lh(n);s.run(t,d,f);function f(p,m,b){const x=m||t;p?c(p):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),ok("runSync","run",r),s;function a(l,c){rk(l),s=c,r=!0}}stringify(t,n){this.freeze();const r=lh(n),s=this.compiler||this.Compiler;return Tb("stringify",s),ak(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Sb("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(s.settings=bb(!0,s.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,b=-1;for(;++m<r.length;)if(r[m][0]===f){b=m;break}if(b===-1)r.push([f,...p]);else if(p.length>0){let[x,...v]=p;const k=r[b][1];I1(k)&&I1(x)&&(x=bb(!0,k,x)),r[b]=[f,x,...v]}}}}const mee=new Ay().freeze();function vb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sb(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 ak(e){if(!I1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ok(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lh(e){return pee(e)?e:new cee(e)}function pee(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function gee(e){return typeof e=="string"||bee(e)}function bee(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Ry(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Po=Ry();function W4(e){Po=e}var Za={exec:()=>null};function Bt(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(pr.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var xee=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),pr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},yee=/^(?:[ \t]*(?:\n|$))+/,Eee=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tee=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Oy=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Q4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Z4=Bt(Q4).replace(/bull/g,Oy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),See=Bt(Q4).replace(/bull/g,Oy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Iy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Cee=/^[^\n]+/,My=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wee=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",My).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kee=Bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oy).getRegex(),sp="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ly=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Nee=Bt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ly).replace("tag",sp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),J4=Bt(Iy).replace("hr",xd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sp).getRegex(),_ee=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",J4).getRegex(),Dy={blockquote:_ee,code:Eee,def:wee,fences:vee,heading:Tee,hr:xd,html:Nee,lheading:Z4,list:kee,newline:yee,paragraph:J4,table:Za,text:Cee},lk=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sp).getRegex(),Aee={...Dy,lheading:See,table:lk,paragraph:Bt(Iy).replace("hr",xd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sp).getRegex()},Ree={...Dy,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ly).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Za,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(Iy).replace("hr",xd).replace("heading",` *#{1,6} *[^
589
+ ]`).replace("lheading",Z4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oee=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Iee=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,eO=/^( {2,}|\\)\n(?!\s*$)/,Mee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cu=/[\p{P}\p{S}]/u,ip=/[\s\p{P}\p{S}]/u,jy=/[^\s\p{P}\p{S}]/u,Lee=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ip).getRegex(),tO=/(?!~)[\p{P}\p{S}]/u,Dee=/(?!~)[\s\p{P}\p{S}]/u,jee=/(?:[^\s\p{P}\p{S}]|~)/u,Pee=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xee?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nO=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bee=Bt(nO,"u").replace(/punct/g,cu).getRegex(),zee=Bt(nO,"u").replace(/punct/g,tO).getRegex(),rO="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Hee=Bt(rO,"gu").replace(/notPunctSpace/g,jy).replace(/punctSpace/g,ip).replace(/punct/g,cu).getRegex(),Uee=Bt(rO,"gu").replace(/notPunctSpace/g,jee).replace(/punctSpace/g,Dee).replace(/punct/g,tO).getRegex(),Fee=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,jy).replace(/punctSpace/g,ip).replace(/punct/g,cu).getRegex(),$ee=Bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,cu).getRegex(),Vee="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",qee=Bt(Vee,"gu").replace(/notPunctSpace/g,jy).replace(/punctSpace/g,ip).replace(/punct/g,cu).getRegex(),Yee=Bt(/\\(punct)/,"gu").replace(/punct/g,cu).getRegex(),Gee=Bt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Kee=Bt(Ly).replace("(?:-->|$)","-->").getRegex(),Xee=Bt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Kee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Wee=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",sm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sO=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",sm).replace("ref",My).getRegex(),iO=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",My).getRegex(),Qee=Bt("reflink|nolink(?!\\()","g").replace("reflink",sO).replace("nolink",iO).getRegex(),uk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Py={_backpedal:Za,anyPunctuation:Yee,autolink:Gee,blockSkip:Pee,br:eO,code:Iee,del:Za,delLDelim:Za,delRDelim:Za,emStrongLDelim:Bee,emStrongRDelimAst:Hee,emStrongRDelimUnd:Fee,escape:Oee,link:Wee,nolink:iO,punctuation:Lee,reflink:sO,reflinkSearch:Qee,tag:Xee,text:Mee,url:Za},Zee={...Py,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",sm).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sm).getRegex()},L1={...Py,emStrongRDelimAst:Uee,emStrongLDelim:zee,delLDelim:$ee,delRDelim:qee,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",uk).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",uk).getRegex()},Jee={...L1,br:Bt(eO).replace("{2,}","*").getRegex(),text:Bt(L1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uh={normal:Dy,gfm:Aee,pedantic:Ree},pc={normal:Py,gfm:L1,breaks:Jee,pedantic:Zee},ete={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ck=e=>ete[e];function _s(e,t){if(t){if(pr.escapeTest.test(e))return e.replace(pr.escapeReplace,ck)}else if(pr.escapeTestNoEncode.test(e))return e.replace(pr.escapeReplaceNoEncode,ck);return e}function dk(e){try{e=encodeURI(e).replace(pr.percentDecode,"%")}catch{return null}return e}function fk(e,t){let n=e.replace(pr.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=n.split(pr.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(pr.slashPipe,"|");return r}function gc(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function tte(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function nte(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=s,n++;return r}function hk(e,t,n,r,s){let a=t.href,l=t.title||null,c=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,d}function rte(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
590
+ `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[c]=l;return c.length>=s.length?a.slice(s.length):a}).join(`
591
+ `)}var im=class{options;rules;lexer;constructor(e){this.options=e||Po}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:gc(n,`
592
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=rte(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=gc(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:gc(t[0],`
593
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=gc(t[0],`
594
+ `).split(`
595
+ `),r="",s="",a=[];for(;n.length>0;){let l=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),l=!0;else if(!l)c.push(n[d]);else break;n=n.slice(d);let f=c.join(`
596
+ `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
597
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
598
+ ${f}`:f,s=s?`${s}
599
+ ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=m,n.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,v=x.raw+`
600
+ `+n.join(`
601
+ `),k=this.blockquote(v);a[a.length-1]=k,r=r.substring(0,r.length-x.raw.length)+k.raw,s=s.substring(0,s.length-x.text.length)+k.text;break}else if(b?.type==="list"){let x=b,v=x.raw+`
602
+ `+n.join(`
603
+ `),k=this.list(v);a[a.length-1]=k,r=r.substring(0,r.length-b.raw.length)+k.raw,s=s.substring(0,s.length-x.raw.length)+k.raw,n=v.substring(a.at(-1).raw.length).split(`
604
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;e;){let d=!1,f="",p="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let m=nte(t[2].split(`
605
+ `,1)[0],t[1].length),b=e.split(`
606
+ `,1)[0],x=!m.trim(),v=0;if(this.options.pedantic?(v=2,p=m.trimStart()):x?v=t[1].length+1:(v=m.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=m.slice(v),v+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(f+=b+`
607
+ `,e=e.substring(b.length+1),d=!0),!d){let k=this.rules.other.nextBulletRegex(v),C=this.rules.other.hrRegex(v),S=this.rules.other.fencesBeginRegex(v),N=this.rules.other.headingBeginRegex(v),_=this.rules.other.htmlBeginRegex(v),R=this.rules.other.blockquoteBeginRegex(v);for(;e;){let I=e.split(`
608
+ `,1)[0],A;if(b=I,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),A=b):A=b.replace(this.rules.other.tabCharGlobal," "),S.test(b)||N.test(b)||_.test(b)||R.test(b)||k.test(b)||C.test(b))break;if(A.search(this.rules.other.nonSpaceChar)>=v||!b.trim())p+=`
609
+ `+A.slice(v);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(m)||N.test(m)||C.test(m))break;p+=`
610
+ `+b}x=!b.trim(),f+=I+`
611
+ `,e=e.substring(I.length+1),m=A.slice(v)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0)),s.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),s.raw+=f}let c=s.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let d of s.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,s.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!s.loose){let f=d.tokens.filter(m=>m.type==="space"),p=f.length>0&&f.some(m=>this.rules.other.anyLine.test(m.raw));s.loose=p}}if(s.loose)for(let d of s.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=fk(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
612
+ `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of s)a.rows.push(fk(l,a.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[d]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
613
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=gc(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=tte(t[2],"()");if(a===-2)return;if(a>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),hk(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return hk(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,c=s,d=0,f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+s);(r=f.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let p=[...r[0]][0].length,m=e.slice(0,s+r.index+p+l);if(Math.min(s,l)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let b=m.slice(2,-2);return{type:"strong",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,c=s,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==s))continue;if(r[3]||r[4]){c+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c);let f=[...r[0]][0].length,p=e.slice(0,s+r.index+f+l),m=p.slice(s,-s);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},os=class D1{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Po,this.options.tokenizer=this.options.tokenizer||new im,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:pr,block:uh.normal,inline:pc.normal};this.options.pedantic?(n.block=uh.pedantic,n.inline=pc.pedantic):this.options.gfm&&(n.block=uh.gfm,this.options.breaks?n.inline=pc.breaks:n.inline=pc.gfm),this.tokenizer.rules=n}static get rules(){return{block:uh,inline:pc}}static lex(t,n){return new D1(n).lex(t)}static lexInline(t,n){return new D1(n).inlineTokens(t)}lex(t){t=t.replace(pr.carriageReturn,`
614
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(pr.tabCharGlobal," ").replace(pr.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(l=>(s=l.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=n.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
615
+ `:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
616
+ `)?"":`
617
+ `)+s.raw,l.text+=`
618
+ `+s.text,this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
619
+ `)?"":`
620
+ `)+s.raw,l.text+=`
621
+ `+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let l=1/0,c=t.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},c),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
622
+ `)?"":`
623
+ `)+s.raw,l.text+=`
624
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s),r=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
625
+ `)?"":`
626
+ `)+s.raw,l.text+=`
627
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=s[2]?s[2].length:0,r=r.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,c="";for(;t;){l||(c=""),l=!1;let d;if(this.options.extensions?.inline?.some(p=>(d=p.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let p=n.at(-1);d.type==="text"&&p?.type==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,c)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t,r,c)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if(this.options.extensions?.startInline){let p=1/0,m=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},m),typeof b=="number"&&b>=0&&(p=Math.min(p,b))}),p<1/0&&p>=0&&(f=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(c=d.raw.slice(-1)),l=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=d.raw,p.text+=d.text):n.push(d);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},am=class{options;parser;constructor(t){this.options=t||Po}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(pr.notSpaceStart)?.[0],a=t.replace(pr.endingNewline,"")+`
628
+ `;return s?'<pre><code class="language-'+_s(s)+'">'+(r?a:_s(a,!0))+`</code></pre>
629
+ `:"<pre><code>"+(r?a:_s(a,!0))+`</code></pre>
630
+ `}blockquote({tokens:t}){return`<blockquote>
631
+ ${this.parser.parse(t)}</blockquote>
632
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
633
+ `}hr(t){return`<hr>
634
+ `}list(t){let n=t.ordered,r=t.start,s="";for(let c=0;c<t.items.length;c++){let d=t.items[c];s+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
635
+ `+s+"</"+a+`>
636
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
637
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
638
+ `}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let s="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];r="";for(let c=0;c<l.length;c++)r+=this.tablecell(l[c]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
639
+ <thead>
640
+ `+n+`</thead>
641
+ `+s+`</table>
642
+ `}tablerow({text:t}){return`<tr>
643
+ ${t}</tr>
644
+ `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
645
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${_s(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let s=this.parser.parseInline(r),a=dk(t);if(a===null)return s;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+_s(n)+'"'),l+=">"+s+"</a>",l}image({href:t,title:n,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let a=dk(t);if(a===null)return _s(r);t=a;let l=`<img src="${t}" alt="${_s(r)}"`;return n&&(l+=` title="${_s(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:_s(t.text)}},By=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ms=class j1{options;renderer;textRenderer;constructor(t){this.options=t||Po,this.options.renderer=this.options.renderer||new am,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new By}static parse(t,n){return new j1(n).parse(t)}static parseInline(t,n){return new j1(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},kc=class{options;block;constructor(e){this.options=e||Po}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?os.lex:os.lexInline}provideParser(e=this.block){return e?ms.parse:ms.parseInline}},ste=class{defaults=Ry();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ms;Renderer=am;TextRenderer=By;Lexer=os;Tokenizer=im;Hooks=kc;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=n.renderers[a.name];l?n.renderers[a.name]=function(...c){let d=a.renderer.apply(this,c);return d===!1&&(d=l.apply(this,c)),d}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=n[a.level];l?l.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),s.extensions=n),r.renderer){let a=this.defaults.renderer||new am(this.defaults);for(let l in r.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let c=l,d=r.renderer[c],f=a[c];a[c]=(...p)=>{let m=d.apply(a,p);return m===!1&&(m=f.apply(a,p)),m||""}}s.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new im(this.defaults);for(let l in r.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let c=l,d=r.tokenizer[c],f=a[c];a[c]=(...p)=>{let m=d.apply(a,p);return m===!1&&(m=f.apply(a,p)),m}}s.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new kc;for(let l in r.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let c=l,d=r.hooks[c],f=a[c];kc.passThroughHooks.has(l)?a[c]=p=>{if(this.defaults.async&&kc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,p);return f.call(a,b)})();let m=d.call(a,p);return f.call(a,m)}:a[c]=(...p)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,p);return b===!1&&(b=await f.apply(a,p)),b})();let m=d.apply(a,p);return m===!1&&(m=f.apply(a,p)),m}}s.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(c){let d=[];return d.push(l.call(this,c)),a&&(d=d.concat(a.call(this,c))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return os.lex(t,n??this.defaults)}parser(t,n){return ms.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let s={...r},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let c=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?os.lex:os.lexInline)(c,a),f=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(f,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?ms.parse:ms.parseInline)(f,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let c=(a.hooks?a.hooks.provideLexer(t):t?os.lex:os.lexInline)(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?ms.parse:ms.parseInline)(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(t,n){return r=>{if(r.message+=`
646
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+_s(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},vo=new ste;function Wt(e,t){return vo.parse(e,t)}Wt.options=Wt.setOptions=function(e){return vo.setOptions(e),Wt.defaults=vo.defaults,W4(Wt.defaults),Wt};Wt.getDefaults=Ry;Wt.defaults=Po;Wt.use=function(...e){return vo.use(...e),Wt.defaults=vo.defaults,W4(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return vo.walkTokens(e,t)};Wt.parseInline=vo.parseInline;Wt.Parser=ms;Wt.parser=ms.parse;Wt.Renderer=am;Wt.TextRenderer=By;Wt.Lexer=os;Wt.lexer=os.lex;Wt.Tokenizer=im;Wt.Hooks=kc;Wt.parse=Wt;Wt.options;Wt.setOptions;Wt.use;Wt.walkTokens;Wt.parseInline;ms.parse;os.lex;var ite=300,ate="300px",ote=500;function lte(e={}){let{immediate:t=!1,debounceDelay:n=ite,rootMargin:r=ate,idleTimeout:s=ote}=e,[a,l]=y.useState(!1),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=y.useMemo(()=>x=>{let v=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),m=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,v)=>window.requestIdleCallback(x,v):p,[p]),b=y.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?x=>window.cancelIdleCallback(x):x=>{clearTimeout(x)},[]);return y.useEffect(()=>{if(t){l(!0);return}let x=c.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),f.current&&(b(f.current),f.current=null)},k=_=>{f.current=m(R=>{R.timeRemaining()>0||R.didTimeout?(l(!0),_.disconnect()):f.current=m(()=>{l(!0),_.disconnect()},{timeout:s/2})},{timeout:s})},C=_=>{v(),d.current=window.setTimeout(()=>{var R,I;let A=_.takeRecords();(A.length===0||(I=(R=A.at(-1))==null?void 0:R.isIntersecting)!=null&&I)&&k(_)},n)},S=(_,R)=>{_.isIntersecting?C(R):v()},N=new IntersectionObserver(_=>{for(let R of _)S(R,N)},{rootMargin:r,threshold:0});return N.observe(x),()=>{d.current&&clearTimeout(d.current),f.current&&b(f.current),N.disconnect()}},[t,n,r,s,b,m]),{shouldRender:a,containerRef:c}}var aO=/\s/,ute=/^\s+$/,cte=new Set(["code","pre","svg","math","annotation"]),dte=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",fte=e=>e.some(t=>dte(t)&&cte.has(t.tagName)),hte=e=>{let t=[],n="",r=!1;for(let s of e){let a=aO.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},mte=e=>{let t=[],n="";for(let r of e)aO.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},pte=(e,t,n,r,s,a)=>{let l=`--sd-animation:sd-${t};--sd-duration:${s?0:n}ms;--sd-easing:${r}`;return a&&(l+=`;--sd-delay:${a}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:l},children:[{type:"text",value:e}]}},gte=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(fte(t))return Il;let l=a,c=l.children.indexOf(e);if(c===-1)return;let d=e.value;if(!d.trim()){s.count+=d.length;return}let f=n.sep==="char"?mte(d):hte(d),p=r.prevContentLength,m=f.map(b=>{let x=s.count;if(s.count+=b.length,ute.test(b))return{type:"text",value:b};let v=p>0&&x<p,k=v?0:s.newIndex++*n.stagger;return pte(b,n.animation,n.duration,n.easing,v,k)});return l.children.splice(c,1,...m),c+m.length},bte=0;function P1(e){var t,n,r,s,a;let l={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(s=e?.sep)!=null?s:"word",stagger:(a=e?.stagger)!=null?a:40},c={prevContentLength:0,lastRenderCharCount:0},d=bte++,f=()=>p=>{let m={count:0,newIndex:0};ay(p,"text",(b,x)=>gte(b,x,l,c,m)),c.lastRenderCharCount=m.count,c.prevContentLength=0};return Object.defineProperty(f,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:f,setPrevContentLength(p){c.prevContentLength=p},getLastRenderCharCount(){let p=c.lastRenderCharCount;return c.lastRenderCharCount=0,p}}}P1();var oO=y.createContext(!1),xte=()=>y.useContext(oO),zy=(...e)=>t3(gm(e)),yte=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},Ete=e=>e?(...t)=>yte(e,t3(gm(t))):zy,zl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",s=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},B1=y.createContext(zy),wt=()=>y.useContext(B1),vte=zy("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Tte=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),a=n.slice(r+1).trim();s&&a&&(t[s]=a)}}return t},Ste=y.memo(({children:e,result:t,language:n,className:r,startLine:s,lineNumbers:a=!0,...l})=>{let c=wt(),d=y.useMemo(()=>c(vte),[c]),f=y.useMemo(()=>{let p={};return t.bg&&(p["--sdm-bg"]=t.bg),t.fg&&(p["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(p,Tte(t.rootStyle)),p},[t.bg,t.fg,t.rootStyle]);return h.jsx("div",{className:c(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...l,children:h.jsx("pre",{className:c(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:f,children:h.jsx("code",{className:a?c("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((p,m)=>h.jsx("span",{className:a?d:void 0,children:p.length===0||p.length===1&&p[0].content===""?`
647
+ `:p.map((b,x)=>{let v={},k=!!b.bgColor;if(b.color&&(v["--sdm-c"]=b.color),b.bgColor&&(v["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[C,S]of Object.entries(b.htmlStyle))C==="color"?v["--sdm-c"]=S:C==="background-color"?(v["--sdm-tbg"]=S,k=!0):v[C]=S;return h.jsx("span",{className:c("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",k&&"bg-[var(--sdm-tbg)]",k&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...b.htmlAttrs,children:b.content},x)})},m))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Cte=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=wt();return h.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},lO=y.createContext({code:""}),uO=()=>y.useContext(lO),wte=({language:e})=>{let t=wt();return h.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:h.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},kte=e=>{let t=e.length;for(;t>0&&e[t-1]===`
648
+ `;)t--;return e.slice(0,t)},Nte=y.lazy(()=>Kl(()=>import("./highlighted-body-OFNGDK62-B0YOLbpA.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),_te=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,lineNumbers:l,...c})=>{let d=wt(),f=y.useMemo(()=>kte(e),[e]),p=y.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:f.split(`
649
+ `).map(m=>[{content:m,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[f]);return h.jsx(lO.Provider,{value:{code:e},children:h.jsxs(Cte,{isIncomplete:s,language:t,children:[h.jsx(wte,{language:t}),r?h.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,h.jsx(y.Suspense,{fallback:h.jsx(Ste,{className:n,language:t,lineNumbers:l,result:p,startLine:a,...c}),children:h.jsx(Nte,{className:n,code:f,language:t,lineNumbers:l,raw:p,startLine:a,...c})})]})})},Ate=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Rte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Ote=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Ite=e=>h.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[h.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),h.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Mte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Lte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),Dte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),jte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Pte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Bte=e=>h.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:h.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Nc={CheckIcon:Ate,CopyIcon:Rte,DownloadIcon:Ote,ExternalLinkIcon:jte,Loader2Icon:Ite,Maximize2Icon:Mte,RotateCcwIcon:Lte,XIcon:Dte,ZoomInIcon:Pte,ZoomOutIcon:Bte},cO=y.createContext(Nc),zte=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>e[s]===t[s])},mk=({icons:e,children:t})=>{let n=y.useRef(e),r=y.useRef(e?{...Nc,...e}:Nc);zte(n.current,e)||(n.current=e,r.current=e?{...Nc,...e}:Nc);let s=r.current;return h.jsx(cO.Provider,{value:s,children:t})},Es=()=>y.useContext(cO),dO={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},z1=y.createContext(dO),Ni=()=>y.useContext(z1),pk=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...l})=>{let c=wt(),[d,f]=y.useState(!1),p=y.useRef(0),{code:m}=uO(),{isAnimating:b}=y.useContext(Yr),x=Ni(),v=a??m,k=async()=>{var N;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),f(!0),e?.(),p.current=window.setTimeout(()=>f(!1),n))}catch(_){t?.(_)}};y.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let C=Es(),S=d?C.CheckIcon:C.CopyIcon;return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:b,onClick:k,title:x.copyCode,type:"button",...l,children:r??h.jsx(S,{size:14})})},gk={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Hte=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...l})=>{let c=wt(),{code:d}=uO(),{isAnimating:f}=y.useContext(Yr),p=Ni(),m=Es(),b=a??d,x=`file.${n&&n in gk?gk[n]:"txt"}`,v="text/plain",k=()=>{try{zl(x,b,v),e?.()}catch(C){t?.(C)}};return h.jsx("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:f,onClick:k,title:p.downloadFile,type:"button",...l,children:r??h.jsx(m.DownloadIcon,{size:14})})},bk=()=>{let{Loader2Icon:e}=Es(),t=wt();return h.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[h.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),h.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:h.jsx(e,{className:t("size-4 animate-spin")})})]})},Ute=/\.[^/.]+$/,Fte=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...l})=>{let{DownloadIcon:c}=Es(),d=wt(),f=y.useRef(null),[p,m]=y.useState(!1),[b,x]=y.useState(!1),v=Ni(),k=l.width!=null||l.height!=null,C=(p||k)&&!b,S=b&&!k;y.useEffect(()=>{let I=f.current;if(I!=null&&I.complete){let A=I.naturalWidth>0;m(A),x(!A)}},[]);let N=y.useCallback(I=>{m(!0),x(!1),s?.(I)},[s]),_=y.useCallback(I=>{m(!1),x(!0),a?.(I)},[a]),R=async()=>{if(n)try{let I=await(await fetch(n)).blob(),A=new URL(n,window.location.origin).pathname.split("/").pop()||"",L=A.split(".").pop(),D=A.includes(".")&&L!==void 0&&L.length<=4,U="";if(D)U=A;else{let z=I.type,K="png";z.includes("jpeg")||z.includes("jpg")?K="jpg":z.includes("png")?K="png":z.includes("svg")?K="svg":z.includes("gif")?K="gif":z.includes("webp")&&(K="webp"),U=`${(r||A||"image").replace(Ute,"")}.${K}`}zl(U,I,I.type)}catch{window.open(n,"_blank")}};return n?h.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[h.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:_,onLoad:N,ref:f,src:n,...l}),S&&h.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),h.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),C&&h.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:R,title:v.downloadImage,type:"button",children:h.jsx(c,{size:14})})]}):null},Hc=0,Hy=()=>{Hc+=1,Hc===1&&(document.body.style.overflow="hidden")},Uy=()=>{Hc=Math.max(0,Hc-1),Hc===0&&(document.body.style.overflow="")},$te=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:l,XIcon:c}=Es(),d=wt(),[f,p]=y.useState(!1),m=Ni(),b=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),x=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){Hy();let v=k=>{k.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),Uy()}}},[t,n]),t?h.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:h.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[h.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:m.close,type:"button",children:h.jsx(c,{size:16})}),h.jsxs("div",{className:d("flex flex-col gap-2"),children:[h.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[h.jsx(l,{size:20}),h.jsx("span",{children:m.openExternalLink})]}),h.jsx("p",{className:d("text-muted-foreground text-sm"),children:m.externalLinkWarning})]}),h.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),h.jsxs("div",{className:d("flex gap-2"),children:[h.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:b,type:"button",children:f?h.jsxs(h.Fragment,{children:[h.jsx(s,{size:14}),h.jsx("span",{children:m.copied})]}):h.jsxs(h.Fragment,{children:[h.jsx(a,{size:14}),h.jsx("span",{children:m.copyLink})]})}),h.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:x,type:"button",children:[h.jsx(l,{size:14}),h.jsx("span",{children:m.openLink})]})]})]})}):null},H1=y.createContext(null),Fy=()=>y.useContext(H1),Hie=()=>{var e;let t=Fy();return(e=t?.code)!=null?e:null},$y=()=>{var e;let t=Fy();return(e=t?.mermaid)!=null?e:null},Vte=e=>{var t;let n=Fy();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},qte=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,a)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let d=document.createElement("canvas"),f=c.width*r,p=c.height*r;d.width=f,d.height=p;let m=d.getContext("2d");if(!m){a(new Error("Failed to create 2D canvas context for PNG export"));return}m.drawImage(c,0,0,f,p),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}s(b)},"image/png")},c.onerror=()=>a(new Error("Failed to load SVG image")),c.src=l})},Yte=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let l=wt(),[c,d]=y.useState(!1),f=y.useRef(null),{isAnimating:p}=y.useContext(Yr),m=Es(),b=$y(),x=Ni(),v=async k=>{try{if(k==="mmd"){zl("diagram.mmd",e,"text/plain"),d(!1),r?.(k);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let C=b.getMermaid(s),S=e.split("").reduce((R,I)=>(R<<5)-R+I.charCodeAt(0)|0,0),N=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:_}=await C.render(N,e);if(!_){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(k==="svg"){zl("diagram.svg",_,"image/svg+xml"),d(!1),r?.(k);return}if(k==="png"){let R=await qte(_);zl("diagram.png",R,"image/png"),r?.(k),d(!1);return}}catch(C){a?.(C)}};return y.useEffect(()=>{let k=C=>{let S=C.composedPath();f.current&&!S.includes(f.current)&&d(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.jsxs("div",{className:l("relative"),ref:f,children:[h.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>d(!c),title:x.downloadDiagram,type:"button",children:t??h.jsx(m.DownloadIcon,{size:14})}),c?h.jsxs("div",{className:l("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),h.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},Gte=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:l,XIcon:c}=Es(),d=wt(),[f,p]=y.useState(!1),{isAnimating:m,controls:b}=y.useContext(Yr),x=Ni(),v=(()=>{if(typeof b=="boolean")return b;let C=b.mermaid;return C===!1?!1:C===!0||C===void 0?!0:C.panZoom!==!1})(),k=()=>{p(!f)};return y.useEffect(()=>{if(f){Hy();let C=S=>{S.key==="Escape"&&p(!1)};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C),Uy()}}},[f]),y.useEffect(()=>{f?n?.():r&&r()},[f,n,r]),h.jsxs(h.Fragment,{children:[h.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:m,onClick:k,title:x.viewFullscreen,type:"button",...a,children:h.jsx(l,{size:14})}),f?lr.createPortal(h.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:k,onKeyDown:C=>{C.key==="Escape"&&k()},role:"button",tabIndex:0,children:[h.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:k,title:x.exitFullscreen,type:"button",children:h.jsx(c,{size:20})}),h.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),role:"presentation",children:h.jsx(YO,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},fO=e=>{var t,n;let r=[],s=[],a=e.querySelectorAll("thead th");for(let c of a)r.push(((t=c.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let c of l){let d=[],f=c.querySelectorAll("td");for(let p of f)d.push(((n=p.textContent)==null?void 0:n.trim())||"");s.push(d)}return{headers:r,rows:s}},hO=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1,f=!1;for(let p of c){if(p==='"'){d=!0,f=!0;break}(p===","||p===`
650
+ `)&&(d=!0)}return d?f?`"${c.replace(/"/g,'""')}"`:`"${c}"`:c},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(","),l+=1);for(let c of n)a[l]=c.map(r).join(","),l+=1;return a.join(`
651
+ `)},Kte=e=>{let{headers:t,rows:n}=e,r=c=>{let d=!1;for(let p of c)if(p===" "||p===`
652
+ `||p==="\r"){d=!0;break}if(!d)return c;let f=[];for(let p of c)p===" "?f.push("\\t"):p===`
653
+ `?f.push("\\n"):p==="\r"?f.push("\\r"):f.push(p);return f.join("")},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(" "),l+=1);for(let c of n)a[l]=c.map(r).join(" "),l+=1;return a.join(`
654
+ `)},Cb=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},U1=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,a=t.map(c=>Cb(c));r[s]=`| ${a.join(" | ")} |`,s+=1;let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]="---";r[s]=`| ${l.join(" | ")} |`,s+=1;for(let c of n)if(c.length<t.length){let d=new Array(t.length);for(let f=0;f<t.length;f+=1)d[f]=f<c.length?Cb(c[f]):"";r[s]=`| ${d.join(" | ")} |`,s+=1}else{let d=c.map(f=>Cb(f));r[s]=`| ${d.join(" | ")} |`,s+=1}return r.join(`
655
+ `)},mO=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=wt(),[l,c]=y.useState(!1),[d,f]=y.useState(!1),p=y.useRef(null),m=y.useRef(0),{isAnimating:b}=y.useContext(Yr),x=Ni(),v=async S=>{var N,_;if(typeof window>"u"||!((N=navigator?.clipboard)!=null&&N.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(_=p.current)==null?void 0:_.closest('[data-streamdown="table-wrapper"]'),I=R?.querySelector("table");if(!I){r?.(new Error("Table not found"));return}let A=fO(I),L=({csv:hO,tsv:Kte,md:U1}[S]||U1)(A),D=new ClipboardItem({"text/plain":new Blob([L],{type:"text/plain"}),"text/html":new Blob([I.outerHTML],{type:"text/html"})});await navigator.clipboard.write([D]),f(!0),c(!1),n?.(S),m.current=window.setTimeout(()=>f(!1),s)}catch(R){r?.(R)}};y.useEffect(()=>{let S=N=>{let _=N.composedPath();p.current&&!_.includes(p.current)&&c(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(m.current)}},[]);let k=Es(),C=d?k.CheckIcon:k.CopyIcon;return h.jsxs("div",{className:a("relative"),ref:p,children:[h.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:b,onClick:()=>c(!l),title:x.copyTable,type:"button",children:e??h.jsx(C,{height:14,width:14})}),l?h.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),h.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},pO=({children:e,className:t,onDownload:n,onError:r})=>{let s=wt(),[a,l]=y.useState(!1),c=y.useRef(null),{isAnimating:d}=y.useContext(Yr),f=Ni(),p=Es(),m=b=>{var x;try{let v=(x=c.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),k=v?.querySelector("table");if(!k){r?.(new Error("Table not found"));return}let C=fO(k),S=b==="csv"?hO(C):U1(C);zl(`table.${b==="csv"?"csv":"md"}`,S,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(v){r?.(v)}};return y.useEffect(()=>{let b=x=>{let v=x.composedPath();c.current&&!v.includes(c.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),h.jsxs("div",{className:s("relative"),ref:c,children:[h.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>l(!a),title:f.downloadTable,type:"button",children:e??h.jsx(p.DownloadIcon,{size:14})}),a?h.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[h.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("csv"),title:f.downloadTableAsCsv,type:"button",children:f.tableFormatCsv}),h.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("markdown"),title:f.downloadTableAsMarkdown,type:"button",children:f.tableFormatMarkdown})]}):null]})},Xte=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=Es(),l=wt(),[c,d]=y.useState(!1),{isAnimating:f}=y.useContext(Yr),p=Ni(),m=()=>{d(!0)},b=()=>{d(!1)};return y.useEffect(()=>{if(c){Hy();let x=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),Uy()}}},[c]),h.jsxs(h.Fragment,{children:[h.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:m,title:p.viewFullscreen,type:"button",children:h.jsx(s,{size:14})}),c?lr.createPortal(h.jsx("div",{"aria-label":p.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:b,onKeyDown:x=>{x.key==="Escape"&&b()},role:"dialog",children:h.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[h.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?h.jsx(mO,{}):null,r?h.jsx(pO,{}):null,h.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:p.exitFullscreen,type:"button",children:h.jsx(a,{size:20})})]}),h.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:h.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},Wte=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...l})=>{let c=wt(),d=n&&r,f=n&&s,p=n&&a,m=d||f||p;return h.jsxs("div",{className:c("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[m?h.jsxs("div",{className:c("flex items-center justify-end gap-1"),children:[d?h.jsx(mO,{}):null,f?h.jsx(pO,{}):null,p?h.jsx(Xte,{showCopy:d,showDownload:f,children:e}):null]}):null,h.jsx("div",{className:c("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:h.jsx("table",{className:c("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},Qte=/startLine=(\d+)/,Zte=/\bnoLineNumbers\b/,Jte=y.lazy(()=>Kl(()=>Promise.resolve().then(()=>Pie),void 0).then(e=>({default:e.Mermaid}))),ene=/language-([^\s]+)/;function ap(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&s?.line===a?.line&&s?.column===a?.column}function vn(e,t){return e.className===t.className&&ap(e.node,t.node)}var F1=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,wb=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},xk=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},ch=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Vy=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>vn(e,t));Vy.displayName="MarkdownOl";var gO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&ap(e.node,t.node));gO.displayName="MarkdownLi";var bO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>vn(e,t));bO.displayName="MarkdownUl";var xO=y.memo(({className:e,node:t,...n})=>{let r=wt();return h.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>vn(e,t));xO.displayName="MarkdownHr";var yO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>vn(e,t));yO.displayName="MarkdownStrong";var tne=({children:e,className:t,href:n,node:r,...s})=>{let a=wt(),{linkSafety:l}=y.useContext(Yr),[c,d]=y.useState(!1),f=n==="streamdown:incomplete-link",p=y.useCallback(async v=>{if(!(!(l!=null&&l.enabled&&n)||f)){if(v.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,f]),m=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=y.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:c,onClose:b,onConfirm:m};return l!=null&&l.enabled&&n?h.jsxs(h.Fragment,{children:[h.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",onClick:p,type:"button",children:e}),l.renderModal?l.renderModal(x):h.jsx($te,{...x})]}):h.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":f,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},EO=y.memo(tne,(e,t)=>vn(e,t)&&e.href===t.href);EO.displayName="MarkdownA";var vO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>vn(e,t));vO.displayName="MarkdownH1";var TO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>vn(e,t));TO.displayName="MarkdownH2";var SO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>vn(e,t));SO.displayName="MarkdownH3";var CO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>vn(e,t));CO.displayName="MarkdownH4";var wO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>vn(e,t));wO.displayName="MarkdownH5";var kO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>vn(e,t));kO.displayName="MarkdownH6";var NO=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=y.useContext(Yr),a=F1(s,"table"),l=wb(s,"copy"),c=wb(s,"download"),d=wb(s,"fullscreen");return h.jsx(Wte,{className:t,showControls:a,showCopy:l,showDownload:c,showFullscreen:d,...r,children:e})},(e,t)=>vn(e,t));NO.displayName="MarkdownTable";var _O=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>vn(e,t));_O.displayName="MarkdownThead";var AO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>vn(e,t));AO.displayName="MarkdownTbody";var RO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>vn(e,t));RO.displayName="MarkdownTr";var OO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>vn(e,t));OO.displayName="MarkdownTh";var IO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>vn(e,t));IO.displayName="MarkdownTd";var MO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>vn(e,t));MO.displayName="MarkdownBlockquote";var LO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>vn(e,t));LO.displayName="MarkdownSup";var DO=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return h.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>vn(e,t));DO.displayName="MarkdownSub";var jO=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=l=>{var c,d;if(!y.isValidElement(l))return!1;let f=Array.isArray(l.props.children)?l.props.children:[l.props.children],p=!1,m=!1;for(let b of f)if(b){if(typeof b=="string")b.trim()!==""&&(p=!0);else if(y.isValidElement(b))if(((c=b.props)==null?void 0:c["data-footnote-backref"])!==void 0)m=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let v of x){if(typeof v=="string"&&v.trim()!==""){p=!0;break}if(y.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){p=!0;break}}}}return m&&!p},a=Array.isArray(e)?e.map(l=>{if(!y.isValidElement(l))return l;if(l.type===Vy){let c=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!s(d));return c.length===0?null:{...l,props:{...l.props,children:c}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?h.jsx("section",{className:t,...r,children:a}):null}return h.jsx("section",{className:t,...r,children:e})},(e,t)=>vn(e,t));jO.displayName="MarkdownSection";var nne=({node:e,className:t,children:n,...r})=>{var s,a;let l=wt(),c=!("data-block"in r),{mermaid:d,controls:f,lineNumbers:p}=y.useContext(Yr),m=$y(),b=xte(),x=t?.match(ene),v=(s=x?.at(1))!=null?s:"",k=Vte(v);if(c)return h.jsx("code",{className:l("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let C=(a=e?.properties)==null?void 0:a.metastring,S=C?.match(Qte),N=S?Number.parseInt(S[1],10):void 0,_=N!==void 0&&N>=1?N:void 0,R=!(C&&Zte.test(C))&&p!==!1,I="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?I=n.props.children:typeof n=="string"&&(I=n),k){let U=k.component;return h.jsx(y.Suspense,{fallback:h.jsx(bk,{}),children:h.jsx(U,{code:I,isIncomplete:b,language:v,meta:C})})}if(v==="mermaid"&&m){let U=F1(f,"mermaid"),z=ch(f,"download"),K=ch(f,"copy"),W=ch(f,"fullscreen"),J=ch(f,"panZoom"),te=U&&(z||K||W);return h.jsx(y.Suspense,{fallback:h.jsx(bk,{}),children:h.jsxs("div",{className:l("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[h.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:h.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),te?h.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:h.jsxs("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[z?h.jsx(Yte,{chart:I,config:d?.config}):null,K?h.jsx(pk,{code:I}):null,W?h.jsx(Gte,{chart:I,config:d?.config}):null]})}):null,h.jsx("div",{className:l("rounded-md border border-border bg-background"),children:h.jsx(Jte,{chart:I,config:d?.config,showControls:J})})]})})}let A=F1(f,"code"),L=xk(f,"download"),D=xk(f,"copy");return h.jsx(_te,{className:t,code:I,isIncomplete:b,language:v,lineNumbers:R,startLine:_,children:A?h.jsxs(h.Fragment,{children:[L?h.jsx(Hte,{code:I,language:v}):null,D?h.jsx(pk,{}):null]}):null})},PO=y.memo(nne,(e,t)=>e.className===t.className&&ap(e.node,t.node));PO.displayName="MarkdownCode";var BO=y.memo(Fte,(e,t)=>e.className===t.className&&ap(e.node,t.node));BO.displayName="MarkdownImg";var zO=y.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&y.isValidElement(r[0])){let s=r[0].props.node,a=s?.tagName;if(a==="img")return h.jsx(h.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return h.jsx(h.Fragment,{children:e})}return h.jsx("p",{...n,children:e})},(e,t)=>vn(e,t));zO.displayName="MarkdownParagraph";var rne={ol:Vy,li:gO,ul:bO,hr:xO,strong:yO,a:EO,h1:vO,h2:TO,h3:SO,h4:CO,h5:wO,h6:kO,table:NO,thead:_O,tbody:AO,tr:RO,th:OO,td:IO,blockquote:MO,code:PO,img:BO,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:LO,sub:DO,p:zO,section:jO},sne=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,ine=/\p{L}/u;function yk(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(sne.test(n))return"rtl";if(ine.test(n))return"ltr"}return"ltr"}var ane=/^[ \t]{0,3}(`{3,}|~{3,})/,one=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,Ek=e=>{let t=e.split(`
656
+ `),n=null,r=0;for(let s of t){let a=ane.exec(s);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],c=l[0],d=l.length;c===n&&d>=r&&(n=null,r=0)}}return n!==null},lne=e=>{let t=e.split(`
657
+ `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&one.test(r))return!0}return!1},une=()=>e=>{Ps(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},vk=[],Tk={allowDangerousHtml:!0},dh=new WeakMap,cne=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let p="default";return this.keyCache.set(e,p),p}let a=p=>{if(!p||p.length===0)return"";let m="";for(let b=0;b<p.length;b+=1){let x=p[b];if(b>0&&(m+=","),Array.isArray(x)){let[v,k]=x;if(typeof v=="function"){let C=dh.get(v);C||(C=v.name,dh.set(v,C)),m+=C}else m+=String(v);m+=":",m+=JSON.stringify(k)}else if(typeof x=="function"){let v=dh.get(x);v||(v=x.name,dh.set(x,v)),m+=v}else m+=String(x)}return m},l=a(n),c=a(r),d=s?JSON.stringify(s):"",f=`${c}::${l}::${d}`;return this.keyCache.set(e,f),f}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},Sk=new cne,HO=e=>{let t=dne(e),n=e.children||"",r=t.runSync(t.parse(n),n);return xne(r,e)},dne=e=>{let t=Sk.get(e);if(t)return t;let n=hne(e);return Sk.set(e,n),n},fne=e=>e.some(t=>Array.isArray(t)?t[0]===k1:t===k1),hne=e=>{let t=e.rehypePlugins||vk,n=e.remarkPlugins||vk,r=fne(t)?n:[...n,une],s=e.remarkRehypeOptions?{...Tk,...e.remarkRehypeOptions}:Tk;return mee().use(hJ).use(r).use(XJ,s).use(t)},mne=e=>e,pne=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},gne=(e,t)=>{var n;for(let r in pb)if(Object.hasOwn(pb,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=pb[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},bne=(e,t,n,r,s,a)=>{let l=!1;return r?l=!r.includes(e.tagName):s&&(l=s.includes(e.tagName)),!l&&a&&typeof t=="number"&&(l=!a(e,t,n)),l},xne=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:a,unwrapDisallowed:l,urlTransform:c}=t;if(n||r||s||a||c){let d=c||mne;Ps(e,(f,p,m)=>{if(f.type==="raw"&&m&&typeof p=="number")return pne(m,p,a,f.value),p;if(f.type==="element"&&(gne(f,d),bne(f,p,m,r,s,n)&&m&&typeof p=="number"))return l&&f.children?m.children.splice(p,1,...f.children):m.children.splice(p,1),p})}return vZ(e,{Fragment:h.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0})},yne=/\[\^[\w-]{1,200}\](?!:)/,Ene=/\[\^[\w-]{1,200}\]:/,vne=/<(\w+)[\s>]/,Tne=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ck=new Map,wk=new Map,Sne=e=>{let t=e.toLowerCase(),n=Ck.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Ck.set(t,r),r},Cne=e=>{let t=e.toLowerCase(),n=wk.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return wk.set(t,r),r},kk=(e,t)=>{if(Tne.has(t.toLowerCase()))return 0;let n=e.match(Sne(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},Nk=(e,t)=>{let n=e.match(Cne(t));return n?n.length:0},wne=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},kne=e=>{let t=yne.test(e),n=Ene.test(e);if(t||n)return[e];let r=os.lex(e,{gfm:!0}),s=[],a=[],l=!1;for(let c of r){let d=c.raw,f=s.length;if(a.length>0){s[f-1]+=d;let p=a.at(-1),m=kk(d,p),b=Nk(d,p);for(let x=0;x<m;x+=1)a.push(p);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===p&&a.pop();continue}if(c.type==="html"&&c.block){let p=d.match(vne);if(p){let m=p[1],b=kk(d,m),x=Nk(d,m);b>x&&a.push(m)}}if(f>0&&!l){let p=s[f-1];if(wne(p)%2===1){s[f-1]=p+d;continue}}s.push(d),c.type!=="space"&&(l=c.type==="code")}return s},Nne=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,c,d)=>{if(!c.includes(`
658
+
659
+ `))return l+c+d;let f=c.replace(/\n\n/g,`
660
+ <!---->
661
+ `),p=(f.startsWith(`
662
+ `)?"":`
663
+ `)+f+(f.endsWith(`
664
+ `)?"":`
665
+ `);return`${l}${p}${d}
666
+
667
+ `})}return n},_ne=/([\\`*_~[\]|])/g,Ane=e=>e.replace(_ne,"\\$1"),Rne=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,c,d)=>{let f=Ane(c).replace(/\n\n/g,"&#10;&#10;");return l+f+d})}return n},UO=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(UO).join(""):"",One=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Ps(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=UO(r);r.children=s?[{type:"text",value:s}]:[]}})},Ine=()=>e=>{Ps(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},Mne=/^[ \t]*<[\w!/?-]/,Lne=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,Dne=e=>typeof e!="string"||e.length===0||!Mne.test(e)?e:e.replace(Lne,"$1"),_k,Ak,Rk,Ok,Nh={...Qa,protocols:{...Qa.protocols,href:[...(Ak=(_k=Qa.protocols)==null?void 0:_k.href)!=null?Ak:[],"tel"]},attributes:{...Qa.attributes,code:[...(Ok=(Rk=Qa.attributes)==null?void 0:Rk.code)!=null?Ok:[],"metastring"]}},$1={raw:k1,sanitize:[QR,Nh],harden:[R$,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},jne={gfm:[KW,{}],codeMeta:Ine},Ik=Object.values($1),Pne=Object.values(jne),Bne={block:" ▋",circle:" ●"},FO=["github-light","github-dark"],$O={enabled:!0},zne={shikiTheme:FO,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:$O},Yr=y.createContext(zne),VO=y.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:a,animatePlugin:l,...c})=>{if(l){let p=l.getLastRenderCharCount();l.setPrevContentLength(p)}let d=typeof e=="string"&&n?Dne(e):e,f=h.jsx(HO,{...c,children:d});return h.jsx(oO.Provider,{value:s,children:a?h.jsx("div",{dir:a,style:{display:"contents"},children:f}):f})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var a,l;return((a=e.components)==null?void 0:a[s])!==((l=t.components)==null?void 0:l[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});VO.displayName="Block";var qO=y.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:l=Ik,remarkPlugins:c=Pne,className:d,shikiTheme:f=FO,mermaid:p,controls:m=!0,isAnimating:b=!1,animated:x,BlockComponent:v=VO,parseMarkdownIntoBlocksFn:k=kne,caret:C,plugins:S,remend:N,linkSafety:_=$O,lineNumbers:R=!0,allowedTags:I,literalTagContent:A,translations:L,icons:D,prefix:U,onAnimationStart:z,onAnimationEnd:K,...W})=>{let J=y.useId(),[te,V]=y.useTransition(),B=y.useMemo(()=>Ete(U),[U]),G=y.useRef(null),X=y.useRef(z),ae=y.useRef(K);X.current=z,ae.current=K,y.useEffect(()=>{var we,ye,Oe;if(t==="static")return;let je=G.current;if(G.current=b,je===null){b&&((we=X.current)==null||we.call(X));return}b&&!je?(ye=X.current)==null||ye.call(X):!b&&je&&((Oe=ae.current)==null||Oe.call(ae))},[b,t]);let M=y.useMemo(()=>I?Object.keys(I):[],[I]),P=y.useMemo(()=>{if(typeof e!="string")return"";let we=t==="streaming"&&r?iZ(e,N):e;return A&&A.length>0&&(we=Rne(we,A)),M.length>0&&(we=Nne(we,M)),we},[e,t,r,N,M,A]),$=y.useMemo(()=>k(P),[P,k]),[j,re]=y.useState($);y.useEffect(()=>{t==="streaming"&&!ve?V(()=>{re($)}):re($)},[$,t]);let oe=t==="streaming"?j:$,ce=y.useMemo(()=>n==="auto"?oe.map(yk):void 0,[oe,n]),de=y.useMemo(()=>oe.map((we,ye)=>`${J}-${ye}`),[oe.length,J]),fe=y.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),ve=y.useMemo(()=>fe?fe==="true"?P1():P1(x):null,[fe]),Fe=y.useMemo(()=>{var we,ye;return{shikiTheme:(ye=(we=S?.code)==null?void 0:we.getThemes())!=null?ye:f,controls:m,isAnimating:b,lineNumbers:R,mode:t,mermaid:p,linkSafety:_}},[f,m,b,R,t,p,_,S?.code]),De=y.useMemo(()=>L?JSON.stringify(L):"",[L]),Ee=y.useMemo(()=>({...dO,...L}),[De]),Ie=y.useMemo(()=>{let{inlineCode:we,...ye}=a??{},Oe={...rne,...ye};if(we){let je=Oe.code;Oe.code=ee=>"data-block"in ee?je?y.createElement(je,ee):null:y.createElement(we,ee)}return Oe},[a]),Be=y.useMemo(()=>{let we=[];return S!=null&&S.cjk&&(we=[...we,...S.cjk.remarkPluginsBefore]),we=[...we,...c],S!=null&&S.cjk&&(we=[...we,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(we=[...we,S.math.remarkPlugin]),we},[c,S?.math,S?.cjk]),Ge=y.useMemo(()=>{var we;let ye=l;if(I&&Object.keys(I).length>0&&l===Ik){let Oe={...Nh,tagNames:[...(we=Nh.tagNames)!=null?we:[],...Object.keys(I)],attributes:{...Nh.attributes,...I}};ye=[$1.raw,[QR,Oe],$1.harden]}return A&&A.length>0&&(ye=[...ye,[One,A]]),S!=null&&S.math&&(ye=[...ye,S.math.rehypePlugin]),ve&&b&&(ye=[...ye,ve.rehypePlugin]),ye},[l,S?.math,ve,b,I,A]),$e=y.useMemo(()=>{if(!b||oe.length===0)return!1;let we=oe.at(-1);return Ek(we)||lne(we)},[b,oe]),Me=y.useMemo(()=>C&&b&&!$e?{"--streamdown-caret":`"${Bne[C]}"`}:void 0,[C,b,$e]);return t==="static"?h.jsx(z1.Provider,{value:Ee,children:h.jsx(H1.Provider,{value:S??null,children:h.jsx(Yr.Provider,{value:Fe,children:h.jsx(mk,{icons:D,children:h.jsx(B1.Provider,{value:B,children:h.jsx("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?yk(P):n,children:h.jsx(HO,{components:Ie,rehypePlugins:Ge,remarkPlugins:Be,...W,children:P})})})})})})}):h.jsx(z1.Provider,{value:Ee,children:h.jsx(H1.Provider,{value:S??null,children:h.jsx(Yr.Provider,{value:Fe,children:h.jsx(mk,{icons:D,children:h.jsx(B1.Provider,{value:B,children:h.jsxs("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",C&&!$e?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:Me,children:[oe.length===0&&C&&b&&h.jsx("span",{}),oe.map((we,ye)=>{var Oe;let je=ye===oe.length-1,ee=b&&je&&Ek(we);return h.jsx(v,{animatePlugin:ve,components:Ie,content:we,dir:(Oe=ce?.[ye])!=null?Oe:n!=="auto"?n:void 0,index:ye,isIncomplete:ee,rehypePlugins:Ge,remarkPlugins:Be,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...W},de[ye])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);qO.displayName="Streamdown";var Hne=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:l=1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:f,ZoomOutIcon:p}=Es(),m=wt(),b=y.useRef(null),x=y.useRef(null),[v,k]=y.useState(l),[C,S]=y.useState({x:0,y:0}),[N,_]=y.useState(!1),[R,I]=y.useState({x:0,y:0}),[A,L]=y.useState({x:0,y:0}),D=y.useCallback(B=>{k(G=>Math.max(n,Math.min(r,G+B)))},[n,r]),U=y.useCallback(()=>{D(s)},[D,s]),z=y.useCallback(()=>{D(-s)},[D,s]),K=y.useCallback(()=>{k(l),S({x:0,y:0})},[l]),W=y.useCallback(B=>{B.preventDefault();let G=B.deltaY>0?-s:s;D(G)},[D,s]),J=y.useCallback(B=>{if(B.button!==0||B.isPrimary===!1)return;_(!0),I({x:B.clientX,y:B.clientY}),L(C);let G=B.currentTarget;G instanceof HTMLElement&&G.setPointerCapture(B.pointerId)},[C]),te=y.useCallback(B=>{if(!N)return;B.preventDefault();let G=B.clientX-R.x,X=B.clientY-R.y;S({x:A.x+G,y:A.y+X})},[N,R,A]),V=y.useCallback(B=>{_(!1);let G=B.currentTarget;G instanceof HTMLElement&&G.releasePointerCapture(B.pointerId)},[]);return y.useEffect(()=>{let B=b.current;if(B)return B.addEventListener("wheel",W,{passive:!1}),()=>{B.removeEventListener("wheel",W)}},[W]),y.useEffect(()=>{let B=x.current;if(B&&N)return document.body.style.userSelect="none",B.addEventListener("pointermove",te,{passive:!1}),B.addEventListener("pointerup",V),B.addEventListener("pointercancel",V),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",te),B.removeEventListener("pointerup",V),B.removeEventListener("pointercancel",V)}},[N,te,V]),h.jsxs("div",{className:m("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:N?"grabbing":"grab"},children:[a?h.jsxs("div",{className:m("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[h.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:U,title:"Zoom in",type:"button",children:h.jsx(f,{size:16})}),h.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:z,title:"Zoom out",type:"button",children:h.jsx(p,{size:16})}),h.jsx("button",{className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:K,title:"Reset zoom and pan",type:"button",children:h.jsx(d,{size:16})})]}):null,h.jsx("div",{className:m("flex-1 origin-center transition-transform duration-150 ease-out",c?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:J,ref:x,role:"application",style:{transform:`translate(${C.x}px, ${C.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},YO=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=wt(),[l,c]=y.useState(null),[d,f]=y.useState(!1),[p,m]=y.useState(""),[b,x]=y.useState(""),[v,k]=y.useState(0),{mermaid:C}=y.useContext(Yr),S=$y(),N=C?.errorComponent,{shouldRender:_,containerRef:R}=lte({immediate:r});if(y.useEffect(()=>{if(_){if(!S){c("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{c(null),f(!0);let A=S.getMermaid(n),L=e.split("").reduce((z,K)=>(z<<5)-z+K.charCodeAt(0)|0,0),D=`mermaid-${Math.abs(L)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:U}=await A.render(D,e);m(U),x(U)}catch(A){if(!(b||p)){let L=A instanceof Error?A.message:"Failed to render Mermaid chart";c(L)}}finally{f(!1)}})()}},[e,n,v,_,S]),!(_||p||b))return h.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(d&&!p&&!b)return h.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:h.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[h.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),h.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!p&&!b){let A=()=>k(L=>L+1);return N?h.jsx("div",{ref:R,children:h.jsx(N,{chart:e,error:l,retry:A})}):h.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[h.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),h.jsxs("details",{className:a("mt-2"),children:[h.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),h.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let I=p||b;return h.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:h.jsx(Hne,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:h.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:I},role:"img"})})})};const GO=y.createContext("cards");function KO({value:e,children:t}){return h.jsx(GO.Provider,{value:e,children:t})}function Une(){return y.useContext(GO)}function Kr(){return Une()==="lines"}const Fne=y.createContext("comfortable");function $ne({value:e,children:t}){return h.jsx(Fne.Provider,{value:e,children:t})}const Vne={cards:{comfortable:{className:"pt-4",px:16},compact:{className:"pt-2",px:8}},lines:{comfortable:{className:"pt-4",px:16},compact:{px:0}}};function Mr({children:e,className:t}){return h.jsx("span",{"aria-hidden":!0,className:Se("w-3.5 shrink-0 select-none text-center font-mono text-label leading-5 text-fg-4",t),children:e})}const qne="text-body-sm leading-5",Yne=["text-body-sm leading-5","[&_*]:leading-5","[&_p]:my-0! [&_pre]:my-0! [&_blockquote]:my-0! [&_table]:my-0!","[&_h1]:my-0! [&_h2]:my-0! [&_h3]:my-0! [&_h4]:my-0! [&_h5]:my-0! [&_h6]:my-0!","[&>*+*]:mt-5","[&_ul]:my-0! [&_ol]:my-0! [&_li]:my-0! [&_li>p]:my-0!","[&_li+li]:mt-0! [&_ul_ul]:mt-0! [&_ul_ol]:mt-0! [&_ol_ul]:mt-0! [&_ol_ol]:mt-0!","[&_li]:py-0! [&_ul]:py-0! [&_ol]:py-0!","[&_ul]:list-outside! [&_ol]:list-outside!","[&_ul]:pl-[2ch]! [&_ol]:pl-[3ch]! [&_li]:pl-0!","[&_h1]:text-body-sm [&_h2]:text-body-sm [&_h3]:text-body-sm","[&_h4]:text-body-sm [&_h5]:text-body-sm [&_h6]:text-body-sm","[&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold","[&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold","[&_blockquote]:border-l [&_blockquote]:border-border [&_blockquote]:pl-2","[&_:not(pre)>code]:rounded-none [&_:not(pre)>code]:px-1! [&_:not(pre)>code]:py-0!","[&_:not(pre)>code]:text-body-sm [&_:not(pre)>code]:leading-5! [&_:not(pre)>code]:text-fg-1","[&_th]:py-0! [&_td]:py-0!","[&_[data-streamdown=code-block]]:my-0! [&_[data-streamdown=code-block]]:gap-0!","[&_[data-streamdown=code-block]]:rounded-none! [&_[data-streamdown=code-block]]:border-0!","[&_[data-streamdown=code-block]]:bg-transparent! [&_[data-streamdown=code-block]]:p-0!","[&_[data-streamdown=code-block]]:relative!","[&_[data-streamdown=code-block-header]]:hidden!","[&_div:has(>[data-streamdown=code-block-actions])]:absolute! [&_div:has(>[data-streamdown=code-block-actions])]:top-0!","[&_div:has(>[data-streamdown=code-block-actions])]:right-0! [&_div:has(>[data-streamdown=code-block-actions])]:mt-0!","[&_div:has(>[data-streamdown=code-block-actions])]:h-5! [&_div:has(>[data-streamdown=code-block-actions])]:opacity-0!","[&_div:has(>[data-streamdown=code-block-actions])]:transition-opacity","[&_[data-streamdown=code-block]:hover_div:has(>[data-streamdown=code-block-actions])]:opacity-100!","[&_[data-streamdown=code-block]:focus-within_div:has(>[data-streamdown=code-block-actions])]:opacity-100!","[&_[data-streamdown=code-block-actions]]:rounded-none! [&_[data-streamdown=code-block-actions]]:border-0!","[&_[data-streamdown=code-block-actions]]:bg-code-bg! [&_[data-streamdown=code-block-actions]]:px-1!","[&_[data-streamdown=code-block-actions]]:py-0! [&_[data-streamdown=code-block-actions]]:gap-1!","[&_[data-streamdown=code-block-actions]]:backdrop-blur-none!","[&_[data-streamdown=code-block-body]]:rounded-none! [&_[data-streamdown=code-block-body]]:border-0!","[&_[data-streamdown=code-block-body]]:bg-code-bg! [&_[data-streamdown=code-block-body]]:px-2!","[&_[data-streamdown=code-block-body]]:py-0! [&_[data-streamdown=code-block-body]]:text-body-sm!","[&_[data-streamdown=code-block-copy-button]]:p-0! [&_[data-streamdown=code-block-download-button]]:p-0!","[&_[data-streamdown=table-wrapper]]:rounded-none! [&_[data-streamdown=table-wrapper]]:border-0!","[&_[data-streamdown=table-wrapper]]:my-0! [&_[data-streamdown=table-wrapper]]:bg-transparent!","[&_[data-streamdown=table-wrapper]]:relative! [&_[data-streamdown=table-wrapper]]:gap-0!","[&_[data-streamdown=table-wrapper]]:p-0!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:absolute! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:top-0!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:right-0! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:z-10!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:opacity-0! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:bg-code-bg!","[&_[data-streamdown=table-wrapper]>div:not(:has(table))]:px-1! [&_[data-streamdown=table-wrapper]>div:not(:has(table))]:transition-opacity","[&_[data-streamdown=table-wrapper]:hover>div:not(:has(table))]:opacity-100!","[&_[data-streamdown=table-wrapper]:focus-within>div:not(:has(table))]:opacity-100!","[&_[data-streamdown=table-wrapper]>div:has(table)]:rounded-none! [&_[data-streamdown=table-wrapper]>div:has(table)]:border-0!","[&_[data-streamdown=table-wrapper]>div:has(table)]:bg-transparent!"].join(" "),kb=e=>function({className:n}){return h.jsx("span",{"aria-hidden":!0,className:Se("font-mono text-body-sm leading-5",n),children:e})},Gne={DownloadIcon:kb("⤓"),CopyIcon:kb("⧉"),CheckIcon:kb("✓")},qy=y.memo(function({children:t,streaming:n,className:r}){const s=Kr();return h.jsx(qO,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],icons:s?Gne:void 0,className:Se("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",s&&Yne,r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),fa="pl-[calc(0.875rem+0.5rem)]",Kne={check:["[ ]","[x]"],radio:["( )","(•)"]};function XO({options:e,focused:t,onFocus:n,onChoose:r,active:s=!0,label:a,className:l}){const c=y.useRef([]);y.useEffect(()=>{s&&c.current[t]?.focus()},[s,t]);const d=f=>{e.length>0&&n((t+f+e.length)%e.length)};return h.jsx("div",{role:"group","aria-label":a,className:Se("flex flex-col",l),onKeyDown:f=>{if(f.key==="ArrowDown"){d(1),f.preventDefault();return}if(f.key==="ArrowUp"){d(-1),f.preventDefault();return}const p=Number(f.key);Number.isInteger(p)&&p>=1&&p<=Math.min(e.length,9)&&(n(p-1),r(p-1),f.preventDefault())},children:e.map((f,p)=>{const m=p===t;return h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("button",{ref:b=>{c.current[p]=b},type:"button",tabIndex:m?0:-1,"aria-pressed":f.checked,onFocus:()=>n(p),onClick:()=>r(p),className:Se("flex w-full items-baseline gap-2 text-left outline-none",m?"bg-surface-hover":"hover:bg-surface-hover/60"),children:[h.jsx(Mr,{className:m?"text-accent":void 0,children:m?"❯":" "}),h.jsx("span",{className:"shrink-0 font-mono text-label leading-5 text-fg-4",children:p+1}),f.checked!==void 0?h.jsx("span",{className:Se("shrink-0 font-mono text-label leading-5",f.checked?"text-accent":"text-fg-4"),children:Kne[f.marker??"check"][f.checked?1:0]}):null,h.jsxs("span",{className:Se("min-w-0 flex-1 text-body-sm leading-5",f.danger?"text-danger":"text-fg-1"),children:[f.label,f.description?h.jsxs("span",{className:"text-fg-4",children:[" — ",f.description]}):null]})]}),f.detail?h.jsx("div",{className:fa,children:f.detail}):null]},f.key)})})}function WO({children:e}){return h.jsx("div",{className:Se(fa,"text-label leading-5 text-fg-4"),children:e})}function QO({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:s}){return h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-accent",children:"›"}),h.jsx("input",{autoFocus:!0,value:e,placeholder:s,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),n()),a.key==="Escape"&&(a.stopPropagation(),r())},className:"min-w-0 flex-1 border-b border-border bg-transparent text-body-sm leading-5 text-fg-1 outline-none placeholder:text-fg-4 focus:border-accent"})]})}function Yy({code:e,label:t,language:n,className:r}){return h.jsxs("div",{className:Se("min-w-0",r),children:[h.jsx("span",{className:"block truncate text-label leading-5 text-fg-4",children:t}),h.jsx(qy,{children:Xne(e,n)})]})}function Xne(e,t){const n=Math.max(0,...[...e.matchAll(/`+/g)].map(s=>s[0].length)),r="`".repeat(Math.max(3,n+1));return`${r}${t??""}
668
+ ${e}
669
+ ${r}`}function Wne({request:e,onApprove:t,onDeny:n,className:r}){const s=Kr(),[a,l]=y.useState(!1),[c,d]=y.useState(!1),[f,p]=y.useState(""),[m,b]=y.useState(0),x=S=>{const N=f.trim();n(e.id,N||void 0,S||void 0),p(""),d(!1)},v=g1(e.input),k=KA(e.toolName),C=e.title??e.displayName??"Permission needed";if(s){const S=[{key:"allow",label:"Allow"},{key:"deny",label:"Deny",description:"the turn continues",detail:c?h.jsx(QO,{value:f,onChange:p,onSubmit:()=>x(!1),onCancel:()=>d(!1),placeholder:"Reason (optional) — the agent reads this and can try something else"}):void 0},{key:"stop",label:"Deny & stop",description:"interrupt the turn",danger:!0}];return h.jsxs("div",{"data-slot":"permission-prompt",className:Se("w-full",r),onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),x(!1))},children:[h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-warning",children:"!"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm leading-5 font-medium text-fg-1",children:C})]}),e.description?h.jsx("div",{className:Se(fa,"text-label leading-5 text-fg-3"),children:e.description}):null,e.decisionReason?h.jsx("div",{className:Se(fa,"text-label leading-5 text-fg-4"),children:e.decisionReason}):null,h.jsxs("button",{type:"button",onClick:()=>l(N=>!N),className:"flex w-full items-baseline gap-2 text-left outline-none hover:bg-surface-hover/60",children:[h.jsx(Mr,{className:"text-fg-4",children:"⎿"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-label leading-5 text-fg-4",children:[h.jsx("span",{className:"font-medium text-fg-2",children:e.toolName}),v?`(${v})`:null]})]}),a?h.jsx("div",{className:fa,children:h.jsx(Yy,{code:JSON.stringify(e.input,null,2),language:"json",label:"Input"})}):null,h.jsx(XO,{label:C,options:S,focused:m,onFocus:b,active:!c,onChoose:N=>{N===0?t(e.id):N===1?d(!0):x(!0)}}),h.jsx(WO,{children:"↑↓ move · 1–3 choose · esc deny"})]})}return h.jsxs("div",{"data-slot":"permission-prompt",className:Se("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx(q_,{className:"mt-0.5 size-4 shrink-0 text-warning"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?h.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?h.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,h.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[h.jsx(k,{className:"size-3 shrink-0 text-fg-3"}),h.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),v?h.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:v}):null]}),h.jsxs("button",{type:"button",className:"mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>l(S=>!S),children:[a?"Hide":"Show"," ",e.toolName," input"]}),a?h.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:JSON.stringify(e.input,null,2)}):null]}),h.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[h.jsx(rt,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),h.jsx(rt,{size:"sm",variant:"outline",onClick:()=>d(S=>!S),children:"Deny"}),h.jsx(rt,{size:"sm",variant:"outline",onClick:()=>x(!0),children:"Deny & stop"})]})]}),c?h.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[h.jsx(sn,{autoFocus:!0,value:f,onChange:S=>p(S.target.value),onKeyDown:S=>{S.key==="Enter"&&x(!1),S.key==="Escape"&&d(!1)},placeholder:"Reason (optional) — the agent reads this and can try something else",className:"h-7 flex-1"}),h.jsx(rt,{size:"sm",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),h.jsx(rt,{size:"sm",variant:"destructive",onClick:()=>x(!1),children:"Deny"})]}):null]})}const Mk=[{value:"auto",label:"Auto-answer",description:"pick each question’s recommended option"},{value:"ask",label:"Ask",description:"wait for a watcher or webhook controller to answer"},{value:"deny",label:"Disabled",description:"the agent is told to decide on its own"}];function ZO(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const s=r.options.filter(a=>typeof a?.label=="string");return s.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:s,multiSelect:r.multiSelect===!0}]})}const Qne=e=>e.some(t=>t.multiSelect===!0),wl={labels:[],other:"",otherActive:!1};function Lk(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function Zne({request:e,onAnswer:t,onDismiss:n,className:r}){const s=Kr(),a=ZO(e.input),[l,c]=y.useState(()=>a.map(()=>wl)),[d,f]=y.useState(()=>a.map(()=>0)),[p,m]=y.useState(0),b=(C,S)=>{c(N=>N.map((_,R)=>R===C?{..._,...S}:_))},x=(C,S,N)=>{const _=l[C]??wl;N?b(C,{labels:_.labels.includes(S)?_.labels.filter(R=>R!==S):[..._.labels,S]}):b(C,{labels:_.labels[0]===S?[]:[S],otherActive:!1})},v=a.every((C,S)=>Lk(l[S]??wl)!==""),k=()=>{const C={};a.forEach((S,N)=>{C[S.question]=Lk(l[N]??wl)}),t(e.id,{...e.input,answers:C})};if(s){const C=()=>n(e.id,"Question dismissed by user");return h.jsxs("div",{"data-slot":"question-prompt",className:Se("flex w-full flex-col gap-2",r),onKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),C();return}S.key==="Enter"&&(S.metaKey||S.ctrlKey)&&v&&(S.preventDefault(),k())},children:[a.map((S,N)=>{const _=l[N]??wl,R=d[N]??0,I=S.multiSelect===!0,A=[...S.options.map((L,D)=>{const U=_.labels.includes(L.label);return{key:L.label,label:L.label,description:L.description,detail:L.preview&&(U||R===D)?h.jsx(Yy,{code:L.preview,label:"Preview"}):void 0,checked:U,marker:I?"check":"radio"}}),{key:"__other",label:"Other…",checked:_.otherActive,marker:I?"check":"radio",detail:_.otherActive?h.jsx(QO,{value:_.other,onChange:L=>b(N,{other:L}),onSubmit:()=>{v&&k()},onCancel:()=>b(N,{otherActive:!1,other:""}),placeholder:"Type your own answer"}):void 0}];return h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-info",children:"?"}),h.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-1",children:[S.header?h.jsxs("span",{className:"text-fg-4",children:[S.header," · "]}):null,h.jsx("span",{className:"font-medium",children:S.question})]})]}),h.jsx(XO,{label:S.question,options:A,focused:R,active:p===N&&!_.otherActive,onFocus:L=>{m(N),f(D=>D.map((U,z)=>z===N?L:U))},onChoose:L=>{if(L===S.options.length){b(N,{otherActive:!_.otherActive});return}const D=S.options[L];D&&x(N,D.label,I)}})]},N)}),h.jsx("div",{className:Se(fa,"flex flex-col"),children:h.jsx("button",{type:"button",disabled:!v,onClick:k,className:"w-fit text-body-sm leading-5 text-accent underline-offset-2 outline-none hover:underline disabled:text-fg-4 disabled:no-underline",children:"⏎ Answer"})}),h.jsxs(WO,{children:["↑↓ move · ",Qne(a)?"space/1–9 toggle":"1–9 choose"," · ⌘⏎ answer · esc dismiss"]})]})}return h.jsx("div",{"data-slot":"question-prompt",className:Se("rounded-lg border border-info/40 bg-info-bg p-3",r),children:h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx(K_,{className:"mt-0.5 size-4 shrink-0 text-info"}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[a.map((C,S)=>{const N=l[S]??wl;return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[C.header?h.jsx(pn,{variant:"info",children:C.header}):null,h.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:C.question})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[C.options.map(_=>{const R=N.labels.includes(_.label);return h.jsxs("button",{type:"button",onClick:()=>x(S,_.label,C.multiSelect===!0),className:Se("rounded-md border px-2.5 py-1.5 text-left transition-colors",R?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[h.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:_.label}),_.description?h.jsx("span",{className:"block text-label text-fg-4",children:_.description}):null,R&&_.preview?h.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:_.preview}):null]},_.label)}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>b(S,{otherActive:!N.otherActive}),className:Se("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",N.otherActive?"border-info bg-bg text-fg-1":"border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg"),children:"Other…"}),N.otherActive?h.jsx(sn,{autoFocus:!0,value:N.other,onChange:_=>b(S,{other:_.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},S)}),h.jsx("div",{children:h.jsx(rt,{size:"sm",onClick:k,disabled:!v,children:"Answer"})})]}),h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:h.jsx(js,{className:"size-3.5"})})]})})}function Jne({state:e,client:t,sessionId:n,open:r,onOpenChange:s}){const a=e.session,l=e.permissionMode?v$(e.permissionMode):void 0;return h.jsx(Ao,{open:r,onOpenChange:s,children:h.jsxs(Ro,{children:[h.jsx(Oo,{title:"Session info",description:a?.title}),h.jsx(Io,{children:h.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[h.jsxs("div",{className:"pb-2",children:[h.jsx(ir,{label:"Engine",children:e.engine??"claude"}),a?.profile?h.jsx(ir,{label:"Profile",children:a.profile}):null,e.model?h.jsx(ir,{label:"Model",mono:!0,children:e.model}):null,l?h.jsx(ir,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?h.jsx(ir,{label:"Credentials",children:a.apiKeySource}):null]}),h.jsxs("div",{className:"py-2",children:[e.cwd?h.jsx(Nb,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?h.jsx(Nb,{label:"Engine session id",value:e.sdkSessionId}):null,a?h.jsx(Nb,{label:"Gateway session id",value:a.id}):null]}),h.jsxs("div",{className:"py-2",children:[a?.createdAt?h.jsx(ir,{label:"Started",children:cd(a.createdAt)}):null,a?.numTurns!==void 0?h.jsx(ir,{label:"Turns",children:a.numTurns}):null,h.jsx(ir,{label:"Cost",mono:!0,children:bo(e.totalCostUsd)})]}),e.capabilities.vfs?h.jsx(ere,{client:t,sessionId:n,open:r}):null]})})]})})}function Nb({label:e,value:t}){return h.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"text-label text-fg-3",children:e}),h.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),h.jsx(Yh,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function ere({client:e,sessionId:t,open:n}){const[r,s]=y.useState(),[a,l]=y.useState(!1);return y.useEffect(()=>{if(!n||!t)return;let c=!1;return l(!0),e.listSessionFiles(t).then(d=>{c||s(d)}).catch(()=>{c||s([])}).finally(()=>{c||l(!1)}),()=>{c=!0}},[e,t,n]),h.jsxs("div",{className:"pt-3",children:[h.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?h.jsx("div",{className:"py-3 text-center",children:h.jsx(kn,{className:"size-4 text-fg-4"})}):r?.length?h.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(c=>h.jsx("li",{children:h.jsxs("a",{href:t?e.sessionFileUrl(t,c.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[h.jsx(F_,{className:"size-3.5 shrink-0 text-fg-4"}),h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:c.path}),h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:xo(c.bytes)})]})},c.path))}):h.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const JO={starting:{label:"Starting",variant:"info",busy:!0},running:{label:"Running",variant:"info",busy:!0},awaiting_approval:{label:"Needs approval",variant:"warning",busy:!0},idle:{label:"Idle",variant:"success",busy:!1},parked:{label:"Parked",variant:"accent",busy:!1},failed:{label:"Failed",variant:"danger",busy:!1},closed:{label:"Closed",variant:"neutral",busy:!1}};function tre(e=3e4){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const eI=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",nre=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function rre({usage:e}){return h.jsx(iy,{content:h.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:nre(t.color)?{backgroundColor:t.color}:void 0}),h.jsx("span",{className:"flex-1",children:t.name}),h.jsx("span",{className:"font-mono text-fg-3",children:us(t.tokens)})]},t.name)),h.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[h.jsx("span",{children:"Total"}),h.jsxs("span",{className:"font-mono text-fg-3",children:[us(e.totalTokens)," / ",us(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:h.jsxs("span",{className:Se("inline-flex cursor-default items-center gap-1 font-mono text-label",eI(e.percentage)),children:["Ctx ",us(e.totalTokens)]})})}function Dk({label:e,info:t,now:n}){const r=t.utilization,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return h.jsx(iy,{content:h.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{children:[e," usage"]}),h.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),s!==void 0?h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{children:"Resets in"}),h.jsx("span",{className:"font-mono text-fg-3",children:p1(s,n)})]}):null,t.isUsingOverage?h.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?h.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:h.jsxs("span",{className:Se("inline-flex cursor-default items-center gap-1 font-mono text-label",t.status==="rejected"?"text-danger":eI(r??0)),children:[h.jsx(EA,{value:r??0}),e,r!==void 0?` ${r.toFixed(0)}%`:"",s!==void 0?h.jsxs("span",{className:"text-fg-4",children:["· ",p1(s,n)]}):null]})})}function _b({onClick:e,hint:t,children:n}){return e?h.jsx("button",{type:"button",onClick:e,"aria-label":t,className:"rounded-md px-1 py-0.5 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover",children:n}):h.jsx(h.Fragment,{children:n})}function sre({state:e,connected:t,connection:n,onOpenStatus:r,onOpenContext:s,onOpenUsage:a,actions:l,className:c}){const d=JO[e.status],f=tre(),p=e.rateLimits?.five_hour,m=e.rateLimits?.seven_day,b=n??(t===!1?"reconnecting":"live");return h.jsxs("div",{"data-slot":"status-bar",className:Se("flex items-center gap-2 border-b border-border bg-surface px-3 py-1.5",c),children:[h.jsx(_b,{onClick:r,hint:"Session info",children:b==="live"?h.jsxs(pn,{variant:d.variant,dot:!d.busy,children:[d.busy?h.jsx(kn,{className:"size-3 text-current"}):null,d.label]}):h.jsxs(pn,{variant:b==="offline"?"danger":"warning",dot:!1,children:[b==="offline"?h.jsx(XB,{className:"size-3 text-current"}):h.jsx(Bm,{className:"size-3 animate-spin text-current"}),b==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?h.jsx(_b,{onClick:s,hint:"Context breakdown",children:h.jsx(rre,{usage:e.contextUsage})}):null,p||m?h.jsx(_b,{onClick:a,hint:"Plan usage",children:h.jsxs("span",{className:"inline-flex items-center gap-2",children:[p?h.jsx(Dk,{label:"Session",info:p,now:f}):null,m?h.jsx(Dk,{label:"Weekly",info:m,now:f}):null]})}):null,h.jsx("span",{className:"flex-1"}),h.jsx("span",{className:"font-mono text-label text-fg-3",children:bo(e.totalCostUsd)}),l]})}function ire(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,a,l){if(typeof a=="string"){const c=a.charCodeAt(0);if(c>=48&&c<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let f=s[d];if(!f){const p=t[d*2];f=s[d]={index:d,key:n(d),start:p,size:t[d*2+1],end:p+t[d*2+1],lane:0}}return f}}if(a==="length")return e}return Reflect.get(s,a,l)}})}function kl(e,t,n){let r=n.initialDeps??[],s,a=!0;function l(){const c=e();return(c.length!==r.length||c.some((f,p)=>r[p]!==f))&&(r=c,s=t(...c),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1),s}return l.updateDeps=c=>{r=c},l}function jk(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const are=(e,t)=>Math.abs(e-t)<1.01,ore=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let bc;const Ab=()=>{if(bc!==void 0)return bc;if(typeof navigator>"u")return bc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return bc=!0;const e=navigator.maxTouchPoints;return bc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Pk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},lre=e=>e,ure=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let a=0;a<r;a++)s[a]=t+a;return s},cre=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=l=>{const{width:c,height:d}=l;t({width:Math.round(c),height:Math.round(d)})};if(s(Pk(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(l=>{const c=()=>{const d=l[0];if(d?.borderBoxSize){const f=d.borderBoxSize[0];if(f){s({width:f.inlineSize,height:f.blockSize});return}}s(Pk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},om={passive:!0},dre=typeof window>"u"?!0:"onscrollend"in window,fre=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const a=e.options.useScrollendEvent&&dre;let l=0;const c=a?null:ore(s,()=>t(l,!1),e.options.isScrollingResetDelay),d=m=>()=>{l=n(r),c?.(),t(l,m)},f=d(!0),p=d(!1);return r.addEventListener("scroll",f,om),a&&r.addEventListener("scrollend",p,om),()=>{r.removeEventListener("scroll",f),a&&r.removeEventListener("scrollend",p)}},hre=(e,t)=>fre(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),mre=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),a=n.itemSizeCache.get(s);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},pre=(e,{adjustments:t=0,behavior:n},r)=>{var s,a;(a=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},gre=pre;class bre{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{const l=()=>{const c=a.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[f,p]of this.elementsCache)if(p===c){this.elementsCache.delete(f);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var a;return(a=r())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=r())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r,s;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lre,rangeExtractor:ure,onChange:()=>{},measureElement:mre,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in n){const x=n[b];x!==void 0&&(a[b]=x)}const l=this.options;let c=null,d=null,f=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const b=l.count,x=a.count,v=this.getMeasurements(),k=b>0?((r=v[0])==null?void 0:r.key)??l.getItemKey(0):null,C=b>0?((s=v[b-1])==null?void 0:s.key)??l.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(a.getItemKey(0)!==k||a.getItemKey(x-1)!==C)){f=!0;const _=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;_&&(c=[_.key,this.getScrollOffset()-_.start]);const R=a.followOnAppend===!0?"auto":a.followOnAppend||null;R&&x>b&&this.isAtEnd(l.scrollEndThreshold)&&(b===0||a.getItemKey(x-1)!==C)&&(d=R)}}this.options=a,f&&(this.pendingMin=0,this.itemSizeCacheVersion++);let p=!1,m=0;if(c&&this.scrollOffset!==null){const[b,x]=c,v=this.getMeasurements(),{count:k,getItemKey:C}=this.options;let S=0;for(;S<k&&C(S)!==b;)S++;if(S<k){const N=v[S];if(N){const _=Math.max(0,N.start+x);_!==this.scrollOffset&&(m=_-this.scrollOffset,this.scrollOffset=_,p=!0)}}}(p||d)&&(this.pendingScrollAnchor=[p?c[0]:null,p?c[1]:0,d,m])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=kl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{if(l&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=l?c===a?this.scrollDirection:c<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Ab()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,om),a.addEventListener("touchend",c,om),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[a,l,c,d]=s;a!==null&&!c&&(Ab()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=kl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,a,l,c,d,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:d,gap:f}),{key:!1}),this.getMeasurements=kl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:c,laneAssignmentMode:d,gap:f},p)=>{const m=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const S of this.laneAssignments.keys())S>=n&&this.laneAssignments.delete(S);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(S=>{this.itemSizeCache.set(S.key,S.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const S=n*2;let N=this._flatMeasurements;if(!N||N.length<S){const I=new Float64Array(S);N&&b>0&&I.set(N.subarray(0,b*2)),N=I,this._flatMeasurements=N}let _;if(b===0)_=r+s;else{const I=b-1;_=N[I*2]+N[I*2+1]+f}for(let I=b;I<n;I++){const A=a(I),L=m.get(A),D=typeof L=="number"?L:this.options.estimateSize(I);N[I*2]=_,N[I*2+1]=D,_+=D+f}const R=ire(n,N,a);return this.measurementsCache=R,R}const x=this.measurementsCache.slice(0,b),v=new Array(c).fill(void 0),k=new Float64Array(c);let C=0;for(let S=0;S<b;S++){const N=x[S];N&&(v[N.lane]===void 0&&C++,v[N.lane]=S,k[N.lane]=N.end)}for(let S=b;S<n;S++){const N=a(S),_=this.laneAssignments.get(S);let R,I;const A=d==="estimate"||m.has(N);if(_!==void 0&&this.options.lanes>1){R=_;const z=v[R],K=z!==void 0?x[z]:void 0;I=K?K.end+f:r+s}else if(C===c){let z=0,K=k[0],W=v[0];for(let J=1;J<c;J++){const te=k[J];(te<K||te===K&&v[J]<W)&&(z=J,K=te,W=v[J])}R=z,I=K+f,A&&this.laneAssignments.set(S,R)}else R=S%this.options.lanes,I=r+s,A&&this.laneAssignments.set(S,R);const L=m.get(N),D=typeof L=="number"?L:this.options.estimateSize(S),U=I+D;x[S]={index:S,start:I,size:D,end:U,key:N,lane:R},v[R]===void 0&&C++,v[R]=S,k[R]=U}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=kl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>n.length===0||r===0?(this.range=null,null):(this.range=yre(n,r,s,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=kl(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,s-a),c=Math.min(this.options.count-1,s+a);return n>=l&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,c)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,a;if(n<0||n>=this.options.count)return;let l,c,d;const f=this._flatMeasurements;if(this.options.lanes===1&&f!==null)d=this.options.getItemKey(n),c=f[n*2],l=f[n*2+1];else{const b=this.measurementsCache[n];if(!b)return;d=b.key,c=b.start,l=b.size}const p=this.itemSizeCache.get(d)??l,m=r-p;if(m!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,C=!this.itemSizeCache.has(d)?c<v:c+p<=v&&this.scrollDirection!=="backward",S=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:d,start:c,size:l,end:c+l,lane:0},m,this):C);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let N=!1;b?N=this.applyScrollAdjustment(this.getTotalSize()-x):S&&(N=this.applyScrollAdjustment(m)),this.notify(N)}},this.getVirtualItems=kl(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,l=n.length;a<l;a++){const c=n[a],d=r[c];s.push(d)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,a=this.options.lanes===1&&s!=null,l=tI(0,r.length-1,a?c=>s[c*2]:c=>jk(r[c]).start,n);return jk(r[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=n>=l+a?"end":"start"),r==="center"?n+=(s-a)/2:r==="end"&&(n-=a);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(r==="auto")if(l.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(l.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,l.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,r),l=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[l,c]=a,d=this.now();this.scrollState={index:n,align:c,behavior:s,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const a=r.length-1,l=this._flatMeasurements;l!=null?s=l[a*2]+l[a*2+1]:s=((n=r[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&a.some(c=>c===null);){const c=r[l];a[c.lane]===null&&(a[c.lane]=c.end),l--}s=Math.max(...a.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:Ab()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,a=1,l=s!==this.scrollState.lastTargetOffset;if(!l&&are(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const c=this.getSize()||600,d=Math.abs(s-this.getScrollOffset()),f=this.scrollState.behavior==="smooth"&&d>c;this.scrollState.lastTargetOffset=s,f||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:f?"smooth":"auto"})}this.scheduleScrollReconcile()}}const tI=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,a=n(s);if(a<r)e=s+1;else if(a>r)t=s-1;else return s}return e>0?e-1:0};function xre(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,a=e[s*2];if(a<n)r=s+1;else if(a>n)t=s-1;else return s}return r>0?r-1:0}function yre(e,t,n,r,s){const a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&s!==null){const f=xre(s,a,n);let p=f;const m=n+t;for(;p<a&&s[p*2]+s[p*2+1]<m;)p++;return{startIndex:f,endIndex:p}}let c=tI(0,a,f=>e[f].start,n),d=c;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const f=Array(r).fill(0);for(;d<a&&f.some(m=>m<n+t);){const m=e[d];f[m.lane]=m.end,d++}const p=Array(r).fill(n+t);for(;c>=0&&p.some(m=>m>=n);){const m=e[c];p[m.lane]=m.start,c--}c=Math.max(0,c-c%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:c,endIndex:d}}const Rb=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Ere({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=y.useReducer(p=>p+1,0)[1],a=y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=p=>{const m=a.current;if(!m.enabled||!m.container)return;const b=p.getTotalSize();if(b!==m.lastSize){m.lastSize=b;const x=p.options.horizontal?"width":"height";m.container.style[x]=`${b}px`}},c=p=>{const m=a.current;if(!m.enabled||!m.container)return;l(p);const b=!!p.options.horizontal,x=m.mode==="transform",v=b?"left":"top",k=p.options.scrollMargin,C=p.getVirtualItems();for(const S of C){const N=S.start-k,_=p.elementsCache.get(S.key);_&&m.lastPositions.get(_)!==N&&(m.lastPositions.set(_,N),x?_.style.transform=b?`translate3d(${N}px, 0, 0)`:`translate3d(0, ${N}px, 0)`:_.style[v]=`${N}px`)}},d={...r,onChange:(p,m)=>{var b;const x=a.current;let v=!0;if(x.enabled){c(p);const k=p.range,C=x.prevRange;v=!C||C.isScrolling!==p.isScrolling||C.startIndex!==k?.startIndex||C.endIndex!==k?.endIndex,v&&(x.prevRange=k?{startIndex:k.startIndex,endIndex:k.endIndex,isScrolling:p.isScrolling}:null)}v&&(e&&m?lr.flushSync(s):s()),(b=r.onChange)==null||b.call(r,p,m)}},[f]=y.useState(()=>{const p=new bre(d);return Object.assign(p,{containerRef:m=>{const b=a.current;if(b.container=m,b.lastSize=null,m&&b.enabled){const x=p.getTotalSize();b.lastSize=x;const v=p.options.horizontal?"width":"height";m.style[v]=`${x}px`}}})});return f.setOptions(d),Rb(()=>f._didMount(),[]),Rb(()=>(l(f),f._willUpdate())),Rb(()=>{c(f)}),f}function vre(e){return Ere({observeElementRect:cre,observeElementOffset:hre,scrollToFn:gre,...e})}/*!---------------------------------------------------------------------------------------------
670
+ * Copyright (c) StackBlitz. All rights reserved.
671
+ * Licensed under the MIT License. See License.txt in the project root for license information.
672
+ *--------------------------------------------------------------------------------------------*/const Tre={damping:.7,stiffness:.05,mass:1.25},Sre=70,Cre=1e3/60,wre=350;let op=!1;globalThis.document?.addEventListener("mousedown",()=>{op=!0});globalThis.document?.addEventListener("mouseup",()=>{op=!1});globalThis.document?.addEventListener("click",()=>{op=!1});const kre=(e={})=>{const[t,n]=y.useState(!1),[r,s]=y.useState(e.initial!==!1),[a,l]=y.useState(!1),c=y.useRef(null);c.current=e;const d=y.useCallback(()=>{if(!op)return!1;const N=window.getSelection();if(!N||!N.rangeCount)return!1;const _=N.getRangeAt(0);return _.commonAncestorContainer.contains(C.current)||C.current?.contains(_.commonAncestorContainer)},[]),f=y.useCallback(N=>{m.isAtBottom=N,s(N)},[]),p=y.useCallback(N=>{m.escapedFromLock=N,n(N)},[]),m=y.useMemo(()=>{let N;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return C.current?.scrollTop??0},set scrollTop(_){if(C.current){const{scrollBehavior:R}=getComputedStyle(C.current);R!=="auto"&&(C.current.style.scrollBehavior="auto"),C.current.scrollTop=_,m.ignoreScrollToTop=C.current.scrollTop,R!=="auto"&&(C.current.style.scrollBehavior=R)}},get targetScrollTop(){return!C.current||!S.current?0:C.current.scrollHeight-1-C.current.clientHeight},get calculatedTargetScrollTop(){if(!C.current||!S.current)return 0;const{targetScrollTop:_}=this;if(!e.targetScrollTop)return _;if(N?.targetScrollTop===_)return N.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(_,{scrollElement:C.current,contentElement:S.current}),_),0);return N={targetScrollTop:_,calculatedScrollTop:R},requestAnimationFrame(()=>{N=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Sre}}},[]),b=y.useCallback((N={})=>{typeof N=="string"&&(N={animation:N}),N.preserveScrollPosition||f(!0);const _=Date.now()+(Number(N.wait)||0),R=Ib(c.current,N.animation),{ignoreEscapes:I=!1}=N;let A,L=m.calculatedTargetScrollTop;N.duration instanceof Promise?N.duration.finally(()=>{A=Date.now()}):A=_+(N.duration??0);const D=async()=>{const U=new Promise(requestAnimationFrame).then(()=>{if(!m.isAtBottom)return m.animation=void 0,!1;const{scrollTop:z}=m,K=performance.now(),W=(K-(m.lastTick??K))/Cre;if(m.animation||(m.animation={behavior:R,promise:U,ignoreEscapes:I}),m.animation.behavior===R&&(m.lastTick=K),d()||_>Date.now())return D();if(z<Math.min(L,m.calculatedTargetScrollTop)){if(m.animation?.behavior===R){if(R==="instant")return m.scrollTop=m.calculatedTargetScrollTop,D();m.velocity=(R.damping*m.velocity+R.stiffness*m.scrollDifference)/R.mass,m.accumulated+=m.velocity*W,m.scrollTop+=m.accumulated,m.scrollTop!==z&&(m.accumulated=0)}return D()}return A>Date.now()?(L=m.calculatedTargetScrollTop,D()):(m.animation=void 0,m.scrollTop<m.calculatedTargetScrollTop?b({animation:Ib(c.current,c.current.resize),ignoreEscapes:I,duration:Math.max(0,A-Date.now())||void 0}):m.isAtBottom)});return U.then(z=>(requestAnimationFrame(()=>{m.animation||(m.lastTick=void 0,m.velocity=0)}),z))};return N.wait!==!0&&(m.animation=void 0),m.animation?.behavior===R?m.animation.promise:D()},[f,d,m]),x=y.useCallback(()=>{p(!0),f(!1)},[p,f]),v=y.useCallback(({target:N})=>{if(N!==C.current)return;const{scrollTop:_,ignoreScrollToTop:R}=m;let{lastScrollTop:I=_}=m;m.lastScrollTop=_,m.ignoreScrollToTop=void 0,R&&R>_&&(I=R),l(m.isNearBottom),setTimeout(()=>{if(m.resizeDifference||_===R)return;if(d()){p(!0),f(!1);return}const A=_>I,L=_<I;if(m.animation?.ignoreEscapes){m.scrollTop=I;return}L&&(p(!0),f(!1)),A&&p(!1),!m.escapedFromLock&&m.isNearBottom&&f(!0)},1)},[p,f,d,m]),k=y.useCallback(({target:N,deltaY:_})=>{let R=N;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===C.current&&_<0&&C.current.scrollHeight>C.current.clientHeight&&!m.animation?.ignoreEscapes&&(p(!0),f(!1))},[p,f,m]),C=Bk(N=>{C.current?.removeEventListener("scroll",v),C.current?.removeEventListener("wheel",k),N?.addEventListener("scroll",v,{passive:!0}),N?.addEventListener("wheel",k,{passive:!0})},[]),S=Bk(N=>{if(m.resizeObserver?.disconnect(),m.resizeObserver=void 0,!N)return;let _;m.resizeObserver=new ResizeObserver(([R])=>{const{height:I}=R.contentRect,A=I-(_??I);if(m.resizeDifference=A,m.scrollTop>m.targetScrollTop&&(m.scrollTop=m.targetScrollTop),l(m.isNearBottom),A>=0){const L=Ib(c.current,_?c.current.resize:c.current.initial);b({animation:L,wait:!0,preserveScrollPosition:!0,duration:L==="instant"?void 0:wre})}else m.isNearBottom&&(p(!1),f(!0));_=I,requestAnimationFrame(()=>{setTimeout(()=>{m.resizeDifference===A&&(m.resizeDifference=0)},1)})}),m.resizeObserver?.observe(N)},[]);return{contentRef:S,scrollRef:C,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:m}};function Bk(e,t){const n=y.useCallback(r=>(n.current=r,e(r)),t);return n}const Ob=new Map;function Ib(...e){const t={...Tre};let n=!1;for(const s of e){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,t.damping=s.damping??t.damping,t.stiffness=s.stiffness??t.stiffness,t.mass=s.mass??t.mass)}const r=JSON.stringify(t);return Ob.has(r)||Ob.set(r,Object.freeze(t)),n?"instant":Ob.get(r)}/*!---------------------------------------------------------------------------------------------
673
+ * Copyright (c) StackBlitz. All rights reserved.
674
+ * Licensed under the MIT License. See License.txt in the project root for license information.
675
+ *--------------------------------------------------------------------------------------------*/const nI=y.createContext(null),Nre=typeof window<"u"?y.useLayoutEffect:y.useEffect;function lm({instance:e,children:t,resize:n,initial:r,mass:s,damping:a,stiffness:l,targetScrollTop:c,contextRef:d,...f}){const p=y.useRef(null),m=y.useCallback((I,A)=>(R?.targetScrollTop??c)?.(I,A)??I,[c]),b=kre({mass:s,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:m}),{scrollRef:x,contentRef:v,scrollToBottom:k,stopScroll:C,isAtBottom:S,escapedFromLock:N,state:_}=e??b,R=y.useMemo(()=>({scrollToBottom:k,stopScroll:C,scrollRef:x,isAtBottom:S,escapedFromLock:N,contentRef:v,state:_,get targetScrollTop(){return p.current},set targetScrollTop(I){p.current=I}}),[k,S,v,x,C,N,_]);return y.useImperativeHandle(d,()=>R,[R]),Nre(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),y.createElement(nI.Provider,{value:R},y.createElement("div",{...f},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const a=Gy();return y.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},y.createElement("div",{...s,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(lm||(lm={}));function Gy(){const e=y.useContext(nI);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function _re({className:e,children:t,resize:n="smooth",...r}){return h.jsx(lm,{"data-slot":"conversation",className:Se("relative flex-1 overflow-y-auto",e),initial:"instant",resize:n,role:"log",...r,children:t})}function Are({className:e,children:t,...n}){return h.jsx(lm.Content,{"data-slot":"conversation-content",className:Se("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-4 px-4 py-4",e),...n,children:t})}function Rre({className:e}){const{isAtBottom:t,scrollToBottom:n}=Gy();return t?null:h.jsx(rt,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:Se("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:h.jsx(q9,{className:"size-4"})})}function Ore({item:e,href:t,className:n}){const r=Kr(),s=e.path.split("/").pop()||e.path;return r?h.jsxs("div",{"data-slot":"file-delivered",className:Se("flex w-full items-baseline gap-2",n),children:[h.jsx(Mr,{className:"text-fg-4",children:"◇"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5",children:[h.jsx("span",{className:"font-medium text-fg-1",children:s}),h.jsxs("span",{className:"text-fg-4",children:[" · ",xo(e.bytes),e.description?` · ${e.description}`:""]})]}),t?h.jsx("a",{href:t,download:s,className:"shrink-0 text-label text-fg-3 underline-offset-2 hover:text-fg-1 hover:underline",children:"download"}):null]}):h.jsxs("div",{"data-slot":"file-delivered",className:Se("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[h.jsx(Jx,{className:"size-4 shrink-0 text-fg-3"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:s}),h.jsxs("div",{className:"truncate text-label text-fg-4",children:[xo(e.bytes),e.description?` · ${e.description}`:""]})]}),t?h.jsxs("a",{href:t,download:s,className:Se("flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5","text-body-sm text-fg-2 transition-colors hover:bg-surface-hover"),children:[h.jsx(F_,{className:"size-3.5"}),"Download"]}):null]})}const um=["⋄","◇","◈","◆"],Ire=150,Mre=um[um.length-1];function Lre(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const n=window.matchMedia?.("(prefers-reduced-motion: reduce)");if(!n)return;t(n.matches);const r=()=>t(n.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}function rI(e){const t=Lre(),n=e&&!t,[r,s]=y.useState(0);return y.useEffect(()=>{if(!n)return;const a=setInterval(()=>s(l=>l+1),Ire);return()=>clearInterval(a)},[n]),n?um[r%um.length]:Mre}const Mb=["Working","Thinking","Churning","Pondering","Whirring","Computing","Percolating","Tinkering","Deliberating","Simmering","Crunching","Noodling"],Dre=4e3;function jre({label:e,startedAt:t,tokens:n,className:r}){const s=Kr(),a=rI(s);if(!s)return h.jsxs("div",{"data-slot":"loader",className:Se("flex items-center gap-2 py-1 text-body-sm text-fg-4",r),children:[h.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(f=>h.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${f*160}ms`}},f))}),e?h.jsx("span",{children:e}):null]});const l=t===void 0?void 0:Date.now()-t,c=e??Mb[Math.floor((l??0)/Dre)%Mb.length]??Mb[0],d=[l!==void 0?m1(l):void 0,n!==void 0?`↓ ${us(n)}`:void 0].filter(Boolean);return h.jsxs("div",{"data-slot":"loader",className:Se("flex items-baseline gap-2",r),children:[h.jsx(Mr,{className:"text-accent",children:a}),h.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-3",children:[c,"…"," ",d.length?h.jsxs("span",{className:"text-label text-fg-4",children:["(",d.join(" · "),")"]}):null]})]})}function zk({from:e,className:t,children:n,...r}){const s=Kr();return h.jsx("div",{"data-slot":"message","data-from":e,className:Se("flex w-full",s?Se("flex-row gap-2",e==="user"&&"-mx-1 rounded-sm bg-surface px-1"):Se("flex-col gap-1",e==="user"?"items-end":"items-start"),t),...r,children:s?h.jsxs(h.Fragment,{children:[h.jsx(Mr,{className:e==="user"?"text-accent":"text-fg-3",children:e==="user"?"❯":"●"}),h.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:n})]}):n})}function Hk({className:e,...t}){const n=Kr();return h.jsx("div",{"data-slot":"message-content",className:Se("min-w-0",n?Se("w-full text-fg-1",qne,"in-data-[from=user]:whitespace-pre-wrap"):Se("text-body-sm leading-6 text-fg-1","in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-br-sm","in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2","in-data-[from=user]:whitespace-pre-wrap","in-data-[from=assistant]:w-full"),e),...t})}function Pre({text:e,className:t}){const n=DF(e);if(n.length===0)return h.jsx("span",{className:t,children:e});const r=[];let s=0;for(const[a,l]of n.entries())l.start>s&&r.push(e.slice(s,l.start)),r.push(h.jsx("span",{className:Se("font-mono",l.kind==="file"?"text-accent":"text-info"),children:l.text},`${l.start}-${a}`)),s=l.end;return s<e.length&&r.push(e.slice(s)),h.jsx("span",{className:t,children:r.map((a,l)=>h.jsx(y.Fragment,{children:a},l))})}function Bre({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const s=Kr(),[a,l]=y.useState(n??t),c=y.useRef(!1);y.useEffect(()=>{if(!c.current)if(t)l(!0);else{const f=setTimeout(()=>l(!1),600);return()=>clearTimeout(f)}},[t]);const d=e.trim()!=="";return!d&&!t?null:h.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:Se("w-full",r),children:[h.jsxs("button",{type:"button",disabled:!d,onClick:()=>{c.current=!0,l(f=>!f)},className:Se("flex items-baseline text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",s?"w-full gap-2":"items-center gap-1.5"),children:[s?h.jsx(Mr,{className:"text-fg-4",children:"✻"}):h.jsx(Z9,{className:"size-3.5"}),h.jsx("span",{className:Se(s&&"leading-5"),children:t?"Thinking…":"Thought process"}),d&&!s?h.jsx(U_,{className:Se("size-3.5 transition-transform",a&&"rotate-180")}):null]}),a&&d?h.jsx("div",{className:Se("border-l border-border text-body-sm text-fg-3 [&_*]:text-fg-3",s?"ml-[0.4375rem] mt-0.5 pl-2 leading-5":"mt-2 border-l-2 pl-3"),children:h.jsx(qy,{streaming:t,children:e})}):null]})}function zre({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:s}){const a=[{icon:Z7,text:"Tell the agent what to do."},...t?[{icon:DB,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:Hm,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:W9,text:"Type @ to search this project’s files."}]:[]];return h.jsxs("div",{className:Se("flex flex-col items-center gap-4 py-10",s),children:[h.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:h.jsx(a1,{className:"size-5"})}),e?h.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,h.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>h.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[h.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),h.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const Uk=2e3,Hre=new Set(["CodexImageGeneration","CodexImageView"]),Ure=e=>{if(!Hre.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},Fre={running:{label:"Running",variant:"info",busy:!0},pending:{label:"Executing",variant:"info",busy:!0},deferred:{label:"Deferred",variant:"accent",busy:!1},settled:{label:"Done",variant:"success",busy:!1},failed:{label:"Error",variant:"danger",busy:!1}},$re={running:"text-info",pending:"text-info",deferred:"text-accent",settled:"text-fg-4",failed:"text-danger"},Vre={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",jsonc:"json",md:"md",mdx:"md",css:"css",scss:"scss",html:"html",xml:"xml",yml:"yaml",yaml:"yaml",toml:"toml",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",sql:"sql",graphql:"graphql",dockerfile:"dockerfile",diff:"diff",patch:"diff"};function qre(e){if(e.name==="Bash"||e.name==="CodexCommand")return"bash";if(e.name==="CodexFileChange")return"diff";const t=e.input,n=t?.file_path??t?.path;if(typeof n!="string")return;const r=n.slice(n.lastIndexOf(".")+1).toLowerCase();return Vre[r]}function Yre({item:e,hostImage:t,className:n}){const r=Kr(),[s,a]=y.useState(!1),[l,c]=y.useState(!1),d=Ure(e),f=e.status??(e.result===void 0?"running":"settled"),p=Fre[f],m=f==="failed"||e.result?.isError===!0,b=rI(r&&p.busy),x=KA(e.name),v=e.result?.text??"",k=!l&&v.length>Uk,C=k?v.slice(0,Uk):v,S=r?"plain":"panel",N=r?Xre:Kre,_=s?h.jsxs("div",{className:Se("flex flex-col",r?"gap-1 py-1":"gap-2 border-t border-border p-2.5"),children:[h.jsx(N,{code:JSON.stringify(e.input,null,2),language:"json",label:"Parameters",variant:S}),e.logs?.length?h.jsx(N,{code:e.logs.join(`
676
+ `),label:"Logs",variant:S}):null,e.result!==void 0?h.jsxs("div",{children:[h.jsx(N,{code:C||"(empty result)",language:qre(e),label:m?"Error":"Result",variant:S,className:Se(m&&(r?"[&_pre]:text-danger":"border-danger/40 [&_pre]:text-danger"))}),k?h.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>c(!0),children:["Show all ",v.length.toLocaleString()," chars"]}):null]}):null]}):null,R=d&&t?h.jsx(Wre,{path:d,load:t,lines:r}):null;return r?h.jsxs("div",{"data-slot":"tool-call","data-state":f,className:Se("w-full",n),children:[h.jsxs("button",{type:"button",onClick:()=>a(I=>!I),className:"flex w-full items-baseline gap-2 text-left outline-none",children:[h.jsx(Mr,{className:f==="settled"&&!m&&S$(e.name)?"text-success":$re[f],children:p.busy?b:"●"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5 text-fg-3",children:[h.jsx("span",{className:"font-medium text-fg-1",children:e.name}),h.jsxs("span",{className:"text-fg-4",children:["(",g1(e.input),")"]})]}),e.backend&&e.backend!=="server"?h.jsx("span",{className:"shrink-0 text-label text-fg-4",children:e.backend}):null,f==="deferred"?h.jsx(xC,{className:"size-3 shrink-0 self-center text-fg-4"}):null,m&&!p.busy?h.jsx("span",{className:"shrink-0 text-label text-danger",children:"error"}):null]}),!s&&v?h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-fg-4",children:"⎿"}),h.jsx("span",{className:Se("min-w-0 flex-1 truncate text-label leading-5",m?"text-danger":"text-fg-4"),children:Gre(v)})]}):null,R,_?h.jsx("div",{className:fa,children:_}):null]}):h.jsxs("div",{"data-slot":"tool-call","data-state":f,className:Se("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[h.jsxs("button",{type:"button",onClick:()=>a(I=>!I),className:Se("flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none","hover:bg-surface-hover focus-visible:bg-surface-hover"),children:[h.jsx(x,{className:"size-3.5 shrink-0 text-fg-3"}),h.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?h.jsx(pn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:g1(e.input)}),h.jsxs(pn,{variant:p.variant,dot:!p.busy,className:"shrink-0 gap-1",children:[p.busy?h.jsx(kn,{className:"size-3 text-current"}):null,f==="deferred"?h.jsx(xC,{className:"size-3 text-current"}):null,p.label]}),h.jsx(U_,{className:Se("size-3.5 shrink-0 text-fg-4 transition-transform",s&&"rotate-180")})]}),R,_]})}function Gre(e){const t=e.split(`
677
+ `).find(s=>s.trim()!=="")??"",n=e.trimEnd().split(`
678
+ `).length-1,r=t.trim();return n>0?`${r} (+${n} lines)`:r}function Kre({code:e,label:t,variant:n,className:r}){return h.jsx(yA,{code:e,label:t,variant:n,className:r})}function Xre({code:e,label:t,language:n,className:r}){return h.jsx(Yy,{code:e,label:t,language:n,className:r})}function Wre({path:e,load:t,lines:n}){const[r,s]=y.useState();return y.useEffect(()=>{let a=!1;return s(void 0),t(e).then(l=>{a||s(l)}).catch(()=>{}),()=>{a=!0}},[e,t]),r?h.jsx("div",{className:Se(n?Se("py-1",fa):"border-t border-border p-2.5"),children:h.jsx("img",{src:r,alt:e.split("/").pop()??"Generated image",className:"max-h-96 w-auto max-w-full rounded-md border border-border"})}):null}function Qre({item:e}){return Kr()?h.jsxs("div",{"data-slot":"turn-result",className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:"text-fg-4",children:"·"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("span",{className:Se("text-label leading-5",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",m1(e.durationMs)," ·"," ",bo(e.totalCostUsd)]}),e.errors?.length?h.jsx("ul",{className:"flex flex-col",children:e.errors.map((n,r)=>h.jsx("li",{className:"text-label leading-5 break-words text-danger",children:n},r))}):null]})]}):h.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"h-px flex-1 bg-border"}),h.jsxs("span",{className:Se("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",m1(e.durationMs)," ·"," ",bo(e.totalCostUsd)]}),h.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?h.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((n,r)=>h.jsx("li",{className:"text-label break-words text-danger",children:n},r))}):null]})}function Zre({item:e}){return Kr()?h.jsxs("div",{"data-slot":"notice",className:"flex items-baseline gap-2",children:[h.jsx(Mr,{className:e.level==="error"?"text-danger":"text-fg-4",children:"!"}),h.jsx("span",{className:Se("min-w-0 flex-1 text-body-sm leading-5",e.level==="error"?"text-danger":"text-fg-3"),children:e.text})]}):h.jsx("div",{"data-slot":"notice",className:Se("rounded-md border px-3 py-2 text-body-sm",e.level==="error"?"border-transparent bg-danger-bg text-danger":"border-border bg-surface text-fg-3"),children:e.text})}function Jre({item:e,fileUrl:t,attachmentUrl:n,hostImage:r}){switch(e.kind){case"user":return h.jsxs(zk,{from:"user",children:[e.attachments?.length?h.jsx(sse,{attachments:e.attachments,attachmentUrl:n}):null,e.text?h.jsx(Hk,{children:h.jsx(Pre,{text:e.text})}):null]});case"assistant_text":return h.jsx(zk,{from:"assistant",children:h.jsx(Hk,{children:h.jsx(qy,{streaming:e.streaming,children:e.text})})});case"thinking":return h.jsx(Bre,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return h.jsx(Yre,{item:e,hostImage:r});case"turn_result":return h.jsx(Qre,{item:e});case"notice":return h.jsx(Zre,{item:e});case"file_delivered":return h.jsx(Ore,{item:e,href:t?.(e.path)});default:return null}}function ese({line:e,since:t}){const n=Kr(),r=t===void 0?void 0:cd(t),s=r?`${e} · last here ${r}`:e;return n?h.jsxs("div",{"data-slot":"recap",className:"flex items-baseline gap-2 py-0.5",children:[h.jsx(Mr,{className:"text-accent",children:"※"}),h.jsxs("span",{className:"min-w-0 flex-1 text-label leading-5 text-fg-3",children:[h.jsx("span",{className:"text-fg-2",children:"recap:"})," ",s]})]}):h.jsxs("div",{"data-slot":"recap",className:"flex items-center gap-2 py-1",children:[h.jsx("div",{className:"h-px flex-1 bg-border"}),h.jsxs("span",{className:"font-mono text-label text-fg-3",children:["※ recap: ",s]}),h.jsx("div",{className:"h-px flex-1 bg-border"})]})}function tse(e,t,n=400){const[r,s]=y.useState(!1);return y.useEffect(()=>{if(r||e===0)return;const a=setTimeout(()=>s(!0),n);return()=>clearTimeout(a)},[e,r,n]),r&&(t==="running"||t==="starting")}function nse(e){const t=e==="running"||e==="starting",[n,r]=y.useState(void 0);return y.useEffect(()=>{r(s=>t?s??Date.now():void 0)},[t]),t?n:void 0}function rse(e){if(e.status!=="running"&&e.status!=="starting")return!1;const t=e.items.at(-1);return t?t.kind==="assistant_text"&&t.streaming||t.kind==="thinking"&&t.id==="streaming-thinking"?!1:t.kind!=="turn_result"||e.status==="running":!0}function sse({attachments:e,attachmentUrl:t}){const n=Kr();return h.jsx("div",{className:Se("mb-1 flex flex-wrap gap-1.5",n?"justify-start":"justify-end"),children:e.map(r=>{const s=t?.(r.id);return r.mediaType.startsWith("image/")&&s?h.jsx("img",{src:s,alt:r.name,className:"size-20 rounded-md border border-border object-cover"},r.id):h.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:r.name},r.id)})})}function ise(e,t){if("parentToolUseId"in e&&e.parentToolUseId!=null)return t?"ml-3.5 border-l border-border pl-2":"border-l-2 border-border pl-3"}function ase({rows:e,boundary:t,since:n,lines:r,gap:s,fileUrl:a,attachmentUrl:l,hostImage:c,jumpToRecapRef:d}){const f=Gy(),[p,m]=y.useState(null);y.useEffect(()=>{m(f.scrollRef.current)},[f.scrollRef]);const b=vre({count:e.length,getScrollElement:()=>(p&&b.scrollElement!==p&&(b.scrollOffset=p.scrollTop),p),estimateSize:()=>(r?32:100)+s.px,overscan:8,getItemKey:v=>e[v].key,useFlushSync:!0});b.shouldAdjustScrollPositionOnItemSizeChange=(v,k,C)=>{if(f.state.isAtBottom)return!1;const S=(C.scrollOffset??0)+C.scrollAdjustments;return C.itemSizeCache.has(v.key)?v.end<=S&&C.scrollDirection!=="backward":v.start<S};const x=y.useRef(void 0);return y.useEffect(()=>()=>clearTimeout(x.current),[]),y.useEffect(()=>{if(d)return d.current=()=>{const v=e.findIndex(C=>C.key==="recap");if(v<0)return;f.stopScroll(),clearTimeout(x.current);const k=C=>{const S=p?.querySelector('[data-slot="recap"]');if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}C>=6||(b.scrollToIndex(v,{align:"center",behavior:"smooth"}),x.current=setTimeout(()=>k(C+1),300))};k(0)},()=>{d.current=null}}),h.jsx("div",{"data-slot":"transcript-rows",className:"relative w-full",style:{height:b.getTotalSize()},children:b.getVirtualItems().map(v=>{const k=e[v.index];return h.jsx("div",{ref:b.measureElement,"data-index":v.index,className:Se("absolute inset-x-0 top-0",v.index>0&&s.className),style:{transform:`translateY(${v.start}px)`},children:"item"in k?h.jsx("div",{className:Se(r&&"-mx-1 rounded-sm px-1 py-0.5 transition-colors hover:bg-surface-hover",t!==void 0&&k.index<t&&"opacity-45",ise(k.item,r)),children:h.jsx(Jre,{item:k.item,fileUrl:a,attachmentUrl:l,hostImage:c})}):h.jsx(ese,{line:k.line,since:n})},k.key)})})}function ose({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:s,variant:a="cards",density:l="comfortable",catchUp:c,jumpToRecapRef:d,className:f}){const p=a==="lines",m=Vne[a][l],b=nse(e.status),x=tse(e.items.length,e.status),v=c&&c.from>0&&c.from<e.items.length?c.from:void 0,k=y.useMemo(()=>v===void 0?void 0:QF(WF(e,v)),[e,v]),C=y.useMemo(()=>{const S=[];for(const[N,_]of e.items.entries())N===v&&k&&S.push({key:"recap",line:k}),S.push({key:`${_.kind}:${_.id}`,item:_,index:N});return S},[e.items,v,k]);return h.jsx(KO,{value:a,children:h.jsxs(_re,{className:f,resize:x?"smooth":"instant",children:[h.jsxs(Are,{className:Se(p&&"gap-0 px-2 py-1.5"),children:[e.items.length===0&&e.status!=="starting"?h.jsx(zre,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(S=>S.enabled),canBrowseFiles:r}):h.jsx(ase,{rows:C,boundary:v,since:c?.since,lines:p,gap:m,fileUrl:t,attachmentUrl:n,hostImage:s,jumpToRecapRef:d}),rse(e)?h.jsx(jre,{label:e.status==="starting"?"Starting session…":void 0,startedAt:b,tokens:e.contextUsage?.totalTokens,className:Se(p&&"py-0.5")}):null]}),h.jsx(Rre,{})]})})}function lse(e){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[e]),t}const use=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function cse({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:s,open:a,onOpenChange:l}){const c=lse(a);return h.jsx(Ao,{open:a,onOpenChange:l,children:h.jsxs(Ro,{children:[h.jsx(Oo,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?h.jsx(pn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),h.jsxs(Io,{children:[e.length===0?h.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:n==="claude"?"This session reports no plan windows — API-key sessions have none, and a subscription session reports them once a turn has run.":`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):h.jsx("div",{className:"flex flex-col gap-5",children:e.map(({key:d,info:f})=>h.jsx(dse,{windowKey:d,info:f,now:c},d))}),h.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[h.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),h.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:bo(r)})]}),s?h.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",e$(s,c)]}):null]})]})})}function dse({windowKey:e,info:t,now:n}){const r=t.utilization??0,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0,a=JF(e),l=s!==void 0?(s-n)/1e3:void 0,c=a!==void 0&&l!==void 0&&l>0&&l<a?(a-l)/a:void 0;return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsx("span",{className:"truncate text-body-sm text-fg-1",children:ZF(e)}),h.jsxs("span",{className:Se("shrink-0 font-mono text-body-sm font-medium",t.status==="rejected"?"text-danger":"text-fg-1"),children:[r.toFixed(0),"% used"]})]}),h.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[h.jsx("div",{className:Se("h-full rounded-full",use(r)),style:{width:`${Math.min(100,Math.max(2,r))}%`}}),c!==void 0?h.jsx("span",{"aria-hidden":!0,title:"Spent evenly, usage would be here by now",className:"absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1",style:{left:`${Math.min(100,Math.max(0,c*100))}%`}}):null]}),h.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[s!==void 0?h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(EB,{className:"size-3"})," Resets in ",p1(s,n)]}):null,t.isUsingOverage?h.jsx("span",{className:"text-warning",children:"overage"}):null,t.status==="rejected"?h.jsx("span",{className:"text-danger",children:"limit reached"}):null]})]})}const fse=["button","a","input","textarea","select","summary","img",'[contenteditable="true"]','[role="button"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'].join(",");function hse({client:e,sessionId:t,header:n,panelSurface:r="internal",statusSurface:s="internal",onOpenPanel:a,onVitals:l,transcriptVariant:c="cards",transcriptDensity:d="comfortable",controlsSurface:f="internal",onControls:p,focusComposerOnClick:m=!1,unseen:b,className:x}){const v=r==="external",k=s==="external",C=f==="external",[S,N]=y.useState(void 0),[_,R]=y.useState(),{state:I,connection:A,protocolMismatch:L,models:D,effectiveModel:U,handle:z,send:K,approve:W,deny:J,interrupt:te,setModel:V,setPermissionMode:B,reconnectNow:G}=wF(e,t,{onProtocolError:N});y.useEffect(()=>N(void 0),[t]);const[X,ae]=y.useState(!1);y.useEffect(()=>{ae(!1)},[t]);const[M]=y.useState(b),P=X?void 0:M,$=P?Math.max(0,I.items.length-P.itemCount):0,j=y.useCallback(Q=>{v?a?.(Q):R(Q)},[v,a]);y.useEffect(()=>{const Q=()=>{document.visibilityState==="visible"&&G()};return document.addEventListener("visibilitychange",Q),()=>document.removeEventListener("visibilitychange",Q)},[G]),XF(z);const re=I.capabilities,oe=y.useRef(l);oe.current=l;const ce=U??I.model,de=y.useMemo(()=>T$(re.permissionModes,I.session?.canBypassPermissions),[re.permissionModes,I.session?.canBypassPermissions]);y.useEffect(()=>{oe.current?.({status:I.status,connection:A,engine:I.engine,capabilities:I.capabilities,model:ce,models:D,permissionMode:I.permissionMode,permissionModes:de,cwd:I.cwd,contextUsage:I.contextUsage,rateLimits:I.rateLimits,itemCount:I.items.length})},[I.status,A,I.engine,I.capabilities,ce,D,I.permissionMode,de,I.cwd,I.contextUsage,I.rateLimits,I.items.length]);const fe=y.useRef(p);fe.current=p;const ve=y.useRef({setModel:V,setPermissionMode:B,interrupt:te});ve.current={setModel:V,setPermissionMode:B,interrupt:te};const Fe=y.useRef({setModel:Q=>ve.current.setModel(Q),setPermissionMode:Q=>ve.current.setPermissionMode(Q),interrupt:()=>ve.current.interrupt(),focusComposer:()=>Me.current?.focus()});y.useEffect(()=>{const Q=fe.current;return Q?.(Fe.current),()=>Q?.(void 0)},[t]);const De=I.status==="running"||I.status==="awaiting_approval",Ee=I.status==="failed"||I.status==="closed",Ie=AF(e,t,{capabilities:re,engine:I.engine}),Be=UA(e,I.cwd),Ge=y.useMemo(()=>vF(I),[I]),$e=mse(e,t,I.producedFiles),Me=y.useRef(null),we=y.useRef(null),ye=y.useMemo(()=>{if(I.commands)return I.commands.some(Q=>Q.name==="model")?I.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...I.commands]},[I.commands]),Oe=(Q,Y)=>{if(Y.length===0){const F=/^\/model\s+(\S+)$/.exec(Q);if(F){V(F[1]);return}if(re.mcpStatus&&Q.trim()==="/mcp"){j("mcp");return}}ae(!0),K(Q,Y)},je=h.jsxs(Fz,{children:[h.jsx($z,{render:h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:h.jsx(y7,{className:"size-4"})})}),h.jsxs(Vz,{children:[re.contextUsage?h.jsxs(Tl,{onClick:()=>j("context"),children:[h.jsx(n7,{className:"size-3.5 text-fg-3"})," Context"]}):null,re.rateLimits?h.jsxs(Tl,{onClick:()=>j("usage"),children:[h.jsx(P7,{className:"size-3.5 text-fg-3"})," Usage"]}):null,h.jsxs(Tl,{onClick:()=>j("info"),children:[h.jsx(q7,{className:"size-3.5 text-fg-3"})," Session info"]}),re.mcpStatus?h.jsxs(Tl,{onClick:()=>j("mcp"),children:[h.jsx(cB,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,re.skillsList?h.jsxs(Tl,{onClick:()=>j("skills"),children:[h.jsx(Hm,{className:"size-3.5 text-fg-3"})," Skills"]}):null,Be.available?h.jsxs(Tl,{onClick:()=>j("files"),children:[h.jsx(L7,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),ee=v?null:je,me=typeof n=="function",ie=Q=>{!m||Q.target?.closest(fse)||window.getSelection()?.isCollapsed!==!1&&Me.current?.focus()};return h.jsx(KO,{value:c,children:h.jsx($ne,{value:d,children:h.jsxs("div",{"data-slot":"session-panel",onClick:ie,className:Se("flex h-full min-h-0 flex-col overflow-hidden bg-bg",x),children:[me?n({actions:ee}):n,k?null:h.jsx(sre,{state:I,connection:A,onOpenStatus:v&&!a?void 0:()=>j("info"),onOpenContext:v&&!a?void 0:()=>j("context"),onOpenUsage:v&&!a?void 0:()=>j("usage"),actions:me?void 0:ee}),L!==void 0?h.jsxs(Fk,{level:"warning",children:["Server speaks protocol v",L,", this build renders v",HA,". Some events may not render."]}):null,S?h.jsx(Fk,{level:"error",onDismiss:()=>N(void 0),children:S}):null,h.jsx(ose,{state:I,fileUrl:t?Q=>e.sessionFileUrl(t,Q):void 0,attachmentUrl:t?Q=>e.attachmentUrl(t,Q):void 0,canBrowseFiles:Be.available,hostImage:$e,variant:c,density:d,catchUp:P&&$>0?{from:P.itemCount,since:P.since}:void 0,jumpToRecapRef:we}),P&&$>0?h.jsx("div",{className:"px-3 pb-1",children:h.jsxs("div",{"data-slot":"catch-up",className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-fg-3",children:[h.jsx("span",{"aria-hidden":!0,className:"select-none text-accent",children:"※"}),h.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[$," new ",$===1?"row":"rows",P.since!==void 0?" since you were last here":""]}),h.jsx("button",{type:"button",onClick:()=>we.current?.(),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"jump"}),h.jsx("button",{type:"button",onClick:()=>ae(!0),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"dismiss"})]})}):null,re.interactiveApprovals&&I.pendingApprovals.length>0?h.jsx("div",{className:"px-3 pb-2",children:h.jsx("div",{className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-2",children:I.pendingApprovals.map(Q=>Q.toolName==="AskUserQuestion"&&ZO(Q.input).length>0?h.jsx(Zne,{request:Q,onAnswer:W,onDismiss:Y=>J(Y,"Question dismissed by user")},Q.id):h.jsx(Wne,{request:Q,onApprove:W,onDeny:J},Q.id))})}):null,h.jsx(n$,{ref:Me,onSend:Oe,onInterrupt:te,busy:De,disabled:Ee||!t,commands:re.slashCommands?ye:void 0,skills:re.skillsList?I.skills:void 0,attachments:Ie,onSearchFiles:Be.available?(Q,Y)=>Be.search(Q,{...Y,limit:8}):void 0,layout:C?"inline":"stacked",toolbar:C?void 0:h.jsxs(h.Fragment,{children:[D.length?h.jsx(GA,{models:D,model:U,onModelChange:V,disabled:Ee}):null,I.permissionMode?h.jsx(qm,{mode:I.permissionMode,onModeChange:B,modes:re.permissionModes,canBypass:I.session?.canBypassPermissions,disabled:Ee}):null]})}),v?null:h.jsxs(h.Fragment,{children:[h.jsx(Jne,{state:I,client:e,sessionId:t,open:_==="info",onOpenChange:Q=>R(Q?"info":void 0)}),h.jsx(l$,{usage:I.contextUsage,open:_==="context",onOpenChange:Q=>R(Q?"context":void 0)}),h.jsx(cse,{rateLimits:Ge,subscriptionType:I.subscriptionType,engine:I.engine??"claude",totalCostUsd:I.totalCostUsd,updatedAt:I.rateLimitsUpdatedAt,open:_==="usage",onOpenChange:Q=>R(Q?"usage":void 0)}),h.jsx(d$,{client:e,sessionId:t,canManageServers:re.mcpServerActions,open:_==="mcp",onOpenChange:Q=>R(Q?"mcp":void 0)}),h.jsx(g$,{skills:I.skills,open:_==="skills",onOpenChange:Q=>R(Q?"skills":void 0),onUse:Q=>Me.current?.insertText(VA(Q))}),h.jsx(u$,{client:e,cwd:I.cwd,open:_==="files",onOpenChange:Q=>R(Q?"files":void 0)})]})]})})})}function mse(e,t,n){const r=y.useRef(new Map),s=y.useRef([]);return y.useEffect(()=>()=>{for(const a of s.current)URL.revokeObjectURL(a);s.current=[]},[]),y.useCallback(a=>{const l=n?.[a],c=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(c);if(d)return d;const f=l&&t?e.readProducedFile(t,l.fileId).then(p=>{if(p.size===0)return;const m=URL.createObjectURL(p);return s.current.push(m),m}).catch(()=>{}):e.readHostFile(a).then(p=>{if(p.encoding!=="base64")return;const m=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=pse[m];return b?`data:${b};base64,${p.content}`:void 0}).catch(()=>{});return r.current.set(c,f),f},[e,t,n])}const pse={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function Fk({level:e,onDismiss:t,children:n}){return h.jsx("div",{className:"px-3 pt-2",children:h.jsxs("div",{role:"alert",className:Se("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-start gap-2 rounded-md border px-3 py-2 text-body-sm",e==="error"?"border-danger/40 bg-danger-bg text-danger":"border-warning/40 bg-warning-bg text-warning"),children:[h.jsx(Bl,{className:"mt-0.5 size-3.5 shrink-0"}),h.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?h.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:h.jsx(js,{className:"size-3.5"})}):null]})})}function gse({rows:e,config:t,onConfigChange:n,scope:r,activeId:s,onSelect:a,onDelete:l,onRename:c,emptyState:d,className:f}){const p=y.useMemo(()=>aF(e,t,r),[e,t,r]),m=y.useMemo(()=>uF(p,t),[p,t]),b=cF(t,r,p.length,e.length),x=y.useMemo(()=>nF(e),[e]),v=y.useMemo(()=>{const C=new Map;for(const S of e)C.set(S.hostId,S.hostName);return[...C].map(([S,N])=>({id:S,name:N}))},[e]),k=C=>n({...t,...C});return h.jsxs("div",{"data-slot":"session-browser",className:Se("flex flex-col gap-3",f),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsxs("div",{className:"relative min-w-48 flex-1",children:[h.jsx(zm,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4"}),h.jsx(sn,{value:t.search,onChange:C=>k({search:C.target.value}),placeholder:"Search sessions","aria-label":"Search sessions",className:"pl-8"})]}),h.jsx(Lb,{label:"State",value:t.states,options:DA.map(C=>({value:C,label:jA[C]})),onChange:C=>k({states:C})}),x.length>1?h.jsx(Lb,{label:"Engine",value:t.adapters,options:x.map(C=>({value:C,label:C})),onChange:C=>k({adapters:C})}):null,v.length>1?h.jsx(Lb,{label:"Gateway",value:t.gateways,options:v.map(C=>({value:C.id,label:C.name})),onChange:C=>k({gateways:C})}):null,h.jsx(Vk,{label:"Group",value:t.groupBy,options:[{value:"none",label:"No grouping"},{value:"state",label:"By state"},{value:"adapter",label:"By engine"},...v.length>1?[{value:"gateway",label:"By gateway"}]:[]],onChange:C=>k({groupBy:C})}),h.jsx(Vk,{label:"Sort",value:t.sortBy,options:[{value:"recent",label:"Recent"},{value:"name",label:"Name"},{value:"state",label:"State"},...v.length>1?[{value:"gateway",label:"Gateway"}]:[]],onChange:C=>k({sortBy:C})})]}),b?h.jsxs("div",{className:"flex items-center gap-2 text-label text-fg-4",children:[h.jsxs("span",{children:[b.shown," of ",b.total,b.causes.length?` · ${b.causes.join(" · ")}`:null]}),h.jsx("button",{type:"button",className:"text-fg-3 underline underline-offset-2 hover:text-fg-1",onClick:()=>n(BC(t)),children:"Show all"})]}):null,e.length===0?d??h.jsx($k,{children:"No sessions yet."}):p.length===0?h.jsx($k,{children:dF(t)?h.jsxs(h.Fragment,{children:["No sessions match."," ",h.jsx("button",{type:"button",className:"underline underline-offset-2 hover:text-fg-1",onClick:()=>n(BC(t)),children:"Clear filters"})]}):"No sessions here."}):h.jsx("div",{className:"flex flex-col gap-4",children:m.map(C=>h.jsxs("div",{className:"flex flex-col gap-1",children:[t.groupBy!=="none"&&C.label?h.jsxs("div",{className:"flex items-baseline gap-2 px-2.5 text-label font-medium text-fg-4",children:[h.jsx("span",{className:"uppercase tracking-wide",children:C.label}),h.jsx("span",{className:"text-fg-4/70",children:C.rows.length})]}):null,C.rows.map(S=>h.jsx(bse,{row:S,active:S.info.id===s,showGateway:v.length>1,onSelect:a,onDelete:l,onRename:c},`${S.hostId}:${S.info.id}`))]},C.key))})]})}function $k({children:e}){return h.jsx("div",{className:"px-2.5 py-6 text-center text-body-sm text-fg-4",children:e})}function bse({row:e,active:t,showGateway:n,onSelect:r,onDelete:s,onRename:a}){const{info:l}=e,c=JO[l.status],[d,f]=y.useState(!1);return h.jsxs("div",{"data-slot":"session-row","data-active":t||void 0,className:Se("group flex w-full items-center gap-2 rounded-md border border-transparent px-2.5 py-2 text-left transition-colors",t?"border-border bg-surface":"hover:bg-surface-hover"),children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[d&&a?h.jsx(xse,{initial:l.title??"",onCommit:p=>{f(!1),a(e,p)},onCancel:()=>f(!1)}):h.jsx("button",{type:"button",onClick:()=>r?.(e),className:"min-w-0 truncate text-left text-body-sm font-medium text-fg-1 outline-none",children:Qh(l)}),h.jsx(pn,{variant:c.variant,dot:!0,className:"shrink-0",children:c.label}),e.unseen>0?h.jsx(pn,{variant:"accent",className:"shrink-0",title:`${e.unseen} new`,children:e.unseen}):null]}),h.jsxs("button",{type:"button",onClick:()=>!d&&r?.(e),className:"mt-0.5 flex w-full items-center gap-2 text-left font-mono text-label text-fg-4 outline-none",children:[h.jsx("span",{className:"truncate",children:l.cwd}),n?h.jsx("span",{className:"shrink-0",children:e.hostName}):null,l.profile?h.jsxs("span",{className:"shrink-0",children:["@",l.profile]}):null,h.jsx("span",{className:"shrink-0",children:bo(l.totalCostUsd)}),h.jsx("span",{className:"shrink-0",children:cd(l.lastActivityAt??l.createdAt)})]})]}),a&&!d?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Rename session",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>f(!0),children:h.jsx(lB,{className:"size-3.5 text-fg-3"})}):null,s?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>s(e),children:h.jsx(ty,{className:"size-3.5 text-fg-3"})}):null]})}function xse({initial:e,onCommit:t,onCancel:n}){const[r,s]=y.useState(e),a=y.useRef(null);return y.useEffect(()=>{a.current?.select()},[]),h.jsx("input",{ref:a,value:r,autoFocus:!0,"aria-label":"Session name",onClick:l=>l.stopPropagation(),onChange:l=>s(l.target.value),onBlur:()=>document.hasFocus()?t(r.trim()):void 0,onKeyDown:l=>{l.key==="Enter"?t(r.trim()):l.key==="Escape"&&n(),l.stopPropagation()},className:"-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-0.5 text-body-sm font-medium text-fg-1 outline-none"})}function Lb({label:e,value:t,options:n,onChange:r}){return h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(Bs,{multiple:!0,value:t,onValueChange:s=>r(s),children:[h.jsx(Hs,{"aria-label":e,className:"min-w-28",children:h.jsx(zs,{children:t.length===0?e:t.length===1?n.find(s=>s.value===t[0])?.label??e:`${e} · ${t.length}`})}),h.jsx(Us,{children:n.map(s=>h.jsx(xs,{value:s.value,children:h.jsx(bs,{children:s.label})},s.value))})]}),t.length>0?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":`Clear ${e}`,onClick:()=>r([]),children:h.jsx(js,{className:"size-3 text-fg-4"})}):null]})}function Vk({label:e,value:t,options:n,onChange:r}){return h.jsxs(Bs,{value:t,onValueChange:s=>r(s),children:[h.jsx(Hs,{"aria-label":e,className:"min-w-28",children:h.jsx(zs,{children:n.find(s=>s.value===t)?.label??e})}),h.jsx(Us,{children:n.map(s=>h.jsx(xs,{value:s.value,children:h.jsx(bs,{children:s.label})},s.value))})]})}const yse="0.12.0",Ese=yse;function vse({className:e}){return h.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[h.jsx("path",{d:"M12 3 20.5 7.75 12 12.5 3.5 7.75Z"}),h.jsx("path",{d:"M3.5 12.25 12 17l8.5-4.75"}),h.jsx("path",{d:"M3.5 16.5 12 21.25l8.5-4.75"}),h.jsx("path",{d:"M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z",fill:"#2fbf71",stroke:"none"})]})}function sI(){const[e,t]=y.useState(W1());return h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(qM()),children:e==="dark"?h.jsx(UB,{className:"size-4"}):h.jsx(eB,{className:"size-4"})})}const Tse=[{id:"sessions",label:"Sessions",icon:PB,path:"/sessions"},{id:"jobs",label:"Jobs",icon:G_,path:"/jobs"},{id:"profiles",label:"Profiles",icon:Q_,path:"/profiles"},{id:"settings",label:"Settings",icon:kB,path:"/settings"}],qk="workerdeck.sidebar-collapsed";function Sse({children:e}){const t=jL({select:a=>a.location.pathname}),[n,r]=y.useState(()=>{try{return localStorage.getItem(qk)==="1"}catch{return!1}}),s=()=>{r(a=>{try{localStorage.setItem(qk,a?"0":"1")}catch{}return!a})};return h.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[h.jsxs("aside",{className:Se("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",n?"w-14 items-center":"w-52"),children:[h.jsxs("div",{className:Se("flex items-center py-2",n?"justify-center":"gap-2 px-2"),children:[h.jsx(vse,{className:"size-4 shrink-0 text-fg-1"}),!n&&h.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),h.jsx("nav",{className:Se("mt-1 flex flex-1 flex-col gap-0.5",n&&"items-center"),children:Tse.map(a=>{const l=t.startsWith(a.path);return h.jsxs(sd,{to:a.path,title:n?a.label:void 0,"aria-label":a.label,className:Se("flex items-center rounded-md text-body-sm transition-colors outline-none",n?"justify-center p-2":"gap-2 px-2 py-1.5",l?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-surface-hover hover:text-fg-1"),children:[h.jsx(a.icon,{className:"size-4 shrink-0"}),!n&&a.label]},a.id)})}),h.jsxs("div",{className:Se("flex items-center",n?"flex-col gap-1":"justify-between px-1"),children:[!n&&h.jsxs("span",{className:"font-mono text-label text-fg-4",children:["v",Ese]}),h.jsx(sI,{}),h.jsx("button",{type:"button",onClick:s,title:n?"Expand sidebar":"Collapse sidebar","aria-label":n?"Expand sidebar":"Collapse sidebar",className:"flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:n?h.jsx(W_,{className:"size-4"}):h.jsx(X_,{className:"size-4"})})]})]}),h.jsx("main",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl",children:e??h.jsx(BN,{})})]})}const iI=[{value:"default",displayName:"Default (recommended)",description:"The CLI's configured default model"},{value:"fable",displayName:"Fable",description:"Fable 5 · Most capable for your hardest and longest-running tasks"},{value:"opus",displayName:"Opus",description:"Opus 5 with 1M context · Best for everyday, complex tasks"},{value:"sonnet",displayName:"Sonnet",description:"Sonnet 5 · Efficient for routine tasks"},{value:"haiku",displayName:"Haiku",description:"Haiku 4.5 · Fastest for quick answers"}],V1={session:"workerdeck.default-session-model",job:"workerdeck.default-job-model"};function aI(e){return localStorage.getItem(V1[e])??""}function Cse(e,t){const n=t.trim();n?localStorage.setItem(V1[e],n):localStorage.removeItem(V1[e])}const oI={session:"workerdeck.default-session-permission-mode",job:"workerdeck.default-job-permission-mode"},wse={session:"default",job:"acceptEdits"};function lI(e){const t=localStorage.getItem(oI[e]);return Xl.some(r=>r.value===t)?t:wse[e]}function kse(e,t){localStorage.setItem(oI[e],t)}const uI="workerdeck.transcript-density";function cI(){return localStorage.getItem(uI)==="compact"?"compact":"comfortable"}function Nse(e){localStorage.setItem(uI,e)}const dI="workerdeck.transcript-variant";function fI(){return localStorage.getItem(dI)==="lines"?"lines":"cards"}function _se(e){localStorage.setItem(dI,e)}function hI({value:e,onChange:t,models:n=iI,className:r}){return h.jsx(GA,{variant:"form",models:n,model:e||void 0,onModelChange:s=>t(s??""),className:r})}function Ase({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),h.jsxs(Bs,{items:e.map(s=>({value:s.name,label:s.name})),value:t,onValueChange:s=>n(s),children:[h.jsx(Hs,{className:r,children:h.jsx(zs,{})}),h.jsx(Us,{children:e.map(s=>h.jsx(xs,{value:s.name,children:h.jsx(bs,{children:h.jsxs("span",{className:s.available===!1?"text-fg-4":void 0,title:s.unavailableReason,children:[s.description?`${s.name} — ${s.description}`:s.name,s.available===!1?" (unavailable)":""]})})},s.name))})]})]})}const Hn=new BF({baseUrl:`${location.origin}/v1`});function Rse(e,t,n){const r=e?.capabilities??ud[e?.engine??"claude"],s=r.permissionModes.includes(t)?t:r.defaultPermissionMode;let a,l;if(e?.models?.length)a=e.models,l=e.defaultModel;else if(e?.engine==="provider"){const f=e.provider;a=(f?.models?.length?f.models:f?.model?[f.model]:[]).map(m=>({value:m,displayName:m})),l=f?.model}else a=iI.filter(f=>f.value!=="default");const c=a.find(f=>f.value===n||f.resolvedModel===n),d=c||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...a],mode:s,model:d,reasoningEfforts:(c?c.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}const mI={profiles:[]};let q1,Db;const Y1=new Set;async function Yk(){const e=await Hn.listProfiles().catch(()=>mI);q1=e;for(const t of Y1)t(e);return e}function pI(){const[e,t]=y.useState(q1??mI);y.useEffect(()=>(Y1.add(t),q1||(Db??=Yk()),()=>{Y1.delete(t)}),[]);const n=y.useCallback(async()=>{Db=Yk(),await Db},[]);return{...e,refresh:n}}function Ose(){return pI().profiles}const Gk="workerdeck.last-profile";function Ise(){const e=Ose(),[t,n]=y.useState(()=>localStorage.getItem(Gk)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",s=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:s,select:l=>{n(l),localStorage.setItem(Gk,l)}}}const G1="workerdeck.last-cwd";function Mse(e){const[t,n]=y.useState([]);return y.useEffect(()=>{Hn.listHostRoots().then(r=>n(r.roots.map(s=>s.path))).catch(()=>n([]))},[]),y.useMemo(()=>{const r=localStorage.getItem(G1),s=[...r?[r]:[],...[...e].sort((a,l)=>(l.lastActivityAt??l.createdAt)-(a.lastActivityAt??a.createdAt)).map(a=>a.cwd),...t];return[...new Set(s)].slice(0,12)},[e,t])}function gI(e){const[t,n]=y.useState(()=>localStorage.getItem(G1)??""),[r,s]=y.useState(""),[a,l]=y.useState(()=>lI(e)),[c,d]=y.useState(()=>aI(e)),[f,p]=y.useState(""),{profiles:m,profile:b,selected:x,select:v}=Ise(),k=Rse(x,a,c);return{cwd:t,setCwd:n,prompt:r,setPrompt:s,mode:a,setMode:l,model:c,setModel:d,effort:f,setEffort:p,profiles:m,profile:b,selectProfile:v,engine:k,sessionFields:N=>({cwd:t.trim(),profile:b||void 0,prompt:N.prompt,permissionMode:k.mode,model:k.model.trim()||void 0,resume:N.resume,reasoningEffort:f&&k.reasoningEfforts.includes(f)?f:void 0,...k.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:N.allowBypass||void 0}:{}}),rememberCwd:N=>localStorage.setItem(G1,t.trim()||N)}}function bI({form:e,sessions:t,promptLabel:n,promptPlaceholder:r="e.g. /verify-content 42, or a task description",extras:s,actions:a,onProfileChange:l}){const c=Mse(t),d=y.useId(),{engine:f}=e;return h.jsxs(h.Fragment,{children:[h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),h.jsx(sn,{value:e.cwd,list:d,onChange:p=>e.setCwd(p.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"}),h.jsx("datalist",{id:d,children:c.map(p=>h.jsx("option",{value:p},p))})]}),h.jsxs("label",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:n}),h.jsx(n3,{value:e.prompt,onChange:p=>e.setPrompt(p.target.value),rows:2,placeholder:r})]}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(Ase,{profiles:e.profiles,value:e.profile,onChange:p=>{e.selectProfile(p),l?.(p)},className:"min-w-32"}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),h.jsx(qm,{variant:"form",mode:f.mode,onModeChange:e.setMode,modes:f.modes,className:"min-w-44"})]}),s,h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),h.jsx(hI,{value:f.model,onChange:e.setModel,models:f.models,className:"min-w-40"})]}),f.reasoningEfforts.length>0?h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),h.jsxs(Bs,{items:[{value:"default",label:"Default"},...f.reasoningEfforts.map(p=>({value:p,label:p}))],value:e.effort||"default",onValueChange:p=>e.setEffort(p==="default"?"":String(p)),children:[h.jsx(Hs,{className:"min-w-28",children:h.jsx(zs,{})}),h.jsx(Us,{children:["default",...f.reasoningEfforts].map(p=>h.jsx(xs,{value:p,children:h.jsx(bs,{children:p})},p))})]})]}):null,a]})]})}function Lse(e=15e3){const[t,n]=y.useState([]),[r,s]=y.useState(),[a,l]=y.useState(!0),[c,d]=y.useState(!1),[f,p]=y.useState(),m=y.useRef(void 0),b=y.useCallback(async()=>{try{const[v,k]=await Promise.all([Hn.listJobs(),Hn.queueStats()]);n(v),s(k),l(!0),p(void 0)}catch(v){const k=v instanceof Error?v.message:String(v);/not configured/i.test(k)?(l(!1),p(void 0)):p(k)}},[]);y.useEffect(()=>(b(),m.current=setInterval(()=>void b(),e),()=>clearInterval(m.current)),[b,e]);const x=a&&r!==void 0;return y.useEffect(()=>{if(!x)return;const v=Hn.attachQueue(),k=[v.on("attached",()=>void b()),v.on("stats",s),v.on("connectionChange",d),v.on("event",C=>{n(S=>S.some(_=>_.id===C.job.id)?S.map(_=>_.id===C.job.id?C.job:_):[...S,C.job])})];return()=>{for(const C of k)C();v.detach()}},[x,b]),{jobs:t,stats:r,enabled:a,live:c,error:f,refresh:b}}const Kk="workerdeck.watermarks.v1",lp="gateway",K1=new Set;let X1=0;const Dse={read:()=>{try{const e=localStorage.getItem(Kk);return e?JSON.parse(e):void 0}catch{return}},write:e=>{try{localStorage.setItem(Kk,JSON.stringify(e))}catch{}X1+=1;for(const t of K1)t()}},cm=new mF(Dse);function jse(e){return K1.add(e),()=>K1.delete(e)}function Pse(){return y.useSyncExternalStore(jse,()=>X1,()=>X1),{unseenFor:y.useCallback(t=>pF(cm.get(lp,t.id),{activityCount:t.activityCount,turns:t.numTurns}),[]),watermarks:cm}}function Bse(e){const t=cm.get(lp,e);return t?{itemCount:t.itemCount,since:t.seenAt}:void 0}function zse(e){const t=y.useRef({});return y.useCallback(n=>{!e||document.hidden||(t.current={...t.current,...n},cm.mark(lp,e,t.current))},[e])}const Hse=5e3,Use=1200;function xI(){const[e,t]=y.useState([]),[n,r]=y.useState(),[s,a]=y.useState(!1),l=y.useCallback(async()=>{try{t(await Hn.listSessions()),r(void 0)}catch(f){r(f instanceof Error?f.message:String(f))}finally{a(!0)}},[]),c=e.some(f=>{const p=PA(f);return p==="working"||p==="attention"}),d=y.useRef(l);return d.current=l,y.useEffect(()=>{d.current();const f=setInterval(()=>void d.current(),c?Use:Hse);return()=>clearInterval(f)},[c]),{sessions:e,error:n,loaded:s,refresh:l}}function Fse(e){const{unseenFor:t}=Pse();return y.useMemo(()=>e.map(n=>({hostId:lp,hostName:"Gateway",local:!0,adapter:n.engine??"claude",state:PA(n),info:n,unseen:t(n)})),[e,t])}const $se={queued:{label:"Queued",variant:"neutral"},running:{label:"Running",variant:"info",busy:!0},parked:{label:"Parked",variant:"accent"},succeeded:{label:"Succeeded",variant:"success"},failed:{label:"Failed",variant:"danger"},canceled:{label:"Canceled",variant:"warning"}};function Vse({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return h.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2",children:[h.jsxs("span",{children:["Running ",h.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),h.jsxs("span",{children:["Queued ",h.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?h.jsxs("span",{children:["Parked ",h.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?h.jsx(EA,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",h.jsxs("span",{className:"font-mono text-fg-1",children:[us(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${us(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?h.jsxs("span",{children:["Per-job cap ",h.jsx("span",{className:"font-mono text-fg-1",children:us(e.sessionTokenLimit)})]}):null,e.paused?h.jsx(pn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function qse({sessions:e,onScheduled:t}){const n=gI("job"),[r,s]=y.useState("auto"),[a,l]=y.useState(!1),[c,d]=y.useState(""),[f,p]=y.useState(""),[m,b]=y.useState(""),[x,v]=y.useState(!1),{engine:k}=n,C=async()=>{if(!n.cwd.trim()||!n.prompt.trim()){Ln.error("Working directory and prompt are required");return}const S=c.trim()?Number(c.trim()):void 0;if(S!==void 0&&(!Number.isFinite(S)||S<=0)){Ln.error("Max tokens must be a positive number");return}const N=f.trim()?Number(f.trim()):void 0;if(N!==void 0&&(!Number.isInteger(N)||N<1)){Ln.error("Attempts must be a whole number of at least 1");return}v(!0);try{n.rememberCwd(n.cwd.trim()),await Hn.createJob({session:{...n.sessionFields({allowBypass:a}),prompt:n.prompt.trim(),questionBehavior:k.capabilities.interactiveApprovals?r:void 0},maxTokens:S,attempts:N,webhook:m.trim()?{url:m.trim()}:void 0}),n.setPrompt(""),Ln.success("Job scheduled"),t()}catch(_){Ln.error(_ instanceof Error?_.message:"Failed to schedule job")}finally{v(!1)}};return h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Schedule a job"})}),h.jsxs(xi,{className:"flex flex-col gap-3",children:[h.jsx(bI,{form:n,sessions:e,promptLabel:"Prompt (the task — runs unattended)",extras:k.capabilities.interactiveApprovals?h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),h.jsxs(Bs,{items:Mk.map(S=>({value:S.value,label:S.label})),value:r,onValueChange:S=>s(S),children:[h.jsx(Hs,{className:"min-w-36",children:h.jsx(zs,{})}),h.jsx(Us,{children:Mk.map(S=>h.jsx(xs,{value:S.value,children:h.jsx(bs,{children:`${S.label} — ${S.description}`})},S.value))})]})]}):null,actions:h.jsxs(h.Fragment,{children:[h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),h.jsx(sn,{value:c,onChange:S=>d(S.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),h.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),h.jsx(sn,{value:f,onChange:S=>p(S.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),h.jsx(sn,{value:m,onChange:S=>b(S.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),h.jsxs(rt,{onClick:()=>void C(),disabled:x,children:[x?h.jsx(kn,{className:"size-3.5 text-current"}):h.jsx(Pm,{className:"size-4"}),"Schedule"]})]})}),k.capabilities.settingSources?h.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2",title:"Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.",children:[h.jsx("input",{type:"checkbox",checked:a,onChange:S=>l(S.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",h.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",h.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,h.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — watch the job's session to approve, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via"," ",h.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})]})}function Yse({job:e,watchable:t,onChanged:n}){const r=Jl(),s=$se[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=async()=>{try{await Hn.cancelJob(e.id),n()}catch(c){Ln.error(c instanceof Error?c.message:"Cancel failed")}};return h.jsxs("li",{className:"flex items-center gap-3 rounded-md px-2 py-2 hover:bg-surface-hover",children:[h.jsxs(pn,{variant:s.variant,dot:!s.busy,children:[s.busy?h.jsx(kn,{className:"size-3 text-current"}):null,s.label]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate text-body-sm text-fg-1",children:e.prompt}),h.jsxs("div",{className:"flex flex-wrap gap-x-3 font-mono text-label text-fg-4",children:[h.jsx("span",{className:"truncate",children:e.cwd}),e.profile?h.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,h.jsx("span",{className:"shrink-0",children:cd(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?h.jsxs("span",{className:"shrink-0",children:["attempt ",e.attempt??1,"/",e.maxAttempts,e.status==="queued"&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?" — retry pending":""]}):null,e.usage.tokens>0?h.jsxs("span",{className:"shrink-0",children:[us(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?h.jsx("span",{className:"shrink-0",children:bo(e.usage.totalCostUsd)}):null,e.error?h.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]}),e.sessionId&&t?h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>void r({to:"/sessions/$sessionId",params:{sessionId:e.sessionId}}),children:[h.jsx($_,{className:"size-3"}),"Watch"]}):null,a?h.jsxs(rt,{variant:"outline",size:"xs",onClick:()=>void l(),children:[h.jsx(js,{className:"size-3"}),"Cancel"]}):null]})}const Gse=["queued","running","parked"];function Kse(){const{jobs:e,stats:t,enabled:n,live:r,error:s,refresh:a}=Lse(),{sessions:l}=xI(),c=new Set(l.map(k=>k.id)),[d,f]=y.useState(""),[p,m]=y.useState([]),b=d.trim().toLowerCase(),x=[...e].sort((k,C)=>C.createdAt-k.createdAt).filter(k=>(p.length===0||p.includes(k.status))&&(!b||k.prompt.toLowerCase().includes(b)||k.cwd.toLowerCase().includes(b)||(k.profile?.toLowerCase().includes(b)??!1)||k.id.startsWith(b))),v=e.length-x.length;return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Jobs"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Scheduled one-shot runs with concurrency and token budgets."})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(pn,{variant:r?"success":"neutral",dot:!0,children:r?"Live":"Polling"}):null,h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:h.jsx(Bm,{className:"size-4"})})]})]}),s?h.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",s,". Start it with"," ",h.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,n?h.jsxs(h.Fragment,{children:[t?h.jsx(Vse,{stats:t}):null,e.length>0?h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(sn,{value:d,onChange:k=>f(k.target.value),placeholder:"Search jobs","aria-label":"Search jobs",className:"min-w-48 flex-1"}),h.jsx(rt,{variant:p.length?"default":"outline",size:"sm",onClick:()=>m(p.length?[]:Gse),children:p.length?"Showing active":"Active only"}),v>0?h.jsxs("span",{className:"text-label text-fg-4",children:[x.length," of ",e.length]}):null]}):null,e.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(G_,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"No jobs yet. Schedule one below."})]}):x.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx("p",{className:"text-body-sm text-fg-2",children:"No jobs match."}),h.jsx(rt,{variant:"ghost",size:"sm",onClick:()=>{f(""),m([])},children:"Clear filters"})]}):h.jsx("ul",{className:"flex flex-col gap-1 rounded-md border border-border bg-surface p-1",children:x.map(k=>h.jsx(Yse,{job:k,watchable:k.sessionId!==void 0&&c.has(k.sessionId),onChanged:()=>void a()},k.id))}),h.jsx(qse,{sessions:l,onScheduled:()=>void a()})]}):h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(e7,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"The server has no job queue configured."}),h.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",h.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",h.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})})}const Xse=["web_search","download","web_fetch","deliver_file"],fh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function ta({label:e,children:t}){return h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Wse({profile:e,onSaved:t}){const n=e.engine==="provider",[r,s]=y.useState(e.description??""),[a,l]=y.useState(e.defaults?.model??""),[c,d]=y.useState(e.defaults?.permissionMode),[f,p]=y.useState(e.provider?.model??""),[m,b]=y.useState((e.provider?.models??[]).join(", ")),[x,v]=y.useState(e.session?.capabilities),[k,C]=y.useState((e.session?.mcpServers??[]).join(", ")),[S,N]=y.useState(e.session?.instructions??""),[_,R]=y.useState(!1),I=async()=>{const A={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:c}};n&&(A.provider={...e.provider,id:e.provider?.id??"",model:f.trim()||void 0,models:fh(m).length>0?fh(m):void 0},A.session={capabilities:x,mcpServers:fh(k).length>0?fh(k):void 0,instructions:S.trim()||void 0}),R(!0);try{t(await Hn.updateProfile(e.name,A)),Ln.success("Profile saved")}catch(L){Ln.error(L instanceof Error?L.message:"Failed to save profile")}finally{R(!1)}};return h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Edit profile"})}),h.jsxs(xi,{className:"flex flex-col gap-3",children:[h.jsx(ta,{label:"Description",children:h.jsx(sn,{value:r,onChange:A=>s(A.target.value)})}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(ta,{label:"Default model",children:h.jsx(sn,{value:a,onChange:A=>l(A.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),h.jsx(ta,{label:"Default permission mode",children:h.jsx(qm,{variant:"form",mode:c,onModeChange:d,modes:(e.capabilities??ud[e.engine??"claude"]).permissionModes})})]}),n?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(ta,{label:"Default model id",children:h.jsx(sn,{value:f,onChange:A=>p(A.target.value),className:"font-mono"})}),h.jsx(ta,{label:"Models offered (comma-separated)",children:h.jsx(sn,{value:m,onChange:A=>b(A.target.value),className:"font-mono"})})]}),h.jsx(ta,{label:"Capabilities granted",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",checked:x===void 0,onChange:A=>v(A.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),Xse.map(A=>h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(A)??!1,onChange:L=>v(D=>L.target.checked?[...D??[],A]:(D??[]).filter(U=>U!==A)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),h.jsx("code",{className:"font-mono text-label",children:A})]},A))]})}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(ta,{label:"MCP servers (names, comma-separated)",children:h.jsx(sn,{value:k,onChange:A=>C(A.target.value),className:"font-mono"})}),h.jsx(ta,{label:"Instructions",children:h.jsx(sn,{value:S,onChange:A=>N(A.target.value)})})]})]}):null,h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("p",{className:"text-label text-fg-4",children:"Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean."}),h.jsxs(rt,{onClick:()=>void I(),disabled:_,children:[_?h.jsx(kn,{className:"size-3.5 text-current"}):h.jsx(SB,{className:"size-4"}),"Save"]})]})]})]})}const Qse=["web_search","download","web_fetch","deliver_file"],hh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function hs({label:e,children:t}){return h.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Zse({onCreated:e}){const[t,n]=y.useState("provider"),[r,s]=y.useState(""),[a,l]=y.useState(""),[c,d]=y.useState(""),[f,p]=y.useState(""),[m,b]=y.useState(""),[x,v]=y.useState(""),[k,C]=y.useState(""),[S,N]=y.useState([]),[_,R]=y.useState(""),[I,A]=y.useState(""),[L,D]=y.useState(!1),U=t==="provider",z=async()=>{if(!r.trim()){Ln.error("Name is required");return}const K={name:r.trim(),engine:t};if(a.trim()&&(K.description=a.trim()),U){K.provider={id:c.trim(),model:f.trim()||void 0,models:hh(m).length>0?hh(m):void 0,apiKeyEnv:x.trim()||void 0};const W={};S.length>0&&(W.capabilities=S),hh(_).length>0&&(W.mcpServers=hh(_)),I.trim()&&(W.instructions=I.trim()),Object.keys(W).length>0&&(K.session=W)}else K.configDir=k.trim();D(!0);try{await Hn.createProfile(K),await e(),s(""),l(""),A(""),Ln.success(`Profile '${K.name}' created`)}catch(W){Ln.error(W instanceof Error?W.message:"Failed to create profile")}finally{D(!1)}};return h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"New profile"})}),h.jsxs(xi,{className:"flex flex-col gap-3",children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Engine",children:h.jsxs(Bs,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:K=>n(K),children:[h.jsx(Hs,{className:"min-w-32",children:h.jsx(zs,{})}),h.jsxs(Us,{children:[h.jsx(xs,{value:"provider",children:h.jsx(bs,{children:"provider — model-agnostic engine"})}),h.jsx(xs,{value:"claude",children:h.jsx(bs,{children:"claude — Agent SDK + config dir"})})]})]})}),h.jsx(hs,{label:"Name",children:h.jsx(sn,{value:r,onChange:K=>s(K.target.value),placeholder:"kimi"})}),h.jsx(hs,{label:"Description (optional)",children:h.jsx(sn,{value:a,onChange:K=>l(K.target.value),placeholder:"what this profile is for"})})]}),U?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Provider id",children:h.jsx(sn,{value:c,onChange:K=>d(K.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),h.jsx(hs,{label:"Default model",children:h.jsx(sn,{value:f,onChange:K=>p(K.target.value),placeholder:"kimi-k3",className:"font-mono"})}),h.jsx(hs,{label:"Models offered (comma-separated)",children:h.jsx(sn,{value:m,onChange:K=>b(K.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),h.jsx(hs,{label:"API key variable",children:h.jsx(sn,{value:x,onChange:K=>v(K.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),h.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[h.jsx(hs,{label:"Capabilities granted",children:h.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:Qse.map(K=>h.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[h.jsx("input",{type:"checkbox",checked:S.includes(K),onChange:W=>N(J=>W.target.checked?[...J,K]:J.filter(te=>te!==K)),className:"size-3.5 accent-(--color-fg-1)"}),h.jsx("code",{className:"font-mono text-label",children:K})]},K))})}),h.jsx(hs,{label:"MCP servers (names, comma-separated)",children:h.jsx(sn,{value:_,onChange:K=>R(K.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),h.jsx(hs,{label:"Instructions (optional)",children:h.jsx(sn,{value:I,onChange:K=>A(K.target.value),placeholder:"prepended to the session's system prompt"})}),h.jsx("p",{className:"text-label text-fg-4",children:"Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server."})]}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{label:"Config directory",children:h.jsx(sn,{value:k,onChange:K=>C(K.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),h.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",h.jsx("code",{className:"font-mono",children:"allowedConfigDirRoots"})," — a config directory is a credential store, so the server bounds which ones a managed profile may point at."]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(rt,{onClick:()=>void z(),disabled:L,children:[L?h.jsx(kn,{className:"size-3.5 text-current"}):h.jsx(Pm,{className:"size-4"}),"Create profile"]})})]})]})}function yI(e){window.location.href=`vscode://file${e}`}function Jse(){const{profiles:e,canManage:t,refresh:n}=pI(),r=Jl(),s=a=>{Hn.deleteProfile(a).then(()=>n()).then(()=>Ln.success(`Profile '${a}' deleted`)).catch(l=>Ln.error(l instanceof Error?l.message:"Delete failed"))};return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Profiles"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"What a session runs as: a named Claude Code config directory — its own settings, memory, skills, and credentials — or a model provider for the model-agnostic engine."})]}),e.length===0?h.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-md border border-border bg-surface px-4 py-8 text-center",children:[h.jsx(_7,{className:"size-6 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-2",children:"The server declares no profiles."}),h.jsxs("p",{className:"text-label text-fg-4",children:["Pass ",h.jsxs("code",{className:"font-mono",children:["profiles: [","{ name, configDir, … }","]"]})," to"," ",h.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — without the option, a"," ",h.jsx("code",{className:"font-mono",children:"default"})," profile is auto-created from"," ",h.jsx("code",{className:"font-mono",children:"~/.claude"})," when it exists."]})]}):h.jsx("ul",{className:"divide-y divide-border rounded-md border border-border bg-surface",children:e.map(a=>h.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[h.jsx(YB,{className:"size-4 shrink-0 text-fg-3"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:a.name}),a.description?h.jsx("span",{className:"truncate text-body-sm text-fg-3",children:a.description}):null]}),h.jsx("div",{className:"mt-0.5 truncate font-mono text-label text-fg-4",children:a.configDir??(a.provider?`${a.provider.id}${a.provider.model?` · ${a.provider.model}`:""}`:"")})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx(pn,{variant:"neutral",children:a.engine??"claude"}),a.defaults?.model?h.jsx(pn,{variant:"neutral",children:a.defaults.model}):null,a.defaults?.permissionMode?h.jsx(pn,{variant:"neutral",children:a.defaults.permissionMode}):null,a.configDir?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":`Open ${a.name} in VSCode`,title:"Open config dir in VSCode",onClick:()=>yI(a.configDir),children:h.jsx(Zx,{className:"size-4"})}):null,h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":`View ${a.name}`,title:"View profile",onClick:()=>void r({to:"/profiles/$profileName",params:{profileName:a.name}}),children:h.jsx($_,{className:"size-4"})}),a.managed?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${a.name}`,title:"Delete profile",onClick:()=>s(a.name),children:h.jsx(ty,{className:"size-4"})}):null]})]},a.name))}),t?h.jsx(Zse,{onCreated:n}):null,h.jsxs("p",{className:"text-label text-fg-4",children:["Session and job creates run under the selected profile; when the server declares more than one, picking a profile is required."," ",t?"Profiles created here are stored by the server; the ones declared in its options are code and stay read-only.":"Profiles are declared in server configuration and read-only here."]})]})})}function In({label:e,children:t}){return h.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[h.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),h.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function na({items:e,empty:t}){return e.length===0?h.jsx("span",{className:"text-fg-4",children:t}):h.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>h.jsx(pn,{variant:"neutral",children:n},n))})}function eie(){const{profileName:e}=pm({from:"/profiles/$profileName"}),[t,n]=y.useState(),[r,s]=y.useState();y.useEffect(()=>{let c=!0;return Hn.getProfile(e).then(d=>{c&&n(d)}).catch(d=>{c&&s(d instanceof Error?d.message:"Failed to load profile")}),()=>{c=!1}},[e]);const a=t?.profile,l=t?.config;return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs(sd,{to:"/profiles",className:"mb-1 inline-flex items-center gap-1 text-label text-fg-3 hover:text-fg-1",children:[h.jsx(z_,{className:"size-3"}),"Profiles"]}),h.jsx("h1",{className:"truncate text-display-sm font-semibold tracking-tight text-text",children:e}),a?.description?h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:a.description}):null]}),a?.configDir?h.jsxs(rt,{variant:"outline",size:"xs",onClick:()=>yI(a.configDir),children:[h.jsx(Zx,{className:"size-3"}),"Open in VSCode"]}):null]}),r?h.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:r}):null,!t&&!r?h.jsx(kn,{className:"mx-auto size-5 text-fg-4"}):null,a&&l?h.jsxs(h.Fragment,{children:[h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Worker defaults"})}),h.jsxs(xi,{className:"flex flex-col divide-y divide-border",children:[h.jsx(In,{label:"Engine",children:h.jsx(pn,{variant:"neutral",children:a.engine??"claude"})}),a.engine==="provider"?h.jsx(In,{label:"Provider",children:h.jsx("span",{className:"font-mono text-label",children:a.provider?.id})}):h.jsx(In,{label:"Config directory",children:h.jsx("span",{className:"font-mono text-label",children:a.configDir})}),h.jsx(In,{label:"Default model",children:a.defaults?.model??a.provider?.model??h.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),h.jsx(In,{label:"Default permission mode",children:a.defaults?.permissionMode??h.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),a.engine==="provider"?h.jsxs(h.Fragment,{children:[h.jsx(In,{label:"Models offered",children:h.jsx(na,{items:a.provider?.models??[],empty:"the default model only"})}),h.jsx(In,{label:"API key variable",children:a.provider?.apiKeyEnv?h.jsx("span",{className:"font-mono text-label",children:a.provider.apiKeyEnv}):h.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),a.engine==="provider"?h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Session grants"})}),h.jsxs(xi,{className:"flex flex-col divide-y divide-border",children:[h.jsx(In,{label:"Capabilities",children:h.jsx(na,{items:a.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),h.jsx(In,{label:"MCP servers",children:h.jsx(na,{items:a.session?.mcpServers??[],empty:"not declared — every connected server"})}),h.jsx(In,{label:"Instructions",children:a.session?.instructions?`${a.session.instructions.length} characters`:h.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,a.engine==="provider"?null:h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Claude Code configuration"})}),h.jsxs(xi,{className:"flex flex-col divide-y divide-border",children:[l.settings?h.jsxs(h.Fragment,{children:[h.jsx(In,{label:"Model (settings.json)",children:l.settings.model??h.jsx("span",{className:"text-fg-4",children:"not set"})}),h.jsx(In,{label:"Default permission mode",children:l.settings.defaultPermissionMode??h.jsx("span",{className:"text-fg-4",children:"not set"})}),h.jsx(In,{label:"Permission rules",children:h.jsx("span",{className:"font-mono text-label",children:l.settings.permissionRules?`${l.settings.permissionRules.allow} allow · ${l.settings.permissionRules.ask} ask · ${l.settings.permissionRules.deny} deny`:"—"})}),h.jsx(In,{label:"Env vars (names only)",children:h.jsx(na,{items:l.settings.envKeys??[],empty:"none"})}),h.jsx(In,{label:"Hooks",children:h.jsx(na,{items:l.settings.hooks??[],empty:"none"})})]}):h.jsx(In,{label:"settings.json",children:h.jsx("span",{className:"text-fg-4",children:"not found"})}),h.jsx(In,{label:"User memory (CLAUDE.md)",children:l.hasUserMemory?"present":h.jsx("span",{className:"text-fg-4",children:"none"})}),h.jsx(In,{label:"Skills",children:h.jsx(na,{items:l.skills,empty:"none"})}),h.jsx(In,{label:"Agents",children:h.jsx(na,{items:l.agents,empty:"none"})}),h.jsx(In,{label:"Commands",children:h.jsx(na,{items:l.commands,empty:"none"})})]})]}),a.managed?h.jsx(Wse,{profile:a,onSaved:c=>n({...t,profile:c})}):null,h.jsxs("p",{className:"text-label text-fg-4",children:[a.managed?"Stored on the server and editable here. ":"View only — this profile is declared in the server options. ","Other profile configuration lives on the server (the"," ",h.jsx("code",{className:"font-mono",children:"profiles"})," option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it."]})]}):null]})})}function tie({files:e,activePath:t,onActivate:n,onClose:r,className:s}){return h.jsx(uH,{delay:500,closeDelay:0,children:h.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:Se("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",s),children:e.map(a=>h.jsx(nie,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const c=e.findIndex(f=>f.path===a.path),d=e[c+l];d&&n(d.path)}},a.path))})})}function nie({file:e,active:t,onActivate:n,onClose:r,onArrow:s}){const a=Zc(e),l=y.useRef(null);y.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const c=d=>{d.button===1&&(d.preventDefault(),r())};return h.jsxs(iy,{side:"bottom",render:h.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:c,onKeyDown:d=>{if(d.key==="ArrowRight")s(1);else if(d.key==="ArrowLeft")s(-1);else if(d.key==="Enter"||d.key===" ")n();else return;d.preventDefault()},className:Se("group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset",t?"bg-bg text-fg-1":"text-fg-3 hover:bg-surface-hover hover:text-fg-2")}),content:h.jsxs("span",{className:"flex flex-col gap-0.5",children:[h.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?h.jsx("span",{className:"text-fg-4",children:xo(e.bytes)}):null]}),children:[h.jsx("span",{className:Se("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?h.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,h.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:Se("shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1",t||a?"opacity-70":"opacity-0 group-hover:opacity-70 focus-visible:opacity-100"),children:[h.jsx("span",{className:Se("block",a&&"group-hover:hidden"),children:a?h.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):h.jsx(js,{className:"size-3"})}),a?h.jsx("span",{className:"hidden group-hover:block",children:h.jsx(js,{className:"size-3"})}):null]})]})}const EI=12;function rie({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:s,style:a,className:l}){const[c,d]=y.useState(""),[f,p]=y.useState(),m=c.trim().length>0;return y.useEffect(()=>{if(!t?.available)return;const b=c.trim();if(!b){p(void 0);return}const x=new AbortController,v=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(k=>{x.signal.aborted||p(k)})},150);return()=>{x.abort(),clearTimeout(v)}},[t,c]),h.jsxs("div",{"data-slot":"file-tree",style:a,className:Se("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?h.jsxs("div",{className:"relative min-w-0 flex-1",children:[h.jsx(zm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),h.jsx(sn,{value:c,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),m?h.jsx("button",{type:"button",onClick:()=>d(""),"aria-label":"Clear search",className:"absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2",children:h.jsx(js,{className:"size-3.5"})}):null]}):h.jsx("span",{className:"min-w-0 flex-1 truncate px-1 font-mono text-label text-fg-4",children:e.root}),h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:h.jsx(Bm,{className:"size-3.5 text-fg-3"})}),s?h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:s,children:h.jsx(X_,{className:"size-3.5 text-fg-3"})}):null]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?h.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):m?f===void 0?h.jsx("div",{className:"py-6 text-center",children:h.jsx(kn,{className:"size-4 text-fg-4"})}):f.length===0?h.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):h.jsx("ul",{children:f.map(b=>h.jsx("li",{children:h.jsx(Xk,{label:sie(b.relative),detail:iie(b.relative),title:b.relative,icon:h.jsx(jm,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?h.jsx("div",{className:"py-6 text-center",children:h.jsx(kn,{className:"size-4 text-fg-4"})}):e.rows.length===0?h.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):h.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>h.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[h.jsx(Xk,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?h.jsx(kn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?h.jsx(R7,{className:"size-3.5 shrink-0 text-accent"}):h.jsx(V_,{className:"size-3.5 shrink-0 text-accent"}):h.jsx(aie,{type:b.entry.type}),chevron:b.entry.type==="dir"?h.jsx(Dm,{className:Se("size-3 shrink-0 text-fg-4 transition-transform",b.expanded&&"rotate-90")}):void 0,onClick:()=>b.entry.type==="dir"?e.toggle(b.entry.path):r(b.entry.path)}),b.truncated?h.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*EI+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function Xk({label:e,detail:t,title:n,icon:r,chevron:s,indent:a=0,active:l,onClick:c}){const d=y.useRef(null);return y.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),h.jsxs("button",{ref:d,type:"button",onClick:c,title:n??e,style:{paddingLeft:a*EI+4},className:Se("flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors",l?"bg-surface-hover text-fg-1":"text-fg-2 hover:bg-surface-hover"),children:[h.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:s}),r,h.jsx("span",{className:"shrink-0 truncate font-mono text-label",children:e}),t?h.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:t}):null]})}function sie(e){return e.slice(e.lastIndexOf("/")+1)}function iie(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function aie({type:e}){return e==="symlink"?h.jsx(Y_,{className:"size-3.5 shrink-0 text-fg-4"}):h.jsx(jm,{className:"size-3.5 shrink-0 text-fg-4"})}function oie({path:e,value:t,onChange:n,onSave:r,readOnly:s,className:a}){const l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),[f,p]=y.useState(!1),m=lie(),b=y.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},y.useEffect(()=>{let x=!1;return uie().then(v=>{if(x||!l.current)return;d.current=v;const k=v.editor.create(l.current,{value:t,language:Zk(e),readOnly:s,automaticLayout:!0,theme:Wk(document.documentElement.getAttribute("data-theme")),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',renderLineHighlight:"line",smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:"off",quickSuggestions:!1});c.current=k,k.onDidChangeModelContent(()=>{b.current.onChange?.(k.getValue())}),k.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KeyS,()=>{b.current.onSave?.()}),p(!0)}),()=>{x=!0,c.current?.dispose(),c.current=null,p(!1)}},[]),y.useEffect(()=>{const x=d.current,v=c.current;if(!x||!v||!f)return;const k=x.Uri.parse(`workerdeck://host${e}`),C=x.editor.getModel(k)??x.editor.createModel(t,Zk(e),k);v.getModel()!==C&&v.setModel(C)},[e,f,t]),y.useEffect(()=>{const x=c.current;if(!x||!f)return;const v=x.getModel();!v||v.getValue()===t||v.pushEditOperations([],[{range:v.getFullModelRange(),text:t}],()=>null)},[t,f]),y.useEffect(()=>{f&&c.current?.updateOptions({readOnly:s})},[s,f]),y.useEffect(()=>{f&&d.current?.editor.setTheme(Wk(m))},[m,f]),h.jsxs("div",{className:Se("relative min-h-0 min-w-0 flex-1",a),children:[h.jsx("div",{ref:l,className:"absolute inset-0"}),f?null:h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:h.jsx(kn,{className:"size-4 text-fg-4"})})]})}function lie(){const[e,t]=y.useState(()=>typeof document>"u"?null:document.documentElement.getAttribute("data-theme"));return y.useEffect(()=>{const n=document.documentElement,r=()=>t(n.getAttribute("data-theme"));r();const s=new MutationObserver(r);return s.observe(n,{attributes:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[]),e}function Wk(e){return e==="light"?"wd-light":"wd-dark"}let Qk;function uie(){return Qk??=(async()=>{const e=await Kl(()=>import("./index-DHZZDn-j.js"),__vite__mapDeps([0,1]));return e.editor.defineTheme("wd-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e.editor.defineTheme("wd-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e})(),Qk}function Zk(e){const t=e.slice(e.lastIndexOf("/")+1),n=cie[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return die[r]??"plaintext"}const cie={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},die={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",yml:"yaml",yaml:"yaml",toml:"plaintext",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",py:"python",rb:"ruby",rs:"rust",go:"go",swift:"swift",java:"java",kt:"kotlin",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",r:"r",pl:"perl",dart:"dart",scala:"scala",ini:"ini",cfg:"ini",conf:"ini",txt:"plaintext",log:"plaintext"};function fie({file:e,canWrite:t,onChange:n,onSave:r,onRevert:s,onReload:a,onOverwrite:l,onDismissConflict:c,className:d}){return e?h.jsxs("div",{"data-slot":"file-viewer",className:Se("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?h.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2",children:[h.jsx(Bl,{className:"size-3.5 shrink-0 text-warning"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),h.jsx(rt,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),h.jsx(rt,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),h.jsx(rt,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):e.saveError?h.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[h.jsx(Bl,{className:"size-3.5 shrink-0 text-danger"}),h.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),h.jsx(rt,{variant:"ghost",size:"xs",onClick:()=>c?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?h.jsx(jb,{children:h.jsx(kn,{className:"size-4 text-fg-4"})}):e.status==="error"?h.jsxs(jb,{children:[h.jsx(Bl,{className:"size-4 text-danger"}),h.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?h.jsxs(jb,{children:[h.jsx(C7,{className:"size-4 text-fg-4"}),h.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),h.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):h.jsx(oie,{path:e.path,value:h1(e),readOnly:!t,onChange:n?f=>n(e.path,f):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||Zc(e)||!t)?h.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?h.jsxs(h.Fragment,{children:[h.jsx(kn,{className:"size-3 text-fg-4"}),h.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),h.jsx("span",{className:"flex-1"}),h.jsx(rt,{variant:"ghost",size:"xs",onClick:()=>s?.(e.path),children:"Revert"}),h.jsxs(rt,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",h.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):h.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function jb({children:e}){return h.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const hie=180,mie=520,pie=220,Jk=120;function gie({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:s,unseen:a,onVitals:l,defaultRailWidth:c=260,defaultRailCollapsed:d,onRailChange:f,className:p}){const{info:m}=FA(e,t),b=m?.cwd,x=FF(e,b),v=UA(e,b),k=VF(e),{canWrite:C}=UF(e);y.useEffect(()=>{if(!k.hasUnsaved)return;const ae=M=>M.preventDefault();return window.addEventListener("beforeunload",ae),()=>window.removeEventListener("beforeunload",ae)},[k.hasUnsaved]);const S=xie(),[N,_]=y.useState(d??!1),[R,I]=y.useState(c),A=y.useRef(f);A.current=f,y.useEffect(()=>{A.current?.({width:R,collapsed:N})},[R,N]);const[L,D]=y.useState(360),U=k.files.length>0,z=!S,K=x.available&&!N;y.useEffect(()=>{z&&_(!0)},[z]);const W=y.useCallback(ae=>{const M=k.files.find(P=>P.path===ae);if(M&&Zc(M)){const P=M.name;if(!window.confirm(`${P} has unsaved changes. Close it and lose them?`))return}k.close(ae)},[k]),J=y.useRef(null),te=bie(J),V=Math.max(Jk,te-pie),[B,G]=y.useState(null),X=n===void 0||B===null?void 0:typeof n=="function"?ae=>lr.createPortal(n(ae),B):lr.createPortal(n,B);return h.jsxs("div",{"data-slot":"session-workspace",className:Se("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",p),children:[n!==void 0?h.jsx("div",{ref:G,className:"shrink-0"}):null,h.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[K?h.jsx(rie,{tree:x,search:v,activePath:k.activePath,onOpenFile:k.open,onCollapse:()=>_(!0),style:{width:z?Math.min(R,320):R},className:Se("shrink-0 border-r border-border",z&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):x.available?h.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>_(!1),children:h.jsx(W_,{className:"size-4 text-fg-3"})})}):null,K&&!z?h.jsx(SC,{orientation:"vertical",value:R,onValueChange:I,min:hie,max:mie,"aria-label":"Resize the file tree"}):null,h.jsxs("div",{ref:J,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[U?h.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(L,V||L)},children:[h.jsx(tie,{files:k.files,activePath:k.activePath,onActivate:k.activate,onClose:W}),h.jsx(fie,{file:k.active,canWrite:C,onChange:k.edit,onSave:ae=>void k.save(ae),onRevert:k.revert,onReload:k.reload,onOverwrite:ae=>void k.overwrite(ae),onDismissConflict:k.dismissConflict})]}):null,U?h.jsx(SC,{orientation:"horizontal",value:Math.min(L,V||L),onValueChange:D,min:Jk,max:V,"aria-label":"Resize the open file"}):null,h.jsx(hse,{client:e,sessionId:t,header:X,transcriptVariant:r,transcriptDensity:s,unseen:a,onVitals:l,className:"min-h-0 flex-1"})]}),z&&K?h.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>_(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function bie(e){const[t,n]=y.useState(0);return y.useLayoutEffect(()=>{const r=e.current;if(!r)return;const s=new ResizeObserver(([a])=>{a&&n(a.contentRect.height)});return s.observe(r),()=>s.disconnect()},[e]),t}function xie(){const[e,t]=y.useState(!0);return y.useEffect(()=>{const n=window.matchMedia("(min-width: 768px)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const vI="workerdeck.rail",eN={width:260,collapsed:!1};function yie(){try{const e=localStorage.getItem(vI),t=e?JSON.parse(e):{};return{width:Math.min(520,Math.max(180,Number(t.width)||eN.width)),collapsed:t.collapsed===!0}}catch{return eN}}function Eie(e){try{localStorage.setItem(vI,JSON.stringify(e))}catch{}}function vie(){const{sessionId:e}=pm({from:"/sessions/$sessionId"}),t=Jl(),{info:n,error:r}=FA(Hn,e),s=zse(e),[a]=y.useState(()=>Bse(e)),[l]=y.useState(cI),[c]=y.useState(fI),[d]=y.useState(yie);y.useEffect(()=>{r&&(Ln.error("Session not found"),t({to:"/sessions"}))},[r,t]);const f=async()=>{try{await Hn.deleteSession(e)}catch{}t({to:"/sessions"})},p=n?.cwd?.split("/").filter(Boolean).pop();return h.jsx(gie,{client:Hn,sessionId:e,transcriptVariant:c,transcriptDensity:l,defaultRailWidth:d.width,defaultRailCollapsed:d.collapsed,onRailChange:Eie,unseen:a,onVitals:m=>s({itemCount:m.itemCount,activity:n?.activityCount,turns:n?.numTurns}),header:({actions:m})=>h.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[h.jsx(sd,{to:"/sessions","aria-label":"Back to sessions",children:h.jsx(rt,{variant:"ghost",size:"icon-sm",children:h.jsx(z_,{className:"size-4"})})}),h.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:n?.title??p??e.slice(0,8)}),n?.engine&&n.engine!=="claude"?h.jsx(pn,{variant:"neutral",className:"shrink-0",children:n.engine}):null,n?.cwd?h.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:n.cwd,children:n.cwd}):null,h.jsx("span",{className:"flex-1"}),h.jsx(Yh,{value:e,"aria-label":"Copy session id"}),h.jsxs(hz,{children:[h.jsx(mz,{render:h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:h.jsx(ty,{className:"size-4 text-fg-3"})})}),h.jsxs(gz,{children:[h.jsx(bz,{children:"Close this session?"}),h.jsx(xz,{children:"The run is terminated on the server. You can pick it up later from “Resume a previous session” — the transcript is kept by the engine, not by the gateway."}),h.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[h.jsx(pz,{render:h.jsx(rt,{variant:"outline",children:"Cancel"})}),h.jsx(rt,{variant:"destructive",onClick:()=>void f(),children:"Close session"})]})]})]}),m]})},e)}const tN="workerdeck.view-config";function Tie(){const[e,t]=y.useState(()=>{try{const r=localStorage.getItem(tN),s=r?JSON.parse(r):{};return{...d1,...s,search:"",scoped:!1}}catch{return{...d1,scoped:!1}}}),n=y.useCallback(r=>{t(r);try{localStorage.setItem(tN,JSON.stringify(r))}catch{}},[]);return[e,n]}function Sie({sessions:e,onCreated:t}){const n=gI("session"),[r,s]=y.useState(!1),[a,l]=y.useState(),[c,d]=y.useState(!1),{engine:f}=n,p=async b=>{const x=b?.cwd??n.cwd.trim();if(!x){Ln.error("Working directory is required");return}s(!0);try{n.rememberCwd(x);const v=await Hn.createSession({...n.sessionFields({prompt:b?void 0:n.prompt.trim()||void 0,resume:b?.sessionId,allowBypass:!0}),cwd:x});t(v.id)}catch(v){Ln.error(v instanceof Error?v.message:"Failed to create session")}finally{s(!1)}},m=async()=>{if(!n.cwd.trim()){Ln.error("Set a working directory first — resumable sessions are listed per project");return}d(!0);try{l(await Hn.listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(b){Ln.error(b instanceof Error?b.message:"Failed to list resumable sessions")}finally{d(!1)}};return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(bI,{form:n,sessions:e,promptLabel:"Initial prompt (optional)",onProfileChange:()=>l(void 0),actions:h.jsxs(rt,{className:"ml-auto",onClick:()=>void p(),disabled:r,children:[r?h.jsx(kn,{className:"size-3.5 text-current"}):h.jsx(Pm,{className:"size-4"}),"Create"]})}),f.capabilities.listSessions?h.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),h.jsxs(rt,{variant:"ghost",size:"xs",onClick:()=>void m(),disabled:c,children:[c?h.jsx(kn,{className:"size-3 text-current"}):h.jsx(U7,{className:"size-3"}),a?"Reload":"Browse"]})]}),a!==void 0?a.length===0?h.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):h.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:a.map(b=>h.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("div",{className:"truncate text-body-sm text-fg-1",children:b.customTitle??b.summary}),h.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[b.gitBranch?h.jsx("span",{className:"truncate",children:b.gitBranch}):null,h.jsx("span",{className:"shrink-0",children:cd(b.lastModified)})]})]}),h.jsx(rt,{variant:"outline",size:"xs",onClick:()=>void p(b),disabled:r,children:"Resume"})]},b.sessionId))}):null]}):null]})}function Cie(){const e=Jl(),{sessions:t,error:n,refresh:r}=xI(),s=Fse(t),[a,l]=Tie(),[c,d]=y.useState(!1),f=m=>void e({to:"/sessions/$sessionId",params:{sessionId:m}}),p=(m,b)=>{Hn.updateSession(m.info.id,{title:b||null}).then(()=>r()).catch(x=>Ln.error(x instanceof Error?x.message:"Rename failed"))};return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:[h.jsxs("header",{className:"flex items-end justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Sessions"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Live Agent SDK sessions on this worker."})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(rt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:h.jsx(Bm,{className:"size-4"})}),h.jsxs(rt,{onClick:()=>d(!0),children:[h.jsx(Pm,{className:"size-4"}),"New session"]})]})]}),n?h.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can’t reach the worker server: ",n,". Start it with"," ",h.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,h.jsx(gse,{rows:s,config:a,onConfigChange:l,onSelect:m=>f(m.info.id),onRename:p,onDelete:m=>{Hn.deleteSession(m.info.id).then(()=>r()).catch(b=>Ln.error(b instanceof Error?b.message:"Delete failed"))},emptyState:h.jsxs("div",{className:"px-2.5 py-8 text-center text-body-sm text-fg-4",children:["No live sessions yet. Start one with ",h.jsx("strong",{className:"text-fg-2",children:"New session"}),"."]})}),h.jsx(Ao,{open:c,onOpenChange:d,children:h.jsxs(Ro,{size:"lg",children:[h.jsx(Oo,{title:"New session",description:"Pick a directory and an engine."}),h.jsx(Io,{children:h.jsx(Sie,{sessions:t,onCreated:m=>{d(!1),f(m)}})})]})})]})})}function nN({kind:e,label:t}){const[n,r]=y.useState(()=>aI(e)),[s,a]=y.useState(()=>lI(e));return h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:t}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(qm,{variant:"form",mode:s,onModeChange:l=>{a(l),kse(e,l)},className:"min-w-40"}),h.jsx(hI,{value:n,onChange:l=>{r(l),Cse(e,l)},className:"min-w-44"})]})]})}function wie(){const[e,t]=y.useState(cI),n=[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}];return h.jsxs(Bs,{value:e,onValueChange:r=>{const s=r;t(s),Nse(s)},children:[h.jsx(Hs,{"aria-label":"Transcript density",className:"min-w-40",children:h.jsx(zs,{children:n.find(r=>r.value===e)?.label})}),h.jsx(Us,{children:n.map(r=>h.jsx(xs,{value:r.value,children:h.jsx(bs,{children:r.label})},r.value))})]})}function kie(){const[e,t]=y.useState(fI),n=[{value:"cards",label:"Cards"},{value:"lines",label:"Lines"}];return h.jsxs(Bs,{value:e,onValueChange:r=>{const s=r;t(s),_se(s)},children:[h.jsx(Hs,{"aria-label":"Transcript style",className:"min-w-40",children:h.jsx(zs,{children:n.find(r=>r.value===e)?.label})}),h.jsx(Us,{children:n.map(r=>h.jsx(xs,{value:r.value,children:h.jsx(bs,{children:r.label})},r.value))})]})}function Nie(){return h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-4 px-6 py-6",children:[h.jsxs("header",{children:[h.jsx("h1",{className:"text-display-sm font-semibold tracking-tight text-text",children:"Settings"}),h.jsx("p",{className:"mt-0.5 text-body-sm text-muted-foreground",children:"Client-side preferences. Server policy (auth, cwd roots, API-key requirements) is configured where the worker runs."})]}),h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Appearance"})}),h.jsxs(xi,{className:"flex flex-col gap-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),h.jsx(sI,{})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:"Transcript style"}),h.jsx(kie,{})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-body-sm text-fg-2",children:"Transcript density"}),h.jsx(wie,{})]}),h.jsx("p",{className:"text-label text-fg-4",children:"Cards is the chat shape; Lines is the terminal one — full-width rows behind a gutter glyph, no boxes. Comfortable leaves a blank line between messages, the way the CLI does; Compact fits more of a long session on screen. Both take effect on the next session you open."})]})]}),h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Defaults"})}),h.jsxs(xi,{className:"flex flex-col gap-3",children:[h.jsx(nN,{kind:"session",label:"New session"}),h.jsx(nN,{kind:"job",label:"Queue job"}),h.jsx("p",{className:"text-label text-fg-4",children:'Pre-fills the permission mode and model on the new-session and schedule-job forms (still editable per run). "Default (recommended)" leaves the model to the CLI. This list is the Claude aliases, so a profile running another engine will fall back to its own default rather than the choice made here.'})]})]}),h.jsxs(pi,{children:[h.jsx(gi,{children:h.jsx(bi,{children:"Worker server"})}),h.jsxs(xi,{className:"flex flex-col gap-1 text-body-sm text-fg-2",children:[h.jsxs("div",{children:["Endpoint: ",h.jsxs("code",{className:"font-mono text-code",children:[location.origin,"/v1"]})," (dev proxy → ",h.jsx("code",{className:"font-mono text-code",children:"WORKER_URL"}),", default"," ",h.jsx("code",{className:"font-mono text-code",children:"http://127.0.0.1:8787"}),")"]}),h.jsx("div",{className:"text-label text-fg-4",children:"Anthropic credentials are resolved by the SDK from the server operator’s environment — this app never handles them."})]})]})]})})}const wa=yL({component:Sse}),_ie=So({getParentRoute:()=>wa,path:"/",beforeLoad:()=>{throw gN({to:"/sessions"})}}),Aie=So({getParentRoute:()=>wa,path:"/sessions",component:Cie}),Rie=So({getParentRoute:()=>wa,path:"/sessions/$sessionId",component:vie}),Oie=So({getParentRoute:()=>wa,path:"/jobs",component:Kse}),Iie=So({getParentRoute:()=>wa,path:"/profiles",component:Jse}),Mie=So({getParentRoute:()=>wa,path:"/profiles/$profileName",component:eie}),Lie=So({getParentRoute:()=>wa,path:"/settings",component:Nie}),Die=IL({routeTree:wa.addChildren([_ie,Aie,Rie,Oie,Iie,Mie,Lie]),history:P5()});function jie(){return h.jsxs(h.Fragment,{children:[h.jsx(DL,{router:Die}),h.jsx(BH,{})]})}iN();const TI=document.getElementById("root");if(!TI)throw new Error("Root element #root not found");$M.createRoot(TI).render(h.jsx(y.StrictMode,{children:h.jsx(jie,{})}));const Pie=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:YO},Symbol.toStringTag,{value:"Module"}));export{Ste as A,Hie as L,Yr as R,Kl as _,h as j,y as r};