@workerdeck/web 0.15.0 → 0.16.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.
@@ -1,708 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BlST7WCb.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
- function qM(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 Ap(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dg={exports:{}},uc={};/**
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 IS;function YM(){if(IS)return uc;IS=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 u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return uc.Fragment=t,uc.jsx=n,uc.jsxs=n,uc}var OS;function GM(){return OS||(OS=1,Dg.exports=YM()),Dg.exports}var f=GM(),jg={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 MS;function KM(){if(MS)return gt;MS=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"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=b&&B[b]||B["@@iterator"],typeof B=="function"?B:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,w={};function S(B,$,L){this.props=B,this.context=$,this.refs=w,this.updater=L||E}S.prototype.isReactComponent={},S.prototype.setState=function(B,$){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,$,"setState")},S.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=S.prototype;function N(B,$,L){this.props=B,this.context=$,this.refs=w,this.updater=L||E}var _=N.prototype=new k;_.constructor=N,A(_,S.prototype),_.isPureReactComponent=!0;var M=Array.isArray;function R(){}var j={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function H(B,$,L){var te=L.ref;return{$$typeof:e,type:B,key:$,ref:te!==void 0?te:null,props:L}}function P(B,$){return H(B.type,$,B.props)}function Y(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function X(B){var $={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(L){return $[L]})}var Z=/\/+/g;function ee(B,$){return typeof B=="object"&&B!==null&&B.key!=null?X(""+B.key):$.toString(36)}function V(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(R,R):(B.status="pending",B.then(function($){B.status==="pending"&&(B.status="fulfilled",B.value=$)},function($){B.status==="pending"&&(B.status="rejected",B.reason=$)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function z(B,$,L,te,ne){var ce=typeof B;(ce==="undefined"||ce==="boolean")&&(B=null);var fe=!1;if(B===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(B.$$typeof){case e:case t:fe=!0;break;case m:return fe=B._init,z(fe(B._payload),$,L,te,ne)}}if(fe)return ne=ne(B),fe=te===""?"."+ee(B,0):te,M(ne)?(L="",fe!=null&&(L=fe.replace(Z,"$&/")+"/"),z(ne,$,L,"",function(Fe){return Fe})):ne!=null&&(Y(ne)&&(ne=P(ne,L+(ne.key==null||B&&B.key===ne.key?"":(""+ne.key).replace(Z,"$&/")+"/")+fe)),$.push(ne)),1;fe=0;var de=te===""?".":te+":";if(M(B))for(var xe=0;xe<B.length;xe++)te=B[xe],ce=de+ee(te,xe),fe+=z(te,$,L,ce,ne);else if(xe=x(B),typeof xe=="function")for(B=xe.call(B),xe=0;!(te=B.next()).done;)te=te.value,ce=de+ee(te,xe++),fe+=z(te,$,L,ce,ne);else if(ce==="object"){if(typeof B.then=="function")return z(V(B),$,L,te,ne);throw $=String(B),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return fe}function G(B,$,L){if(B==null)return B;var te=[],ne=0;return z(B,te,"","",function(ce){return $.call(L,ce,ne++)}),te}function Q(B){if(B._status===-1){var $=B._result;$=$(),$.then(function(L){(B._status===0||B._status===-1)&&(B._status=1,B._result=L)},function(L){(B._status===0||B._status===-1)&&(B._status=2,B._result=L)}),B._status===-1&&(B._status=0,B._result=$)}if(B._status===1)return B._result.default;throw B._result}var se=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},D={map:G,forEach:function(B,$,L){G(B,function(){$.apply(this,arguments)},L)},count:function(B){var $=0;return G(B,function(){$++}),$},toArray:function(B){return G(B,function($){return $})||[]},only:function(B){if(!Y(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return gt.Activity=p,gt.Children=D,gt.Component=S,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=N,gt.StrictMode=r,gt.Suspense=d,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,gt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return j.H.useMemoCache(B)}},gt.cache=function(B){return function(){return B.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(B,$,L){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var te=A({},B.props),ne=B.key;if($!=null)for(ce in $.key!==void 0&&(ne=""+$.key),$)!O.call($,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&$.ref===void 0||(te[ce]=$[ce]);var ce=arguments.length-2;if(ce===1)te.children=L;else if(1<ce){for(var fe=Array(ce),de=0;de<ce;de++)fe[de]=arguments[de+2];te.children=fe}return H(B.type,ne,te)},gt.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:a,_context:B},B},gt.createElement=function(B,$,L){var te,ne={},ce=null;if($!=null)for(te in $.key!==void 0&&(ce=""+$.key),$)O.call($,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ne[te]=$[te]);var fe=arguments.length-2;if(fe===1)ne.children=L;else if(1<fe){for(var de=Array(fe),xe=0;xe<fe;xe++)de[xe]=arguments[xe+2];ne.children=de}if(B&&B.defaultProps)for(te in fe=B.defaultProps,fe)ne[te]===void 0&&(ne[te]=fe[te]);return H(B,ce,ne)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(B){return{$$typeof:u,render:B}},gt.isValidElement=Y,gt.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:Q}},gt.memo=function(B,$){return{$$typeof:h,type:B,compare:$===void 0?null:$}},gt.startTransition=function(B){var $=j.T,L={};j.T=L;try{var te=B(),ne=j.S;ne!==null&&ne(L,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(R,se)}catch(ce){se(ce)}finally{$!==null&&L.types!==null&&($.types=L.types),j.T=$}},gt.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},gt.use=function(B){return j.H.use(B)},gt.useActionState=function(B,$,L){return j.H.useActionState(B,$,L)},gt.useCallback=function(B,$){return j.H.useCallback(B,$)},gt.useContext=function(B){return j.H.useContext(B)},gt.useDebugValue=function(){},gt.useDeferredValue=function(B,$){return j.H.useDeferredValue(B,$)},gt.useEffect=function(B,$){return j.H.useEffect(B,$)},gt.useEffectEvent=function(B){return j.H.useEffectEvent(B)},gt.useId=function(){return j.H.useId()},gt.useImperativeHandle=function(B,$,L){return j.H.useImperativeHandle(B,$,L)},gt.useInsertionEffect=function(B,$){return j.H.useInsertionEffect(B,$)},gt.useLayoutEffect=function(B,$){return j.H.useLayoutEffect(B,$)},gt.useMemo=function(B,$){return j.H.useMemo(B,$)},gt.useOptimistic=function(B,$){return j.H.useOptimistic(B,$)},gt.useReducer=function(B,$,L){return j.H.useReducer(B,$,L)},gt.useRef=function(B){return j.H.useRef(B)},gt.useState=function(B){return j.H.useState(B)},gt.useSyncExternalStore=function(B,$,L){return j.H.useSyncExternalStore(B,$,L)},gt.useTransition=function(){return j.H.useTransition()},gt.version="19.2.7",gt}var LS;function xd(){return LS||(LS=1,jg.exports=KM()),jg.exports}var y=xd();const $e=Ap(y),XM=qM({__proto__:null,default:$e},[y]);var Pg={exports:{}},cc={},Bg={exports:{}},zg={};/**
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 DS;function WM(){return DS||(DS=1,(function(e){function t(z,G){var Q=z.length;z.push(G);e:for(;0<Q;){var se=Q-1>>>1,D=z[se];if(0<s(D,G))z[se]=G,z[Q]=D,Q=se;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],Q=z.pop();if(Q!==G){z[0]=Q;e:for(var se=0,D=z.length,B=D>>>1;se<B;){var $=2*(se+1)-1,L=z[$],te=$+1,ne=z[te];if(0>s(L,Q))te<D&&0>s(ne,L)?(z[se]=ne,z[te]=Q,se=te):(z[se]=L,z[$]=Q,se=$);else if(te<D&&0>s(ne,Q))z[se]=ne,z[te]=Q,se=te;else break e}}return G}function s(z,G){var Q=z.sortIndex-G.sortIndex;return Q!==0?Q:z.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,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],m=1,p=null,b=3,x=!1,E=!1,A=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function _(z){for(var G=n(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=z)r(h),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(h)}}function M(z){if(A=!1,_(z),!E)if(n(d)!==null)E=!0,R||(R=!0,X());else{var G=n(h);G!==null&&V(M,G.startTime-z)}}var R=!1,j=-1,O=5,H=-1;function P(){return w?!0:!(e.unstable_now()-H<O)}function Y(){if(w=!1,R){var z=e.unstable_now();H=z;var G=!0;try{e:{E=!1,A&&(A=!1,k(j),j=-1),x=!0;var Q=b;try{t:{for(_(z),p=n(d);p!==null&&!(p.expirationTime>z&&P());){var se=p.callback;if(typeof se=="function"){p.callback=null,b=p.priorityLevel;var D=se(p.expirationTime<=z);if(z=e.unstable_now(),typeof D=="function"){p.callback=D,_(z),G=!0;break t}p===n(d)&&r(d),_(z)}else r(d);p=n(d)}if(p!==null)G=!0;else{var B=n(h);B!==null&&V(M,B.startTime-z),G=!1}}break e}finally{p=null,b=Q,x=!1}G=void 0}}finally{G?X():R=!1}}}var X;if(typeof N=="function")X=function(){N(Y)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=Y,X=function(){ee.postMessage(null)}}else X=function(){S(Y,0)};function V(z,G){j=S(function(){z(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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(z){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var Q=b;b=G;try{return z()}finally{b=Q}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Q=b;b=z;try{return G()}finally{b=Q}},e.unstable_scheduleCallback=function(z,G,Q){var se=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?se+Q:se):Q=se,z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=Q+D,z={id:m++,callback:G,priorityLevel:z,startTime:Q,expirationTime:D,sortIndex:-1},Q>se?(z.sortIndex=Q,t(h,z),n(d)===null&&z===n(h)&&(A?(k(j),j=-1):A=!0,V(M,Q-se))):(z.sortIndex=D,t(d,z),E||x||(E=!0,R||(R=!0,X()))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var G=b;return function(){var Q=b;b=G;try{return z.apply(this,arguments)}finally{b=Q}}}})(zg)),zg}var jS;function QM(){return jS||(jS=1,Bg.exports=WM()),Bg.exports}var Ug={exports:{}},nr={};/**
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 PS;function ZM(){if(PS)return nr;PS=1;var e=xd();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+h+" 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,h,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:d,containerInfo:h,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,nr.createPortal=function(d,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,m)},nr.flushSync=function(d){var h=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=h,r.p=m,r.d.f()}},nr.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},nr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},nr.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var m=h.as,p=u(m,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:x}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},nr.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},nr.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,p=u(m,h.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},nr.preloadModule=function(d,h){if(typeof d=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},nr.requestFormReset=function(d){r.d.r(d)},nr.unstable_batchedUpdates=function(d,h){return d(h)},nr.useFormState=function(d,h,m){return l.H.useFormState(d,h,m)},nr.useFormStatus=function(){return l.H.useHostTransitionStatus()},nr.version="19.2.7",nr}var BS;function Jk(){if(BS)return Ug.exports;BS=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(),Ug.exports=ZM(),Ug.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 zS;function JM(){if(zS)return cc;zS=1;var e=QM(),t=xd(),n=Jk();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}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,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c: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 u(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 h(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,g=o;;){var v=c.return;if(v===null)break;var T=v.alternate;if(T===null){if(g=v.return,g!==null){c=g;continue}break}if(v.child===T.child){for(T=v.child;T;){if(T===c)return d(v),i;if(T===g)return d(v),o;T=T.sibling}throw Error(r(188))}if(c.return!==g.return)c=v,g=T;else{for(var I=!1,U=v.child;U;){if(U===c){I=!0,c=v,g=T;break}if(U===g){I=!0,g=v,c=T;break}U=U.sibling}if(!I){for(U=T.child;U;){if(U===c){I=!0,c=T,g=v;break}if(U===g){I=!0,g=T,c=v;break}U=U.sibling}if(!I)throw Error(r(189))}}if(c.alternate!==g)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Symbol.for("react.client.reference");function ee(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Z?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case A:return"Fragment";case S:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case E:return"Portal";case N:return i.displayName||"Context";case k:return(i._context.displayName||"Context")+".Consumer";case _:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return o=i.displayName||null,o!==null?o:ee(i.type)||"Memo";case O:o=i._payload,i=i._init;try{return ee(i(o))}catch{}}return null}var V=Array.isArray,z=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,Q={pending:!1,data:null,method:null,action:null},se=[],D=-1;function B(i){return{current:i}}function $(i){0>D||(i.current=se[D],se[D]=null,D--)}function L(i,o){D++,se[D]=i.current,i.current=o}var te=B(null),ne=B(null),ce=B(null),fe=B(null);function de(i,o){switch(L(ce,o),L(ne,i),L(te,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?eS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=eS(o),i=tS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(te),L(te,i)}function xe(){$(te),$(ne),$(ce)}function Fe(i){i.memoizedState!==null&&L(fe,i);var o=te.current,c=tS(o,i.type);o!==c&&(L(ne,i),L(te,c))}function De(i){ne.current===i&&($(te),$(ne)),fe.current===i&&($(fe),ic._currentValue=Q)}var Te,Oe;function ze(i){if(Te===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Te=o&&o[1]||"",Oe=-1<c.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Te+i+Oe}var Xe=!1;function Ye(i,o){if(!i||Xe)return"";Xe=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(Se){var ve=Se}Reflect.construct(i,[],Re)}else{try{Re.call()}catch(Se){ve=Se}i.call(Re.prototype)}}else{try{throw Error()}catch(Se){ve=Se}(Re=i())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(Se){if(Se&&ve&&typeof Se.stack=="string")return[Se.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=g.DetermineComponentFrameRoot(),I=T[0],U=T[1];if(I&&U){var ie=I.split(`
45
- `),be=U.split(`
46
- `);for(v=g=0;g<ie.length&&!ie[g].includes("DetermineComponentFrameRoot");)g++;for(;v<be.length&&!be[v].includes("DetermineComponentFrameRoot");)v++;if(g===ie.length||v===be.length)for(g=ie.length-1,v=be.length-1;1<=g&&0<=v&&ie[g]!==be[v];)v--;for(;1<=g&&0<=v;g--,v--)if(ie[g]!==be[v]){if(g!==1||v!==1)do if(g--,v--,0>v||ie[g]!==be[v]){var Ne=`
47
- `+ie[g].replace(" at new "," at ");return i.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",i.displayName)),Ne}while(1<=g&&0<=v);break}}}finally{Xe=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?ze(c):""}function Le(i,o){switch(i.tag){case 26:case 27:case 5:return ze(i.type);case 16:return ze("Lazy");case 13:return i.child!==o&&o!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Ye(i.type,!1);case 11:return Ye(i.type.render,!1);case 1:return Ye(i.type,!0);case 31:return ze("Activity");default:return""}}function ke(i){try{var o="",c=null;do o+=Le(i,c),c=i,i=i.return;while(i);return o}catch(g){return`
48
- Error generating stack: `+g.message+`
49
- `+g.stack}}var Ee=Object.prototype.hasOwnProperty,Ie=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,J=e.unstable_shouldYield,pe=e.unstable_requestPaint,oe=e.unstable_now,ae=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,F=e.unstable_UserBlockingPriority,le=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,_e=e.unstable_IdlePriority,Ve=e.log,Pe=e.unstable_setDisableYieldValue,We=null,lt=null;function ct(i){if(typeof Ve=="function"&&Pe(i),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(We,i)}catch{}}var Ge=Math.clz32?Math.clz32:ut,Rt=Math.log,jt=Math.LN2;function ut(i){return i>>>=0,i===0?32:31-(Rt(i)/jt|0)|0}var Lt=256,Zt=262144,$t=4194304;function Jt(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 Qe(i,o,c){var g=i.pendingLanes;if(g===0)return 0;var v=0,T=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var U=g&134217727;return U!==0?(g=U&~T,g!==0?v=Jt(g):(I&=U,I!==0?v=Jt(I):c||(c=U&~i,c!==0&&(v=Jt(c))))):(U=g&~T,U!==0?v=Jt(U):I!==0?v=Jt(I):c||(c=g&~i,c!==0&&(v=Jt(c)))),v===0?0:o!==0&&o!==v&&(o&T)===0&&(T=v&-v,c=o&-o,T>=c||T===32&&(c&4194048)!==0)?o:v}function yt(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Ht(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 en(){var i=$t;return $t<<=1,($t&62914560)===0&&($t=4194304),i}function Kn(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function vt(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ln(i,o,c,g,v,T){var I=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var U=i.entanglements,ie=i.expirationTimes,be=i.hiddenUpdates;for(c=I&~c;0<c;){var Ne=31-Ge(c),Re=1<<Ne;U[Ne]=0,ie[Ne]=-1;var ve=be[Ne];if(ve!==null)for(be[Ne]=null,Ne=0;Ne<ve.length;Ne++){var Se=ve[Ne];Se!==null&&(Se.lane&=-536870913)}c&=~Re}g!==0&&yr(i,g,0),T!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=T&~(I&~o))}function yr(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var g=31-Ge(o);i.entangledLanes|=o,i.entanglements[g]=i.entanglements[g]|1073741824|c&261930}function bn(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var g=31-Ge(c),v=1<<g;v&o|i[g]&o&&(i[g]|=o),c&=~v}}function Cn(i,o){var c=o&-o;return c=(c&42)!==0?1:ht(c),(c&(i.suspendedLanes|o))!==0?0:c}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 It(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yn(){var i=G.p;return i!==0?i:(i=window.event,i===void 0?32:CS(i.type))}function Un(i,o){var c=G.p;try{return G.p=i,o()}finally{G.p=c}}var jn=Math.random().toString(36).slice(2),tn="__reactFiber$"+jn,Xn="__reactProps$"+jn,_s="__reactContainer$"+jn,yu="__reactEvents$"+jn,Dd="__reactListeners$"+jn,DI="__reactHandles$"+jn,Hv="__reactResources$"+jn,vu="__reactMarker$"+jn;function Nm(i){delete i[tn],delete i[Xn],delete i[yu],delete i[Dd],delete i[DI]}function Ho(i){var o=i[tn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[_s]||c[tn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=lS(i);i!==null;){if(c=i[tn])return c;i=lS(i)}return o}i=c,c=i.parentNode}return null}function Fo(i){if(i=i[tn]||i[_s]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Eu(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function $o(i){var o=i[Hv];return o||(o=i[Hv]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Hn(i){i[vu]=!0}var Fv=new Set,$v={};function Oa(i,o){Vo(i,o),Vo(i+"Capture",o)}function Vo(i,o){for($v[i]=o,i=0;i<o.length;i++)Fv.add(o[i])}var jI=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]*$"),Vv={},qv={};function PI(i){return Ee.call(qv,i)?!0:Ee.call(Vv,i)?!1:jI.test(i)?qv[i]=!0:(Vv[i]=!0,!1)}function jd(i,o,c){if(PI(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){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,""+c)}}function Pd(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Xs(i,o,c,g){if(g===null)i.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+g)}}function Wr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Yv(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function BI(i,o,c){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var v=g.get,T=g.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return v.call(this)},set:function(I){c=""+I,T.call(this,I)}}),Object.defineProperty(i,o,{enumerable:g.enumerable}),{getValue:function(){return c},setValue:function(I){c=""+I},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Am(i){if(!i._valueTracker){var o=Yv(i)?"checked":"value";i._valueTracker=BI(i,o,""+i[o])}}function Gv(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),g="";return i&&(g=Yv(i)?i.checked?"true":"false":i.value),i=g,i!==c?(o.setValue(i),!0):!1}function Bd(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 zI=/[\n"\\]/g;function Qr(i){return i.replace(zI,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function _m(i,o,c,g,v,T,I,U){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),o!=null?I==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Wr(o)):i.value!==""+Wr(o)&&(i.value=""+Wr(o)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),o!=null?Rm(i,I,Wr(o)):c!=null?Rm(i,I,Wr(c)):g!=null&&i.removeAttribute("value"),v==null&&T!=null&&(i.defaultChecked=!!T),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.name=""+Wr(U):i.removeAttribute("name")}function Kv(i,o,c,g,v,T,I,U){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),o!=null||c!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){Am(i);return}c=c!=null?""+Wr(c):"",o=o!=null?""+Wr(o):c,U||o===i.value||(i.value=o),i.defaultValue=o}g=g??v,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=U?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Am(i)}function Rm(i,o,c){o==="number"&&Bd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function qo(i,o,c,g){if(i=i.options,o){o={};for(var v=0;v<c.length;v++)o["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=o.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&g&&(i[c].defaultSelected=!0)}else{for(c=""+Wr(c),o=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,g&&(i[v].defaultSelected=!0);return}o!==null||i[v].disabled||(o=i[v])}o!==null&&(o.selected=!0)}}function Xv(i,o,c){if(o!=null&&(o=""+Wr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Wr(c):""}function Wv(i,o,c,g){if(o==null){if(g!=null){if(c!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}c=g}c==null&&(c=""),o=c}c=Wr(o),i.defaultValue=c,g=i.textContent,g===c&&g!==""&&g!==null&&(i.value=g),Am(i)}function Yo(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var UI=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 Qv(i,o,c){var g=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?g?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":g?i.setProperty(o,c):typeof c!="number"||c===0||UI.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function Zv(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var g in c)!c.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var v in o)g=o[v],o.hasOwnProperty(v)&&c[v]!==g&&Qv(i,v,g)}else for(var T in o)o.hasOwnProperty(T)&&Qv(i,T,o[T])}function Im(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 HI=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"]]),FI=/^[\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 zd(i){return FI.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ws(){}var Om=null;function Mm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Go=null,Ko=null;function Jv(i){var o=Fo(i);if(o&&(i=o.stateNode)){var c=i[Xn]||null;e:switch(i=o.stateNode,o.type){case"input":if(_m(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Qr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var g=c[o];if(g!==i&&g.form===i.form){var v=g[Xn]||null;if(!v)throw Error(r(90));_m(g,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(o=0;o<c.length;o++)g=c[o],g.form===i.form&&Gv(g)}break e;case"textarea":Xv(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&qo(i,!!c.multiple,o,!1)}}}var Lm=!1;function e2(i,o,c){if(Lm)return i(o,c);Lm=!0;try{var g=i(o);return g}finally{if(Lm=!1,(Go!==null||Ko!==null)&&(Nf(),Go&&(o=Go,i=Ko,Ko=Go=null,Jv(o),i)))for(o=0;o<i.length;o++)Jv(i[o])}}function Tu(i,o){var c=i.stateNode;if(c===null)return null;var g=c[Xn]||null;if(g===null)return null;c=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(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var Qs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dm=!1;if(Qs)try{var Su={};Object.defineProperty(Su,"passive",{get:function(){Dm=!0}}),window.addEventListener("test",Su,Su),window.removeEventListener("test",Su,Su)}catch{Dm=!1}var Li=null,jm=null,Ud=null;function t2(){if(Ud)return Ud;var i,o=jm,c=o.length,g,v="value"in Li?Li.value:Li.textContent,T=v.length;for(i=0;i<c&&o[i]===v[i];i++);var I=c-i;for(g=1;g<=I&&o[c-g]===v[T-g];g++);return Ud=v.slice(i,1<g?1-g:void 0)}function Hd(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 Fd(){return!0}function n2(){return!1}function vr(i){function o(c,g,v,T,I){this._reactName=c,this._targetInst=v,this.type=g,this.nativeEvent=T,this.target=I,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(c=i[U],this[U]=c?c(T):T[U]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Fd:n2,this.isPropagationStopped=n2,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Fd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Fd)},persist:function(){},isPersistent:Fd}),o}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$d=vr(Ma),Cu=p({},Ma,{view:0,detail:0}),$I=vr(Cu),Pm,Bm,wu,Vd=p({},Cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Um,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!==wu&&(wu&&i.type==="mousemove"?(Pm=i.screenX-wu.screenX,Bm=i.screenY-wu.screenY):Bm=Pm=0,wu=i),Pm)},movementY:function(i){return"movementY"in i?i.movementY:Bm}}),r2=vr(Vd),VI=p({},Vd,{dataTransfer:0}),qI=vr(VI),YI=p({},Cu,{relatedTarget:0}),zm=vr(YI),GI=p({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),KI=vr(GI),XI=p({},Ma,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),WI=vr(XI),QI=p({},Ma,{data:0}),s2=vr(QI),ZI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JI={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"},eO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tO(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=eO[i])?!!o[i]:!1}function Um(){return tO}var nO=p({},Cu,{key:function(i){if(i.key){var o=ZI[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Hd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?JI[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Um,charCode:function(i){return i.type==="keypress"?Hd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Hd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),rO=vr(nO),sO=p({},Vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i2=vr(sO),iO=p({},Cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Um}),aO=vr(iO),oO=p({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),lO=vr(oO),uO=p({},Vd,{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}),cO=vr(uO),dO=p({},Ma,{newState:0,oldState:0}),fO=vr(dO),hO=[9,13,27,32],Hm=Qs&&"CompositionEvent"in window,ku=null;Qs&&"documentMode"in document&&(ku=document.documentMode);var pO=Qs&&"TextEvent"in window&&!ku,a2=Qs&&(!Hm||ku&&8<ku&&11>=ku),o2=" ",l2=!1;function u2(i,o){switch(i){case"keyup":return hO.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c2(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Xo=!1;function mO(i,o){switch(i){case"compositionend":return c2(o);case"keypress":return o.which!==32?null:(l2=!0,o2);case"textInput":return i=o.data,i===o2&&l2?null:i;default:return null}}function gO(i,o){if(Xo)return i==="compositionend"||!Hm&&u2(i,o)?(i=t2(),Ud=jm=Li=null,Xo=!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 a2&&o.locale!=="ko"?null:o.data;default:return null}}var bO={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 d2(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!bO[i.type]:o==="textarea"}function f2(i,o,c,g){Go?Ko?Ko.push(g):Ko=[g]:Go=g,o=Lf(o,"onChange"),0<o.length&&(c=new $d("onChange","change",null,c,g),i.push({event:c,listeners:o}))}var Nu=null,Au=null;function xO(i){KT(i,0)}function qd(i){var o=Eu(i);if(Gv(o))return i}function h2(i,o){if(i==="change")return o}var p2=!1;if(Qs){var Fm;if(Qs){var $m="oninput"in document;if(!$m){var m2=document.createElement("div");m2.setAttribute("oninput","return;"),$m=typeof m2.oninput=="function"}Fm=$m}else Fm=!1;p2=Fm&&(!document.documentMode||9<document.documentMode)}function g2(){Nu&&(Nu.detachEvent("onpropertychange",b2),Au=Nu=null)}function b2(i){if(i.propertyName==="value"&&qd(Au)){var o=[];f2(o,Au,i,Mm(i)),e2(xO,o)}}function yO(i,o,c){i==="focusin"?(g2(),Nu=o,Au=c,Nu.attachEvent("onpropertychange",b2)):i==="focusout"&&g2()}function vO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return qd(Au)}function EO(i,o){if(i==="click")return qd(o)}function TO(i,o){if(i==="input"||i==="change")return qd(o)}function SO(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Dr=typeof Object.is=="function"?Object.is:SO;function _u(i,o){if(Dr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),g=Object.keys(o);if(c.length!==g.length)return!1;for(g=0;g<c.length;g++){var v=c[g];if(!Ee.call(o,v)||!Dr(i[v],o[v]))return!1}return!0}function x2(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function y2(i,o){var c=x2(i);i=0;for(var g;c;){if(c.nodeType===3){if(g=i+c.textContent.length,i<=o&&g>=o)return{node:c,offset:o-i};i=g}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=x2(c)}}function v2(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?v2(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function E2(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Bd(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=Bd(i.document)}return o}function Vm(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 CO=Qs&&"documentMode"in document&&11>=document.documentMode,Wo=null,qm=null,Ru=null,Ym=!1;function T2(i,o,c){var g=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ym||Wo==null||Wo!==Bd(g)||(g=Wo,"selectionStart"in g&&Vm(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}),Ru&&_u(Ru,g)||(Ru=g,g=Lf(qm,"onSelect"),0<g.length&&(o=new $d("onSelect","select",null,o,c),i.push({event:o,listeners:g}),o.target=Wo)))}function La(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var Qo={animationend:La("Animation","AnimationEnd"),animationiteration:La("Animation","AnimationIteration"),animationstart:La("Animation","AnimationStart"),transitionrun:La("Transition","TransitionRun"),transitionstart:La("Transition","TransitionStart"),transitioncancel:La("Transition","TransitionCancel"),transitionend:La("Transition","TransitionEnd")},Gm={},S2={};Qs&&(S2=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function Da(i){if(Gm[i])return Gm[i];if(!Qo[i])return i;var o=Qo[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in S2)return Gm[i]=o[c];return i}var C2=Da("animationend"),w2=Da("animationiteration"),k2=Da("animationstart"),wO=Da("transitionrun"),kO=Da("transitionstart"),NO=Da("transitioncancel"),N2=Da("transitionend"),A2=new Map,Km="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(" ");Km.push("scrollEnd");function bs(i,o){A2.set(i,o),Oa(o,[i])}var Yd=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)},Zr=[],Zo=0,Xm=0;function Gd(){for(var i=Zo,o=Xm=Zo=0;o<i;){var c=Zr[o];Zr[o++]=null;var g=Zr[o];Zr[o++]=null;var v=Zr[o];Zr[o++]=null;var T=Zr[o];if(Zr[o++]=null,g!==null&&v!==null){var I=g.pending;I===null?v.next=v:(v.next=I.next,I.next=v),g.pending=v}T!==0&&_2(c,v,T)}}function Kd(i,o,c,g){Zr[Zo++]=i,Zr[Zo++]=o,Zr[Zo++]=c,Zr[Zo++]=g,Xm|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Wm(i,o,c,g){return Kd(i,o,c,g),Xd(i)}function ja(i,o){return Kd(i,null,null,o),Xd(i)}function _2(i,o,c){i.lanes|=c;var g=i.alternate;g!==null&&(g.lanes|=c);for(var v=!1,T=i.return;T!==null;)T.childLanes|=c,g=T.alternate,g!==null&&(g.childLanes|=c),T.tag===22&&(i=T.stateNode,i===null||i._visibility&1||(v=!0)),i=T,T=T.return;return i.tag===3?(T=i.stateNode,v&&o!==null&&(v=31-Ge(c),i=T.hiddenUpdates,g=i[v],g===null?i[v]=[o]:g.push(o),o.lane=c|536870912),T):null}function Xd(i){if(50<Zu)throw Zu=0,ig=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var Jo={};function AO(i,o,c,g){this.tag=i,this.key=c,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,c,g){return new AO(i,o,c,g)}function Qm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Zs(i,o){var c=i.alternate;return c===null?(c=jr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function R2(i,o){i.flags&=65011714;var c=i.alternate;return c===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=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Wd(i,o,c,g,v,T){var I=0;if(g=i,typeof i=="function")Qm(i)&&(I=1);else if(typeof i=="string")I=MM(i,c,te.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=jr(31,c,o,v),i.elementType=H,i.lanes=T,i;case A:return Pa(c.children,v,T,o);case w:I=8,v|=24;break;case S:return i=jr(12,c,o,v|2),i.elementType=S,i.lanes=T,i;case M:return i=jr(13,c,o,v),i.elementType=M,i.lanes=T,i;case R:return i=jr(19,c,o,v),i.elementType=R,i.lanes=T,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case N:I=10;break e;case k:I=9;break e;case _:I=11;break e;case j:I=14;break e;case O:I=16,g=null;break e}I=29,c=Error(r(130,i===null?"null":typeof i,"")),g=null}return o=jr(I,c,o,v),o.elementType=i,o.type=g,o.lanes=T,o}function Pa(i,o,c,g){return i=jr(7,i,g,o),i.lanes=c,i}function Zm(i,o,c){return i=jr(6,i,null,o),i.lanes=c,i}function I2(i){var o=jr(18,null,null,0);return o.stateNode=i,o}function Jm(i,o,c){return o=jr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var O2=new WeakMap;function Jr(i,o){if(typeof i=="object"&&i!==null){var c=O2.get(i);return c!==void 0?c:(o={value:i,source:o,stack:ke(o)},O2.set(i,o),o)}return{value:i,source:o,stack:ke(o)}}var el=[],tl=0,Qd=null,Iu=0,es=[],ts=0,Di=null,Rs=1,Is="";function Js(i,o){el[tl++]=Iu,el[tl++]=Qd,Qd=i,Iu=o}function M2(i,o,c){es[ts++]=Rs,es[ts++]=Is,es[ts++]=Di,Di=i;var g=Rs;i=Is;var v=32-Ge(g)-1;g&=~(1<<v),c+=1;var T=32-Ge(o)+v;if(30<T){var I=v-v%5;T=(g&(1<<I)-1).toString(32),g>>=I,v-=I,Rs=1<<32-Ge(o)+v|c<<v|g,Is=T+i}else Rs=1<<T|c<<v|g,Is=i}function e0(i){i.return!==null&&(Js(i,1),M2(i,1,0))}function t0(i){for(;i===Qd;)Qd=el[--tl],el[tl]=null,Iu=el[--tl],el[tl]=null;for(;i===Di;)Di=es[--ts],es[ts]=null,Is=es[--ts],es[ts]=null,Rs=es[--ts],es[ts]=null}function L2(i,o){es[ts++]=Rs,es[ts++]=Is,es[ts++]=Di,Rs=o.id,Is=o.overflow,Di=i}var Wn=null,un=null,Dt=!1,ji=null,ns=!1,n0=Error(r(519));function Pi(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ou(Jr(o,i)),n0}function D2(i){var o=i.stateNode,c=i.type,g=i.memoizedProps;switch(o[tn]=i,o[Xn]=g,c){case"dialog":Nt("cancel",o),Nt("close",o);break;case"iframe":case"object":case"embed":Nt("load",o);break;case"video":case"audio":for(c=0;c<ec.length;c++)Nt(ec[c],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),Kv(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),Wv(o,g.value,g.defaultValue,g.children)}c=g.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||g.suppressHydrationWarning===!0||ZT(o.textContent,c)?(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=Ws),o=!0):o=!1,o||Pi(i,!0)}function j2(i){for(Wn=i.return;Wn;)switch(Wn.tag){case 5:case 31:case 13:ns=!1;return;case 27:case 3:ns=!0;return;default:Wn=Wn.return}}function nl(i){if(i!==Wn)return!1;if(!Dt)return j2(i),Dt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||vg(i.type,i.memoizedProps)),c=!c),c&&un&&Pi(i),j2(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));un=oS(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));un=oS(i)}else o===27?(o=un,Qi(i.type)?(i=wg,wg=null,un=i):un=o):un=Wn?ss(i.stateNode.nextSibling):null;return!0}function Ba(){un=Wn=null,Dt=!1}function r0(){var i=ji;return i!==null&&(Cr===null?Cr=i:Cr.push.apply(Cr,i),ji=null),i}function Ou(i){ji===null?ji=[i]:ji.push(i)}var s0=B(null),za=null,ei=null;function Bi(i,o,c){L(s0,o._currentValue),o._currentValue=c}function ti(i){i._currentValue=s0.current,$(s0)}function i0(i,o,c){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===c)break;i=i.return}}function a0(i,o,c,g){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var T=v.dependencies;if(T!==null){var I=v.child;T=T.firstContext;e:for(;T!==null;){var U=T;T=v;for(var ie=0;ie<o.length;ie++)if(U.context===o[ie]){T.lanes|=c,U=T.alternate,U!==null&&(U.lanes|=c),i0(T.return,c,i),g||(I=null);break e}T=U.next}}else if(v.tag===18){if(I=v.return,I===null)throw Error(r(341));I.lanes|=c,T=I.alternate,T!==null&&(T.lanes|=c),i0(I,c,i),I=null}else I=v.child;if(I!==null)I.return=v;else for(I=v;I!==null;){if(I===i){I=null;break}if(v=I.sibling,v!==null){v.return=I.return,I=v;break}I=I.return}v=I}}function rl(i,o,c,g){i=null;for(var v=o,T=!1;v!==null;){if(!T){if((v.flags&524288)!==0)T=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var I=v.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var U=v.type;Dr(v.pendingProps.value,I.value)||(i!==null?i.push(U):i=[U])}}else if(v===fe.current){if(I=v.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(ic):i=[ic])}v=v.return}i!==null&&a0(o,i,c,g),o.flags|=262144}function Zd(i){for(i=i.firstContext;i!==null;){if(!Dr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ua(i){za=i,ei=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Qn(i){return P2(za,i)}function Jd(i,o){return za===null&&Ua(i),P2(i,o)}function P2(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},ei===null){if(i===null)throw Error(r(308));ei=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ei=ei.next=o;return c}var _O=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,g){i.push(g)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},RO=e.unstable_scheduleCallback,IO=e.unstable_NormalPriority,_n={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function o0(){return{controller:new _O,data:new Map,refCount:0}}function Mu(i){i.refCount--,i.refCount===0&&RO(IO,function(){i.controller.abort()})}var Lu=null,l0=0,sl=0,il=null;function OO(i,o){if(Lu===null){var c=Lu=[];l0=0,sl=dg(),il={status:"pending",value:void 0,then:function(g){c.push(g)}}}return l0++,o.then(B2,B2),o}function B2(){if(--l0===0&&Lu!==null){il!==null&&(il.status="fulfilled");var i=Lu;Lu=null,sl=0,il=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function MO(i,o){var c=[],g={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){g.status="fulfilled",g.value=o;for(var v=0;v<c.length;v++)(0,c[v])(o)},function(v){for(g.status="rejected",g.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),g}var z2=z.S;z.S=function(i,o){TT=oe(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&OO(i,o),z2!==null&&z2(i,o)};var Ha=B(null);function u0(){var i=Ha.current;return i!==null?i:nn.pooledCache}function ef(i,o){o===null?L(Ha,Ha.current):L(Ha,o.pool)}function U2(){var i=u0();return i===null?null:{parent:_n._currentValue,pool:i}}var al=Error(r(460)),c0=Error(r(474)),tf=Error(r(542)),nf={then:function(){}};function H2(i){return i=i.status,i==="fulfilled"||i==="rejected"}function F2(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Ws,Ws),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,V2(i),i;default:if(typeof o.status=="string")o.then(Ws,Ws);else{if(i=nn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(g){if(o.status==="pending"){var v=o;v.status="fulfilled",v.value=g}},function(g){if(o.status==="pending"){var v=o;v.status="rejected",v.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,V2(i),i}throw $a=o,al}}function Fa(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?($a=c,al):c}}var $a=null;function $2(){if($a===null)throw Error(r(459));var i=$a;return $a=null,i}function V2(i){if(i===al||i===tf)throw Error(r(483))}var ol=null,Du=0;function rf(i){var o=Du;return Du+=1,ol===null&&(ol=[]),F2(ol,i,o)}function ju(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function sf(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 q2(i){function o(he,ue){if(i){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function c(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 v(he,ue){return he=Zs(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 I(he){return i&&he.alternate===null&&(he.flags|=67108866),he}function U(he,ue,ge,Ae){return ue===null||ue.tag!==6?(ue=Zm(ge,he.mode,Ae),ue.return=he,ue):(ue=v(ue,ge),ue.return=he,ue)}function ie(he,ue,ge,Ae){var it=ge.type;return it===A?Ne(he,ue,ge.props.children,Ae,ge.key):ue!==null&&(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===O&&Fa(it)===ue.type)?(ue=v(ue,ge.props),ju(ue,ge),ue.return=he,ue):(ue=Wd(ge.type,ge.key,ge.props,null,he.mode,Ae),ju(ue,ge),ue.return=he,ue)}function be(he,ue,ge,Ae){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=Jm(ge,he.mode,Ae),ue.return=he,ue):(ue=v(ue,ge.children||[]),ue.return=he,ue)}function Ne(he,ue,ge,Ae,it){return ue===null||ue.tag!==7?(ue=Pa(ge,he.mode,Ae,it),ue.return=he,ue):(ue=v(ue,ge),ue.return=he,ue)}function Re(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=Zm(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ge=Wd(ue.type,ue.key,ue.props,null,he.mode,ge),ju(ge,ue),ge.return=he,ge;case E:return ue=Jm(ue,he.mode,ge),ue.return=he,ue;case O:return ue=Fa(ue),Re(he,ue,ge)}if(V(ue)||X(ue))return ue=Pa(ue,he.mode,ge,null),ue.return=he,ue;if(typeof ue.then=="function")return Re(he,rf(ue),ge);if(ue.$$typeof===N)return Re(he,Jd(he,ue),ge);sf(he,ue)}return null}function ve(he,ue,ge,Ae){var it=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return it!==null?null:U(he,ue,""+ge,Ae);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return ge.key===it?ie(he,ue,ge,Ae):null;case E:return ge.key===it?be(he,ue,ge,Ae):null;case O:return ge=Fa(ge),ve(he,ue,ge,Ae)}if(V(ge)||X(ge))return it!==null?null:Ne(he,ue,ge,Ae,null);if(typeof ge.then=="function")return ve(he,ue,rf(ge),Ae);if(ge.$$typeof===N)return ve(he,ue,Jd(he,ge),Ae);sf(he,ge)}return null}function Se(he,ue,ge,Ae,it){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return he=he.get(ge)||null,U(ue,he,""+Ae,it);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case x:return he=he.get(Ae.key===null?ge:Ae.key)||null,ie(ue,he,Ae,it);case E:return he=he.get(Ae.key===null?ge:Ae.key)||null,be(ue,he,Ae,it);case O:return Ae=Fa(Ae),Se(he,ue,ge,Ae,it)}if(V(Ae)||X(Ae))return he=he.get(ge)||null,Ne(ue,he,Ae,it,null);if(typeof Ae.then=="function")return Se(he,ue,ge,rf(Ae),it);if(Ae.$$typeof===N)return Se(he,ue,ge,Jd(ue,Ae),it);sf(ue,Ae)}return null}function et(he,ue,ge,Ae){for(var it=null,zt=null,nt=ue,xt=ue=0,Mt=null;nt!==null&&xt<ge.length;xt++){nt.index>xt?(Mt=nt,nt=null):Mt=nt.sibling;var Ut=ve(he,nt,ge[xt],Ae);if(Ut===null){nt===null&&(nt=Mt);break}i&&nt&&Ut.alternate===null&&o(he,nt),ue=T(Ut,ue,xt),zt===null?it=Ut:zt.sibling=Ut,zt=Ut,nt=Mt}if(xt===ge.length)return c(he,nt),Dt&&Js(he,xt),it;if(nt===null){for(;xt<ge.length;xt++)nt=Re(he,ge[xt],Ae),nt!==null&&(ue=T(nt,ue,xt),zt===null?it=nt:zt.sibling=nt,zt=nt);return Dt&&Js(he,xt),it}for(nt=g(nt);xt<ge.length;xt++)Mt=Se(nt,he,xt,ge[xt],Ae),Mt!==null&&(i&&Mt.alternate!==null&&nt.delete(Mt.key===null?xt:Mt.key),ue=T(Mt,ue,xt),zt===null?it=Mt:zt.sibling=Mt,zt=Mt);return i&&nt.forEach(function(na){return o(he,na)}),Dt&&Js(he,xt),it}function ot(he,ue,ge,Ae){if(ge==null)throw Error(r(151));for(var it=null,zt=null,nt=ue,xt=ue=0,Mt=null,Ut=ge.next();nt!==null&&!Ut.done;xt++,Ut=ge.next()){nt.index>xt?(Mt=nt,nt=null):Mt=nt.sibling;var na=ve(he,nt,Ut.value,Ae);if(na===null){nt===null&&(nt=Mt);break}i&&nt&&na.alternate===null&&o(he,nt),ue=T(na,ue,xt),zt===null?it=na:zt.sibling=na,zt=na,nt=Mt}if(Ut.done)return c(he,nt),Dt&&Js(he,xt),it;if(nt===null){for(;!Ut.done;xt++,Ut=ge.next())Ut=Re(he,Ut.value,Ae),Ut!==null&&(ue=T(Ut,ue,xt),zt===null?it=Ut:zt.sibling=Ut,zt=Ut);return Dt&&Js(he,xt),it}for(nt=g(nt);!Ut.done;xt++,Ut=ge.next())Ut=Se(nt,he,xt,Ut.value,Ae),Ut!==null&&(i&&Ut.alternate!==null&&nt.delete(Ut.key===null?xt:Ut.key),ue=T(Ut,ue,xt),zt===null?it=Ut:zt.sibling=Ut,zt=Ut);return i&&nt.forEach(function(VM){return o(he,VM)}),Dt&&Js(he,xt),it}function Xt(he,ue,ge,Ae){if(typeof ge=="object"&&ge!==null&&ge.type===A&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:e:{for(var it=ge.key;ue!==null;){if(ue.key===it){if(it=ge.type,it===A){if(ue.tag===7){c(he,ue.sibling),Ae=v(ue,ge.props.children),Ae.return=he,he=Ae;break e}}else if(ue.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===O&&Fa(it)===ue.type){c(he,ue.sibling),Ae=v(ue,ge.props),ju(Ae,ge),Ae.return=he,he=Ae;break e}c(he,ue);break}else o(he,ue);ue=ue.sibling}ge.type===A?(Ae=Pa(ge.props.children,he.mode,Ae,ge.key),Ae.return=he,he=Ae):(Ae=Wd(ge.type,ge.key,ge.props,null,he.mode,Ae),ju(Ae,ge),Ae.return=he,he=Ae)}return I(he);case E:e:{for(it=ge.key;ue!==null;){if(ue.key===it)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){c(he,ue.sibling),Ae=v(ue,ge.children||[]),Ae.return=he,he=Ae;break e}else{c(he,ue);break}else o(he,ue);ue=ue.sibling}Ae=Jm(ge,he.mode,Ae),Ae.return=he,he=Ae}return I(he);case O:return ge=Fa(ge),Xt(he,ue,ge,Ae)}if(V(ge))return et(he,ue,ge,Ae);if(X(ge)){if(it=X(ge),typeof it!="function")throw Error(r(150));return ge=it.call(ge),ot(he,ue,ge,Ae)}if(typeof ge.then=="function")return Xt(he,ue,rf(ge),Ae);if(ge.$$typeof===N)return Xt(he,ue,Jd(he,ge),Ae);sf(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,ue!==null&&ue.tag===6?(c(he,ue.sibling),Ae=v(ue,ge),Ae.return=he,he=Ae):(c(he,ue),Ae=Zm(ge,he.mode,Ae),Ae.return=he,he=Ae),I(he)):c(he,ue)}return function(he,ue,ge,Ae){try{Du=0;var it=Xt(he,ue,ge,Ae);return ol=null,it}catch(nt){if(nt===al||nt===tf)throw nt;var zt=jr(29,nt,null,he.mode);return zt.lanes=Ae,zt.return=he,zt}finally{}}}var Va=q2(!0),Y2=q2(!1),zi=!1;function d0(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function f0(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 Ui(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Hi(i,o,c){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Ft&2)!==0){var v=g.pending;return v===null?o.next=o:(o.next=v.next,v.next=o),g.pending=o,o=Xd(i),_2(i,null,c),o}return Kd(i,g,o,c),Xd(i)}function Pu(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,bn(i,c)}}function h0(i,o){var c=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,c===g)){var v=null,T=null;if(c=c.firstBaseUpdate,c!==null){do{var I={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};T===null?v=T=I:T=T.next=I,c=c.next}while(c!==null);T===null?v=T=o:T=T.next=o}else v=T=o;c={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var p0=!1;function Bu(){if(p0){var i=il;if(i!==null)throw i}}function zu(i,o,c,g){p0=!1;var v=i.updateQueue;zi=!1;var T=v.firstBaseUpdate,I=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var ie=U,be=ie.next;ie.next=null,I===null?T=be:I.next=be,I=ie;var Ne=i.alternate;Ne!==null&&(Ne=Ne.updateQueue,U=Ne.lastBaseUpdate,U!==I&&(U===null?Ne.firstBaseUpdate=be:U.next=be,Ne.lastBaseUpdate=ie))}if(T!==null){var Re=v.baseState;I=0,Ne=be=ie=null,U=T;do{var ve=U.lane&-536870913,Se=ve!==U.lane;if(Se?(Ot&ve)===ve:(g&ve)===ve){ve!==0&&ve===sl&&(p0=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var et=i,ot=U;ve=o;var Xt=c;switch(ot.tag){case 1:if(et=ot.payload,typeof et=="function"){Re=et.call(Xt,Re,ve);break e}Re=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=ot.payload,ve=typeof et=="function"?et.call(Xt,Re,ve):et,ve==null)break e;Re=p({},Re,ve);break e;case 2:zi=!0}}ve=U.callback,ve!==null&&(i.flags|=64,Se&&(i.flags|=8192),Se=v.callbacks,Se===null?v.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Ne===null?(be=Ne=Se,ie=Re):Ne=Ne.next=Se,I|=ve;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;Se=U,U=Se.next,Se.next=null,v.lastBaseUpdate=Se,v.shared.pending=null}}while(!0);Ne===null&&(ie=Re),v.baseState=ie,v.firstBaseUpdate=be,v.lastBaseUpdate=Ne,T===null&&(v.shared.lanes=0),Yi|=I,i.lanes=I,i.memoizedState=Re}}function G2(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function K2(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)G2(c[i],o)}var ll=B(null),af=B(0);function X2(i,o){i=ci,L(af,i),L(ll,o),ci=i|o.baseLanes}function m0(){L(af,ci),L(ll,ll.current)}function g0(){ci=af.current,$(ll),$(af)}var Pr=B(null),rs=null;function Fi(i){var o=i.alternate;L(wn,wn.current&1),L(Pr,i),rs===null&&(o===null||ll.current!==null||o.memoizedState!==null)&&(rs=i)}function b0(i){L(wn,wn.current),L(Pr,i),rs===null&&(rs=i)}function W2(i){i.tag===22?(L(wn,wn.current),L(Pr,i),rs===null&&(rs=i)):$i()}function $i(){L(wn,wn.current),L(Pr,Pr.current)}function Br(i){$(Pr),rs===i&&(rs=null),$(wn)}var wn=B(0);function of(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Sg(c)||Cg(c)))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 ni=0,bt=null,Gt=null,Rn=null,lf=!1,ul=!1,qa=!1,uf=0,Uu=0,cl=null,LO=0;function vn(){throw Error(r(321))}function x0(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!Dr(i[c],o[c]))return!1;return!0}function y0(i,o,c,g,v,T){return ni=T,bt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=i===null||i.memoizedState===null?ME:L0,qa=!1,T=c(g,v),qa=!1,ul&&(T=Z2(o,c,g,v)),Q2(i),T}function Q2(i){z.H=$u;var o=Gt!==null&&Gt.next!==null;if(ni=0,Rn=Gt=bt=null,lf=!1,Uu=0,cl=null,o)throw Error(r(300));i===null||In||(i=i.dependencies,i!==null&&Zd(i)&&(In=!0))}function Z2(i,o,c,g){bt=i;var v=0;do{if(ul&&(cl=null),Uu=0,ul=!1,25<=v)throw Error(r(301));if(v+=1,Rn=Gt=null,i.updateQueue!=null){var T=i.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}z.H=LE,T=o(c,g)}while(ul);return T}function DO(){var i=z.H,o=i.useState()[0];return o=typeof o.then=="function"?Hu(o):o,i=i.useState()[0],(Gt!==null?Gt.memoizedState:null)!==i&&(bt.flags|=1024),o}function v0(){var i=uf!==0;return uf=0,i}function E0(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function T0(i){if(lf){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}lf=!1}ni=0,Rn=Gt=bt=null,ul=!1,Uu=uf=0,cl=null}function cr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?bt.memoizedState=Rn=i:Rn=Rn.next=i,Rn}function kn(){if(Gt===null){var i=bt.alternate;i=i!==null?i.memoizedState:null}else i=Gt.next;var o=Rn===null?bt.memoizedState:Rn.next;if(o!==null)Rn=o,Gt=i;else{if(i===null)throw bt.alternate===null?Error(r(467)):Error(r(310));Gt=i,i={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Rn===null?bt.memoizedState=Rn=i:Rn=Rn.next=i}return Rn}function cf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hu(i){var o=Uu;return Uu+=1,cl===null&&(cl=[]),i=F2(cl,i,o),o=bt,(Rn===null?o.memoizedState:Rn.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?ME:L0),i}function df(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Hu(i);if(i.$$typeof===N)return Qn(i)}throw Error(r(438,String(i)))}function S0(i){var o=null,c=bt.updateQueue;if(c!==null&&(o=c.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(v){return v.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=cf(),bt.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),g=0;g<i;g++)c[g]=P;return o.index++,c}function ri(i,o){return typeof o=="function"?o(i):o}function ff(i){var o=kn();return C0(o,Gt,i)}function C0(i,o,c){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var v=i.baseQueue,T=g.pending;if(T!==null){if(v!==null){var I=v.next;v.next=T.next,T.next=I}o.baseQueue=v=T,g.pending=null}if(T=i.baseState,v===null)i.memoizedState=T;else{o=v.next;var U=I=null,ie=null,be=o,Ne=!1;do{var Re=be.lane&-536870913;if(Re!==be.lane?(Ot&Re)===Re:(ni&Re)===Re){var ve=be.revertLane;if(ve===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Re===sl&&(Ne=!0);else if((ni&ve)===ve){be=be.next,ve===sl&&(Ne=!0);continue}else Re={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ie===null?(U=ie=Re,I=T):ie=ie.next=Re,bt.lanes|=ve,Yi|=ve;Re=be.action,qa&&c(T,Re),T=be.hasEagerState?be.eagerState:c(T,Re)}else ve={lane:Re,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ie===null?(U=ie=ve,I=T):ie=ie.next=ve,bt.lanes|=Re,Yi|=Re;be=be.next}while(be!==null&&be!==o);if(ie===null?I=T:ie.next=U,!Dr(T,i.memoizedState)&&(In=!0,Ne&&(c=il,c!==null)))throw c;i.memoizedState=T,i.baseState=I,i.baseQueue=ie,g.lastRenderedState=T}return v===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function w0(i){var o=kn(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var g=c.dispatch,v=c.pending,T=o.memoizedState;if(v!==null){c.pending=null;var I=v=v.next;do T=i(T,I.action),I=I.next;while(I!==v);Dr(T,o.memoizedState)||(In=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),c.lastRenderedState=T}return[T,g]}function J2(i,o,c){var g=bt,v=kn(),T=Dt;if(T){if(c===void 0)throw Error(r(407));c=c()}else c=o();var I=!Dr((Gt||v).memoizedState,c);if(I&&(v.memoizedState=c,In=!0),v=v.queue,A0(nE.bind(null,g,v,i),[i]),v.getSnapshot!==o||I||Rn!==null&&Rn.memoizedState.tag&1){if(g.flags|=2048,dl(9,{destroy:void 0},tE.bind(null,g,v,c,o),null),nn===null)throw Error(r(349));T||(ni&127)!==0||eE(g,o,c)}return c}function eE(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=bt.updateQueue,o===null?(o=cf(),bt.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function tE(i,o,c,g){o.value=c,o.getSnapshot=g,rE(o)&&sE(i)}function nE(i,o,c){return c(function(){rE(o)&&sE(i)})}function rE(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!Dr(i,c)}catch{return!0}}function sE(i){var o=ja(i,2);o!==null&&wr(o,i,2)}function k0(i){var o=cr();if(typeof i=="function"){var c=i;if(i=c(),qa){ct(!0);try{c()}finally{ct(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:i},o}function iE(i,o,c,g){return i.baseState=c,C0(i,Gt,typeof g=="function"?g:ri)}function jO(i,o,c,g,v){if(mf(i))throw Error(r(485));if(i=o.action,i!==null){var T={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){T.listeners.push(I)}};z.T!==null?c(!0):T.isTransition=!1,g(T),c=o.pending,c===null?(T.next=o.pending=T,aE(o,T)):(T.next=c.next,o.pending=c.next=T)}}function aE(i,o){var c=o.action,g=o.payload,v=i.state;if(o.isTransition){var T=z.T,I={};z.T=I;try{var U=c(v,g),ie=z.S;ie!==null&&ie(I,U),oE(i,o,U)}catch(be){N0(i,o,be)}finally{T!==null&&I.types!==null&&(T.types=I.types),z.T=T}}else try{T=c(v,g),oE(i,o,T)}catch(be){N0(i,o,be)}}function oE(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(g){lE(i,o,g)},function(g){return N0(i,o,g)}):lE(i,o,c)}function lE(i,o,c){o.status="fulfilled",o.value=c,uE(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,aE(i,c)))}function N0(i,o,c){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=c,uE(o),o=o.next;while(o!==g)}i.action=null}function uE(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function cE(i,o){return o}function dE(i,o){if(Dt){var c=nn.formState;if(c!==null){e:{var g=bt;if(Dt){if(un){t:{for(var v=un,T=ns;v.nodeType!==8;){if(!T){v=null;break t}if(v=ss(v.nextSibling),v===null){v=null;break t}}T=v.data,v=T==="F!"||T==="F"?v:null}if(v){un=ss(v.nextSibling),g=v.data==="F!";break e}}Pi(g)}g=!1}g&&(o=c[0])}}return c=cr(),c.memoizedState=c.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cE,lastRenderedState:o},c.queue=g,c=RE.bind(null,bt,g),g.dispatch=c,g=k0(!1),T=M0.bind(null,bt,!1,g.queue),g=cr(),v={state:o,dispatch:null,action:i,pending:null},g.queue=v,c=jO.bind(null,bt,v,T,c),v.dispatch=c,g.memoizedState=i,[o,c,!1]}function fE(i){var o=kn();return hE(o,Gt,i)}function hE(i,o,c){if(o=C0(i,o,cE)[0],i=ff(ri)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Hu(o)}catch(I){throw I===al?tf:I}else g=o;o=kn();var v=o.queue,T=v.dispatch;return c!==o.memoizedState&&(bt.flags|=2048,dl(9,{destroy:void 0},PO.bind(null,v,c),null)),[g,T,i]}function PO(i,o){i.action=o}function pE(i){var o=kn(),c=Gt;if(c!==null)return hE(o,c,i);kn(),o=o.memoizedState,c=kn();var g=c.queue.dispatch;return c.memoizedState=i,[o,g,!1]}function dl(i,o,c,g){return i={tag:i,create:c,deps:g,inst:o,next:null},o=bt.updateQueue,o===null&&(o=cf(),bt.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(g=c.next,c.next=i,i.next=g,o.lastEffect=i),i}function mE(){return kn().memoizedState}function hf(i,o,c,g){var v=cr();bt.flags|=i,v.memoizedState=dl(1|o,{destroy:void 0},c,g===void 0?null:g)}function pf(i,o,c,g){var v=kn();g=g===void 0?null:g;var T=v.memoizedState.inst;Gt!==null&&g!==null&&x0(g,Gt.memoizedState.deps)?v.memoizedState=dl(o,T,c,g):(bt.flags|=i,v.memoizedState=dl(1|o,T,c,g))}function gE(i,o){hf(8390656,8,i,o)}function A0(i,o){pf(2048,8,i,o)}function BO(i){bt.flags|=4;var o=bt.updateQueue;if(o===null)o=cf(),bt.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function bE(i){var o=kn().memoizedState;return BO({ref:o,nextImpl:i}),function(){if((Ft&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function xE(i,o){return pf(4,2,i,o)}function yE(i,o){return pf(4,4,i,o)}function vE(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function EE(i,o,c){c=c!=null?c.concat([i]):null,pf(4,4,vE.bind(null,o,i),c)}function _0(){}function TE(i,o){var c=kn();o=o===void 0?null:o;var g=c.memoizedState;return o!==null&&x0(o,g[1])?g[0]:(c.memoizedState=[i,o],i)}function SE(i,o){var c=kn();o=o===void 0?null:o;var g=c.memoizedState;if(o!==null&&x0(o,g[1]))return g[0];if(g=i(),qa){ct(!0);try{i()}finally{ct(!1)}}return c.memoizedState=[g,o],g}function R0(i,o,c){return c===void 0||(ni&1073741824)!==0&&(Ot&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=CT(),bt.lanes|=i,Yi|=i,c)}function CE(i,o,c,g){return Dr(c,o)?c:ll.current!==null?(i=R0(i,c,g),Dr(i,o)||(In=!0),i):(ni&42)===0||(ni&1073741824)!==0&&(Ot&261930)===0?(In=!0,i.memoizedState=c):(i=CT(),bt.lanes|=i,Yi|=i,o)}function wE(i,o,c,g,v){var T=G.p;G.p=T!==0&&8>T?T:8;var I=z.T,U={};z.T=U,M0(i,!1,o,c);try{var ie=v(),be=z.S;if(be!==null&&be(U,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ne=MO(ie,g);Fu(i,o,Ne,Hr(i))}else Fu(i,o,g,Hr(i))}catch(Re){Fu(i,o,{then:function(){},status:"rejected",reason:Re},Hr())}finally{G.p=T,I!==null&&U.types!==null&&(I.types=U.types),z.T=I}}function zO(){}function I0(i,o,c,g){if(i.tag!==5)throw Error(r(476));var v=kE(i).queue;wE(i,v,o,Q,c===null?zO:function(){return NE(i),c(g)})}function kE(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:Q},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function NE(i){var o=kE(i);o.next===null&&(o=i.alternate.memoizedState),Fu(i,o.next.queue,{},Hr())}function O0(){return Qn(ic)}function AE(){return kn().memoizedState}function _E(){return kn().memoizedState}function UO(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=Hr();i=Ui(c);var g=Hi(o,i,c);g!==null&&(wr(g,o,c),Pu(g,o,c)),o={cache:o0()},i.payload=o;return}o=o.return}}function HO(i,o,c){var g=Hr();c={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},mf(i)?IE(o,c):(c=Wm(i,o,c,g),c!==null&&(wr(c,i,g),OE(c,o,g)))}function RE(i,o,c){var g=Hr();Fu(i,o,c,g)}function Fu(i,o,c,g){var v={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(mf(i))IE(o,v);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var I=o.lastRenderedState,U=T(I,c);if(v.hasEagerState=!0,v.eagerState=U,Dr(U,I))return Kd(i,o,v,0),nn===null&&Gd(),!1}catch{}finally{}if(c=Wm(i,o,v,g),c!==null)return wr(c,i,g),OE(c,o,g),!0}return!1}function M0(i,o,c,g){if(g={lane:2,revertLane:dg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},mf(i)){if(o)throw Error(r(479))}else o=Wm(i,c,g,2),o!==null&&wr(o,i,2)}function mf(i){var o=i.alternate;return i===bt||o!==null&&o===bt}function IE(i,o){ul=lf=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function OE(i,o,c){if((c&4194048)!==0){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,bn(i,c)}}var $u={readContext:Qn,use:df,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};$u.useEffectEvent=vn;var ME={readContext:Qn,use:df,useCallback:function(i,o){return cr().memoizedState=[i,o===void 0?null:o],i},useContext:Qn,useEffect:gE,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,hf(4194308,4,vE.bind(null,o,i),c)},useLayoutEffect:function(i,o){return hf(4194308,4,i,o)},useInsertionEffect:function(i,o){hf(4,2,i,o)},useMemo:function(i,o){var c=cr();o=o===void 0?null:o;var g=i();if(qa){ct(!0);try{i()}finally{ct(!1)}}return c.memoizedState=[g,o],g},useReducer:function(i,o,c){var g=cr();if(c!==void 0){var v=c(o);if(qa){ct(!0);try{c(o)}finally{ct(!1)}}}else v=o;return g.memoizedState=g.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},g.queue=i,i=i.dispatch=HO.bind(null,bt,i),[g.memoizedState,i]},useRef:function(i){var o=cr();return i={current:i},o.memoizedState=i},useState:function(i){i=k0(i);var o=i.queue,c=RE.bind(null,bt,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:_0,useDeferredValue:function(i,o){var c=cr();return R0(c,i,o)},useTransition:function(){var i=k0(!1);return i=wE.bind(null,bt,i.queue,!0,!1),cr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var g=bt,v=cr();if(Dt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),nn===null)throw Error(r(349));(Ot&127)!==0||eE(g,o,c)}v.memoizedState=c;var T={value:c,getSnapshot:o};return v.queue=T,gE(nE.bind(null,g,T,i),[i]),g.flags|=2048,dl(9,{destroy:void 0},tE.bind(null,g,T,c,o),null),c},useId:function(){var i=cr(),o=nn.identifierPrefix;if(Dt){var c=Is,g=Rs;c=(g&~(1<<32-Ge(g)-1)).toString(32)+c,o="_"+o+"R_"+c,c=uf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=LO++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:O0,useFormState:dE,useActionState:dE,useOptimistic:function(i){var o=cr();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=M0.bind(null,bt,!0,c),c.dispatch=o,[i,o]},useMemoCache:S0,useCacheRefresh:function(){return cr().memoizedState=UO.bind(null,bt)},useEffectEvent:function(i){var o=cr(),c={impl:i};return o.memoizedState=c,function(){if((Ft&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},L0={readContext:Qn,use:df,useCallback:TE,useContext:Qn,useEffect:A0,useImperativeHandle:EE,useInsertionEffect:xE,useLayoutEffect:yE,useMemo:SE,useReducer:ff,useRef:mE,useState:function(){return ff(ri)},useDebugValue:_0,useDeferredValue:function(i,o){var c=kn();return CE(c,Gt.memoizedState,i,o)},useTransition:function(){var i=ff(ri)[0],o=kn().memoizedState;return[typeof i=="boolean"?i:Hu(i),o]},useSyncExternalStore:J2,useId:AE,useHostTransitionStatus:O0,useFormState:fE,useActionState:fE,useOptimistic:function(i,o){var c=kn();return iE(c,Gt,i,o)},useMemoCache:S0,useCacheRefresh:_E};L0.useEffectEvent=bE;var LE={readContext:Qn,use:df,useCallback:TE,useContext:Qn,useEffect:A0,useImperativeHandle:EE,useInsertionEffect:xE,useLayoutEffect:yE,useMemo:SE,useReducer:w0,useRef:mE,useState:function(){return w0(ri)},useDebugValue:_0,useDeferredValue:function(i,o){var c=kn();return Gt===null?R0(c,i,o):CE(c,Gt.memoizedState,i,o)},useTransition:function(){var i=w0(ri)[0],o=kn().memoizedState;return[typeof i=="boolean"?i:Hu(i),o]},useSyncExternalStore:J2,useId:AE,useHostTransitionStatus:O0,useFormState:pE,useActionState:pE,useOptimistic:function(i,o){var c=kn();return Gt!==null?iE(c,Gt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:S0,useCacheRefresh:_E};LE.useEffectEvent=bE;function D0(i,o,c,g){o=i.memoizedState,c=c(g,o),c=c==null?o:p({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var j0={enqueueSetState:function(i,o,c){i=i._reactInternals;var g=Hr(),v=Ui(g);v.payload=o,c!=null&&(v.callback=c),o=Hi(i,v,g),o!==null&&(wr(o,i,g),Pu(o,i,g))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var g=Hr(),v=Ui(g);v.tag=1,v.payload=o,c!=null&&(v.callback=c),o=Hi(i,v,g),o!==null&&(wr(o,i,g),Pu(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=Hr(),g=Ui(c);g.tag=2,o!=null&&(g.callback=o),o=Hi(i,g,c),o!==null&&(wr(o,i,c),Pu(o,i,c))}};function DE(i,o,c,g,v,T,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,T,I):o.prototype&&o.prototype.isPureReactComponent?!_u(c,g)||!_u(v,T):!0}function jE(i,o,c,g){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,g),o.state!==i&&j0.enqueueReplaceState(o,o.state,null)}function Ya(i,o){var c=o;if("ref"in o){c={};for(var g in o)g!=="ref"&&(c[g]=o[g])}if(i=i.defaultProps){c===o&&(c=p({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function PE(i){Yd(i)}function BE(i){console.error(i)}function zE(i){Yd(i)}function gf(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function UE(i,o,c){try{var g=i.onCaughtError;g(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function P0(i,o,c){return c=Ui(c),c.tag=3,c.payload={element:null},c.callback=function(){gf(i,o)},c}function HE(i){return i=Ui(i),i.tag=3,i}function FE(i,o,c,g){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var T=g.value;i.payload=function(){return v(T)},i.callback=function(){UE(o,c,g)}}var I=c.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){UE(o,c,g),typeof v!="function"&&(Gi===null?Gi=new Set([this]):Gi.add(this));var U=g.stack;this.componentDidCatch(g.value,{componentStack:U!==null?U:""})})}function FO(i,o,c,g,v){if(c.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=c.alternate,o!==null&&rl(o,c,v,!0),c=Pr.current,c!==null){switch(c.tag){case 31:case 13:return rs===null?Af():c.alternate===null&&En===0&&(En=3),c.flags&=-257,c.flags|=65536,c.lanes=v,g===nf?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([g]):o.add(g),lg(i,g,v)),!1;case 22:return c.flags|=65536,g===nf?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([g]):c.add(g)),lg(i,g,v)),!1}throw Error(r(435,c.tag))}return lg(i,g,v),Af(),!1}if(Dt)return o=Pr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=v,g!==n0&&(i=Error(r(422),{cause:g}),Ou(Jr(i,c)))):(g!==n0&&(o=Error(r(423),{cause:g}),Ou(Jr(o,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,g=Jr(g,c),v=P0(i.stateNode,g,v),h0(i,v),En!==4&&(En=2)),!1;var T=Error(r(520),{cause:g});if(T=Jr(T,c),Qu===null?Qu=[T]:Qu.push(T),En!==4&&(En=2),o===null)return!0;g=Jr(g,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=P0(c.stateNode,g,i),h0(c,i),!1;case 1:if(o=c.type,T=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Gi===null||!Gi.has(T))))return c.flags|=65536,v&=-v,c.lanes|=v,v=HE(v),FE(v,i,c,g),h0(c,v),!1}c=c.return}while(c!==null);return!1}var B0=Error(r(461)),In=!1;function Zn(i,o,c,g){o.child=i===null?Y2(o,null,c,g):Va(o,i.child,c,g)}function $E(i,o,c,g,v){c=c.render;var T=o.ref;if("ref"in g){var I={};for(var U in g)U!=="ref"&&(I[U]=g[U])}else I=g;return Ua(o),g=y0(i,o,c,I,T,v),U=v0(),i!==null&&!In?(E0(i,o,v),si(i,o,v)):(Dt&&U&&e0(o),o.flags|=1,Zn(i,o,g,v),o.child)}function VE(i,o,c,g,v){if(i===null){var T=c.type;return typeof T=="function"&&!Qm(T)&&T.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=T,qE(i,o,T,g,v)):(i=Wd(c.type,null,g,o,o.mode,v),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,!Y0(i,v)){var I=T.memoizedProps;if(c=c.compare,c=c!==null?c:_u,c(I,g)&&i.ref===o.ref)return si(i,o,v)}return o.flags|=1,i=Zs(T,g),i.ref=o.ref,i.return=o,o.child=i}function qE(i,o,c,g,v){if(i!==null){var T=i.memoizedProps;if(_u(T,g)&&i.ref===o.ref)if(In=!1,o.pendingProps=g=T,Y0(i,v))(i.flags&131072)!==0&&(In=!0);else return o.lanes=i.lanes,si(i,o,v)}return z0(i,o,c,g,v)}function YE(i,o,c,g){var v=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|c:c,i!==null){for(g=o.child=i.child,v=0;g!==null;)v=v|g.lanes|g.childLanes,g=g.sibling;g=v&~T}else g=0,o.child=null;return GE(i,o,T,c,g)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&ef(o,T!==null?T.cachePool:null),T!==null?X2(o,T):m0(),W2(o);else return g=o.lanes=536870912,GE(i,o,T!==null?T.baseLanes|c:c,c,g)}else T!==null?(ef(o,T.cachePool),X2(o,T),$i(),o.memoizedState=null):(i!==null&&ef(o,null),m0(),$i());return Zn(i,o,v,c),o.child}function Vu(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function GE(i,o,c,g,v){var T=u0();return T=T===null?null:{parent:_n._currentValue,pool:T},o.memoizedState={baseLanes:c,cachePool:T},i!==null&&ef(o,null),m0(),W2(o),i!==null&&rl(i,o,g,!0),o.childLanes=v,null}function bf(i,o){return o=yf({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function KE(i,o,c){return Va(o,i.child,null,c),i=bf(o,o.pendingProps),i.flags|=2,Br(o),o.memoizedState=null,i}function $O(i,o,c){var g=o.pendingProps,v=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Dt){if(g.mode==="hidden")return i=bf(o,g),o.lanes=536870912,Vu(null,i);if(b0(o),(i=un)?(i=aS(i,ns),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Di!==null?{id:Rs,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},c=I2(i),c.return=o,o.child=c,Wn=o,un=null)):i=null,i===null)throw Pi(o);return o.lanes=536870912,null}return bf(o,g)}var T=i.memoizedState;if(T!==null){var I=T.dehydrated;if(b0(o),v)if(o.flags&256)o.flags&=-257,o=KE(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(In||rl(i,o,c,!1),v=(c&i.childLanes)!==0,In||v){if(g=nn,g!==null&&(I=Cn(g,c),I!==0&&I!==T.retryLane))throw T.retryLane=I,ja(i,I),wr(g,i,I),B0;Af(),o=KE(i,o,c)}else i=T.treeContext,un=ss(I.nextSibling),Wn=o,Dt=!0,ji=null,ns=!1,i!==null&&L2(o,i),o=bf(o,g),o.flags|=4096;return o}return i=Zs(i.child,{mode:g.mode,children:g.children}),i.ref=o.ref,o.child=i,i.return=o,i}function xf(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function z0(i,o,c,g,v){return Ua(o),c=y0(i,o,c,g,void 0,v),g=v0(),i!==null&&!In?(E0(i,o,v),si(i,o,v)):(Dt&&g&&e0(o),o.flags|=1,Zn(i,o,c,v),o.child)}function XE(i,o,c,g,v,T){return Ua(o),o.updateQueue=null,c=Z2(o,g,c,v),Q2(i),g=v0(),i!==null&&!In?(E0(i,o,T),si(i,o,T)):(Dt&&g&&e0(o),o.flags|=1,Zn(i,o,c,T),o.child)}function WE(i,o,c,g,v){if(Ua(o),o.stateNode===null){var T=Jo,I=c.contextType;typeof I=="object"&&I!==null&&(T=Qn(I)),T=new c(g,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=j0,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=g,T.state=o.memoizedState,T.refs={},d0(o),I=c.contextType,T.context=typeof I=="object"&&I!==null?Qn(I):Jo,T.state=o.memoizedState,I=c.getDerivedStateFromProps,typeof I=="function"&&(D0(o,c,I,g),T.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(I=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),I!==T.state&&j0.enqueueReplaceState(T,T.state,null),zu(o,g,T,v),Bu(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(i===null){T=o.stateNode;var U=o.memoizedProps,ie=Ya(c,U);T.props=ie;var be=T.context,Ne=c.contextType;I=Jo,typeof Ne=="object"&&Ne!==null&&(I=Qn(Ne));var Re=c.getDerivedStateFromProps;Ne=typeof Re=="function"||typeof T.getSnapshotBeforeUpdate=="function",U=o.pendingProps!==U,Ne||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(U||be!==I)&&jE(o,T,g,I),zi=!1;var ve=o.memoizedState;T.state=ve,zu(o,g,T,v),Bu(),be=o.memoizedState,U||ve!==be||zi?(typeof Re=="function"&&(D0(o,c,Re,g),be=o.memoizedState),(ie=zi||DE(o,c,ie,g,ve,be,I))?(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=I,g=ie):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,f0(i,o),I=o.memoizedProps,Ne=Ya(c,I),T.props=Ne,Re=o.pendingProps,ve=T.context,be=c.contextType,ie=Jo,typeof be=="object"&&be!==null&&(ie=Qn(be)),U=c.getDerivedStateFromProps,(be=typeof U=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==Re||ve!==ie)&&jE(o,T,g,ie),zi=!1,ve=o.memoizedState,T.state=ve,zu(o,g,T,v),Bu();var Se=o.memoizedState;I!==Re||ve!==Se||zi||i!==null&&i.dependencies!==null&&Zd(i.dependencies)?(typeof U=="function"&&(D0(o,c,U,g),Se=o.memoizedState),(Ne=zi||DE(o,c,Ne,g,ve,Se,ie)||i!==null&&i.dependencies!==null&&Zd(i.dependencies))?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Se,ie),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Se,ie)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||I===i.memoizedProps&&ve===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ve===i.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=Se),T.props=g,T.state=Se,T.context=ie,g=Ne):(typeof T.componentDidUpdate!="function"||I===i.memoizedProps&&ve===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ve===i.memoizedState||(o.flags|=1024),g=!1)}return T=g,xf(i,o),g=(o.flags&128)!==0,T||g?(T=o.stateNode,c=g&&typeof c.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,i!==null&&g?(o.child=Va(o,i.child,null,v),o.child=Va(o,null,c,v)):Zn(i,o,c,v),o.memoizedState=T.state,i=o.child):i=si(i,o,v),i}function QE(i,o,c,g){return Ba(),o.flags|=256,Zn(i,o,c,g),o.child}var U0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function H0(i){return{baseLanes:i,cachePool:U2()}}function F0(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=Ur),i}function ZE(i,o,c){var g=o.pendingProps,v=!1,T=(o.flags&128)!==0,I;if((I=T)||(I=i!==null&&i.memoizedState===null?!1:(wn.current&2)!==0),I&&(v=!0,o.flags&=-129),I=(o.flags&32)!==0,o.flags&=-33,i===null){if(Dt){if(v?Fi(o):$i(),(i=un)?(i=aS(i,ns),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:Di!==null?{id:Rs,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},c=I2(i),c.return=o,o.child=c,Wn=o,un=null)):i=null,i===null)throw Pi(o);return Cg(i)?o.lanes=32:o.lanes=536870912,null}var U=g.children;return g=g.fallback,v?($i(),v=o.mode,U=yf({mode:"hidden",children:U},v),g=Pa(g,v,c,null),U.return=o,g.return=o,U.sibling=g,o.child=U,g=o.child,g.memoizedState=H0(c),g.childLanes=F0(i,I,c),o.memoizedState=U0,Vu(null,g)):(Fi(o),$0(o,U))}var ie=i.memoizedState;if(ie!==null&&(U=ie.dehydrated,U!==null)){if(T)o.flags&256?(Fi(o),o.flags&=-257,o=V0(i,o,c)):o.memoizedState!==null?($i(),o.child=i.child,o.flags|=128,o=null):($i(),U=g.fallback,v=o.mode,g=yf({mode:"visible",children:g.children},v),U=Pa(U,v,c,null),U.flags|=2,g.return=o,U.return=o,g.sibling=U,o.child=g,Va(o,i.child,null,c),g=o.child,g.memoizedState=H0(c),g.childLanes=F0(i,I,c),o.memoizedState=U0,o=Vu(null,g));else if(Fi(o),Cg(U)){if(I=U.nextSibling&&U.nextSibling.dataset,I)var be=I.dgst;I=be,g=Error(r(419)),g.stack="",g.digest=I,Ou({value:g,source:null,stack:null}),o=V0(i,o,c)}else if(In||rl(i,o,c,!1),I=(c&i.childLanes)!==0,In||I){if(I=nn,I!==null&&(g=Cn(I,c),g!==0&&g!==ie.retryLane))throw ie.retryLane=g,ja(i,g),wr(I,i,g),B0;Sg(U)||Af(),o=V0(i,o,c)}else Sg(U)?(o.flags|=192,o.child=i.child,o=null):(i=ie.treeContext,un=ss(U.nextSibling),Wn=o,Dt=!0,ji=null,ns=!1,i!==null&&L2(o,i),o=$0(o,g.children),o.flags|=4096);return o}return v?($i(),U=g.fallback,v=o.mode,ie=i.child,be=ie.sibling,g=Zs(ie,{mode:"hidden",children:g.children}),g.subtreeFlags=ie.subtreeFlags&65011712,be!==null?U=Zs(be,U):(U=Pa(U,v,c,null),U.flags|=2),U.return=o,g.return=o,g.sibling=U,o.child=g,Vu(null,g),g=o.child,U=i.child.memoizedState,U===null?U=H0(c):(v=U.cachePool,v!==null?(ie=_n._currentValue,v=v.parent!==ie?{parent:ie,pool:ie}:v):v=U2(),U={baseLanes:U.baseLanes|c,cachePool:v}),g.memoizedState=U,g.childLanes=F0(i,I,c),o.memoizedState=U0,Vu(i.child,g)):(Fi(o),c=i.child,i=c.sibling,c=Zs(c,{mode:"visible",children:g.children}),c.return=o,c.sibling=null,i!==null&&(I=o.deletions,I===null?(o.deletions=[i],o.flags|=16):I.push(i)),o.child=c,o.memoizedState=null,c)}function $0(i,o){return o=yf({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function yf(i,o){return i=jr(22,i,null,o),i.lanes=0,i}function V0(i,o,c){return Va(o,i.child,null,c),i=$0(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function JE(i,o,c){i.lanes|=o;var g=i.alternate;g!==null&&(g.lanes|=o),i0(i.return,o,c)}function q0(i,o,c,g,v,T){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:c,tailMode:v,treeForkCount:T}:(I.isBackwards=o,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=c,I.tailMode=v,I.treeForkCount=T)}function eT(i,o,c){var g=o.pendingProps,v=g.revealOrder,T=g.tail;g=g.children;var I=wn.current,U=(I&2)!==0;if(U?(I=I&1|2,o.flags|=128):I&=1,L(wn,I),Zn(i,o,g,c),g=Dt?Iu:0,!U&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&JE(i,c,o);else if(i.tag===19)JE(i,c,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(v){case"forwards":for(c=o.child,v=null;c!==null;)i=c.alternate,i!==null&&of(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=o.child,o.child=null):(v=c.sibling,c.sibling=null),q0(o,!1,v,c,T,g);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=o.child,o.child=null;v!==null;){if(i=v.alternate,i!==null&&of(i)===null){o.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}q0(o,!0,c,null,T,g);break;case"together":q0(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function si(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Yi|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(rl(i,o,c,!1),(c&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,c=Zs(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Zs(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function Y0(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Zd(i)))}function VO(i,o,c){switch(o.tag){case 3:de(o,o.stateNode.containerInfo),Bi(o,_n,i.memoizedState.cache),Ba();break;case 27:case 5:Fe(o);break;case 4:de(o,o.stateNode.containerInfo);break;case 10:Bi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,b0(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(Fi(o),o.flags|=128,null):(c&o.child.childLanes)!==0?ZE(i,o,c):(Fi(o),i=si(i,o,c),i!==null?i.sibling:null);Fi(o);break;case 19:var v=(i.flags&128)!==0;if(g=(c&o.childLanes)!==0,g||(rl(i,o,c,!1),g=(c&o.childLanes)!==0),v){if(g)return eT(i,o,c);o.flags|=128}if(v=o.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),L(wn,wn.current),g)break;return null;case 22:return o.lanes=0,YE(i,o,c,o.pendingProps);case 24:Bi(o,_n,i.memoizedState.cache)}return si(i,o,c)}function tT(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)In=!0;else{if(!Y0(i,c)&&(o.flags&128)===0)return In=!1,VO(i,o,c);In=(i.flags&131072)!==0}else In=!1,Dt&&(o.flags&1048576)!==0&&M2(o,Iu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(i=Fa(o.elementType),o.type=i,typeof i=="function")Qm(i)?(g=Ya(i,g),o.tag=1,o=WE(null,o,i,g,c)):(o.tag=0,o=z0(null,o,i,g,c));else{if(i!=null){var v=i.$$typeof;if(v===_){o.tag=11,o=$E(null,o,i,g,c);break e}else if(v===j){o.tag=14,o=VE(null,o,i,g,c);break e}}throw o=ee(i)||i,Error(r(306,o,""))}}return o;case 0:return z0(i,o,o.type,o.pendingProps,c);case 1:return g=o.type,v=Ya(g,o.pendingProps),WE(i,o,g,v,c);case 3:e:{if(de(o,o.stateNode.containerInfo),i===null)throw Error(r(387));g=o.pendingProps;var T=o.memoizedState;v=T.element,f0(i,o),zu(o,g,null,c);var I=o.memoizedState;if(g=I.cache,Bi(o,_n,g),g!==T.cache&&a0(o,[_n],c,!0),Bu(),g=I.element,T.isDehydrated)if(T={element:g,isDehydrated:!1,cache:I.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=QE(i,o,g,c);break e}else if(g!==v){v=Jr(Error(r(424)),o),Ou(v),o=QE(i,o,g,c);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(un=ss(i.firstChild),Wn=o,Dt=!0,ji=null,ns=!0,c=Y2(o,null,g,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Ba(),g===v){o=si(i,o,c);break e}Zn(i,o,g,c)}o=o.child}return o;case 26:return xf(i,o),i===null?(c=fS(o.type,null,o.pendingProps,null))?o.memoizedState=c:Dt||(c=o.type,i=o.pendingProps,g=Df(ce.current).createElement(c),g[tn]=o,g[Xn]=i,Jn(g,c,i),Hn(g),o.stateNode=g):o.memoizedState=fS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Fe(o),i===null&&Dt&&(g=o.stateNode=uS(o.type,o.pendingProps,ce.current),Wn=o,ns=!0,v=un,Qi(o.type)?(wg=v,un=ss(g.firstChild)):un=v),Zn(i,o,o.pendingProps.children,c),xf(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Dt&&((v=g=un)&&(g=vM(g,o.type,o.pendingProps,ns),g!==null?(o.stateNode=g,Wn=o,un=ss(g.firstChild),ns=!1,v=!0):v=!1),v||Pi(o)),Fe(o),v=o.type,T=o.pendingProps,I=i!==null?i.memoizedProps:null,g=T.children,vg(v,T)?g=null:I!==null&&vg(v,I)&&(o.flags|=32),o.memoizedState!==null&&(v=y0(i,o,DO,null,null,c),ic._currentValue=v),xf(i,o),Zn(i,o,g,c),o.child;case 6:return i===null&&Dt&&((i=c=un)&&(c=EM(c,o.pendingProps,ns),c!==null?(o.stateNode=c,Wn=o,un=null,i=!0):i=!1),i||Pi(o)),null;case 13:return ZE(i,o,c);case 4:return de(o,o.stateNode.containerInfo),g=o.pendingProps,i===null?o.child=Va(o,null,g,c):Zn(i,o,g,c),o.child;case 11:return $E(i,o,o.type,o.pendingProps,c);case 7:return Zn(i,o,o.pendingProps,c),o.child;case 8:return Zn(i,o,o.pendingProps.children,c),o.child;case 12:return Zn(i,o,o.pendingProps.children,c),o.child;case 10:return g=o.pendingProps,Bi(o,o.type,g.value),Zn(i,o,g.children,c),o.child;case 9:return v=o.type._context,g=o.pendingProps.children,Ua(o),v=Qn(v),g=g(v),o.flags|=1,Zn(i,o,g,c),o.child;case 14:return VE(i,o,o.type,o.pendingProps,c);case 15:return qE(i,o,o.type,o.pendingProps,c);case 19:return eT(i,o,c);case 31:return $O(i,o,c);case 22:return YE(i,o,c,o.pendingProps);case 24:return Ua(o),g=Qn(_n),i===null?(v=u0(),v===null&&(v=nn,T=o0(),v.pooledCache=T,T.refCount++,T!==null&&(v.pooledCacheLanes|=c),v=T),o.memoizedState={parent:g,cache:v},d0(o),Bi(o,_n,v)):((i.lanes&c)!==0&&(f0(i,o),zu(o,null,null,c),Bu()),v=i.memoizedState,T=o.memoizedState,v.parent!==g?(v={parent:g,cache:g},o.memoizedState=v,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=v),Bi(o,_n,g)):(g=T.cache,Bi(o,_n,g),g!==v.cache&&a0(o,[_n],c,!0))),Zn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function ii(i){i.flags|=4}function G0(i,o,c,g,v){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(AT())i.flags|=8192;else throw $a=nf,c0}else i.flags&=-16777217}function nT(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!bS(o))if(AT())i.flags|=8192;else throw $a=nf,c0}function vf(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?en():536870912,i.lanes|=o,ml|=o)}function qu(i,o){if(!Dt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function cn(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,g=0;if(o)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,g|=v.subtreeFlags&65011712,g|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=g,i.childLanes=c,o}function qO(i,o,c){var g=o.pendingProps;switch(t0(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(o),null;case 1:return cn(o),null;case 3:return c=o.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),ti(_n),xe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(nl(o)?ii(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,r0())),cn(o),null;case 26:var v=o.type,T=o.memoizedState;return i===null?(ii(o),T!==null?(cn(o),nT(o,T)):(cn(o),G0(o,v,null,g,c))):T?T!==i.memoizedState?(ii(o),cn(o),nT(o,T)):(cn(o),o.flags&=-16777217):(i=i.memoizedProps,i!==g&&ii(o),cn(o),G0(o,v,i,g,c)),null;case 27:if(De(o),c=ce.current,v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&ii(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return cn(o),null}i=te.current,nl(o)?D2(o):(i=uS(v,g,c),o.stateNode=i,ii(o))}return cn(o),null;case 5:if(De(o),v=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&ii(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return cn(o),null}if(T=te.current,nl(o))D2(o);else{var I=Df(ce.current);switch(T){case 1:T=I.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:T=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":T=I.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":T=I.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":T=I.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?T.multiple=!0:g.size&&(T.size=g.size);break;default:T=typeof g.is=="string"?I.createElement(v,{is:g.is}):I.createElement(v)}}T[tn]=o,T[Xn]=g;e:for(I=o.child;I!==null;){if(I.tag===5||I.tag===6)T.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&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}o.stateNode=T;e:switch(Jn(T,v,g),v){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ii(o)}}return cn(o),G0(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==g&&ii(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(i=ce.current,nl(o)){if(i=o.stateNode,c=o.memoizedProps,g=null,v=Wn,v!==null)switch(v.tag){case 27:case 5:g=v.memoizedProps}i[tn]=o,i=!!(i.nodeValue===c||g!==null&&g.suppressHydrationWarning===!0||ZT(i.nodeValue,c)),i||Pi(o,!0)}else i=Df(i).createTextNode(g),i[tn]=o,o.stateNode=i}return cn(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(g=nl(o),c!==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[tn]=o}else Ba(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),i=!1}else c=r0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(Br(o),o):(Br(o),null);if((o.flags&128)!==0)throw Error(r(558))}return cn(o),null;case 13:if(g=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=nl(o),g!==null&&g.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=o.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[tn]=o}else Ba(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;cn(o),v=!1}else v=r0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return o.flags&256?(Br(o),o):(Br(o),null)}return Br(o),(o.flags&128)!==0?(o.lanes=c,o):(c=g!==null,i=i!==null&&i.memoizedState!==null,c&&(g=o.child,v=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(v=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==v&&(g.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),vf(o,o.updateQueue),cn(o),null);case 4:return xe(),i===null&&mg(o.stateNode.containerInfo),cn(o),null;case 10:return ti(o.type),cn(o),null;case 19:if($(wn),g=o.memoizedState,g===null)return cn(o),null;if(v=(o.flags&128)!==0,T=g.rendering,T===null)if(v)qu(g,!1);else{if(En!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(T=of(i),T!==null){for(o.flags|=128,qu(g,!1),i=T.updateQueue,o.updateQueue=i,vf(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)R2(c,i),c=c.sibling;return L(wn,wn.current&1|2),Dt&&Js(o,g.treeForkCount),o.child}i=i.sibling}g.tail!==null&&oe()>wf&&(o.flags|=128,v=!0,qu(g,!1),o.lanes=4194304)}else{if(!v)if(i=of(T),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,vf(o,i),qu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!Dt)return cn(o),null}else 2*oe()-g.renderingStartTime>wf&&c!==536870912&&(o.flags|=128,v=!0,qu(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=oe(),i.sibling=null,c=wn.current,L(wn,v?c&1|2:c&1),Dt&&Js(o,g.treeForkCount),i):(cn(o),null);case 22:case 23:return Br(o),g0(),g=o.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(c&536870912)!==0&&(o.flags&128)===0&&(cn(o),o.subtreeFlags&6&&(o.flags|=8192)):cn(o),c=o.updateQueue,c!==null&&vf(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==c&&(o.flags|=2048),i!==null&&$(Ha),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),ti(_n),cn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function YO(i,o){switch(t0(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ti(_n),xe(),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));Ba()}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));Ba()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return $(wn),null;case 4:return xe(),null;case 10:return ti(o.type),null;case 22:case 23:return Br(o),g0(),i!==null&&$(Ha),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ti(_n),null;case 25:return null;default:return null}}function rT(i,o){switch(t0(o),o.tag){case 3:ti(_n),xe();break;case 26:case 27:case 5:De(o);break;case 4:xe();break;case 31:o.memoizedState!==null&&Br(o);break;case 13:Br(o);break;case 19:$(wn);break;case 10:ti(o.type);break;case 22:case 23:Br(o),g0(),i!==null&&$(Ha);break;case 24:ti(_n)}}function Yu(i,o){try{var c=o.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var v=g.next;c=v;do{if((c.tag&i)===i){g=void 0;var T=c.create,I=c.inst;g=T(),I.destroy=g}c=c.next}while(c!==v)}}catch(U){qt(o,o.return,U)}}function Vi(i,o,c){try{var g=o.updateQueue,v=g!==null?g.lastEffect:null;if(v!==null){var T=v.next;g=T;do{if((g.tag&i)===i){var I=g.inst,U=I.destroy;if(U!==void 0){I.destroy=void 0,v=o;var ie=c,be=U;try{be()}catch(Ne){qt(v,ie,Ne)}}}g=g.next}while(g!==T)}}catch(Ne){qt(o,o.return,Ne)}}function sT(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{K2(o,c)}catch(g){qt(i,i.return,g)}}}function iT(i,o,c){c.props=Ya(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(g){qt(i,o,g)}}function Gu(i,o){try{var c=i.ref;if(c!==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 c=="function"?i.refCleanup=c(g):c.current=g}}catch(v){qt(i,o,v)}}function Os(i,o){var c=i.ref,g=i.refCleanup;if(c!==null)if(typeof g=="function")try{g()}catch(v){qt(i,o,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){qt(i,o,v)}else c.current=null}function aT(i){var o=i.type,c=i.memoizedProps,g=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&g.focus();break e;case"img":c.src?g.src=c.src:c.srcSet&&(g.srcset=c.srcSet)}}catch(v){qt(i,i.return,v)}}function K0(i,o,c){try{var g=i.stateNode;pM(g,i.type,c,o),g[Xn]=o}catch(v){qt(i,i.return,v)}}function oT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Qi(i.type)||i.tag===4}function X0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||oT(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 W0(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ws));else if(g!==4&&(g===27&&Qi(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(W0(i,o,c),i=i.sibling;i!==null;)W0(i,o,c),i=i.sibling}function Ef(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(g!==4&&(g===27&&Qi(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Ef(i,o,c),i=i.sibling;i!==null;)Ef(i,o,c),i=i.sibling}function lT(i){var o=i.stateNode,c=i.memoizedProps;try{for(var g=i.type,v=o.attributes;v.length;)o.removeAttributeNode(v[0]);Jn(o,g,c),o[tn]=i,o[Xn]=c}catch(T){qt(i,i.return,T)}}var ai=!1,On=!1,Q0=!1,uT=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function GO(i,o){if(i=i.containerInfo,xg=Ff,i=E2(i),Vm(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var g=c.getSelection&&c.getSelection();if(g&&g.rangeCount!==0){c=g.anchorNode;var v=g.anchorOffset,T=g.focusNode;g=g.focusOffset;try{c.nodeType,T.nodeType}catch{c=null;break e}var I=0,U=-1,ie=-1,be=0,Ne=0,Re=i,ve=null;t:for(;;){for(var Se;Re!==c||v!==0&&Re.nodeType!==3||(U=I+v),Re!==T||g!==0&&Re.nodeType!==3||(ie=I+g),Re.nodeType===3&&(I+=Re.nodeValue.length),(Se=Re.firstChild)!==null;)ve=Re,Re=Se;for(;;){if(Re===i)break t;if(ve===c&&++be===v&&(U=I),ve===T&&++Ne===g&&(ie=I),(Se=Re.nextSibling)!==null)break;Re=ve,ve=Re.parentNode}Re=Se}c=U===-1||ie===-1?null:{start:U,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(yg={focusedElem:i,selectionRange:c},Ff=!1,Fn=o;Fn!==null;)if(o=Fn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Fn=i;else for(;Fn!==null;){switch(o=Fn,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(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&T!==null){i=void 0,c=o,v=T.memoizedProps,T=T.memoizedState,g=c.stateNode;try{var et=Ya(c.type,v);i=g.getSnapshotBeforeUpdate(et,T),g.__reactInternalSnapshotBeforeUpdate=i}catch(ot){qt(c,c.return,ot)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Tg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Tg(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,Fn=i;break}Fn=o.return}}function cT(i,o,c){var g=c.flags;switch(c.tag){case 0:case 11:case 15:li(i,c),g&4&&Yu(5,c);break;case 1:if(li(i,c),g&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(I){qt(c,c.return,I)}else{var v=Ya(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(v,o,i.__reactInternalSnapshotBeforeUpdate)}catch(I){qt(c,c.return,I)}}g&64&&sT(c),g&512&&Gu(c,c.return);break;case 3:if(li(i,c),g&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{K2(i,o)}catch(I){qt(c,c.return,I)}}break;case 27:o===null&&g&4&&lT(c);case 26:case 5:li(i,c),o===null&&g&4&&aT(c),g&512&&Gu(c,c.return);break;case 12:li(i,c);break;case 31:li(i,c),g&4&&hT(i,c);break;case 13:li(i,c),g&4&&pT(i,c),g&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=nM.bind(null,c),TM(i,c))));break;case 22:if(g=c.memoizedState!==null||ai,!g){o=o!==null&&o.memoizedState!==null||On,v=ai;var T=On;ai=g,(On=o)&&!T?ui(i,c,(c.subtreeFlags&8772)!==0):li(i,c),ai=v,On=T}break;case 30:break;default:li(i,c)}}function dT(i){var o=i.alternate;o!==null&&(i.alternate=null,dT(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Nm(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 hn=null,Er=!1;function oi(i,o,c){for(c=c.child;c!==null;)fT(i,o,c),c=c.sibling}function fT(i,o,c){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(We,c)}catch{}switch(c.tag){case 26:On||Os(c,o),oi(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:On||Os(c,o);var g=hn,v=Er;Qi(c.type)&&(hn=c.stateNode,Er=!1),oi(i,o,c),nc(c.stateNode),hn=g,Er=v;break;case 5:On||Os(c,o);case 6:if(g=hn,v=Er,hn=null,oi(i,o,c),hn=g,Er=v,hn!==null)if(Er)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(c.stateNode)}catch(T){qt(c,o,T)}else try{hn.removeChild(c.stateNode)}catch(T){qt(c,o,T)}break;case 18:hn!==null&&(Er?(i=hn,sS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Sl(i)):sS(hn,c.stateNode));break;case 4:g=hn,v=Er,hn=c.stateNode.containerInfo,Er=!0,oi(i,o,c),hn=g,Er=v;break;case 0:case 11:case 14:case 15:Vi(2,c,o),On||Vi(4,c,o),oi(i,o,c);break;case 1:On||(Os(c,o),g=c.stateNode,typeof g.componentWillUnmount=="function"&&iT(c,o,g)),oi(i,o,c);break;case 21:oi(i,o,c);break;case 22:On=(g=On)||c.memoizedState!==null,oi(i,o,c),On=g;break;default:oi(i,o,c)}}function hT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Sl(i)}catch(c){qt(o,o.return,c)}}}function pT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Sl(i)}catch(c){qt(o,o.return,c)}}function KO(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new uT),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new uT),o;default:throw Error(r(435,i.tag))}}function Tf(i,o){var c=KO(i);o.forEach(function(g){if(!c.has(g)){c.add(g);var v=rM.bind(null,i,g);g.then(v,v)}})}function Tr(i,o){var c=o.deletions;if(c!==null)for(var g=0;g<c.length;g++){var v=c[g],T=i,I=o,U=I;e:for(;U!==null;){switch(U.tag){case 27:if(Qi(U.type)){hn=U.stateNode,Er=!1;break e}break;case 5:hn=U.stateNode,Er=!1;break e;case 3:case 4:hn=U.stateNode.containerInfo,Er=!0;break e}U=U.return}if(hn===null)throw Error(r(160));fT(T,I,v),hn=null,Er=!1,T=v.alternate,T!==null&&(T.return=null),v.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)mT(o,i),o=o.sibling}var xs=null;function mT(i,o){var c=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Tr(o,i),Sr(i),g&4&&(Vi(3,i,i.return),Yu(3,i),Vi(5,i,i.return));break;case 1:Tr(o,i),Sr(i),g&512&&(On||c===null||Os(c,c.return)),g&64&&ai&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?g:c.concat(g))));break;case 26:var v=xs;if(Tr(o,i),Sr(i),g&512&&(On||c===null||Os(c,c.return)),g&4){var T=c!==null?c.memoizedState:null;if(g=i.memoizedState,c===null)if(g===null)if(i.stateNode===null){e:{g=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(g){case"title":T=v.getElementsByTagName("title")[0],(!T||T[vu]||T[tn]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=v.createElement(g),v.head.insertBefore(T,v.querySelector("head > title"))),Jn(T,g,c),T[tn]=i,Hn(T),g=T;break e;case"link":var I=mS("link","href",v).get(g+(c.href||""));if(I){for(var U=0;U<I.length;U++)if(T=I[U],T.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&T.getAttribute("rel")===(c.rel==null?null:c.rel)&&T.getAttribute("title")===(c.title==null?null:c.title)&&T.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){I.splice(U,1);break t}}T=v.createElement(g),Jn(T,g,c),v.head.appendChild(T);break;case"meta":if(I=mS("meta","content",v).get(g+(c.content||""))){for(U=0;U<I.length;U++)if(T=I[U],T.getAttribute("content")===(c.content==null?null:""+c.content)&&T.getAttribute("name")===(c.name==null?null:c.name)&&T.getAttribute("property")===(c.property==null?null:c.property)&&T.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&T.getAttribute("charset")===(c.charSet==null?null:c.charSet)){I.splice(U,1);break t}}T=v.createElement(g),Jn(T,g,c),v.head.appendChild(T);break;default:throw Error(r(468,g))}T[tn]=i,Hn(T),g=T}i.stateNode=g}else gS(v,i.type,i.stateNode);else i.stateNode=pS(v,g,i.memoizedProps);else T!==g?(T===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):T.count--,g===null?gS(v,i.type,i.stateNode):pS(v,g,i.memoizedProps)):g===null&&i.stateNode!==null&&K0(i,i.memoizedProps,c.memoizedProps)}break;case 27:Tr(o,i),Sr(i),g&512&&(On||c===null||Os(c,c.return)),c!==null&&g&4&&K0(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Tr(o,i),Sr(i),g&512&&(On||c===null||Os(c,c.return)),i.flags&32){v=i.stateNode;try{Yo(v,"")}catch(et){qt(i,i.return,et)}}g&4&&i.stateNode!=null&&(v=i.memoizedProps,K0(i,v,c!==null?c.memoizedProps:v)),g&1024&&(Q0=!0);break;case 6:if(Tr(o,i),Sr(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,c=i.stateNode;try{c.nodeValue=g}catch(et){qt(i,i.return,et)}}break;case 3:if(Bf=null,v=xs,xs=jf(o.containerInfo),Tr(o,i),xs=v,Sr(i),g&4&&c!==null&&c.memoizedState.isDehydrated)try{Sl(o.containerInfo)}catch(et){qt(i,i.return,et)}Q0&&(Q0=!1,gT(i));break;case 4:g=xs,xs=jf(i.stateNode.containerInfo),Tr(o,i),Sr(i),xs=g;break;case 12:Tr(o,i),Sr(i);break;case 31:Tr(o,i),Sr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 13:Tr(o,i),Sr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Cf=oe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 22:v=i.memoizedState!==null;var ie=c!==null&&c.memoizedState!==null,be=ai,Ne=On;if(ai=be||v,On=Ne||ie,Tr(o,i),On=Ne,ai=be,Sr(i),g&8192)e:for(o=i.stateNode,o._visibility=v?o._visibility&-2:o._visibility|1,v&&(c===null||ie||ai||On||Ga(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){ie=c=o;try{if(T=ie.stateNode,v)I=T.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{U=ie.stateNode;var Re=ie.memoizedProps.style,ve=Re!=null&&Re.hasOwnProperty("display")?Re.display:null;U.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(et){qt(ie,ie.return,et)}}}else if(o.tag===6){if(c===null){ie=o;try{ie.stateNode.nodeValue=v?"":ie.memoizedProps}catch(et){qt(ie,ie.return,et)}}}else if(o.tag===18){if(c===null){ie=o;try{var Se=ie.stateNode;v?iS(Se,!0):iS(ie.stateNode,!1)}catch(et){qt(ie,ie.return,et)}}}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;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=i.updateQueue,g!==null&&(c=g.retryQueue,c!==null&&(g.retryQueue=null,Tf(i,c))));break;case 19:Tr(o,i),Sr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Tf(i,g)));break;case 30:break;case 21:break;default:Tr(o,i),Sr(i)}}function Sr(i){var o=i.flags;if(o&2){try{for(var c,g=i.return;g!==null;){if(oT(g)){c=g;break}g=g.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,T=X0(i);Ef(i,T,v);break;case 5:var I=c.stateNode;c.flags&32&&(Yo(I,""),c.flags&=-33);var U=X0(i);Ef(i,U,I);break;case 3:case 4:var ie=c.stateNode.containerInfo,be=X0(i);W0(i,be,ie);break;default:throw Error(r(161))}}catch(Ne){qt(i,i.return,Ne)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function gT(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;gT(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function li(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)cT(i,o.alternate,o),o=o.sibling}function Ga(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Vi(4,o,o.return),Ga(o);break;case 1:Os(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&iT(o,o.return,c),Ga(o);break;case 27:nc(o.stateNode);case 26:case 5:Os(o,o.return),Ga(o);break;case 22:o.memoizedState===null&&Ga(o);break;case 30:Ga(o);break;default:Ga(o)}i=i.sibling}}function ui(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,v=i,T=o,I=T.flags;switch(T.tag){case 0:case 11:case 15:ui(v,T,c),Yu(4,T);break;case 1:if(ui(v,T,c),g=T,v=g.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(be){qt(g,g.return,be)}if(g=T,v=g.updateQueue,v!==null){var U=g.stateNode;try{var ie=v.shared.hiddenCallbacks;if(ie!==null)for(v.shared.hiddenCallbacks=null,v=0;v<ie.length;v++)G2(ie[v],U)}catch(be){qt(g,g.return,be)}}c&&I&64&&sT(T),Gu(T,T.return);break;case 27:lT(T);case 26:case 5:ui(v,T,c),c&&g===null&&I&4&&aT(T),Gu(T,T.return);break;case 12:ui(v,T,c);break;case 31:ui(v,T,c),c&&I&4&&hT(v,T);break;case 13:ui(v,T,c),c&&I&4&&pT(v,T);break;case 22:T.memoizedState===null&&ui(v,T,c),Gu(T,T.return);break;case 30:break;default:ui(v,T,c)}o=o.sibling}}function Z0(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&Mu(c))}function J0(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Mu(i))}function ys(i,o,c,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)bT(i,o,c,g),o=o.sibling}function bT(i,o,c,g){var v=o.flags;switch(o.tag){case 0:case 11:case 15:ys(i,o,c,g),v&2048&&Yu(9,o);break;case 1:ys(i,o,c,g);break;case 3:ys(i,o,c,g),v&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Mu(i)));break;case 12:if(v&2048){ys(i,o,c,g),i=o.stateNode;try{var T=o.memoizedProps,I=T.id,U=T.onPostCommit;typeof U=="function"&&U(I,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ie){qt(o,o.return,ie)}}else ys(i,o,c,g);break;case 31:ys(i,o,c,g);break;case 13:ys(i,o,c,g);break;case 23:break;case 22:T=o.stateNode,I=o.alternate,o.memoizedState!==null?T._visibility&2?ys(i,o,c,g):Ku(i,o):T._visibility&2?ys(i,o,c,g):(T._visibility|=2,fl(i,o,c,g,(o.subtreeFlags&10256)!==0||!1)),v&2048&&Z0(I,o);break;case 24:ys(i,o,c,g),v&2048&&J0(o.alternate,o);break;default:ys(i,o,c,g)}}function fl(i,o,c,g,v){for(v=v&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=i,I=o,U=c,ie=g,be=I.flags;switch(I.tag){case 0:case 11:case 15:fl(T,I,U,ie,v),Yu(8,I);break;case 23:break;case 22:var Ne=I.stateNode;I.memoizedState!==null?Ne._visibility&2?fl(T,I,U,ie,v):Ku(T,I):(Ne._visibility|=2,fl(T,I,U,ie,v)),v&&be&2048&&Z0(I.alternate,I);break;case 24:fl(T,I,U,ie,v),v&&be&2048&&J0(I.alternate,I);break;default:fl(T,I,U,ie,v)}o=o.sibling}}function Ku(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,g=o,v=g.flags;switch(g.tag){case 22:Ku(c,g),v&2048&&Z0(g.alternate,g);break;case 24:Ku(c,g),v&2048&&J0(g.alternate,g);break;default:Ku(c,g)}o=o.sibling}}var Xu=8192;function hl(i,o,c){if(i.subtreeFlags&Xu)for(i=i.child;i!==null;)xT(i,o,c),i=i.sibling}function xT(i,o,c){switch(i.tag){case 26:hl(i,o,c),i.flags&Xu&&i.memoizedState!==null&&LM(c,xs,i.memoizedState,i.memoizedProps);break;case 5:hl(i,o,c);break;case 3:case 4:var g=xs;xs=jf(i.stateNode.containerInfo),hl(i,o,c),xs=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=Xu,Xu=16777216,hl(i,o,c),Xu=g):hl(i,o,c));break;default:hl(i,o,c)}}function yT(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 Wu(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];Fn=g,ET(g,i)}yT(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)vT(i),i=i.sibling}function vT(i){switch(i.tag){case 0:case 11:case 15:Wu(i),i.flags&2048&&Vi(9,i,i.return);break;case 3:Wu(i);break;case 12:Wu(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Sf(i)):Wu(i);break;default:Wu(i)}}function Sf(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];Fn=g,ET(g,i)}yT(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Vi(8,o,o.return),Sf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Sf(o));break;default:Sf(o)}i=i.sibling}}function ET(i,o){for(;Fn!==null;){var c=Fn;switch(c.tag){case 0:case 11:case 15:Vi(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var g=c.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Mu(c.memoizedState.cache)}if(g=c.child,g!==null)g.return=c,Fn=g;else e:for(c=i;Fn!==null;){g=Fn;var v=g.sibling,T=g.return;if(dT(g),g===c){Fn=null;break e}if(v!==null){v.return=T,Fn=v;break e}Fn=T}}}var XO={getCacheForType:function(i){var o=Qn(_n),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return Qn(_n).controller.signal}},WO=typeof WeakMap=="function"?WeakMap:Map,Ft=0,nn=null,kt=null,Ot=0,Vt=0,zr=null,qi=!1,pl=!1,eg=!1,ci=0,En=0,Yi=0,Ka=0,tg=0,Ur=0,ml=0,Qu=null,Cr=null,ng=!1,Cf=0,TT=0,wf=1/0,kf=null,Gi=null,Pn=0,Ki=null,gl=null,di=0,rg=0,sg=null,ST=null,Zu=0,ig=null;function Hr(){return(Ft&2)!==0&&Ot!==0?Ot&-Ot:z.T!==null?dg():yn()}function CT(){if(Ur===0)if((Ot&536870912)===0||Dt){var i=Zt;Zt<<=1,(Zt&3932160)===0&&(Zt=262144),Ur=i}else Ur=536870912;return i=Pr.current,i!==null&&(i.flags|=32),Ur}function wr(i,o,c){(i===nn&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)&&(bl(i,0),Xi(i,Ot,Ur,!1)),vt(i,c),((Ft&2)===0||i!==nn)&&(i===nn&&((Ft&2)===0&&(Ka|=c),En===4&&Xi(i,Ot,Ur,!1)),Ms(i))}function wT(i,o,c){if((Ft&6)!==0)throw Error(r(327));var g=!c&&(o&127)===0&&(o&i.expiredLanes)===0||yt(i,o),v=g?JO(i,o):og(i,o,!0),T=g;do{if(v===0){pl&&!g&&Xi(i,o,0,!1);break}else{if(c=i.current.alternate,T&&!QO(c)){v=og(i,o,!1),T=!1;continue}if(v===2){if(T=o,i.errorRecoveryDisabledLanes&T)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){o=I;e:{var U=i;v=Qu;var ie=U.current.memoizedState.isDehydrated;if(ie&&(bl(U,I).flags|=256),I=og(U,I,!1),I!==2){if(eg&&!ie){U.errorRecoveryDisabledLanes|=T,Ka|=T,v=4;break e}T=Cr,Cr=v,T!==null&&(Cr===null?Cr=T:Cr.push.apply(Cr,T))}v=I}if(T=!1,v!==2)continue}}if(v===1){bl(i,0),Xi(i,o,0,!0);break}e:{switch(g=i,T=v,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Xi(g,o,Ur,!qi);break e;case 2:Cr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(v=Cf+300-oe(),10<v)){if(Xi(g,o,Ur,!qi),Qe(g,0,!0)!==0)break e;di=o,g.timeoutHandle=nS(kT.bind(null,g,c,Cr,kf,ng,o,Ur,Ka,ml,qi,T,"Throttled",-0,0),v);break e}kT(g,c,Cr,kf,ng,o,Ur,Ka,ml,qi,T,null,-0,0)}}break}while(!0);Ms(i)}function kT(i,o,c,g,v,T,I,U,ie,be,Ne,Re,ve,Se){if(i.timeoutHandle=-1,Re=o.subtreeFlags,Re&8192||(Re&16785408)===16785408){Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ws},xT(o,T,Re);var et=(T&62914560)===T?Cf-oe():(T&4194048)===T?TT-oe():0;if(et=DM(Re,et),et!==null){di=T,i.cancelPendingCommit=et(LT.bind(null,i,o,T,c,g,v,I,U,ie,Ne,Re,null,ve,Se)),Xi(i,T,I,!be);return}}LT(i,o,T,c,g,v,I,U,ie)}function QO(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var g=0;g<c.length;g++){var v=c[g],T=v.getSnapshot;v=v.value;try{if(!Dr(T(),v))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;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 Xi(i,o,c,g){o&=~tg,o&=~Ka,i.suspendedLanes|=o,i.pingedLanes&=~o,g&&(i.warmLanes|=o),g=i.expirationTimes;for(var v=o;0<v;){var T=31-Ge(v),I=1<<T;g[T]=-1,v&=~I}c!==0&&yr(i,c,o)}function Nf(){return(Ft&6)===0?(Ju(0),!1):!0}function ag(){if(kt!==null){if(Vt===0)var i=kt.return;else i=kt,ei=za=null,T0(i),ol=null,Du=0,i=kt;for(;i!==null;)rT(i.alternate,i),i=i.return;kt=null}}function bl(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,bM(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),di=0,ag(),nn=i,kt=c=Zs(i.current,null),Ot=o,Vt=0,zr=null,qi=!1,pl=yt(i,o),eg=!1,ml=Ur=tg=Ka=Yi=En=0,Cr=Qu=null,ng=!1,(o&8)!==0&&(o|=o&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=o;0<g;){var v=31-Ge(g),T=1<<v;o|=i[v],g&=~T}return ci=o,Gd(),c}function NT(i,o){bt=null,z.H=$u,o===al||o===tf?(o=$2(),Vt=3):o===c0?(o=$2(),Vt=4):Vt=o===B0?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,zr=o,kt===null&&(En=1,gf(i,Jr(o,i.current)))}function AT(){var i=Pr.current;return i===null?!0:(Ot&4194048)===Ot?rs===null:(Ot&62914560)===Ot||(Ot&536870912)!==0?i===rs:!1}function _T(){var i=z.H;return z.H=$u,i===null?$u:i}function RT(){var i=z.A;return z.A=XO,i}function Af(){En=4,qi||(Ot&4194048)!==Ot&&Pr.current!==null||(pl=!0),(Yi&134217727)===0&&(Ka&134217727)===0||nn===null||Xi(nn,Ot,Ur,!1)}function og(i,o,c){var g=Ft;Ft|=2;var v=_T(),T=RT();(nn!==i||Ot!==o)&&(kf=null,bl(i,o)),o=!1;var I=En;e:do try{if(Vt!==0&&kt!==null){var U=kt,ie=zr;switch(Vt){case 8:ag(),I=6;break e;case 3:case 2:case 9:case 6:Pr.current===null&&(o=!0);var be=Vt;if(Vt=0,zr=null,xl(i,U,ie,be),c&&pl){I=0;break e}break;default:be=Vt,Vt=0,zr=null,xl(i,U,ie,be)}}ZO(),I=En;break}catch(Ne){NT(i,Ne)}while(!0);return o&&i.shellSuspendCounter++,ei=za=null,Ft=g,z.H=v,z.A=T,kt===null&&(nn=null,Ot=0,Gd()),I}function ZO(){for(;kt!==null;)IT(kt)}function JO(i,o){var c=Ft;Ft|=2;var g=_T(),v=RT();nn!==i||Ot!==o?(kf=null,wf=oe()+500,bl(i,o)):pl=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,xl(i,o,T,1);break;case 2:case 9:if(H2(T)){Vt=0,zr=null,OT(o);break}o=function(){Vt!==2&&Vt!==9||nn!==i||(Vt=7),Ms(i)},T.then(o,o);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:H2(T)?(Vt=0,zr=null,OT(o)):(Vt=0,zr=null,xl(i,o,T,7));break;case 5:var I=null;switch(kt.tag){case 26:I=kt.memoizedState;case 5:case 27:var U=kt;if(I?bS(I):U.stateNode.complete){Vt=0,zr=null;var ie=U.sibling;if(ie!==null)kt=ie;else{var be=U.return;be!==null?(kt=be,_f(be)):kt=null}break t}}Vt=0,zr=null,xl(i,o,T,5);break;case 6:Vt=0,zr=null,xl(i,o,T,6);break;case 8:ag(),En=6;break e;default:throw Error(r(462))}}eM();break}catch(Ne){NT(i,Ne)}while(!0);return ei=za=null,z.H=g,z.A=v,Ft=c,kt!==null?0:(nn=null,Ot=0,Gd(),En)}function eM(){for(;kt!==null&&!J();)IT(kt)}function IT(i){var o=tT(i.alternate,i,ci);i.memoizedProps=i.pendingProps,o===null?_f(i):kt=o}function OT(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=XE(c,o,o.pendingProps,o.type,void 0,Ot);break;case 11:o=XE(c,o,o.pendingProps,o.type.render,o.ref,Ot);break;case 5:T0(o);default:rT(c,o),o=kt=R2(o,ci),o=tT(c,o,ci)}i.memoizedProps=i.pendingProps,o===null?_f(i):kt=o}function xl(i,o,c,g){ei=za=null,T0(o),ol=null,Du=0;var v=o.return;try{if(FO(i,v,o,c,Ot)){En=1,gf(i,Jr(c,i.current)),kt=null;return}}catch(T){if(v!==null)throw kt=v,T;En=1,gf(i,Jr(c,i.current)),kt=null;return}o.flags&32768?(Dt||g===1?i=!0:pl||(Ot&536870912)!==0?i=!1:(qi=i=!0,(g===2||g===9||g===3||g===6)&&(g=Pr.current,g!==null&&g.tag===13&&(g.flags|=16384))),MT(o,i)):_f(o)}function _f(i){var o=i;do{if((o.flags&32768)!==0){MT(o,qi);return}i=o.return;var c=qO(o.alternate,o,ci);if(c!==null){kt=c;return}if(o=o.sibling,o!==null){kt=o;return}kt=o=i}while(o!==null);En===0&&(En=5)}function MT(i,o){do{var c=YO(i.alternate,i);if(c!==null){c.flags&=32767,kt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){kt=i;return}kt=i=c}while(i!==null);En=6,kt=null}function LT(i,o,c,g,v,T,I,U,ie){i.cancelPendingCommit=null;do Rf();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|=Xm,ln(i,c,T,I,U,ie),i===nn&&(kt=nn=null,Ot=0),gl=o,Ki=i,di=c,rg=T,sg=v,ST=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,sM(le,function(){return zT(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,v=G.p,G.p=2,I=Ft,Ft|=4;try{GO(i,o,c)}finally{Ft=I,G.p=v,z.T=g}}Pn=1,DT(),jT(),PT()}}function DT(){if(Pn===1){Pn=0;var i=Ki,o=gl,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null;var g=G.p;G.p=2;var v=Ft;Ft|=4;try{mT(o,i);var T=yg,I=E2(i.containerInfo),U=T.focusedElem,ie=T.selectionRange;if(I!==U&&U&&U.ownerDocument&&v2(U.ownerDocument.documentElement,U)){if(ie!==null&&Vm(U)){var be=ie.start,Ne=ie.end;if(Ne===void 0&&(Ne=be),"selectionStart"in U)U.selectionStart=be,U.selectionEnd=Math.min(Ne,U.value.length);else{var Re=U.ownerDocument||document,ve=Re&&Re.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),et=U.textContent.length,ot=Math.min(ie.start,et),Xt=ie.end===void 0?ot:Math.min(ie.end,et);!Se.extend&&ot>Xt&&(I=Xt,Xt=ot,ot=I);var he=y2(U,ot),ue=y2(U,Xt);if(he&&ue&&(Se.rangeCount!==1||Se.anchorNode!==he.node||Se.anchorOffset!==he.offset||Se.focusNode!==ue.node||Se.focusOffset!==ue.offset)){var ge=Re.createRange();ge.setStart(he.node,he.offset),Se.removeAllRanges(),ot>Xt?(Se.addRange(ge),Se.extend(ue.node,ue.offset)):(ge.setEnd(ue.node,ue.offset),Se.addRange(ge))}}}}for(Re=[],Se=U;Se=Se.parentNode;)Se.nodeType===1&&Re.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<Re.length;U++){var Ae=Re[U];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Ff=!!xg,yg=xg=null}finally{Ft=v,G.p=g,z.T=c}}i.current=o,Pn=2}}function jT(){if(Pn===2){Pn=0;var i=Ki,o=gl,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=z.T,z.T=null;var g=G.p;G.p=2;var v=Ft;Ft|=4;try{cT(i,o.alternate,o)}finally{Ft=v,G.p=g,z.T=c}}Pn=3}}function PT(){if(Pn===4||Pn===3){Pn=0,pe();var i=Ki,o=gl,c=di,g=ST;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,gl=Ki=null,BT(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(Gi=null),It(c),o=o.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(We,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=z.T,v=G.p,G.p=2,z.T=null;try{for(var T=i.onRecoverableError,I=0;I<g.length;I++){var U=g[I];T(U.value,{componentStack:U.stack})}}finally{z.T=o,G.p=v}}(di&3)!==0&&Rf(),Ms(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===ig?Zu++:(Zu=0,ig=i):Zu=0,Ju(0)}}function BT(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Mu(o)))}function Rf(){return DT(),jT(),PT(),zT()}function zT(){if(Pn!==5)return!1;var i=Ki,o=rg;rg=0;var c=It(di),g=z.T,v=G.p;try{G.p=32>c?32:c,z.T=null,c=sg,sg=null;var T=Ki,I=di;if(Pn=0,gl=Ki=null,di=0,(Ft&6)!==0)throw Error(r(331));var U=Ft;if(Ft|=4,vT(T.current),bT(T,T.current,I,c),Ft=U,Ju(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(We,T)}catch{}return!0}finally{G.p=v,z.T=g,BT(i,o)}}function UT(i,o,c){o=Jr(c,o),o=P0(i.stateNode,o,2),i=Hi(i,o,2),i!==null&&(vt(i,2),Ms(i))}function qt(i,o,c){if(i.tag===3)UT(i,i,c);else for(;o!==null;){if(o.tag===3){UT(o,i,c);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Gi===null||!Gi.has(g))){i=Jr(c,i),c=HE(2),g=Hi(o,c,2),g!==null&&(FE(c,g,o,i),vt(g,2),Ms(g));break}}o=o.return}}function lg(i,o,c){var g=i.pingCache;if(g===null){g=i.pingCache=new WO;var v=new Set;g.set(o,v)}else v=g.get(o),v===void 0&&(v=new Set,g.set(o,v));v.has(c)||(eg=!0,v.add(c),i=tM.bind(null,i,o,c),o.then(i,i))}function tM(i,o,c){var g=i.pingCache;g!==null&&g.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,nn===i&&(Ot&c)===c&&(En===4||En===3&&(Ot&62914560)===Ot&&300>oe()-Cf?(Ft&2)===0&&bl(i,0):tg|=c,ml===Ot&&(ml=0)),Ms(i)}function HT(i,o){o===0&&(o=en()),i=ja(i,o),i!==null&&(vt(i,o),Ms(i))}function nM(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),HT(i,c)}function rM(i,o){var c=0;switch(i.tag){case 31:case 13:var g=i.stateNode,v=i.memoizedState;v!==null&&(c=v.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),HT(i,c)}function sM(i,o){return Ie(i,o)}var If=null,yl=null,ug=!1,Of=!1,cg=!1,Wi=0;function Ms(i){i!==yl&&i.next===null&&(yl===null?If=yl=i:yl=yl.next=i),Of=!0,ug||(ug=!0,aM())}function Ju(i,o){if(!cg&&Of){cg=!0;do for(var c=!1,g=If;g!==null;){if(i!==0){var v=g.pendingLanes;if(v===0)var T=0;else{var I=g.suspendedLanes,U=g.pingedLanes;T=(1<<31-Ge(42|i)+1)-1,T&=v&~(I&~U),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(c=!0,qT(g,T))}else T=Ot,T=Qe(g,g===nn?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(T&3)===0||yt(g,T)||(c=!0,qT(g,T));g=g.next}while(c);cg=!1}}function iM(){FT()}function FT(){Of=ug=!1;var i=0;Wi!==0&&gM()&&(i=Wi);for(var o=oe(),c=null,g=If;g!==null;){var v=g.next,T=$T(g,o);T===0?(g.next=null,c===null?If=v:c.next=v,v===null&&(yl=c)):(c=g,(i!==0||(T&3)!==0)&&(Of=!0)),g=v}Pn!==0&&Pn!==5||Ju(i),Wi!==0&&(Wi=0)}function $T(i,o){for(var c=i.suspendedLanes,g=i.pingedLanes,v=i.expirationTimes,T=i.pendingLanes&-62914561;0<T;){var I=31-Ge(T),U=1<<I,ie=v[I];ie===-1?((U&c)===0||(U&g)!==0)&&(v[I]=Ht(U,o)):ie<=o&&(i.expiredLanes|=U),T&=~U}if(o=nn,c=Ot,c=Qe(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,c===0||i===o&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&je(g),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||yt(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(g!==null&&je(g),It(c)){case 2:case 8:c=F;break;case 32:c=le;break;case 268435456:c=_e;break;default:c=le}return g=VT.bind(null,i),c=Ie(c,g),i.callbackPriority=o,i.callbackNode=c,o}return g!==null&&g!==null&&je(g),i.callbackPriority=2,i.callbackNode=null,2}function VT(i,o){if(Pn!==0&&Pn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(Rf()&&i.callbackNode!==c)return null;var g=Ot;return g=Qe(i,i===nn?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(wT(i,g,o),$T(i,oe()),i.callbackNode!=null&&i.callbackNode===c?VT.bind(null,i):null)}function qT(i,o){if(Rf())return null;wT(i,o,!0)}function aM(){xM(function(){(Ft&6)!==0?Ie(K,iM):FT()})}function dg(){if(Wi===0){var i=sl;i===0&&(i=Lt,Lt<<=1,(Lt&261888)===0&&(Lt=256)),Wi=i}return Wi}function YT(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:zd(""+i)}function GT(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function oM(i,o,c,g,v){if(o==="submit"&&c&&c.stateNode===v){var T=YT((v[Xn]||null).action),I=g.submitter;I&&(o=(o=I[Xn]||null)?YT(o.formAction):I.getAttribute("formAction"),o!==null&&(T=o,I=null));var U=new $d("action","action",null,g,v);i.push({event:U,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Wi!==0){var ie=I?GT(v,I):new FormData(v);I0(c,{pending:!0,data:ie,method:v.method,action:T},null,ie)}}else typeof T=="function"&&(U.preventDefault(),ie=I?GT(v,I):new FormData(v),I0(c,{pending:!0,data:ie,method:v.method,action:T},T,ie))},currentTarget:v}]})}}for(var fg=0;fg<Km.length;fg++){var hg=Km[fg],lM=hg.toLowerCase(),uM=hg[0].toUpperCase()+hg.slice(1);bs(lM,"on"+uM)}bs(C2,"onAnimationEnd"),bs(w2,"onAnimationIteration"),bs(k2,"onAnimationStart"),bs("dblclick","onDoubleClick"),bs("focusin","onFocus"),bs("focusout","onBlur"),bs(wO,"onTransitionRun"),bs(kO,"onTransitionStart"),bs(NO,"onTransitionCancel"),bs(N2,"onTransitionEnd"),Vo("onMouseEnter",["mouseout","mouseover"]),Vo("onMouseLeave",["mouseout","mouseover"]),Vo("onPointerEnter",["pointerout","pointerover"]),Vo("onPointerLeave",["pointerout","pointerover"]),Oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ec="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(" "),cM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ec));function KT(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var g=i[c],v=g.event;g=g.listeners;e:{var T=void 0;if(o)for(var I=g.length-1;0<=I;I--){var U=g[I],ie=U.instance,be=U.currentTarget;if(U=U.listener,ie!==T&&v.isPropagationStopped())break e;T=U,v.currentTarget=be;try{T(v)}catch(Ne){Yd(Ne)}v.currentTarget=null,T=ie}else for(I=0;I<g.length;I++){if(U=g[I],ie=U.instance,be=U.currentTarget,U=U.listener,ie!==T&&v.isPropagationStopped())break e;T=U,v.currentTarget=be;try{T(v)}catch(Ne){Yd(Ne)}v.currentTarget=null,T=ie}}}}function Nt(i,o){var c=o[yu];c===void 0&&(c=o[yu]=new Set);var g=i+"__bubble";c.has(g)||(XT(o,i,2,!1),c.add(g))}function pg(i,o,c){var g=0;o&&(g|=4),XT(c,i,g,o)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function mg(i){if(!i[Mf]){i[Mf]=!0,Fv.forEach(function(c){c!=="selectionchange"&&(cM.has(c)||pg(c,!1,i),pg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Mf]||(o[Mf]=!0,pg("selectionchange",!1,o))}}function XT(i,o,c,g){switch(CS(o)){case 2:var v=BM;break;case 8:v=zM;break;default:v=Rg}c=v.bind(null,o,c,i),v=void 0,!Dm||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(v=!0),g?v!==void 0?i.addEventListener(o,c,{capture:!0,passive:v}):i.addEventListener(o,c,!0):v!==void 0?i.addEventListener(o,c,{passive:v}):i.addEventListener(o,c,!1)}function gg(i,o,c,g,v){var T=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var U=g.stateNode.containerInfo;if(U===v)break;if(I===4)for(I=g.return;I!==null;){var ie=I.tag;if((ie===3||ie===4)&&I.stateNode.containerInfo===v)return;I=I.return}for(;U!==null;){if(I=Ho(U),I===null)return;if(ie=I.tag,ie===5||ie===6||ie===26||ie===27){g=T=I;continue e}U=U.parentNode}}g=g.return}e2(function(){var be=T,Ne=Mm(c),Re=[];e:{var ve=A2.get(i);if(ve!==void 0){var Se=$d,et=i;switch(i){case"keypress":if(Hd(c)===0)break e;case"keydown":case"keyup":Se=rO;break;case"focusin":et="focus",Se=zm;break;case"focusout":et="blur",Se=zm;break;case"beforeblur":case"afterblur":Se=zm;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=r2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=qI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=aO;break;case C2:case w2:case k2:Se=KI;break;case N2:Se=lO;break;case"scroll":case"scrollend":Se=$I;break;case"wheel":Se=cO;break;case"copy":case"cut":case"paste":Se=WI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=i2;break;case"toggle":case"beforetoggle":Se=fO}var ot=(o&4)!==0,Xt=!ot&&(i==="scroll"||i==="scrollend"),he=ot?ve!==null?ve+"Capture":null:ve;ot=[];for(var ue=be,ge;ue!==null;){var Ae=ue;if(ge=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ge===null||he===null||(Ae=Tu(ue,he),Ae!=null&&ot.push(tc(ue,Ae,ge))),Xt)break;ue=ue.return}0<ot.length&&(ve=new Se(ve,et,null,c,Ne),Re.push({event:ve,listeners:ot}))}}if((o&7)===0){e:{if(ve=i==="mouseover"||i==="pointerover",Se=i==="mouseout"||i==="pointerout",ve&&c!==Om&&(et=c.relatedTarget||c.fromElement)&&(Ho(et)||et[_s]))break e;if((Se||ve)&&(ve=Ne.window===Ne?Ne:(ve=Ne.ownerDocument)?ve.defaultView||ve.parentWindow:window,Se?(et=c.relatedTarget||c.toElement,Se=be,et=et?Ho(et):null,et!==null&&(Xt=a(et),ot=et.tag,et!==Xt||ot!==5&&ot!==27&&ot!==6)&&(et=null)):(Se=null,et=be),Se!==et)){if(ot=r2,Ae="onMouseLeave",he="onMouseEnter",ue="mouse",(i==="pointerout"||i==="pointerover")&&(ot=i2,Ae="onPointerLeave",he="onPointerEnter",ue="pointer"),Xt=Se==null?ve:Eu(Se),ge=et==null?ve:Eu(et),ve=new ot(Ae,ue+"leave",Se,c,Ne),ve.target=Xt,ve.relatedTarget=ge,Ae=null,Ho(Ne)===be&&(ot=new ot(he,ue+"enter",et,c,Ne),ot.target=ge,ot.relatedTarget=Xt,Ae=ot),Xt=Ae,Se&&et)t:{for(ot=dM,he=Se,ue=et,ge=0,Ae=he;Ae;Ae=ot(Ae))ge++;Ae=0;for(var it=ue;it;it=ot(it))Ae++;for(;0<ge-Ae;)he=ot(he),ge--;for(;0<Ae-ge;)ue=ot(ue),Ae--;for(;ge--;){if(he===ue||ue!==null&&he===ue.alternate){ot=he;break t}he=ot(he),ue=ot(ue)}ot=null}else ot=null;Se!==null&&WT(Re,ve,Se,ot,!1),et!==null&&Xt!==null&&WT(Re,Xt,et,ot,!0)}}e:{if(ve=be?Eu(be):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var zt=h2;else if(d2(ve))if(p2)zt=TO;else{zt=vO;var nt=yO}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?be&&Im(be.elementType)&&(zt=h2):zt=EO;if(zt&&(zt=zt(i,be))){f2(Re,zt,c,Ne);break e}nt&&nt(i,ve,be),i==="focusout"&&be&&ve.type==="number"&&be.memoizedProps.value!=null&&Rm(ve,"number",ve.value)}switch(nt=be?Eu(be):window,i){case"focusin":(d2(nt)||nt.contentEditable==="true")&&(Wo=nt,qm=be,Ru=null);break;case"focusout":Ru=qm=Wo=null;break;case"mousedown":Ym=!0;break;case"contextmenu":case"mouseup":case"dragend":Ym=!1,T2(Re,c,Ne);break;case"selectionchange":if(CO)break;case"keydown":case"keyup":T2(Re,c,Ne)}var xt;if(Hm)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 Xo?u2(i,c)&&(Mt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Mt="onCompositionStart");Mt&&(a2&&c.locale!=="ko"&&(Xo||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Xo&&(xt=t2()):(Li=Ne,jm="value"in Li?Li.value:Li.textContent,Xo=!0)),nt=Lf(be,Mt),0<nt.length&&(Mt=new s2(Mt,i,null,c,Ne),Re.push({event:Mt,listeners:nt}),xt?Mt.data=xt:(xt=c2(c),xt!==null&&(Mt.data=xt)))),(xt=pO?mO(i,c):gO(i,c))&&(Mt=Lf(be,"onBeforeInput"),0<Mt.length&&(nt=new s2("onBeforeInput","beforeinput",null,c,Ne),Re.push({event:nt,listeners:Mt}),nt.data=xt)),oM(Re,i,be,c,Ne)}KT(Re,o)})}function tc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Lf(i,o){for(var c=o+"Capture",g=[];i!==null;){var v=i,T=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||T===null||(v=Tu(i,c),v!=null&&g.unshift(tc(i,v,T)),v=Tu(i,o),v!=null&&g.push(tc(i,v,T))),i.tag===3)return g;i=i.return}return[]}function dM(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function WT(i,o,c,g,v){for(var T=o._reactName,I=[];c!==null&&c!==g;){var U=c,ie=U.alternate,be=U.stateNode;if(U=U.tag,ie!==null&&ie===g)break;U!==5&&U!==26&&U!==27||be===null||(ie=be,v?(be=Tu(c,T),be!=null&&I.unshift(tc(c,be,ie))):v||(be=Tu(c,T),be!=null&&I.push(tc(c,be,ie)))),c=c.return}I.length!==0&&i.push({event:o,listeners:I})}var fM=/\r\n?/g,hM=/\u0000|\uFFFD/g;function QT(i){return(typeof i=="string"?i:""+i).replace(fM,`
50
- `).replace(hM,"")}function ZT(i,o){return o=QT(o),QT(i)===o}function Kt(i,o,c,g,v,T){switch(c){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||Yo(i,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&Yo(i,""+g);break;case"className":Pd(i,"class",g);break;case"tabIndex":Pd(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Pd(i,c,g);break;case"style":Zv(i,g,T);break;case"data":if(o!=="object"){Pd(i,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=zd(""+g),i.setAttribute(c,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(c,"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"&&(c==="formAction"?(o!=="input"&&Kt(i,o,"name",v.name,v,null),Kt(i,o,"formEncType",v.formEncType,v,null),Kt(i,o,"formMethod",v.formMethod,v,null),Kt(i,o,"formTarget",v.formTarget,v,null)):(Kt(i,o,"encType",v.encType,v,null),Kt(i,o,"method",v.method,v,null),Kt(i,o,"target",v.target,v,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=zd(""+g),i.setAttribute(c,g);break;case"onClick":g!=null&&(i.onclick=Ws);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(c=g.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}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}c=zd(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);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(c,""+g):i.removeAttribute(c);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(c,""):i.removeAttribute(c);break;case"capture":case"download":g===!0?i.setAttribute(c,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,g):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(c,g):i.removeAttribute(c);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(c):i.setAttribute(c,g);break;case"popover":Nt("beforetoggle",i),Nt("toggle",i),jd(i,"popover",g);break;case"xlinkActuate":Xs(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Xs(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Xs(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Xs(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Xs(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Xs(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Xs(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Xs(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Xs(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":jd(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=HI.get(c)||c,jd(i,c,g))}}function bg(i,o,c,g,v,T){switch(c){case"style":Zv(i,g,T);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(c=g.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof g=="string"?Yo(i,g):(typeof g=="number"||typeof g=="bigint")&&Yo(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=Ws);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$v.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),o=c.slice(2,v?c.length-7:void 0),T=i[Xn]||null,T=T!=null?T[c]:null,typeof T=="function"&&i.removeEventListener(o,T,v),typeof g=="function")){typeof T!="function"&&T!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,g,v);break e}c in i?i[c]=g:g===!0?i.setAttribute(c,""):jd(i,c,g)}}}function Jn(i,o,c){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,v=!1,T;for(T in c)if(c.hasOwnProperty(T)){var I=c[T];if(I!=null)switch(T){case"src":g=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Kt(i,o,T,I,c,null)}}v&&Kt(i,o,"srcSet",c.srcSet,c,null),g&&Kt(i,o,"src",c.src,c,null);return;case"input":Nt("invalid",i);var U=T=I=v=null,ie=null,be=null;for(g in c)if(c.hasOwnProperty(g)){var Ne=c[g];if(Ne!=null)switch(g){case"name":v=Ne;break;case"type":I=Ne;break;case"checked":ie=Ne;break;case"defaultChecked":be=Ne;break;case"value":T=Ne;break;case"defaultValue":U=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,o));break;default:Kt(i,o,g,Ne,c,null)}}Kv(i,T,U,ie,be,I,v,!1);return;case"select":Nt("invalid",i),g=I=T=null;for(v in c)if(c.hasOwnProperty(v)&&(U=c[v],U!=null))switch(v){case"value":T=U;break;case"defaultValue":I=U;break;case"multiple":g=U;default:Kt(i,o,v,U,c,null)}o=T,c=I,i.multiple=!!g,o!=null?qo(i,!!g,o,!1):c!=null&&qo(i,!!g,c,!0);return;case"textarea":Nt("invalid",i),T=v=g=null;for(I in c)if(c.hasOwnProperty(I)&&(U=c[I],U!=null))switch(I){case"value":g=U;break;case"defaultValue":v=U;break;case"children":T=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:Kt(i,o,I,U,c,null)}Wv(i,g,v,T);return;case"option":for(ie in c)if(c.hasOwnProperty(ie)&&(g=c[ie],g!=null))switch(ie){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Kt(i,o,ie,g,c,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<ec.length;g++)Nt(ec[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 c)if(c.hasOwnProperty(be)&&(g=c[be],g!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Kt(i,o,be,g,c,null)}return;default:if(Im(o)){for(Ne in c)c.hasOwnProperty(Ne)&&(g=c[Ne],g!==void 0&&bg(i,o,Ne,g,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(g=c[U],g!=null&&Kt(i,o,U,g,c,null))}function pM(i,o,c,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,T=null,I=null,U=null,ie=null,be=null,Ne=null;for(Se in c){var Re=c[Se];if(c.hasOwnProperty(Se)&&Re!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":ie=Re;default:g.hasOwnProperty(Se)||Kt(i,o,Se,null,g,Re)}}for(var ve in g){var Se=g[ve];if(Re=c[ve],g.hasOwnProperty(ve)&&(Se!=null||Re!=null))switch(ve){case"type":T=Se;break;case"name":v=Se;break;case"checked":be=Se;break;case"defaultChecked":Ne=Se;break;case"value":I=Se;break;case"defaultValue":U=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,o));break;default:Se!==Re&&Kt(i,o,ve,Se,g,Re)}}_m(i,I,U,ie,be,Ne,T,v);return;case"select":Se=I=U=ve=null;for(T in c)if(ie=c[T],c.hasOwnProperty(T)&&ie!=null)switch(T){case"value":break;case"multiple":Se=ie;default:g.hasOwnProperty(T)||Kt(i,o,T,null,g,ie)}for(v in g)if(T=g[v],ie=c[v],g.hasOwnProperty(v)&&(T!=null||ie!=null))switch(v){case"value":ve=T;break;case"defaultValue":U=T;break;case"multiple":I=T;default:T!==ie&&Kt(i,o,v,T,g,ie)}o=U,c=I,g=Se,ve!=null?qo(i,!!c,ve,!1):!!g!=!!c&&(o!=null?qo(i,!!c,o,!0):qo(i,!!c,c?[]:"",!1));return;case"textarea":Se=ve=null;for(U in c)if(v=c[U],c.hasOwnProperty(U)&&v!=null&&!g.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Kt(i,o,U,null,g,v)}for(I in g)if(v=g[I],T=c[I],g.hasOwnProperty(I)&&(v!=null||T!=null))switch(I){case"value":ve=v;break;case"defaultValue":Se=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==T&&Kt(i,o,I,v,g,T)}Xv(i,ve,Se);return;case"option":for(var et in c)if(ve=c[et],c.hasOwnProperty(et)&&ve!=null&&!g.hasOwnProperty(et))switch(et){case"selected":i.selected=!1;break;default:Kt(i,o,et,null,g,ve)}for(ie in g)if(ve=g[ie],Se=c[ie],g.hasOwnProperty(ie)&&ve!==Se&&(ve!=null||Se!=null))switch(ie){case"selected":i.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Kt(i,o,ie,ve,g,Se)}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 ot in c)ve=c[ot],c.hasOwnProperty(ot)&&ve!=null&&!g.hasOwnProperty(ot)&&Kt(i,o,ot,null,g,ve);for(be in g)if(ve=g[be],Se=c[be],g.hasOwnProperty(be)&&ve!==Se&&(ve!=null||Se!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,o));break;default:Kt(i,o,be,ve,g,Se)}return;default:if(Im(o)){for(var Xt in c)ve=c[Xt],c.hasOwnProperty(Xt)&&ve!==void 0&&!g.hasOwnProperty(Xt)&&bg(i,o,Xt,void 0,g,ve);for(Ne in g)ve=g[Ne],Se=c[Ne],!g.hasOwnProperty(Ne)||ve===Se||ve===void 0&&Se===void 0||bg(i,o,Ne,ve,g,Se);return}}for(var he in c)ve=c[he],c.hasOwnProperty(he)&&ve!=null&&!g.hasOwnProperty(he)&&Kt(i,o,he,null,g,ve);for(Re in g)ve=g[Re],Se=c[Re],!g.hasOwnProperty(Re)||ve===Se||ve==null&&Se==null||Kt(i,o,Re,ve,g,Se)}function JT(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mM(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),g=0;g<c.length;g++){var v=c[g],T=v.transferSize,I=v.initiatorType,U=v.duration;if(T&&U&&JT(I)){for(I=0,U=v.responseEnd,g+=1;g<c.length;g++){var ie=c[g],be=ie.startTime;if(be>U)break;var Ne=ie.transferSize,Re=ie.initiatorType;Ne&&JT(Re)&&(ie=ie.responseEnd,I+=Ne*(ie<U?1:(U-be)/(ie-be)))}if(--g,o+=8*(T+I)/(v.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 xg=null,yg=null;function Df(i){return i.nodeType===9?i:i.ownerDocument}function eS(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 tS(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 vg(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 Eg=null;function gM(){var i=window.event;return i&&i.type==="popstate"?i===Eg?!1:(Eg=i,!0):(Eg=null,!1)}var nS=typeof setTimeout=="function"?setTimeout:void 0,bM=typeof clearTimeout=="function"?clearTimeout:void 0,rS=typeof Promise=="function"?Promise:void 0,xM=typeof queueMicrotask=="function"?queueMicrotask:typeof rS<"u"?function(i){return rS.resolve(null).then(i).catch(yM)}:nS;function yM(i){setTimeout(function(){throw i})}function Qi(i){return i==="head"}function sS(i,o){var c=o,g=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(g===0){i.removeChild(v),Sl(o);return}g--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")g++;else if(c==="html")nc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,nc(c);for(var T=c.firstChild;T;){var I=T.nextSibling,U=T.nodeName;T[vu]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&T.rel.toLowerCase()==="stylesheet"||c.removeChild(T),T=I}}else c==="body"&&nc(i.ownerDocument.body);c=v}while(c);Sl(o)}function iS(i,o){var c=i;i=0;do{var g=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=g}while(c)}function Tg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Tg(c),Nm(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function vM(i,o,c,g){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[vu])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!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(T=i.getAttribute("src"),(T!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&T&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var T=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===T)return i}else return i;if(i=ss(i.nextSibling),i===null)break}return null}function EM(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=ss(i.nextSibling),i===null))return null;return i}function aS(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=ss(i.nextSibling),i===null))return null;return i}function Sg(i){return i.data==="$?"||i.data==="$~"}function Cg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function TM(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var g=function(){o(),c.removeEventListener("DOMContentLoaded",g)};c.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function ss(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 wg=null;function oS(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return ss(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function lS(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function uS(i,o,c){switch(o=Df(c),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 nc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Nm(i)}var is=new Map,cS=new Set;function jf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var fi=G.d;G.d={f:SM,r:CM,D:wM,C:kM,L:NM,m:AM,X:RM,S:_M,M:IM};function SM(){var i=fi.f(),o=Nf();return i||o}function CM(i){var o=Fo(i);o!==null&&o.tag===5&&o.type==="form"?NE(o):fi.r(i)}var vl=typeof document>"u"?null:document;function dS(i,o,c){var g=vl;if(g&&typeof o=="string"&&o){var v=Qr(o);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),cS.has(v)||(cS.add(v),i={rel:i,crossOrigin:c,href:o},g.querySelector(v)===null&&(o=g.createElement("link"),Jn(o,"link",i),Hn(o),g.head.appendChild(o)))}}function wM(i){fi.D(i),dS("dns-prefetch",i,null)}function kM(i,o){fi.C(i,o),dS("preconnect",i,o)}function NM(i,o,c){fi.L(i,o,c);var g=vl;if(g&&i&&o){var v='link[rel="preload"][as="'+Qr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+Qr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+Qr(c.imageSizes)+'"]')):v+='[href="'+Qr(i)+'"]';var T=v;switch(o){case"style":T=El(i);break;case"script":T=Tl(i)}is.has(T)||(i=p({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),is.set(T,i),g.querySelector(v)!==null||o==="style"&&g.querySelector(rc(T))||o==="script"&&g.querySelector(sc(T))||(o=g.createElement("link"),Jn(o,"link",i),Hn(o),g.head.appendChild(o)))}}function AM(i,o){fi.m(i,o);var c=vl;if(c&&i){var g=o&&typeof o.as=="string"?o.as:"script",v='link[rel="modulepreload"][as="'+Qr(g)+'"][href="'+Qr(i)+'"]',T=v;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Tl(i)}if(!is.has(T)&&(i=p({rel:"modulepreload",href:i},o),is.set(T,i),c.querySelector(v)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(sc(T)))return}g=c.createElement("link"),Jn(g,"link",i),Hn(g),c.head.appendChild(g)}}}function _M(i,o,c){fi.S(i,o,c);var g=vl;if(g&&i){var v=$o(g).hoistableStyles,T=El(i);o=o||"default";var I=v.get(T);if(!I){var U={loading:0,preload:null};if(I=g.querySelector(rc(T)))U.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":o},c),(c=is.get(T))&&kg(i,c);var ie=I=g.createElement("link");Hn(ie),Jn(ie,"link",i),ie._p=new Promise(function(be,Ne){ie.onload=be,ie.onerror=Ne}),ie.addEventListener("load",function(){U.loading|=1}),ie.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Pf(I,o,g)}I={type:"stylesheet",instance:I,count:1,state:U},v.set(T,I)}}}function RM(i,o){fi.X(i,o);var c=vl;if(c&&i){var g=$o(c).hoistableScripts,v=Tl(i),T=g.get(v);T||(T=c.querySelector(sc(v)),T||(i=p({src:i,async:!0},o),(o=is.get(v))&&Ng(i,o),T=c.createElement("script"),Hn(T),Jn(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(v,T))}}function IM(i,o){fi.M(i,o);var c=vl;if(c&&i){var g=$o(c).hoistableScripts,v=Tl(i),T=g.get(v);T||(T=c.querySelector(sc(v)),T||(i=p({src:i,async:!0,type:"module"},o),(o=is.get(v))&&Ng(i,o),T=c.createElement("script"),Hn(T),Jn(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(v,T))}}function fS(i,o,c,g){var v=(v=ce.current)?jf(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=El(c.href),c=$o(v).hoistableStyles,g=c.get(o),g||(g={type:"style",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=El(c.href);var T=$o(v).hoistableStyles,I=T.get(i);if(I||(v=v.ownerDocument||v,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,I),(T=v.querySelector(rc(i)))&&!T._p&&(I.instance=T,I.state.loading=5),is.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},is.set(i,c),T||OM(v,i,c,I.state))),o&&g===null)throw Error(r(528,""));return I}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Tl(c),c=$o(v).hoistableScripts,g=c.get(o),g||(g={type:"script",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function El(i){return'href="'+Qr(i)+'"'}function rc(i){return'link[rel="stylesheet"]['+i+"]"}function hS(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function OM(i,o,c,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}),Jn(o,"link",c),Hn(o),i.head.appendChild(o))}function Tl(i){return'[src="'+Qr(i)+'"]'}function sc(i){return"script[async]"+i}function pS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var g=i.querySelector('style[data-href~="'+Qr(c.href)+'"]');if(g)return o.instance=g,Hn(g),g;var v=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Hn(g),Jn(g,"style",v),Pf(g,c.precedence,i),o.instance=g;case"stylesheet":v=El(c.href);var T=i.querySelector(rc(v));if(T)return o.state.loading|=4,o.instance=T,Hn(T),T;g=hS(c),(v=is.get(v))&&kg(g,v),T=(i.ownerDocument||i).createElement("link"),Hn(T);var I=T;return I._p=new Promise(function(U,ie){I.onload=U,I.onerror=ie}),Jn(T,"link",g),o.state.loading|=4,Pf(T,c.precedence,i),o.instance=T;case"script":return T=Tl(c.src),(v=i.querySelector(sc(T)))?(o.instance=v,Hn(v),v):(g=c,(v=is.get(T))&&(g=p({},c),Ng(g,v)),i=i.ownerDocument||i,v=i.createElement("script"),Hn(v),Jn(v,"link",g),i.head.appendChild(v),o.instance=v);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,Pf(g,c.precedence,i));return o.instance}function Pf(i,o,c){for(var g=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=g.length?g[g.length-1]:null,T=v,I=0;I<g.length;I++){var U=g[I];if(U.dataset.precedence===o)T=U;else if(T!==v)break}T?T.parentNode.insertBefore(i,T.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function kg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Ng(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Bf=null;function mS(i,o,c){if(Bf===null){var g=new Map,v=Bf=new Map;v.set(c,g)}else v=Bf,g=v.get(c),g||(g=new Map,v.set(c,g));if(g.has(i))return g;for(g.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var T=c[v];if(!(T[vu]||T[tn]||i==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var I=T.getAttribute(o)||"";I=i+I;var U=g.get(I);U?U.push(T):g.set(I,[T])}}return g}function gS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function MM(i,o,c){if(c===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 bS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function LM(i,o,c,g){if(c.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=El(g.href),T=o.querySelector(rc(v));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=zf.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=T,Hn(T);return}T=o.ownerDocument||o,g=hS(g),(v=is.get(v))&&kg(g,v),T=T.createElement("link"),Hn(T);var I=T;I._p=new Promise(function(U,ie){I.onload=U,I.onerror=ie}),Jn(T,"link",g),c.instance=T}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=zf.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var Ag=0;function DM(i,o){return i.stylesheets&&i.count===0&&Hf(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var g=setTimeout(function(){if(i.stylesheets&&Hf(i,i.stylesheets),i.unsuspend){var T=i.unsuspend;i.unsuspend=null,T()}},6e4+o);0<i.imgBytes&&Ag===0&&(Ag=62500*mM());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Hf(i,i.stylesheets),i.unsuspend)){var T=i.unsuspend;i.unsuspend=null,T()}},(i.imgBytes>Ag?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(v)}}:null}function zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Uf=null;function Hf(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Uf=new Map,o.forEach(jM,i),Uf=null,zf.call(i))}function jM(i,o){if(!(o.state.loading&4)){var c=Uf.get(i);if(c)var g=c.get(null);else{c=new Map,Uf.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<v.length;T++){var I=v[T];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(c.set(I.dataset.precedence,I),g=I)}g&&c.set(null,g)}v=o.instance,I=v.getAttribute("data-precedence"),T=c.get(I)||g,T===g&&c.set(null,v),c.set(I,v),this.count++,g=zf.bind(this),v.addEventListener("load",g),v.addEventListener("error",g),T?T.parentNode.insertBefore(v,T.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),o.state.loading|=4}}var ic={$$typeof:N,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function PM(i,o,c,g,v,T,I,U,ie){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=Kn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kn(0),this.hiddenUpdates=Kn(null),this.identifierPrefix=g,this.onUncaughtError=v,this.onCaughtError=T,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function xS(i,o,c,g,v,T,I,U,ie,be,Ne,Re){return i=new PM(i,o,c,I,ie,be,Ne,Re,U),o=1,T===!0&&(o|=24),T=jr(3,null,null,o),i.current=T,T.stateNode=i,o=o0(),o.refCount++,i.pooledCache=o,o.refCount++,T.memoizedState={element:g,isDehydrated:c,cache:o},d0(T),i}function yS(i){return i?(i=Jo,i):Jo}function vS(i,o,c,g,v,T){v=yS(v),g.context===null?g.context=v:g.pendingContext=v,g=Ui(o),g.payload={element:c},T=T===void 0?null:T,T!==null&&(g.callback=T),c=Hi(i,g,o),c!==null&&(wr(c,i,o),Pu(c,i,o))}function ES(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function _g(i,o){ES(i,o),(i=i.alternate)&&ES(i,o)}function TS(i){if(i.tag===13||i.tag===31){var o=ja(i,67108864);o!==null&&wr(o,i,67108864),_g(i,67108864)}}function SS(i){if(i.tag===13||i.tag===31){var o=Hr();o=ht(o);var c=ja(i,o);c!==null&&wr(c,i,o),_g(i,o)}}var Ff=!0;function BM(i,o,c,g){var v=z.T;z.T=null;var T=G.p;try{G.p=2,Rg(i,o,c,g)}finally{G.p=T,z.T=v}}function zM(i,o,c,g){var v=z.T;z.T=null;var T=G.p;try{G.p=8,Rg(i,o,c,g)}finally{G.p=T,z.T=v}}function Rg(i,o,c,g){if(Ff){var v=Ig(g);if(v===null)gg(i,o,g,$f,c),wS(i,g);else if(HM(v,i,o,c,g))g.stopPropagation();else if(wS(i,g),o&4&&-1<UM.indexOf(i)){for(;v!==null;){var T=Fo(v);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var I=Jt(T.pendingLanes);if(I!==0){var U=T;for(U.pendingLanes|=2,U.entangledLanes|=2;I;){var ie=1<<31-Ge(I);U.entanglements[1]|=ie,I&=~ie}Ms(T),(Ft&6)===0&&(wf=oe()+500,Ju(0))}}break;case 31:case 13:U=ja(T,2),U!==null&&wr(U,T,2),Nf(),_g(T,2)}if(T=Ig(g),T===null&&gg(i,o,g,$f,c),T===v)break;v=T}v!==null&&g.stopPropagation()}else gg(i,o,g,null,c)}}function Ig(i){return i=Mm(i),Og(i)}var $f=null;function Og(i){if($f=null,i=Ho(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return $f=i,null}function CS(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(ae()){case K:return 2;case F:return 8;case le:case Ce:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Mg=!1,Zi=null,Ji=null,ea=null,ac=new Map,oc=new Map,ta=[],UM="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 wS(i,o){switch(i){case"focusin":case"focusout":Zi=null;break;case"dragenter":case"dragleave":Ji=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":ac.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(o.pointerId)}}function lc(i,o,c,g,v,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:c,eventSystemFlags:g,nativeEvent:T,targetContainers:[v]},o!==null&&(o=Fo(o),o!==null&&TS(o)),i):(i.eventSystemFlags|=g,o=i.targetContainers,v!==null&&o.indexOf(v)===-1&&o.push(v),i)}function HM(i,o,c,g,v){switch(o){case"focusin":return Zi=lc(Zi,i,o,c,g,v),!0;case"dragenter":return Ji=lc(Ji,i,o,c,g,v),!0;case"mouseover":return ea=lc(ea,i,o,c,g,v),!0;case"pointerover":var T=v.pointerId;return ac.set(T,lc(ac.get(T)||null,i,o,c,g,v)),!0;case"gotpointercapture":return T=v.pointerId,oc.set(T,lc(oc.get(T)||null,i,o,c,g,v)),!0}return!1}function kS(i){var o=Ho(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,Un(i.priority,function(){SS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,Un(i.priority,function(){SS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Vf(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Ig(i.nativeEvent);if(c===null){c=i.nativeEvent;var g=new c.constructor(c.type,c);Om=g,c.target.dispatchEvent(g),Om=null}else return o=Fo(c),o!==null&&TS(o),i.blockedOn=c,!1;o.shift()}return!0}function NS(i,o,c){Vf(i)&&c.delete(o)}function FM(){Mg=!1,Zi!==null&&Vf(Zi)&&(Zi=null),Ji!==null&&Vf(Ji)&&(Ji=null),ea!==null&&Vf(ea)&&(ea=null),ac.forEach(NS),oc.forEach(NS)}function qf(i,o){i.blockedOn===o&&(i.blockedOn=null,Mg||(Mg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FM)))}var Yf=null;function AS(i){Yf!==i&&(Yf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yf===i&&(Yf=null);for(var o=0;o<i.length;o+=3){var c=i[o],g=i[o+1],v=i[o+2];if(typeof g!="function"){if(Og(g||c)===null)continue;break}var T=Fo(c);T!==null&&(i.splice(o,3),o-=3,I0(T,{pending:!0,data:v,method:c.method,action:g},g,v))}}))}function Sl(i){function o(ie){return qf(ie,i)}Zi!==null&&qf(Zi,i),Ji!==null&&qf(Ji,i),ea!==null&&qf(ea,i),ac.forEach(o),oc.forEach(o);for(var c=0;c<ta.length;c++){var g=ta[c];g.blockedOn===i&&(g.blockedOn=null)}for(;0<ta.length&&(c=ta[0],c.blockedOn===null);)kS(c),c.blockedOn===null&&ta.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(g=0;g<c.length;g+=3){var v=c[g],T=c[g+1],I=v[Xn]||null;if(typeof T=="function")I||AS(c);else if(I){var U=null;if(T&&T.hasAttribute("formAction")){if(v=T,I=T[Xn]||null)U=I.formAction;else if(Og(v)!==null)continue}else U=I.action;typeof U=="function"?c[g+1]=U:(c.splice(g,3),g-=3),AS(c)}}}function _S(){function i(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(I){return v=I})},focusReset:"manual",scroll:"manual"})}function o(){v!==null&&(v(),v=null),g||setTimeout(c,20)}function c(){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,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),v!==null&&(v(),v=null)}}}function Lg(i){this._internalRoot=i}Gf.prototype.render=Lg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,g=Hr();vS(c,g,i,o,null,null)},Gf.prototype.unmount=Lg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;vS(i.current,2,null,i,null,null),Nf(),o[_s]=null}};function Gf(i){this._internalRoot=i}Gf.prototype.unstable_scheduleHydration=function(i){if(i){var o=yn();i={blockedOn:null,target:i,priority:o};for(var c=0;c<ta.length&&o!==0&&o<ta[c].priority;c++);ta.splice(c,0,i),c===0&&kS(i)}};var RS=t.version;if(RS!=="19.2.7")throw Error(r(527,RS,"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=h(o),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var $M={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{We=Kf.inject($M),lt=Kf}catch{}}return cc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,g="",v=PE,T=BE,I=zE;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(I=o.onRecoverableError)),o=xS(i,1,!1,null,null,c,g,null,v,T,I,_S),i[_s]=o.current,mg(i),new Lg(o)},cc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var g=!1,v="",T=PE,I=BE,U=zE,ie=null;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(T=c.onUncaughtError),c.onCaughtError!==void 0&&(I=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(ie=c.formState)),o=xS(i,1,!0,o,c??null,g,v,ie,T,I,U,_S),o.context=yS(null),c=o.current,g=Hr(),g=ht(g),v=Ui(g),v.callback=null,Hi(c,v,g),c=g,o.current.lanes=c,vt(o,c),Ms(o),i[_s]=o.current,mg(i),new Gf(o)},cc.version="19.2.7",cc}var US;function eL(){if(US)return Pg.exports;US=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(),Pg.exports=JM(),Pg.exports}var tL=eL();const eN="workerdeck.theme";function _x(){try{const e=localStorage.getItem(eN);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function tN(e=_x()){document.documentElement.setAttribute("data-theme",e)}function nL(e){try{localStorage.setItem(eN,e)}catch{}tN(e)}function rL(){const e=_x()==="dark"?"light":"dark";return nL(e),e}var Ac=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Hg(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 sL(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 iL(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}const nN=!1;function Jc(e){return e[e.length-1]}function aL(e){return typeof e=="function"}function io(e,t){return aL(e)?e(t):e}const rN=Object.prototype.hasOwnProperty,HS=Object.prototype.propertyIsEnumerable;function sN(e){for(const t in e)if(rN.call(e,t))return!0;return!1}const oL=()=>Object.create(null),Xa=(e,t)=>ao(e,t,oL);function ao(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,a=VS(e)&&VS(s);if(!a&&!(qh(e)&&qh(s)))return s;const l=a?e:FS(e);if(!l)return s;const u=a?s:FS(s);if(!u)return s;const d=l.length,h=u.length,m=a?new Array(h):n();let p=0;for(let b=0;b<h;b++){const x=a?b:u[b],E=e[x],A=s[x];if(E===A){m[x]=E,(a?b<d:rN.call(e,x))&&p++;continue}if(E===null||A===null||typeof E!="object"||typeof A!="object"){m[x]=A;continue}const w=ao(E,A,n,r+1);m[x]=w,w===E&&p++}return d===h&&p===d?e:m}function FS(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!HS.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(!HS.call(e,s))return!1;r.push(s)}return r}function qh(e){if(!$S(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!$S(n)||!n.hasOwnProperty("isPrototypeOf"))}function $S(e){return Object.prototype.toString.call(e)==="[object Object]"}function VS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fo(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(!fo(e[r],t[r],n))return!1;return!0}if(qh(e)&&qh(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!fo(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||!fo(e[l],t[l],n)))return!1;return s===a}return!1}function Gl(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 ed(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const lL=/[\x00-\x1f\x7f"<>`{}]/g;function uL(e){return e.replace(lL,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function qS(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 uL(t)}const cL=["http:","https:","mailto:","tel:"];function Yh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function dc(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+=qS(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+qS(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function dL(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function fL(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 vi(){throw new Error("Invariant failed")}function td(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 u=t.get(a);if(u)u.value=l,s(u);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 ha=4,iN=5;function hL(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 aN(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 u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,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=hL(a);if(l){const[u,d]=l,h=a.charCodeAt(u+1);if(h===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const m=u+3,p=d;if(m<p)return n[0]=3,n[1]=t+u,n[2]=t+m,n[3]=t+p,n[4]=t+d+1,n[5]=s,n}}else if(h===36){const m=u+1,p=u+2;return p===d?(n[0]=2,n[1]=t+u,n[2]=t+m,n[3]=t+p,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+p,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 _p(e,t,n,r,s,a,l){l?.(n);let u=r;{const d=n.fullPath??n.from,h=d.length,m=n.options?.caseSensitive??e,p=n.options?.params?.parse??n.options?.parseParams;for(;u<h;){const x=aN(d,u,t);let E;const A=u,w=x[5];switch(u=w+1,a++,x[0]){case 0:{const S=d.substring(x[2],x[3]);if(m){const k=s.static?.get(S);if(k)E=k;else{s.static??=new Map;const N=oo(n.fullPath??n.from);N.parent=s,N.depth=a,E=N,s.static.set(S,N)}}else{const k=S.toLowerCase(),N=s.staticInsensitive?.get(k);if(N)E=N;else{s.staticInsensitive??=new Map;const _=oo(n.fullPath??n.from);_.parent=s,_.depth=a,E=_,s.staticInsensitive.set(k,_)}}break}case 1:{const S=d.substring(A,x[1]),k=d.substring(x[4],w),N=m&&!!(S||k),_=S?N?S:S.toLowerCase():void 0,M=k?N?k:k.toLowerCase():void 0,R=!p&&s.dynamic?.find(j=>!j.parse&&j.caseSensitive===N&&j.prefix===_&&j.suffix===M);if(R)E=R;else{const j=$g(1,n.fullPath??n.from,N,_,M);E=j,j.depth=a,j.parent=s,s.dynamic??=[],s.dynamic.push(j)}break}case 3:{const S=d.substring(A,x[1]),k=d.substring(x[4],w),N=m&&!!(S||k),_=S?N?S:S.toLowerCase():void 0,M=k?N?k:k.toLowerCase():void 0,R=!p&&s.optional?.find(j=>!j.parse&&j.caseSensitive===N&&j.prefix===_&&j.suffix===M);if(R)E=R;else{const j=$g(3,n.fullPath??n.from,N,_,M);E=j,j.parent=s,j.depth=a,s.optional??=[],s.optional.push(j)}break}case 2:{const S=d.substring(A,x[1]),k=d.substring(x[4],w),N=m&&!!(S||k),_=S?N?S:S.toLowerCase():void 0,M=k?N?k:k.toLowerCase():void 0,R=$g(2,n.fullPath??n.from,N,_,M);E=R,R.parent=s,R.depth=a,s.wildcard??=[],s.wildcard.push(R)}}s=E}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=oo(n.fullPath??n.from);x.kind=iN,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=oo(n.fullPath??n.from);x.kind=ha,x.parent=s,a++,x.depth=a,s.index=x,s=x}s.parse=p??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)_p(e,t,d,u,s,a,l)}function Fg(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 da(e){if(e.pathless)for(const t of e.pathless)da(t);if(e.static)for(const t of e.static.values())da(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())da(t);if(e.dynamic?.length){e.dynamic.sort(Fg);for(const t of e.dynamic)da(t)}if(e.optional?.length){e.optional.sort(Fg);for(const t of e.optional)da(t)}if(e.wildcard?.length){e.wildcard.sort(Fg);for(const t of e.wildcard)da(t)}}function oo(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 $g(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 pL(e,t){const n=oo("/"),r=new Uint16Array(6);for(const s of e)_p(!1,r,s,1,n,0);da(n),t.masksTree=n,t.flatCache=td(1e3)}function mL(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Rx(e,t.masksTree);return t.flatCache.set(e,r),r}function gL(e,t,n,r,s){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=s.singleCache.get(a);return l||(l=oo("/"),_p(t,new Uint16Array(6),{from:e},1,l,0),s.singleCache.set(a,l)),Rx(r,l,n)}function bL(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=Rx(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=lN(a.route)),t.matchCache.set(r,a),a}function xL(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function yL(e,t=!1,n){const r=oo(e.fullPath),s=new Uint16Array(6),a={},l={};let u=0;return _p(t,s,e,1,r,0,d=>{if(n?.(d,u),d.id in a&&vi(),a[d.id]=d,u!==0&&d.path){const h=xL(d.fullPath);(!l[h]||d.fullPath.endsWith("/"))&&(l[h]=d)}u++}),da(r),{processedTree:{segmentTree:r,singleCache:td(1e3),matchCache:td(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Rx(e,t,n=!1){const r=e.split("/"),s=EL(e,r,t,n);if(!s)return null;const[a]=oN(e,r,s);return{route:s.node.route,rawParams:a}}function oN(e,t,n){const r=vL(n.node);let s=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,h=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,h++){const m=r[u];if(m.kind===ha)break;if(m.kind===iN){h--,l--,d--;continue}const p=t[l],b=d;if(p&&(d+=p.length),m.kind===1){s??=n.node.fullPath.split("/");const x=s[h],E=m.prefix?.length??0;if(x.charCodeAt(E)===123){const A=m.suffix?.length??0,w=x.substring(E+2,x.length-A-1),S=p.substring(E,p.length-A);a[w]=decodeURIComponent(S)}else{const A=x.substring(1);a[A]=decodeURIComponent(p)}}else if(m.kind===3){if(n.skipped&1<<u){l--,d=b-1;continue}s??=n.node.fullPath.split("/");const x=s[h],E=m.prefix?.length??0,A=m.suffix?.length??0,w=x.substring(E+3,x.length-A-1),S=m.suffix||m.prefix?p.substring(E,p.length-A):p;S&&(a[w]=decodeURIComponent(S))}else if(m.kind===2){const x=m,E=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),A=decodeURIComponent(E);a["*"]=A,a._splat=A;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:h}]}function lN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function vL(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function EL(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Jc(t),a=s&&e!=="/",l=t.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,h=null;for(;u.length;){const m=u.pop(),{node:p,index:b,skipped:x,depth:E,statics:A,dynamics:w,optionals:S}=m;let{extract:k,rawParams:N}=m;if(p.kind===2&&p.route&&!Wf(h,m))continue;if(p.parse){if(!YS(e,t,m))continue;N=m.rawParams,k=m.extract}r&&p.route&&p.kind!==ha&&Wf(d,m)&&(d=m);const _=b===l;if(_&&(p.route&&(!a||p.kind===ha||p.kind===2)&&Wf(h,m)&&(h=m),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const M=_?void 0:t[b];let R;if(_&&p.index){const j={node:p.index,index:b,skipped:x,depth:E+1,statics:A,dynamics:w,optionals:S,extract:k,rawParams:N};let O=!0;if(p.index.parse&&(YS(e,t,j)||(O=!1)),O){if(!w&&!S&&!x&&TL(A,l))return j;Wf(h,j)&&(h=j)}}if(p.wildcard)for(let j=p.wildcard.length-1;j>=0;j--){const O=p.wildcard[j],{prefix:H,suffix:P}=O;if(!(H&&(_||!(O.caseSensitive?M:R??=M.toLowerCase()).startsWith(H)))){if(P){if(_)continue;const Y=t.slice(b).join("/").slice(-P.length);if((O.caseSensitive?Y:Y.toLowerCase())!==P)continue}u.push({node:O,index:l,skipped:x,depth:E+1,statics:A,dynamics:w,optionals:S,extract:k,rawParams:N})}}if(p.optional){const j=x|1<<E,O=E+1;for(let H=p.optional.length-1;H>=0;H--){const P=p.optional[H];u.push({node:P,index:b,skipped:j,depth:O,statics:A,dynamics:w,optionals:S,extract:k,rawParams:N})}if(!_)for(let H=p.optional.length-1;H>=0;H--){const P=p.optional[H],{prefix:Y,suffix:X}=P;if(Y||X){const Z=P.caseSensitive?M:R??=M.toLowerCase();if(Y&&!Z.startsWith(Y)||X&&!Z.endsWith(X))continue}u.push({node:P,index:b+1,skipped:x,depth:O,statics:A,dynamics:w,optionals:S+Xf(l,b),extract:k,rawParams:N})}}if(!_&&p.dynamic&&M)for(let j=p.dynamic.length-1;j>=0;j--){const O=p.dynamic[j],{prefix:H,suffix:P}=O;if(H||P){const Y=O.caseSensitive?M:R??=M.toLowerCase();if(H&&!Y.startsWith(H)||P&&!Y.endsWith(P))continue}u.push({node:O,index:b+1,skipped:x,depth:E+1,statics:A,dynamics:w+Xf(l,b),optionals:S,extract:k,rawParams:N})}if(!_&&p.staticInsensitive){const j=p.staticInsensitive.get(R??=M.toLowerCase());j&&u.push({node:j,index:b+1,skipped:x,depth:E+1,statics:A+Xf(l,b),dynamics:w,optionals:S,extract:k,rawParams:N})}if(!_&&p.static){const j=p.static.get(M);j&&u.push({node:j,index:b+1,skipped:x,depth:E+1,statics:A+Xf(l,b),dynamics:w,optionals:S,extract:k,rawParams:N})}if(p.pathless){const j=E+1;for(let O=p.pathless.length-1;O>=0;O--){const H=p.pathless[O];u.push({node:H,index:b,skipped:x,depth:j,statics:A,dynamics:w,optionals:S,extract:k,rawParams:N})}}}if(h)return h;if(r&&d){let m=d.index;for(let b=0;b<d.index;b++)m+=t[b].length;const p=m===e.length?"/":e.slice(m);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(p),d}return null}function Xf(e,t){return 2**(e-t-1)}function TL(e,t){return e===2**(t-1)-1}function YS(e,t,n){let r,s;try{[r,s]=oN(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 Wf(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===ha)>(e.node.kind===ha)||t.node.kind===ha==(e.node.kind===ha)&&t.depth>e.depth))):!0}function Ih(e){return Ix(e.filter(t=>t!==void 0).join("/"))}function Ix(e){return e.replace(/\/{2,}/g,"/")}function uN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function yi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function cN(e){return yi(uN(e))}function Gh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function SL(e,t,n){return Gh(e,n)===Gh(t,n)}function CL({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 h=r.get(l);if(h)return h}let u;if(a)u=e.split("/");else if(s)u=t.split("/");else{for(u=e.split("/");u.length>1&&Jc(u)==="";)u.pop();const h=t.split("/");for(let m=0,p=h.length;m<p;m++){const b=h[m];b===""?m?m===p-1&&u.push(b):u=[b]:b===".."?u.pop():b==="."||u.push(b)}}u.length>1&&(Jc(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const d=Ix(u.join("/"))||"/";return l&&r&&r.set(l,d),d}function wL(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 Vg(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=>KS(s,n)).join("/"):KS(r,n)}function GS({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 u=0,d,h="";for(;u<l;){const m=u;d=aN(e,m,d);const p=d[5];if(u=p+1,m===p)continue;const b=d[0];if(b===0){h+="/"+e.substring(m,p);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const E=e.substring(m,d[1]),A=e.substring(d[4],p);if(!x){s=!0,(E||A)&&(h+="/"+E+A);continue}const w=Vg("_splat",t,n);h+="/"+E+w+A;continue}if(b===1){const x=e.substring(d[2],d[3]);!s&&!(x in t)&&(s=!0),a[x]=t[x];const E=e.substring(m,d[1]),A=e.substring(d[4],p),w=Vg(x,t,n)??"undefined";h+="/"+E+w+A;continue}if(b===3){const x=e.substring(d[2],d[3]),E=t[x];if(E==null)continue;a[x]=E;const A=e.substring(m,d[1]),w=e.substring(d[4],p),S=Vg(x,t,n)??"";h+="/"+A+S+w;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:a,interpolatedPath:h||"/",isMissingParams:s}}function KS(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ar(e){return e?.isNotFound===!0}function kL(){try{return sessionStorage}catch{return}}const NL="tsr-scroll-restoration-v1_3",dN=kL();function AL(){try{return JSON.parse(dN?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function _L(){try{dN?.setItem(NL,JSON.stringify(Rl))}catch{}}const Rl=AL(),XS="data-scroll-restoration-id",RL=e=>e.state.__TSR_key||e.href;function IL(e){const t=e.getAttribute(XS);if(t)return`[${XS}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const u=`${r.localName}:nth-child(${a})`;n=n?`${u} > ${n}`:u,r=s}return n}let Qf=!1;const Oh="window";function ob(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function WS(e){const t=new Set;for(const n of e){if(n===Oh)continue;const r=ob(n);r&&t.add(r)}return t}function OL(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||RL,a=new Set,l=u=>{const d=Rl[u]||={};for(const h of a)h===document?d[Oh]={scrollX,scrollY}:h.isConnected&&(d[IL(h)]={scrollX:h.scrollLeft,scrollY:h.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Qf=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{Qf||a.add(u.target)},!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&l(s(u.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),_L()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",u=>{const d=e.options.scrollRestorationBehavior,h=e.options.scrollToTopSelectors,m=r.next,p=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(u.toLocation),E=u.fromLocation&&s(u.fromLocation);if(r.restoring&&E&&E!==x){const A=Rl[E];if(A){let w=Rl[x];for(const S in A){if(S===Oh){if(m)continue}else{const k=ob(S);if(!k||m&&h&&(b??=WS(h),b.has(k)))continue}w||(w=Rl[x]={}),w[S]??=A[S]}}}Qf=!0;try{const A=u.toLocation.hash,w=u.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(m){!A&&h&&(b??=WS(h));const k=A&&w&&p,N=r.restoring?Rl[x]:void 0;if(N)for(const _ in N){const{scrollX:M,scrollY:R}=N[_];if(_===Oh){if(k)continue;scrollTo({top:R,left:M,behavior:d}),S=!0}else{const j=ob(_);j&&(j.scrollLeft=M,j.scrollTop=R,b?.delete(j))}}if(!A){const _={top:0,left:0,behavior:d};if(S||scrollTo(_),b)for(const M of b)M.scrollTo(_)}}!S&&A&&w&&document.getElementById(A)?.scrollIntoView(w)}finally{Qf=!1}}))}function ML(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 qg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function LL(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]=qg(s):Array.isArray(a)?a.push(qg(s)):n[r]=[a,qg(s)]}return n}const DL=PL(JSON.parse),jL=BL(JSON.stringify,JSON.parse);function PL(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=LL(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function BL(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=ML(s,r);return a?`?${a}`:""}}const ho="__root__";function Rp(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 Rr(e){return e instanceof Response&&!!e.options}function zL(e){return{input:({url:t})=>{for(const n of e)t=lb(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=fN(e[n],t);return t}}}function UL(e){const t=cN(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=Ih(["/",t,a.pathname]),a)}}function lb(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 fN(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 HL(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:a}=t,l=new Map,u=new Map,d=new Map,h=n(e.status),m=n(e.loadedAt),p=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),E=n(e.resolvedLocation),A=n(e.statusCode),w=n(e.redirect),S=n([]),k=n([]),N=n([]),_=r(()=>Yg(l,S.get())),M=r(()=>Yg(u,k.get())),R=r(()=>Yg(d,N.get())),j=r(()=>S.get()[0]),O=r(()=>S.get().some(G=>l.get(G)?.get().status==="pending")),H=r(()=>({locationHref:x.get().href,resolvedLocationHref:E.get()?.href,status:h.get()})),P=r(()=>({status:h.get(),loadedAt:m.get(),isLoading:p.get(),isTransitioning:b.get(),matches:_.get(),location:x.get(),resolvedLocation:E.get(),statusCode:A.get(),redirect:w.get()})),Y=td(64);function X(G){let Q=Y.get(G);return Q||(Q=r(()=>{const se=S.get();for(const D of se){const B=l.get(D);if(B&&B.routeId===G)return B.get()}}),Y.set(G,Q)),Q}const Z={status:h,loadedAt:m,isLoading:p,isTransitioning:b,location:x,resolvedLocation:E,statusCode:A,redirect:w,matchesId:S,pendingIds:k,cachedIds:N,matches:_,pendingMatches:M,cachedMatches:R,firstId:j,hasPending:O,matchRouteDeps:H,matchStores:l,pendingMatchStores:u,cachedMatchStores:d,__store:P,getRouteMatchStore:X,setMatches:ee,setPending:V,setCached:z};ee(e.matches),a?.(Z);function ee(G){Gg(G,l,S,n,s)}function V(G){Gg(G,u,k,n,s)}function z(G){Gg(G,d,N,n,s)}return Z}function Yg(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Gg(e,t,n,r,s){const a=e.map(u=>u.id),l=new Set(a);s(()=>{for(const u of t.keys())l.has(u)||t.delete(u);for(const u of e){const d=t.get(u.id);if(!d){const h=r(u);h.routeId=u.routeId,t.set(u.id,h);continue}d.routeId=u.routeId,d.get()!==u&&d.set(u)}fL(n.get(),a)||n.set(a)})}const ub=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},FL=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Ip=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),po=(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 u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},QS=(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 u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:s},pa=(e,t,n)=>{if(!(!Rr(n)&&!ar(n)))throw Rr(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:Rr(n)?"redirected":ar(n)?"notFound":r.status==="pending"?"success":r.status,context:po(e,t.index),isFetching:!1,error:n})),ar(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Rr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},hN=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ZS=(e,t,n)=>{const r=po(e,n);e.updateMatch(t,s=>({...s,context:r}))},fc=(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,pa(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,pa(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&&!Rr(n)&&!ar(n)&&(e.serialError??=n)},pN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ip(e,t)&&(n.options.loader||n.options.beforeLoad||gN(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{ub(e)},s);r._nonReactive.pendingTimeout=a}},$L=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;pN(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&pa(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},VL=(e,t,n,r)=>{const s=e.router.getMatch(t);let a=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Gl(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=s;l&&fc(e,n,l),u&&fc(e,n,u),pN(e,t,r,s);const d=new AbortController;let h=!1;const m=()=>{h||(h=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:d})))},p=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{m(),p()});return}s._nonReactive.beforeLoadPromise=Gl();const b={...po(e,n,!1),...s.__routeContext},{search:x,params:E,cause:A}=s,w=Ip(e,t),S={search:x,abortController:d,params:E,preload:w,context:b,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":A,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},k=_=>{if(_===void 0){e.router.batch(()=>{m(),p()});return}(Rr(_)||ar(_))&&(m(),fc(e,n,_)),e.router.batch(()=>{m(),e.updateMatch(t,M=>({...M,__beforeLoadContext:_})),p()})};let N;try{if(N=r.options.beforeLoad(S),ed(N))return m(),N.catch(_=>{fc(e,n,_)}).then(k)}catch(_){m(),fc(e,n,_)}k(N)},qL=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>u(),l=()=>VL(e,n,t,s),u=()=>{if(hN(e,n))return;const d=$L(e,n,s);return ed(d)?d.then(l):l()};return a()},YL=(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,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},mN=(e,t,n,r,s)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(n),m=po(e,r),p=Ip(e,n);return{params:l,deps:u,preload:!!p,parentMatchPromise:a,abortController:d,context:m,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:p?"preload":h,route:s,...e.router.options.additionalContext}},JS=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(nN??e.router.isServer)||a.ssr===!0)&&nd(s);const l=s.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(mN(e,t,n,r,s)),h=!!u&&ed(d);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,p=>({...p,isFetching:"loader"})),u){const p=h?await d:d;pa(e,e.router.getMatch(n),p),p!==void 0&&e.updateMatch(n,b=>({...b,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const m=a._nonReactive.minPendingPromise;m&&await m,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,p=>({...p,error:void 0,context:po(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:po(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,ar(l)&&await s.options.notFoundComponent?.preload?.(),pa(e,e.router.getMatch(n),l);try{s.options.onError?.(l)}catch(h){u=h,pa(e,e.router.getMatch(n),h)}!Rr(u)&&!ar(u)&&await nd(s,["errorComponent"]),e.updateMatch(n,h=>({...h,error:u,context:po(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),pa(e,l,a)}},GL=async(e,t,n)=>{async function r(x,E,A,w,S){const k=Date.now()-E.updatedAt,N=x?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,_=S.options.shouldReload,M=typeof _=="function"?_(mN(e,t,s,n,S)):_,{status:R,invalid:j}=w,O=k>=N&&(!!e.forceStaleReload||w.cause==="enter"||A!==void 0&&A!==w.id);l=R==="success"&&(j||(M??O)),x&&S.options.preload===!1||(l&&!e.sync&&m?(u=!0,(async()=>{try{await JS(e,t,s,n,S);const H=e.router.getMatch(s);H._nonReactive.loaderPromise?.resolve(),H._nonReactive.loadPromise?.resolve(),H._nonReactive.loaderPromise=void 0,H._nonReactive.loadPromise=void 0}catch(H){Rr(H)&&await e.router.navigate(H.options)}})()):R!=="success"||l?await JS(e,t,s,n,S):ZS(e,s,n))}const{id:s,routeId:a}=e.matches[n];let l=!1,u=!1;const d=e.router.looseRoutesById[a],h=d.options.loader,m=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(hN(e,s)){if(!e.router.getMatch(s))return e.matches[n];ZS(e,s,n)}else{const x=e.router.getMatch(s),E=e.router.stores.matchesId.get()[n],A=(E&&e.router.stores.matchStores.get(E)||null)?.routeId===a?E:e.router.stores.matches.get().find(S=>S.routeId===a)?.id,w=Ip(e,s);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&m)return x;await x._nonReactive.loaderPromise;const S=e.router.getMatch(s),k=S._nonReactive.error||S.error;k&&pa(e,S,k),S.status==="pending"&&await r(w,x,A,S,d)}else{const S=w&&!e.router.stores.matchStores.has(s),k=e.router.getMatch(s);k._nonReactive.loaderPromise=Gl(),S!==k.preload&&e.updateMatch(s,N=>({...N,preload:S})),await r(w,x,A,k,d)}}const p=e.router.getMatch(s);u||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,u||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const b=u?p.isFetching:!1;return b!==p.isFetching||p.invalid!==!1?(e.updateMatch(s,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(s)):p};async function eC(e){const t=e,n=[];FL(t.router)&&ub(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=qL(t,b);ed(x)&&await x}catch(x){if(Rr(x))throw x;if(ar(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?QS(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,s):s;let u,d;for(let b=0;b<l;b++)n.push(GL(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 E=x.reason;if(Rr(E))throw E;ar(E)?u??=E:d??=E}if(d!==void 0)throw d}const h=u??(r&&!t.preload?r:void 0);let m=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const b=QS(t,h);b===void 0&&vi();const x=t.matches[b],E=t.router.looseRoutesById[x.routeId],A=t.router.options?.defaultNotFoundComponent;!E.options.notFoundComponent&&A&&(E.options.notFoundComponent=A),h.routeId=x.routeId;const w=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,S=>({...S,...w?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),m=b,await nd(E,["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 nd(b,["errorComponent"])}for(let b=0;b<=m;b++){const{id:x,routeId:E}=t.matches[b],A=t.router.looseRoutesById[E];try{const w=YL(t,x,A);if(w){const S=await w;t.updateMatch(x,k=>({...k,...S}))}}catch(w){console.error(`Error executing head for route ${E}:`,w)}}const p=ub(t);if(ed(p)&&await p,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function tC(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function nd(e,t=Mh){!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===Mh?(()=>{if(e._componentsPromise===void 0){const r=tC(e,Mh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():tC(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function gN(e){for(const t of Mh)if(e.options[t]?.preload)return!0;return!1}const Mh=["component","errorComponent","pendingComponent","notFoundComponent"];var ba="__TSR_index",nC="popstate",rC="beforeunload";function KL(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],m=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&h.length&&m)for(const p of h){const b=rd(d.path,d.state);if(await p.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,u,d)=>{const h=t.state[ba];u=sC(h+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const h=t.state[ba];u=sC(h,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),s({type:"GO",index:l})},navigateOpts:u,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[ba]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function sC(e,t){t||(t={});const n=Ox();return{...t,key:n,__TSR_key:n,[ba]:e}}function bN(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=O=>s=O,u=e?.createHref??(O=>O),d=e?.parseLocation??(()=>rd(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=Ox();t.history.replaceState({[ba]:0,key:O,__TSR_key:O},"")}let h=d(),m,p=!1,b=!1,x=!1,E=!1;const A=()=>h;let w,S;const k=()=>{w&&(j._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),j._ignoreSubscribers=!1,w=void 0,S=void 0,m=void 0)},N=(O,H,P)=>{const Y=u(H);S||(m=h),h=rd(H,P),w={href:Y,state:P,isPush:w?.isPush||O==="push"},S||(S=Promise.resolve().then(()=>k()))},_=O=>{h=d(),j.notify({type:O})},M=async()=>{if(b){b=!1;return}const O=d(),H=O.state[ba]-h.state[ba],P=H===1,Y=H===-1,X=!P&&!Y||p;p=!1;const Z=X?"GO":Y?"BACK":"FORWARD",ee=X?{type:"GO",index:H}:{type:Y?"BACK":"FORWARD"};if(x)x=!1;else{const V=a();if(typeof document<"u"&&V.length){for(const z of V)if(await z.blockerFn({currentLocation:h,nextLocation:O,action:Z})){b=!0,t.history.go(1),j.notify(ee);return}}}h=d(),j.notify(ee)},R=O=>{if(E){E=!1;return}let H=!1;const P=a();if(typeof document<"u"&&P.length)for(const Y of P){const X=Y.enableBeforeUnload??!0;if(X===!0){H=!0;break}if(typeof X=="function"&&X()===!0){H=!0;break}}if(H)return O.preventDefault(),O.returnValue=""},j=KL({getLocation:A,getLength:()=>t.history.length,pushState:(O,H)=>N("push",O,H),replaceState:(O,H)=>N("replace",O,H),back:O=>(O&&(x=!0),E=!0,t.history.back()),forward:O=>{O&&(x=!0),E=!0,t.history.forward()},go:O=>{p=!0,t.history.go(O)},createHref:O=>u(O),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(rC,R,{capture:!0}),t.removeEventListener(nC,M)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(rC,R,{capture:!0}),t.addEventListener(nC,M),t.history.pushState=function(...O){const H=n.apply(t.history,O);return j._ignoreSubscribers||_("PUSH"),H},t.history.replaceState=function(...O){const H=r.apply(t.history,O);return j._ignoreSubscribers||_("REPLACE"),H},j}function XL(e){const t=typeof document<"u"?window:void 0;return bN({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",s=t.location.search,a=n.slice(1);return rd(`${r}${s}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function WL(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function rd(e,t){const n=WL(e),r=n.indexOf("#"),s=n.indexOf("?"),a=Ox();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||{[ba]:0,key:a,__TSR_key:a}}}function Ox(){return(Math.random()+1).toString(36).substring(7)}function Pl(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 QL=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=wL(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=bN()),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 m;this.resolvePathCache=td(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=HL(JL(this.latestLocation),m),OL(this)}let u=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(a||s!==d||l!==h){this.basepath=d;const m=[],p=cN(d);p&&p!=="/"&&m.push(UL({basepath:d})),h&&m.push(h),this.rewrite=m.length===0?void 0:m.length===1?m[0]:zL(m),this.history&&this.updateLatestLocation(),u=!0}u&&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=yL(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&pL(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:h,hash:m,href:p,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(h),k=this.options.stringifySearch(S);return{href:d+k+m,publicHref:d+k+m,pathname:dc(d).path,external:!1,searchStr:k,search:Xa(r?.search,S),hash:dc(m.slice(1)).path,state:ao(r?.state,b)}}const x=new URL(p,this.origin),E=lb(this.rewrite,x),A=this.options.parseSearch(E.search),w=this.options.stringifySearch(A);return E.search=w,{href:E.href.replace(E.origin,""),publicHref:p,pathname:dc(E.pathname).path,external:!!this.rewrite&&E.origin!==this.origin,searchStr:w,search:Xa(r?.search,A),hash:dc(E.hash.slice(1)).path,state:ao(r?.state,b)}},a=s(n),{__tempLocation:l,__tempKey:u}=a.state;if(l&&(!u||u===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)=>CL({base:n,to:r.includes("//")?Ix(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=>e8({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,u=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??u.fullPath,h=a.to?`${a.to}`:void 0,m=u.search,p=Object.assign(Object.create(null),u.params),b=h?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=h?this.resolvePathWithBase(b,h):b,E=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?p:Object.assign(p,io(a.params,p)),A=this.routesByPath[yi(x)];let w;if(A)w=this.getRouteBranch(A);else if(x.includes("$"))w=[];else{const Y=this.getMatchedRoutes(x);w=Y.matchedRoutes,this.options.notFoundRoute&&(!Y.foundRoute||Y.foundRoute.path!=="/"&&Y.routeParams["**"])&&(w=[...w,this.options.notFoundRoute])}if(w.length&&sN(E))for(const Y of w){const X=Y.options.params?.stringify??Y.options.stringifyParams;if(X)try{Object.assign(E,X(E))}catch{}}const S=n.leaveParams?x:dc(GS({path:x,params:E,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let k=m;if(n._includeValidateSearch&&this.options.search?.strict){const Y={};w.forEach(X=>{if(X.options.validateSearch)try{Object.assign(Y,Lh(X.options.validateSearch,{...Y,...k}))}catch{}}),k=Y}k=t8({search:k,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),k=Xa(m,k);const N=this.options.stringifySearch(k),_=a.hash===!0?l.hash:a.hash?io(a.hash,l.hash):void 0,M=_?`#${_}`:"";let R=a.state===!0?l.state:a.state?io(a.state,l.state):{};R=ao(l.state,R);const j=`${S}${N}${M}`;let O,H,P=!1;if(this.rewrite){const Y=new URL(j,this.origin),X=fN(this.rewrite,Y);O=Y.href.replace(Y.origin,""),X.origin!==this.origin?(H=X.href,P=!0):H=X.pathname+X.search+X.hash}else O=dL(j),H=O;return{publicHref:H,href:O,pathname:S,search:k,searchStr:N,state:R,hash:_??"",external:P,unmaskOnReload:a.unmaskOnReload}},s=(a={},l)=>{const u=r(a);let d=l?r(l):void 0;if(!d){const h=Object.create(null);if(this.options.routeMasks){const m=mL(u.pathname,this.processedTree);if(m){Object.assign(h,m.rawParams);const{from:p,params:b,...x}=m.route,E=b===!1||b===null?Object.create(null):(b??!0)===!0?h:Object.assign(h,io(b,h));l={from:n.from,...x,params:E},d=r(l)}}}return d&&(u.maskedLocation=d),u};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 h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(p=>{s.state[p]=this.latestLocation.state[p]});const m=fo(s.state,this.latestLocation.state);return h.forEach(p=>{delete s.state[p]}),m},u=yi(this.latestLocation.href)===yi(s.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Gl(()=>{d?.resolve(),d=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=s.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](p.publicHref,p.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:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,b=rd(u,{__TSR_index:n?p:p+1}),x=new URL(b.pathname,this.origin);d.to=lb(this.rewrite,x).pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const m=this.commitLocation({...h,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:a,...l})=>{let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const h=this.buildLocation({to:n,...l});s=s??h.publicHref,a=a??h.publicHref}const d=!u&&a?a:s;if(Yh(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const h=this.history.getBlockers?.()??[];for(const m of h)if(m?.blockerFn&&await m.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 u=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const m=this.latestLocation,p=Pl(m,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...p}),this.emit({type:"onBeforeLoad",...p}),await eC({router:this,sync:n?.sync,forceStaleReload:u.href===m.href,matches:this.stores.pendingMatches.get(),location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,E=null,A=null;this.batch(()=>{const w=this.stores.pendingMatches.get(),S=w.length,k=this.stores.matches.get();b=S?k.filter(M=>!this.stores.pendingMatchStores.has(M.id)):null;const N=new Set;for(const M of this.stores.pendingMatchStores.values())M.routeId&&N.add(M.routeId);const _=new Set;for(const M of this.stores.matchStores.values())M.routeId&&_.add(M.routeId);x=S?k.filter(M=>!N.has(M.routeId)):null,E=S?w.filter(M=>!_.has(M.routeId)):null,A=S?w.filter(M=>_.has(M.routeId)):k,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(w),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(M=>M.status!=="error"&&M.status!=="notFound"&&M.status!=="redirected")]),this.clearExpiredCache())});for(const[w,S]of[[x,"onLeave"],[E,"onEnter"],[A,"onStay"]])if(w)for(const k of w)this.looseRoutesById[k.routeId].options[S]?.(k)})})}})}catch(m){Rr(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):ar(m)&&(a=m);const p=s?s.status:a?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(p),this.stores.redirect.set(s)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(h=>h.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(),u=typeof r.types=="function"?r.types(Pl(a,l)):r.types;if(u===!1){n();return}s={update:n,types:u}}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 u=r(l.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(h=>h!==n)):l.set(u)}})},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&&Yh(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=nd,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()]),u=s.filter(d=>!l.has(d.id));if(u.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...u])}try{return s=await eC({router:this,matches:s,location:r,preload:!0,updateMatch:(d,h)=>{a.has(d)?s=s.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),s}catch(d){if(Rr(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});ar(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(),u=gL(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!u||n.params&&!fo(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?fo(l.search,a.search,{partial:!0})?u.rawParams:!1:u.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??jL,parseSearch:e.parseSearch??DL,protocolAllowlist:e.protocolAllowlist??cL}),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=lN(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["**"]:yi(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const u=l?r8(this.options.notFoundMode,a):void 0,d=new Array(a.length),h=new Map;for(const m of this.stores.matchStores.values())m.routeId&&h.set(m.routeId,m.get());for(let m=0;m<a.length;m++){const p=a[m],b=d[m-1];let x,E,A;{const X=b?.search??e.search,Z=b?._strictSearch??void 0;try{const ee=Lh(p.options.validateSearch,{...X})??void 0;x={...X,...ee},E={...Z,...ee},A=void 0}catch(ee){let V=ee;if(ee instanceof Kh||(V=new Kh(ee.message,{cause:ee})),t?.throwOnError)throw V;x=X,E={},A=V}}const w=p.options.loaderDeps?.({search:x})??"",S=w?JSON.stringify(w):"",{interpolatedPath:k,usedParams:N}=GS({path:p.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),_=p.id+k+S,M=this.getMatch(_),R=h.get(p.id),j=M?._strictParams??N;let O;if(!M)try{iC(p,j)}catch(X){if(ar(X)||Rr(X)?O=X:O=new ZL(X.message,{cause:X}),t?.throwOnError)throw O}Object.assign(s,j);const H=R?"stay":"enter";let P;if(M)P={...M,cause:H,params:R?.params??s,_strictParams:j,search:Xa(R?R.search:M.search,x),_strictSearch:E};else{const X=p.options.loader||p.options.beforeLoad||p.lazyFn||gN(p)?"pending":"success";P={id:_,ssr:p.options.ssr,index:m,routeId:p.id,params:R?.params??s,_strictParams:j,pathname:k,updatedAt:Date.now(),search:R?Xa(R.search,x):x,_strictSearch:E,searchError:void 0,status:X,isFetching:!1,error:void 0,paramsError:O,__routeContext:void 0,_nonReactive:{loadPromise:Gl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:H,loaderDeps:R?ao(R.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}t?.preload||(P.globalNotFound=u===p.id),P.searchError=A;const Y=this.getParentContext(b);P.context={...Y,...P.__routeContext,...P.__beforeLoadContext},d[m]=P}for(let m=0;m<d.length;m++){const p=d[m],b=this.looseRoutesById[p.routeId],x=this.getMatch(p.id),E=h.get(p.routeId);if(p.params=E?Xa(E.params,s):s,!x){const A=d[m-1],w=this.getParentContext(A);if(b.options.context){const S={deps:p.loaderDeps,params:p.params,context:w??{},location:e,navigate:k=>this.navigate({...k,_fromLocation:e}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:d,routeId:b.id};p.__routeContext=b.options.context(S)??void 0}p.context={...w,...p.__routeContext,...p.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=Jc(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=Jc(r),l={...e.search};for(const p of r)try{Object.assign(l,Lh(p.options.validateSearch,l))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),d=u&&u.routeId===a.id&&u.pathname===e.pathname;let h;if(d)h=u.params;else{const p=Object.assign(Object.create(null),s);for(const b of r)try{iC(b,p)}catch{}h=p}const m={matchedRoutes:r,fullPath:a.fullPath,search:l,params:h};return this.lightweightCache.set(e,[t,m]),m}},Kh=class extends Error{},ZL=class extends Error{};function JL(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Lh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Kh("Async validation not supported");if(n.issues)throw new Kh(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 e8({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=yi(e);let a;const l=bL(s,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function t8({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return n8(n)(e,t,r??!1)}function n8(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:h,next:m})=>{const p=m(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),h):h);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),p):p};r.push(d)}const u=l.validateSearch;if(u){const d=({search:h,next:m,meta:p})=>{const b=m(h);if(n)try{const x=Lh(u,b);if(p&&x)for(const E in x)E in b||(p.defaulted||=new Map).set(E,x[E]);return{...b,...x}}catch{}return b};r.push(d)}}const s=(a,l,u)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const h=io(t.search,l);return u&&(u.explicit=h),h}const d=(h,m)=>{if(m){const p=u||{};return{search:s(a+1,h,p),meta:p}}return s(a+1,h,u)};return r[a]({search:l,next:d,meta:u})};return function(l,u,d){return t=u,n=d,s(0,l)}}function r8(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 ho}function iC(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 s8="Error preloading route! ☝️";var xN=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=ho:this.parentRoute||vi();let s=r?ho:n?.path;s&&s!=="/"&&(s=uN(s));const a=n?.id||s;let l=r?ho:Ih([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);s==="__root__"&&(s="/"),l!=="__root__"&&(l=Ih(["/",l]));const u=l==="__root__"?"/":Ih([this.parentRoute.fullPath,s]);this._path=s,this._id=l,this._fullPath=u,this._to=yi(u)},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=>Rp({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.")}},i8=class extends xN{constructor(e){super(e)}};function Mx(e){const t=e.errorComponent??Lx;return f.jsx(a8,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}var a8=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 Lx({error:e}){const[t,n]=y.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.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"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function o8({children:e,fallback:t=null}){return yN()?f.jsx($e.Fragment,{children:e}):f.jsx($e.Fragment,{children:t})}function yN(){return $e.useSyncExternalStore(l8,()=>!0,()=>!1)}function l8(){return()=>{}}var vN=y.createContext(null);function Kr(e){return y.useContext(vN)}var Op=y.createContext(void 0),u8=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 c8({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:a,checkDirty:l,shallowPropagate:u};function r(h,m,p){const b=m.depsTail;if(b!==void 0&&b.dep===h)return;const x=b!==void 0?b.nextDep:m.deps;if(x!==void 0&&x.dep===h){x.version=p,m.depsTail=x;return}const E=h.subsTail;if(E!==void 0&&E.version===p&&E.sub===m)return;const A=m.depsTail=h.subsTail={version:p,dep:h,sub:m,prevDep:b,nextDep:x,prevSub:E,nextSub:void 0};x!==void 0&&(x.prevDep=A),b!==void 0?b.nextDep=A:m.deps=A,E!==void 0?E.nextSub=A:h.subs=A}function s(h,m=h.sub){const p=h.dep,b=h.prevDep,x=h.nextDep,E=h.nextSub,A=h.prevSub;return x!==void 0?x.prevDep=b:m.depsTail=b,b!==void 0?b.nextDep=x:m.deps=x,E!==void 0?E.prevSub=A:p.subsTail=A,A!==void 0?A.nextSub=E:(p.subs=E)===void 0&&n(p),x}function a(h){let m=h.nextSub,p;e:do{const b=h.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(h,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 E=b.subs;if(E!==void 0){const A=(h=E).nextSub;A!==void 0&&(p={value:m,prev:p},m=A);continue}}if((h=m)!==void 0){m=h.nextSub;continue}for(;p!==void 0;)if(h=p.value,p=p.prev,h!==void 0){m=h.nextSub;continue e}break}while(!0)}function l(h,m){let p,b=0,x=!1;e:do{const E=h.dep,A=E.flags;if(m.flags&16)x=!0;else if((A&17)===17){if(e(E)){const w=E.subs;w.nextSub!==void 0&&u(w),x=!0}}else if((A&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(p={value:h,prev:p}),h=E.deps,m=E,++b;continue}if(!x){const w=h.nextDep;if(w!==void 0){h=w;continue}}for(;b--;){const w=m.subs,S=w.nextSub!==void 0;if(S?(h=p.value,p=p.prev):h=w,x){if(e(m)){S&&u(w),m=h.sub;continue}x=!1}else m.flags&=-33;m=h.sub;const k=h.nextDep;if(k!==void 0){h=k;continue e}}return x}while(!0)}function u(h){do{const m=h.sub,p=m.flags;(p&48)===32&&(m.flags=p|16,(p&6)===2&&t(m))}while((h=h.nextSub)!==void 0)}function d(h,m){let p=m.depsTail;for(;p!==void 0;){if(p===h)return!0;p=p.prevDep}return!1}}function d8(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 cb=[];let Dh=0;const{link:aC,unlink:f8,propagate:h8,checkDirty:EN,shallowPropagate:oC}=c8({update(e){return e._update()},notify(e){cb[db++]=e,e.flags&=~mn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=mn.Mutable|mn.Dirty,Xh(e))}});let Zf=0,db=0,Bs,fb=0;function TN(e){try{++fb,e()}finally{--fb||SN()}}function Xh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=f8(n,e)}function SN(){if(!(fb>0)){for(;Zf<db;){const e=cb[Zf];cb[Zf++]=void 0,e.notify()}Zf=0,db=0}}function lC(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 Bs!==void 0&&aC(s,Bs,Dh),s._snapshot},subscribe(a){const l=d8(a),u={current:!1},d=p8(()=>{s.get(),u.current?l.next?.(s._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Bs,u=t?.compare??Object.is;if(n)Bs=s,++Dh,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=mn.Mutable|mn.RecursedCheck);try{const d=s._snapshot,h=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,h)?(s._snapshot=h,!0):!1}finally{Bs=l,n&&(s.flags&=~mn.RecursedCheck),Xh(s)}}};return n?(s.flags=mn.Mutable|mn.Dirty,s.get=function(){const a=s.flags;if(a&mn.Dirty||a&mn.Pending&&EN(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&oC(l)}}else a&mn.Pending&&(s.flags=a&~mn.Pending);return Bs!==void 0&&aC(s,Bs,Dh),s._snapshot}):s.set=function(a){if(s._update(a)){const l=s.subs;l!==void 0&&(h8(l),oC(l),SN())}},s}function p8(e){const t=()=>{const r=Bs;Bs=n,++Dh,n.depsTail=void 0,n.flags=mn.Watching|mn.RecursedCheck;try{return e()}finally{Bs=r,n.flags&=~mn.RecursedCheck,Xh(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&&EN(this.deps,this)?t():this.flags=mn.Watching},stop(){this.flags=mn.None,this.depsTail=void 0,Xh(this)}};return t(),n}var Kg={exports:{}},Xg={},Wg={exports:{}},Qg={};/**
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 uC;function m8(){if(uC)return Qg;uC=1;var e=xd();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(p,b){var x=b(),E=r({inst:{value:x,getSnapshot:b}}),A=E[0].inst,w=E[1];return a(function(){A.value=x,A.getSnapshot=b,d(A)&&w({inst:A})},[p,x,b]),s(function(){return d(A)&&w({inst:A}),p(function(){d(A)&&w({inst:A})})},[p]),l(x),x}function d(p){var b=p.getSnapshot;p=p.value;try{var x=b();return!n(p,x)}catch{return!0}}function h(p,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Qg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Qg}var cC;function CN(){return cC||(cC=1,Wg.exports=m8()),Wg.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 dC;function g8(){if(dC)return Xg;dC=1;var e=xd(),t=CN();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Xg.useSyncExternalStoreWithSelector=function(h,m,p,b,x){var E=a(null);if(E.current===null){var A={hasValue:!1,value:null};E.current=A}else A=E.current;E=u(function(){function S(R){if(!k){if(k=!0,N=R,R=b(R),x!==void 0&&A.hasValue){var j=A.value;if(x(j,R))return _=j}return _=R}if(j=_,r(N,R))return j;var O=b(R);return x!==void 0&&x(j,O)?(N=R,j):(N=R,_=O)}var k=!1,N,_,M=p===void 0?null:p;return[function(){return S(m())},M===null?void 0:function(){return S(M())}]},[m,p,b,x]);var w=s(h,E[0],E[1]);return l(function(){A.hasValue=!0,A.value=w},[w]),d(w),w},Xg}var fC;function b8(){return fC||(fC=1,Kg.exports=g8()),Kg.exports}var wN=b8();function x8(e,t){return e===t}function gr(e,t,n=x8){const r=y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),s=y.useCallback(()=>e?.get(),[e]);return wN.useSyncExternalStoreWithSelector(r,s,s,t,n)}var Zg={get(){},subscribe(){return{unsubscribe(){}}}};function kN(e,t){const n=y.useRef();return r=>{const s=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ao(n.current,s):s}}function Ao(e){const t=Kr(),n=y.useContext(e.from?u8:Op),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),s=kN(e,t),a=gr(r??Zg,l=>l?s(l):Zg);if(a!==Zg)return a;(e.shouldThrow??!0)&&vi()}function NN(e){return Ao({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function AN(e){const{select:t,...n}=e;return Ao({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function au(e){return Ao({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 _N(e){return Ao({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ws(e){const t=Kr();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function RN(e){return Ao({...e,select:t=>e.select?e.select(t.context):t.context})}var or=Jk();const y8=Ap(or);function v8(e,t){const n=Kr(),r=iL(t),{activeProps:s,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:h,preloadIntentProximity:m,hashScrollIntoView:p,replace:b,startTransition:x,resetScroll:E,viewTransition:A,children:w,target:S,disabled:k,style:N,className:_,onClick:M,onBlur:R,onFocus:j,onMouseEnter:O,onMouseLeave:H,onTouchStart:P,ignoreBlocker:Y,params:X,search:Z,hash:ee,state:V,mask:z,reloadDocument:G,unsafeRelative:Q,from:se,_fromLocation:D,...B}=e,$=yN(),L=y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),te=gr(n.stores.location,ae=>ae,(ae,K)=>ae.href===K.href),ne=y.useMemo(()=>{const ae={_fromLocation:te,...L};return n.buildLocation(ae)},[n,te,L]),ce=ne.maskedLocation?ne.maskedLocation.publicHref:ne.publicHref,fe=ne.maskedLocation?ne.maskedLocation.external:ne.external,de=y.useMemo(()=>k8(ce,fe,n.history,k),[k,fe,ce,n.history]),xe=y.useMemo(()=>{if(de?.external)return Yh(de.href,n.protocolAllowlist)?void 0:de.href;if(!N8(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Yh(u,n.protocolAllowlist)?void 0:u}catch{}},[u,de,n.protocolAllowlist]),Fe=y.useMemo(()=>{if(xe)return!1;if(l?.exact){if(!SL(te.pathname,ne.pathname,n.basepath))return!1}else{const ae=Gh(te.pathname,n.basepath),K=Gh(ne.pathname,n.basepath);if(!(ae.startsWith(K)&&(ae.length===K.length||ae[K.length]==="/")))return!1}return(l?.includeSearch??!0)&&!fo(te.search,ne.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?$&&te.hash===ne.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,te,xe,$,ne.hash,ne.pathname,ne.search,n.basepath]),De=Fe?io(s,{})??E8:Jg,Te=Fe?Jg:io(a,{})??Jg,Oe=[_,De.className,Te.className].filter(Boolean).join(" "),ze=(N||De.style||Te.style)&&{...N,...De.style,...Te.style},[Xe,Ye]=y.useState(!1),Le=y.useRef(!1),ke=e.reloadDocument||xe?!1:d??n.options.defaultPreload,Ee=h??n.options.defaultPreloadDelay??0,Ie=y.useCallback(()=>{n.preloadRoute({...L,_builtLocation:ne}).catch(ae=>{console.warn(ae),console.warn(s8)})},[n,L,ne]);sL(r,y.useCallback(ae=>{ae?.isIntersecting&&Ie()},[Ie]),w8,{disabled:!!k||ke!=="viewport"}),y.useEffect(()=>{Le.current||!k&&ke==="render"&&(Ie(),Le.current=!0)},[k,Ie,ke]);const je=ae=>{const K=ae.currentTarget.getAttribute("target"),F=S!==void 0?S:K;if(!k&&!A8(ae)&&!ae.defaultPrevented&&(!F||F==="_self")&&ae.button===0){ae.preventDefault(),or.flushSync(()=>{Ye(!0)});const le=n.subscribe("onResolved",()=>{le(),Ye(!1)});n.navigate({...L,replace:b,resetScroll:E,hashScrollIntoView:p,startTransition:x,viewTransition:A,ignoreBlocker:Y})}};if(xe)return{...B,ref:r,href:xe,...w&&{children:w},...S&&{target:S},...k&&{disabled:k},...N&&{style:N},..._&&{className:_},...M&&{onClick:M},...R&&{onBlur:R},...j&&{onFocus:j},...O&&{onMouseEnter:O},...H&&{onMouseLeave:H},...P&&{onTouchStart:P}};const J=ae=>{if(k||ke!=="intent")return;if(!Ee){Ie();return}const K=ae.currentTarget;if(hc.has(K))return;const F=setTimeout(()=>{hc.delete(K),Ie()},Ee);hc.set(K,F)},pe=ae=>{k||ke!=="intent"||Ie()},oe=ae=>{if(k||!ke||!Ee)return;const K=ae.currentTarget,F=hc.get(K);F&&(clearTimeout(F),hc.delete(K))};return{...B,...De,...Te,href:de?.href,ref:r,onClick:Cl([M,je]),onBlur:Cl([R,oe]),onFocus:Cl([j,J]),onMouseEnter:Cl([O,J]),onMouseLeave:Cl([H,oe]),onTouchStart:Cl([P,pe]),disabled:!!k,target:S,...ze&&{style:ze},...Oe&&{className:Oe},...k&&T8,...Fe&&S8,...$&&Xe&&C8}}var Jg={},E8={className:"active"},T8={role:"link","aria-disabled":!0},S8={"data-status":"active","aria-current":"page"},C8={"data-transitioning":"transitioning"},hc=new WeakMap,w8={rootMargin:"100px"},Cl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function k8(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function N8(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Mp=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=v8(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return y.createElement("a",d,l)}return y.createElement(n,a,l)});function A8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var _8=class extends xN{constructor(e){super(e),this.useMatch=t=>Ao({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>RN({...t,from:this.id}),this.useSearch=t=>_N({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>au({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>AN({...t,from:this.id}),this.useLoaderData=t=>NN({...t,from:this.id}),this.useNavigate=()=>ws({from:this.fullPath}),this.Link=$e.forwardRef((t,n)=>f.jsx(Mp,{ref:n,from:this.fullPath,...t}))}};function ks(e){return new _8(e)}var R8=class extends i8{constructor(e){super(e),this.useMatch=t=>Ao({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>RN({...t,from:this.id}),this.useSearch=t=>_N({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>au({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>AN({...t,from:this.id}),this.useLoaderData=t=>NN({...t,from:this.id}),this.useNavigate=()=>ws({from:this.fullPath}),this.Link=$e.forwardRef((t,n)=>f.jsx(Mp,{ref:n,from:this.fullPath,...t}))}};function I8(e){return new R8(e)}function O8(e){const t=Kr(),n=`not-found-${gr(t.stores.location,r=>r.pathname)}-${gr(t.stores.status,r=>r)}`;return f.jsx(Mx,{getResetKey:()=>n,onCatch:(r,s)=>{if(ar(r))e.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(ar(r))return e.fallback?.(r);throw r},children:e.children})}function M8(){return f.jsx("p",{children:"Not Found"})}function Il(e){return f.jsx(f.Fragment,{children:e.children})}function IN(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(M8,{})}function L8(e){return null}function D8(){return L8(Kr()),null}var j8=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,P8=(e,t)=>e[0]===t[0]&&e[1]===t[1],ON=y.memo(function({matchId:t}){const n=Kr(),r=n.stores.matchStores.get(t);r||vi();const s=gr(n.stores.loadedAt,l=>l),a=gr(r,l=>l,j8);return f.jsx(B8,{router:n,matchId:t,resetKey:s,matchState:y.useMemo(()=>{const l=a.routeId,u=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function B8({router:e,matchId:t,resetKey:n,matchState:r}){const s=e.routesById[r.routeId],a=s.options.pendingComponent??e.options.defaultPendingComponent,l=a?f.jsx(a,{}):null,u=s.options.errorComponent??e.options.defaultErrorComponent,d=s.options.onCatch??e.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??e.options.notFoundRoute?.options.component:s.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!s.isRoot||s.options.wrapInSuspense||m)&&(s.options.wrapInSuspense??a??(s.options.errorComponent?.preload||m))?y.Suspense:Il,b=u?Mx:Il,x=h?O8:Il;return f.jsxs(s.isRoot?s.options.shellComponent??Il:Il,{children:[f.jsx(Op.Provider,{value:t,children:f.jsx(p,{fallback:l,children:f.jsx(b,{getResetKey:()=>n,errorComponent:u||Lx,onCatch:(E,A)=>{if(ar(E))throw E.routeId??=r.routeId,E;d?.(E,A)},children:f.jsx(x,{fallback:E=>{if(E.routeId??=r.routeId,!h||E.routeId&&E.routeId!==r.routeId||!E.routeId&&!s.isRoot)throw E;return y.createElement(h,E)},children:m||r._displayPending?f.jsx(o8,{fallback:l,children:f.jsx(hC,{matchId:t})}):f.jsx(hC,{matchId:t})})})})}),r.parentRouteId===ho?f.jsxs(f.Fragment,{children:[f.jsx(z8,{}),e.options.scrollRestoration&&nN?f.jsx(D8,{}):null]}):null]})}function z8(){const e=Kr(),t=y.useRef();return Ac(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...Pl(e.stores.location.get(),r??n)}),t.current=n},[gr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var hC=y.memo(function({matchId:t}){const n=Kr(),r=(m,p)=>n.getMatch(m.id)?._nonReactive[p]??m._nonReactive[p],s=n.stores.matchStores.get(t);s||vi();const a=gr(s,m=>m),l=a.routeId,u=n.routesById[l],d=y.useMemo(()=>{const m=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return m?JSON.stringify(m):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),h=y.useMemo(()=>{const m=u.options.component??n.options.defaultComponent;return m?f.jsx(m,{},d):f.jsx(MN,{})},[d,u.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const m=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(m){const p=n.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const b=Gl();p._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw r(a,"loadPromise")}if(a.status==="notFound")return ar(a.error)||vi(),IN(n,u,a.error);if(a.status==="redirected")throw Rr(a.error)||vi(),r(a,"loadPromise");if(a.status==="error")throw a.error;return h}),MN=y.memo(function(){const t=Kr(),n=y.useContext(Op);let r,s=!1,a;{const h=n?t.stores.matchStores.get(n):void 0;[r,s]=gr(h,m=>[m?.routeId,m?.globalNotFound??!1],P8),a=gr(t.stores.matchesId,m=>m[m.findIndex(p=>p===n)+1])}const l=r?t.routesById[r]:void 0,u=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return l||vi(),IN(t,l,void 0);if(!a)return null;const d=f.jsx(ON,{matchId:a});return r===ho?f.jsx(y.Suspense,{fallback:u,children:d}):d});function U8(){const e=Kr(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),s=gr(e.stores.isLoading,p=>p),a=gr(e.stores.hasPending,p=>p),l=Hg(s),u=s||n||a,d=Hg(u),h=s||a,m=Hg(h);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return yi(e.latestLocation.publicHref)!==yi(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{p()}},[e,e.history]),Ac(()=>{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]),Ac(()=>{l&&!s&&e.emit({type:"onLoad",...Pl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,s]),Ac(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...Pl(e.stores.location.get(),e.stores.resolvedLocation.get())})},[h,m,e]),Ac(()=>{if(d&&!u){const p=Pl(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...p}),TN(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,d,e]),null}function H8(){const e=Kr(),t=e.routesById[ho].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Il:y.Suspense,{fallback:n,children:[f.jsx(U8,{}),f.jsx(F8,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function F8(){const e=Kr(),t=gr(e.stores.firstId,s=>s),n=gr(e.stores.loadedAt,s=>s),r=t?f.jsx(ON,{matchId:t}):null;return f.jsx(Op.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(Mx,{getResetKey:()=>n,errorComponent:Lx,onCatch:void 0,children:r})})}var $8=e=>({createMutableStore:lC,createReadonlyStore:lC,batch:TN}),V8=e=>new q8(e),q8=class extends QL{constructor(e){super(e,$8)}};function Y8({router:e,children:t,...n}){sN(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(vN.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function G8({router:e,...t}){return f.jsx(Y8,{router:e,...t,children:f.jsx(H8,{})})}function yd(e){const t=Kr({warn:e?.router===void 0}),n=e?.router||t;return gr(n.stores.__store,kN(e,n))}function LN(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=LN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=LN(e))&&(r&&(r+=" "),r+=t);return r}const pC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mC=Lp,DN=(e,t)=>n=>{var r;if(t?.variants==null)return mC(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(h=>{const m=n?.[h],p=a?.[h];if(m===null)return null;const b=pC(m)||pC(p);return s[h][b]}),u=n&&Object.entries(n).reduce((h,m)=>{let[p,b]=m;return b===void 0||(h[p]=b),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:p,className:b,...x}=m;return Object.entries(x).every(E=>{let[A,w]=E;return Array.isArray(w)?w.includes({...a,...u}[A]):{...a,...u}[A]===w})?[...h,p,b]:h},[]);return mC(e,l,d,n?.class,n?.className)},K8=(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},X8=(e,t)=>({classGroupId:e,validator:t}),jN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wh="-",gC=[],W8="arbitrary..",Q8=e=>{const t=J8(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Z8(l);const u=l.split(Wh),d=u[0]===""&&u.length>1?1:0;return PN(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?K8(h,d):d:h||gC}return n[l]||gC}}},PN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const h=PN(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Wh):e.slice(t).join(Wh),d=l.length;for(let h=0;h<d;h++){const m=l[h];if(m.validator(u))return m.classGroupId}},Z8=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?W8+r:void 0})(),J8=e=>{const{theme:t,classGroups:n}=e;return eD(n,t)},eD=(e,t)=>{const n=jN();for(const r in e){const s=e[r];Dx(s,n,r,t)}return n},Dx=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];tD(l,t,n,r)}},tD=(e,t,n,r)=>{if(typeof e=="string"){nD(e,t,n);return}if(typeof e=="function"){rD(e,t,n,r);return}sD(e,t,n,r)},nD=(e,t,n)=>{const r=e===""?t:BN(t,e);r.classGroupId=n},rD=(e,t,n,r)=>{if(iD(e)){Dx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(X8(n,e))},sD=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,d]=s[l];Dx(d,BN(t,u),n,r)}},BN=(e,t)=>{let n=e;const r=t.split(Wh),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=jN(),n.nextPart.set(l,u)),n=u}return n},iD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,aD=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)}}},hb="!",bC=":",oD=[],xC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),lD=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,d=0,h;const m=s.length;for(let A=0;A<m;A++){const w=s[A];if(l===0&&u===0){if(w===bC){a.push(s.slice(d,A)),d=A+1;continue}if(w==="/"){h=A;continue}}w==="["?l++:w==="]"?l--:w==="("?u++:w===")"&&u--}const p=a.length===0?s:s.slice(d);let b=p,x=!1;p.endsWith(hb)?(b=p.slice(0,-1),x=!0):p.startsWith(hb)&&(b=p.slice(1),x=!0);const E=h&&h>d?h-d:void 0;return xC(a,x,b,E)};if(t){const s=t+bC,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):xC(oD,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},uD=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],u=l[0]==="[",d=t.has(l);u||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}},cD=e=>({cache:aD(e.cacheSize),parseClassName:lD(e),sortModifiers:uD(e),postfixLookupClassGroupIds:dD(e),...Q8(e)}),dD=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},fD=/\s+/,hD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:l}=t,u=[],d=e.trim().split(fD);let h="";for(let m=d.length-1;m>=0;m-=1){const p=d[m],{isExternal:b,modifiers:x,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:w}=n(p);if(b){h=p+(h.length>0?" "+h:h);continue}let S=!!w,k;if(S){const j=A.substring(0,w);k=r(j);const O=k&&l[k]?r(A):void 0;O&&O!==k&&(k=O,S=!1)}else k=r(A);if(!k){if(!S){h=p+(h.length>0?" "+h:h);continue}if(k=r(A),!k){h=p+(h.length>0?" "+h:h);continue}S=!1}const N=x.length===0?"":x.length===1?x[0]:a(x).join(":"),_=E?N+hb:N,M=_+k;if(u.indexOf(M)>-1)continue;u.push(M);const R=s(k,S);for(let j=0;j<R.length;++j){const O=R[j];u.push(_+O)}h=p+(h.length>0?" "+h:h)}return h},pD=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=zN(n))&&(s&&(s+=" "),s+=r);return s},zN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zN(e[r]))&&(n&&(n+=" "),n+=t);return n},pb=(e,...t)=>{let n,r,s,a;const l=d=>{const h=t.reduce((m,p)=>p(m),e());return n=cD(h),r=n.cache.get,s=n.cache.set,a=u,u(d)},u=d=>{const h=r(d);if(h)return h;const m=hD(d,n);return s(d,m),m};return a=l,(...d)=>a(pD(...d))},mD=[],Bn=e=>{const t=n=>n[e]||mD;return t.isThemeGetter=!0,t},UN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xD=/\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$/,yD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ED=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ra=e=>gD.test(e),Et=e=>!!e&&!Number.isNaN(Number(e)),Ls=e=>!!e&&Number.isInteger(Number(e)),e1=e=>e.endsWith("%")&&Et(e.slice(0,-1)),hi=e=>bD.test(e),FN=()=>!0,TD=e=>xD.test(e)&&!yD.test(e),jx=()=>!1,SD=e=>vD.test(e),CD=e=>ED.test(e),wD=e=>!Ze(e)&&!Je(e),kD=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)),ND=e=>Sa(e,qN,jx),Ze=e=>UN.test(e),Wa=e=>Sa(e,YN,TD),yC=e=>Sa(e,DD,Et),AD=e=>Sa(e,KN,FN),_D=e=>Sa(e,GN,jx),vC=e=>Sa(e,$N,jx),RD=e=>Sa(e,VN,CD),Jf=e=>Sa(e,XN,SD),Je=e=>HN.test(e),pc=e=>_o(e,YN),ID=e=>_o(e,GN),EC=e=>_o(e,$N),OD=e=>_o(e,qN),MD=e=>_o(e,VN),eh=e=>_o(e,XN,!0),LD=e=>_o(e,KN,!0),Sa=(e,t,n)=>{const r=UN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},_o=(e,t,n=!1)=>{const r=HN.exec(e);return r?r[1]?t(r[1]):n:!1},$N=e=>e==="position"||e==="percentage",VN=e=>e==="image"||e==="url",qN=e=>e==="length"||e==="size"||e==="bg-size",YN=e=>e==="length",DD=e=>e==="number",GN=e=>e==="family-name",KN=e=>e==="number"||e==="weight",XN=e=>e==="shadow",mb=()=>{const e=Bn("color"),t=Bn("font"),n=Bn("text"),r=Bn("font-weight"),s=Bn("tracking"),a=Bn("leading"),l=Bn("breakpoint"),u=Bn("container"),d=Bn("spacing"),h=Bn("radius"),m=Bn("shadow"),p=Bn("inset-shadow"),b=Bn("text-shadow"),x=Bn("drop-shadow"),E=Bn("blur"),A=Bn("perspective"),w=Bn("aspect"),S=Bn("ease"),k=Bn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[..._(),Je,Ze],R=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],O=()=>[Je,Ze,d],H=()=>[ra,"full","auto",...O()],P=()=>[Ls,"none","subgrid",Je,Ze],Y=()=>["auto",{span:["full",Ls,Je,Ze]},Ls,Je,Ze],X=()=>[Ls,"auto",Je,Ze],Z=()=>["auto","min","max","fr",Je,Ze],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...O()],G=()=>[ra,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],Q=()=>[ra,"screen","full","dvw","lvw","svw","min","max","fit",...O()],se=()=>[ra,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],D=()=>[e,Je,Ze],B=()=>[..._(),EC,vC,{position:[Je,Ze]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",OD,ND,{size:[Je,Ze]}],te=()=>[e1,pc,Wa],ne=()=>["","none","full",h,Je,Ze],ce=()=>["",Et,pc,Wa],fe=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Et,e1,EC,vC],Fe=()=>["","none",E,Je,Ze],De=()=>["none",Et,Je,Ze],Te=()=>["none",Et,Je,Ze],Oe=()=>[Et,Je,Ze],ze=()=>[ra,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hi],breakpoint:[hi],color:[FN],container:[hi],"drop-shadow":[hi],ease:["in","out","in-out"],font:[wD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hi],shadow:[hi],spacing:["px",Et],text:[hi],"text-shadow":[hi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ra,Ze,Je,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Je,Ze]}],"container-named":[kD],columns:[{columns:[Et,Ze,Je,u]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:M()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Ls,"auto",Je,Ze]}],basis:[{basis:[ra,"full","auto",u,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Et,ra,"auto","initial","none",Ze]}],grow:[{grow:["",Et,Je,Ze]}],shrink:[{shrink:["",Et,Je,Ze]}],order:[{order:[Ls,"first","last","none",Je,Ze]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[u,"screen",...G()]}],"min-w":[{"min-w":[u,"screen","none",...G()]}],"max-w":[{"max-w":[u,"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,pc,Wa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,LD,AD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",e1,Ze]}],"font-family":[{font:[ID,_D,t]}],"font-features":[{"font-features":[Ze]}],"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,Je,Ze]}],"line-clamp":[{"line-clamp":[Et,"none",Je,yC]}],leading:[{leading:[a,...O()]}],"list-image":[{"list-image":["none",Je,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Je,Ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Et,"from-font","auto",Je,Wa]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Et,"auto",Je,Ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[Ls,Je,Ze]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Je,Ze]}],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",Je,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ls,Je,Ze],radial:["",Je,Ze],conic:[Ls,Je,Ze]},MD,RD]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"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:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Et,Je,Ze]}],"outline-w":[{outline:["",Et,pc,Wa]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",m,eh,Jf]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",p,eh,Jf]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Et,Wa]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",b,eh,Jf]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[Et,Je,Ze]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"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":[Et]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Je,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Et]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Je,Ze]}],filter:[{filter:["","none",Je,Ze]}],blur:[{blur:Fe()}],brightness:[{brightness:[Et,Je,Ze]}],contrast:[{contrast:[Et,Je,Ze]}],"drop-shadow":[{"drop-shadow":["","none",x,eh,Jf]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",Et,Je,Ze]}],"hue-rotate":[{"hue-rotate":[Et,Je,Ze]}],invert:[{invert:["",Et,Je,Ze]}],saturate:[{saturate:[Et,Je,Ze]}],sepia:[{sepia:["",Et,Je,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Je,Ze]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[Et,Je,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[Et,Je,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Et,Je,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Et,Je,Ze]}],"backdrop-invert":[{"backdrop-invert":["",Et,Je,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[Et,Je,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[Et,Je,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Et,Je,Ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Je,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Et,"initial",Je,Ze]}],ease:[{ease:["linear","initial",S,Je,Ze]}],delay:[{delay:[Et,Je,Ze]}],animate:[{animate:["none",k,Je,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,Je,Ze]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[Je,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Ls,Je,Ze]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Je,Ze]}],"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":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Je,Ze]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Et,pc,Wa,yC]}],stroke:[{stroke:["none",...D()]}],"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"]}},jD=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Ol(e,"cacheSize",t),Ol(e,"prefix",n),Ol(e,"experimentalParseClassName",r),th(e.theme,a.theme),th(e.classGroups,a.classGroups),th(e.conflictingClassGroups,a.conflictingClassGroups),th(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Ol(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Ol(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),nh(e.theme,s.theme),nh(e.classGroups,s.classGroups),nh(e.conflictingClassGroups,s.conflictingClassGroups),nh(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),gb(e,s,"postfixLookupClassGroups"),gb(e,s,"orderSensitiveModifiers"),e),Ol=(e,t,n)=>{n!==void 0&&(e[t]=n)},th=(e,t)=>{if(t)for(const n in t)Ol(e,n,t[n])},nh=(e,t)=>{if(t)for(const n in t)gb(e,t,n)},gb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},PD=(e,...t)=>typeof e=="function"?pb(mb,e,...t):pb(()=>jD(mb(),e),...t),WN=pb(mb),BD=PD({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 ye(...e){return BD(Lp(e))}const zD=DN("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"}}),tt=y.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...s},a)=>f.jsx("button",{ref:a,type:r,"data-slot":"button",className:ye(zD({variant:t,size:n,className:e})),...s}));tt.displayName="Button";const UD=DN("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 gn({className:e,variant:t="neutral",mono:n,dot:r,children:s,...a}){return f.jsxs("span",{"data-slot":"badge",className:ye(UD({variant:t,mono:n,className:e})),...a,children:[r?f.jsx("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 self-center rounded-full bg-current"}):null,s]})}function Bl({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ye("rounded-lg border border-border bg-surface",e),...t})}function zl({className:e,...t}){return f.jsx("div",{className:ye("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function Ul({className:e,...t}){return f.jsx("h3",{className:ye("text-heading-3 font-semibold text-text",e),...t})}function Hl({className:e,...t}){return f.jsx("div",{className:ye("px-4 pb-4",e),...t})}const Yt=y.forwardRef(({className:e,...t},n)=>f.jsx("input",{ref:n,"data-slot":"input",className:ye("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}));Yt.displayName="Input";const QN=y.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{ref:n,"data-slot":"textarea",className:ye("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}));QN.displayName="Textarea";const ZN={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},JN={...ZN,position:"fixed",top:0,left:0},HD={...ZN,position:"absolute"},TC={};function br(e,t){const n=y.useRef(TC);return n.current===TC&&(n.current=e(t)),n}function xo(e,t,n,r){const s=br(eA).current;return $D(s,e,t,n,r)&&tA(s,[e,t,n,r]),s.callback}function FD(e){const t=br(eA).current;return VD(t,e)&&tA(t,e),t.callback}function eA(){return{callback:null,cleanup:null,refs:[]}}function $D(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function VD(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function tA(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 Px(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}function qD(e){const[t,n]=y.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function YD(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function SC({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=y.useRef(e!==void 0),[a,l]=y.useState(t),u=s?e:a,d=y.useCallback(h=>{s||l(h)},[]);return[u,d]}const GD=()=>{},Ke=typeof document<"u"?y.useLayoutEffect:GD,Bx={...XM},t1=Bx.useInsertionEffect,KD=t1&&t1!==Bx.useLayoutEffect?t1:e=>e();function rt(e){const t=br(XD).current;return t.next=e,KD(t.effect),t.trampoline}function XD(){const e={next:void 0,callback:WD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function WD(){}function Tn(e){const t=br(QD,e).current;return t.next=e,Ke(t.effect),t}function QD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ZD(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=ZD("https://base-ui.com/production-error","Base UI"),Ue=(e,t,n,r,s,a,...l)=>{if(l.length>0)throw new Error(Dn(1));let u;if(e)u=e;else throw new Error("Missing arguments");return u};var nA=CN();const JD=parseInt(y.version,10);function zx(e){return JD>=e}const bb=[];let xb;function ej(){return xb}function tj(e){bb.push(e)}function Ux(e){const t=(n,r)=>{const s=br(nj).current;let a;try{xb=s;for(const l of bb)l.before(s);a=e(n,r);for(const l of bb)l.after(s);s.didInitialize=!0}finally{xb=void 0}return a};return t.displayName=e.displayName||e.name,t}function rA(e){return y.forwardRef(Ux(e))}function nj(){return{didInitialize:!1}}const rj=zx(19),sj=rj?aj:oj;function ft(e,t,n,r,s){return sj(e,t,n,r,s)}function ij(e,t,n,r,s){const a=y.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return nA.useSyncExternalStore(e.subscribe,a,a)}tj({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()}}),nA.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function aj(e,t,n,r,s){const a=ej();if(!a)return ij(e,t,n,r,s);const l=a.syncIndex;a.syncIndex+=1;let u;return a.didInitialize?(u=a.syncHooks[l],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(a.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},a.syncHooks.push(u)),u.value}function oj(e,t,n,r,s){return wN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,s))}class sA{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 Vn(){}const Kl=Object.freeze([]),fn=Object.freeze({});class Dp extends sA{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){y.useDebugValue(t);const r=this;Ke(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ke(()=>(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);Ke(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){y.useDebugValue(t);const r=this,s=n!==void 0;Ke(()=>{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=rt(n??Vn);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 u=s;s=l,n(l,u,this)}})}}function jp(){return typeof window<"u"}function tr(e){return Hx(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ni(e){var t;return(t=(Hx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hx(e){return jp()?e instanceof Node||e instanceof on(e).Node:!1}function St(e){return jp()?e instanceof Element||e instanceof on(e).Element:!1}function dn(e){return jp()?e instanceof HTMLElement||e instanceof on(e).HTMLElement:!1}function Xl(e){return!jp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof on(e).ShadowRoot}function Ro(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Yr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function lj(e){return/^(table|td|th)$/.test(tr(e))}function Pp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const uj=/transform|translate|scale|rotate|perspective|filter/,cj=/paint|layout|strict|content/,Qa=e=>!!e&&e!=="none";let n1;function Fx(e){const t=St(e)?Yr(e):e;return Qa(t.transform)||Qa(t.translate)||Qa(t.scale)||Qa(t.rotate)||Qa(t.perspective)||!$x()&&(Qa(t.backdropFilter)||Qa(t.filter))||uj.test(t.willChange||"")||cj.test(t.contain||"")}function dj(e){let t=Ci(e);for(;dn(t)&&!Ei(t);){if(Fx(t))return t;if(Pp(t))return null;t=Ci(t)}return null}function $x(){return n1==null&&(n1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n1}function Ei(e){return/^(html|body|#document)$/.test(tr(e))}function Yr(e){return on(e).getComputedStyle(e)}function Bp(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ci(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xl(e)&&e.host||Ni(e);return Xl(t)?t.host:t}function iA(e){const t=Ci(e);return Ei(t)?(e.ownerDocument||e).body:dn(t)&&Ro(t)?t:iA(t)}function sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=iA(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=on(s);if(a){const u=yb(l);return t.concat(l,l.visualViewport||[],Ro(s)?s:[],u&&n?sd(u):[])}else return t.concat(s,sd(s,[],n))}function yb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $s(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function At(e){return e?.ownerDocument||document}function Tt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const fj=[];function Vx(e){y.useEffect(e,fj)}const rh=null;class hj{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 sh=new hj;class Us{static create(){return new Us}static request(t){return sh.request(t)}static cancel(t){return sh.cancel(t)}currentId=rh;request(t){this.cancel(),this.currentId=sh.request(()=>{this.currentId=rh,t()})}cancel=()=>{this.currentId!==rh&&(sh.cancel(this.currentId),this.currentId=rh)};disposeEffect=()=>this.cancel}function Wl(){const e=br(Us.create).current;return Vx(e.disposeEffect),e}const mc=0;class Ss{static create(){return new Ss}currentId=mc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=mc,n()},t)}isStarted(){return this.currentId!==mc}clear=()=>{this.currentId!==mc&&(clearTimeout(this.currentId),this.currentId=mc)};disposeEffect=()=>this.clear}function Gn(){const e=br(Ss.create).current;return Vx(e.disposeEffect),e}function pj(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:mj,platform:gj,maxTouchPoints:bj}=pj(),zp=mj.toLowerCase(),id=gj.toLowerCase(),Up=/^i(os$|p)/.test(id)||id==="macintel"&&bj>1,CC="android",vb=id===CC||zp.includes(CC),qx=!Up&&id.startsWith("mac");id.startsWith("win");const xj=qx||Up,Ca=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Ca&&zp.includes("firefox");!Ca&&zp.includes("chrom");const yj=xj,Yx=/jsdom|happydom/.test(zp);function zs(e){e.preventDefault(),e.stopPropagation()}function vj(e){return"nativeEvent"in e}function Gx(e){return e.pointerType===""&&e.isTrusted?!0:vb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function aA(e){return Yx?!1:!vb&&e.width===0&&e.height===0||vb&&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 yo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ej(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Eb="data-base-ui-focusable",oA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Hp="ArrowLeft",Fp="ArrowRight",lA="ArrowUp",Kx="ArrowDown";function _r(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Xl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function mr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qh(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(st(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function r1(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 Tj(e){return e.matches("html,body")}function $p(e){return dn(e)&&e.matches(oA)}function Sj(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${oA}`)!=null}function Tb(e){return e?e.getAttribute("role")==="combobox"&&$p(e):!1}function Cj(e){if(!e||Yx)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Zh(e){return e?e.hasAttribute(Eb)?e:e.querySelector(`[${Eb}]`)||e:null}function wj(e,t){return t!=null&&!yo(t)?0:typeof e=="function"?e():e}function Ql(e,t,n){const r=wj(e,n);return typeof r=="number"?r:r?.[t]}function wC(e){return typeof e=="function"?e():e}function uA(e,t){return t||e==="click"||e==="mousedown"}function kj(e){return e?.includes("mouse")&&e!=="mousedown"}const ou="none",lu="trigger-press",qn="trigger-hover",Fl="trigger-focus",Vp="outside-press",Bc="item-press",Nj="close-press",vo="focus-out",qp="escape-key",Sb="list-navigation",cA="cancel-open",_c="sibling-open",Aj="disabled",Xx="imperative-action",_j="window-resize";function pt(e,t,n,r){let s=!1,a=!1;const l=fn;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 dA=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ss,currentIdRef:{current:null},currentContextRef:{current:null}});function Rj(e,t){e.current=t.current}function Ij(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=y.useRef(n),a=y.useRef(n),l=y.useRef(null),u=y.useRef(null),d=Gn();return Ke(()=>{if(a.current=n,!l.current){s.current=n;return}s.current={open:Ql(s.current,"open"),close:Ql(n,"close")}},[n,l,s,a]),f.jsx(dA.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:u,timeout:d}),[r,d]),children:t})}function Oj(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),a=y.useContext(dA),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:h,currentContextRef:m,hasProvider:p,timeout:b}=a,[x,E]=y.useState(!1),A=y.useRef(n),w=y.useRef(!1);return Ke(()=>{A.current=n},[n]),Ke(()=>()=>{w.current=!0},[]),Ke(()=>{function S(){w.current||E(!1),m.current?.setIsInstantPhase(!1),l.current=null,m.current=null,u.current=h.current,b.clear()}if(l.current&&!n&&l.current===s){if(E(!1),d){const k=s;return b.start(d,()=>{r.select("open")||l.current&&l.current!==k||S()}),()=>{(A.current||l.current!==k)&&b.clear()}}S()}},[n,s,l,u,d,h,m,b,r]),Ke(()=>{if(!n)return;const S=m.current,k=l.current;b.clear(),m.current={onOpenChange:r.setOpen,setIsInstantPhase:E},l.current=s,u.current={open:0,close:Ql(h.current,"close")},k!==null&&k!==s?(E(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,pt(ou))):(E(!1),S?.setIsInstantPhase(!1))},[n,s,r,l,u,h,m,b]),Ke(()=>()=>{if(l.current===s){if(m.current=null,!A.current)return;l.current=null,Rj(u,h),b.clear()}},[m,l,u,s,h,b]),y.useMemo(()=>({hasProvider:p,delayRef:u,isInstantPhase:x}),[p,u,x])}const Zl=y.forwardRef(function(t,n){const[r,s]=y.useState();Ke(()=>{yj&&Ca&&s("button")},[]);const a={tabIndex:0,role:r};return f.jsx("span",{...t,ref:n,style:JN,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),Mj=["top","right","bottom","left"],Jl=Math.min,Ti=Math.max,Jh=Math.round,ih=Math.floor,Si=e=>({x:e,y:e}),Lj={left:"right",right:"left",bottom:"top",top:"bottom"};function fA(e,t,n){return Ti(e,Jl(t,n))}function wi(e,t){return typeof e=="function"?e(t):e}function $r(e){return e.split("-")[0]}function wa(e){return e.split("-")[1]}function Wx(e){return e==="x"?"y":"x"}function Qx(e){return e==="y"?"height":"width"}function us(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Zx(e){return Wx(us(e))}function Dj(e,t,n){n===void 0&&(n=!1);const r=wa(e),s=Zx(e),a=Qx(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ep(l)),[l,ep(l)]}function jj(e){const t=ep(e);return[Cb(e),t,Cb(t)]}function Cb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const kC=["left","right"],NC=["right","left"],Pj=["top","bottom"],Bj=["bottom","top"];function zj(e,t,n){switch(e){case"top":case"bottom":return n?t?NC:kC:t?kC:NC;case"left":case"right":return t?Pj:Bj;default:return[]}}function Uj(e,t,n,r){const s=wa(e);let a=zj($r(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Cb)))),a}function ep(e){const t=$r(e);return Lj[t]+e.slice(t.length)}function Hj(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 hA(e){return typeof e!="number"?Hj(e):{top:e,right:e,bottom:e,left:e}}function ad(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 AC(e,t){return t<0||t>=e.length}function s1(e,t){return Ll(e.current,{disabledIndices:t})}function _C(e,t){return Ll(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ll(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&&pA(e,a,r));return a}function pA(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const s=e[t];return s?Yp(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function Fj(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Yp(e,t=e?Yr(e):null){return!e||!e.isConnected||!t||Fj(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const $j='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Vj(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Xl(n)?n.host:null}function wb(e){for(const t of Array.from(e.children))if(tr(t)==="summary")return t;return null}function qj(e,t){const n=wb(t);return!!n&&(e===n||st(n,e))}function mA(e){const t=e?tr(e):"";return e!=null&&e.matches($j)&&(t!=="summary"||e.parentElement!=null&&tr(e.parentElement)==="details"&&wb(e.parentElement)===e)&&(t!=="details"||wb(e)==null)&&(t!=="input"||e.type!=="hidden")}function gA(e){if(!mA(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Vj(t)){const n=t!==e,r=tr(t)==="slot";if(t.hasAttribute("inert")||n&&tr(t)==="details"&&!t.open&&!qj(e,t)||t.hasAttribute("hidden")||!r&&!Yj(t,n))return!1}return!0}function Yj(e,t){const n=Yr(e);return t?n.display!=="none":Yp(e,n)}function bA(e){const t=e.tabIndex;if(t<0){const n=tr(e);if(n==="details"||n==="audio"||n==="video"||dn(e)&&e.isContentEditable)return 0}return t}function i1(e){if(tr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Gj(e,t){const n=i1(e);if(!n)return!0;const r=t.find(s=>{const a=i1(s);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(s=>{const a=i1(s);return a?.name===n.name&&a.form===n.form})===n}function xA(e){if(dn(e)&&tr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return dn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function yA(e,t){xA(e).forEach(n=>{mA(n)&&t.push(n),yA(n,t)})}function vA(e,t,n){xA(e).forEach(r=>{dn(r)&&r.matches(t)&&n.push(r),vA(r,t,n)})}function Jx(e){return gA(e)&&bA(e)>=0}function EA(e){const t=[];return yA(e,t),t.filter(gA)}function vd(e){const t=EA(e);return t.filter(n=>bA(n)>=0&&Gj(n,t))}function TA(e,t){const n=vd(e),r=n.length;if(r===0)return;const s=_r(At(e)),a=n.indexOf(s),l=a===-1?t===1?0:r-1:a+t;return n[l]}function ey(e){return TA(At(e).body,1)||e}function SA(e){return TA(At(e).body,-1)||e}function CA(e,t){if(!e)return null;const n=vd(At(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 Kj(e){return CA(e,1)}function Xj(e){return CA(e,-1)}function $l(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!st(n,r)}function Wj(e){vd(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function RC(e){const t=[];vA(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 ya(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...ya(e,s.id,n)])}function IC(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 od(e){return`data-base-ui-${e}`}let ah=0;function jh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(ah);function a(){s&&!s()||e?.focus({preventScroll:n})}if(r)return a(),Vn;const l=requestAnimationFrame(a);return ah=l,()=>{ah===l&&(cancelAnimationFrame(l),ah=0)}}const a1={inert:new WeakMap,"aria-hidden":new WeakMap},OC="data-base-ui-inert",kb={inert:new WeakSet,"aria-hidden":new WeakSet};let gc=new WeakMap,o1=0;function Qj(e){return kb[e]}function wA(e){return e?Xl(e)?e.host:wA(e.parentNode):null}const MC=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=wA(n);return e.contains(r)?r:null}).filter(n=>n!=null),LC=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},DC=(e,t,n)=>{const r=[],s=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{tr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function Zj(e,t,n,r,{mark:s=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,u=null;const d=MC(t,e),h=s?DC(t,LC(d),new Set(d)):[],m=[],p=[];if(a){const b=a1[a],x=Qj(a);u=x,l=b;const E=MC(t,Array.from(t.querySelectorAll("[aria-live]"))),A=d.concat(E);DC(t,LC(A),new Set(A)).forEach(S=>{const k=S.getAttribute(a),N=k!==null&&k!=="false",_=(b.get(S)||0)+1;b.set(S,_),m.push(S),_===1&&N&&x.add(S),N||S.setAttribute(a,a==="inert"?"":"true")})}return s&&h.forEach(b=>{const x=(gc.get(b)||0)+1;gc.set(b,x),p.push(b),x===1&&b.setAttribute(OC,"")}),o1+=1,()=>{l&&m.forEach(b=>{const E=(l.get(b)||0)-1;l.set(b,E),E||(!u?.has(b)&&a&&b.removeAttribute(a),u?.delete(b))}),s&&p.forEach(b=>{const x=(gc.get(b)||0)-1;gc.set(b,x),x||b.removeAttribute(OC)}),o1-=1,o1||(a1.inert=new WeakMap,a1["aria-hidden"]=new WeakMap,kb.inert=new WeakSet,kb["aria-hidden"]=new WeakSet,gc=new WeakMap)}}function jC(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,a=At(e[0]).body;return Zj(e,a,n,r,{mark:s})}let PC=0;function Jj(e,t="mui"){const[n,r]=y.useState(e),s=e||n;return y.useEffect(()=>{n==null&&(PC+=1,r(`${t}-${PC}`))},[n,t]),s}const BC=Bx.useId;function Eo(e,t){if(BC!==void 0){const n=BC();return e??(t?`${t}-${n}`:n)}return Jj(e,t)}function zC(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(zx(19)?n?.ref:t.ref)??null}function Nb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function e9(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 t9(e,t){return typeof e=="function"?e(t):e}function n9(e,t){return typeof e=="function"?e(t):e}const ty={};function Ir(e,t,n,r,s){if(!n&&!r&&!s&&!e)return tp(t);let a=tp(e);return t&&(a=Rc(a,t)),n&&(a=Rc(a,n)),r&&(a=Rc(a,r)),s&&(a=Rc(a,s)),a}function r9(e){if(e.length===0)return ty;if(e.length===1)return tp(e[0]);let t=tp(e[0]);for(let n=1;n<e.length;n+=1)t=Rc(t,e[n]);return t}function tp(e){return ny(e)?{...NA(e,ty)}:s9(e)}function Rc(e,t){return ny(t)?NA(t,e):i9(e,t)}function s9(e){const t={...e};for(const n in t){const r=t[n];kA(n,r)&&(t[n]=AA(r))}return t}function i9(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Nb(e.style,r);break}case"className":{e[n]=_A(e.className,r);break}default:kA(n,r)?e[n]=a9(e[n],r):e[n]=r}}return e}function kA(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 ny(e){return typeof e=="function"}function NA(e,t){return ny(e)?e(t):e??ty}function a9(e,t){return t?e?(...n)=>{const r=n[0];if(RA(r)){const a=r;np(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const s=t(...n);return e?.(...n),s}:AA(t):e}function AA(e){return e&&((...t)=>{const n=t[0];return RA(n)&&np(n),e(...t)})}function np(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function _A(e,t){return t?e?t+" "+e:t:e}function RA(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function An(e,t,n={}){const r=t.render,s=o9(t,n);if(n.enabled===!1)return null;const a=n.state??fn;return c9(e,r,s,a)}function o9(e,t={}){const{className:n,style:r,render:s}=e,{state:a=fn,ref:l,props:u,stateAttributesMapping:d,enabled:h=!0}=t,m=h?t9(n,a):void 0,p=h?n9(r,a):void 0,b=h?e9(a,d):fn,x=h&&u?l9(u):void 0,E=h?Nb(b,x)??{}:fn;return typeof document<"u"&&(h?Array.isArray(l)?E.ref=FD([E.ref,zC(s),...l]):E.ref=xo(E.ref,zC(s),l):xo(null,null)),h?(m!==void 0&&(E.className=_A(E.className,m)),p!==void 0&&(E.style=Nb(E.style,p)),E):fn}function l9(e){return Array.isArray(e)?r9(e):Ir(void 0,e)}const u9=Symbol.for("react.lazy");function c9(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===u9&&(a=y.Children.toArray(t)[0]),y.cloneElement(a,s)}if(e&&typeof e=="string")return d9(e,n);throw new Error(Dn(8))}function d9(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 f9=500,h9=500,p9={style:{transition:"none"}},IA="data-base-ui-click-trigger",OA={fallbackAxisSide:"none"},MA={fallbackAxisSide:"end"},m9={clipPath:"inset(50%)",position:"fixed",top:0,left:0},LA=y.createContext(null),DA=()=>y.useContext(LA),g9=od("portal");function jA(e={}){const{ref:t,container:n,componentProps:r=fn,elementProps:s}=e,a=Eo(),u=DA()?.portalNode,[d,h]=y.useState(null),[m,p]=y.useState(null),b=rt(w=>{w!==null&&p(w)}),x=y.useRef(null);Ke(()=>{if(n===null){x.current&&(x.current=null,p(null),h(null));return}if(a==null)return;const w=(n&&(Hx(n)?n:n.current))??u??document.body;if(w==null){x.current&&(x.current=null,p(null),h(null));return}x.current!==w&&(x.current=w,p(null),h(w))},[n,u,a]);const E=An("div",r,{ref:[t,b],props:[{id:a,[g9]:""},s]});return{portalNode:m,portalSubtree:d&&E?or.createPortal(E,d):null}}const ry=y.forwardRef(function(t,n){const{render:r,className:s,style:a,children:l,container:u,renderGuards:d,...h}=t,{portalNode:m,portalSubtree:p}=jA({container:u,ref:n,componentProps:t,elementProps:h}),b=y.useRef(null),x=y.useRef(null),E=y.useRef(null),A=y.useRef(null),[w,S]=y.useState(null),k=y.useRef(!1),N=w?.modal,_=w?.open,M=typeof d=="boolean"?d:!!w&&!w.modal&&w.open&&!!m;y.useEffect(()=>{if(!m||N)return;function j(O){m&&O.relatedTarget&&$l(O)&&(O.type==="focusin"?k.current&&(RC(m),k.current=!1):(Wj(m),k.current=!0))}return $s(Tt(m,"focusin",j,!0),Tt(m,"focusout",j,!0))},[m,N]),Ke(()=>{!m||_!==!0||!k.current||(RC(m),k.current=!1)},[_,m]);const R=y.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:E,afterInsideRef:A,portalNode:m,setFocusManagerState:S}),[m]);return f.jsxs(y.Fragment,{children:[p,f.jsxs(LA.Provider,{value:R,children:[M&&m&&f.jsx(Zl,{"data-type":"outside",ref:b,onFocus:j=>{if($l(j,m))E.current?.focus();else{const O=w?w.domReference:null;SA(O)?.focus()}}}),M&&m&&f.jsx("span",{"aria-owns":m.id,style:m9}),m&&or.createPortal(l,m),M&&m&&f.jsx(Zl,{"data-type":"outside",ref:x,onFocus:j=>{if($l(j,m))A.current?.focus();else{const O=w?w.domReference:null;ey(O)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,pt(vo,j.nativeEvent))}}})]})]})});function PA(){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 sy{nodesRef={current:[]};events=PA();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 BA=y.createContext(null),zA=y.createContext(null),ka=()=>y.useContext(BA)?.id||null,Na=e=>{const t=y.useContext(zA);return e??t};function UA(e){const t=Eo(),n=Na(e),r=ka();return Ke(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function b9(e){const{children:t,id:n}=e,r=ka();return f.jsx(BA.Provider,{value:y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function x9(e){const{children:t,externalTree:n}=e,r=br(()=>n??new sy).current;return f.jsx(zA.Provider,{value:r,children:t})}function pi(e){return e==null?e:"current"in e?e.current:e}function y9(e,t){const n=on(mr(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 UC=20;let ma=[];function iy(){ma=ma.filter(e=>e.deref()?.isConnected)}function HC(e){iy(),e&&tr(e)!=="body"&&(ma.push(new WeakRef(e)),ma.length>UC&&(ma=ma.slice(-UC)))}function FC(){return iy(),ma[ma.length-1]?.deref()}function v9(e){return e?Jx(e)?e:vd(e)[0]||e:null}function $C(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=EA(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return Jx(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 ay(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:h="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:E}=e,A="rootStore"in t?t.rootStore:t,w=A.useState("open"),S=A.useState("domReferenceElement"),k=A.useState("floatingElement"),{events:N,dataRef:_}=A.context,M=rt(()=>_.current.floatingContext?.nodeId),R=s===!1,j=Tb(S)&&R,O=Tn(s),H=Tn(a),P=Tn(h),Y=Tn(w),X=Na(x),Z=DA(),ee=y.useRef(!1),V=y.useRef(!1),z=y.useRef(!1),G=y.useRef(null),Q=y.useRef(""),se=y.useRef(""),D=y.useRef(null),B=y.useRef(null),$=xo(D,b,Z?.beforeInsideRef),L=xo(B,Z?.afterInsideRef),te=Gn(),ne=Gn(),ce=Wl(),fe=Z!=null,de=Zh(k),xe=rt((Te=de)=>Te?vd(Te):[]),Fe=rt(()=>E?.().filter(Te=>Te!=null)??[]);y.useEffect(()=>{if(r||!u)return;function Te(ze){ze.key==="Tab"&&st(de,_r(At(de)))&&xe().length===0&&!j&&zs(ze)}const Oe=At(de);return Tt(Oe,"keydown",Te)},[r,de,u,j,xe]),y.useEffect(()=>{if(r||!w)return;const Te=At(de);function Oe(){z.current=!1}function ze(Ye){const Le=mr(Ye),ke=Fe(),Ee=st(k,Le)||st(S,Le)||st(Z?.portalNode,Le)||ke.some(Ie=>Ie===Le||st(Ie,Le));z.current=!Ee,se.current=Ye.pointerType||"keyboard",Le?.closest(`[${IA}]`)&&(V.current=!0,ne.start(0,()=>{V.current=!1}))}function Xe(){se.current="keyboard"}return $s(Tt(Te,"pointerdown",ze,!0),Tt(Te,"pointerup",Oe,!0),Tt(Te,"pointercancel",Oe,!0),Tt(Te,"keydown",Xe,!0),Oe)},[r,k,S,de,w,Z,ne,Fe]),y.useEffect(()=>{if(r||!d)return;const Te=At(de);function Oe(){V.current=!0,ne.start(0,()=>{V.current=!1})}function ze(ke){const Ee=mr(ke);Jx(Ee)&&(G.current=Ee)}function Xe(ke){const Ee=ke.relatedTarget,Ie=ke.currentTarget,je=mr(ke);u&&Ee==null&&je!=null&&st(k,je)&&HC(je),queueMicrotask(()=>{const J=M(),pe=A.context.triggerElements,oe=Fe(),ae=Ee?.hasAttribute(od("focus-guard"))&&[D.current,B.current,Z?.beforeInsideRef.current,Z?.afterInsideRef.current,Z?.beforeOutsideRef.current,Z?.afterOutsideRef.current,pi(p),pi(m)].includes(Ee),K=!(st(S,Ee)||st(k,Ee)||st(Ee,k)||st(Z?.portalNode,Ee)||oe.some(F=>F===Ee||st(F,Ee))||Ee!=null&&pe.hasElement(Ee)||pe.hasMatchingElement(F=>st(F,Ee))||ae||X&&(ya(X.nodesRef.current,J).find(F=>st(F.context?.elements.floating,Ee)||st(F.context?.elements.domReference,Ee))||IC(X.nodesRef.current,J).find(F=>[F.context?.elements.floating,Zh(F.context?.elements.floating)].includes(Ee)||F.context?.elements.domReference===Ee)));if(Ie===S&&de&&$C(de),l&&Ie!==S&&!Yp(je)&&_r(Te)===Te.body){if(dn(de)&&(de.focus(),l==="popup")){ce.request(()=>{de.focus()});return}const F=xe(),le=G.current,Ce=(le&&F.includes(le)?le:null)||F[F.length-1]||de;dn(Ce)&&Ce.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}(j||!u)&&Ee&&K&&!V.current&&(j||Ee!==FC())&&(ee.current=!0,A.setOpen(!1,pt(vo,ke)))})}function Ye(){z.current||(_.current.insideReactTree=!0,te.start(0,()=>{_.current.insideReactTree=!1}))}const Le=dn(S)?S:null;if(!(!k&&!Le))return $s(Le&&Tt(Le,"focusout",Xe),Le&&Tt(Le,"pointerdown",Oe),k&&Tt(k,"focusin",ze),k&&Tt(k,"focusout",Xe),k&&Z&&Tt(k,"focusout",Ye,!0))},[r,S,k,de,u,X,Z,A,d,l,xe,j,M,_,te,ne,ce,m,p,Fe]),y.useEffect(()=>{if(r||!k||!w)return;const Te=Array.from(Z?.portalNode?.querySelectorAll(`[${od("portal")}]`)||[]),ze=(X?IC(X.nodesRef.current,M()):[]).find(Ie=>Tb(Ie.context?.elements.domReference||null))?.context?.elements.domReference,Ye=[...[k,...Te,D.current,B.current,Z?.beforeOutsideRef.current,Z?.afterOutsideRef.current,...Fe()],ze,pi(p),pi(m),j?S:null].filter(Ie=>Ie!=null),Le=jC(Ye,{ariaHidden:u||j,mark:!1}),ke=[k,...Te].filter(Ie=>Ie!=null),Ee=jC(ke);return()=>{Ee(),Le()}},[w,r,S,k,u,Z,j,X,M,m,p,Fe]),Ke(()=>{if(!w||r||!dn(de))return;const Te=At(de),Oe=_r(Te);queueMicrotask(()=>{const ze=O.current,Xe=typeof ze=="function"?ze(P.current||""):ze;if(Xe===void 0||Xe===!1||st(de,Oe))return;let Le=null;const ke=()=>(Le==null&&(Le=xe(de)),Le[0]||de);let Ee;Xe===!0||Xe===null?Ee=ke():Ee=pi(Xe),Ee=Ee||ke();const Ie=st(de,_r(Te));jh(Ee,{preventScroll:Ee===de,shouldFocus(){if(!Y.current)return!1;if(Ie)return!0;const je=_r(Te);return!(je!==Ee&&st(de,je))}})})},[r,w,de,xe,O,P,Y]),Ke(()=>{if(r||!de)return;const Te=At(de),Oe=_r(Te),ze=P.current==null;HC(Oe);function Xe(Le){if(Le.open||(Q.current=y9(Le.nativeEvent,se.current)),Le.reason===qn&&Le.nativeEvent.type==="mouseleave"&&(ee.current=!0),Le.reason===Vp)if(Le.nested)ee.current=!1;else if(Gx(Le.nativeEvent)||aA(Le.nativeEvent))ee.current=!1;else{let ke=!1;At(de).createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?ee.current=!1:ee.current=!0}}N.on("openchange",Xe);function Ye(){const Le=H.current;let ke=typeof Le=="function"?Le(Q.current):Le;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const Ee=S?.isConnected?S:null,Ie=Oe?.isConnected&&tr(Oe)!=="body"?Oe:null;let je=ze?Ie||Ee:Ee||Ie;return je||(je=FC()||null),typeof ke=="boolean"?je:pi(ke)||je||null}return()=>{N.off("openchange",Xe);const Le=_r(Te),ke=Fe(),Ee=st(k,Le)||ke.some(J=>J===Le||st(J,Le))||X&&ya(X.nodesRef.current,M(),!1).some(J=>st(J.context?.elements.floating,Le)),Ie=H.current,je=Ye();queueMicrotask(()=>{const J=v9(je),pe=typeof Ie!="boolean";Ie&&!ee.current&&dn(J)&&(!(!pe&&J!==Le&&Le!==Te.body)||Ee)&&J.focus({preventScroll:!0}),ee.current=!1})}},[r,k,de,H,P,N,X,S,M,Fe]),Ke(()=>{if(!Ca||w||!k)return;const Te=_r(At(k));!dn(Te)||!$p(Te)||st(k,Te)&&Te.blur()},[w,k]),Ke(()=>{if(!(r||!Z))return Z.setFocusManagerState({modal:u,closeOnFocusOut:d,open:w,onOpenChange:A.setOpen,domReference:S}),()=>{Z.setFocusManagerState(null)}},[r,Z,u,w,A,d,S]),Ke(()=>{if(!(r||!de))return $C(de),()=>{queueMicrotask(iy)}},[r,de]);const De=!r&&(u?!j:!0)&&(fe||u);return f.jsxs(y.Fragment,{children:[De&&f.jsx(Zl,{"data-type":"inside",ref:$,onFocus:Te=>{if(u){const Oe=xe();jh(Oe[Oe.length-1])}else Z?.portalNode&&(ee.current=!1,$l(Te,Z.portalNode)?ey(S)?.focus():pi(p??Z.beforeOutsideRef)?.focus())}}),n,De&&f.jsx(Zl,{"data-type":"inside",ref:L,onFocus:Te=>{u?jh(xe()[0]):Z?.portalNode&&(d&&(ee.current=!0),$l(Te,Z.portalNode)?SA(S)?.focus():pi(m??Z.afterOutsideRef)?.focus())}})]})}function oy(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:d=lu}=t,h="rootStore"in e?e.rootStore:e,m=h.context.dataRef,p=y.useRef(void 0),b=Wl(),x=Gn(),E=y.useMemo(()=>{function A(S,k,N,_){const M=pt(d,k,N);S&&_==="touch"&&u>0?x.start(u,()=>{h.setOpen(!0,M)}):h.setOpen(S,M)}function w(S,k,N){const _=m.current.openEvent,M=h.select("domReferenceElement")!==k;return S&&M||!S||!s?!0:_&&l?!N(_.type):!1}return{onPointerDown(S){p.current=S.pointerType},onMouseDown(S){const k=p.current,N=S.nativeEvent,_=h.select("open");if(S.button!==0||r==="click"||yo(k,!0)&&a)return;const M=w(_,S.currentTarget,O=>O==="click"||O==="mousedown"),R=mr(N);if($p(R)){A(M,N,R,k);return}const j=S.currentTarget;b.request(()=>{A(M,N,j,k)})},onClick(S){if(r==="mousedown-only")return;const k=p.current;if(r==="mousedown"&&k){p.current=void 0;return}if(yo(k,!0)&&a)return;const N=h.select("open"),_=w(N,S.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");A(_,S.nativeEvent,S.currentTarget,k)},onKeyDown(){p.current=void 0}}},[m,r,a,d,h,l,s,b,x,u]);return y.useMemo(()=>n?{reference:E}:fn,[n,E])}function E9(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",u=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let h=a.width,m=a.height,p=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&u&&(r=a.y-t.y),p-=n||0,b-=r||0,h=0,m=0,!s||d?(h=t.axis==="y"?a.width:0,m=t.axis==="x"?a.height:0,p=l&&t.x!=null?t.x:p,b=u&&t.y!=null?t.y:b):s&&!d&&(m=t.axis==="x"?a.height:m,h=t.axis==="y"?a.width:h),s=!0,{width:h,height:m,x:p,y:b,top:b,right:p+h,bottom:b+m,left:p}}}}function VC(e){return e!=null&&e.clientX!=null}function T9(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"),u=s.useState("domReferenceElement"),d=s.context.dataRef,h=y.useRef(!1),m=y.useRef(null),[p,b]=y.useState(),[x,E]=y.useState([]),A=rt(_=>{s.set("positionReference",_)}),w=rt((_,M,R)=>{h.current||d.current.openEvent&&!VC(d.current.openEvent)||s.set("positionReference",E9(R??u,{x:_,y:M,axis:r,dataRef:d,pointerType:p}))}),S=rt(_=>{a?m.current||(w(_.clientX,_.clientY,_.currentTarget),E([])):w(_.clientX,_.clientY,_.currentTarget)}),k=yo(p)?l:a;y.useEffect(()=>{if(!n){A(u);return}if(!k)return;function _(){m.current?.(),m.current=null}const M=on(l);function R(j){const O=mr(j);st(l,O)?_():w(j.clientX,j.clientY)}return!d.current.openEvent||VC(d.current.openEvent)?m.current=Tt(M,"mousemove",R):A(u),_},[k,n,l,d,u,s,w,A,x]),y.useEffect(()=>()=>{s.set("positionReference",null)},[s]),y.useEffect(()=>{n&&!l&&(h.current=!1)},[n,l]),y.useEffect(()=>{!n&&a&&(h.current=!0)},[n,a]);const N=y.useMemo(()=>{function _(M){b(M.pointerType)}return{onPointerDown:_,onPointerEnter:_,onMouseMove:S,onMouseEnter:S}},[S]);return y.useMemo(()=>n?{reference:N,trigger:N}:{},[n,N])}function S9(){return!1}function C9(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Gp(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:a="sloppy",referencePress:l=S9,bubbles:u,externalTree:d}=t,h="rootStore"in e?e.rootStore:e,m=h.useState("open"),p=h.useState("floatingElement"),{dataRef:b}=h.context,x=Na(d),E=rt(typeof s=="function"?s:()=>!1),A=typeof s=="function"?E:s,w=A!==!1,S=rt(()=>a),{escapeKey:k,outsidePress:N}=C9(u),_=y.useRef(!1),M=y.useRef(!1),R=y.useRef(!1),j=y.useRef(!1),O=y.useRef(""),H=y.useRef(null),P=Gn(),Y=Gn(),X=rt(()=>{Y.clear(),b.current.insideReactTree=!1}),Z=rt($=>{const L=b.current.floatingContext?.nodeId;return(x?ya(x.nodesRef.current,L):[]).some(ne=>ne.context?.open&&!ne.context.dataRef.current[$])}),ee=rt($=>r1($,h.select("floatingElement"))||r1($,h.select("domReferenceElement"))),V=rt($=>{l()&&h.setOpen(!1,pt(lu,$.nativeEvent))}),z=rt($=>{if(!m||!n||!r||$.key!=="Escape"||j.current||!k&&Z("__escapeKeyBubbles"))return;const L=vj($)?$.nativeEvent:$,te=pt(qp,L);h.setOpen(!1,te),te.isCanceled||$.preventDefault(),!k&&!te.isPropagationAllowed&&$.stopPropagation()}),G=rt(()=>{b.current.insideReactTree=!0,Y.start(0,X)}),Q=rt($=>{if(!m||!n||$.button!==0)return;const L=mr($.nativeEvent);st(h.select("floatingElement"),L)&&(_.current||(_.current=!0,M.current=!1))}),se=rt($=>{!m||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&_.current&&(M.current=!0)});y.useEffect(()=>{if(!m||!n)return;b.current.__escapeKeyBubbles=k,b.current.__outsidePressBubbles=N;const $=new Ss,L=new Ss;function te(){$.clear(),j.current=!0}function ne(){$.start(Ca?5:0,()=>{j.current=!1})}function ce(){R.current=!0,L.start(0,()=>{R.current=!1})}function fe(){_.current=!1,M.current=!1}function de(){const oe=O.current,ae=oe==="pen"||!oe?"mouse":oe,K=S(),F=typeof K=="function"?K():K;return typeof F=="string"?F:F[ae]}function xe(oe){const ae=de();return ae==="intentional"&&oe.type!=="click"||ae==="sloppy"&&oe.type==="click"}function Fe(oe){const ae=b.current.floatingContext?.nodeId,K=x&&ya(x.nodesRef.current,ae).some(F=>r1(oe,F.context?.elements.floating));return ee(oe)||K}function De(oe){if(xe(oe)){oe.type!=="click"&&!ee(oe)&&(L.clear(),R.current=!1),X();return}if(b.current.insideReactTree){X();return}const ae=mr(oe),K=`[${od("inert")}]`,F=St(ae)?ae.getRootNode():null,le=Array.from((Xl(F)?F:At(h.select("floatingElement"))).querySelectorAll(K)),Ce=h.context.triggerElements;if(ae&&(Ce.hasElement(ae)||Ce.hasMatchingElement(Ve=>st(Ve,ae))))return;let _e=St(ae)?ae:null;for(;_e&&!Ei(_e);){const Ve=Ci(_e);if(Ei(Ve)||!St(Ve))break;_e=Ve}if(!(le.length&&St(ae)&&!Tj(ae)&&!st(ae,h.select("floatingElement"))&&le.every(Ve=>!st(_e,Ve)))){if(dn(ae)&&!("touches"in oe)){const Ve=Ei(ae),Pe=Yr(ae),We=/auto|scroll/,lt=Ve||We.test(Pe.overflowX),ct=Ve||We.test(Pe.overflowY),Ge=lt&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Rt=ct&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,jt=Pe.direction==="rtl",ut=Rt&&(jt?oe.offsetX<=ae.offsetWidth-ae.clientWidth:oe.offsetX>ae.clientWidth),Lt=Ge&&oe.offsetY>ae.clientHeight;if(ut||Lt)return}if(!Fe(oe)){if(de()==="intentional"&&R.current){L.clear(),R.current=!1;return}typeof A=="function"&&!A(oe)||Z("__outsidePressBubbles")||(h.setOpen(!1,pt(Vp,oe)),X())}}}function Te(oe){de()!=="sloppy"||oe.pointerType==="touch"||!h.select("open")||!n||ee(oe)||De(oe)}function Oe(oe){if(de()!=="sloppy"||!h.select("open")||!n||ee(oe))return;const ae=oe.touches[0];ae&&(H.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function ze(oe,ae){const K=mr(oe);if(!K)return;const F=Tt(K,oe.type,()=>{ae(oe),F()})}function Xe(oe){O.current="touch",ze(oe,Oe)}function Ye(oe){P.clear(),oe.type==="pointerdown"&&(O.current=oe.pointerType),!(oe.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&ze(oe,ae=>{ae.type==="pointerdown"?Te(ae):De(ae)})}function Le(oe){if(!_.current)return;const ae=M.current;if(fe(),de()==="intentional"){if(oe.type==="pointercancel"){ae&&ce();return}if(!Fe(oe)){if(ae){ce();return}typeof A=="function"&&!A(oe)||(L.clear(),R.current=!0,X())}}}function ke(oe){if(de()!=="sloppy"||!H.current||ee(oe))return;const ae=oe.touches[0];if(!ae)return;const K=Math.abs(ae.clientX-H.current.startX),F=Math.abs(ae.clientY-H.current.startY),le=Math.sqrt(K*K+F*F);le>5&&(H.current.dismissOnTouchEnd=!0),le>10&&(De(oe),P.clear(),H.current=null)}function Ee(oe){ze(oe,ke)}function Ie(oe){de()!=="sloppy"||!H.current||ee(oe)||(H.current.dismissOnTouchEnd&&De(oe),P.clear(),H.current=null)}function je(oe){ze(oe,Ie)}const J=At(p),pe=$s(r&&$s(Tt(J,"keydown",z),Tt(J,"compositionstart",te),Tt(J,"compositionend",ne)),w&&$s(Tt(J,"click",Ye,!0),Tt(J,"pointerdown",Ye,!0),Tt(J,"pointerup",Le,!0),Tt(J,"pointercancel",Le,!0),Tt(J,"mousedown",Ye,!0),Tt(J,"mouseup",Le,!0),Tt(J,"touchstart",Xe,!0),Tt(J,"touchmove",Ee,!0),Tt(J,"touchend",je,!0)));return()=>{pe(),$.clear(),L.clear(),fe(),R.current=!1}},[b,p,r,w,A,m,n,k,N,z,X,S,Z,ee,x,h,P]),y.useEffect(X,[A,X]);const D=y.useMemo(()=>({onKeyDown:z,onPointerDown:V,onClick:V}),[z,V]),B=y.useMemo(()=>({onKeyDown:z,onPointerDown:se,onMouseDown:se,onClickCapture:G,onMouseDownCapture($){G(),Q($)},onPointerDownCapture($){G(),Q($)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[z,G,Q,se]);return y.useMemo(()=>n?{reference:D,floating:B,trigger:D}:{},[n,D,B])}function qC(e,t,n){let{reference:r,floating:s}=e;const a=us(t),l=Zx(t),u=Qx(l),d=$r(t),h=a==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,b=r[u]/2-s[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-s.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}const E=wa(t);return E&&(x[l]+=b*(E==="end"?1:-1)*(n&&h?-1:1)),x}async function w9(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:x=0}=wi(t,e),E=hA(x),w=u[b?p==="floating"?"reference":"floating":p],S=ad(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:d})),k=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),_=await(a.isElement==null?void 0:a.isElement(N))&&await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1},M=ad(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:N,strategy:d}):k);return{top:(S.top-M.top+E.top)/_.y,bottom:(M.bottom-S.bottom+E.bottom)/_.y,left:(S.left-M.left+E.left)/_.x,right:(M.right-S.right+E.right)/_.x}}const k9=50,N9=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:w9},d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=qC(h,r,d),b=r,x=0;const E={};for(let A=0;A<a.length;A++){const w=a[A];if(!w)continue;const{name:S,fn:k}=w,{x:N,y:_,data:M,reset:R}=await k({x:m,y:p,initialPlacement:r,placement:b,strategy:s,middlewareData:E,rects:h,platform:u,elements:{reference:e,floating:t}});m=N??m,p=_??p,E[S]={...E[S],...M},R&&x<k9&&(x++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(h=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:m,y:p}=qC(h,b,d)),A=-1)}return{x:m,y:p,placement:b,strategy:s,middlewareData:E}},A9=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:u,platform:d,elements:h}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,...w}=wi(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=$r(s),k=us(u),N=$r(u)===u,_=await(d.isRTL==null?void 0:d.isRTL(h.floating)),M=b||(N||!A?[ep(u)]:jj(u)),R=E!=="none";!b&&R&&M.push(...Uj(u,A,E,_));const j=[u,...M],O=await d.detectOverflow(t,w),H=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&H.push(O[S]),p){const ee=Dj(s,l,_);H.push(O[ee[0]],O[ee[1]])}if(P=[...P,{placement:s,overflows:H}],!H.every(ee=>ee<=0)){var Y,X;const ee=(((Y=a.flip)==null?void 0:Y.index)||0)+1,V=j[ee];if(V&&(!(p==="alignment"?k!==us(V):!1)||P.every(Q=>us(Q.placement)===k?Q.overflows[0]>0:!0)))return{data:{index:ee,overflows:P},reset:{placement:V}};let z=(X=P.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:X.placement;if(!z)switch(x){case"bestFit":{var Z;const G=(Z=P.filter(Q=>{if(R){const se=us(Q.placement);return se===k||se==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(se=>se>0).reduce((se,D)=>se+D,0)]).sort((Q,se)=>Q[1]-se[1])[0])==null?void 0:Z[0];G&&(z=G);break}case"initialPlacement":z=u;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function YC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function GC(e){return Mj.some(t=>e[t]>=0)}const _9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=wi(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=YC(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:GC(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=YC(l,n.floating);return{data:{escapedOffsets:u,escaped:GC(u)}}}default:return{}}}}},HA=new Set(["left","top"]);async function R9(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=$r(n),u=wa(n),d=us(n)==="y",h=HA.has(l)?-1:1,m=a&&d?-1:1,p=wi(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof E=="number"&&(x=u==="end"?E*-1:E),d?{x:x*m,y:b*h}:{x:b*h,y:x*m}}const I9=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:u}=t,d=await R9(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},O9=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:u=!1,limiter:d={fn:k=>{let{x:N,y:_}=k;return{x:N,y:_}}},...h}=wi(e,t),m={x:n,y:r},p=await a.detectOverflow(t,h),b=us(s),x=Wx(b);let E=m[x],A=m[b];const w=(k,N)=>fA(N+p[k==="y"?"top":"left"],N,N-p[k==="y"?"bottom":"right"]);l&&(E=w(x,E)),u&&(A=w(b,A));const S=d.fn({...t,[x]:E,[b]:A});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:l,[b]:u}}}}}},M9=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:l,rects:u,middlewareData:d}=t,{offset:h=0,mainAxis:m=!0,crossAxis:p=!0}=wi(e,t),b={x:s,y:a},x=us(l),E=Wx(x);let A=b[E],w=b[x];const S=wi(h,t),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(m){const M=E==="y"?"height":"width",R=u.reference[E]-u.floating[M]+k.mainAxis,j=u.reference[E]+u.reference[M]-k.mainAxis;A<R?A=R:A>j&&(A=j)}if(p){var N,_;const M=E==="y"?"width":"height",R=HA.has($r(l)),j=u.reference[x]-u.floating[M]+(R&&((N=d.offset)==null?void 0:N[x])||0)+(R?0:k.crossAxis),O=u.reference[x]+u.reference[M]+(R?0:((_=d.offset)==null?void 0:_[x])||0)-(R?k.crossAxis:0);w<j?w=j:w>O&&(w=O)}return{[E]:A,[x]:w}}}},L9=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=()=>{},...u}=wi(e,t),d=await s.detectOverflow(t,u),h=$r(n),m=wa(n),p=us(n)==="y",{width:b,height:x}=r.floating;let E,A;h==="top"||h==="bottom"?(E=h,A=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(A=h,E=m==="end"?"top":"bottom");const w=x-d.top-d.bottom,S=b-d.left-d.right,k=Jl(x-d[E],w),N=Jl(b-d[A],S),_=t.middlewareData.shift,M=!_;let R=k,j=N;_!=null&&_.enabled.x&&(j=S),_!=null&&_.enabled.y&&(R=w),M&&!m&&(p?j=b-2*Ti(d.left,d.right):R=x-2*Ti(d.top,d.bottom)),await l({...t,availableWidth:j,availableHeight:R});const O=await s.getDimensions(a.floating);return b!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function FA(e){const t=Yr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=dn(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Jh(n)!==a||Jh(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function ly(e){return St(e)?e:e.contextElement}function Vl(e){const t=ly(e);if(!dn(t))return Si(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=FA(t);let l=(a?Jh(n.width):n.width)/r,u=(a?Jh(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const D9=Si(0);function $A(e){const t=on(e);return!$x()||!t.visualViewport?D9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function j9(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===on(e)}function To(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=ly(e);let l=Si(1);t&&(r?St(r)&&(l=Vl(r)):l=Vl(e));const u=j9(a,n,r)?$A(a):Si(0);let d=(s.left+u.x)/l.x,h=(s.top+u.y)/l.y,m=s.width/l.x,p=s.height/l.y;if(a&&r){const b=on(a),x=St(r)?on(r):r;let E=b,A=yb(E);for(;A&&x!==E;){const w=Vl(A),S=A.getBoundingClientRect(),k=Yr(A),N=S.left+(A.clientLeft+parseFloat(k.paddingLeft))*w.x,_=S.top+(A.clientTop+parseFloat(k.paddingTop))*w.y;d*=w.x,h*=w.y,m*=w.x,p*=w.y,d+=N,h+=_,E=on(A),A=yb(E)}}return ad({width:m,height:p,x:d,y:h})}function Kp(e,t){const n=Bp(e).scrollLeft;return t?t.left+n:To(Ni(e)).left+n}function VA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kp(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function P9(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Ni(r),u=t?Pp(t.floating):!1;if(r===l||u&&a)return n;let d={scrollLeft:0,scrollTop:0},h=Si(1);const m=Si(0),p=dn(r);if((p||!a)&&((tr(r)!=="body"||Ro(l))&&(d=Bp(r)),p)){const x=To(r);h=Vl(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const b=l&&!p&&!a?VA(l,d):Si(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+m.x+b.x,y:n.y*h.y-d.scrollTop*h.y+m.y+b.y}}function B9(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function z9(e){const t=Bp(e),n=e.ownerDocument.body,r=Ti(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Ti(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+Kp(e);const l=-t.scrollTop;return Yr(n).direction==="rtl"&&(a+=Ti(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:a,y:l}}const U9=25;function H9(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=on(e),a=Ni(e),l=s.visualViewport;let u=a.clientWidth,d=a.clientHeight,h=0,m=0;if(l){const b=!$x()||t==="fixed";r?b||(h=-l.offsetLeft,m=-l.offsetTop):(u=l.width,d=l.height,b&&(h=l.offsetLeft,m=l.offsetTop))}if(Kp(a)<=0){const b=a.ownerDocument,x=b.body,E=getComputedStyle(x),A=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,w=Math.abs(a.clientWidth-x.clientWidth-A),S=getComputedStyle(a).scrollbarGutter==="stable both-edges"?w/2:w;S<=U9&&(u-=S)}return{width:u,height:d,x:h,y:m}}function F9(e,t){const n=To(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Vl(e),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=s*a.x,h=r*a.y;return{width:l,height:u,x:d,y:h}}function KC(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=H9(e,n,t);else if(t==="document")r=z9(Ni(e));else if(St(t))r=F9(t,n);else{const s=$A(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ad(r)}function $9(e,t){const n=t.get(e);if(n)return n;let r=sd(e,[],!1).filter(u=>St(u)&&tr(u)!=="body"),s=null;const a=Yr(e).position==="fixed";let l=a?Ci(e):e;for(;St(l)&&!Ei(l);){const u=Yr(l),d=Fx(l),h=s?s.position:a?"fixed":"";!d&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(p=>p!==l):s=u,l=Ci(l)}return t.set(e,r),r}function V9(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Pp(t)?[]:$9(t,this._c):[].concat(n),r],u=KC(t,l[0],s);let d=u.top,h=u.right,m=u.bottom,p=u.left;for(let b=1;b<l.length;b++){const x=KC(t,l[b],s);d=Ti(x.top,d),h=Jl(x.right,h),m=Jl(x.bottom,m),p=Ti(x.left,p)}return{width:h-p,height:m-d,x:p,y:d}}function q9(e){const{width:t,height:n}=FA(e);return{width:t,height:n}}function Y9(e,t,n){const r=dn(t),s=Ni(t),a=n==="fixed",l=To(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Si(0);if((r||!a)&&((tr(t)!=="body"||Ro(s))&&(u=Bp(t)),r)){const b=To(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&s&&(d.x=Kp(s));const h=s&&!r&&!a?VA(s,u):Si(0),m=l.left+u.scrollLeft-d.x-h.x,p=l.top+u.scrollTop-d.y-h.y;return{x:m,y:p,width:l.width,height:l.height}}function l1(e){return Yr(e).position==="static"}function XC(e,t){if(!dn(e)||Yr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ni(e)===n&&(n=n.ownerDocument.body),n}function qA(e,t){const n=on(e);if(Pp(e))return n;if(!dn(e)){let s=Ci(e);for(;s&&!Ei(s);){if(St(s)&&!l1(s))return s;s=Ci(s)}return n}let r=XC(e,t);for(;r&&lj(r)&&l1(r);)r=XC(r,t);return r&&Ei(r)&&l1(r)&&!Fx(r)?n:r||dj(e)||n}const G9=async function(e){const t=this.getOffsetParent||qA,n=this.getDimensions,r=await n(e.floating);return{reference:Y9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function K9(e){return Yr(e).direction==="rtl"}const YA={convertOffsetParentRelativeRectToViewportRelativeRect:P9,getDocumentElement:Ni,getClippingRect:V9,getOffsetParent:qA,getElementRects:G9,getClientRects:B9,getDimensions:q9,getScale:Vl,isElement:St,isRTL:K9};function GA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function X9(e,t,n){let r=null,s;const a=Ni(e);function l(){var m;clearTimeout(s),(m=r)==null||m.disconnect(),r=null}function u(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),l();const b=e.getBoundingClientRect(),{left:x,top:E,width:A,height:w}=b;if(m||t(),!A||!w)return;const S=ih(E),k=ih(a.clientWidth-(x+A)),N=ih(a.clientHeight-(E+w)),_=ih(x),R={rootMargin:-S+"px "+-k+"px "+-N+"px "+-_+"px",threshold:Ti(0,Jl(1,p))||1};let j=!0;function O(H){const P=H[0].intersectionRatio;if(!GA(b,e.getBoundingClientRect()))return u();if(P!==p){if(!j)return u();P?u(!1,P):s=setTimeout(()=>{u(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(O,{...R,root:a.ownerDocument})}catch{r=new IntersectionObserver(O,R)}r.observe(e)}const d=on(e),h=()=>u(n);return d.addEventListener("resize",h),u(!0),()=>{d.removeEventListener("resize",h),l()}}function WC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=ly(e),m=s||a?[...h?sd(h):[],...t?sd(t):[]]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n),a&&S.addEventListener("resize",n)});const p=h&&u?X9(h,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(S=>{let[k]=S;k&&k.target===h&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),h&&!d&&x.observe(h),t&&x.observe(t));let E,A=d?To(e):null;d&&w();function w(){const S=To(e);A&&!GA(A,S)&&n(),A=S,E=requestAnimationFrame(w)}return n(),()=>{var S;m.forEach(k=>{s&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),p?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(E)}}const W9=I9,Q9=O9,Z9=A9,J9=L9,eP=_9,tP=M9,nP=(e,t,n)=>{const r=new Map,s=n??{},a={...YA,...s.platform,_c:r};return N9(e,t,{...s,platform:a})};var rP=typeof document<"u",sP=function(){},Ph=rP?y.useLayoutEffect:sP;function rp(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(!rp(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)&&!rp(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function KA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function QC(e,t){const n=KA(e);return Math.round(t*n)/n}function u1(e){const t=y.useRef(e);return Ph(()=>{t.current=e}),t}function iP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(r);rp(b,r)||x(r);const[E,A]=y.useState(null),[w,S]=y.useState(null),k=y.useCallback(Q=>{Q!==R.current&&(R.current=Q,A(Q))},[]),N=y.useCallback(Q=>{Q!==j.current&&(j.current=Q,S(Q))},[]),_=a||E,M=l||w,R=y.useRef(null),j=y.useRef(null),O=y.useRef(m),H=d!=null,P=u1(d),Y=u1(s),X=u1(h),Z=y.useCallback(()=>{if(!R.current||!j.current)return;const Q={placement:t,strategy:n,middleware:b};Y.current&&(Q.platform=Y.current),nP(R.current,j.current,Q).then(se=>{const D={...se,isPositioned:X.current!==!1};ee.current&&!rp(O.current,D)&&(O.current=D,or.flushSync(()=>{p(D)}))})},[b,t,n,Y,X]);Ph(()=>{h===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(Q=>({...Q,isPositioned:!1})))},[h]);const ee=y.useRef(!1);Ph(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Ph(()=>{if(_&&(R.current=_),M&&(j.current=M),_&&M){if(P.current)return P.current(_,M,Z);Z()}},[_,M,Z,P,H]);const V=y.useMemo(()=>({reference:R,floating:j,setReference:k,setFloating:N}),[k,N]),z=y.useMemo(()=>({reference:_,floating:M}),[_,M]),G=y.useMemo(()=>{const Q={position:n,left:0,top:0};if(!z.floating)return Q;const se=QC(z.floating,m.x),D=QC(z.floating,m.y);return u?{...Q,transform:"translate("+se+"px, "+D+"px)",...KA(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:D}},[n,u,z.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:Z,refs:V,elements:z,floatingStyles:G}),[m,Z,V,z,G])}const aP=(e,t)=>{const n=W9(e);return{name:n.name,fn:n.fn,options:[e,t]}},oP=(e,t)=>{const n=Q9(e);return{name:n.name,fn:n.fn,options:[e,t]}},lP=(e,t)=>({fn:tP(e).fn,options:[e,t]}),uP=(e,t)=>{const n=Z9(e);return{name:n.name,fn:n.fn,options:[e,t]}},cP=(e,t)=>{const n=J9(e);return{name:n.name,fn:n.fn,options:[e,t]}},dP=(e,t)=>{const n=eP(e);return{name:n.name,fn:n.fn,options:[e,t]}},fP={open:Ue(e=>e.open),transitionStatus:Ue(e=>e.transitionStatus),domReferenceElement:Ue(e=>e.domReferenceElement),referenceElement:Ue(e=>e.positionReference??e.referenceElement),floatingElement:Ue(e=>e.floatingElement),floatingId:Ue(e=>e.floatingId)};class Xp extends Dp{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:PA(),nested:r,triggerElements:a},fP),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Ej(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 XA(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:a,onOpenChange:l}=e,u=t.useState("open"),d=t.useState("activeTriggerElement"),h=t.useState(n?"popupElement":"positionerElement"),m=t.context.triggerElements,p=l,b=y.useRef(null);r===void 0&&b.current===null&&(b.current=new Xp({open:u,transitionStatus:void 0,referenceElement:d,floatingElement:h,triggerElements:m,onOpenChange:p,floatingId:s,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",s),Ke(()=>{const E={open:u,floatingId:s,referenceElement:d,floatingElement:h};St(d)&&(E.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(E.positionReference=d),x.update(E)},[u,s,d,h,x]),x.context.onOpenChange=p,x.context.nested=a,x}function uy(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),Ke(()=>{if(!e&&a&&r!=="ending"&&n){const u=Us.request(()=>{s("ending")});return()=>{Us.cancel(u)}}},[e,a,r,n]),Ke(()=>{if(!e||t)return;const u=Us.request(()=>{s(void 0)});return()=>{Us.cancel(u)}},[t,e]),Ke(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&s("starting");const u=Us.request(()=>{s("idle")});return()=>{Us.cancel(u)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let ld=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const hP={[ld.startingStyle]:""},pP={[ld.endingStyle]:""},uu={transitionStatus(e){return e==="starting"?hP:e==="ending"?pP:null}};function WA(e,t=!1,n=!0){const r=Wl();return rt((s,a=null)=>{r.cancel();const l=pi(e);if(l==null)return;const u=l,d=()=>{or.flushSync(s)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function h(){Promise.all(u.getAnimations().map(m=>m.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const m=u.getAnimations();!a?.aborted&&m.length>0&&m.some(p=>p.pending||p.playState!=="finished")&&h()})}if(t){const m=ld.startingStyle;if(!u.hasAttribute(m)){r.request(h);return}const p=new MutationObserver(()=>{u.hasAttribute(m)||(p.disconnect(),h())});p.observe(u,{attributes:!0,attributeFilter:[m]}),a?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}r.request(h)})}function Io(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,a=rt(s),l=WA(r,n,!1);y.useEffect(()=>{if(!t)return;const u=new AbortController;return l(a,u.signal),()=>{u.abort()}},[t,n,a,l])}const Wp={tabIndex:-1,[Eb]:""};function mP(e){return t=>t==="touch"?e.current:!0}function QA(e,t,n=!1){const r=Eo(),s=ka()!=null,a=y.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,s));const l=e??a.current;return XA({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function gP(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,u=r.current,d=t.context.triggerElements.getById(l);u&&d===u&&(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 cy(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 ZA(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function bP(e,t,n,r={}){const s=n.reason,a=s===qn,l=t&&s===Fl,u=!t&&(s===lu||s===qp),d=ZA(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const h=()=>{const m={...r.extraState,open:t};l?m.instantType="focus":u?m.instantType="dismiss":a&&(m.instantType=void 0),cy(m,t,n.trigger,d()),e.update(m)};a?or.flushSync(h):h()}function JA(e,t,n,r){Px(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function dy(e,t,n,r){const s=n.useState("isMountedByTrigger",e),a=gP(e,n),l=rt(u=>{if(a(u),!u)return;const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){n.update({activeTriggerElement:u,...d?r:null});return}h==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return Ke(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function fy(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");Ke(()=>{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 u=e.select("activeTriggerId");let d=null;if(u){const h=e.context.triggerElements.getById(u);h?h!==e.state.activeTriggerElement&&(l.activeTriggerElement=h):d=u}if(!d&&!u&&a===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,p]=h.value;l.activeTriggerId=m,l.activeTriggerElement=p}}(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 h=pt(ou);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function hy(e,t,n){const{mounted:r,setMounted:s,transitionStatus:a}=uy(e),l=t.useState("preventUnmountingOnClose"),u=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:u});const d=rt(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Io({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function py(e,t){e.useSyncedValues(t),Ke(()=>()=>{e.update({activeTriggerProps:fn,inactiveTriggerProps:fn,popupProps:fn})},[e])}function xP(e,t){Ke(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Ke(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Ed{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 yP(){return new Xp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Ed,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function my(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:yP(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fn,inactiveTriggerProps:fn,popupProps:fn}}function e_(e,t,n=!1){return new Xp({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const zc=Ue(e=>e.triggerIdProp??e.activeTriggerId),gy=Ue(e=>e.openProp??e.open),ZC=Ue(e=>(e.popupElement?.id??e.floatingId)||void 0);function t_(e,t){return t!==void 0&&gy(e)&&zc(e)===t}function vP(e,t){return t_(e,t)?!0:t!==void 0&&gy(e)&&zc(e)==null&&e.triggerCount===1}const by={open:gy,mounted:Ue(e=>e.mounted),transitionStatus:Ue(e=>e.transitionStatus),floatingRootContext:Ue(e=>e.floatingRootContext),triggerCount:Ue(e=>e.triggerCount),preventUnmountingOnClose:Ue(e=>e.preventUnmountingOnClose),payload:Ue(e=>e.payload),activeTriggerId:zc,activeTriggerElement:Ue(e=>e.mounted?e.activeTriggerElement:null),popupId:ZC,isTriggerActive:Ue((e,t)=>t!==void 0&&zc(e)===t),isOpenedByTrigger:Ue((e,t)=>t_(e,t)),isMountedByTrigger:Ue((e,t)=>t!==void 0&&zc(e)===t&&e.mounted),triggerProps:Ue((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Ue((e,t)=>vP(e,t)?ZC(e):void 0),popupProps:Ue(e=>e.popupProps),popupElement:Ue(e=>e.popupElement),positionerElement:Ue(e=>e.positionerElement)};function n_(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=Eo(),a=ka()!=null,l=br(()=>new Xp({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ed,floatingId:s,syncOnly:!1,nested:a})).current;return Ke(()=>{const u={open:t,floatingId:s};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=St(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),l.update(u)},[t,s,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function EP(e={}){const{nodeId:t,externalTree:n}=e,r=n_(e),s=e.rootContext||r,a=s.useState("referenceElement"),l=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.useState("open"),h=s.useState("floatingId"),[m,p]=y.useState(null),[b,x]=y.useState(void 0),[E,A]=y.useState(void 0),w=y.useRef(null),S=Na(n),k=y.useMemo(()=>({reference:a,floating:l,domReference:u}),[a,l,u]),N=iP({...e,elements:{...k,...m&&{reference:m}}}),_=St(b)?b:null,M=E===void 0?s.state.floatingElement:E;s.useSyncedValue("referenceElement",b??null),s.useSyncedValue("domReferenceElement",b===void 0?u:_),s.useSyncedValue("floatingElement",M);const R=y.useCallback(X=>{const Z=St(X)?{getBoundingClientRect:()=>X.getBoundingClientRect(),getClientRects:()=>X.getClientRects(),contextElement:X}:X;p(Z),N.refs.setReference(Z)},[N.refs]),j=y.useCallback(X=>{(St(X)||X===null)&&(w.current=X,x(X)),(St(N.refs.reference.current)||N.refs.reference.current===null||X!==null&&!St(X))&&N.refs.setReference(X)},[N.refs,x]),O=y.useCallback(X=>{A(X),N.refs.setFloating(X)},[N.refs]),H=y.useMemo(()=>({...N.refs,setReference:j,setFloating:O,setPositionReference:R,domReference:w}),[N.refs,j,O,R]),P=y.useMemo(()=>({...N.elements,domReference:u}),[N.elements,u]),Y=y.useMemo(()=>({...N,dataRef:s.context.dataRef,open:d,onOpenChange:s.setOpen,events:s.context.events,floatingId:h,refs:H,elements:P,nodeId:t,rootStore:s}),[N,H,P,t,s,d,h]);return Ke(()=>{u&&(w.current=u)},[u]),Ke(()=>{s.context.dataRef.current.floatingContext=Y;const X=S?.nodesRef.current.find(Z=>Z.id===t);X&&(X.context=Y)}),y.useMemo(()=>({...N,context:Y,refs:H,elements:P,rootStore:s}),[N,H,P,Y,s])}const c1=qx&&Ca;function r_(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=s.context,u=y.useRef(!1),d=y.useRef(null),h=y.useRef(!0),m=Gn();y.useEffect(()=>{const b=s.select("domReferenceElement");if(!n)return;const x=on(b);function E(){const S=s.select("domReferenceElement");!s.select("open")&&dn(S)&&S===_r(At(S))&&(u.current=!0)}function A(){h.current=!0}function w(){h.current=!1}return $s(Tt(x,"blur",E),c1&&Tt(x,"keydown",A,!0),c1&&Tt(x,"pointerdown",w,!0))},[s,n]),y.useEffect(()=>{if(!n)return;function b(x){if(x.reason===lu||x.reason===qp){const E=s.select("domReferenceElement");St(E)&&(d.current=E,u.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,s]);const p=y.useMemo(()=>{function b(){u.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const E=x.currentTarget;if(u.current){if(d.current===E)return;b()}const A=mr(x.nativeEvent);if(St(A)){if(c1&&!x.relatedTarget){if(!h.current&&!$p(A))return}else if(!Cj(A))return}const w=Qh(x.relatedTarget,s.context.triggerElements),{nativeEvent:S,currentTarget:k}=x,N=typeof r=="function"?r():r;if(s.select("open")&&w||N===0||N===void 0){s.setOpen(!0,pt(Fl,S,k));return}m.start(N,()=>{u.current||s.setOpen(!0,pt(Fl,S,k))})},onBlur(x){b();const E=x.relatedTarget,A=x.nativeEvent,w=St(E)&&E.hasAttribute(od("focus-guard"))&&E.getAttribute("data-type")==="outside";m.start(0,()=>{const S=s.select("domReferenceElement"),k=_r(At(S));!E&&k===S||st(l.current.floatingContext?.refs.floating.current,k)||st(S,k)||w||Qh(E??k,s.context.triggerElements)||s.setOpen(!1,pt(Fl,A))})}}},[l,r,s,m]);return y.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class xy{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 Ss,this.restTimeout=new Ss,this.handleCloseOptions=void 0}static create(){return new xy}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const sp=new WeakMap;function ip(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&sp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),sp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function s_(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,a=sp.get(n);a&&a!==e&&ip(a),ip(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,sp.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function yy(e){const t=e.context.dataRef.current,n=br(()=>t.hoverInteractionState??xy.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Vx(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function i_(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),u=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:h}=a.context,m=Na(),p=ka(),b=yy(a),x=Gn(),E=rt(()=>uA(h.current.openEvent?.type,b.interactedInside)),A=rt(()=>kj(h.current.openEvent?.type)),w=rt(()=>{ip(b)});Ke(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,w())},[l,b,w]),y.useEffect(()=>w,[w]),Ke(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&A()&&St(d)&&u){const S=d,k=u,N=At(u),_=m?.nodesRef.current.find(O=>O.id===p)?.context?.elements.floating;_&&(_.style.pointerEvents="");const M=b.pointerEventsScopeElement!==k?b.pointerEventsScopeElement:null,R=_!==k?_:null,j=b.handleCloseOptions?.getScope?.()??M??R??S.closest("[data-rootownerid]")??N.body;return s_(b,{scopeElement:j,referenceElement:S,floatingElement:k}),()=>{w()}}},[n,l,d,u,b,A,m,p,w]),y.useEffect(()=>{if(!n)return;function S(){return!!(m&&p&&ya(m.nodesRef.current,p).length>0)}function k(O){const H=Ql(r,"close",b.pointerType),P=()=>{a.setOpen(!1,pt(qn,O)),m?.events.emit("floating.closed",O)};H?b.openChangeTimeout.start(H,P):(b.openChangeTimeout.clear(),P())}function N(O){const H=mr(O);if(!Sj(H)){b.interactedInside=!1;return}b.interactedInside=H?.closest("[aria-haspopup]")!=null}function _(){b.openChangeTimeout.clear(),x.clear(),m?.events.off("floating.closed",R),w()}function M(O){if(S()&&m){m.events.on("floating.closed",R);return}if(Qh(O.relatedTarget,a.context.triggerElements))return;const H=h.current.floatingContext?.nodeId??s,P=O.relatedTarget;if(!(m&&H&&St(P)&&ya(m.nodesRef.current,H,!1).some(X=>st(X.context?.elements.floating,P)))){if(b.handler){b.handler(O);return}w(),A()&&!E()&&k(O)}}function R(O){!m||!p||S()||x.start(0,()=>{m.events.off("floating.closed",R),a.setOpen(!1,pt(qn,O)),m.events.emit("floating.closed",O)})}const j=u;return $s(j&&Tt(j,"mouseenter",_),j&&Tt(j,"mouseleave",M),j&&Tt(j,"pointerdown",N,!0),()=>{m?.events.off("floating.closed",R)})},[n,u,a,h,r,s,A,E,w,b,m,p,x])}const TP={current:null};function a_(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:a=!1,restMs:l=0,move:u=!0,triggerElementRef:d=TP,externalTree:h,isActiveTrigger:m=!0,getHandleCloseContext:p,isClosing:b,shouldOpen:x}=t,E="rootStore"in e?e.rootStore:e,{dataRef:A,events:w}=E.context,S=Na(h),k=yy(E),N=y.useRef(!1),_=Tn(s),M=Tn(r),R=Tn(l),j=Tn(n),O=Tn(x),H=Tn(b),P=rt(()=>uA(A.current.openEvent?.type,k.interactedInside)),Y=rt(()=>O.current?.()!==!1),X=rt((V,z,G)=>{const Q=E.context.triggerElements;if(Q.hasElement(z))return!V||!st(V,z);if(!St(G))return!1;const se=G;return Q.hasMatchingElement(D=>st(D,se))&&(!V||!st(V,se))}),Z=rt(()=>{if(!k.handler)return;At(E.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),ee=rt(()=>{ip(k)});return m&&(k.handleCloseOptions=_.current?.__options),y.useEffect(()=>Z,[Z]),y.useEffect(()=>{if(!n)return;function V(z){z.open?N.current=!1:(N.current=z.reason===qn,Z(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return w.on("openchange",V),()=>{w.off("openchange",V)}},[n,w,k,Z]),y.useEffect(()=>{if(!n)return;function V(se,D=!0){const B=Ql(M.current,"close",k.pointerType);B?k.openChangeTimeout.start(B,()=>{E.setOpen(!1,pt(qn,se)),S?.events.emit("floating.closed",se)}):D&&(k.openChangeTimeout.clear(),E.setOpen(!1,pt(qn,se)),S?.events.emit("floating.closed",se))}const z=d.current??(m?E.select("domReferenceElement"):null);if(!St(z))return;function G(se){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,a&&!yo(k.pointerType))return;const D=wC(R.current),B=Ql(M.current,"open",k.pointerType),$=mr(se),L=se.currentTarget??null,te=E.select("domReferenceElement");let ne=L;if(St($)&&!E.context.triggerElements.hasElement($)){for(const ze of E.context.triggerElements.elements())if(st(ze,$)){ne=ze;break}}St(L)&&St(te)&&!E.context.triggerElements.hasElement(L)&&st(L,te)&&(ne=te);const ce=ne==null?!1:X(te,ne,$),fe=E.select("open"),de=H.current?.()??E.select("transitionStatus")==="ending",xe=!fe&&de&&N.current,Fe=!ce&&St(ne)&&St(te)&&st(te,ne)&&xe,De=D>0&&!B,Te=ce&&(fe||xe)||Fe,Oe=!fe||ce;if(Te){Y()&&E.setOpen(!0,pt(qn,se,ne));return}De||(B?k.openChangeTimeout.start(B,()=>{Oe&&Y()&&E.setOpen(!0,pt(qn,se,ne))}):Oe&&Y()&&E.setOpen(!0,pt(qn,se,ne)))}function Q(se){if(P()){ee();return}Z();const D=E.select("domReferenceElement"),B=At(D);k.restTimeout.clear(),k.restTimeoutPending=!1;const $=A.current.floatingContext??p?.();if(Qh(se.relatedTarget,E.context.triggerElements))return;if(_.current&&$){E.select("open")||k.openChangeTimeout.clear();const te=d.current;k.handler=_.current({...$,tree:S,x:se.clientX,y:se.clientY,onClose(){ee(),Z(),j.current&&!P()&&te===E.select("domReferenceElement")&&V(se,!0)}}),B.addEventListener("mousemove",k.handler),k.handler(se);return}(k.pointerType==="touch"?!st(E.select("floatingElement"),se.relatedTarget):!0)&&V(se)}return u?$s(Tt(z,"mousemove",G,{once:!0}),Tt(z,"mouseenter",G),Tt(z,"mouseleave",Q)):$s(Tt(z,"mouseenter",G),Tt(z,"mouseleave",Q))},[Z,ee,A,M,E,n,_,k,m,X,P,a,u,R,d,S,j,p,H,Y]),y.useMemo(()=>{if(!n)return;function V(z){k.pointerType=z.pointerType}return{onPointerDown:V,onPointerEnter:V,onMouseMove(z){const{nativeEvent:G}=z,Q=z.currentTarget,se=E.select("domReferenceElement"),D=E.select("open"),B=X(se,Q,z.target);if(a&&!yo(k.pointerType))return;if(D&&B&&k.handleCloseOptions?.blockPointerEvents){const te=E.select("floatingElement");if(te){const ne=k.handleCloseOptions?.getScope?.()??Q.ownerDocument.body;s_(k,{scopeElement:ne,referenceElement:Q,floatingElement:te})}}const $=wC(R.current);if(D&&!B||$===0||!B&&k.restTimeoutPending&&z.movementX**2+z.movementY**2<2)return;k.restTimeout.clear();function L(){if(k.restTimeoutPending=!1,P())return;const te=E.select("open");!k.blockMouseMove&&(!te||B)&&Y()&&E.setOpen(!0,pt(qn,G,Q))}k.pointerType==="touch"?or.flushSync(()=>{L()}):B&&D?L():(k.restTimeoutPending=!0,k.restTimeout.start($,L))}}},[n,k,P,X,a,E,R,Y])}const SP="Escape";function Qp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function oh(e,t){return Qp(t,e===lA||e===Kx,e===Hp||e===Fp)}function d1(e,t,n){return Qp(t,e===Kx,n?e===Hp:e===Fp)||e==="Enter"||e===" "||e===""}function CP(e,t,n){return Qp(t,n?e===Hp:e===Fp,e===Kx)}function wP(e,t,n,r){const s=n?e===Fp:e===Hp,a=e===lA;return t==="both"||t==="horizontal"&&r?e===SP:Qp(t,s,a)}function o_(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:u=!1,loopFocus:d=!1,nested:h=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:E=!0,disabledIndices:A=void 0,orientation:w="vertical",parentOrientation:S,id:k,resetOnPointerLeave:N=!0,externalTree:_,grid:M}=t,R=M!=null,j="rootStore"in e?e.rootStore:e,O=j.useState("open"),H=j.useState("floatingElement"),P=j.useState("domReferenceElement"),Y=j.context.dataRef,X=Zh(H),Z=Tb(P),ee=Tn(X),V=ka(),z=Na(_),G=y.useRef(b),Q=y.useRef(l??-1),se=y.useRef(null),D=y.useRef(!0),B=rt(oe=>{s(Q.current===-1?null:Q.current,oe)}),$=y.useRef(!!H),L=y.useRef(O),te=y.useRef(!1),ne=y.useRef(!1),ce=y.useRef(null),fe=Tn(A),de=Tn(O),xe=Tn(l),Fe=Tn(N),De=Wl(),Te=Wl(),Oe=rt(()=>{function oe(le){p?z?.events.emit("virtualfocus",le):ce.current=jh(le,{sync:te.current,preventScroll:!0})}const ae=n.current[Q.current],K=ne.current;ae&&oe(ae),(te.current?le=>le():le=>De.request(le))(()=>{const le=n.current[Q.current]||ae;if(!le)return;ae||oe(le),Ee&&(K||!D.current)&&le.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Ke(()=>{Y.current.orientation=w},[Y,w]),Ke(()=>{a&&(O&&H?(Q.current=l??-1,G.current&&l!=null&&(ne.current=!0,B())):$.current&&(Q.current=-1,B()))},[a,O,H,l,B]),Ke(()=>{if(a){if(!O){te.current=!1;return}if(H)if(r==null){if(te.current=!1,xe.current!=null)return;if($.current&&(Q.current=-1,Oe()),(!L.current||!$.current)&&G.current&&(se.current!=null||G.current===!0&&se.current==null)){let oe=0;const ae=()=>{n.current[0]==null?(oe<2&&(oe?F=>Te.request(F):queueMicrotask)(ae),oe+=1):(Q.current=se.current==null||d1(se.current,w,m)||h?s1(n):_C(n),se.current=null,B())};ae()}}else AC(n.current,r)||(Q.current=r,Oe(),ne.current=!1)}},[a,O,H,r,xe,h,n,w,m,B,Oe,Te]),Ke(()=>{if(!a||H||!z||p||!$.current)return;const oe=z.nodesRef.current,ae=oe.find(le=>le.id===V)?.context?.elements.floating,K=_r(At(P??ae??null)),F=oe.some(le=>le.context&&st(le.context.elements.floating,K));ae&&!F&&D.current&&ae.focus({preventScroll:!0})},[a,H,P,z,V,p]),Ke(()=>{L.current=O,$.current=!!H}),Ke(()=>{O||(se.current=null,G.current=b)},[O,b]);const ze=r!=null,Xe=rt(oe=>{if(!de.current)return;const ae=n.current.indexOf(oe.currentTarget);ae!==-1&&(Q.current!==ae||r!==ae)&&(Q.current=ae,B(oe))}),Ye=rt(()=>S??z?.nodesRef.current.find(oe=>oe.id===V)?.context?.dataRef?.current.orientation),Le=rt(()=>s1(n,fe.current)),ke=rt(oe=>{if(D.current=!1,te.current=!0,oe.which===229||!de.current&&oe.currentTarget===ee.current)return;if(h&&wP(oe.key,w,m,R)){oh(oe.key,Ye())||zs(oe),j.setOpen(!1,pt(Sb,oe.nativeEvent)),dn(P)&&(p?z?.events.emit("virtualfocus",P):P.focus());return}const ae=Q.current,K=s1(n,A),F=_C(n,A);if(Z||(oe.key==="Home"&&(zs(oe),Q.current=K,B(oe)),oe.key==="End"&&(zs(oe),Q.current=F,B(oe))),M!=null){const le=M(oe,Q.current,n,w,d,m,A,K,F);if(le!=null&&(Q.current=le,B(oe)),w==="both")return}if(oh(oe.key,w)){if(zs(oe),O&&!p&&_r(oe.currentTarget.ownerDocument)===oe.currentTarget){Q.current=d1(oe.key,w,m)?K:F,B(oe);return}d1(oe.key,w,m)?d?ae>=F?u&&ae!==n.current.length?Q.current=-1:(te.current=!1,Q.current=K):Q.current=Ll(n.current,{startingIndex:ae,disabledIndices:A}):Q.current=Math.min(F,Ll(n.current,{startingIndex:ae,disabledIndices:A})):d?ae<=K?u&&ae!==-1?Q.current=n.current.length:(te.current=!1,Q.current=F):Q.current=Ll(n.current,{startingIndex:ae,decrement:!0,disabledIndices:A}):Q.current=Math.max(K,Ll(n.current,{startingIndex:ae,decrement:!0,disabledIndices:A})),AC(n.current,Q.current)&&(Q.current=-1),B(oe)}}),Ee=y.useMemo(()=>({onFocus(ae){te.current=!0,Xe(ae)},onClick:({currentTarget:ae})=>ae.focus({preventScroll:!0}),onMouseMove(ae){te.current=!0,ne.current=!1,x&&Xe(ae)},onPointerLeave(ae){if(!de.current||!D.current||ae.pointerType==="touch")return;te.current=!0;const K=ae.relatedTarget;if(!(!x||n.current.includes(K))&&Fe.current&&(ce.current?.(),ce.current=null,Q.current=-1,B(ae),!p)){const F=ee.current,le=_r(At(F));F&&st(F,le)&&F.focus({preventScroll:!0})}}}),[Xe,de,ee,x,n,B,Fe,p]),Ie=y.useMemo(()=>p&&O&&ze&&{"aria-activedescendant":`${k}-${r}`},[p,O,ze,k,r]),je=y.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...Z?{}:Ie,onKeyDown(oe){if(oe.key==="Tab"&&oe.shiftKey&&O&&!p){const ae=mr(oe.nativeEvent);if(ae&&!st(ee.current,ae))return;zs(oe),j.setOpen(!1,pt(vo,oe.nativeEvent)),dn(P)&&P.focus();return}ke(oe)},onPointerMove(){D.current=!0}}),[Ie,ke,ee,w,Z,j,O,p,P]),J=y.useMemo(()=>{function oe(F){j.setOpen(!0,pt(Sb,F.nativeEvent,F.currentTarget))}function ae(F){b==="auto"&&Gx(F.nativeEvent)&&(G.current=!p)}function K(F){G.current=b,b==="auto"&&aA(F.nativeEvent)&&(G.current=!0)}return{onKeyDown(F){const le=j.select("open");D.current=!1;const Ce=F.key.startsWith("Arrow"),_e=CP(F.key,Ye(),m),Ve=oh(F.key,w),Pe=(h?_e:Ve)||F.key==="Enter"||F.key.trim()==="";if(p&&le)return ke(F);if(!(!le&&!E&&Ce)){if(Pe){const We=oh(F.key,Ye());se.current=h&&We?null:F.key}if(h){_e&&(zs(F),le?(Q.current=Le(),B(F)):oe(F));return}Ve&&(xe.current!=null&&(Q.current=xe.current),zs(F),!le&&E?oe(F):ke(F),le&&B(F))}},onFocus(F){j.select("open")&&!p&&(Q.current=-1,B(F))},onPointerDown:K,onPointerEnter:K,onMouseDown:ae,onClick:ae}},[ke,b,Le,h,B,j,E,w,Ye,m,xe,p]),pe=y.useMemo(()=>({...Ie,...J}),[Ie,J]);return y.useMemo(()=>a?{reference:pe,floating:je,item:Ee,trigger:J}:{},[a,pe,je,J,Ee])}function l_(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:a,disabledIndices:l,onTyping:u,enabled:d=!0,resetMs:h=750,selectedIndex:m=null}=t,p="rootStore"in e?e.rootStore:e,b=p.useState("open"),x=Gn(),E=y.useRef(""),A=y.useRef(m??s??-1),w=y.useRef(null),S=rt(_=>{function M(ee){const V=r?.current[ee];return!V||Yp(V)}function R(ee){return M(ee)?l==null||!pA(Kl,ee,l):!1}function j(ee,V,z=0){if(ee.length===0)return-1;const G=(z%ee.length+ee.length)%ee.length,Q=V.toLowerCase();for(let se=0;se<ee.length;se+=1){const D=(G+se)%ee.length;if(!(!ee[D]?.toLowerCase().startsWith(Q)||!R(D)))return D}return-1}const O=n.current;if(E.current.length>0&&_.key===" "&&(zs(_),u?.(!0)),E.current.length>0&&E.current[0]!==" "&&j(O,E.current)===-1&&_.key!==" "&&u?.(!1),O==null||_.key.length!==1||_.ctrlKey||_.metaKey||_.altKey)return;b&&_.key!==" "&&(zs(_),u?.(!0));const H=E.current==="";H&&(A.current=m??s??-1),O.every((ee,V)=>ee&&R(V)?ee[0]?.toLowerCase()!==ee[1]?.toLowerCase():!0)&&E.current===_.key&&(E.current="",A.current=w.current),E.current+=_.key,x.start(h,()=>{E.current="",A.current=w.current,u?.(!1)});const X=((H?m??s??-1:A.current)??0)+1,Z=j(O,E.current,X);Z!==-1?(a?.(Z),w.current=Z):_.key!==" "&&(E.current="",u?.(!1))}),k=rt(_=>{const M=_.relatedTarget,R=p.select("domReferenceElement"),j=p.select("floatingElement");st(R,M)||st(j,M)||(x.clear(),E.current="",A.current=w.current,u?.(!1))});Ke(()=>{!b&&m!==null||(x.clear(),w.current=null,E.current!==""&&(E.current=""))},[b,m,x]),Ke(()=>{b&&E.current===""&&(A.current=m??s??-1)},[b,m,s]);const N=y.useMemo(()=>({onKeyDown:S,onBlur:k}),[S,k]);return y.useMemo(()=>d?{reference:N,floating:N}:{},[d,N])}const JC=.1,kP=JC*JC,Wt=.5;function lh(e,t,n,r,s,a){return r>=t!=a>=t&&e<=(s-n)*(t-r)/(a-r)+n}function uh(e,t,n,r,s,a,l,u,d,h){let m=!1;return lh(e,t,n,r,s,a)&&(m=!m),lh(e,t,s,a,l,u)&&(m=!m),lh(e,t,l,u,d,h)&&(m=!m),lh(e,t,d,h,n,r)&&(m=!m),m}function NP(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ch(e,t,n,r,s,a){const l=Math.min(n,s),u=Math.max(n,s),d=Math.min(r,a),h=Math.max(r,a);return e>=l&&e<=u&&t>=d&&t<=h}function u_(e={}){const{blockPointerEvents:t=!1}=e,n=new Ss,r=({x:s,y:a,placement:l,elements:u,onClose:d,nodeId:h,tree:m})=>{const p=l?.split("-")[0];let b=!1,x=null,E=null,A=typeof performance<"u"?performance.now():0;function w(k,N){const _=performance.now(),M=_-A;if(x===null||E===null||M===0)return x=k,E=N,A=_,!1;const R=k-x,j=N-E,O=R*R+j*j,H=M*M*kP;return x=k,E=N,A=_,O<H}function S(){n.clear(),d()}return function(N){n.clear();const _=u.domReference,M=u.floating;if(!_||!M||p==null||s==null||a==null)return;const{clientX:R,clientY:j}=N,O=mr(N),H=N.type==="mouseleave",P=st(M,O),Y=st(_,O);if(P&&(b=!0,!H))return;if(Y&&(b=!1,!H)){b=!0;return}if(H&&St(N.relatedTarget)&&st(M,N.relatedTarget))return;function X(){return!!(m&&ya(m.nodesRef.current,h).length>0)}function Z(){X()||S()}if(X())return;const ee=_.getBoundingClientRect(),V=M.getBoundingClientRect(),z=s>V.right-V.width/2,G=a>V.bottom-V.height/2,Q=V.width>ee.width,se=V.height>ee.height,D=(Q?ee:V).left,B=(Q?ee:V).right,$=(se?ee:V).top,L=(se?ee:V).bottom;if(p==="top"&&a>=ee.bottom-1||p==="bottom"&&a<=ee.top+1||p==="left"&&s>=ee.right-1||p==="right"&&s<=ee.left+1){Z();return}let te=!1;switch(p){case"top":te=ch(R,j,D,ee.top+1,B,V.bottom-1);break;case"bottom":te=ch(R,j,D,V.top+1,B,ee.bottom-1);break;case"left":te=ch(R,j,V.right-1,L,ee.left+1,$);break;case"right":te=ch(R,j,ee.right-1,L,V.left+1,$);break}if(te)return;if(b&&!NP(R,j,ee)){Z();return}if(!H&&w(R,j)){Z();return}let ne=!1;switch(p){case"top":{const ce=Q?Wt/2:Wt*4,fe=Q||z?s+ce:s-ce,de=Q?s-ce:z?s+ce:s-ce,xe=a+Wt+1,Fe=z||Q?V.bottom-Wt:V.top,De=z?Q?V.bottom-Wt:V.top:V.bottom-Wt;ne=uh(R,j,fe,xe,de,xe,V.left,Fe,V.right,De);break}case"bottom":{const ce=Q?Wt/2:Wt*4,fe=Q||z?s+ce:s-ce,de=Q?s-ce:z?s+ce:s-ce,xe=a-Wt,Fe=z||Q?V.top+Wt:V.bottom,De=z?Q?V.top+Wt:V.bottom:V.top+Wt;ne=uh(R,j,fe,xe,de,xe,V.left,Fe,V.right,De);break}case"left":{const ce=se?Wt/2:Wt*4,fe=se||G?a+ce:a-ce,de=se?a-ce:G?a+ce:a-ce,xe=s+Wt+1,Fe=G||se?V.right-Wt:V.left,De=G?se?V.right-Wt:V.left:V.right-Wt;ne=uh(R,j,Fe,V.top,De,V.bottom,xe,fe,xe,de);break}case"right":{const ce=se?Wt/2:Wt*4,fe=se||G?a+ce:a-ce,de=se?a-ce:G?a+ce:a-ce,xe=s-Wt,Fe=G||se?V.left+Wt:V.right,De=G?se?V.left+Wt:V.right:V.left+Wt;ne=uh(R,j,xe,fe,xe,de,Fe,V.top,De,V.bottom);break}}ne?b||n.start(40,Z):Z()}};return r.__options={...e,blockPointerEvents:t},r}const c_=y.createContext(null),d_=y.createContext(null);function Aa(){const e=y.useContext(c_);if(e===null)throw new Error(Dn(60));return e}function f_(){const e=y.useContext(d_);if(e===null)throw new Error(Dn(61));return e}let ew=(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 AP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ic={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},_P={disabled:!1,...Ic},RP={valid(e){return e===null?null:e?{[ew.valid]:""}:{[ew.invalid]:""}}},IP={invalid:void 0,name:void 0,validityData:{state:AP,errors:[],error:"",value:"",initialValue:null},setValidityData:Vn,disabled:void 0,touched:Ic.touched,setTouched:Vn,dirty:Ic.dirty,setDirty:Vn,filled:Ic.filled,setFilled:Vn,focused:Ic.focused,setFocused:Vn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:_P,markedDirtyRef:{current:!1},registerFieldControl:Vn,validation:{getValidationProps:(e,t=fn)=>t,inputRef:{current:null},registerInput:Vn,commit:async()=>{},change:Vn}},OP=y.createContext(IP);function vy(e=!0){const t=y.useContext(OP);if(t.setValidityData===Vn&&!e)throw new Error(Dn(28));return t}function MP(e,t,n,r,s=!0,a){const{registerFieldControl:l}=vy(),u=y.useRef(null);u.current||(u.current=Symbol()),Ke(()=>{const d=u.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 Oo(e){return Eo(e,"base-ui")}const LP=y.createContext({controlId:void 0,registerControlId:Vn,labelId:void 0,setLabelId:Vn,messageIds:[],setMessageIds:Vn,getDescriptionProps:e=>e});function h_(){return y.useContext(LP)}function p_(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=h_(),l=Oo(t),u=n?s:void 0,d=br(()=>Symbol("labelable-control")),h=y.useRef(!1),m=y.useRef(t!=null),p=rt(()=>{!h.current||a===Vn||(h.current=!1,a(d.current,void 0))});return Ke(()=>{if(a===Vn)return;let b;if(n){const x=r?.current;St(x)&&x.closest("label")!=null?b=t??null:b=u??l}else if(t!=null)m.current=!0,b=t;else if(m.current)b=l;else{p();return}if(b===void 0){p();return}h.current=!0,a(d.current,b)},[t,r,u,a,n,l,d,p]),y.useEffect(()=>p,[p]),s??l}const DP=(e,t)=>Object.is(e,t);function So(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function jP(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:So(t,r,n))}function Uc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:So(r,t,n))}function PP(e,t,n){return e.filter(r=>!So(t,r,n))}function Ab(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function m_(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function BP(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(m_(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 g_(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 Ab(e)}function to(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ab(e.value):Ab(e)}function b_(e,t,n){function r(){return g_(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=m_(s)?s.flatMap(l=>l.items):s;if(e==null||typeof e!="object"){const l=a.find(u=>u.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(u=>u&&u.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function zP(e,t,n){return e.reduce((r,s,a)=>(a>0&&r.push(", "),r.push(f.jsx(y.Fragment,{children:b_(s,t,n)},a)),r),[])}const dt={id:Ue(e=>e.id),labelId:Ue(e=>e.labelId),modal:Ue(e=>e.modal),multiple:Ue(e=>e.multiple),items:Ue(e=>e.items),itemToStringLabel:Ue(e=>e.itemToStringLabel),itemToStringValue:Ue(e=>e.itemToStringValue),isItemEqualToValue:Ue(e=>e.isItemEqualToValue),value:Ue(e=>e.value),hasSelectedValue:Ue(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:to(t,r)!==""}),hasNullItemLabel:Ue((e,t)=>t?BP(e.items):!1),open:Ue(e=>e.open),mounted:Ue(e=>e.mounted),forceMount:Ue(e=>e.forceMount),transitionStatus:Ue(e=>e.transitionStatus),openMethod:Ue(e=>e.openMethod),activeIndex:Ue(e=>e.activeIndex),selectedIndex:Ue(e=>e.selectedIndex),isActive:Ue((e,t)=>e.activeIndex===t),isSelected:Ue((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>So(t,s,n)):So(t,r,n)}),isSelectedByFocus:Ue((e,t)=>e.selectedIndex===t),popupProps:Ue(e=>e.popupProps),triggerProps:Ue(e=>e.triggerProps),triggerElement:Ue(e=>e.triggerElement),positionerElement:Ue(e=>e.positionerElement),listElement:Ue(e=>e.listElement),popupSide:Ue(e=>e.popupSide),scrollUpArrowVisible:Ue(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ue(e=>e.scrollDownArrowVisible),hasScrollArrows:Ue(e=>e.hasScrollArrows)},UP=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Vn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function HP(){return y.useContext(UP)}function FP(e,t,n=(r,s)=>r===s){return e.length===t.length&&e.every((r,s)=>n(r,t[s]))}function x_(e,t){const n=y.useRef(e),r=rt(t);Ke(()=>{n.current!==e&&r(n.current)},[e,r]),Ke(()=>{n.current=e},[e])}function $P(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 y_(e,t){const n=rt((a,l)=>{(typeof e=="function"?e():e)||t(l||(Up?"touch":""))}),{onClick:r,onPointerDown:s}=$P(n);return y.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function v_(e){const[t,n]=y.useState(null),r=y_(e,n);return x_(e,s=>{s&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Oc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const mi=1;function E_(e,t){return Math.max(0,e-t)}function VP(e,t){if(t<=0)return 0;const n=Oc(e,0,t),r=n,s=t-n,a=r<=mi,l=s<=mi;return a&&l?r<=s?0:t:a?0:l?t:n}function qP(e){const{id:t,value:n,defaultValue:r=null,onValueChange:s,open:a,defaultOpen:l=!1,onOpenChange:u,name:d,form:h,autoComplete:m,disabled:p=!1,readOnly:b=!1,required:x=!1,modal:E=!0,actionsRef:A,inputRef:w,onOpenChangeComplete:S,items:k,multiple:N=!1,itemToStringLabel:_,itemToStringValue:M,isItemEqualToValue:R=DP,highlightItemOnHover:j=!0,children:O}=e,{clearErrors:H}=HP(),{setDirty:P,setTouched:Y,setFocused:X,validityData:Z,setFilled:ee,name:V,disabled:z,validation:G,validationMode:Q}=vy(),se=p_({id:t}),D=z||p,B=V??d,[$,L]=SC({controlled:n,default:N?r??Kl:r,name:"Select",state:"value"}),[te,ne]=SC({controlled:a,default:l,name:"Select",state:"open"}),ce=y.useRef([]),fe=y.useRef([]),de=y.useRef(null),xe=y.useRef(null),Fe=y.useRef(0),De=y.useRef(null),Te=y.useRef([]),Oe=y.useRef(!1),ze=y.useRef(null),Xe=y.useRef(null),Ye=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=y.useRef(!1),{mounted:ke,setMounted:Ee,transitionStatus:Ie}=uy(te),{openMethod:je,triggerProps:J}=v_(te),pe=br(()=>new sA({id:se,labelId:void 0,modal:E,multiple:N,itemToStringLabel:_,itemToStringValue:M,isItemEqualToValue:R,value:$,open:te,mounted:ke,transitionStatus:Ie,items:k,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,oe=ft(pe,dt.activeIndex),ae=ft(pe,dt.selectedIndex),K=ft(pe,dt.triggerElement),F=ft(pe,dt.positionerElement),le=qD(je),Ce=je??le??null,_e=y.useMemo(()=>N?"":to($,M),[N,$,M]),Ve=y.useMemo(()=>N&&Array.isArray($)?$.map(ht=>to(ht,M)):to($,M),[N,$,M]),Pe=Tn(pe.state.triggerElement),We=rt(()=>Ve);MP(Pe,se,$,We,!D,d);const lt=y.useRef($),ct=N?Array.isArray($)&&$.length>0:$!=null&&to($,M)!=="";Ke(()=>{$!==lt.current&&pe.set("forceMount",!0)},[pe,$]),Ke(()=>{ee(ct)},[ct,ee]),Ke(function(){const It=Te.current;let yn;if(N){const Un=Array.isArray($)?$:[];if(Un.length===0)yn=null;else{const jn=Un[Un.length-1],tn=Uc(It,jn,R);yn=tn===-1?null:tn}}else{const Un=Uc(It,$,R);yn=Un===-1?null:Un}yn===null&&(Xe.current=null),!te&&pe.set("selectedIndex",yn)},[ct,N,te,$,Te,R,pe,Xe]);function Ge(ht){const It=Z.initialValue;return Array.isArray(ht)&&Array.isArray(It)?!FP(ht,It,(yn,Un)=>So(yn,Un,R)):ht!==It}x_($,()=>{H(B),P(Ge($)),G.change($)});const Rt=rt((ht,It)=>{u?.(ht,It),!It.isCanceled&&(ne(ht),!ht&&(It.reason===vo||It.reason===Vp)&&(Y(!0),X(!1),Q==="onBlur"&&G.commit($)))}),jt=rt(()=>{Ee(!1),pe.update({activeIndex:null,openMethod:null}),S?.(!1)});Io({enabled:!A,open:te,ref:de,onComplete(){te||jt()}}),y.useImperativeHandle(A,()=>({unmount:jt}),[jt]);const ut=rt((ht,It)=>{s?.(ht,It),!It.isCanceled&&L(ht)}),Lt=rt(()=>{const ht=pe.state.listElement||de.current;if(!ht)return;const It=E_(ht.scrollHeight,ht.clientHeight),yn=VP(ht.scrollTop,It),Un=yn>0,jn=yn<It;pe.state.scrollUpArrowVisible!==Un&&pe.set("scrollUpArrowVisible",Un),pe.state.scrollDownArrowVisible!==jn&&pe.set("scrollDownArrowVisible",jn)}),Zt=n_({open:te,onOpenChange:Rt,elements:{reference:K,floating:F}}),$t=oy(Zt,{enabled:!b&&!D,event:"mousedown"}),Jt=Gp(Zt),Qe=o_(Zt,{enabled:!b&&!D,listRef:ce,activeIndex:oe,selectedIndex:ae,disabledIndices:Kl,onNavigate(ht){ht===null&&!te||pe.set("activeIndex",ht)},focusItemOnHover:j}),yt=l_(Zt,{enabled:!b&&!D&&(te||!N),listRef:fe,activeIndex:oe,selectedIndex:ae,disabledIndices:ht=>YD(ce.current[ht]),onMatch(ht){te?pe.set("activeIndex",ht):ut(Te.current[ht],pt("none"))},onTyping(ht){Oe.current=ht}}),Ht=y.useMemo(()=>{const ht=Ir(yt.reference,Qe.reference,Jt.reference,$t.reference,J);return se&&(ht.id=se),ht},[$t.reference,yt.reference,Qe.reference,Jt.reference,J,se]),en=y.useMemo(()=>Ir(Wp,yt.floating,Qe.floating,Jt.floating),[yt.floating,Qe.floating,Jt.floating]),Kn=Qe.item??fn;Px(()=>{pe.update({popupProps:en,triggerProps:Ht})}),Ke(()=>{pe.update({id:se,modal:E,multiple:N,value:$,open:te,mounted:ke,transitionStatus:Ie,popupProps:en,triggerProps:Ht,items:k,itemToStringLabel:_,itemToStringValue:M,isItemEqualToValue:R,openMethod:Ce})},[pe,se,E,N,$,te,ke,Ie,en,Ht,k,_,M,R,Ce]);const vt=y.useMemo(()=>({store:pe,name:B,required:x,disabled:D,readOnly:b,multiple:N,highlightItemOnHover:j,setValue:ut,setOpen:Rt,listRef:ce,popupRef:de,scrollHandlerRef:xe,handleScrollArrowVisibility:Lt,scrollArrowsMountedCountRef:Fe,itemProps:Kn,valueRef:De,valuesRef:Te,labelsRef:fe,typingRef:Oe,selectionRef:Ye,firstItemTextRef:ze,selectedItemTextRef:Xe,validation:G,onOpenChangeComplete:S,alignItemWithTriggerActiveRef:Le,initialValueRef:lt}),[pe,B,x,D,b,N,j,ut,Rt,Kn,G,S,Lt]),ln=xo(w,G.inputRef),yr=N&&Array.isArray($)&&$.length>0,bn=N?void 0:B,Cn=y.useMemo(()=>!N||!Array.isArray($)||!B?null:$.map(ht=>{const It=to(ht,M);return f.jsx("input",{type:"hidden",form:h,name:B,value:It,disabled:D},It)}),[N,$,h,B,M,D]);return f.jsx(c_.Provider,{value:vt,children:f.jsxs(d_.Provider,{value:Zt,children:[O,f.jsx("input",{...G.getValidationProps(D,{onFocus(){pe.state.triggerElement?.focus({focusVisible:!0})},onChange(ht){if(ht.nativeEvent.defaultPrevented||D||b)return;const It=ht.currentTarget.value,yn=pt(ou,ht.nativeEvent);function Un(){if(N)return;const jn=It.toLowerCase();let tn=Te.current.findIndex(_s=>to(_s,M).toLowerCase()===jn||g_(_s,_).toLowerCase()===jn);tn===-1&&(tn=Te.current.findIndex((_s,yu)=>{const Dd=fe.current[yu];return Dd!=null&&Dd.toLowerCase()===jn}));const Xn=tn===-1?void 0:Te.current[tn];Xn!=null&&ut(Xn,yn)}pe.set("forceMount",!0),queueMicrotask(Un)}}),id:se&&bn==null?`${se}-hidden-input`:void 0,form:h,name:bn,autoComplete:m,value:_e,disabled:D,required:x&&!yr,readOnly:b,ref:ln,style:B?HD:JN,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Cn]})})}function YP(e,t){return e??t}let lo=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ld.startingStyle]="startingStyle",e[e.endingStyle=ld.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),ap=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const GP={[ap.popupOpen]:""},KP={[ap.popupOpen]:"",[ap.pressed]:""},XP={[lo.open]:""},WP={[lo.closed]:""},QP={[lo.anchorHidden]:""},Ey={open(e){return e?GP:null}},_b={open(e){return e?KP:null}},cu={open(e){return e?XP:WP},anchorHidden(e){return e?QP:null}};function T_(e){const t=e.getBoundingClientRect(),n=on(e);if(Yx)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,u=parseFloat(r.height)||0,d=parseFloat(s.width)||0,h=parseFloat(s.height)||0,m=Math.max(t.width,l,d),p=Math.max(t.height,u,h),b=m-t.width,x=p-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-x/2,bottom:t.bottom+x/2}}const ZP=y.createContext(void 0);function Ty(e=!1){const t=y.useContext(ZP);if(t===void 0&&!e)throw new Error(Dn(16));return t}function JP(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,l=r&&t!==!1,u=r&&t===!1;return{props:y.useMemo(()=>{const h={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(h.tabIndex=s,!a&&n&&(h.tabIndex=t?s:-1)),(a&&(t||l)||!a&&n)&&(h["aria-disabled"]=n),a&&(!t||u)&&(h.disabled=n),h},[r,n,t,l,u,a,s])}}function du(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,l=y.useRef(null),u=Ty(!0),d=a??u!==void 0,{props:h}=JP({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:s}),m=y.useCallback(()=>{const x=l.current;f1(x)&&d&&t&&h.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,h.disabled,d]);Ke(m,[m]);const p=y.useCallback((x={})=>{const{onClick:E,onMouseDown:A,onKeyUp:w,onKeyDown:S,onPointerDown:k,...N}=x;return Ir({onClick(_){if(t){_.preventDefault();return}E?.(_)},onMouseDown(_){t||A?.(_)},onKeyDown(_){if(t||(np(_),S?.(_),_.baseUIHandlerPrevented))return;const M=_.target===_.currentTarget,R=_.currentTarget,j=f1(R),O=!s&&e7(R),H=M&&(s?j:!O),P=_.key==="Enter",Y=_.key===" ",X=R.getAttribute("role"),Z=X?.startsWith("menuitem")||X==="option"||X==="gridcell";if(M&&d&&Y){if(_.defaultPrevented&&Z)return;_.preventDefault(),O||s&&j?(R.click(),_.preventBaseUIHandler()):H&&(E?.(_),_.preventBaseUIHandler());return}H&&(!s&&(Y||P)&&_.preventDefault(),!s&&P&&E?.(_))},onKeyUp(_){if(!t){if(np(_),w?.(_),_.target===_.currentTarget&&s&&d&&f1(_.currentTarget)&&_.key===" "){_.preventDefault();return}_.baseUIHandlerPrevented||_.target===_.currentTarget&&!s&&!d&&_.key===" "&&E?.(_)}},onPointerDown(_){if(t){_.preventDefault();return}k?.(_)}},s?{type:"button"}:{role:"button"},h,N)},[t,h,d,s]),b=rt(x=>{l.current=x,m()});return{getButtonProps:p,buttonRef:b}}function f1(e){return dn(e)&&e.tagName==="BUTTON"}function e7(e){return!!(e?.tagName==="A"&&e?.href)}const dh=2,t7=400,n7={..._b,...RP,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},r7=y.forwardRef(function(t,n){const{render:r,className:s,id:a,disabled:l=!1,nativeButton:u=!0,style:d,...h}=t,{setTouched:m,setFocused:p,validationMode:b,state:x,disabled:E}=vy(),{labelId:A}=h_(),{store:w,setOpen:S,selectionRef:k,validation:N,readOnly:_,required:M,alignItemWithTriggerActiveRef:R,disabled:j}=Aa(),O=E||j||l,H=ft(w,dt.open),P=ft(w,dt.mounted),Y=ft(w,dt.value),X=ft(w,dt.triggerProps),Z=ft(w,dt.positionerElement),ee=ft(w,dt.listElement),V=ft(w,dt.popupSide),z=ft(w,dt.id),G=ft(w,dt.labelId),Q=ft(w,dt.hasSelectedValue),se=P&&Z?V:null,D=a??z,B=YP(A,G);p_({id:D});const $=Tn(Z),L=y.useRef(null),{getButtonProps:te,buttonRef:ne}=du({disabled:O,native:u}),ce=rt(Oe=>{w.set("triggerElement",Oe)}),fe=Gn(),de=Gn(),xe=Gn();y.useEffect(()=>{if(H)return xe.start(t7,()=>{k.current.allowUnselectedMouseUp=!0,k.current.allowSelectedMouseUp=!0}),()=>{xe.clear()};k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},de.clear()},[H,k,de,xe]);const Fe=Ir(X,{id:D,role:"combobox","aria-expanded":H?"true":"false","aria-haspopup":"listbox","aria-controls":H?ee?.id??Zh(Z)?.id:void 0,"aria-labelledby":B,"aria-readonly":_||void 0,"aria-required":M||void 0,tabIndex:O?-1:0,onFocus(Oe){p(!0),H&&R.current&&S(!1,pt(ou,Oe.nativeEvent)),fe.start(0,()=>{w.set("forceMount",!0)})},onBlur(Oe){st(Z,Oe.relatedTarget)||(m(!0),p(!1),b==="onBlur"&&N.commit(Y))},onMouseDown(Oe){if(H)return;const ze=At(Oe.currentTarget);function Xe(Ye){if(!L.current)return;const Le=Ye.target;if(st(L.current,Le)||st($.current,Le))return;const ke=T_(L.current);Ye.clientX>=ke.left-dh&&Ye.clientX<=ke.right+dh&&Ye.clientY>=ke.top-dh&&Ye.clientY<=ke.bottom+dh||S(!1,pt(cA,Ye))}de.start(0,()=>{ze.addEventListener("mouseup",Xe,{once:!0})})}},h,te),De=N.getValidationProps(O,Fe);De.role="combobox";const Te={...x,open:H,disabled:O,value:Y,readOnly:_,popupSide:se,placeholder:!Q};return An("button",t,{ref:[n,L,ne,ce],state:Te,stateAttributesMapping:n7,props:De})}),s7={value:()=>null},i7=y.forwardRef(function(t,n){const{className:r,render:s,children:a,placeholder:l,style:u,...d}=t,{store:h,valueRef:m}=Aa(),p=ft(h,dt.value),b=ft(h,dt.items),x=ft(h,dt.itemToStringLabel),E=ft(h,dt.hasSelectedValue),A=!E&&l!=null&&a==null,w=ft(h,dt.hasNullItemLabel,A),S={value:p,placeholder:!E};let k=null;return typeof a=="function"?k=a(p):a!=null?k=a:!E&&l!=null&&!w?k=l:Array.isArray(p)?k=zP(p,b,x):k=b_(p,b,x),An("span",t,{state:S,ref:[n,m],props:[{children:k},d],stateAttributesMapping:s7})}),a7=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,{store:u}=Aa(),h={open:ft(u,dt.open)};return An("span",t,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:Ey})}),o7=y.createContext(void 0),l7=y.forwardRef(function(t,n){const{store:r}=Aa(),s=ft(r,dt.mounted),a=ft(r,dt.forceMount);return s||a?f.jsx(o7.Provider,{value:!0,children:f.jsx(ry,{ref:n,...t})}):null});function Sy(e){return zx(19)?e:e?"true":void 0}const S_=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function u7(){return y.useContext(S_)}function C_(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,a=rt(s),l=y.useRef(0),u=br(d7).current,d=br(c7).current,[h,m]=y.useState(0),p=y.useRef(h),b=rt((S,k)=>{d.set(S,k??null),p.current+=1,m(p.current)}),x=rt(S=>{d.delete(S),p.current+=1,m(p.current)}),E=y.useMemo(()=>{const S=new Map;return Array.from(d.keys()).filter(N=>N.isConnected).sort(f7).forEach((N,_)=>{const M=d.get(N)??{};S.set(N,{...M,index:_})}),S},[d,h]);Ke(()=>{if(typeof MutationObserver!="function"||E.size===0)return;const S=new MutationObserver(k=>{const N=new Set,_=M=>N.has(M)?N.delete(M):N.add(M);k.forEach(M=>{M.removedNodes.forEach(_),M.addedNodes.forEach(_)}),N.size===0&&(p.current+=1,m(p.current))});return E.forEach((k,N)=>{N.parentElement&&S.observe(N.parentElement,{childList:!0})}),()=>{S.disconnect()}},[E]),Ke(()=>{p.current===h&&(n.current.length!==E.size&&(n.current.length=E.size),r&&r.current.length!==E.size&&(r.current.length=E.size),l.current=E.size),a(E)},[a,E,n,r,h]),Ke(()=>()=>{n.current=[]},[n]),Ke(()=>()=>{r&&(r.current=[])},[r]);const A=rt(S=>(u.add(S),()=>{u.delete(S)}));Ke(()=>{u.forEach(S=>S(E))},[u,E]);const w=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:A,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,A,n,r,l]);return f.jsx(S_.Provider,{value:w,children:t})}function c7(){return new Map}function d7(){return new Set}function f7(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 h7=y.createContext(void 0);function Cy(){return y.useContext(h7)?.direction??"ltr"}const p7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:m=0,offsetParent:p="real"}=wi(e,t)||{};if(h==null)return{};const b=hA(m),x={x:n,y:r},E=Zx(s),A=Qx(E),w=await l.getDimensions(h),S=E==="y",k=S?"top":"left",N=S?"bottom":"right",_=S?"clientHeight":"clientWidth",M=a.reference[A]+a.reference[E]-x[E]-a.floating[A],R=x[E]-a.reference[E],j=p==="real"?await l.getOffsetParent?.(h):u.floating;let O=u.floating[_]||a.floating[A];(!O||!await l.isElement?.(j))&&(O=u.floating[_]||a.floating[A]);const H=M/2-R/2,P=O/2-w[A]/2-1,Y=Math.min(b[k],P),X=Math.min(b[N],P),Z=Y,ee=O-w[A]-X,V=O/2-w[A]/2+H,z=fA(Z,V,ee),G=!d.arrow&&wa(s)!=null&&V!==z&&a.reference[A]/2-(V<Z?Y:X)-w[A]/2<0,Q=G?V<Z?V-Z:V-ee:0;return{[E]:x[E]+Q,data:{[E]:z,centerOffset:V-z-Q,...G&&{alignmentOffset:Q}},reset:G}}}),m7=(e,t)=>({...p7(e),options:[e,t]}),g7=dP().fn,b7={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 g7(e)).data?.referenceHidden||a}}}},Bh={sideX:"left",sideY:"top"},w_={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:s},platform:a,strategy:l,placement:u}=e,d=on(s),h=d.getComputedStyle(s);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:n,data:Bh};const p=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(p===d){const k=At(s);b={width:k.documentElement.clientWidth,height:k.documentElement.clientHeight}}else await a.isElement?.(p)&&(b=await a.getDimensions(p));const x=$r(u);let E=t,A=n;x==="left"&&(E=b.width-(t+r.width)),x==="top"&&(A=b.height-(n+r.height));const w=x==="left"?"right":Bh.sideX,S=x==="top"?"bottom":Bh.sideY;return{x:E,y:A,data:{sideX:w,sideY:S}}}};function k_(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 tw(e,t,n){const{rects:r,placement:s}=e;return{side:k_(t,$r(s),n),align:wa(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function wy(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:b,keepMounted:x=!1,floatingRootContext:E,mounted:A,collisionAvoidance:w,shiftCrossAxis:S=!1,nodeId:k,adaptiveOrigin:N,lazyFlip:_=!1,externalTree:M}=e,[R,j]=y.useState(null);!A&&R!==null&&j(null);const O=w.side||"flip",H=w.align||"flip",P=w.fallbackAxisSide||"end",Y=typeof t=="function"?t:void 0,X=rt(Y),Z=Y?X:t,ee=Tn(t),V=Tn(A),G=Cy()==="rtl",Q=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"}[r],se=a==="center"?Q:`${Q}-${a}`;let D=d;const B=1,$=r==="bottom"?B:0,L=r==="top"?B:0,te=r==="right"?B:0,ne=r==="left"?B:0;typeof D=="number"?D={top:D+$,right:D+ne,bottom:D+L,left:D+te}:D&&(D={top:(D.top||0)+$,right:(D.right||0)+ne,bottom:(D.bottom||0)+L,left:(D.left||0)+te});const ce={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:D},fe=y.useRef(null),de=Tn(s),xe=Tn(l),Fe=typeof s!="function"?s:0,De=typeof l!="function"?l:0,Te=[];b&&Te.push(b),Te.push(aP(ut=>{const Lt=tw(ut,r,G),Zt=typeof de.current=="function"?de.current(Lt):de.current,$t=typeof xe.current=="function"?xe.current(Lt):xe.current;return{mainAxis:Zt,crossAxis:$t,alignmentAxis:$t}},[Fe,De,G,r]));const Oe=H==="none"&&O!=="shift",ze=!Oe&&(h||S||O==="shift"),Xe=O==="none"?null:uP({...ce,padding:{top:D.top+B,right:D.right+B,bottom:D.bottom+B,left:D.left+B},mainAxis:!S&&O==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),Ye=Oe?null:oP(ut=>{const Lt=At(ut.elements.floating).documentElement;return{...ce,rootBoundary:S?{x:0,y:0,width:Lt.clientWidth,height:Lt.clientHeight}:void 0,mainAxis:H!=="none",crossAxis:ze,limiter:h||S?void 0:lP(Zt=>{if(!fe.current)return{};const{width:$t,height:Jt}=fe.current.getBoundingClientRect(),Qe=us($r(Zt.placement)),yt=Qe==="y"?$t:Jt,Ht=Qe==="y"?D.left+D.right:D.top+D.bottom;return{offset:yt/2+Ht/2}})}},[ce,h,S,D,H]);O==="shift"||H==="shift"||a==="center"?Te.push(Ye,Xe):Te.push(Xe,Ye),Te.push(cP({...ce,apply({elements:{floating:ut},availableWidth:Lt,availableHeight:Zt,rects:$t}){if(!V.current)return;const Jt=ut.style;Jt.setProperty("--available-width",`${Lt}px`),Jt.setProperty("--available-height",`${Zt}px`);const Qe=on(ut).devicePixelRatio||1,{x:yt,y:Ht,width:en,height:Kn}=$t.reference,vt=(Math.round((yt+en)*Qe)-Math.round(yt*Qe))/Qe,ln=(Math.round((Ht+Kn)*Qe)-Math.round(Ht*Qe))/Qe;Jt.setProperty("--anchor-width",`${vt}px`),Jt.setProperty("--anchor-height",`${ln}px`)}}),m7(ut=>({element:fe.current||At(ut.elements.floating).createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(ut){const{elements:Lt,middlewareData:Zt,placement:$t,rects:Jt,y:Qe}=ut,yt=$r($t),Ht=us(yt),en=fe.current,Kn=Zt.arrow?.x||0,vt=Zt.arrow?.y||0,ln=en?.clientWidth||0,yr=en?.clientHeight||0,bn=Kn+ln/2,Cn=vt+yr/2,ht=Math.abs(Zt.shift?.y||0),It=Jt.reference.height/2,yn=typeof s=="function"?s(tw(ut,r,G)):s,Un=ht>yn,jn={top:`${bn}px calc(100% + ${yn}px)`,bottom:`${bn}px ${-yn}px`,left:`calc(100% + ${yn}px) ${Cn}px`,right:`${-yn}px ${Cn}px`}[yt],tn=`${bn}px ${Jt.reference.y+It-Qe}px`;return Lt.floating.style.setProperty("--transform-origin",ze&&Ht==="y"&&Un?tn:jn),{}}},b7,N),Ke(()=>{!A&&E&&E.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[A,E]);const Le=y.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:ke,elements:Ee,x:Ie,y:je,middlewareData:J,update:pe,placement:oe,context:ae,isPositioned:K,floatingStyles:F}=EP({rootContext:E,open:x?A:void 0,placement:se,middleware:Te,strategy:n,whileElementsMounted:x?void 0:(...ut)=>WC(...ut,Le),nodeId:k,externalTree:M}),{sideX:le,sideY:Ce}=J.adaptiveOrigin||Bh,_e=K?n:"fixed",Ve=y.useMemo(()=>{const ut=N?{position:_e,[le]:Ie,[Ce]:je}:{position:_e,...F};return K||(ut.opacity=0),ut},[N,_e,le,Ie,Ce,je,F,K]),Pe=y.useRef(null);Ke(()=>{if(!A)return;const ut=ee.current,Lt=typeof ut=="function"?ut():ut,$t=(nw(Lt)?Lt.current:Lt)||null||null;$t!==Pe.current&&(ke.setPositionReference($t),Pe.current=$t)},[A,ke,Z,ee]),y.useEffect(()=>{if(!A)return;const ut=ee.current;typeof ut!="function"&&nw(ut)&&ut.current!==Pe.current&&(ke.setPositionReference(ut.current),Pe.current=ut.current)},[A,ke,Z,ee]),y.useEffect(()=>{if(x&&A&&Ee.reference&&Ee.floating)return WC(Ee.reference,Ee.floating,pe,Le)},[x,A,Ee,pe,Le]);const We=$r(oe),lt=k_(r,We,G),ct=wa(oe)||"center",Ge=!!J.hide?.referenceHidden;Ke(()=>{_&&A&&K&&j(We)},[_,A,K,We]);const Rt=y.useMemo(()=>({position:"absolute",top:J.arrow?.y,left:J.arrow?.x}),[J.arrow]),jt=J.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:Ve,arrowStyles:Rt,arrowRef:fe,arrowUncentered:jt,side:lt,align:ct,physicalSide:We,anchorHidden:Ge,refs:ke,context:ae,isPositioned:K,update:pe}),[Ve,Rt,fe,jt,lt,ct,We,Ge,ke,ae,K,pe])}function nw(e){return e!=null&&"current"in e}const N_=y.createContext(void 0);function x7(){const e=y.useContext(N_);if(!e)throw new Error(Dn(59));return e}const ky=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 f.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function op(e,t){e&&Object.assign(e.style,t)}const y7={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Zp(e){return e==="starting"?p9:fn}function Ny(e,t,{styles:n,transitionStatus:r,props:s,refs:a,hidden:l,inert:u=!1}){const d={...n};return u&&(d.pointerEvents="none"),An("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},Zp(r),s],stateAttributesMapping:cu})}let rw={},sw={},iw="";function v7(e){if(typeof document>"u")return!1;const t=At(e);return on(t).innerWidth-t.documentElement.clientWidth>0}function E7(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=At(e),r=n.documentElement,s=n.body,a=Ro(r)?r:s,l=a.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const h=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=u,d===h}function T7(e){const t=At(e),n=t.documentElement,r=t.body,s=Ro(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 S7(e){const t=At(e),n=t.documentElement,r=t.body,s=on(n);let a=0,l=0,u=!1;const d=Us.create();if(Ca&&(s.visualViewport?.scale??1)!==1)return()=>{};function h(){const x=s.getComputedStyle(n),E=s.getComputedStyle(r),S=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,rw={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},iw=n.style.scrollBehavior,sw={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 k=n.scrollHeight>n.clientHeight,N=n.scrollWidth>n.clientWidth,_=x.overflowY==="scroll"||E.overflowY==="scroll",M=x.overflowX==="scroll"||E.overflowX==="scroll",R=Math.max(0,s.innerWidth-r.clientWidth),j=Math.max(0,s.innerHeight-r.clientHeight),O=parseFloat(E.marginTop)+parseFloat(E.marginBottom),H=parseFloat(E.marginLeft)+parseFloat(E.marginRight),P=Ro(n)?n:r;if(u=E7(e),u){n.style.scrollbarGutter=S,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(k||_)&&(n.style.overflowY="scroll"),(N||M)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:O||j?`calc(100dvh - ${O+j}px)`:"100dvh",width:H||R?`calc(100vw - ${H+R}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 m(){Object.assign(n.style,rw),Object.assign(r.style,sw),u||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=iw)}function p(){m(),d.request(h)}h();const b=Tt(s,"resize",p);return()=>{d.cancel(),m(),typeof s.removeEventListener=="function"&&b()}}class C7{lockCount=0;restore=null;timeoutLock=Ss.create();timeoutUnlock=Ss.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=At(t).documentElement,s=on(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=Vn;return}const a=Up||!v7(t);this.restore=a?T7(t):S7(t)}}const w7=new C7;function A_(e=!0,t=null){Ke(()=>{if(e)return w7.acquire(t)},[e,t])}const k7=20;function __(e,t,n,r){const[s,a]=y.useState(!1);Ke(()=>{if(!e||!t||n==null){a(!1);return}const l=At(n).documentElement.clientWidth,u=n.offsetWidth;a(l>0&&u>0&&u>=l-k7)},[e,t,n]),A_(e&&(!t||s),r)}const N7={position:"fixed"},A7=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u="bottom",align:d="center",sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:A,alignItemWithTrigger:w=!0,collisionAvoidance:S=OA,style:k,...N}=t,{store:_,listRef:M,labelsRef:R,alignItemWithTriggerActiveRef:j,selectedItemTextRef:O,valuesRef:H,initialValueRef:P,popupRef:Y,setValue:X}=Aa(),Z=f_(),ee=ft(_,dt.open),V=ft(_,dt.mounted),z=ft(_,dt.modal),G=ft(_,dt.value),Q=ft(_,dt.openMethod),se=ft(_,dt.positionerElement),D=ft(_,dt.triggerElement),B=ft(_,dt.isItemEqualToValue),$=ft(_,dt.transitionStatus),L=y.useRef(null),te=y.useRef(null),[ne,ce]=y.useState(w),fe=V&&ne&&Q!=="touch";!V&&ne!==w&&ce(w),Ke(()=>{V||(dt.scrollUpArrowVisible(_.state)&&_.set("scrollUpArrowVisible",!1),dt.scrollDownArrowVisible(_.state)&&_.set("scrollDownArrowVisible",!1))},[_,V]),y.useImperativeHandle(j,()=>fe),__((fe||z)&&ee,Q==="touch",se,D);const de=wy({anchor:r,floatingRootContext:Z,positionMethod:s,mounted:V,side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:x,collisionBoundary:p,collisionPadding:b,sticky:E,disableAnchorTracking:A??fe,collisionAvoidance:S,keepMounted:!0}),xe=fe?"none":de.side,Fe=fe?N7:de.positionerStyles,De={open:ee,side:xe,align:de.align,anchorHidden:de.anchorHidden};Ke(()=>{_.set("popupSide",de.side)},[_,de.side]);const Te=rt(Le=>{_.set("positionerElement",Le)}),Oe=Ny(t,De,{styles:Fe,transitionStatus:$,props:N,refs:[n,Te],hidden:!V,inert:!ee}),ze=y.useRef(0),Xe=rt(Le=>{if(Le.size===0&&ze.current===0||H.current.length===0)return;const ke=ze.current;if(ze.current=Le.size,Le.size===ke)return;const Ee=pt(ou);if(ke!==0&&!_.state.multiple&&G!==null&&Uc(H.current,G,B)===-1){const je=P.current,pe=je!=null&&Uc(H.current,je,B)!==-1?je:null;X(pe,Ee),pe===null&&(_.set("selectedIndex",null),O.current=null)}if(ke!==0&&_.state.multiple&&Array.isArray(G)){const Ie=J=>Uc(H.current,J,B)!==-1,je=G.filter(J=>Ie(J));(je.length!==G.length||je.some(J=>!jP(G,J,B)))&&(X(je,Ee),je.length===0&&(_.set("selectedIndex",null),O.current=null))}if(ee&&fe){_.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};op(se,Ie),op(Y.current,Ie)}}),Ye=y.useMemo(()=>({...de,side:xe,alignItemWithTriggerActive:fe,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:L,scrollDownArrowRef:te}),[de,xe,fe,ce]);return f.jsx(C_,{elementsRef:M,labelsRef:R,onMapChange:Xe,children:f.jsxs(N_.Provider,{value:Ye,children:[V&&z&&f.jsx(ky,{inert:Sy(!ee),cutout:D}),Oe]})})}),fh="base-ui-disable-scrollbar",aw={className:fh,getElement(e){return f.jsx("style",{nonce:e,href:fh,precedence:"base-ui:low",children:`.${fh}{scrollbar-width:none}.${fh}::-webkit-scrollbar{display:none}`})}},_7=y.createContext(void 0);function R_(e){return y.useContext(_7)}const R7="ArrowUp",I7="ArrowDown",O7="ArrowLeft",M7="ArrowRight",L7="Home",D7="End",j7=new Set([O7,M7]),P7=new Set([R7,I7]),B7=new Set([...j7,...P7]),Ay=new Set([...B7,L7,D7]),z7=y.createContext(void 0),U7={disableStyleElements:!1};function H7(){return y.useContext(z7)??U7}const F7={...cu,...uu},$7=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d,popupRef:h,onOpenChangeComplete:m,setOpen:p,valueRef:b,firstItemTextRef:x,selectedItemTextRef:E,multiple:A,handleScrollArrowVisibility:w,scrollHandlerRef:S,listRef:k,highlightItemOnHover:N}=Aa(),{side:_,align:M,alignItemWithTriggerActive:R,isPositioned:j,setControlledAlignItemWithTrigger:O}=x7(),H=R_()!=null,P=f_(),Y=Cy(),{nonce:X,disableStyleElements:Z}=H7(),ee=ft(d,dt.id),V=ft(d,dt.open),z=ft(d,dt.openMethod),G=ft(d,dt.mounted),Q=ft(d,dt.popupProps),se=ft(d,dt.transitionStatus),D=ft(d,dt.triggerElement),B=ft(d,dt.positionerElement),$=ft(d,dt.listElement),L=y.useRef(!1),te=y.useRef(!1),ne=y.useRef({}),ce=Wl(),fe=rt(De=>{if(!B||!h.current||!te.current)return;if(L.current||!R){w();return}const Te=B.style.top==="0px",Oe=B.style.bottom==="0px";if(!Te&&!Oe){w();return}const ze=lw(B),Xe=Mc(B.getBoundingClientRect().height,"y",ze),Ye=At(B),Le=on(B),ke=Le.getComputedStyle(B),Ee=parseFloat(ke.marginTop),Ie=parseFloat(ke.marginBottom),je=ow(Le.getComputedStyle(h.current)),J=Math.min(Ye.documentElement.clientHeight-Ee-Ie,je),pe=De.scrollTop,oe=hh(De);let ae=0,K=null,F=!1,le=!1;const Ce=We=>{B.style.height=`${We}px`},_e=(We,lt)=>{const ct=Oc(We,0,J-Xe);ct>0&&Ce(Xe+ct),De.scrollTop=lt,J-(Xe+ct)<=mi&&(L.current=!0),w()},Ve=Te?oe-pe:pe,Pe=Math.min(Xe+Ve,J);if(ae=Pe,Ve<=mi){_e(Ve,Te?oe:0);return}if(J-Pe>mi)Te?le=!0:K=0;else if(F=!0,Oe&&pe<oe){const We=Xe+Ve-J;K=pe-(Ve-We)}if(ae=Math.ceil(ae),ae!==0&&Ce(ae),le||K!=null){const We=hh(De),lt=le?We:Oc(K,0,We);Math.abs(De.scrollTop-lt)>mi&&(De.scrollTop=lt)}(F||ae>=J-mi)&&(L.current=!0),w()});y.useImperativeHandle(S,()=>fe,[fe]),Io({open:V,ref:h,onComplete(){V&&m?.(!0)}});const de={open:V,transitionStatus:se,side:_,align:M};Ke(()=>{!B||!h.current||Object.keys(ne.current).length||(ne.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[h,B]),Ke(()=>{V||R||(te.current=!1,L.current=!1,op(B,ne.current))},[V,R,B,h]),Ke(()=>{const De=h.current;if(!V||!D||!B||!De||R&&!j||d.state.transitionStatus==="ending")return;if(!R){te.current=!0,ce.request(w),De.style.removeProperty("--transform-origin");return}const Te=V7(De);De.style.removeProperty("--transform-origin");try{let Oe=E.current;Oe?.isConnected||(Oe=!dt.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const ze=b.current,Xe=on(B),Ye=Xe.getComputedStyle(B),Le=Xe.getComputedStyle(De),ke=At(D),Ee=lw(D),Ie=ph(D.getBoundingClientRect(),Ee),je=ph(B.getBoundingClientRect(),Ee),J=Ie.height,pe=$||De,oe=pe.scrollHeight,ae=parseFloat(Le.borderBottomWidth),K=parseFloat(Ye.marginTop)||10,F=parseFloat(Ye.marginBottom)||10,le=parseFloat(Ye.minHeight)||100,Ce=ow(Le),_e=5,Ve=5,Pe=20,We=ke.documentElement.clientHeight-K-F,lt=ke.documentElement.clientWidth,ct=We-Ie.bottom+J;let Ge,Rt=Y==="rtl"?Ie.right-je.width:Ie.left,jt=0;if(Oe&&ze){const vt=ph(ze.getBoundingClientRect(),Ee);Ge=ph(Oe.getBoundingClientRect(),Ee),Rt=je.left+(Y==="rtl"?vt.right-Ge.right:vt.left-Ge.left);const ln=vt.top-Ie.top+vt.height/2;jt=Ge.top-je.top+Ge.height/2-ln}const ut=ct+jt+F+ae;let Lt=Math.min(We,ut);const Zt=We-K-F,$t=ut-Lt,Jt=lt-Ve;B.style.left=`${Oc(Rt,_e,Jt-je.width)}px`,B.style.height=`${Lt}px`,B.style.maxHeight="none",B.style.marginTop=`${K}px`,B.style.marginBottom=`${F}px`,De.style.height="100%";const Qe=hh(pe),yt=$t>=Qe-mi;yt&&(Lt=Math.min(We,je.height)-($t-Qe));const Ht=Ie.top<Pe||Ie.bottom>We-Pe||Math.ceil(Lt)+mi<Math.min(oe,le),en=(Xe.visualViewport?.scale??1)!==1&&Ca;if(Ht||en){te.current=!0,op(B,ne.current),O(!1);return}const Kn=Math.max(le,Lt);if(yt){const vt=Math.max(0,We-ut);B.style.top=je.height>=Zt?"0":`${vt}px`,B.style.height=`${Lt}px`,pe.scrollTop=hh(pe)}else B.style.bottom="0",pe.scrollTop=$t;if(Ge){const vt=je.top,ln=je.height,yr=Ge.top+Ge.height/2,bn=ln>0?(yr-vt)/ln*100:50,Cn=Oc(bn,0,100);De.style.setProperty("--transform-origin",`50% ${Cn}%`)}(Kn===We||Lt>=Ce)&&(L.current=!0),w(),N&&d.state.selectedIndex===null&&d.state.activeIndex===null&&k.current[0]!=null&&d.set("activeIndex",0),te.current=!0}finally{Te()}},[d,V,B,D,b,x,E,h,w,R,O,ce,$,k,N,Y,j]),y.useEffect(()=>{if(!R||!B||!V)return;const De=on(B);function Te(Oe){p(!1,pt(_j,Oe))}return Tt(De,"resize",Te)},[p,R,B,V]);const xe={...$?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":A||void 0,id:`${ee}-list`},onKeyDown(De){H&&Ay.has(De.key)&&De.stopPropagation()},onScroll(De){$||fe(De.currentTarget)},...R&&{style:$?{height:"100%"}:y7}},Fe=An("div",t,{ref:[n,h],state:de,stateAttributesMapping:F7,props:[Q,xe,Zp(se),{className:!$&&R?aw.className:void 0},u]});return f.jsxs(y.Fragment,{children:[!Z&&aw.getElement(X),f.jsx(ay,{context:P,modal:!1,disabled:!G,openInteractionType:z,returnFocus:l,restoreFocus:!0,children:Fe})]})});function ow(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function hh(e){return E_(e.scrollHeight,e.clientHeight)}function lw(e){return YA.getScale(e)}function Mc(e,t,n){return e/n[t]}function ph(e,t){return ad({x:Mc(e.x,"x",t),y:Mc(e.y,"y",t),width:Mc(e.width,"x",t),height:Mc(e.height,"y",t)})}const uw=[["transform","none"],["scale","1"],["translate","0 0"]];function V7(e){const{style:t}=e,n={};for(const[r,s]of uw)n[r]=t.getPropertyValue(r),t.setProperty(r,s,"important");return()=>{for(const[r]of uw){const s=n[r];s?t.setProperty(r,s):t.removeProperty(r)}}}let I_=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function _y(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:a}=e,{register:l,unregister:u,subscribeMapChange:d,elementsRef:h,labelsRef:m,nextIndexRef:p}=u7(),b=y.useRef(-1),[x,E]=y.useState(a??(s===I_.GuessFromOrder?()=>{if(b.current===-1){const S=p.current;p.current+=1,b.current=S}return b.current}:-1)),A=y.useRef(null),w=y.useCallback(S=>{if(A.current=S,x!==-1&&S!==null&&(h.current[x]=S,m)){const k=t!==void 0;m.current[x]=k?t:r?.current?.textContent??S.textContent}},[x,h,m,t,r]);return Ke(()=>{if(a!=null)return;const S=A.current;if(S)return l(S,n),()=>{u(S)}},[a,l,u,n]),Ke(()=>{if(a==null)return d(S=>{const k=A.current?S.get(A.current)?.index:null;k!=null&&E(k)})},[a,d,E]),{ref:w,index:x}}const O_=y.createContext(void 0);function Ry(){const e=y.useContext(O_);if(!e)throw new Error(Dn(57));return e}const q7=y.memo(y.forwardRef(function(t,n){const{render:r,className:s,style:a,value:l=null,label:u,disabled:d=!1,nativeButton:h=!1,...m}=t,p=y.useRef(null),b=_y({label:u,textRef:p,indexGuessBehavior:I_.GuessFromOrder}),{store:x,itemProps:E,setOpen:A,setValue:w,selectionRef:S,typingRef:k,valuesRef:N,multiple:_,selectedItemTextRef:M,disabled:R,readOnly:j}=Aa(),O=ft(x,dt.isActive,b.index),H=ft(x,dt.open),P=ft(x,dt.isSelected,l),Y=ft(x,dt.isSelectedByFocus,b.index),X=ft(x,dt.isItemEqualToValue),Z=b.index,ee=Z!==-1,V=y.useRef(null);Ke(()=>{if(!ee)return;const fe=N.current;return fe[Z]=l,()=>{delete fe[Z]}},[ee,Z,l,N]),Ke(()=>{if(!ee)return;const fe=x.state.value;let de=fe;_&&Array.isArray(fe)&&(de=fe.length>0?fe[fe.length-1]:void 0),de!==void 0&&So(l,de,X)&&(x.set("selectedIndex",Z),p.current&&(M.current=p.current))},[ee,Z,_,X,x,l,M]);const z=y.useRef(null),G=y.useRef("mouse"),Q=y.useRef(!1),{getButtonProps:se,buttonRef:D}=du({disabled:d,focusableWhenDisabled:!0,native:h,composite:!0}),B={disabled:d,selected:P,highlighted:O};function $(fe){if(R||j)return;const de=x.state.value;if(_){const xe=Array.isArray(de)?de:[],Fe=P?PP(xe,l,X):[...xe,l];w(Fe,pt(Bc,fe))}else w(l,pt(Bc,fe)),A(!1,pt(Bc,fe))}function L(){S.current.dragY=0}const te={role:"option","aria-selected":P,tabIndex:H&&O?0:-1,onKeyDown(fe){z.current=fe.key,x.set("activeIndex",Z),fe.key===" "&&k.current&&fe.preventDefault()},onClick(fe){const de=fe.type==="click"&&G.current!=="touch",xe=fe.nativeEvent.pointerType,Fe=de&&Gx(fe.nativeEvent)&&(xe!==void 0||O),De=de&&!Fe&&!Q.current;Q.current=!1,!(fe.type==="keydown"&&z.current===null)&&(d||fe.type==="keydown"&&z.current===" "&&k.current||De||(z.current=null,$(fe.nativeEvent)))},onPointerEnter(fe){G.current=fe.pointerType},onPointerMove(fe){if(fe.pointerType==="mouse"&&fe.buttons===1){const de=S.current;de.dragY+=fe.movementY,de.dragY**2>=64&&(de.allowUnselectedMouseUp=!0)}},onPointerDown(fe){G.current=fe.pointerType,Q.current=!0,L()},onMouseUp(){if(L(),d||G.current==="touch"||Q.current)return;const fe=!S.current.allowSelectedMouseUp&&P,de=!S.current.allowUnselectedMouseUp&&!P;fe||de||(Q.current=!0,V.current?.click(),Q.current=!1)}},ne=An("div",t,{ref:[D,n,b.ref,V],state:B,props:[E,te,m,se]}),ce=y.useMemo(()=>({selected:P,index:Z,textRef:p,selectedByFocus:Y,hasRegistered:ee}),[P,Z,p,Y,ee]);return f.jsx(O_.Provider,{value:ce,children:ne})})),Y7=y.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:s}=Ry();return r||s?f.jsx(G7,{...t,ref:n}):null}),G7=y.memo(y.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:a,...l}=e,{selected:u}=Ry(),d=y.useRef(null),{transitionStatus:h,setMounted:m}=uy(u),b=An("span",e,{ref:[t,d],state:{selected:u,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:uu});return Io({open:u,ref:d,onComplete(){u||m(!1)}}),b})),K7=y.memo(y.forwardRef(function(t,n){const{index:r,textRef:s,selectedByFocus:a,hasRegistered:l}=Ry(),{firstItemTextRef:u,selectedItemTextRef:d}=Aa(),{render:h,className:m,style:p,...b}=t,x=y.useCallback(A=>{A&&(l&&r===0&&(u.current=A),l&&a&&(d.current=A))},[u,d,r,a,l]);return An("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 M_=(...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 X7=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 W7=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 cw=e=>{const t=W7(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 h1={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 Q7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Z7=y.createContext({}),J7=()=>y.useContext(Z7),eB=y.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},d)=>{const{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:b="currentColor",className:x=""}=J7()??{},E=r??p?Number(n??m)*24/Number(t??h):n??m;return y.createElement("svg",{ref:d,...h1,width:t??h??h1.width,height:t??h??h1.height,stroke:e??b,strokeWidth:E,className:M_("lucide",x,s),...!a&&!Q7(u)&&{"aria-hidden":"true"},...u},[...l.map(([A,w])=>y.createElement(A,w)),...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 qe=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(eB,{ref:a,iconNode:t,className:M_(`lucide-${X7(cw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=cw(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 tB=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],nB=qe("arrow-down",tB);/**
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 rB=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sB=qe("arrow-up",rB);/**
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 iB=[["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"}]],aB=qe("at-sign",iB);/**
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 oB=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],lB=qe("bell-ring",oB);/**
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 uB=[["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"}]],cB=qe("brain",uB);/**
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 dB=[["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"}]],fB=qe("calendar-clock",dB);/**
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 hB=[["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"}]],pB=qe("chart-pie",hB);/**
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 mB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],L_=qe("check",mB);/**
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 gB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D_=qe("chevron-down",gB);/**
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 bB=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],lp=qe("chevron-left",bB);/**
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 xB=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Td=qe("chevron-right",xB);/**
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 yB=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],vB=qe("chevrons-up-down",yB);/**
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 EB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],TB=qe("circle-alert",EB);/**
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 SB=[["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"}]],CB=qe("circle-arrow-down",SB);/**
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 wB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],kB=qe("circle-pause",wB);/**
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 NB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],AB=qe("circle-slash",NB);/**
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 _B=[["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"}]],RB=qe("clipboard-list",_B);/**
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 IB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dw=qe("clock",IB);/**
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 OB=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],j_=qe("code",OB);/**
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 MB=[["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"}]],LB=qe("copy",MB);/**
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 DB=[["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"}]],P_=qe("download",DB);/**
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 jB=[["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"}]],PB=qe("ellipsis",jB);/**
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 BB=[["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"}]],zB=qe("file-diff",BB);/**
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 UB=[["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"}]],HB=qe("file-exclamation-point",UB);/**
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 FB=[["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"}]],Iy=qe("file-text",FB);/**
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 $B=[["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"}]],Jp=qe("file",$B);/**
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 VB=[["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"}]],qB=qe("folder-open",VB);/**
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 YB=[["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"}]],GB=qe("folder-search",YB);/**
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 KB=[["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"}]],XB=qe("folder-tree",KB);/**
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 WB=[["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"}]],B_=qe("folder",WB);/**
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 QB=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ZB=qe("funnel",QB);/**
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 JB=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],ez=qe("gauge",JB);/**
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 tz=[["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"}]],fw=qe("globe",tz);/**
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 nz=[["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"}]],z_=qe("hand",nz);/**
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 rz=[["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"}]],sz=qe("history",rz);/**
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 iz=[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]],az=qe("id-card",iz);/**
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 oz=[["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"}]],lz=qe("image",oz);/**
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 uz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cz=qe("info",uz);/**
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 dz=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Rb=qe("layers",dz);/**
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 fz=[["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"}]],U_=qe("link-2",fz);/**
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 hz=[["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"}]],H_=qe("list-checks",hz);/**
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 pz=[["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"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],hw=qe("list-todo",pz);/**
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 mz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gz=qe("loader-circle",mz);/**
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 bz=[["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"}]],F_=qe("message-circle-question-mark",bz);/**
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 xz=[["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"}]],yz=qe("message-square-text",xz);/**
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 vz=[["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"}]],$_=qe("moon",vz);/**
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 Ez=[["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"}]],Oy=qe("panel-left-close",Ez);/**
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 Tz=[["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"}]],My=qe("panel-left-open",Tz);/**
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 Sz=[["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"}]],Cz=qe("paperclip",Sz);/**
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 wz=[["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"}]],kz=qe("pencil-line",wz);/**
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 Nz=[["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"}]],Az=qe("pencil",Nz);/**
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 _z=[["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"}]],Ly=qe("plug",_z);/**
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 Rz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mo=qe("plus",Rz);/**
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 Iz=[["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"}]],Oz=qe("power-off",Iz);/**
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 Mz=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Lz=qe("power",Mz);/**
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 Dz=[["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"}]],jz=qe("puzzle",Dz);/**
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 Pz=[["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"}]],em=qe("refresh-cw",Pz);/**
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 Bz=[["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"}]],zz=qe("rotate-ccw",Bz);/**
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 Uz=[["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"}]],Dy=qe("rotate-cw",Uz);/**
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 Hz=[["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"}]],Fz=qe("save",Hz);/**
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 $z=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],V_=qe("search-x",$z);/**
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 Vz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tm=qe("search",Vz);/**
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 qz=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Yz=qe("server",qz);/**
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 Gz=[["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"}]],Kz=qe("settings",Gz);/**
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 Xz=[["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"}]],Wz=qe("shield-check",Xz);/**
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 Qz=[["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"}]],nm=qe("sparkles",Qz);/**
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 Zz=[["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"}]],Jz=qe("square-check-big",Zz);/**
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 eU=[["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"}]],tU=qe("square-pen",eU);/**
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 nU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],rU=qe("square-slash",nU);/**
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 sU=[["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"}]],iU=qe("square-terminal",sU);/**
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 aU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],oU=qe("square",aU);/**
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 lU=[["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"}]],uU=qe("sun",lU);/**
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 cU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ib=qe("terminal",cU);/**
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 dU=[["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"}]],Sd=qe("trash-2",dU);/**
472
- * @license lucide-react v1.25.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const fU=[["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"}]],ql=qe("triangle-alert",fU);/**
477
- * @license lucide-react v1.25.0 - ISC
478
- *
479
- * This source code is licensed under the ISC license.
480
- * See the LICENSE file in the root directory of this source tree.
481
- */const hU=[["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"}]],jy=qe("users-round",hU);/**
482
- * @license lucide-react v1.25.0 - ISC
483
- *
484
- * This source code is licensed under the ISC license.
485
- * See the LICENSE file in the root directory of this source tree.
486
- */const pU=[["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"}]],mU=qe("wifi-off",pU);/**
487
- * @license lucide-react v1.25.0 - ISC
488
- *
489
- * This source code is licensed under the ISC license.
490
- * See the LICENSE file in the root directory of this source tree.
491
- */const gU=[["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"}]],bU=qe("wrench",gU);/**
492
- * @license lucide-react v1.25.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */const xU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cs=qe("x",xU);/**
497
- * @license lucide-react v1.25.0 - ISC
498
- *
499
- * This source code is licensed under the ISC license.
500
- * See the LICENSE file in the root directory of this source tree.
501
- */const yU=[["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"}]],vU=qe("zap",yU),Ai=qP,_i=i7,Vs=K7,Ri=({className:e,children:t,...n})=>f.jsxs(r7,{"data-slot":"select-trigger",className:ye("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,f.jsx(a7,{className:"text-fg-4",children:f.jsx(vB,{className:"size-3.5"})})]}),Ii=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:s=6,...a})=>f.jsx(l7,{children:f.jsx(A7,{align:t,alignItemWithTrigger:n,side:r,sideOffset:s,className:"isolate z-80 outline-none",children:f.jsx($7,{"data-slot":"select-content",className:ye("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})})}),qs=({className:e,children:t,...n})=>f.jsxs(q7,{"data-slot":"select-item",className:ye("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:[f.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),f.jsx(Y7,{className:"mt-0.5 text-fg-1",children:f.jsx(L_,{className:"size-3.5"})})]});function EU(e){const{store:t,actionsRef:n}=e,r=t.useState("open");xP(t,r),fy(t);const{forceUnmount:s}=hy(r,t),a=y.useCallback(()=>{t.setOpen(!1,pt(Xx))},[t]);y.useImperativeHandle(n,()=>({unmount:s,close:a}),[s,a])}function TU({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),u=e.useState("floatingRootContext"),[d,h]=y.useState(0),[m,p]=y.useState(0),b=d===0,x=Gp(u,{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 k=mr(S);return b&&!s?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===k||e.context.backdropRef.current===k||st(k,l)&&!k?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});A_(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(S,k)=>{h(S),p(k)}),e.useContextCallback("onNestedDialogClose",()=>{h(0),p(0)}),y.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,m+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,m,t]);const E=x.reference??fn,A=x.trigger??fn,w=x.floating??fn;return py(e,{activeTriggerProps:E,inactiveTriggerProps:A,popupProps:w,nestedOpenDialogCount:d,nestedOpenDrawerCount:m}),null}const q_=y.createContext(!1),Y_=y.createContext(void 0);function _a(e){const t=y.useContext(Y_);if(e===!1&&t===void 0)throw new Error(Dn(27));return t}const SU={...by,modal:Ue(e=>e.modal),nested:Ue(e=>e.nested),nestedOpenDialogCount:Ue(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Ue(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Ue(e=>e.disablePointerDismissal),openMethod:Ue(e=>e.openMethod),descriptionElementId:Ue(e=>e.descriptionElementId),titleElementId:Ue(e=>e.titleElementId),viewportElement:Ue(e=>e.viewportElement),role:Ue(e=>e.role)};class Py extends Dp{constructor(t,n,r=!1){const s=new Ed,a=CU(t);a.floatingRootContext=e_(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},SU)}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};cy(r,t,n.trigger),this.update(r)};static useStore(t,n){return QA(t,(s,a)=>new Py(n,s,a),!0).store}}function CU(e={}){return{...my(),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 G_(e,t="dialog"){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:u=!1,modal:d=!0,actionsRef:h,handle:m,triggerId:p,defaultTriggerId:b=null}=e,x=t==="drawer",E=t==="alert-dialog",A=E?!0:d,w=E||u,S=E?"alertdialog":"dialog",k=_a(!0),_={modal:A,disablePointerDismissal:w,nested:!!k,role:S},M=Py.useStore(m?.store,{open:s,openProp:r,activeTriggerId:b,triggerIdProp:p,..._});Px(()=>{const Y=r===void 0&&M.state.open===!1&&s===!0?{open:!0,activeTriggerId:b}:null;E?M.update(Y?{..._,...Y}:_):Y&&M.update(Y)}),M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",p),M.useSyncedValues(_),M.useContextCallback("onOpenChange",a),M.useContextCallback("onOpenChangeComplete",l);const R=M.useState("open"),j=M.useState("mounted"),O=M.useState("payload");EU({store:M,actionsRef:h});const H=R||j,P=y.useMemo(()=>({store:M}),[M]);return f.jsx(q_.Provider,{value:!1,children:f.jsxs(Y_.Provider,{value:P,children:[H&&f.jsx(TU,{store:M,parentContext:k?.store.context,isDrawer:x}),typeof n=="function"?n({payload:O}):n]})})}function wU(e){return G_(e,"alert-dialog")}const kU={...cu,...uu},K_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,forceRender:l=!1,...u}=t,{store:d}=_a(),h=d.useState("open"),m=d.useState("nested"),p=d.useState("mounted"),b=d.useState("transitionStatus");return An("div",t,{state:{open:h,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:kU,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!m})}),X_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,...d}=t,{store:h}=_a(),m=h.useState("open"),{getButtonProps:p,buttonRef:b}=du({disabled:l,native:u}),x={disabled:l};function E(A){m&&h.setOpen(!1,pt(Nj,A.nativeEvent))}return An("button",t,{state:x,ref:[n,b],props:[{onClick:E},d,p]})}),W_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=_a(),h=Oo(l);return d.useSyncedValueWithCleanup("descriptionElementId",h),An("p",t,{ref:n,props:[{id:h},u]})});let NU=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),AU=(function(e){return e[e.open=lo.open]="open",e[e.closed=lo.closed]="closed",e[e.startingStyle=lo.startingStyle]="startingStyle",e[e.endingStyle=lo.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Q_=y.createContext(void 0);function _U(){const e=y.useContext(Q_);if(e===void 0)throw new Error(Dn(26));return e}const RU={...cu,...uu,nestedDialogOpen(e){return e?{[AU.nestedDialogOpen]:""}:null}},Z_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,initialFocus:u,...d}=t,{store:h}=_a(),m=h.useState("descriptionElementId"),p=h.useState("disablePointerDismissal"),b=h.useState("floatingRootContext"),x=h.useState("popupProps"),E=h.useState("modal"),A=h.useState("mounted"),w=h.useState("nested"),S=h.useState("nestedOpenDialogCount"),k=h.useState("open"),N=h.useState("openMethod"),_=h.useState("titleElementId"),M=h.useState("transitionStatus"),R=h.useState("role"),j=b.useState("floatingId"),O=d.id??j;_U(),Io({open:k,ref:h.context.popupRef,onComplete(){k&&h.context.onOpenChangeComplete?.(!0)}});const H=u===void 0?mP(h.context.popupRef):u,P=S>0,Y=h.useStateSetter("popupElement"),Z=An("div",t,{state:{open:k,nested:w,transitionStatus:M,nestedDialogOpen:P},props:[x,{id:O,"aria-labelledby":_??void 0,"aria-describedby":m??void 0,role:R,...Wp,hidden:!A,onKeyDown(ee){Ay.has(ee.key)&&ee.stopPropagation()},style:{[NU.nestedDialogs]:S}},d],ref:[n,h.context.popupRef,Y],stateAttributesMapping:RU});return f.jsx(ay,{context:b,openInteractionType:N,disabled:!A,closeOnFocusOut:!p,initialFocus:H,returnFocus:l,modal:E!==!1,restoreFocus:"popup",children:Z})}),J_=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=_a(),l=a.useState("mounted"),u=a.useState("modal"),d=a.useState("open");return l||r?f.jsx(Q_.Provider,{value:r,children:f.jsxs(ry,{ref:n,...s,children:[l&&u===!0&&f.jsx(ky,{ref:a.context.internalBackdropRef,inert:Sy(!d)}),t.children]})}):null}),eR=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=_a(),h=Oo(l);return d.useSyncedValueWithCleanup("titleElementId",h),An("h2",t,{ref:n,props:[{id:h},u]})}),IU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,payload:h,handle:m,...p}=t,b=_a(!0),x=m?.store??b?.store;if(!x)throw new Error(Dn(79));const E=Oo(d),A=x.useState("floatingRootContext"),w=x.useState("isOpenedByTrigger",E),S=x.useState("triggerPopupId",E),k=y.useRef(null),{registerTrigger:N,isMountedByThisTrigger:_}=dy(E,k,x,{payload:h}),{getButtonProps:M,buttonRef:R}=du({disabled:l,native:u}),j=oy(A,{enabled:A!=null}),O=y_(()=>x.select("open"),Y=>{x.set("openMethod",Y)}),H={disabled:l,open:w},P=x.useState("triggerProps",_);return An("button",t,{state:H,ref:[R,n,N,k],props:[j.reference,P,O,{[IA]:"",id:E,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":S},p,M],stateAttributesMapping:Ey})}),OU=IU,MU=wU,LU=OU,DU=X_,jU=({className:e,children:t,...n})=>f.jsxs(J_,{children:[f.jsx(K_,{className:ye("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")}),f.jsx(Z_,{"data-slot":"alert-dialog-content",className:ye("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})]}),PU=({className:e,...t})=>f.jsx(eR,{className:ye("text-heading-3 font-semibold text-text",e),...t}),BU=({className:e,...t})=>f.jsx(W_,{className:ye("mt-1.5 text-body-sm text-muted-foreground",e),...t}),tR=y.createContext(void 0);function nR(e){const t=y.useContext(tR);if(t===void 0&&!e)throw new Error(Dn(33));return t}const rR=y.createContext(void 0);function Lo(e){const t=y.useContext(rR);if(t===void 0&&!e)throw new Error(Dn(36));return t}const zU=y.createContext(void 0);function rm(e=!0){const t=y.useContext(zU);if(t===void 0&&!e)throw new Error(Dn(25));return t}function UU(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:a,typingRef:l,itemRef:u,itemMetadata:d}=e,{events:h}=a.useState("floatingTreeRoot"),m=a.useState("open"),p=rm(!0),b=p!==void 0;return y.useMemo(()=>({id:r,role:"menuitem",tabIndex:m&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){s&&h.emit("itemhover",{nodeId:s,target:x.currentTarget})},onClick(x){t&&h.emit("close",{domEvent:x,reason:Bc})},onMouseUp(x){if(p){const E=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,b&&E&&Math.abs(x.clientX-E.x)<=1&&Math.abs(x.clientY-E.y)<=1||b&&!qx&&x.button===2)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&u.current.click()}}),[t,n,r,h,s,m,a,l,u,p,b,d])}const HU={type:"regular-item"};function FU(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:s,store:a,typingRef:l=a.context.typingRef,nativeButton:u,itemMetadata:d,nodeId:h}=e,m=a.useState("disabled"),p=n||m,b=y.useRef(null),{getButtonProps:x,buttonRef:E}=du({disabled:p,focusableWhenDisabled:!0,native:u,composite:!0}),A=UU({closeOnClick:t,highlighted:r,id:s,nodeId:h,store:a,typingRef:l,itemRef:b,itemMetadata:d}),w=y.useCallback(k=>Ir(A,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},k,x),[A,x,d]),S=xo(b,E);return y.useMemo(()=>({getItemProps:w,itemRef:S}),[w,S])}const $U=y.forwardRef(function(t,n){const{render:r,className:s,id:a,label:l,nativeButton:u=!1,disabled:d=!1,closeOnClick:h=!0,style:m,...p}=t,b=_y({label:l}),x=nR(!0),E=Oo(a),{store:A}=Lo(),w=A.useState("isActive",b.index),S=A.useState("itemProps"),{getItemProps:k,itemRef:N}=FU({closeOnClick:h,disabled:d,highlighted:w,id:E,store:A,nativeButton:u,nodeId:x?.context.nodeId,itemMetadata:HU});return An("div",t,{state:{disabled:d,highlighted:w},props:[S,p,k],ref:[N,n,b.ref]})}),VU={...cu,...uu},qU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d}=Lo(),{side:h,align:m}=nR(),p=R_()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),E=d.useState("popupProps"),A=d.useState("mounted"),w=d.useState("instantType"),S=d.useState("activeTriggerElement"),k=d.useState("parent"),N=d.useState("lastOpenChangeReason"),_=d.useState("rootId"),M=d.useState("floatingRootContext"),R=d.useState("floatingTreeRoot"),j=d.useState("closeDelay"),O=d.useState("activeTriggerElement"),H=d.useState("hoverEnabled"),P=d.useState("disabled"),Y=d.useState("openMethod"),X=k.type==="context-menu";Io({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),y.useEffect(()=>{function G(Q){d.setOpen(!1,pt(Q.reason,Q.domEvent))}return R.events.on("close",G),()=>{R.events.off("close",G)}},[R.events,d]),i_(M,{enabled:H&&!P&&!X&&k.type!=="menubar",closeDelay:j});const Z=y.useCallback(G=>{d.set("popupElement",G)},[d]),ee={transitionStatus:x,side:h,align:m,open:b,nested:k.type==="menu",instant:w},V=An("div",t,{state:ee,ref:[n,d.context.popupRef,Z],stateAttributesMapping:VU,props:[E,{onKeyDown(G){p&&Ay.has(G.key)&&G.stopPropagation()}},Zp(x),u,{"data-rootownerid":_}]});let z=k.type===void 0||X;return(S||k.type==="menubar"&&N!==Vp)&&(z=!0),f.jsx(ay,{context:M,openInteractionType:Y,modal:X,disabled:!A,returnFocus:l===void 0?z:l,initialFocus:k.type!=="menu",restoreFocus:!0,externalTree:k.type!=="menubar"?R:void 0,previousFocusableElement:O,nextFocusableElement:k.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:k.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:V})}),sR=y.createContext(void 0);function YU(){const e=y.useContext(sR);if(e===void 0)throw new Error(Dn(32));return e}const GU=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Lo();return a.useState("mounted")||r?f.jsx(sR.Provider,{value:r,children:f.jsx(ry,{ref:n,...s})}):null}),KU=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u,align:d,sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:A=!1,collisionAvoidance:w=OA,style:S,...k}=t,{store:N}=Lo(),_=YU(),M=rm(!0),R=N.useState("parent"),j=N.useState("floatingRootContext"),O=N.useState("floatingTreeRoot"),H=N.useState("mounted"),P=N.useState("open"),Y=N.useState("modal"),X=N.useState("openMethod"),Z=N.useState("activeTriggerElement"),ee=N.useState("transitionStatus"),V=N.useState("positionerElement"),z=N.useState("instantType"),G=N.useState("hasViewport"),Q=N.useState("lastOpenChangeReason"),se=N.useState("floatingNodeId"),D=N.useState("floatingParentNodeId"),B=j.useState("domReferenceElement"),$=y.useRef(null),L=WA(V,!1,!1);let te=r,ne=h,ce=m,fe=d,de=w;R.type==="context-menu"&&(te=r??R.context?.anchor,fe=fe??"start",!u&&fe!=="center"&&(ce=t.alignOffset??2,ne=t.sideOffset??-5));let xe=u,Fe=fe;R.type==="menu"?(xe=xe??"inline-end",Fe=Fe??"start",de=t.collisionAvoidance??MA):R.type==="menubar"&&(xe=xe??(R.context.orientation==="vertical"?"inline-end":"bottom"),Fe=Fe??"start");const De=R.type==="context-menu",Te=wy({anchor:te,floatingRootContext:j,positionMethod:M?"fixed":s,mounted:H,side:xe,sideOffset:ne,align:Fe,alignOffset:ce,arrowPadding:De?0:x,collisionBoundary:p,collisionPadding:b,sticky:E,nodeId:se,keepMounted:_,disableAnchorTracking:A,collisionAvoidance:de,shiftCrossAxis:De&&!("side"in de&&de.side==="flip"),externalTree:O,adaptiveOrigin:G?w_:void 0});y.useEffect(()=>{function Ie(je){je.open&&(je.parentNodeId===se&&N.set("hoverEnabled",!1),je.nodeId!==se&&je.parentNodeId===N.select("floatingParentNodeId")&&N.setOpen(!1,pt(_c)))}return O.events.on("menuopenchange",Ie),()=>{O.events.off("menuopenchange",Ie)}},[N,O.events,se]),y.useEffect(()=>{if(N.select("floatingParentNodeId")==null)return;function Ie(je){if(je.open||je.nodeId!==N.select("floatingParentNodeId"))return;const J=je.reason??_c;N.setOpen(!1,pt(J))}return O.events.on("menuopenchange",Ie),()=>{O.events.off("menuopenchange",Ie)}},[O.events,N]);const Oe=Gn();y.useEffect(()=>{P||Oe.clear()},[P,Oe]),y.useEffect(()=>{function Ie(je){if(!(!P||je.nodeId!==N.select("floatingParentNodeId")))if(je.target&&Z&&Z!==je.target){const J=N.select("closeDelay");J>0?Oe.isStarted()||Oe.start(J,()=>{N.setOpen(!1,pt(_c))}):N.setOpen(!1,pt(_c))}else Oe.clear()}return O.events.on("itemhover",Ie),()=>{O.events.off("itemhover",Ie)}},[O.events,P,Z,N,Oe]),y.useEffect(()=>{const Ie={open:P,nodeId:se,parentNodeId:D,reason:N.select("lastOpenChangeReason")};O.events.emit("menuopenchange",Ie)},[O.events,P,N,se,D]),Ke(()=>{const Ie=B,je=$.current;if(Ie&&($.current=Ie),je&&Ie&&Ie!==je){N.set("instantType",void 0);const J=new AbortController;return L(()=>{N.set("instantType","trigger-change")},J.signal),()=>{J.abort()}}},[B,L,N]);const ze={open:P,side:Te.side,align:Te.align,anchorHidden:Te.anchorHidden,nested:R.type==="menu",instant:z},Xe=R.type==="menubar"&&R.context.modal;__(P&&(Xe||Y&&Q!==qn),X==="touch",V,Z);const Le=Ny(t,ze,{styles:Te.positionerStyles,transitionStatus:ee,props:k,refs:[n,N.useStateSetter("positionerElement")],hidden:!H,inert:!P}),ke=H&&R.type!=="menu"&&(R.type!=="menubar"&&Y&&Q!==qn||R.type==="menubar"&&R.context.modal);let Ee=null;return R.type==="menubar"?Ee=R.context.contentElement:R.type===void 0&&(Ee=Z),f.jsxs(tR.Provider,{value:Te,children:[ke&&f.jsx(ky,{ref:R.type==="context-menu"||R.type==="nested-context-menu"?R.context.internalBackdropRef:null,inert:Sy(!P),cutout:Ee}),f.jsx(b9,{id:se,children:f.jsx(C_,{elementsRef:N.context.itemDomElements,labelsRef:N.context.itemLabels,children:Le})})]})}),XU=y.createContext(null);function iR(e){return y.useContext(XU)}const WU={...by,disabled:Ue(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ue(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:Ue(e=>e.openMethod),allowMouseEnter:Ue(e=>e.allowMouseEnter),highlightItemOnHover:Ue(e=>e.highlightItemOnHover),stickIfOpen:Ue(e=>e.stickIfOpen),parent:Ue(e=>e.parent),rootId:Ue(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ue(e=>e.activeIndex),isActive:Ue((e,t)=>e.activeIndex===t),hoverEnabled:Ue(e=>e.hoverEnabled),instantType:Ue(e=>e.instantType),lastOpenChangeReason:Ue(e=>e.openChangeReason),floatingTreeRoot:Ue(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ue(e=>e.floatingNodeId),floatingParentNodeId:Ue(e=>e.floatingParentNodeId),itemProps:Ue(e=>e.itemProps),closeDelay:Ue(e=>e.closeDelay),hasViewport:Ue(e=>e.hasViewport),keyboardEventRelay:Ue(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class By extends Dp{constructor(t){super({...QU(),...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 Ed},WU),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"),u=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&s===u&&a===d||(r=l,s=u,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=br(()=>new By(n)).current;return t??r}unsubscribeParentListener=null}function QU(){return{...my(),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 sy,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:fn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const ZU=y.createContext(void 0);function JU(){return y.useContext(ZU)}const eH=Ux(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:u=!1,modal:d,loopFocus:h=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:b=!1,handle:x,triggerId:E,defaultTriggerId:A=null,highlightItemOnHover:w=!0}=t,S=rm(!0),k=Lo(!0),N=iR(!0),_=JU(),M=y.useMemo(()=>_&&k?{type:"menu",store:k.store}:N?{type:"menubar",context:N}:S&&!k?{type:"context-menu",context:S}:{type:void 0},[S,k,N,_]),R=By.useStore(x?.store,{open:l,openProp:r,activeTriggerId:A,triggerIdProp:E,parent:M});JA(R,r,l,A),R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",E),R.useContextCallback("onOpenChangeComplete",a);const j=Eo(),O=Eo(),H=R.useState("floatingTreeRoot"),P=UA(H),Y=ka(),X=R.useState("open"),Z=R.useState("activeTriggerElement"),ee=R.useState("positionerElement"),V=R.useState("hoverEnabled"),z=R.useState("disabled"),G=R.useState("lastOpenChangeReason"),Q=R.useState("parent"),se=R.useState("activeIndex"),D=R.useState("payload"),B=R.useState("floatingParentNodeId"),$=y.useRef(null),L=y.useRef(Q.type!=="context-menu"),te=Gn(),ne=y.useRef(!0),ce=Gn(),fe=B!=null,{openMethod:de,triggerProps:xe}=v_(X);R.useSyncedValues({disabled:u,highlightItemOnHover:w,modal:Q.type===void 0?d:void 0,openMethod:de,rootId:j}),fy(R);const{forceUnmount:Fe}=hy(X,R,()=>{R.update({allowMouseEnter:!1,stickIfOpen:!0})});Ke(()=>{S&&!k?R.update({parent:{type:"context-menu",context:S},floatingNodeId:P,floatingParentNodeId:Y}):k&&R.update({floatingNodeId:P,floatingParentNodeId:Y})},[S,k,P,Y,R]),y.useEffect(()=>{if(X||($.current=null),Q.type==="context-menu"){if(!X){te.clear(),L.current=!1;return}te.start(500,()=>{L.current=!0})}},[te,X,Q.type]),Ke(()=>{!X&&!V&&R.set("hoverEnabled",!0)},[X,V,R]);const De=rt((le,Ce)=>{const _e=Ce.reason;if(X===le&&Ce.trigger===Z&&G===_e)return;const Ve=ZA(Ce);if(!le&&Ce.trigger==null&&(Ce.trigger=Z??void 0),s?.(le,Ce),Ce.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(le,Ce);const Pe=Ce.event;if(le===!1&&Pe?.type==="click"&&Pe.pointerType==="touch"&&!ne.current)return;le&&_e===Fl?(ne.current=!1,ce.start(300,()=>{ne.current=!0})):(ne.current=!0,ce.clear());const We=(_e===lu||_e===Bc)&&Pe.detail===0&&Pe?.isTrusted,lt=!le&&(_e===qp||_e==null),ct={open:le,openChangeReason:_e};$.current=Ce.event??null,cy(ct,le,Ce.trigger,Ve()),R.update(ct),Q.type==="menubar"&&(_e===Fl||_e===vo||_e===qn||_e===Sb||_e===_c)?R.set("instantType","group"):We||lt?R.set("instantType",We?"click":"dismiss"):R.set("instantType",void 0)}),Te=XA({popupStore:R,floatingId:O,nested:Y!=null,onOpenChange:De}),Oe=Te.context.events;y.useEffect(()=>{const le=({open:Ce,eventDetails:_e})=>De(Ce,_e);return Oe.on("setOpen",le),()=>{Oe?.off("setOpen",le)}},[Oe,De]);const ze=y.useCallback(()=>{R.setOpen(!1,pt(Xx))},[R]);y.useImperativeHandle(p,()=>({unmount:Fe,close:ze}),[Fe,ze]);let Xe;Q.type==="context-menu"&&(Xe=Q.context),y.useImperativeHandle(Xe?.positionerRef,()=>ee,[ee]),y.useImperativeHandle(Xe?.actionsRef,()=>({setOpen:De}),[De]);const Ye=Gp(Te,{enabled:!z,bubbles:{escapeKey:b&&Q.type==="menu"},outsidePress(){return Q.type!=="context-menu"||$.current?.type==="contextmenu"?!0:L.current},externalTree:fe?H:void 0}),Le=Cy(),ke=y.useCallback(le=>{R.select("activeIndex")!==le&&R.set("activeIndex",le)},[R]),Ee=o_(Te,{enabled:!z,listRef:R.context.itemDomElements,activeIndex:se,nested:Q.type!==void 0,loopFocus:h,orientation:m,parentOrientation:Q.type==="menubar"?Q.context.orientation:void 0,rtl:Le==="rtl",disabledIndices:Kl,onNavigate:ke,openOnArrowKeyDown:Q.type!=="context-menu",externalTree:fe?H:void 0,focusItemOnHover:w}),Ie=y.useCallback(le=>{R.context.typingRef.current=le},[R]),je=l_(Te,{enabled:!z,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:se,resetMs:f9,onMatch:le=>{X&&le!==se&&R.set("activeIndex",le)},onTyping:Ie}),J=y.useMemo(()=>{const le=Ir(je.reference,Ee.reference,Ye.reference,{onMouseMove(){R.set("allowMouseEnter",!0)}},xe);return le["aria-haspopup"]="menu",le["aria-expanded"]=X,le},[R,je.reference,Ee.reference,Ye.reference,xe,X]),pe=y.useMemo(()=>{const le=Ir(Ee.trigger,Ye.trigger,xe);return le["aria-haspopup"]="menu",le["aria-expanded"]=!1,le},[Ee.trigger,Ye.trigger,xe]),oe=y.useMemo(()=>Ir(Wp,{id:O,role:"menu","aria-labelledby":Z?.id,onMouseMove(){R.set("allowMouseEnter",!0),Q.type==="menu"&&R.set("hoverEnabled",!1)},onClick(){R.select("hoverEnabled")&&R.set("hoverEnabled",!1)},onKeyDown(le){const Ce=R.select("keyboardEventRelay");Ce&&!le.isPropagationStopped()&&Ce(le)}},je.floating,Ee.floating,Ye.floating),[Z,O,Q.type,R,je.floating,Ee.floating,Ye.floating]),ae=Ee.item??fn;py(R,{floatingRootContext:Te,activeTriggerProps:J,inactiveTriggerProps:pe,popupProps:oe,itemProps:ae});const K=y.useMemo(()=>({store:R,parent:M}),[R,M]),F=f.jsx(rR.Provider,{value:K,children:typeof n=="function"?n({payload:D}):n});return Q.type===void 0||Q.type==="context-menu"?f.jsx(x9,{externalTree:H,children:F}):F});function tH(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ty(),{ref:s,index:a}=_y(e),l=n===a,u=y.useRef(null),d=xo(s,u);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const m=u.current;if(!t||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!p&&m.focus()}},compositeRef:d,index:a}}function nH(e){const{render:t,className:n,style:r,state:s=fn,props:a=Kl,refs:l=Kl,metadata:u,stateAttributesMapping:d,tag:h="div",...m}=e,{compositeProps:p,compositeRef:b}=tH({metadata:u});return An(h,e,{state:s,ref:[...l,b],props:[p,...a,m],stateAttributesMapping:d})}function aR(e){if(dn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ei(e))return aR(Ci(e))}function rH(e,t){const n=y.useRef(null);function r(a){or.flushSync(()=>{e.setOpen(!1,pt(vo,a.nativeEvent,a.currentTarget))}),Xj(n.current)?.focus()}function s(a){const l=e.select("positionerElement");if(l&&$l(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{or.flushSync(()=>{e.setOpen(!1,pt(vo,a.nativeEvent,a.currentTarget))});let u=Kj(e.context.triggerFocusTargetRef.current||t.current);for(;u!==null&&st(l,u);){const d=u;if(u=ey(u),u===d)break}u?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function sH(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,At(a.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:a=>{s.current&&(s.current=!1,a.preventBaseUIHandler())}}:fn,[t,n,r])}const mh=2,iH=rA(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,openOnHover:h,delay:m=100,closeDelay:p=0,handle:b,payload:x,...E}=t,A=Lo(!0),w=b?.store??A?.store;if(!w)throw new Error(Dn(85));const S=Oo(d),k=w.useState("isTriggerActive",S),N=w.useState("floatingRootContext"),_=w.useState("isOpenedByTrigger",S),M=w.useState("triggerPopupId",S),R=y.useRef(null),j=oH(),O=Ty(!0),H=Na(),P=y.useMemo(()=>H??new sy,[H]),Y=UA(P),X=ka(),{registerTrigger:Z,isMountedByThisTrigger:ee}=dy(S,R,w,{payload:x,closeDelay:p,parent:j,floatingTreeRoot:P,floatingNodeId:Y,floatingParentNodeId:X,keyboardEventRelay:O?.relayKeyboardEvent}),V=j.type==="menubar",z=w.useState("disabled"),G=l||z||V&&j.context.disabled,{getButtonProps:Q,buttonRef:se}=du({disabled:G,native:u});y.useEffect(()=>{!_&&j.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,_,j.type]);const D=y.useRef(null),B=Gn(),$=rt(Ee=>{if(!D.current)return;B.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ie=Ee.target;if(st(D.current,Ie)||st(w.select("positionerElement"),Ie)||Ie===D.current||Ie!=null&&aR(Ie)===w.select("rootId"))return;const je=T_(D.current);Ee.clientX>=je.left-mh&&Ee.clientX<=je.right+mh&&Ee.clientY>=je.top-mh&&Ee.clientY<=je.bottom+mh||P.events.emit("close",{domEvent:Ee,reason:cA})});y.useEffect(()=>{_&&w.select("lastOpenChangeReason")===qn&&At(D.current).addEventListener("mouseup",$,{once:!0})},[_,$,w]);const L=V&&j.context.hasSubmenuOpen,ne=a_(N,{enabled:(h??L)&&!G&&j.type!=="context-menu"&&(!V||L&&!ee),handleClose:u_({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:j.type===void 0?m:void 0,delay:{close:p},triggerElementRef:R,externalTree:P,isActiveTrigger:k,isClosing:()=>w.select("transitionStatus")==="ending"}),ce=aH(_,w.select("lastOpenChangeReason")),fe=oy(N,{enabled:!G&&j.type!=="context-menu",event:_&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:j.type===void 0?ce:!1}),de=r_(N,{enabled:!G&&L}),xe=sH({open:_,enabled:V,mouseDownAction:"open"}),Fe=y.useMemo(()=>Ir(de.reference,fe.reference),[de.reference,fe.reference]),De=w.useState("triggerProps",ee),{preFocusGuardRef:Te,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:ze}=rH(w,R),Xe={disabled:G,open:_},Ye=[D,n,se,Z,R],Le=[Fe,ne??fn,De,{"aria-haspopup":"menu","aria-controls":M,id:S,onMouseDown:Ee=>{if(w.select("open"))return;B.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),At(Ee.currentTarget).addEventListener("mouseup",$,{once:!0})}},V?{role:"menuitem"}:{},xe,E,Q],ke=An("button",t,{enabled:!V,stateAttributesMapping:_b,state:Xe,ref:Ye,props:Le});return V?f.jsx(nH,{tag:"button",render:r,className:s,style:a,state:Xe,refs:Ye,props:Le,stateAttributesMapping:_b}):_?f.jsxs(y.Fragment,{children:[f.jsx(Zl,{ref:Te,onFocus:Oe},`${S}-pre-focus-guard`),f.jsx(y.Fragment,{children:ke},S),f.jsx(Zl,{ref:w.context.triggerFocusTargetRef,onFocus:ze},`${S}-post-focus-guard`)]}):f.jsx(y.Fragment,{children:ke},S)});function aH(e,t){const n=Gn(),[r,s]=y.useState(!1);return Ke(()=>{e&&t==="trigger-hover"?(s(!0),n.start(h9,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function oH(){const e=rm(!0),t=Lo(!0),n=iR();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const lH=eH,uH=iH,cH=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...s})=>f.jsx(GU,{children:f.jsx(KU,{align:t,side:n,sideOffset:r,className:"isolate z-80 outline-none",children:f.jsx(qU,{"data-slot":"menu-content",className:ye("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})})}),wl=({className:e,destructive:t,...n})=>f.jsx($U,{"data-slot":"menu-item",className:ye("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 dH(e){const t=y.useContext(q_)?"drawer":"dialog";return G_(e,t)}const fs=dH,hs=({className:e,children:t,size:n="md",...r})=>f.jsxs(J_,{children:[f.jsx(K_,{className:ye("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")}),f.jsx(Z_,{"data-slot":"dialog-content",className:ye("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})]}),ps=({title:e,description:t,actions:n})=>f.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx(eR,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?f.jsx(W_,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,f.jsx(X_,{"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:f.jsx(Cs,{className:"size-3.5"})})]}),ms=({className:e,...t})=>f.jsx("div",{className:ye("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),sr=({label:e,children:t,mono:n})=>f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),f.jsx("span",{className:ye("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),oR=y.createContext(void 0);function sm(e){const t=y.useContext(oR);if(t===void 0&&!e)throw new Error(Dn(72));return t}const fH={...by,disabled:Ue(e=>e.disabled),instantType:Ue(e=>e.instantType),isInstantPhase:Ue(e=>e.isInstantPhase),trackCursorAxis:Ue(e=>e.trackCursorAxis),disableHoverablePopup:Ue(e=>e.disableHoverablePopup),lastOpenChangeReason:Ue(e=>e.openChangeReason),closeOnClick:Ue(e=>e.closeOnClick),closeDelay:Ue(e=>e.closeDelay),hasViewport:Ue(e=>e.hasViewport)};class zy extends Dp{constructor(t,n,r=!1){const s=new Ed,a={...hH(),...t};a.floatingRootContext=e_(s,n,r),super(a,{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s},fH)}setOpen=(t,n)=>{bP(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,pt(lu,t))}static useStore(t,n){return QA(t,(s,a)=>new zy(n,s,a)).store}}function hH(){return{...my(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const pH=Ux(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:u,onOpenChange:d,onOpenChangeComplete:h,handle:m,triggerId:p,defaultTriggerId:b=null,children:x}=t,E=zy.useStore(m?.store,{open:r,openProp:s,activeTriggerId:b,triggerIdProp:p});JA(E,s,r,b),E.useControlledProp("openProp",s),E.useControlledProp("triggerIdProp",p),E.useContextCallback("onOpenChange",d),E.useContextCallback("onOpenChangeComplete",h);const A=E.useState("open"),w=!n&&A,S=E.useState("activeTriggerId"),k=E.useState("mounted"),N=E.useState("payload");E.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),E.useSyncedValue("disabled",n),fy(E,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:_,transitionStatus:M}=hy(w,E),R=E.useState("isInstantPhase"),j=E.useState("instantType"),O=E.useState("lastOpenChangeReason"),H=y.useRef(null);Ke(()=>{A&&n&&E.setOpen(!1,pt(Aj))},[A,n,E]),Ke(()=>{M==="ending"&&O===ou||M!=="ending"&&R?(j!=="delay"&&(H.current=j),E.set("instantType","delay")):H.current!==null&&(E.set("instantType",H.current),H.current=null)},[M,R,O,j,E]),Ke(()=>{w&&S==null&&E.set("payload",void 0)},[E,S,w]);const P=y.useCallback(()=>{E.setOpen(!1,pt(Xx))},[E]);y.useImperativeHandle(u,()=>({unmount:_,close:P}),[_,P]);const Y=w||k||!n&&l!=="none";return f.jsxs(oR.Provider,{value:E,children:[Y&&f.jsx(mH,{store:E,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:N}):x]})});function mH({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Gp(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=T9(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=y.useMemo(()=>Ir(a.reference,s.reference),[a.reference,s.reference]),u=y.useMemo(()=>Ir(a.trigger,s.trigger),[a.trigger,s.trigger]),d=y.useMemo(()=>Ir(Wp,a.floating,s.floating),[a.floating,s.floating]);return py(e,{activeTriggerProps:l,inactiveTriggerProps:u,popupProps:d}),null}const lR=y.createContext(void 0);function gH(){return y.useContext(lR)}let bH=(function(e){return e[e.popupOpen=ap.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const xH=600,uR="data-base-ui-tooltip-trigger";function pw(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 yH(e){let t=e;for(;t;){if(t.hasAttribute(uR))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 vH=rA(function(t,n){const{render:r,className:s,style:a,handle:l,payload:u,disabled:d,delay:h,closeOnClick:m=!0,closeDelay:p,id:b,...x}=t,E=sm(!0),A=l?.store??E;if(!A)throw new Error(Dn(82));const w=Oo(b),S=A.useState("isTriggerActive",w),k=A.useState("isOpenedByTrigger",w),N=A.useState("floatingRootContext"),_=y.useRef(null),M=h??xH,R=p??0,{registerTrigger:j,isMountedByThisTrigger:O}=dy(w,_,A,{payload:u,closeOnClick:m,closeDelay:R}),H=gH(),{delayRef:P,isInstantPhase:Y,hasProvider:X}=Oj(N,{open:k}),Z=yy(N);A.useSyncedValue("isInstantPhase",Y);const ee=A.useState("disabled"),V=d??ee,z=Tn(V),G=A.useState("trackCursorAxis"),Q=A.useState("disableHoverablePopup"),se=y.useRef(!1),D=Gn(),B=y.useRef(void 0);function $(){const Te=H?.delay,Oe=typeof P.current=="object"?P.current.open:void 0;let ze=M;return X&&(Oe!==0?ze=h??Te??M:ze=0),ze}function L(Te){const Oe=_.current;if(!Oe||!Te)return!1;const ze=yH(Te);return ze!==null&&ze!==Oe&&st(Oe,ze)}function te(Te){const Oe=L(Te);return se.current=Oe,Oe&&(Z.openChangeTimeout.clear(),Z.restTimeout.clear(),Z.restTimeoutPending=!1,D.clear()),Oe}const ne=a_(N,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!Q&&G!=="both"?u_():null,restMs:$,delay(){const Te=typeof P.current=="object"?P.current.close:void 0;let Oe=R;return p==null&&X&&(Oe=Te),{close:Oe}},triggerElementRef:_,isActiveTrigger:S,isClosing:()=>A.select("transitionStatus")==="ending",shouldOpen(){return!se.current}}),ce=r_(N,{enabled:!V}).reference,fe=Te=>{const Oe=se.current,ze=pw(Te),Xe=te(ze),Ye=_.current,Le=Ye&&ze&&st(Ye,ze);if(Xe&&A.select("open")&&A.select("lastOpenChangeReason")===qn){A.setOpen(!1,pt(qn,Te));return}if(Oe&&!Xe&&Le&&!z.current&&!A.select("open")&&Ye&&yo(B.current)){const ke=()=>{!se.current&&!z.current&&!A.select("open")&&A.setOpen(!0,pt(qn,Te,Ye))},Ee=$();Ee===0?(D.clear(),ke()):D.start(Ee,ke)}},de=A.useState("triggerProps",O);return An("button",t,{state:{open:k},ref:[n,j,_],props:[ne,ce,O||G!=="none"?de:void 0,{onMouseOver(Te){fe(Te.nativeEvent)},onFocus(Te){L(pw(Te.nativeEvent))&&Te.preventBaseUIHandler()},onMouseLeave(){se.current=!1,D.clear(),B.current=void 0},onPointerEnter(Te){B.current=Te.pointerType},onPointerDown(Te){B.current=Te.pointerType,A.set("closeOnClick",m),m&&!A.select("open")&&A.cancelPendingOpen(Te.nativeEvent)},onClick(Te){m&&!A.select("open")&&A.cancelPendingOpen(Te.nativeEvent)},id:w,[bH.triggerDisabled]:V?"":void 0,[uR]:V?void 0:""},x],stateAttributesMapping:Ey})}),cR=y.createContext(void 0);function EH(){const e=y.useContext(cR);if(e===void 0)throw new Error(Dn(70));return e}const TH=y.forwardRef(function(t,n){const{children:r,container:s,className:a,render:l,style:u,...d}=t,{portalNode:h,portalSubtree:m}=jA({container:s,ref:n,componentProps:t,elementProps:d});return!m&&!h?null:f.jsxs(y.Fragment,{children:[m,h&&or.createPortal(r,h)]})}),SH=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return sm().useState("mounted")||r?f.jsx(cR.Provider,{value:r,children:f.jsx(TH,{ref:n,...s})}):null}),dR=y.createContext(void 0);function CH(){const e=y.useContext(dR);if(e===void 0)throw new Error(Dn(71));return e}const wH=y.forwardRef(function(t,n){const{render:r,className:s,anchor:a,positionMethod:l="absolute",side:u="top",align:d="center",sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:A=!1,collisionAvoidance:w=MA,style:S,...k}=t,N=sm(),_=EH(),M=N.useState("open"),R=N.useState("mounted"),j=N.useState("trackCursorAxis"),O=N.useState("disableHoverablePopup"),H=N.useState("floatingRootContext"),P=N.useState("instantType"),Y=N.useState("transitionStatus"),X=N.useState("hasViewport"),Z=wy({anchor:a,positionMethod:l,floatingRootContext:H,mounted:R,side:u,sideOffset:h,align:d,alignOffset:m,collisionBoundary:p,collisionPadding:b,sticky:E,arrowPadding:x,disableAnchorTracking:A,keepMounted:_,collisionAvoidance:w,adaptiveOrigin:X?w_:void 0}),ee=y.useMemo(()=>({open:M,side:Z.side,align:Z.align,anchorHidden:Z.anchorHidden,instant:j!=="none"?"tracking-cursor":P}),[M,Z.side,Z.align,Z.anchorHidden,j,P]),V=Ny(t,ee,{styles:Z.positionerStyles,transitionStatus:Y,props:k,refs:[n,N.useStateSetter("positionerElement")],hidden:!R,inert:!M||j==="both"||O});return f.jsx(dR.Provider,{value:Z,children:V})}),kH={...cu,...uu},NH=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,u=sm(),{side:d,align:h}=CH(),m=u.useState("open"),p=u.useState("instantType"),b=u.useState("transitionStatus"),x=u.useState("popupProps"),E=u.useState("floatingRootContext"),A=u.useState("disabled"),w=u.useState("closeDelay");Io({open:m,ref:u.context.popupRef,onComplete(){m&&u.context.onOpenChangeComplete?.(!0)}}),i_(E,{enabled:!A,closeDelay:w});const S=u.useStateSetter("popupElement");return An("div",t,{state:{open:m,side:d,align:h,instant:p,transitionStatus:b},ref:[n,u.context.popupRef,S],props:[x,Zp(b),l],stateAttributesMapping:kH})}),AH=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 f.jsx(lR.Provider,{value:a,children:f.jsx(Ij,{delay:l,timeoutMs:s,children:t.children})})},_H=AH,RH=({className:e,side:t="top",sideOffset:n=6,...r})=>f.jsx(SH,{children:f.jsx(wH,{side:t,sideOffset:n,className:"isolate z-90",children:f.jsx(NH,{"data-slot":"tooltip-content",className:ye("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function Uy({content:e,render:t,side:n,children:r}){return f.jsxs(pH,{children:[f.jsx(vH,{render:t??f.jsx("span",{className:"inline-flex"}),children:r}),f.jsx(RH,{side:n,children:e})]})}function IH(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 OH=e=>{switch(e){case"success":return DH;case"info":return PH;case"warning":return jH;case"error":return BH;default:return null}},MH=Array(12).fill(0),LH=({visible:e,className:t})=>$e.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},$e.createElement("div",{className:"sonner-spinner"},MH.map((n,r)=>$e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DH=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.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"})),jH=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$e.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"})),PH=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.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"})),BH=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.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"})),zH=$e.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"},$e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UH=()=>{const[e,t]=$e.useState(document.hidden);return $e.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ob=1;class HH{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:Ob++,l=this.toasts.find(d=>d.id===a),u=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:u,title:r}):d):this.addToast({title:r,...s,dismissible:u,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 u=s.then(async h=>{if(l=["resolve",h],$e.isValidElement(h))a=!1,this.create({id:r,type:"default",message:h});else if($H(h)&&!h.ok){a=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,E=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...E})}else if(h instanceof Error){a=!1;const p=typeof n.error=="function"?await n.error(h):n.error,b=typeof n.description=="function"?await n.description(h):n.description,E=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...E})}else if(n.success!==void 0){a=!1;const p=typeof n.success=="function"?await n.success(h):n.success,b=typeof n.description=="function"?await n.description(h):n.description,E=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:b,...E})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(h):n.error,p=typeof n.description=="function"?await n.description(h):n.description,x=typeof m=="object"&&!$e.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...x})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,m)=>u.then(()=>l[0]==="reject"?m(l[1]):h(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Ob++;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 HH,FH=(e,t)=>{const n=t?.id||Ob++;return Ar.addToast({title:e,...t,id:n}),n},$H=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VH=FH,qH=()=>Ar.toasts,YH=()=>Ar.getActiveToasts(),an=Object.assign(VH,{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:qH,getToasts:YH});IH("[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 gh(e){return e.label!==void 0}const GH=3,KH="24px",XH="16px",mw=4e3,WH=356,QH=14,ZH=45,JH=200;function Ds(...e){return e.filter(Boolean).join(" ")}function eF(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const tF=e=>{var t,n,r,s,a,l,u,d,h;const{invert:m,toast:p,unstyled:b,interacting:x,setHeights:E,visibleToasts:A,heights:w,index:S,toasts:k,expanded:N,removeToast:_,defaultRichColors:M,closeButton:R,style:j,cancelButtonStyle:O,actionButtonStyle:H,className:P="",descriptionClassName:Y="",duration:X,position:Z,gap:ee,expandByDefault:V,classNames:z,icons:G,closeButtonAriaLabel:Q="Close toast"}=e,[se,D]=$e.useState(null),[B,$]=$e.useState(null),[L,te]=$e.useState(!1),[ne,ce]=$e.useState(!1),[fe,de]=$e.useState(!1),[xe,Fe]=$e.useState(!1),[De,Te]=$e.useState(!1),[Oe,ze]=$e.useState(0),[Xe,Ye]=$e.useState(0),Le=$e.useRef(p.duration||X||mw),ke=$e.useRef(null),Ee=$e.useRef(null),Ie=S===0,je=S+1<=A,J=p.type,pe=p.dismissible!==!1,oe=p.className||"",ae=p.descriptionClassName||"",K=$e.useMemo(()=>w.findIndex(Qe=>Qe.toastId===p.id)||0,[w,p.id]),F=$e.useMemo(()=>{var Qe;return(Qe=p.closeButton)!=null?Qe:R},[p.closeButton,R]),le=$e.useMemo(()=>p.duration||X||mw,[p.duration,X]),Ce=$e.useRef(0),_e=$e.useRef(0),Ve=$e.useRef(0),Pe=$e.useRef(null),[We,lt]=Z.split("-"),ct=$e.useMemo(()=>w.reduce((Qe,yt,Ht)=>Ht>=K?Qe:Qe+yt.height,0),[w,K]),Ge=UH(),Rt=p.invert||m,jt=J==="loading";_e.current=$e.useMemo(()=>K*ee+ct,[K,ct]),$e.useEffect(()=>{Le.current=le},[le]),$e.useEffect(()=>{te(!0)},[]),$e.useEffect(()=>{const Qe=Ee.current;if(Qe){const yt=Qe.getBoundingClientRect().height;return Ye(yt),E(Ht=>[{toastId:p.id,height:yt,position:p.position},...Ht]),()=>E(Ht=>Ht.filter(en=>en.toastId!==p.id))}},[E,p.id]),$e.useLayoutEffect(()=>{if(!L)return;const Qe=Ee.current,yt=Qe.style.height;Qe.style.height="auto";const Ht=Qe.getBoundingClientRect().height;Qe.style.height=yt,Ye(Ht),E(en=>en.find(vt=>vt.toastId===p.id)?en.map(vt=>vt.toastId===p.id?{...vt,height:Ht}:vt):[{toastId:p.id,height:Ht,position:p.position},...en])},[L,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const ut=$e.useCallback(()=>{ce(!0),ze(_e.current),E(Qe=>Qe.filter(yt=>yt.toastId!==p.id)),setTimeout(()=>{_(p)},JH)},[p,_,E,_e]);$e.useEffect(()=>{if(p.promise&&J==="loading"||p.duration===1/0||p.type==="loading")return;let Qe;return N||x||Ge?(()=>{if(Ve.current<Ce.current){const en=new Date().getTime()-Ce.current;Le.current=Le.current-en}Ve.current=new Date().getTime()})():(()=>{Le.current!==1/0&&(Ce.current=new Date().getTime(),Qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),ut()},Le.current))})(),()=>clearTimeout(Qe)},[N,x,p,J,Ge,ut]),$e.useEffect(()=>{p.delete&&(ut(),p.onDismiss==null||p.onDismiss.call(p,p))},[ut,p.delete]);function Lt(){var Qe;if(G?.loading){var yt;return $e.createElement("div",{className:Ds(z?.loader,p==null||(yt=p.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":J==="loading"},G.loading)}return $e.createElement(LH,{className:Ds(z?.loader,p==null||(Qe=p.classNames)==null?void 0:Qe.loader),visible:J==="loading"})}const Zt=p.icon||G?.[J]||OH(J);var $t,Jt;return $e.createElement("li",{tabIndex:0,ref:Ee,className:Ds(P,oe,z?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,z?.default,z?.[J],p==null||(n=p.classNames)==null?void 0:n[J]),"data-sonner-toast":"","data-rich-colors":($t=p.richColors)!=null?$t:M,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":L,"data-promise":!!p.promise,"data-swiped":De,"data-removed":ne,"data-visible":je,"data-y-position":We,"data-x-position":lt,"data-index":S,"data-front":Ie,"data-swiping":fe,"data-dismissible":pe,"data-type":J,"data-invert":Rt,"data-swipe-out":xe,"data-swipe-direction":B,"data-expanded":!!(N||V&&L),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${ne?Oe:_e.current}px`,"--initial-height":V?"auto":`${Xe}px`,...j,...p.style},onDragEnd:()=>{de(!1),D(null),Pe.current=null},onPointerDown:Qe=>{Qe.button!==2&&(jt||!pe||(ke.current=new Date,ze(_e.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(de(!0),Pe.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,yt,Ht;if(xe||!pe)return;Pe.current=null;const en=Number(((Qe=Ee.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kn=Number(((yt=Ee.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vt=new Date().getTime()-((Ht=ke.current)==null?void 0:Ht.getTime()),ln=se==="x"?en:Kn,yr=Math.abs(ln)/vt;if(Math.abs(ln)>=ZH||yr>.11){ze(_e.current),p.onDismiss==null||p.onDismiss.call(p,p),$(se==="x"?en>0?"right":"left":Kn>0?"down":"up"),ut(),Fe(!0);return}else{var bn,Cn;(bn=Ee.current)==null||bn.style.setProperty("--swipe-amount-x","0px"),(Cn=Ee.current)==null||Cn.style.setProperty("--swipe-amount-y","0px")}Te(!1),de(!1),D(null)},onPointerMove:Qe=>{var yt,Ht,en;if(!Pe.current||!pe||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;const vt=Qe.clientY-Pe.current.y,ln=Qe.clientX-Pe.current.x;var yr;const bn=(yr=e.swipeDirections)!=null?yr:eF(Z);!se&&(Math.abs(ln)>1||Math.abs(vt)>1)&&D(Math.abs(ln)>Math.abs(vt)?"x":"y");let Cn={x:0,y:0};const ht=It=>1/(1.5+Math.abs(It)/20);if(se==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&vt<0||bn.includes("bottom")&&vt>0)Cn.y=vt;else{const It=vt*ht(vt);Cn.y=Math.abs(It)<Math.abs(vt)?It:vt}}else if(se==="x"&&(bn.includes("left")||bn.includes("right")))if(bn.includes("left")&&ln<0||bn.includes("right")&&ln>0)Cn.x=ln;else{const It=ln*ht(ln);Cn.x=Math.abs(It)<Math.abs(ln)?It:ln}(Math.abs(Cn.x)>0||Math.abs(Cn.y)>0)&&Te(!0),(Ht=Ee.current)==null||Ht.style.setProperty("--swipe-amount-x",`${Cn.x}px`),(en=Ee.current)==null||en.style.setProperty("--swipe-amount-y",`${Cn.y}px`)}},F&&!p.jsx&&J!=="loading"?$e.createElement("button",{"aria-label":Q,"data-disabled":jt,"data-close-button":!0,onClick:jt||!pe?()=>{}:()=>{ut(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ds(z?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Jt=G?.close)!=null?Jt:zH):null,(J||p.icon||p.promise)&&p.icon!==null&&(G?.[J]!==null||p.icon)?$e.createElement("div",{"data-icon":"",className:Ds(z?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Lt():null,p.type!=="loading"?Zt:null):null,$e.createElement("div",{"data-content":"",className:Ds(z?.content,p==null||(a=p.classNames)==null?void 0:a.content)},$e.createElement("div",{"data-title":"",className:Ds(z?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?$e.createElement("div",{"data-description":"",className:Ds(Y,ae,z?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),$e.isValidElement(p.cancel)?p.cancel:p.cancel&&gh(p.cancel)?$e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||O,onClick:Qe=>{gh(p.cancel)&&pe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Qe),ut())},className:Ds(z?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,$e.isValidElement(p.action)?p.action:p.action&&gh(p.action)?$e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||H,onClick:Qe=>{gh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Qe),!Qe.defaultPrevented&&ut())},className:Ds(z?.actionButton,p==null||(h=p.classNames)==null?void 0:h.actionButton)},p.action.label):null)};function gw(){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 nF(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,l=a?"--mobile-offset":"--offset",u=a?XH:KH;function d(h){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=u:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(u)}),n}const rF=$e.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:m,mobileOffset:p,theme:b="light",richColors:x,duration:E,style:A,visibleToasts:w=GH,toastOptions:S,dir:k=gw(),gap:N=QH,icons:_,containerAriaLabel:M="Notifications"}=t,[R,j]=$e.useState([]),O=$e.useMemo(()=>r?R.filter(L=>L.toasterId===r):R.filter(L=>!L.toasterId),[R,r]),H=$e.useMemo(()=>Array.from(new Set([a].concat(O.filter(L=>L.position).map(L=>L.position)))),[O,a]),[P,Y]=$e.useState([]),[X,Z]=$e.useState(!1),[ee,V]=$e.useState(!1),[z,G]=$e.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=$e.useRef(null),se=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=$e.useRef(null),B=$e.useRef(!1),$=$e.useCallback(L=>{j(te=>{var ne;return(ne=te.find(ce=>ce.id===L.id))!=null&&ne.delete||Ar.dismiss(L.id),te.filter(({id:ce})=>ce!==L.id)})},[]);return $e.useEffect(()=>Ar.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{j(te=>te.map(ne=>ne.id===L.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{y8.flushSync(()=>{j(te=>{const ne=te.findIndex(ce=>ce.id===L.id);return ne!==-1?[...te.slice(0,ne),{...te[ne],...L},...te.slice(ne+1)]:[L,...te]})})})}),[R]),$e.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 L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:te})=>{G(te?"dark":"light")})}catch{L.addListener(({matches:ne})=>{try{G(ne?"dark":"light")}catch(ce){console.error(ce)}})}},[b]),$e.useEffect(()=>{R.length<=1&&Z(!1)},[R]),$e.useEffect(()=>{const L=te=>{var ne;if(l.every(de=>te[de]||te.code===de)){var fe;Z(!0),(fe=Q.current)==null||fe.focus()}te.code==="Escape"&&(document.activeElement===Q.current||(ne=Q.current)!=null&&ne.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[l]),$e.useEffect(()=>{if(Q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,B.current=!1)}},[Q.current]),$e.createElement("section",{ref:n,"aria-label":`${M} ${se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((L,te)=>{var ne;const[ce,fe]=L.split("-");return O.length?$e.createElement("ol",{key:L,dir:k==="auto"?gw():k,tabIndex:-1,ref:Q,className:h,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ce,"data-x-position":fe,style:{"--front-toast-height":`${((ne=P[0])==null?void 0:ne.height)||0}px`,"--width":`${WH}px`,"--gap":`${N}px`,...A,...nF(m,p)},onBlur:de=>{B.current&&!de.currentTarget.contains(de.relatedTarget)&&(B.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||B.current||(B.current=!0,D.current=de.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{ee||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},O.filter(de=>!de.position&&te===0||de.position===L).map((de,xe)=>{var Fe,De;return $e.createElement(tF,{key:de.id,icons:_,index:xe,toast:de,defaultRichColors:x,duration:(Fe=S?.duration)!=null?Fe:E,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:s,visibleToasts:w,closeButton:(De=S?.closeButton)!=null?De:d,interacting:ee,position:L,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:$,toasts:O.filter(Te=>Te.position==de.position),heights:P.filter(Te=>Te.position==de.position),setHeights:Y,expandByDefault:u,gap:N,expanded:X,swipeDirections:t.swipeDirections})})):null}))});function sF(){return f.jsx(rF,{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 iF(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return aF(e)}function aF(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 ud({value:e,glyph:t,className:n,variant:r="ghost",size:s="icon-sm",...a}){const[l,u]=y.useState(!1);return f.jsx(tt,{variant:r,size:s,"aria-label":"Copy",className:ye("text-fg-3",n),onClick:()=>{iF(e).then(d=>{d&&(u(!0),setTimeout(()=>u(!1),1500))})},...a,children:t?f.jsx("span",{className:ye("font-mono text-body-sm leading-5",l&&"text-success"),children:l?"✓":"⧉"}):l?f.jsx(L_,{className:"size-3.5 text-success"}):f.jsx(LB,{className:"size-3.5"})})}function xn({className:e}){return f.jsx(gz,{"aria-label":"Loading",className:ye("size-4 animate-spin text-fg-3",e)})}function fR({code:e,label:t,copyable:n=!0,variant:r="panel",className:s}){const a=r==="plain",l=t!==void 0||n;return a?f.jsxs("div",{"data-slot":"code-block","data-variant":"plain",className:ye("min-w-0",s),children:[l?f.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[f.jsx("span",{className:"truncate text-label leading-5 text-fg-4",children:t}),n?f.jsx(ud,{glyph:!0,value:e,className:"size-5 shrink-0 rounded-sm"}):null]}):null,f.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})]}):f.jsxs("div",{"data-slot":"code-block",className:ye("overflow-hidden rounded-md border border-border bg-code-bg",s),children:[l?f.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[f.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?f.jsx(ud,{value:e}):null]}):null,f.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 Mb({orientation:e,value:t,onValueChange:n,min:r,max:s,step:a=16,defaultValue:l,inverted:u,"aria-label":d,className:h}){const m=y.useRef(null),p=e==="vertical",b=y.useCallback(k=>Math.min(s,Math.max(r,k)),[r,s]),x=k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),m.current={origin:p?k.clientX:k.clientY,start:t})},E=k=>{const N=m.current;if(!N)return;const _=(p?k.clientX:k.clientY)-N.origin;n(b(N.start+(u?-_:_)))},A=k=>{m.current&&(m.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId))},w=()=>{l!==void 0&&n(b(l))},S=k=>{const N=p?"ArrowRight":"ArrowDown",_=p?"ArrowLeft":"ArrowUp",M=u?-1:1;if(k.key===N)n(b(t+a*M));else if(k.key===_)n(b(t-a*M));else if(k.key==="Home")n(r);else if(k.key==="End")n(s);else return;k.preventDefault()};return f.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":d,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":s,onPointerDown:x,onPointerMove:E,onPointerUp:A,onPointerCancel:A,onDoubleClick:w,onKeyDown:S,className:ye("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",h),children:f.jsx("span",{"aria-hidden":!0,className:ye("absolute",p?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function Vr({icon:e,title:t,description:n,action:r,onAction:s}){return f.jsxs("div",{className:"flex flex-col items-center gap-2 px-5 py-8 text-center",children:[f.jsx("div",{className:"text-fg-4 opacity-60 [&_svg]:size-7",children:e}),f.jsx("p",{className:"text-body-sm font-medium text-fg-2",children:t}),n?f.jsx("p",{className:"max-w-[26ch] text-balance text-label leading-relaxed text-fg-4",children:n}):null,r&&s?f.jsx(tt,{variant:"outline",size:"sm",className:"mt-1",onClick:s,children:r}):null]})}function Do({children:e}){return f.jsx("span",{className:"rounded border border-border px-1 font-mono text-fg-3",children:e})}function hR({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 f.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(s)}%`,className:ye("shrink-0 -rotate-90",r),children:[f.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),f.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 oF(e){return e?[{type:"text",text:e}]:[]}function lF(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 u=s.text.charCodeAt(l-1);u>=55296&&u<=56319&&(l-=1),l>0&&n.push({type:"text",text:s.text.slice(0,l)})}}break}return n}function Hc(e){return e===" "||e===`
502
- `||e===" "}function pR(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function up(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
503
- `:Hc(r)}function uF(e,t,n){if(!e||t===0||n.length===0)return null;const r=pR(n);for(let s=t-1;s>=0;s--){const a=e[s];if(Hc(a)){if(s+1<t){const u=e[s+1],d=r.get(u);if(d&&up(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&&up(e,s,l.position))return{config:l,startOffset:s,query:e.slice(s+1,t)}}return null}function p1(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0;for(const p of e)if(p.type==="chip"){const b=`${p.trigger}${p.displayText}`,x=l,E=l+b.length;(E<=r||x>=s)&&a.push(p),l=E}else{const b=l,x=l+p.text.length;if(x<=r)a.push(p);else if(b>=s)a.push(p);else{const E=p.text.slice(0,Math.max(0,r-b)),A=p.text.slice(Math.min(p.text.length,s-b));E&&a.push({type:"text",text:E});const w={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(w),A?a.push({type:"text",text:" "+A.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const u=jo(a);let d=-1,h=0;for(const p of u)p.type==="text"?h+=p.text.length:(h+=p.trigger.length+p.displayText.length,p.value===n.value&&p.displayText===n.displayText&&p.trigger===t.config.char&&(d=h));const m=d===-1?h:d+1;return{segments:u,cursorOffset:m}}function cF(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0,u=r+n.length;for(const m of e){if(m.type==="chip"){const x=l+`${m.trigger}${m.displayText}`.length;(x<=r||l>=s)&&a.push(m),l=x;continue}const p=l,b=l+m.text.length;if(b<=r||p>=s)a.push(m);else{const x=m.text.slice(0,Math.max(0,r-p)),E=m.text.slice(Math.min(m.text.length,s-p));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),E&&a.push({type:"text",text:E})}l=b}const d=jo(a),h=zn(d).length;return u>h&&(u=h),{segments:d,cursorOffset:u}}function dF(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 jo(n)}function fF(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:jo(s),revertedText:r}}function hF(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=pR(n),s=[];for(const a of e){if(a.type==="chip"){s.push(a);continue}const l=pF(a.text,r);s.push(...l)}return jo(s)}function pF(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const s=e[r];if(t.has(s)&&(r===0||Hc(e[r-1]))){const u=t.get(s);if(u&&up(e,r,u.position)){let d=r+1;for(;d<e.length&&!Hc(e[d]);)d++;const h=e.slice(r+1,d);if(h.length>0){const m=u.onSelect?.({value:h,label:h})||h;n.push({type:"chip",trigger:s,value:h,displayText:m,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Hc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function hr(e,t,n,r){const s=[];let a=0,l=!1;for(const u of e)if(u.type==="chip"){const d=`${u.trigger}${u.displayText}`,h=a,m=a+d.length;!l&&t===n&&h===t&&(s.push({type:"text",text:r}),l=!0),(m<=t||h>=n)&&s.push(u),a=m}else{const d=a,h=a+u.text.length,m=t===n?h<t:h<=t,p=t===n?d>n:d>=n;if(m)s.push(u);else if(p)s.push(u);else{const b=u.text.slice(0,Math.max(0,t-d)),x=u.text.slice(Math.min(u.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=h}return!l&&r&&s.push({type:"text",text:r}),jo(s)}function mF(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,u=n+a<=s.length&&s.slice(n,n+a)===r;let d=l&&u;if(d&&a===1){const p=t>a?s[t-a-1]:"",b=n+a<s.length?s[n+a]:"";(p===r||b===r)&&(d=!1)}if(d){const p=hr(e,n,n+a,"");return{segments:hr(p,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const h=hr(e,n,n,r);return{segments:hr(h,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function gF(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 jo(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 im(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 eu(e,t){const n=e.lastIndexOf(`
504
- `,t-1)+1,r=e.indexOf(`
505
- `,t),s=e.slice(n,r===-1?e.length:r),a=im(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 bF(e,t){const n=zn(e),r=n.lastIndexOf(`
506
- `,t-1)+1,s=n.slice(r,t),a=s.match(/^(\s*)[-*] $/);if(!a)return null;const u=`${a[1]}• `,d=r,h=r+s.length;return{segments:hr(e,d,h,u),cursorOffset:r+u.length}}function xF(e,t){const n=zn(e),r=eu(n,t);if(!r)return null;const s=n.indexOf(`
507
- `,t);if(n.slice(r.contentStart,s===-1?n.length:s).trim()==="")return r.indent>0?{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:hr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let u;if(r.listType==="bullet")u=`${l}${r.marker??"•"} `;else{const m=(r.number??1)+1;u=`${l}${m}. `}const d=`
508
- ${u}`;return{segments:hr(e,t,t,d),cursorOffset:t+d.length}}function yF(e,t){if(t===0)return null;const n=e.lastIndexOf(`
509
- `,t-2)+1,r=im(e.slice(n,t-1));return r?r.indent:null}function vF(e,t){const n=zn(e),r=eu(n,t);if(!r)return null;const s=yF(n,r.lineStart),a=s===null?0:s+1;return r.indent>=a?null:{segments:hr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function EF(e,t){const n=zn(e),r=eu(n,t);return!r||r.indent===0?null:{segments:hr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function TF(e,t){const n=zn(e),r=eu(n,t);return!r||t>r.contentStart?null:{segments:hr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const SF=/^\s*```/;function mR(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function gR(e){const t=new Set;let n=-1;return e.forEach((r,s)=>{if(SF.test(r))if(n===-1)n=s;else{for(let a=n;a<=s;a++)t.add(a);n=-1}}),t}function CF(e,t){const n=e.split(`
510
- `),r=gR(n);return n.map((s,a)=>r.has(a)?s:mR(s,t)).join(`
511
- `)}function bw(e,t){const n=[];e.forEach(u=>{u.type==="text"&&n.push(...u.text.split(`
512
- `))});const r=gR(n);let s=0,a=!1;const l=e.map(u=>{if(u.type!=="text")return u;const d=u.text.split(`
513
- `).map(h=>{const m=r.has(s)?h:mR(h,t);return s++,m}).join(`
514
- `);return d===u.text?u:(a=!0,{...u,text:d})});return a?l:e}function bR(e){let t=null,n=0,r=0,s=0,a=!0;for(const l of e.split(`
515
- `)){const u=im(l);if(u?.kind==="numbered"&&u.indent===t){if(a=a&&u.number===r+1,r=u.number,s++,s>=2&&(n===1||a))return!0}else u?.kind==="numbered"?(t=u.indent,n=u.number,r=u.number,s=1,a=!0):(t=null,s=0)}return!1}function xR(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
516
- `);let s="",a=0;const l=(u,d)=>{for(const h of t.keys())(d?h>=u:h>u)&&t.delete(h)};for(let u=0;u<r.length;u++){const d=r[u],h=im(d);if(!h)t.clear(),s+=d;else if(h.kind==="bullet")l(h.indent,!0),s+=d;else{const m=h.indent;l(m,!1);const p=t.get(m),b=p===void 0?1:p+1;t.set(m,b);const x=String(b);x===String(h.number)?s+=d:(n.push({oldStart:a+h.numberStart,oldEnd:a+h.numberEnd,newText:x}),s+=d.slice(0,h.numberStart)+x+d.slice(h.numberEnd))}u<r.length-1&&(s+=`
517
- `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:s,edits:n}}function xw(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 yw(e){const{edits:t}=xR(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=hr(n,s.oldStart,s.oldEnd,s.newText)}return{segments:n,edits:t}}function ki(e){return e instanceof HTMLElement}function er(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function cp(e){return e instanceof HTMLBRElement}function Cd(e){return e instanceof Text}function Lb(e){return er(e)&&e.dataset.chipAutoResolved==="true"}function wF(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function kF(e){try{return JSON.parse(e)}catch{return}}function zh(e){try{return JSON.stringify(e)}catch{return}}function yR(e){if(er(e))return e.dataset.chipTrigger}function NF(e){if(er(e))return e.dataset.chipValue}function vR(e){if(er(e))return e.dataset.chipDisplay??e.textContent??void 0}function AF(e){if(!er(e))return;const t=e.dataset.chipData;if(t)return kF(t)}function ER(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function dp(e){if(!er(e))return null;const t=yR(e),n=NF(e),r=vR(e);if(!t||n===void 0||!r)return null;const s=AF(e),a=Lb(e);return{type:"chip",trigger:t,value:n,displayText:r,...s!==void 0?{data:s}:{},...a?{autoResolved:!0}:{}}}function Uh(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function _F(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":cp(e)?!e.dataset.sentinel:er(e)?dp(e)!==null:ki(e)?(e.textContent??"")!=="":!1}function m1(e,t){let n=0;for(let r=0;r<t;r++)_F(e.childNodes[r])&&n++;return n}function Db(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function RF(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function jb(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))RF(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 vw=/https?:\/\/[^\s),]+/g;function IF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Cd(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";vw.lastIndex=0;const a=[];let l;for(;(l=vw.exec(s))!==null;){let p=l[0];for(;p.length>0&&/[.;:!?]$/.test(p);)p=p.slice(0,-1);p.length>0&&a.push({url:p,index:l.index})}if(a.length===0)continue;const u=r.parentNode;if(!u)continue;const d=[];for(const{url:p,index:b}of a)try{const x=new URL(p);(x.protocol==="http:"||x.protocol==="https:")&&d.push({url:p,href:x.href,index:b})}catch{}if(d.length===0)continue;t=!0;const h=document.createDocumentFragment();let m=0;for(const{url:p,href:b,index:x}of d){x>m&&h.appendChild(document.createTextNode(s.slice(m,x)));const E=document.createElement("a");E.href=b,E.target="_blank",E.rel="noopener noreferrer",E.dataset.url="true",E.className="text-accent hover:text-accent-hover underline cursor-pointer",E.textContent=p,h.appendChild(E),m=x+p.length}m<s.length&&h.appendChild(document.createTextNode(s.slice(m))),u.replaceChild(h,r)}return t}const Ew=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function OF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Cd(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";Ew.lastIndex=0;const a=[];let l;for(;(l=Ew.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 u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{fullMatch:m,marker:p,content:b,index:x,className:E}of a){x>h&&d.appendChild(document.createTextNode(s.slice(h,x)));const A=document.createElement("span");A.dataset.md="true";const w=document.createElement("span");w.className="prompt-area-md-marker",w.textContent=p;const S=document.createElement("span");S.className=E,S.textContent=b;const k=document.createElement("span");k.className="prompt-area-md-marker",k.textContent=p,A.appendChild(w),A.appendChild(S),A.appendChild(k),d.appendChild(A),h=x+m.length}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const Tw=/(^|\n)([ \t]*)•/g;function MF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Cd(s)&&s.textContent?.includes("•")&&n.push(s)}for(const r of n){const s=r.textContent??"";Tw.lastIndex=0;const a=[];let l;for(;(l=Tw.exec(s))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const m of a){m>h&&d.appendChild(document.createTextNode(s.slice(h,m)));const p=document.createElement("span");p.dataset.md="true",p.className="prompt-area-list-bullet",p.textContent="•",d.appendChild(p),h=m+1}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const Sw=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function LF(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Cd(s)&&n.push(s)}for(const r of n){const s=r.textContent??"";Sw.lastIndex=0;const a=[];let l;for(;(l=Sw.exec(s))!==null;){const m=l.index+l[1].length;a.push({start:m,end:m+l[2].length})}if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{start:m,end:p}of a){m>h&&d.appendChild(document.createTextNode(s.slice(h,m)));const b=s.slice(m,p),x=Math.floor(b.length/2),E=document.createElement("span");E.dataset.md="true",E.className="prompt-area-list-indent",E.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,E.textContent=b,d.appendChild(E),h=p}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}function Cw(e,t){t&&(LF(e),MF(e)),IF(e),t&&OF(e)}function Fs(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function DF(e){const t=Fs();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=Db(e,n);return r?{nodeIndex:Uh(e,r),offset:t.startOffset}:null}function jF(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 sa(e){const t=Fs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),fp(n)}function PF(e,t){const n=cd(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function rr(e,t){const n=window.getSelection();if(!n)return;const r=cd(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 fp(e){const t=e.cloneContents();let n=0;const r=s=>{if(s.nodeType===Node.TEXT_NODE)n+=(s.textContent??"").length;else if(er(s))n+=ER(s);else if(ki(s)&&s.tagName==="BR"){if(s.dataset.sentinel)return;n+=1}else ki(s)&&s.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function bh(e){const t=Fs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=fp(n);if(t.collapsed)return{start:r,end:r};const s=document.createRange();s.selectNodeContents(e),s.setEnd(t.endContainer,t.endOffset);const a=fp(s);return{start:r,end:a}}function ww(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){rr(e,t);return}const s=cd(e,t),a=cd(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 cd(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(er(s)){const a=ER(s);if(n<=a)return{node:e,offset:r+1};n-=a}else if(cp(s)){if(s.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(ki(s)){const a=(s.textContent??"").length;if(n<=a){const l=cd(s,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function BF(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function TR(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):er(r)?t.onChip(r):ki(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function zF(e){let t="";return TR(e,{onText:n=>{t+=n},onChip:n=>{t+=(yR(n)??"")+(vR(n)??"")},onBreak:()=>{t+=`
518
- `}}),t}function UF(e){const t=[];return TR(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=dp(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
519
- `})}}),t}function HF(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!BF(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 FF(e,t,n){const r=Fs();if(!r)return[...e,...t];const s=document.createRange();s.selectNodeContents(n),s.setEnd(r.startContainer,r.startOffset);const a=fp(s),l=[];let u=0,d=!1;const h=()=>{d||(l.push(...t),d=!0)};for(const m of e){if(m.type==="chip"){const b=m.trigger.length+m.displayText.length;u>=a&&h(),l.push(m),u+=b;continue}const p=u+m.text.length;if(p<=a)l.push(m);else if(u>=a)h(),l.push(m);else{const b=a-u,x=m.text.slice(0,b),E=m.text.slice(b);x&&l.push({type:"text",text:x}),h(),E&&l.push({type:"text",text:E})}u=p}return h(),jo(l)}function g1(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function $F(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function VF(e){const t=e.tagName,n=e.getAttribute("style")??"",r=g1(n,"font-weight"),s=r?$F(r):t==="B"||t==="STRONG",a=g1(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",u=g1(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||u.includes("line-through"),h=(d?"~~":"")+(s?"**":"")+(l?"*":""),m=(l?"*":"")+(s?"**":"")+(d?"~~":"");return{prefix:h,suffix:m}}function qF(e){return e.replace(/\s+/g," ")}function YF(e){return e.replace(/\*/g,"\\*")}function GF(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 KF(e){const t=GF(e),n=(e.textContent??"").replace(/\n$/,"");return`
520
-
521
- \`\`\`${t}
522
- ${n}
523
- \`\`\`
524
-
525
- `}function XF(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function SR(e){return/^(https?:|mailto:)/i.test(e)}function WF(e,t){const n=e.getAttribute("href")??"",r=gi(e,t).trim();return SR(n)?!r||r===n?n:`[${r}](${n})`:r}function QF(e){const t=e.getAttribute("src")??"";return!t||!SR(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function ZF(e,t){return`
526
-
527
- ${gi(e,t).trim().split(`
528
- `).map(s=>s?`> ${s}`:">").join(`
529
- `)}
530
-
531
- `}function CR(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 u of Array.from(e.childNodes)){if(!ki(u)||u.tagName!=="LI")continue;const d=n?`${s}. `:"- ";s++;let h="",m="";for(const p of Array.from(u.childNodes))ki(p)&&(p.tagName==="UL"||p.tagName==="OL")?m+=`
532
- ${CR(p,t+1)}`:h+=wR(p,t);l.push(`${a}${d}${h.trim()}${m}`)}return l.join(`
533
- `)}function JF(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(u=>Array.from(u.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>gi(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),s=r[0],a=s.map(()=>"---"),l=u=>`| ${u.join(" | ")} |`;return[l(s),l(a),...r.slice(1).map(l)].join(`
534
- `)}function gi(e,t){let n="";return e.childNodes.forEach(r=>{n+=wR(r,t)}),n}function wR(e,t){if(Cd(e))return YF(qF(e.textContent??""));if(!ki(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
535
- `;case"HR":return`
536
-
537
- ---
538
-
539
- `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
540
-
541
- ${"#".repeat(Number(n[1]))} ${gi(e,t).trim()}
542
-
543
- `;case"P":return`
544
-
545
- ${gi(e,t).trim()}
546
-
547
- `;case"DIV":return`
548
- ${gi(e,t).trim()}
549
- `;case"BLOCKQUOTE":return ZF(e,t);case"UL":case"OL":return`
550
-
551
- ${CR(e,t)}
552
-
553
- `;case"LI":return`${gi(e,t).trim()}
554
- `;case"PRE":return KF(e);case"CODE":return XF(e);case"A":return WF(e,t);case"IMG":return QF(e);case"TABLE":return`
555
-
556
- ${JF(e,t)}
557
-
558
- `;default:{const{prefix:r,suffix:s}=VF(e);return r+gi(e,t)+s}}}function e$(e){return e.replace(/[ \t]+\n/g,`
559
- `).replace(/\n[ \t]*\n[ \t\n]*/g,`
560
-
561
- `).trim()}function t$(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?e$(gi(t.body,0)):""}const n$=100,kR=150;function r$(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:s,runTriggerDetection:a,dismissTrigger:l,triggers:u,markdownEnabled:d,normalizeBullets:h,onPaste:m,onUndo:p,onRedo:b,onChipAdd:x,onImagePaste:E,onRawPaste:A}=e,w=y.useRef(!1),S=y.useRef({undoStack:[],redoStack:[]}),k=y.useCallback(Z=>{const ee=S.current;ee.undoStack.push(Z),ee.undoStack.length>n$&&ee.undoStack.shift(),ee.redoStack=[]},[]),N=y.useCallback(()=>{S.current={undoStack:[],redoStack:[]}},[]),_=y.useCallback(Z=>{if(A?.(Z),Z.defaultPrevented)return;Z.preventDefault();const ee=t.current;if(!ee)return;const V=Array.from(Z.clipboardData.files).find(ne=>ne.type.startsWith("image/"))??(Array.from(Z.clipboardData.items).find(ce=>ce.type.startsWith("image/"))?.getAsFile()??null);if(V){E?.(V);return}const z=n();k(z);const G=Z.clipboardData.getData("text/prompt-area-segments");if(G){const ne=HF(G);if(ne&&ne.length>0){const ce=Fs();if(!ce)return;ce.deleteContents();const fe=n(),de=FF(fe,ne,ee);r(de),s(de),m?.({segments:de,source:"internal"});for(const xe of ne)xe.type==="chip"&&x?.(xe);a();return}}let Q="";if(d)if(Q=Z.clipboardData.getData("text/markdown"),Q)Q=Q.replace(/\\([()])/g,"$1");else{const ne=Z.clipboardData.getData("text/html");if(ne)try{Q=t$(ne)}catch{Q=""}}if(Q||(Q=Z.clipboardData.getData("text/plain")),!Q)return;d&&h&&(Q=CF(Q,!0)),d&&bR(Q)&&(Q=xR(Q).text);const se=Fs();if(!se)return;se.deleteContents();const D=Q.split(`
562
- `),B=document.createDocumentFragment();for(let ne=0;ne<D.length;ne++)D[ne]&&B.appendChild(document.createTextNode(D[ne])),ne<D.length-1&&B.appendChild(document.createElement("br"));se.insertNode(B),se.collapse(!1);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(se),jb(ee);const L=n(),te=hF(L,u);if(te!==L){r(te),s(te);for(const ne of te)ne.type==="chip"&&!L.some(ce=>ce.type==="chip"&&ce.trigger===ne.trigger&&ce.value===ne.value&&ce.displayText===ne.displayText)&&x?.(ne)}else r(L);m?.({segments:te,source:"external"}),a()},[t,n,r,k,a,s,u,d,h,m,x,E,A]),M=y.useCallback(Z=>{Z.preventDefault();const ee=Fs();if(!ee)return;const V=ee.cloneContents(),z=zF(V);Z.clipboardData.setData("text/plain",z);const G=UF(V);if(G.some(se=>se.type==="chip")){const se=zh(G);se&&Z.clipboardData.setData("text/prompt-area-segments",se)}},[]),R=y.useCallback(Z=>{M(Z);const ee=Fs();if(!ee)return;const V=n();k(V),ee.deleteContents();const z=t.current;z&&jb(z);const G=n();r(G),a()},[M,t,n,r,k,a]),j=y.useCallback(Z=>{Z.preventDefault()},[]),O=y.useCallback(Z=>{Z.preventDefault()},[]),H=y.useCallback(()=>{w.current=!0},[]),P=y.useCallback(()=>{w.current=!1,a()},[a]),Y=y.useCallback(()=>{setTimeout(()=>{const Z=t.current;if(!Z)return;const ee=document.activeElement;ee&&Z.parentElement?.contains(ee)||l()},kR)},[t,l]),X=y.useCallback(Z=>{if(!(Z.metaKey||Z.ctrlKey)||Z.key!=="z")return!1;Z.preventDefault();const V=S.current;if(Z.shiftKey){if(V.redoStack.length===0)return!0;const z=V.redoStack.pop();if(!z)return!0;const G=n();V.undoStack.push(G),r(z),s(z),b?.(z)}else{if(V.undoStack.length===0)return!0;const z=V.undoStack.pop();if(!z)return!0;const G=n();V.redoStack.push(G),r(z),s(z),p?.(z)}return!0},[n,r,s,p,b]);return{handlePaste:_,handleCopy:M,handleCut:R,handleDrop:j,handleDragOver:O,handleCompositionStart:H,handleCompositionEnd:P,handleBlur:Y,handleKeyDownForUndoRedo:X,pushUndo:k,resetUndoHistory:N,isComposing:w}}function s$(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[s,a]=y.useState(null),l=y.useRef(0),u=y.useRef(null),d=y.useRef(null),h=y.useCallback(()=>{u.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),m=y.useCallback((p,b)=>{if(!b.onSearch)return;u.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,E=new AbortController;u.current=E;const{onSearch:A,onSearchError:w,searchDebounceMs:S}=b,k=()=>{const N=A(p,{signal:E.signal});N instanceof Promise?N.then(_=>{E.signal.aborted||l.current!==x||(t(_),r(!1))},_=>{E.signal.aborted||l.current!==x||_ instanceof DOMException&&_.name==="AbortError"||(a(_ instanceof Error?_.message:"Search failed"),r(!1),w?.(_))}):(t(N),r(!1))};S&&S>0&&p.length>0?d.current=setTimeout(k,S):k()},[]);return y.useEffect(()=>()=>{u.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:s,search:m,reset:h}}const i$=300;function a$({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:s,onEscape:a,onChipClick:l,onChipAdd:u,onChipDelete:d,onLinkClick:h,onPaste:m,onRawPaste:p,onUndo:b,onRedo:x,onImagePaste:E,markdown:A=!0,normalizeBullets:w=!0,submitOnEnter:S=!0,maxLength:k}){const N=y.useRef(null),[_,M]=y.useState(null),[R,j]=y.useState(0),[O,H]=y.useState(null),P=y.useRef(null),Y=y.useRef(null),X=y.useRef(null),{suggestions:Z,suggestionsLoading:ee,suggestionsError:V,search:z,reset:G}=s$(),Q=y.useRef(!1),se=y.useRef([]),D=y.useRef(null),B=y.useRef(null),$=y.useCallback(()=>{const J=N.current;if(!J)return[];const pe=[];let oe=!1,ae=!1;for(let K=0;K<J.childNodes.length;K++){const F=J.childNodes[K];if(F.nodeType===Node.TEXT_NODE){const le=F.textContent??"";le&&(pe.push({type:"text",text:le}),oe=!0)}else if(er(F)){const le=dp(F);le&&(pe.push(le),oe=!0)}else if(cp(F)){if(F.dataset.sentinel){ae=!0;continue}pe.push({type:"text",text:`
563
- `})}else if(ki(F)){const le=F.textContent??"";le&&(pe.push({type:"text",text:le}),oe=!0)}}return!oe&&!ae?[]:pe},[]),L=y.useCallback(J=>{const pe=N.current;if(!pe)return;Q.current=!0;const oe=DF(pe);for(;pe.firstChild;)pe.removeChild(pe.firstChild);for(const ae of J)if(ae.type==="text"){const K=ae.text.split(`
564
- `);for(let F=0;F<K.length;F++)K[F]&&pe.appendChild(document.createTextNode(K[F])),F<K.length-1&&pe.appendChild(document.createElement("br"))}else{const K=document.createElement("span");if(K.contentEditable="false",K.dataset.chipTrigger=ae.trigger,K.dataset.chipValue=ae.value,K.dataset.chipDisplay=ae.displayText,ae.data!==void 0){const Ce=zh(ae.data);Ce&&(K.dataset.chipData=Ce)}ae.autoResolved&&(K.dataset.chipAutoResolved="true");const F=n.find(Ce=>Ce.char===ae.trigger),le=F?.chipStyle??"pill";K.dataset.chipStyle=le,K.className=ye("prompt-area-chip",le==="inline"&&"prompt-area-chip--inline",F?.chipClassName),K.textContent=`${ae.trigger}${ae.displayText}`,K.setAttribute("role","button"),K.setAttribute("tabindex","-1"),pe.appendChild(K)}if(pe.lastChild&&cp(pe.lastChild)){const ae=document.createElement("br");ae.dataset.sentinel="true",pe.appendChild(ae)}Cw(pe,A),oe&&jF(pe,oe),se.current=J,Q.current=!1},[n,A]),te=y.useCallback((J,pe)=>oe=>{const ae=p1(J,pe,{value:oe.value,displayText:oe.displayText,data:oe.data});t(ae.segments),L(ae.segments),u?.({type:"chip",trigger:pe.config.char,value:oe.value,displayText:oe.displayText,...oe.data!==void 0?{data:oe.data}:{}});const K=N.current;K&&rr(K,ae.cursorOffset)},[t,L,u]),ne=y.useCallback(()=>{const J=N.current;if(!J)return;const pe=$(),oe=zn(pe),ae=sa(J);if(ae===null)return;const K=uF(oe,ae,n);if(P.current=null,Y.current=null,K){M(K),j(0);const F=PF(J,K.startOffset);if(F){const le=F.getBoundingClientRect();(le.height>0||le.left>0||le.top>0)&&H(le)}K.config.mode==="dropdown"&&K.config.onSearch&&z(K.query,K.config),K.config.mode==="callback"&&K.config.onActivate&&K.config.onActivate({text:oe,cursorPosition:ae,insertChip:te(pe,K)})}else M(null),G()},[n,$,te,G,z]),ce=y.useCallback(()=>{P.current=null,Y.current=null,M(null),j(0),G()},[G]),fe=r$({editorRef:N,readSegmentsFromDOM:$,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:ne,dismissTrigger:ce,triggers:n,markdownEnabled:A,normalizeBullets:w,onPaste:m,onRawPaste:p,onUndo:b,onRedo:x,onChipAdd:u,onImagePaste:E});y.useEffect(()=>{if(!Q.current&&!gF(e,se.current)){if(A&&w){const J=bw(e,!0);if(J!==e){t(J);return}}L(e)}},[e,L,A,w,t]);const de=y.useRef(A);y.useEffect(()=>{if(de.current===A)return;de.current=A;const J=w?bw(e,A):e;J!==e?t(J):L(e)},[A,w,L,e,t]),y.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const xe=y.useCallback(()=>{if(Q.current)return;if(fe.isComposing.current){const F=$();se.current=F,t(F);return}const J=N.current,pe=J?sa(J):null;J&&jb(J);const oe=$();if(k!=null&&J&&zn(oe).length>k){const F=sa(J),le=lF(oe,k);se.current=le,t(le),L(le),rr(J,F!=null?Math.min(F,k):k),ne();return}if(A&&w&&J&&pe!==null){const F=bF(oe,pe);if(F){se.current=F.segments,t(F.segments),L(F.segments),rr(J,F.cursorOffset),ne();return}}let ae=oe,K=null;if(A&&pe!==null&&bR(zn(oe))){const F=yw(oe);F.edits.length>0&&(ae=F.segments,K=xw(pe,F.edits))}B.current||(B.current=se.current),se.current=ae,t(ae),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{B.current&&(fe.pushUndo(B.current),B.current=null),D.current=null},i$),J&&(K!==null?(L(ae),rr(J,K)):(Cw(J,A),pe!==null&&rr(J,pe))),ne()},[t,$,ne,L,A,w,k,fe]),Fe=y.useCallback(J=>{const pe=J.target;if(!(pe instanceof Node))return;const oe=N.current;if(!oe)return;let ae=pe;for(;ae&&ae!==oe;){if(wF(ae)){if(J.metaKey||J.ctrlKey){J.preventDefault(),h?.(ae.href),window.open(ae.href,"_blank","noopener,noreferrer");return}break}if(er(ae)){const K=ae.getBoundingClientRect(),F=document.createElement("span");F.className="prompt-area-chip-ripple";const le=Math.max(K.width,K.height);F.style.width=`${le}px`,F.style.height=`${le}px`,F.style.left=`${J.clientX-K.left-le/2}px`,F.style.top=`${J.clientY-K.top-le/2}px`,ae.appendChild(F),F.addEventListener("animationend",()=>F.remove());const Ce=dp(ae);if(Ce){const _e=n.find(Pe=>Pe.char===Ce.trigger),Ve=X.current===ae;if(X.current=null,!r&&!Ve&&_e?.reopenOnChipClick&&_e.mode==="dropdown"&&_e.onSearch){const Pe=Uh(oe,ae);P.current={chip:Ce,segIndex:m1(oe,Pe)},Y.current=ae,M({config:_e,startOffset:0,query:""}),j(0),H(K),z("",_e)}l?.(Ce)}return}ae=ae.parentNode}},[l,h,n,z,r]),De=y.useCallback(J=>{const pe=J.target,oe=N.current;if(!oe||!(pe instanceof Node)){X.current=null;return}let ae=pe;for(;ae&&ae!==oe;){if(er(ae)){X.current=Y.current===ae?ae:null;return}ae=ae.parentNode}X.current=null},[]),Te=y.useCallback((J,pe)=>{const oe=$(),ae=Uh(J,pe);if(ae===-1)return!1;const K=m1(J,ae),F=oe[K],le=dF(oe,K);return t(le),L(le),F?.type==="chip"&&d?.(F),!0},[$,t,L,d]),Oe=y.useCallback((J,pe)=>{const oe=$(),ae=Uh(J,pe);if(ae===-1)return!1;const K=m1(J,ae),F=oe[K],le=fF(oe,K);if(!le)return!1;let Ce=0;for(let _e=0;_e<K;_e++){const Ve=oe[_e];Ve.type==="text"?Ce+=Ve.text.length:Ce+=Ve.trigger.length+Ve.displayText.length}return Ce+=le.revertedText.length,t(le.segments),L(le.segments),rr(J,Ce),F?.type==="chip"&&d?.(F),!0},[$,t,L,d]),ze=y.useCallback(()=>{const J=N.current;if(!J)return!1;const pe=Fs();if(!pe||!pe.collapsed)return!1;const oe=pe.startContainer,ae=pe.startOffset;if(oe===J&&ae>0){const K=J.childNodes[ae-1];if(K&&er(K))return Lb(K)?Oe(J,K):Te(J,K)}if(oe.nodeType===Node.TEXT_NODE&&ae===0){const K=Db(J,oe);if(!K)return!1;let F=K.previousSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.previousSibling;if(F&&er(F))return Lb(F)?Oe(J,F):Te(J,F)}return!1},[Te,Oe]),Xe=y.useCallback(()=>{const J=N.current;if(!J)return!1;const pe=Fs();if(!pe||!pe.collapsed)return!1;const oe=pe.startContainer,ae=pe.startOffset;if(oe===J&&ae<J.childNodes.length){const K=J.childNodes[ae];if(K&&er(K))return Te(J,K)}if(oe.nodeType===Node.TEXT_NODE&&ae===(oe.textContent??"").length){const K=Db(J,oe);if(!K)return!1;let F=K.nextSibling;for(;F&&F.nodeType===Node.TEXT_NODE&&F.textContent==="";)F=F.nextSibling;if(F&&er(F))return Te(J,F)}return!1},[Te]),Ye=y.useCallback(J=>{const pe=$(),oe=J.query,ae={value:oe,label:oe},K=J.config.onSelect?.(ae)??oe,F={value:oe,displayText:K||oe,autoResolved:!0},le=p1(pe,J,F);t(le.segments),L(le.segments),u?.({type:"chip",trigger:J.config.char,...F});const Ce=N.current;Ce&&rr(Ce,le.cursorOffset),ce()},[$,t,L,ce,u]),Le=y.useCallback(J=>{if(!_)return;const pe=$(),oe=_.config.insertAsText?.(J);if(oe!==void 0){const _e=cF(pe,_,oe);fe.pushUndo(pe),t(_e.segments),L(_e.segments);const Ve=N.current;Ve&&rr(Ve,_e.cursorOffset),ce(),setTimeout(()=>{N.current?.focus()},0);return}const ae=_.config.onSelect?.(J)??J.label,K={value:J.value,displayText:ae||J.label,data:J.data},F=P.current;if(F){const _e=N.current;if(_e&&!r){const Ve=pe[F.segIndex],We=Ve?.type==="chip"&&Ve.trigger===F.chip.trigger&&Ve.value===F.chip.value?F.segIndex:(()=>{const ct=[];return pe.forEach((Ge,Rt)=>{Ge.type==="chip"&&Ge.trigger===F.chip.trigger&&Ge.value===F.chip.value&&ct.push(Rt)}),ct.length===1?ct[0]:-1})(),lt=We!==-1?pe[We]:void 0;if(lt?.type==="chip"){const ct={type:"chip",trigger:_.config.char,...K};let Ge=pe.map((Zt,$t)=>$t===We?ct:Zt);const Rt=Ge[We+1],jt=!Rt||Rt.type!=="text"||Rt.text.length===0;jt&&(Ge=[...Ge.slice(0,We+1),{type:"text",text:" "},...Ge.slice(We+1)]),fe.pushUndo(pe),t(Ge),L(Ge),lt.value===ct.value&&lt.displayText===ct.displayText&&zh(lt.data)===zh(ct.data)||(d?.(lt),u?.(ct));const Lt=zn(Ge.slice(0,We+1)).length+(jt?1:0);rr(_e,Lt)}}ce(),setTimeout(()=>{N.current?.focus()},0);return}const le=p1(pe,_,K);t(le.segments),L(le.segments),u?.({type:"chip",trigger:_.config.char,...K});const Ce=N.current;Ce&&rr(Ce,le.cursorOffset),ce(),setTimeout(()=>{N.current?.focus()},0)},[_,$,t,L,ce,u,d,fe,r]),ke=Le;y.useEffect(()=>{const J=P.current;if(!J||!_?.config.reopenOnChipClick)return;const pe=Z.findIndex(oe=>oe.value===J.chip.value);pe>0&&j(pe)},[Z,_]);const Ee=y.useCallback(J=>{const pe=(F,le)=>{let{segments:Ce,cursorOffset:_e}=le;if(A){const Ve=yw(Ce);Ce=Ve.segments,_e=xw(_e,Ve.edits)}se.current=Ce,t(Ce),L(Ce),rr(F,_e)},oe=F=>{if(!A)return!1;const le=$(),Ce=sa(F);if(Ce===null)return!1;const _e=zn(le);if(!eu(_e,Ce))return!1;const Ve=xF(le,Ce);return Ve&&pe(F,Ve),!0};if((J.metaKey||J.ctrlKey)&&J.key==="z"&&B.current&&(D.current&&(clearTimeout(D.current),D.current=null),fe.pushUndo(B.current),B.current=null),fe.handleKeyDownForUndoRedo(J))return;if(A&&(J.metaKey||J.ctrlKey)&&!J.shiftKey&&(J.key==="b"||J.key==="i")){J.preventDefault();const F=N.current;if(!F)return;const le=bh(F);if(!le||le.start===le.end)return;const Ce=J.key==="b"?"**":"*",_e=$();fe.pushUndo(_e);const Ve=mF(_e,le.start,le.end,Ce);if(!Ve)return;se.current=Ve.segments,t(Ve.segments),L(Ve.segments),ww(F,Ve.selectionStart,Ve.selectionEnd);return}if(!J.metaKey&&!J.ctrlKey&&!J.altKey&&!J.nativeEvent.isComposing&&J.key.length===1){const F=n.find(Ce=>Ce.mode==="launch"&&Ce.char===J.key),le=N.current;if(F?.onActivate&&le){const Ce=sa(le);if(Ce!==null){const _e=$(),Ve=zn(_e);if(up(Ve,Ce,F.position)){J.preventDefault(),F.onActivate({text:Ve,cursorPosition:Ce,insertChip:te(hr(_e,Ce,Ce,F.char),{config:F,startOffset:Ce,query:""})});return}}}}if(_&&_.config.mode==="dropdown"&&(Z.length>0||ee||V!==null||!!_.config.emptyMessage)){if(J.key==="ArrowDown"){J.preventDefault(),Z.length>0&&j(F=>Math.min(F+1,Z.length-1));return}if(J.key==="ArrowUp"){J.preventDefault(),Z.length>0&&j(F=>Math.max(F-1,0));return}if(J.key==="Enter"||J.key==="Tab"){J.preventDefault();const F=Z[R];F&&Le(F);return}if(J.key==="Escape"){J.preventDefault(),ce();return}}if(J.key===" "&&_&&_.config.resolveOnSpace&&_.query.trim().length>0){J.preventDefault(),Ye(_);return}if(A&&J.key==="Tab"&&!_){const F=N.current;if(F){const le=$(),Ce=zn(le),_e=sa(F);if(_e!==null&&eu(Ce,_e)){J.preventDefault();const Pe=J.shiftKey?EF(le,_e):vF(le,_e);Pe&&pe(F,Pe);return}}}const K=F=>{const le=bh(F);if(!le)return;const Ce=$();fe.pushUndo(Ce);const _e=hr(Ce,le.start,le.end,`
565
- `);pe(F,{segments:_e,cursorOffset:le.start+1})};if(J.key==="Enter"&&J.shiftKey&&!J.nativeEvent.isComposing){J.preventDefault();const F=N.current;F&&!oe(F)&&K(F);return}if(J.key==="Enter"&&!J.shiftKey&&!J.nativeEvent.isComposing){const F=N.current;if(F&&oe(F)){J.preventDefault();return}if(S){J.preventDefault(),s?.($());return}J.preventDefault(),F&&K(F);return}if(J.key==="Escape"&&a){a();return}if((J.key==="Backspace"||J.key==="Delete")&&!J.nativeEvent.isComposing){const F=N.current;if(F){const le=bh(F);if(le&&le.start!==le.end){J.preventDefault();const Ce=$();fe.pushUndo(Ce);const _e=hr(Ce,le.start,le.end,"");pe(F,{segments:_e,cursorOffset:le.start}),ne();return}}}if(J.key==="Backspace"){const F=N.current;if(F){const le=$(),Ce=sa(F);if(A&&Ce!==null){const _e=TF(le,Ce);if(_e){J.preventDefault(),pe(F,_e),ne();return}}}if(ze()){J.preventDefault(),ne();return}}if(J.key==="Delete"&&Xe()){J.preventDefault(),ne();return}},[_,Z,ee,V,R,s,S,a,$,t,L,A,ce,ze,Xe,Ye,ne,Le,fe,n,te]),Ie=y.useMemo(()=>({focus:()=>N.current?.focus(),blur:()=>N.current?.blur(),insertChip:J=>{const pe=$(),oe={type:"chip",...J},ae=[...pe,oe,{type:"text",text:" "}];t(ae),L(ae),u?.(oe)},getPlainText:()=>zn($()),clear:()=>{t([]);const J=N.current;if(J)for(;J.firstChild;)J.removeChild(J.firstChild);fe.resetUndoHistory(),D.current&&(clearTimeout(D.current),D.current=null),B.current=null},setText:J=>{fe.pushUndo($());const pe=oF(J);t(pe),L(pe);const oe=N.current;oe&&rr(oe,J.length)},appendText:J=>{const pe=$();fe.pushUndo(pe);const oe=pe[pe.length-1],ae=oe?.type==="text"?[...pe.slice(0,-1),{type:"text",text:oe.text+J}]:[...pe,{type:"text",text:J}];t(ae),L(ae);const K=N.current;K&&rr(K,zn(ae).length)},getCursorPosition:()=>{const J=N.current;return J?sa(J):null},setCursorPosition:J=>{const pe=N.current;pe&&rr(pe,J)},setCursorToEnd:()=>{const J=N.current;J&&rr(J,zn($()).length)},getSelection:()=>{const J=N.current;return J?bh(J):null},setSelection:(J,pe)=>{const oe=N.current;oe&&ww(oe,J,pe)}}),[$,t,L,u,fe]),je=y.useMemo(()=>({onPaste:fe.handlePaste,onCopy:fe.handleCopy,onCut:fe.handleCut,onDrop:fe.handleDrop,onDragOver:fe.handleDragOver,onCompositionStart:fe.handleCompositionStart,onCompositionEnd:fe.handleCompositionEnd,onBlur:fe.handleBlur}),[fe.handlePaste,fe.handleCopy,fe.handleCut,fe.handleDrop,fe.handleDragOver,fe.handleCompositionStart,fe.handleCompositionEnd,fe.handleBlur]);return{editorRef:N,activeTrigger:_,suggestions:Z,suggestionsLoading:ee,suggestionsError:V,selectedSuggestionIndex:R,handleInput:xe,handleKeyDown:Ee,handleClick:Fe,handleMouseDown:De,selectSuggestion:ke,dismissTrigger:ce,handle:Ie,triggerRect:O,eventHandlers:je}}const kw=240;function o$({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:s,onSelect:a,onDismiss:l,triggerRect:u,triggerChar:d}){const h=y.useRef(null),m=y.useRef(null);if(y.useEffect(()=>{m.current?.scrollIntoView({block:"nearest"})},[s]),y.useEffect(()=>{const w=S=>{const k=S.target;h.current&&k instanceof Node&&!h.current.contains(k)&&l()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]),!u||e.length===0&&!t&&!n&&!r)return null;const p=Math.min(320,window.innerWidth-16),b=Math.min(u.left,window.innerWidth-p-8),x=window.innerHeight-u.bottom,E=x<kw&&u.top>x,A={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${p}px`,maxHeight:`${kw}px`,...E?{bottom:`${window.innerHeight-u.top+4}px`}:{top:`${u.bottom+4}px`}};return f.jsx("div",{ref:h,className:ye("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:A,role:"listbox","aria-label":`${d} suggestions`,children:t?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?f.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((w,S)=>f.jsxs("button",{ref:S===s?m:void 0,type:"button",role:"option","aria-selected":S===s,className:ye("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:k=>{k.preventDefault(),a(w)},children:[w.icon&&f.jsx("span",{className:"mt-0.5 shrink-0",children:w.icon}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",children:w.label}),w.description&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:w.description})]})]},w.value))})}function l$({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]),f.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:f.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function NR({onClick:e,label:t,className:n}){return f.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:ye("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:f.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[f.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),f.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:f.jsx("div",{className:ye("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(s=>f.jsxs("div",{role:"listitem",className:ye("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(s),children:[f.jsx("img",{src:s.url,alt:s.alt??"Attached image",className:"h-full w-full object-cover"}),s.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&f.jsx(NR,{onClick:()=>t(s),label:`Remove ${s.alt??"image"}`})]},s.id))})}function wd({className:e,children:t}){return f.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 am=f.jsxs(f.Fragment,{children:[f.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"}),f.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),c$=({className:e})=>f.jsx(wd,{className:e,children:am}),d$=({className:e})=>f.jsxs(wd,{className:e,children:[am,f.jsx("path",{d:"M10 9H8"}),f.jsx("path",{d:"M16 13H8"}),f.jsx("path",{d:"M16 17H8"})]}),f$=({className:e})=>f.jsxs(wd,{className:e,children:[am,f.jsx("path",{d:"M8 13h2"}),f.jsx("path",{d:"M14 13h2"}),f.jsx("path",{d:"M8 17h2"}),f.jsx("path",{d:"M14 17h2"})]}),h$=({className:e})=>f.jsxs(wd,{className:e,children:[am,f.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),f.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),p$=({className:e})=>f.jsxs(wd,{className:e,children:[f.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),f.jsx("circle",{cx:"9",cy:"9",r:"2"}),f.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),xh=3;function m$(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 g$={pdf:d$,spreadsheet:f$,code:h$,image:p$,default:c$};function b$(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 x$(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function Nw({file:e,compact:t,onRemove:n,onClick:r}){const s=x$(e.name),a=e.size!=null?b$(e.size):null,l=[s,a].filter(Boolean).join(" · ");return f.jsxs("div",{role:"listitem",className:ye("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 u=g$[m$(e.type)];return f.jsx(u,{className:ye("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:ye("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&f.jsx(NR,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function y$({files:e,onRemove:t,onClick:n,className:r}){const[s,a]=y.useState(!1),l=y.useRef(null),u=y.useRef(null);if(y.useEffect(()=>{if(!s)return;const b=x=>{const E=x.target;E instanceof Node&&l.current&&!l.current.contains(E)&&!u.current?.contains(E)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),e.length===0)return null;const d=e.length>xh,h=d,m=e.length-xh,p=e.slice(0,xh);return f.jsxs("div",{className:ye("relative",r),children:[f.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?p:e).map(b=>f.jsx(Nw,{file:b,compact:h,onRemove:t,onClick:n},b.id)),d&&f.jsx("div",{role:"listitem",children:f.jsx("button",{ref:u,type:"button",onClick:()=>a(b=>!b),className:ye("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",h?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:s?"Show less":`+${m} more`})})]}),s&&f.jsx("div",{ref:l,className:ye("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:f.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(xh).map(b=>f.jsx(Nw,{file:b,compact:h,onRemove:t,onClick:n},b.id))})})]})}function b1({value:e,onChange:t,triggers:n,placeholder:r,className:s,disabled:a=!1,markdown:l,normalizeBullets:u,onSubmit:d,onEscape:h,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:x,onPaste:E,onUndo:A,onRedo:w,minHeight:S=80,maxHeight:k,autoFocus:N=!1,autoGrow:_=!1,"aria-label":M,"data-test-id":R,images:j=[],imagePosition:O="above",onImagePaste:H,onImageRemove:P,onImageClick:Y,files:X=[],filePosition:Z="above",onFileRemove:ee,onFileClick:V,onKeyDown:z,onBlur:G,onRawPaste:Q,submitOnEnter:se,spellCheck:D,maxLength:B,"aria-describedby":$,ref:L}){const{editorRef:te,activeTrigger:ne,suggestions:ce,suggestionsLoading:fe,suggestionsError:de,selectedSuggestionIndex:xe,handleInput:Fe,handleKeyDown:De,handleClick:Te,handleMouseDown:Oe,selectSuggestion:ze,dismissTrigger:Xe,handle:Ye,triggerRect:Le,eventHandlers:ke}=a$({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:h,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:x,onPaste:E,onRawPaste:Q,onUndo:A,onRedo:w,onImagePaste:H,markdown:l,normalizeBullets:u,submitOnEnter:se,maxLength:B});y.useImperativeHandle(L,()=>Ye,[Ye]),y.useEffect(()=>{N&&te.current?.focus()},[N,te]);const[Ee,Ie]=y.useState(!1),[je,J]=y.useState(void 0),pe=y.useCallback(()=>{const Ge=te.current;if(!Ge)return;Ge.style.height="auto";const Rt=Ge.scrollHeight;Ge.style.height=`${Rt}px`,J(Rt)},[te]),oe=y.useCallback(()=>{_&&(Ie(!0),pe())},[_,pe]),ae=y.useCallback(()=>{ke.onBlur(),_&&setTimeout(()=>{const Ge=te.current;if(!Ge)return;const Rt=document.activeElement;Rt&&Ge.parentElement?.contains(Rt)||(Ie(!1),J(void 0))},kR)},[ke,_,te]),K=y.useCallback(()=>{Fe(),_&&Ee&&pe()},[Fe,_,Ee,pe]);y.useEffect(()=>{_&&Ee&&requestAnimationFrame(()=>pe())},[e,_,Ee,pe]);const[F,le]=y.useState(!1),Ce=y.useRef(null);y.useEffect(()=>{if(!_)return;const Ge=()=>{if(Ee){le(!1);return}const jt=te.current;jt&&le(jt.scrollHeight>jt.clientHeight)},Rt=Ee?0:160;return Ce.current=setTimeout(Ge,Rt),()=>{Ce.current!==null&&clearTimeout(Ce.current)}},[_,Ee,e,te]);const _e=y.useMemo(()=>{if(!_){const Ge={minHeight:`${S}px`};return k&&(Ge.maxHeight=`${k}px`,Ge.overflowY="auto"),Ge}return{height:Ee&&je?`${je}px`:`${S}px`,minHeight:`${S}px`,maxHeight:k?`${k}px`:"70dvh",overflowY:Ee?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[_,S,k,Ee,je]),Ve=y.useCallback(Ge=>{z?.(Ge),!Ge.defaultPrevented&&De(Ge)},[z,De]),Pe=y.useCallback(Ge=>{G?.(Ge),ae()},[G,ae]),We=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",lt=j.length>0?f.jsx(u$,{images:j,onRemove:P,onClick:Y,className:O==="above"?"pb-2":"pt-2"}):null,ct=X.length>0?f.jsx(y$,{files:X,onRemove:ee,onClick:V,className:Z==="above"?"pb-2":"pt-2"}):null;return f.jsxs("div",{className:ye("prompt-area-container relative text-sm leading-relaxed",s),children:[O==="above"&&lt,Z==="above"&&ct,f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:te,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":M??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":$,"data-test-id":R,spellCheck:D,className:ye("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:_e,onFocus:oe,onInput:_?K:Fe,onKeyDown:Ve,onMouseDown:Oe,onClick:Te,onPaste:ke.onPaste,onCopy:ke.onCopy,onCut:ke.onCut,onDrop:ke.onDrop,onDragOver:ke.onDragOver,onCompositionStart:ke.onCompositionStart,onCompositionEnd:ke.onCompositionEnd,onBlur:Pe}),_&&F&&!Ee&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>te.current?.focus(),children:f.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)))"}})}),We&&r&&(Array.isArray(r)?f.jsx(l$,{texts:r}):f.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}))]}),Z==="below"&&ct,O==="below"&&lt,ne&&ne.config.mode==="dropdown"&&f.jsx(o$,{suggestions:ce,loading:fe,error:de,emptyMessage:ne.config.emptyMessage,selectedIndex:xe,onSelect:ze,onDismiss:Xe,triggerRect:Le,triggerChar:ne.config.char})]})}function v$(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(E=>E.type==="text"&&E.text.trim()===""),[n]),u=y.useMemo(()=>n.some(E=>E.type==="chip"),[n]),d=y.useMemo(()=>n.filter(E=>E.type==="chip"),[n]),h=y.useMemo(()=>({ref:s,value:n,onChange:r}),[n]),m=y.useCallback(()=>{s.current?s.current.clear():r([])},[]),p=y.useCallback(()=>s.current?.focus(),[]),b=y.useCallback(()=>s.current?.blur(),[]),x=y.useCallback(E=>s.current?.insertChip(E),[]);return{bind:h,plainText:a,isEmpty:l,hasChips:u,chips:d,clear:m,focus:p,blur:b,insertChip:x}}function E$(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function Aw(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const AR=["attention","working","idle","ended"],_R={attention:"Needs attention",working:"Working",idle:"Idle",ended:"Ended"};function RR(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 Pb={search:"",gateways:[],adapters:[],states:[],scoped:!0,groupBy:"state",sortBy:"recent"};function T$(e){return[...new Set(e.map(t=>t.adapter))].sort()}function tu(e){return e.title??e.id.slice(0,8)}function S$(e){return typeof e.meta?.jobId=="string"}function C$(e,t){return t?tu(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 _w(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function w$(e,t){const n=_w(e),r=_w(t);return r===n||r.startsWith(`${n}/`)}function k$(e,t){return t.roots.some(n=>(n.hostId?n.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&w$(n.path,e.info.cwd))}function IR(e,t){return e.scoped&&t!==void 0}function OR(e,t,n){const r=t.search.trim().toLowerCase(),s=IR(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||k$(a,s))&&C$(a,r))}function N$(e,t){return t==="gateway"?e.hostId:t==="adapter"?e.adapter:e.state}function MR(e,t){return t==="gateway"?e.hostName:t==="adapter"?e.adapter:_R[e.state]}function Bb(e,t){return t==="state"?String(AR.indexOf(e.state)):MR(e,t).toLowerCase()}const x1=(e,t)=>(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt);function A$(e,t,n){return n==="recent"?x1(e,t):n==="name"?tu(e.info).localeCompare(tu(t.info),void 0,{sensitivity:"base"})||x1(e,t):Bb(e,n).localeCompare(Bb(t,n))||x1(e,t)}function _$(e,t){const n=[...e].sort((a,l)=>A$(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=N$(a,r),u=s.get(l);u?u.rows.push(a):s.set(l,{key:l,label:MR(a,r),rank:Bb(a,r),rows:[a]})}return[...s.values()].sort((a,l)=>a.rank.localeCompare(l.rank))}function R$(e,t,n,r){if(n>=r)return;const s=[];t&&IR(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 I$(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0}function Rw(e){return{...Pb,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}const O$=720*60*60*1e3,M$=6e4,y1=(e,t)=>`${e}:${t}`;class L${#t;#n;constructor(t){this.#t=t,this.#n={...t.read()}}get(t,n){return this.#n[y1(t,n)]}all(){return this.#n}mark(t,n,r,s=Date.now()){const a=y1(t,n),l=this.#n[a],u={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===u.itemCount&&l.activity===u.activity&&l.turns===u.turns&&u.seenAt-l.seenAt<M$?!1:(this.#n[a]=u,this.#t.write(this.#r(s)),!0)}forget(t,n){const r=y1(t,n);r in this.#n&&(delete this.#n[r],this.#t.write(this.#n))}#r(t){const n=t-O$;for(const[r,s]of Object.entries(this.#n))s.seenAt<n&&delete this.#n[r];return this.#n}}function D$(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 LR=7,om={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,hostCwd:!0,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,hostCwd:!0,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,hostCwd:!1,streaming:"token"}};om.provider.permissionModes;const j$={status:"starting",capabilities:om.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},v1="streaming",yh="streaming-thinking";function P$(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
566
- `)}function Iw(e){return typeof e=="string"?[{type:"text",text:e}]:e}function B$(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const z$=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/;function Za(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 U$(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??om[n??"claude"],session:t}}function H$(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 F$(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 Iw(t.message.content))if(s.type==="tool_result"){const a=s,l=a.is_error===!0;r=r.map(u=>u.kind==="tool_call"&&u.id===a.tool_use_id?{...u,status:l?"failed":"settled",result:{text:P$(a.content),isError:l}}:u)}else if(s.type==="text"&&!t.synthetic){const a=s.text,l=z$.exec(a.trim());l?r=Za(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=Za(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===yh)?.text??"",s=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===v1)&&!(l.kind==="thinking"&&l.id===yh));return Iw(t.message.content).forEach((l,u)=>{const d=`${t.uuid}-${u}`;if(l.type==="text")s=Za(s,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const h=l.thinking||r;if(r="",h.trim()==="")return;s=Za(s,{kind:"thinking",id:d,text:h,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const h=l;s=Za(s,{kind:"tool_call",id:h.id,name:h.name,input:h.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===v1),a={kind:"assistant_text",id:v1,text:(s?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:Za(n.items,a)}}if(r.delta?.type==="thinking_delta"){const s=n.items.find(l=>l.kind==="thinking"&&l.id===yh),a={kind:"thinking",id:yh,text:(s?.text??"")+(r.delta.thinking??""),parentToolUseId:t.parentToolUseId};return{...n,items:Za(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:B$(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 $$(e,t){return t.type==="attached"?U$(e,t.session):F$(e,t)}const V$=3;function q$(e,t,n){const[r,s]=y.useReducer($$,j$),[a,l]=y.useState("reconnecting"),[u,d]=y.useState(),[h,m]=y.useState(),p=y.useRef(null),b=y.useRef(n?.onProtocolError);b.current=n?.onProtocolError,y.useEffect(()=>{if(!t)return;const w=e.attach(t);p.current=w,m(w);const S=w.on("event",R=>s(R)),k=w.on("attached",R=>{s(R),d(R.protocolVersion===LR?void 0:R.protocolVersion)}),N=w.on("connectionChange",R=>l(R?"live":"reconnecting")),_=w.on("reconnectAttempt",R=>l(R>=V$?"offline":"reconnecting")),M=w.on("protocolError",R=>{b.current?.(R)});return()=>{S(),k(),N(),_(),M(),w.detach(),p.current=null,m(void 0),l("reconnecting"),d(void 0)}},[e,t]);const x=Y$(e,t,r),E=a==="live",A=y.useCallback(()=>p.current?.reconnectNow(),[]);return y.useMemo(()=>({state:r,connected:E,connection:a,protocolMismatch:u,models:x,effectiveModel:r.model??r.defaultModel,handle:h,send:(w,S)=>p.current?.send(w,S),approve:(w,S)=>p.current?.approve(w,S),deny:(w,S,k)=>p.current?.deny(w,S,k),interrupt:()=>p.current?.interrupt(),setPermissionMode:w=>p.current?.setPermissionMode(w),setModel:w=>p.current?.setModel(w),closeSession:()=>p.current?.closeSession(),reconnectNow:A}),[r,E,a,u,x,h,A])}function Y$(e,t,n){const[r,s]=y.useState([]),a=n.session?.profile,l=n.models,u=!!l?.length;return y.useEffect(()=>s([]),[t]),y.useEffect(()=>{if(!a||u)return;let d=!1;return e.listProfiles().then(h=>{d||s(h.profiles.find(m=>m.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,u]),u?l:r}function G$(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||K$.has(t))return"text"}const K$=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),Ow=1568;function X$(e,t,{capabilities:n,engine:r}){const[s,a]=y.useState([]),[l,u]=y.useState(),d=y.useRef(0),h=y.useRef(new Map),m=y.useRef([]);m.current=s.flatMap(N=>N.previewUrl?[N.previewUrl]:[]);const p=n.attachments;y.useEffect(()=>()=>{for(const N of m.current)URL.revokeObjectURL(N)},[]);const b=y.useCallback((N,_)=>{a(M=>M.map(R=>R.key===N?{...R,..._}:R))},[]),x=y.useCallback((N,_)=>{t&&(b(N,{status:"uploading",error:void 0}),(async()=>{try{const M=await Z$(_),R=await e.uploadAttachment(t,{name:_.name,mediaType:M.mediaType,data:M.body});b(N,{status:"ready",id:R.id,bytes:R.bytes??_.size})}catch(M){b(N,{status:"failed",error:M instanceof Error?M.message:"Upload failed"})}})())},[e,b,t]),E=y.useCallback(N=>{const _=[],M=[];for(const R of N){const j=R.type||"application/octet-stream",O=G$(j);if(O&&!p.includes(O)){u(`The ${r??"claude"} engine does not take ${O} attachments.`);continue}const H=`att-${++d.current}`;_.push({key:H,name:R.name,mediaType:j,bytes:R.size,previewUrl:O==="image"?URL.createObjectURL(R):void 0,status:"uploading"}),M.push({key:H,file:R})}if(_.length!==0){a(R=>[...R,..._]),h.current=new Map([...h.current,...M.map(({key:R,file:j})=>[R,j])]);for(const{key:R,file:j}of M)x(R,j)}},[p,r,x]),A=y.useCallback(N=>{a(_=>{for(const M of _)N.includes(M.key)&&M.previewUrl&&URL.revokeObjectURL(M.previewUrl);return _.filter(M=>!N.includes(M.key))});for(const _ of N)h.current.delete(_)},[]),w=y.useCallback(N=>A([N]),[A]),S=y.useCallback(()=>{a(N=>{for(const _ of N)_.previewUrl&&URL.revokeObjectURL(_.previewUrl);return[]}),h.current.clear()},[]),k=y.useCallback(N=>{const _=h.current.get(N);_&&x(N,_)},[x]);return y.useMemo(()=>({items:s,readyIds:s.flatMap(N=>N.id?[N.id]:[]),uploading:s.some(N=>N.status==="uploading"),hasFailure:s.some(N=>N.status==="failed"),accept:W$(p),disabled:p.length===0||!t,add:E,retry:k,remove:w,clear:S,error:l,dismissError:()=>u(void 0)}),[s,p,t,E,k,w,S,l])}function W$(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 Q$=globalThis;async function Z$(e){const t=e.type||"application/octet-stream",{createImageBitmap:n,document:r}=Q$;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<=Ow)return s.close(),{body:e,mediaType:t};const l=Ow/a,u=r.createElement("canvas");u.width=Math.round(s.width*l),u.height=Math.round(s.height*l);const d=u.getContext("2d");if(!d)return s.close(),{body:e,mediaType:t};d.drawImage(s,0,0,u.width,u.height),s.close();const h=await new Promise(m=>u.toBlob(m,"image/jpeg",.85));return h?{body:h,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const J$=/^[A-Za-z0-9\-_.:]+$/,eV=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function tV(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&&eV.has(e[l-1]);)l--;const u=e.slice(r.index+1,l);u&&(a==="command"&&!J$.test(u)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}function Hy(e){let t=e.baseUrl.trim();for(;t.endsWith("/");)t=t.slice(0,-1);if(t!==""){t.includes("://")||(t="http://"+t),t.endsWith("/v1")||(t+="/v1");try{new URL(t)}catch{return}return t}}function nV(e){const t=Hy(e);if(!t)return!1;try{const{hostname:n}=new URL(t);return n==="127.0.0.1"||n==="localhost"||n==="::1"||n==="[::1]"}catch{return!1}}function rV(e){const{baseUrl:t,key:n}=e;if(n==="")return{};const r=t.replace(/^http/,"ws"),s=a=>`${a}${a.includes("?")?"&":"?"}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(a,l)=>s(`${r}/sessions/${encodeURIComponent(a)}/ws?afterSeq=${l}`),buildQueueWsUrl:()=>s(`${r}/queue/ws`)}}class uo extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class sV{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 iV{#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 aV{#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 uo(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 uo(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 uo(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 sV(this,t,n)}attachQueue(t){return new iV(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 uo(a.error??`${t} ${n} failed with ${s.status}`,s.status);return a}}function oV(e,t,n){const r=[],s=(a,l)=>{const u=t.get(a);if(u)for(const d of u.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const h=n.has(d.path),m=t.get(d.path);r.push({entry:d,depth:l,expanded:h,loading:h&&!m,truncated:h?m?.truncated:void 0}),h&&m&&s(d.path,l+1)}};return s(e,0),r}function lV(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 DR(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,u)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,u?.limit??8);return u?.signal?.aborted?[]:d.matches}catch(d){return d instanceof uo&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function uV(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 cV(e,t){const[n,r]=y.useState(()=>new Map),[s,a]=y.useState(()=>new Set),[l,u]=y.useState(!1),[d,h]=y.useState(),m=y.useRef(t);y.useEffect(()=>{m.current!==t&&(m.current=t,r(new Map),a(new Set),u(!1),h(void 0))},[t]);const p=y.useRef(!0);y.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const b=y.useRef(new Set),x=y.useCallback((k,{force:N=!1}={})=>{l||!N&&b.current.has(k)||(b.current.add(k),e.listHostDir(k).then(_=>{p.current&&r(M=>{const R=new Map(M);return R.set(k,{entries:_.entries,truncated:_.truncated}),R})}).catch(_=>{if(p.current){if(b.current.delete(k),_ instanceof uo&&_.status===404){u(!0);return}h(_ instanceof Error?_.message:"Could not read that directory")}}))},[e,l]);y.useEffect(()=>{t&&x(t)},[t,x]);const E=y.useCallback(k=>{a(N=>{const _=new Set(N);return _.has(k)?_.delete(k):_.add(k),_}),x(k)},[x]),A=y.useCallback(k=>{if(!t)return;const N=lV(t,k);if(N.length!==0){for(const _ of N)x(_);a(_=>{const M=new Set(_);for(const R of N)M.add(R);return M})}},[t,x]),w=y.useCallback(k=>{const N=k??t;N&&(h(void 0),x(N,{force:!0}))},[t,x]),S=y.useMemo(()=>t?oV(t,n,s):[],[t,n,s]);return{available:!!t&&!l,root:t,rows:S,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:E,reveal:A,refresh:w}}function jR(e,t){const[n,r]=y.useState(),[s,a]=y.useState(!!t),[l,u]=y.useState();return y.useEffect(()=>{if(!t){r(void 0),a(!1),u(void 0);return}let d=!1;return a(!0),u(void 0),r(void 0),e.getSession(t).then(h=>{d||(r(h),a(!1))}).catch(h=>{d||(u(h instanceof Error?h.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:s,error:l}}function dd(e){return e.draft!==void 0&&e.draft!==e.content}function zb(e){return e.draft??e.content??""}const PR={files:[]};function dV(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:Mw(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 PR;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return ia(e,t.path,()=>({path:t.path,name:Mw(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 ia(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return ia(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return ia(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return ia(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return ia(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 ia(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return ia(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function ia(e,t,n){const r=e.files.findIndex(u=>u.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 Mw(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function fV(e){const[t,n]=y.useReducer(dV,PR),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 u=t.files.filter(R=>R.status==="loading").map(R=>R.path).join(`
567
- `),d=y.useCallback(R=>e.readHostFile(R).then(j=>{if(s.current)return n({type:"loaded",path:R,content:j.content,encoding:j.encoding,bytes:j.bytes,hash:j.hash,modifiedAt:j.modifiedAt}),j}),[e]);y.useEffect(()=>{for(const R of u?u.split(`
568
- `):[])r.current.has(R)||(r.current.add(R),d(R).catch(j=>{s.current&&n({type:"failed",path:R,error:j instanceof Error?j.message:"Could not read that file"})}))},[d,u]);const h=y.useCallback(R=>n({type:"open",path:R}),[]),m=y.useCallback(R=>{r.current.delete(R),n({type:"close",path:R})},[]),p=y.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=y.useCallback(R=>n({type:"activate",path:R}),[]),x=y.useCallback((R,j)=>n({type:"edit",path:R,content:j}),[]),E=y.useCallback(R=>n({type:"revert",path:R}),[]),A=y.useCallback(R=>n({type:"dismissConflict",path:R}),[]),w=y.useCallback(R=>{r.current.add(R),d(R).catch(j=>{s.current&&n({type:"failed",path:R,error:j instanceof Error?j.message:"Could not re-read that file"})})},[d]),S=y.useCallback(async(R,j,O)=>{try{const H=await e.writeHostFile({path:R,content:j,expectedHash:O});if(!s.current)return;n({type:"saved",path:R,content:j,bytes:H.bytes,hash:H.hash,modifiedAt:H.modifiedAt})}catch(H){if(!s.current)return;const P=H instanceof uo&&H.status===409;n({type:"saveFailed",path:R,conflict:P,error:P?"This file changed on disk since you opened it.":H instanceof Error?H.message:"Could not save that file"})}},[e]),k=y.useCallback(async R=>{const j=a.current.files.find(O=>O.path===R);!j||j.saving||!dd(j)||(n({type:"saveStart",path:R}),await S(R,zb(j),j.hash))},[S]),N=y.useCallback(async R=>{const j=a.current.files.find(H=>H.path===R);if(!j||j.saving)return;const O=zb(j);n({type:"saveStart",path:R});try{const H=await e.readHostFile(R);if(!s.current)return;await S(R,O,H.hash)}catch(H){if(!s.current)return;n({type:"saveFailed",path:R,error:H instanceof Error?H.message:"Could not save that file"})}},[e,S]),_=y.useMemo(()=>t.files.find(R=>R.path===t.activePath),[t.files,t.activePath]),M=y.useMemo(()=>t.files.some(dd),[t.files]);return{...t,active:_,hasUnsaved:M,open:h,close:m,closeAll:p,activate:b,edit:x,save:k,revert:E,reload:w,overwrite:N,dismissConflict:A}}const hV="modulepreload",pV=function(e){return"/"+e},Lw={},nu=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");s=l(n.map(h=>{if(h=pV(h),h in Lw)return;Lw[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":hV,m||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((x,E)=>{b.addEventListener("load",x),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return t().catch(a)})};function mV(e,t={}){const n=new Map;let r,s=!1;const a=m=>t.onExecution?.(m),l=(m,p,b,x)=>{e.sendToolCallError(m.executionId,p,b),a({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:p,startedAt:x,endedAt:Date.now()})},u=async m=>{const p=Date.now();if(!(t.tools??["eval_script"]).includes(m.toolName)){l(m,"unsupported_tool",`this client does not execute '${m.toolName}'`,p);return}const x=m.input?.script;if(typeof x!="string"){l(m,"invalid_input","expected a string `script` input",p);return}const E=new AbortController;n.set(m.executionId,E),a({executionId:m.executionId,toolName:m.toolName,status:"running",startedAt:p});try{const A=await nu(()=>import("./index-D1RXsyHq.js"),[]),w=A.createVfs(m.vfsSeed),S=Math.min(m.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),k=Math.min(m.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),N=t.execute?await t.execute({script:x,vfs:w,timeoutMs:S,memoryLimitBytes:k,signal:E.signal}):await(async()=>(r??=(t.loadEngine??gV)(),A.runScript(await r,{script:x,vfs:w,timeoutMs:S,memoryLimitBytes:k,signal:E.signal,fetchText:t.fetchText})))();if(s||!n.has(m.executionId))return;const _=N.logs.map(M=>`[${M.level}] ${M.text}`);N.ok?(e.sendToolCallResult(m.executionId,{type:"json",value:N.value},_),a({executionId:m.executionId,toolName:m.toolName,status:"settled",startedAt:p,endedAt:Date.now()})):(e.sendToolCallError(m.executionId,N.reason,N.error,_),a({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:N.reason,startedAt:p,endedAt:Date.now()}))}catch(A){if(s||!n.has(m.executionId))return;l(m,"host_error",A instanceof Error?A.message:String(A),p)}finally{n.delete(m.executionId)}},d=e.on("toolCallRequest",m=>void u(m)),h=e.on("toolCallCanceled",({executionId:m,reason:p})=>{const b=n.get(m);b&&(b.abort(),n.delete(m),a({executionId:m,toolName:"",status:"canceled",reason:p,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{s=!0,d(),h();for(const m of n.values())m.abort();n.clear()}}}async function gV(){const[e,t]=await Promise.all([nu(()=>import("./index-D1RXsyHq.js"),[]),nu(()=>import("./index-DcKn0lKB.js"),[])]);return e.loadEngine(t)}function bV(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=mV(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 u=s.current.historyLimit??50;r(d=>[...d.filter(h=>h.executionId!==l.executionId),l].slice(-u))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function xV(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,u=0,d=0,h=0;for(const b of r)switch(b.kind){case"turn_result":a+=1,b.isError&&(h+=1);break;case"assistant_text":l+=1;break;case"tool_call":u+=1,s.set(b.name,(s.get(b.name)??0)+1),(b.status==="failed"||b.result?.isError)&&(h+=1);break;case"file_delivered":d+=1;break;case"notice":b.level==="error"&&(h+=1);break}const m=[...s.entries()].sort((b,x)=>x[1]-b[1]||b[0].localeCompare(x[0])).map(([b])=>b),p=e.pendingApprovals?.length??0;return{turns:a,replies:l,tools:u,toolNames:m,files:d,errors:h,pending:p,any:a+l+u+d+h+p>0}}function yV(e){if(!e.any)return;const t=[];if(e.turns>0?t.push(kl(e.turns,"turn")):e.replies>0&&t.push(kl(e.replies,"reply","replies")),e.tools>0){const n=e.toolNames.slice(0,3).join(", "),r=e.toolNames.length-3;t.push(`${kl(e.tools,"tool call")}${n?` (${n}${r>0?`, +${r}`:""})`:""}`)}return e.files>0&&t.push(kl(e.files,"file")),e.errors>0&&t.push(kl(e.errors,"error")),e.pending>0&&t.push(`${kl(e.pending,"approval")} waiting`),t.join(" · ")}function kl(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}const BR=y.createContext("cards");function zR({value:e,children:t}){return f.jsx(BR.Provider,{value:e,children:t})}function vV(){return y.useContext(BR)}function Xr(){return vV()==="lines"}const EV=y.createContext("comfortable");function TV({value:e,children:t}){return f.jsx(EV.Provider,{value:e,children:t})}const SV={cards:{comfortable:{className:"pt-4",px:16},compact:{className:"pt-2",px:8}},lines:{comfortable:{className:"pt-4",px:16},compact:{px:0}}};function Or({children:e,className:t}){return f.jsx("span",{"aria-hidden":!0,className:ye("w-3.5 shrink-0 select-none text-center font-mono text-label leading-5 text-fg-4",t),children:e})}const CV="text-body-sm leading-5";function va(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function Ub(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 cs(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Co(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function Hb(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 fu(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 wV(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 kV(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function NV(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 Fb(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 AV={gpt:{name:"GPT",joiner:"-"},deepseek:{name:"DeepSeek"},glm:{name:"GLM"},qwen:{name:"Qwen"},kimi:{name:"Kimi"},llama:{name:"Llama"},mistral:{name:"Mistral"},grok:{name:"Grok"}};function _V(e){if(!e)return;const n=(e.split("[")[0]??e).toLowerCase().split("-").filter(Boolean);n[0]==="claude"&&n.shift();const r=n.shift();if(!r)return e;const s=AV[r],a=s?.name??(/^o\d+$/.test(r)?r:`${r.charAt(0).toUpperCase()}${r.slice(1)}`),l=[],u=[];for(const h of n)/^\d{8}$/.test(h)||(/^\d+(\.\d+)?$/.test(h)?l.push(h):u.push(`${h.charAt(0).toUpperCase()}${h.slice(1)}`));return[l.length>0?`${a}${s?.joiner??" "}${l.join(".")}`:a,...u].join(" ")}const RV=e=>e.replace(/\s*\(MCP\)$/i,"");function UR(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function Dw(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 IV({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:s="Message the agent…",commands:a,skills:l,onSearchFiles:u,attachments:d,toolbar:h,layout:m="stacked",className:p,ref:b}){const x=m==="inline",E=Xr(),{bind:A,plainText:w,isEmpty:S,clear:k,focus:N}=v$(),_=y.useRef(null),[M,R]=y.useState(!1);y.useImperativeHandle(b,()=>({insertText:se=>{const D=w.length>0&&!/\s$/.test(w)?" ":"";A.ref.current?.appendText(D+se),N()},focus:N}),[A.ref,w,N]);const j=y.useMemo(()=>{const se=[],D=(l??[]).filter(B=>B.enabled);if(a&&a.length>0){const B=new Set,$=a.flatMap(L=>{const te=RV(L.name);return B.has(te)?[]:(B.add(te),[{...L,name:te}])});se.push(Aw({onSearch:L=>{const te=[];for(const ne of $){const ce=Dw(L,[ne.name,...ne.aliases??[],...ne.name.split(":")]);ce!==0&&te.push({score:ce,suggestion:{value:ne.name,label:`/${ne.name}${ne.argumentHint?` ${ne.argumentHint}`:""}`,description:ne.description}})}return te.sort((ne,ce)=>ce.score-ne.score),te.map(({suggestion:ne})=>ne)},onSelect:L=>L.value,chipClassName:"font-mono"}))}return D.length>0&&se.push(Aw({char:"$",accessibilityLabel:"skill",onSearch:B=>{const $=[];for(const L of D){const te=Dw(B,[L.name,...L.name.split(/[-:_]/)]);if(te===0)continue;const ne=L.shortDescription??L.description;$.push({score:te,suggestion:{value:L.name,label:L.displayName??L.name,description:ne?`Skill · ${ne}`:"Skill · inserts a message you can edit",icon:f.jsx(nm,{className:"size-3.5 text-fg-3"})}})}return $.sort((L,te)=>te.score-L.score),$.map(({suggestion:L})=>L)},insertAsText:B=>{const $=D.find(L=>L.name===B.value);return $?UR($):`$${B.value} `}})),u&&se.push(E$({searchDebounceMs:150,onSearch:async(B,$)=>(await u(B,$)).map(te=>({value:te.relative,label:te.relative,description:te.path})),onSelect:B=>B.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),se.length>0?se:void 0},[a,l,u]),O=d?.items??[],H=!r&&(!S||O.length>0)&&!d?.uploading&&!d?.hasFailure,P=()=>{H&&(e(w.trim(),d?.readyIds??[]),d?.clear(),k(),N())},Y=se=>{se&&se.length>0&&d?.add(se)},X=d&&!d.disabled?f.jsx("input",{ref:_,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:se=>{Y(se.target.files),se.target.value=""}}):null,ee=!!d&&!d.disabled?f.jsxs(f.Fragment,{children:[X,E?f.jsx(jw,{label:"Attach files",disabled:r,onClick:()=>_.current?.click(),children:"+"}):f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>_.current?.click(),children:f.jsx(Cz,{className:"size-4"})})]}):null,V=n&&!H,z=E?f.jsx(jw,{label:V?"Interrupt":"Send",disabled:!V&&!H,onClick:V?t:P,className:V?"text-warning":H?"text-accent":void 0,children:V?"■":"↵"}):V?f.jsx(tt,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:f.jsx(oU,{className:"size-3"})}):f.jsx(tt,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!H,onClick:P,children:f.jsx(sB,{className:"size-4"})}),G={onDragOver:se=>{d&&!d.disabled&&(se.preventDefault(),R(!0))},onDragLeave:()=>R(!1),onDrop:se=>{!d||d.disabled||(se.preventDefault(),R(!1),Y(se.dataTransfer.files))}},Q=d?.error?f.jsxs("div",{className:ye("mx-auto mt-1 flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-danger",E&&"px-2"),children:[f.jsx(ql,{className:"size-3 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1",children:d.error}),f.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:f.jsx(Cs,{className:"size-3"})})]}):null;return E?f.jsxs("div",{"data-slot":"composer",className:ye("shrink-0",p),children:[f.jsx("div",{...G,className:ye("flex min-h-[38px] flex-col justify-center","border-t border-border bg-bg transition-colors","focus-within:border-t-accent",M&&"border-t-accent",r&&"opacity-60"),children:f.jsxs("div",{className:"mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] px-2 py-1",children:[O.length>0&&d?f.jsx(Pw,{attachments:d}):null,f.jsxs("div",{className:"flex items-end gap-1",children:[ee,f.jsx(b1,{...A,triggers:j,onSubmit:P,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:se=>d?.add([se])}),z]}),h?f.jsx("div",{className:"flex min-w-0 items-center gap-1 pt-1",children:h}):null]})}),Q]}):f.jsxs("div",{"data-slot":"composer",className:ye("px-3 pb-3",p),children:[f.jsxs("div",{...G,className:ye("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] overflow-hidden border border-border bg-bg","transition-colors rounded-lg shadow-(--shadow-xs)","focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",M&&"border-ring ring-2 ring-ring/30",r&&"opacity-60"),children:[O.length>0&&d?f.jsx(Pw,{attachments:d}):null,x?f.jsxs("div",{className:"flex items-end gap-1 p-1",children:[ee,f.jsx(b1,{...A,triggers:j,onSubmit:P,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:se=>d?.add([se])}),z]}):f.jsxs(f.Fragment,{children:[f.jsx(b1,{...A,triggers:j,onSubmit:P,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:se=>d?.add([se])}),f.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[ee,h]}),z]})]})]}),Q]})}function jw({label:e,disabled:t,onClick:n,className:r,children:s}){return f.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:ye("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 Pw({attachments:e}){return f.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-border px-2 py-2",children:e.items.map(t=>f.jsx(OV,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function OV({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed";return f.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${Co(e.bytes)}`,children:[f.jsx("div",{className:ye("flex size-14 items-center justify-center overflow-hidden rounded-md border border-border bg-surface",r&&"border-danger/50"),children:e.previewUrl?f.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):f.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[f.jsx(Iy,{className:"size-4"}),f.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:MV(e.name)})]})}),e.status==="uploading"?f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md bg-black/35",children:f.jsx(xn,{className:"size-4 text-white"})}):null,r?f.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:f.jsx(Dy,{className:"size-4"})}):null,f.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:f.jsx(Cs,{className:"size-2.5"})})]})}const MV=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},LV=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,DV=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function jV({usage:e,open:t,onOpenChange:n}){return f.jsx(fs,{open:t,onOpenChange:n,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Context",description:e?.model}),f.jsx(ms,{children:e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Used"}),f.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[cs(e.totalTokens)," / ",cs(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),f.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:ye("h-full rounded-full",DV(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?f.jsxs("div",{className:"mt-5",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),f.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=LV(r.color);return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),f.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:cs(r.tokens)})]}),f.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,s)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):f.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 PV({client:e,cwd:t,open:n,onOpenChange:r}){const[s,a]=y.useState(t),[l,u]=y.useState([]),[d,h]=y.useState(!1),[m,p]=y.useState(""),[b,x]=y.useState(),[E,A]=y.useState(),[w,S]=y.useState(!1),[k,N]=y.useState(),_=y.useCallback(async O=>{S(!0),N(void 0);try{const H=await e.listHostDir(O);a(H.path),u(H.entries),h(H.truncated??!1)}catch(H){N(H instanceof Error?H.message:"Could not read that directory")}finally{S(!1)}},[e]);y.useEffect(()=>{n&&(A(void 0),p(""),x(void 0),N(void 0),t&&_(t))},[n,t,_]),y.useEffect(()=>{if(!n||!t)return;const O=m.trim();if(!O){x(void 0);return}const H=setTimeout(()=>{e.findHostFiles(t,O,40).then(P=>x(P.matches)).catch(()=>x([]))},150);return()=>clearTimeout(H)},[e,t,m,n]);const M=async O=>{S(!0),N(void 0);try{const H=await e.readHostFile(O);A({path:H.path,bytes:H.bytes,content:H.encoding==="utf8"?H.content:"(binary file — not shown)"})}catch(H){N(H instanceof Error?H.message:"Could not read that file")}finally{S(!1)}},R=s&&t&&s!==t?s.slice(0,s.lastIndexOf("/"))||"/":void 0,j=b??l;return f.jsx(fs,{open:n,onOpenChange:r,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:E?E.path.split("/").pop():"Files",description:E?E.path:s,actions:E?f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>A(void 0),children:[f.jsx(lp,{className:"size-3.5"}),"Back"]}):R?f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>void _(R),children:[f.jsx(lp,{className:"size-3.5"}),"Up"]}):null}),f.jsxs(ms,{className:"flex flex-col gap-3",children:[k?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:k}):null,E?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-label text-fg-4",children:Co(E.bytes)}),f.jsx(fR,{code:E.content,label:E.path.split("/").pop()})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsx(tm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:m,onChange:O=>p(O.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),w&&j.length===0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):j.length===0?f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):f.jsx("ul",{className:"flex flex-col",children:b?b.map(O=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>void M(O.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:[f.jsx(Jp,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:O.relative})]})},O.path)):l.map(O=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>O.type==="dir"?void _(O.path):void M(O.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:[f.jsx(BV,{type:O.type}),f.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[O.name,O.type==="dir"?"/":""]}),O.bytes!==void 0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:Co(O.bytes)}):null]})},O.path))}),d&&!b?f.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function BV({type:e}){return e==="dir"?f.jsx(B_,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?f.jsx(U_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(Jp,{className:"size-3.5 shrink-0 text-fg-4"})}const HR={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function zV({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:s=!0}){const[a,l]=y.useState(),[u,d]=y.useState(),[h,m]=y.useState(!1),[p,b]=y.useState(),[x,E]=y.useState(),[A,w]=y.useState(),S=y.useCallback(async()=>{if(t){m(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(R){d(R instanceof Error?R.message:"Could not read MCP status")}finally{m(!1)}}},[e,t]);y.useEffect(()=>{n&&(E(void 0),w(void 0),S())},[n,S]);const k=async(R,j)=>{if(t){b(R),d(void 0);try{l(await e.mcpServerAction(t,R,j))}catch(O){d(O instanceof Error?O.message:`Could not ${j} ${R}`)}finally{b(void 0)}}},N=a?.find(R=>R.name===x),_=N?.tools?.find(R=>R.name===A),M=_?.name??N?.name??"MCP servers";return f.jsx(fs,{open:n,onOpenChange:r,children:f.jsxs(hs,{children:[f.jsx(ps,{title:M,description:_?`${N?.name} tool`:N?N.serverInfo?.name:void 0,actions:x?f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>A?w(void 0):E(void 0),children:[f.jsx(lp,{className:"size-3.5"}),"Back"]}):f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>void S(),disabled:h,children:[h?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(Dy,{className:"size-3"}),"Refresh"]})}),f.jsxs(ms,{children:[u?f.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:u}):null,_?f.jsx(FV,{tool:_}):N?f.jsx(HV,{server:N,busy:p===N.name,canManage:s,onAct:R=>void k(N.name,R),onSelectTool:w}):u&&!a?null:f.jsx(UV,{servers:a,loading:h,onSelect:E})]})]})})}function UV({servers:e,loading:t,onSelect:n}){if(t&&!e)return f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})});if(!e?.length)return f.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 f.jsx("div",{className:"flex flex-col gap-4",children:r.map(s=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:s}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===s).map(a=>f.jsx("li",{children:f.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:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,f.jsx(gn,{variant:HR[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),f.jsx(Td,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},s))})}function HV({server:e,busy:t,canManage:n,onAct:r,onSelectTool:s}){const a=e.status==="disabled";return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[f.jsx(sr,{label:"Status",children:f.jsx(gn,{variant:HR[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?f.jsx(sr,{label:"Transport",children:e.transport}):null,e.scope?f.jsx(sr,{label:"Scope",children:e.scope}):null,e.serverInfo?f.jsxs(sr,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?f.jsx(sr,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?f.jsx(sr,{label:"URL",mono:!0,children:e.url}):null]}),e.error?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(tt,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(Dy,{className:"size-3"}),"Reconnect"]}),f.jsxs(tt,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?f.jsx(Lz,{className:"size-3"}):f.jsx(Oz,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>f.jsx("li",{children:f.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:[f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),f.jsx(Td,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):f.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 FV({tool:e}){const t=e.annotations;return f.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?f.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?f.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?f.jsx(gn,{variant:"success",children:"read-only"}):null,t.destructive?f.jsx(gn,{variant:"danger",children:"destructive"}):null,t.openWorld?f.jsx(gn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),f.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:$V(e.inputSchema)})]}):f.jsx("p",{className:ye("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function $V(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const FR={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function VV({skills:e,open:t,onOpenChange:n,onUse:r}){const[s,a]=y.useState(),l=e?.find(u=>u.name===s);return f.jsx(fs,{open:t,onOpenChange:u=>{u||a(void 0),n(u)},children:f.jsxs(hs,{children:[f.jsx(ps,{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?f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[f.jsx(lp,{className:"size-3.5"}),"Back"]}):void 0}),f.jsx(ms,{children:l?f.jsx(YV,{skill:l,onUse:r,onUsed:()=>n(!1)}):f.jsx(qV,{skills:e,onSelect:a})})]})})}function qV({skills:e,onSelect:t}){if(!e)return f.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 f.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 f.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:FR[r]??r}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(s=>(s.scope??"other")===r).map(s=>f.jsx("li",{children:f.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:[f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:s.displayName??s.name}),s.shortDescription??s.description?f.jsx("span",{className:"block truncate text-label text-fg-4",children:s.shortDescription??s.description}):null]}),s.enabled?null:f.jsx(gn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),f.jsx(Td,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},s.name))})]},r))})}function YV({skill:e,onUse:t,onUsed:n}){return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[e.scope?f.jsx(sr,{label:"Scope",children:FR[e.scope]??e.scope}):null,f.jsx(sr,{label:"Status",children:f.jsx(gn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),f.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?f.jsxs("div",{children:[f.jsx(tt,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),f.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 $b=e=>e==="default",E1=e=>e.replace(/\[.*\]$/,"");function Bw(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function GV(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=E1(t);if(e.resolvedModel)return n===E1(e.resolvedModel);const r=Bw(n);return r!==""&&r===Bw(E1(e.value))}function KV(e,t){if(t)return e.filter(n=>!$b(n.value)).find(n=>GV(n,t))}function $R({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:s,className:a}){const l=KV(e,t)??(t?void 0:e.find(u=>$b(u.value)));return f.jsxs(Ai,{items:e.map(u=>({value:u.value,label:u.displayName})),value:l?.value??null,onValueChange:u=>{typeof u!="string"||u===l?.value||n($b(u)?void 0:u)},disabled:s,children:[f.jsx(Ri,{"aria-label":"Model",className:ye(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:f.jsx("span",{className:ye("truncate",r==="toolbar"&&"font-mono text-label"),children:f.jsx(_i,{placeholder:t??"model"})})}),f.jsx(Ii,{className:"min-w-72",children:e.map(u=>f.jsxs(qs,{value:u.value,children:[f.jsx(Vs,{children:f.jsx("span",{className:"font-medium",children:u.displayName})}),u.description?f.jsx("span",{className:"text-label text-fg-4",children:u.description}):null]},u.value))})]})}const fd=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:z_},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:j_},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:RB},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:vU},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:Wz},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:ql,dangerous:!0}],XV=e=>fd.find(t=>t.value===e);function WV(e,t){return(e?fd.filter(r=>e.includes(r.value)):fd).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 Fy({mode:e,onModeChange:t,modes:n,canBypass:r,variant:s="toolbar",disabled:a,className:l}){const u=e==="bypassPermissions",d=n?fd.filter(m=>n.includes(m.value)):fd,h=m=>m.value==="bypassPermissions"&&r===!1;return f.jsxs(Ai,{items:d.map(m=>({value:m.value,label:m.label})),value:e??null,onValueChange:m=>{typeof m=="string"&&m!==e&&t(m)},disabled:a,children:[f.jsx(Ri,{"aria-label":"Permission mode",className:ye(s==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",u?"text-danger":s==="toolbar"?"text-fg-3":void 0,l),children:f.jsx("span",{className:ye("truncate",s==="toolbar"&&"text-label"),children:f.jsx(_i,{placeholder:"permissions"})})}),f.jsx(Ii,{className:"min-w-64",children:d.map(m=>{const p=h(m);return f.jsxs(qs,{value:m.value,disabled:p,children:[f.jsx(Vs,{children:f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(m.icon,{className:ye("size-3.5 shrink-0",m.dangerous?"text-danger":"text-fg-3")}),f.jsx("span",{className:ye("font-medium",m.dangerous&&"text-danger"),children:m.label})]})}),f.jsx("span",{className:ye("pl-5.5 text-label",p?"text-fg-4":m.dangerous?"text-danger/80":"text-fg-4"),children:p?"Only available to a session started in this mode":m.description})]},m.value)})})]})}function VR(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return Ib;case"Read":return Iy;case"Write":return tU;case"Edit":case"MultiEdit":case"NotebookEdit":return kz;case"Glob":return GB;case"Grep":return tm;case"WebFetch":return CB;case"WebSearch":return fw;case"Task":case"Agent":return jy;case"TodoWrite":return Jz;case"Skill":return nm;case"AskUserQuestion":return F_;case"CodexCommand":return Ib;case"CodexFileChange":return zB;case"CodexWebSearch":return fw;case"CodexImageGeneration":case"CodexImageView":return lz;default:return e.startsWith("mcp__")?jz:bU}}function QV(e){switch(e){case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":case"Update":case"CodexFileChange":return!0;default:return!1}}const lm=(function(e){if(e==null)return tq;if(typeof e=="function")return um(e);if(typeof e=="object")return Array.isArray(e)?ZV(e):JV(e);if(typeof e=="string")return eq(e);throw new Error("Expected function, string, or object as test")});function ZV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lm(e[n]);return um(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function JV(e){const t=e;return um(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function eq(e){return um(t);function t(n){return n&&n.type===e}}function um(e){return t;function t(n,r,s){return!!(nq(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function tq(){return!0}function nq(e){return e!==null&&typeof e=="object"&&"type"in e}const qR=[],Lc=!0,Vb=!1,Dl="skip";function $y(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=lm(s),l=r?-1:1;u(e,void 0,[])();function u(d,h,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=qR,E,A,w;if((!t||a(d,h,m[m.length-1]||void 0))&&(x=rq(n(d,m)),x[0]===Vb))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==Dl)for(A=(r?S.children.length:-1)+l,w=m.concat(S);A>-1&&A<S.children.length;){const k=S.children[A];if(E=u(k,A,w)(),E[0]===Vb)return E;A=typeof E[1]=="number"?E[1]:A+l}}return x}}}function rq(e){return Array.isArray(e)?e:typeof e=="number"?[Lc,e]:e==null?qR:[e]}function Ys(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),$y(e,a,u,s);function u(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return l(d,p,m)}}const ru={indicator:"indicator",textOnly:"text-only",remove:"remove"};function sq({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:u=ru.indicator,imageBlockPolicy:d=ru.indicator}){const h=t.length&&!t.every(p=>p==="*"),m=n.length&&!n.every(p=>p==="*");if(!e&&(h||m))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return p=>{const b=cq(e,t,n,r,s,a,l,u,d);YR(p),Ys(p,b)}}function zw(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 iq(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const aq=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),oq=new Set(["javascript:","data:","file:","vbscript:"]);function Uw(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 m=e.substring(5);if(m&&m.length>0&&m!=="invalid")return e}}catch{return null}return null}const l=zw(e,n);if(!l||oq.has(l.protocol)||!(aq.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=iq(e);return l&&t.some(h=>{const m=zw(h,n);return!m||m.origin!==l.origin?!1:l.href.startsWith(m.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 YR(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)YR(t)}}const T1=Symbol("node-seen");function lq(e,t,n){return t===ru.remove?{type:"remove"}:t===ru.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 uq(e,t,n){if(t===ru.remove)return{type:"remove"};if(t===ru.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 cq=(e,t,n,r,s,a,l,u,d)=>{const h=(m,p,b)=>{if(m.type!=="element"||m[T1])return Lc;if(m.tagName==="a"){const x=Uw(m.properties.href,t,e,!1,!1,s);if(x===null){if(m[T1]=!0,Ys(m,h),b&&typeof p=="number"){const E=lq(m,u,l);if(E.type==="remove")return b.children.splice(p,1),[Dl,p];b.children[p]=E.element}return Dl}else return m.properties.href=x,m.properties.target="_blank",m.properties.rel="noopener noreferrer",Lc}if(m.tagName==="img"){const x=Uw(m.properties.src,n,e,r,!0,s);if(x===null){if(m[T1]=!0,Ys(m,h),b&&typeof p=="number"){const E=uq(m,d,a);if(E.type==="remove")return b.children.splice(p,1),[Dl,p];b.children[p]=E.element}return Dl}else return m.properties.src=x,Lc}return Lc};return h},GR=-1,cm=0,Fc=1,hp=2,Vy=3,qy=4,Yy=5,Gy=6,KR=7,XR=8,WR=typeof self=="object"?self:globalThis,Hw=(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 WR[e](t)},dq=(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 cm:case GR:return n(l,s);case Fc:{const u=n([],s);for(const d of l)u.push(r(d));return u}case hp:{const u=n({},s);for(const[d,h]of l)u[r(d)]=r(h);return u}case Vy:return n(new Date(l),s);case qy:{const{source:u,flags:d}=l;return n(new RegExp(u,d),s)}case Yy:{const u=n(new Map,s);for(const[d,h]of l)u.set(r(d),r(h));return u}case Gy:{const u=n(new Set,s);for(const d of l)u.add(r(d));return u}case KR:{const{name:u,message:d}=l;return n(typeof WR[u]=="function"?Hw(u,d):new Error(d),s)}case XR: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:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(Hw(a,l),s)};return r},Fw=e=>dq(new Map,e)(0),no="",{toString:fq}={},{keys:hq}=Object,bc=e=>{const t=typeof e;if(t!=="object"||!e)return[cm,t];const n=fq.call(e).slice(8,-1);switch(n){case"Array":return[Fc,no];case"Object":return[hp,no];case"Date":return[Vy,no];case"RegExp":return[qy,no];case"Map":return[Yy,no];case"Set":return[Gy,no];case"DataView":return[Fc,n]}return n.includes("Array")?[Fc,n]:e instanceof Error?[KR,e.name||"Error"]:[hp,n]},vh=([e,t])=>e===cm&&(t==="function"||t==="symbol"),pq=(e,t,n,r)=>{const s=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=bc(l);switch(u){case cm:{let m=l;switch(d){case"bigint":u=XR,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([GR],l)}return s([u,m],l)}case Fc:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),s([d,[...b]],l)}const m=[],p=s([u,m],l);for(const b of l)m.push(a(b));return p}case hp:{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 m=[],p=s([u,m],l);for(const b of hq(l))(e||!vh(bc(l[b])))&&m.push([a(b),a(l[b])]);return p}case Vy:return s([u,isNaN(l.getTime())?no:l.toISOString()],l);case qy:{const{source:m,flags:p}=l;return s([u,{source:m,flags:p}],l)}case Yy:{const m=[],p=s([u,m],l);for(const[b,x]of l)(e||!(vh(bc(b))||vh(bc(x))))&&m.push([a(b),a(x)]);return p}case Gy:{const m=[],p=s([u,m],l);for(const b of l)(e||!vh(bc(b)))&&m.push(a(b));return p}}const{message:h}=l;return s([u,{name:d,message:h}],l)};return a},$w=(e,{json:t,lossy:n}={})=>{const r=[];return pq(!(t||n),!!t,new Map,r)(e),r},wo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Fw($w(e,t)):structuredClone(e):(e,t)=>Fw($w(e,t));class kd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}kd.prototype.normal={};kd.prototype.property={};kd.prototype.space=void 0;function QR(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new kd(n,r,t)}function hd(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 mq=0;const mt=Po(),Ln=Po(),qb=Po(),He=Po(),rn=Po(),mo=Po(),Fr=Po();function Po(){return 2**++mq}const Yb=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:Ln,commaOrSpaceSeparated:Fr,commaSeparated:mo,number:He,overloadedBoolean:qb,spaceSeparated:rn},Symbol.toStringTag,{value:"Module"})),S1=Object.keys(Yb);class Ky extends Lr{constructor(t,n,r,s){let a=-1;if(super(t,n),Vw(this,"space",s),typeof r=="number")for(;++a<S1.length;){const l=S1[a];Vw(this,S1[a],(r&Yb[l])===Yb[l])}}}Ky.prototype.defined=!0;function Vw(e,t,n){n&&(e[t]=n)}function hu(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Ky(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hd(r)]=r,n[hd(a.attribute)]=r}return new kd(t,n,e.space)}const ZR=hu({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:rn,ariaCurrent:null,ariaDescribedBy:rn,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:rn,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:rn,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rn,ariaLevel:He,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:rn,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:rn,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:Ln,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 JR(e,t){return t in e?e[t]:t}function e4(e,t){return JR(e,t.toLowerCase())}const gq=hu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mo,acceptCharset:rn,accessKey:rn,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alpha:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:rn,autoFocus:mt,autoPlay:mt,blocking:rn,capture:null,charSet:null,checked:mt,cite:null,className:rn,closedBy:null,colorSpace:null,cols:He,colSpan:He,command:null,commandFor:null,content:null,contentEditable:Ln,controls:mt,controlsList:rn,coords:He|mo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:qb,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:rn,height:He,hidden:qb,high:He,href:null,hrefLang:null,htmlFor:rn,httpEquiv:rn,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:rn,itemRef:rn,itemScope:mt,itemType:rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,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:mt,optimum:He,pattern:null,ping:rn,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:rn,required:mt,reversed:mt,rows:He,rowSpan:He,sandbox:rn,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootCustomElementRegistry:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shadowRootSerializable:mt,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:Ln,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:mt,useMap:null,value:Ln,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rn,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:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:Ln,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:mt,disablePictureInPicture:mt,disableRemotePlayback:mt,exportParts:mo,part:rn,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:e4}),bq=hu({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:rn,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:mt,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:mo,g2:mo,glyphName:mo,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:rn,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:JR}),t4=hu({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()}}),n4=hu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e4}),r4=hu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xq={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"},yq=/[A-Z]/g,qw=/-[a-z]/g,vq=/^data[-\w.:]+$/i;function dm(e,t){const n=hd(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"&&vq.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(qw,Tq);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!qw.test(a)){let l=a.replace(yq,Eq);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Ky}return new s(r,t)}function Eq(e){return"-"+e.toLowerCase()}function Tq(e){return e.charAt(1).toUpperCase()}const Nd=QR([ZR,gq,t4,n4,r4],"html"),Ra=QR([ZR,bq,t4,n4,r4],"svg");function Yw(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 s4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Gw=/[#.]/g;function Sq(e,t){const n=e||"",r={};let s=0,a,l;for(;s<n.length;){Gw.lastIndex=s;const u=Gw.exec(n),d=n.slice(s,u?u.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),u&&(a=u[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function Kw(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function i4(e){return e.join(" ").trim()}function a4(e,t,n){const r=n?Nq(n):void 0;function s(a,l,...u){let d;if(a==null){d={type:"root",children:[]};const h=l;u.unshift(h)}else{d=Sq(a,t);const h=d.tagName.toLowerCase(),m=r?r.get(h):void 0;if(d.tagName=m||h,Cq(l))u.unshift(l);else for(const[p,b]of Object.entries(l))wq(e,d.properties,p,b)}for(const h of u)Gb(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function Cq(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 wq(e,t,n,r){const s=dm(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=Kw(r):s.commaSeparated?a=Yw(r):s.commaOrSpaceSeparated?a=Kw(Yw(r).join(" ")):a=Xw(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?kq(r):String(r);if(Array.isArray(a)){const l=[];for(const u of a)l.push(Xw(s,s.property,u));a=l}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function Gb(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)Gb(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Gb(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Xw(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||hd(n)===hd(t)))return!0}return n}function kq(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Nq(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Aq=["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"],_q=a4(Nd,"div"),Rq=a4(Ra,"g",Aq);function Iq(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 u=n[l];if(u===void 0){const d=Ww(t,n[l-1]);u=d===-1?t.length+1:d+1,n[l]=u}if(u>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 u=n[n.length-1],d=Ww(t,u),h=d===-1?t.length+1:d+1;if(u===h)break;n.push(h)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function Ww(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
569
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const co={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/"},o4={}.hasOwnProperty,Oq=Object.prototype;function Mq(e,t){const n=t||{};return Xy({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ra:Nd,verbose:n.verbose||!1},e)}function Xy(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Hh(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:l4(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),l=Iq(a),u=l.toPoint(0),d=l.toPoint(a.length);n.position={start:u,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Hh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Hh(e,r,n),n}default:return n=Lq(e,t),n}}function l4(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Xy(e,t[n]);r.push(s)}return r}function Lq(e,t){const n=e.schema;e.schema=t.namespaceURI===co.svg?Ra:Nd;let r=-1;const s={};for(;++r<t.attrs.length;){const u=t.attrs[r],d=(u.prefix?u.prefix+":":"")+u.name;o4.call(Oq,d)||(s[d]=u.value)}const l=(e.schema.space==="svg"?Rq:_q)(t.tagName,s,l4(e,t.childNodes));if(Hh(e,t,l),l.tagName==="template"){const u=t,d=u.sourceCodeLocation,h=d&&d.startTag&&jl(d.startTag),m=d&&d.endTag&&jl(d.endTag),p=Xy(e,u.content);h&&m&&e.file&&(p.position={start:h.end,end:m.start}),l.content=p}return e.schema=n,l}function Hh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Dq(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Dq(e,t,n){const r=jl(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)o4.call(n.attrs,l)&&(a[dm(e.schema,l).property]=jl(n.attrs[l]));n.startTag;const u=jl(n.startTag),d=n.endTag?jl(n.endTag):void 0,h={opening:u};d&&(h.closing=d),h.properties=a,t.data={position:h}}}return r}function jl(e){const t=Qw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Qw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Qw(e){return e.line&&e.column?e:void 0}const Zw={}.hasOwnProperty;function u4(e,t){const n=t||{};function r(s,...a){let l=r.invalid;const u=r.handlers;if(s&&Zw.call(s,e)){const d=String(s[e]);l=Zw.call(u,d)?u[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 jq={},Pq={}.hasOwnProperty,c4=u4("type",{handlers:{root:zq,element:Vq,text:Fq,comment:$q,doctype:Hq}});function Bq(e,t){const r=(t||jq).space;return c4(e,r==="svg"?Ra:Nd)}function zq(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Wy(e.children,n,t),pu(e,n),n}function Uq(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Wy(e.children,n,t),pu(e,n),n}function Hq(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return pu(e,t),t}function Fq(e){const t={nodeName:"#text",value:e.value,parentNode:null};return pu(e,t),t}function $q(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return pu(e,t),t}function Vq(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ra);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&Pq.call(e.properties,a)){const d=qq(r,a,e.properties[a]);d&&s.push(d)}}const l=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:co[l],childNodes:[],parentNode:null};return u.childNodes=Wy(e.children,u,r),pu(e,u),e.tagName==="template"&&e.content&&(u.content=Uq(e.content,r)),u}function qq(e,t,n){const r=dm(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?s4(n):i4(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=co[r.space]}return s}function Wy(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=c4(e[r],n);a.parentNode=t,s.push(a)}return s}function pu(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 Yq=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Gq=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]),pn="�";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 kr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function d4(e){return e>=55296&&e<=57343}function Kq(e){return e>=56320&&e<=57343}function Xq(e,t){return(e-55296)*1024+9216+t}function f4(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function h4(e){return e>=64976&&e<=65007||Gq.has(e)}var we;(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"})(we||(we={}));const Wq=65536;class Qq{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=Wq,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,u=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:u,endOffset:u}}_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(Kq(n))return this.pos++,this._addGap(),Xq(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,q.EOF;return this._err(we.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,d4(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){f4(t)?this._err(we.controlCharacterInInputStream):h4(t)&&this._err(we.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 p4(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 Zq=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))),Jq=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 eY(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Jq.get(e))!==null&&t!==void 0?t:e}var Yn;(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"})(Yn||(Yn={}));const tY=32;var ga;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ga||(ga={}));function Kb(e){return e>=Yn.ZERO&&e<=Yn.NINE}function nY(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function rY(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||Kb(e)}function sY(e){return e===Yn.EQUALS||rY(e)}var $n;(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"})($n||($n={}));var bi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(bi||(bi={}));class iY{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=$n.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bi.Strict}startEntity(t){this.decodeMode=t,this.state=$n.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case $n.EntityStart:return t.charCodeAt(n)===Yn.NUM?(this.state=$n.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=$n.NamedEntity,this.stateNamedEntity(t,n));case $n.NumericStart:return this.stateNumericStart(t,n);case $n.NumericDecimal:return this.stateNumericDecimal(t,n);case $n.NumericHex:return this.stateNumericHex(t,n);case $n.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|tY)===Yn.LOWER_X?(this.state=$n.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=$n.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(Kb(s)||nY(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(Kb(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===Yn.SEMI)this.consumed+=1;else if(this.decodeMode===bi.Strict)return 0;return this.emitCodePoint(eY(this.result),this.consumed),this.errors&&(t!==Yn.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&ga.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=aY(r,s,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===bi.Attribute&&(a===0||sY(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ga.VALUE_LENGTH)>>14,a!==0){if(l===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bi.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]&ga.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]&~ga.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case $n.NamedEntity:return this.result!==0&&(this.decodeMode!==bi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $n.NumericDecimal:return this.emitNumericEntity(0,2);case $n.NumericHex:return this.emitNumericEntity(0,3);case $n.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $n.EntityStart:return 0}}}function aY(e,t,n,r){const s=(t&ga.BRANCH_LENGTH)>>7,a=t&ga.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,u=l+s-1;for(;l<=u;){const d=l+u>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)u=d-1;else return e[d+s]}return-1}var Me;(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/"})(Me||(Me={}));var go;(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"})(go||(go={}));var as;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(as||(as={}));var me;(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"})(me||(me={}));var C;(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"})(C||(C={}));const oY=new Map([[me.A,C.A],[me.ADDRESS,C.ADDRESS],[me.ANNOTATION_XML,C.ANNOTATION_XML],[me.APPLET,C.APPLET],[me.AREA,C.AREA],[me.ARTICLE,C.ARTICLE],[me.ASIDE,C.ASIDE],[me.B,C.B],[me.BASE,C.BASE],[me.BASEFONT,C.BASEFONT],[me.BGSOUND,C.BGSOUND],[me.BIG,C.BIG],[me.BLOCKQUOTE,C.BLOCKQUOTE],[me.BODY,C.BODY],[me.BR,C.BR],[me.BUTTON,C.BUTTON],[me.CAPTION,C.CAPTION],[me.CENTER,C.CENTER],[me.CODE,C.CODE],[me.COL,C.COL],[me.COLGROUP,C.COLGROUP],[me.DD,C.DD],[me.DESC,C.DESC],[me.DETAILS,C.DETAILS],[me.DIALOG,C.DIALOG],[me.DIR,C.DIR],[me.DIV,C.DIV],[me.DL,C.DL],[me.DT,C.DT],[me.EM,C.EM],[me.EMBED,C.EMBED],[me.FIELDSET,C.FIELDSET],[me.FIGCAPTION,C.FIGCAPTION],[me.FIGURE,C.FIGURE],[me.FONT,C.FONT],[me.FOOTER,C.FOOTER],[me.FOREIGN_OBJECT,C.FOREIGN_OBJECT],[me.FORM,C.FORM],[me.FRAME,C.FRAME],[me.FRAMESET,C.FRAMESET],[me.H1,C.H1],[me.H2,C.H2],[me.H3,C.H3],[me.H4,C.H4],[me.H5,C.H5],[me.H6,C.H6],[me.HEAD,C.HEAD],[me.HEADER,C.HEADER],[me.HGROUP,C.HGROUP],[me.HR,C.HR],[me.HTML,C.HTML],[me.I,C.I],[me.IMG,C.IMG],[me.IMAGE,C.IMAGE],[me.INPUT,C.INPUT],[me.IFRAME,C.IFRAME],[me.KEYGEN,C.KEYGEN],[me.LABEL,C.LABEL],[me.LI,C.LI],[me.LINK,C.LINK],[me.LISTING,C.LISTING],[me.MAIN,C.MAIN],[me.MALIGNMARK,C.MALIGNMARK],[me.MARQUEE,C.MARQUEE],[me.MATH,C.MATH],[me.MENU,C.MENU],[me.META,C.META],[me.MGLYPH,C.MGLYPH],[me.MI,C.MI],[me.MO,C.MO],[me.MN,C.MN],[me.MS,C.MS],[me.MTEXT,C.MTEXT],[me.NAV,C.NAV],[me.NOBR,C.NOBR],[me.NOFRAMES,C.NOFRAMES],[me.NOEMBED,C.NOEMBED],[me.NOSCRIPT,C.NOSCRIPT],[me.OBJECT,C.OBJECT],[me.OL,C.OL],[me.OPTGROUP,C.OPTGROUP],[me.OPTION,C.OPTION],[me.P,C.P],[me.PARAM,C.PARAM],[me.PLAINTEXT,C.PLAINTEXT],[me.PRE,C.PRE],[me.RB,C.RB],[me.RP,C.RP],[me.RT,C.RT],[me.RTC,C.RTC],[me.RUBY,C.RUBY],[me.S,C.S],[me.SCRIPT,C.SCRIPT],[me.SEARCH,C.SEARCH],[me.SECTION,C.SECTION],[me.SELECT,C.SELECT],[me.SOURCE,C.SOURCE],[me.SMALL,C.SMALL],[me.SPAN,C.SPAN],[me.STRIKE,C.STRIKE],[me.STRONG,C.STRONG],[me.STYLE,C.STYLE],[me.SUB,C.SUB],[me.SUMMARY,C.SUMMARY],[me.SUP,C.SUP],[me.TABLE,C.TABLE],[me.TBODY,C.TBODY],[me.TEMPLATE,C.TEMPLATE],[me.TEXTAREA,C.TEXTAREA],[me.TFOOT,C.TFOOT],[me.TD,C.TD],[me.TH,C.TH],[me.THEAD,C.THEAD],[me.TITLE,C.TITLE],[me.TR,C.TR],[me.TRACK,C.TRACK],[me.TT,C.TT],[me.U,C.U],[me.UL,C.UL],[me.SVG,C.SVG],[me.VAR,C.VAR],[me.WBR,C.WBR],[me.XMP,C.XMP]]);function mu(e){var t;return(t=oY.get(e))!==null&&t!==void 0?t:C.UNKNOWN}const Be=C,lY={[Me.HTML]:new Set([Be.ADDRESS,Be.APPLET,Be.AREA,Be.ARTICLE,Be.ASIDE,Be.BASE,Be.BASEFONT,Be.BGSOUND,Be.BLOCKQUOTE,Be.BODY,Be.BR,Be.BUTTON,Be.CAPTION,Be.CENTER,Be.COL,Be.COLGROUP,Be.DD,Be.DETAILS,Be.DIR,Be.DIV,Be.DL,Be.DT,Be.EMBED,Be.FIELDSET,Be.FIGCAPTION,Be.FIGURE,Be.FOOTER,Be.FORM,Be.FRAME,Be.FRAMESET,Be.H1,Be.H2,Be.H3,Be.H4,Be.H5,Be.H6,Be.HEAD,Be.HEADER,Be.HGROUP,Be.HR,Be.HTML,Be.IFRAME,Be.IMG,Be.INPUT,Be.LI,Be.LINK,Be.LISTING,Be.MAIN,Be.MARQUEE,Be.MENU,Be.META,Be.NAV,Be.NOEMBED,Be.NOFRAMES,Be.NOSCRIPT,Be.OBJECT,Be.OL,Be.P,Be.PARAM,Be.PLAINTEXT,Be.PRE,Be.SCRIPT,Be.SECTION,Be.SELECT,Be.SOURCE,Be.STYLE,Be.SUMMARY,Be.TABLE,Be.TBODY,Be.TD,Be.TEMPLATE,Be.TEXTAREA,Be.TFOOT,Be.TH,Be.THEAD,Be.TITLE,Be.TR,Be.TRACK,Be.UL,Be.WBR,Be.XMP]),[Me.MATHML]:new Set([Be.MI,Be.MO,Be.MN,Be.MS,Be.MTEXT,Be.ANNOTATION_XML]),[Me.SVG]:new Set([Be.TITLE,Be.FOREIGN_OBJECT,Be.DESC]),[Me.XLINK]:new Set,[Me.XML]:new Set,[Me.XMLNS]:new Set},Xb=new Set([Be.H1,Be.H2,Be.H3,Be.H4,Be.H5,Be.H6]);me.STYLE,me.SCRIPT,me.XMP,me.IFRAME,me.NOEMBED,me.NOFRAMES,me.PLAINTEXT;var W;(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"})(W||(W={}));const Nn={DATA:W.DATA,RCDATA:W.RCDATA,RAWTEXT:W.RAWTEXT,SCRIPT_DATA:W.SCRIPT_DATA,PLAINTEXT:W.PLAINTEXT,CDATA_SECTION:W.CDATA_SECTION};function uY(e){return e>=q.DIGIT_0&&e<=q.DIGIT_9}function Dc(e){return e>=q.LATIN_CAPITAL_A&&e<=q.LATIN_CAPITAL_Z}function cY(e){return e>=q.LATIN_SMALL_A&&e<=q.LATIN_SMALL_Z}function ua(e){return cY(e)||Dc(e)}function Jw(e){return ua(e)||uY(e)}function Eh(e){return e+32}function m4(e){return e===q.SPACE||e===q.LINE_FEED||e===q.TABULATION||e===q.FORM_FEED}function e3(e){return m4(e)||e===q.SOLIDUS||e===q.GREATER_THAN_SIGN}function dY(e){return e===q.NULL?we.nullCharacterReference:e>1114111?we.characterReferenceOutsideUnicodeRange:d4(e)?we.surrogateCharacterReference:h4(e)?we.noncharacterCharacterReference:f4(e)||e===q.CARRIAGE_RETURN?we.controlCharacterReference:null}class fY{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=W.DATA,this.returnState=W.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Qq(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new iY(Zq,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(we.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(we.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=dY(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:C.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ct.END_TAG,tagName:"",tagID:C.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(p4(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(we.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=mu(t.tagName),t.type===Ct.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(we.endTagWithAttributes),t.selfClosing&&this._err(we.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=m4(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=W.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bi.Attribute:bi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===W.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===W.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===W.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case W.DATA:{this._stateData(t);break}case W.RCDATA:{this._stateRcdata(t);break}case W.RAWTEXT:{this._stateRawtext(t);break}case W.SCRIPT_DATA:{this._stateScriptData(t);break}case W.PLAINTEXT:{this._statePlaintext(t);break}case W.TAG_OPEN:{this._stateTagOpen(t);break}case W.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case W.TAG_NAME:{this._stateTagName(t);break}case W.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case W.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case W.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case W.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case W.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case W.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case W.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case W.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case W.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case W.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case W.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case W.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case W.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case W.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case W.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case W.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case W.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case W.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case W.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case W.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case W.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case W.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case W.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case W.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case W.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case W.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case W.BOGUS_COMMENT:{this._stateBogusComment(t);break}case W.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case W.COMMENT_START:{this._stateCommentStart(t);break}case W.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case W.COMMENT:{this._stateComment(t);break}case W.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case W.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case W.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case W.COMMENT_END:{this._stateCommentEnd(t);break}case W.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case W.DOCTYPE:{this._stateDoctype(t);break}case W.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case W.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case W.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case W.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case W.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case W.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case W.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case W.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case W.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case W.CDATA_SECTION:{this._stateCdataSection(t);break}case W.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case W.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case W.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case W.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case q.LESS_THAN_SIGN:{this.state=W.TAG_OPEN;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(we.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=W.RCDATA_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case q.LESS_THAN_SIGN:{this.state=W.RAWTEXT_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ua(t))this._createStartTagToken(),this.state=W.TAG_NAME,this._stateTagName(t);else switch(t){case q.EXCLAMATION_MARK:{this.state=W.MARKUP_DECLARATION_OPEN;break}case q.SOLIDUS:{this.state=W.END_TAG_OPEN;break}case q.QUESTION_MARK:{this._err(we.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t);break}case q.EOF:{this._err(we.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(we.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=W.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ua(t))this._createEndTagToken(),this.state=W.TAG_NAME,this._stateTagName(t);else switch(t){case q.GREATER_THAN_SIGN:{this._err(we.missingEndTagName),this.state=W.DATA;break}case q.EOF:{this._err(we.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(we.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=W.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=W.BEFORE_ATTRIBUTE_NAME;break}case q.SOLIDUS:{this.state=W.SELF_CLOSING_START_TAG;break}case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.tagName+=pn;break}case q.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Dc(t)?Eh(t):t)}}_stateRcdataLessThanSign(t){t===q.SOLIDUS?this.state=W.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=W.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ua(t)?(this.state=W.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=W.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=W.BEFORE_ATTRIBUTE_NAME,!1;case q.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=W.SELF_CLOSING_START_TAG,!1;case q.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=W.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===q.SOLIDUS?this.state=W.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ua(t)?(this.state=W.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case q.SOLIDUS:{this.state=W.SCRIPT_DATA_END_TAG_OPEN;break}case q.EXCLAMATION_MARK:{this.state=W.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=W.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ua(t)?(this.state=W.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===q.HYPHEN_MINUS?(this.state=W.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===q.HYPHEN_MINUS?(this.state=W.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=W.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case q.HYPHEN_MINUS:{this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case q.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_ESCAPED,this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===q.SOLIDUS?this.state=W.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ua(t)?(this._emitChars("<"),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ua(t)?(this.state=W.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(kr.SCRIPT,!1)&&e3(this.preprocessor.peek(kr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<kr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=W.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.NULL:{this._err(we.unexpectedNullCharacter),this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case q.HYPHEN_MINUS:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case q.LESS_THAN_SIGN:{this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.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=W.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case q.GREATER_THAN_SIGN:{this.state=W.SCRIPT_DATA,this._emitChars(">");break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(pn);break}case q.EOF:{this._err(we.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===q.SOLIDUS?(this.state=W.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=W.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(kr.SCRIPT,!1)&&e3(this.preprocessor.peek(kr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<kr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=W.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=W.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=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case q.EQUALS_SIGN:{this._err(we.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=W.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=W.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=W.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case q.EQUALS_SIGN:{this._leaveAttrName(),this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:{this._err(we.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.name+=pn;break}default:this.currentAttr.name+=String.fromCodePoint(Dc(t)?Eh(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=W.SELF_CLOSING_START_TAG;break}case q.EQUALS_SIGN:{this.state=W.BEFORE_ATTRIBUTE_VALUE;break}case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=W.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=W.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this.state=W.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(we.missingAttributeValue),this.state=W.DATA,this.emitCurrentTagToken();break}default:this.state=W.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case q.QUOTATION_MARK:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=pn;break}case q.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case q.APOSTROPHE:{this.state=W.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=pn;break}case q.EOF:{this._err(we.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=W.BEFORE_ATTRIBUTE_NAME;break}case q.AMPERSAND:{this._startCharacterReference();break}case q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case q.NULL:{this._err(we.unexpectedNullCharacter),this.currentAttr.value+=pn;break}case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:case q.EQUALS_SIGN:case q.GRAVE_ACCENT:{this._err(we.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case q.EOF:{this._err(we.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=W.BEFORE_ATTRIBUTE_NAME;break}case q.SOLIDUS:{this._leaveAttrValue(),this.state=W.SELF_CLOSING_START_TAG;break}case q.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=W.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.missingWhitespaceBetweenAttributes),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case q.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=W.DATA,this.emitCurrentTagToken();break}case q.EOF:{this._err(we.eofInTag),this._emitEOFToken();break}default:this._err(we.unexpectedSolidusInTag),this.state=W.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case q.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.data+=pn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(kr.DASH_DASH,!0)?(this._createCommentToken(kr.DASH_DASH.length+1),this.state=W.COMMENT_START):this._consumeSequenceIfMatch(kr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(kr.DOCTYPE.length+1),this.state=W.DOCTYPE):this._consumeSequenceIfMatch(kr.CDATA_START,!0)?this.inForeignNode?this.state=W.CDATA_SECTION:(this._err(we.cdataInHtmlContent),this._createCommentToken(kr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=W.BOGUS_COMMENT):this._ensureHibernation()||(this._err(we.incorrectlyOpenedComment),this._createCommentToken(2),this.state=W.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case q.HYPHEN_MINUS:{this.state=W.COMMENT_START_DASH;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=W.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=W.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptClosingOfEmptyComment),this.state=W.DATA,this.emitCurrentComment(n);break}case q.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=W.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=W.COMMENT_END_DASH;break}case q.LESS_THAN_SIGN:{n.data+="<",this.state=W.COMMENT_LESS_THAN_SIGN;break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.data+=pn;break}case q.EOF:{this._err(we.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=W.COMMENT_LESS_THAN_SIGN_BANG;break}case q.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=W.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===q.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=W.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===q.HYPHEN_MINUS?this.state=W.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=W.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==q.GREATER_THAN_SIGN&&t!==q.EOF&&this._err(we.nestedComment),this.state=W.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{this.state=W.COMMENT_END;break}case q.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=W.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentComment(n);break}case q.EXCLAMATION_MARK:{this.state=W.COMMENT_END_BANG;break}case q.HYPHEN_MINUS:{n.data+="-";break}case q.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=W.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case q.HYPHEN_MINUS:{n.data+="--!",this.state=W.COMMENT_END_DASH;break}case q.GREATER_THAN_SIGN:{this._err(we.incorrectlyClosedComment),this.state=W.DATA,this.emitCurrentComment(n);break}case q.EOF:{this._err(we.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=W.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:{this.state=W.BEFORE_DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case q.EOF:{this._err(we.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingWhitespaceBeforeDoctypeName),this.state=W.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Dc(t))this._createDoctypeToken(String.fromCharCode(Eh(t))),this.state=W.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(we.unexpectedNullCharacter),this._createDoctypeToken(pn),this.state=W.DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this._err(we.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.EOF:{this._err(we.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=W.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=W.AFTER_DOCTYPE_NAME;break}case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.name+=pn;break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Dc(t)?Eh(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=W.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(kr.PUBLIC,!1)?this.state=W.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(kr.SYSTEM,!1)?this.state=W.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(we.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=W.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=W.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.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=W.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.publicId="",this.state=W.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(we.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case q.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=pn;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.EOF:{this._err(we.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=W.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.publicId+=pn;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.EOF:{this._err(we.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=W.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case q.GREATER_THAN_SIGN:{this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.QUOTATION_MARK:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(we.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.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=W.DATA;break}case q.QUOTATION_MARK:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.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=W.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.QUOTATION_MARK:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{this._err(we.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.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=W.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case q.APOSTROPHE:{n.systemId="",this.state=W.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case q.GREATER_THAN_SIGN:{this._err(we.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.DATA,this.emitCurrentDoctype(n);break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case q.QUOTATION_MARK:{this.state=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=pn;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.EOF:{this._err(we.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=W.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case q.NULL:{this._err(we.unexpectedNullCharacter),n.systemId+=pn;break}case q.GREATER_THAN_SIGN:{this._err(we.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.EOF:{this._err(we.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=W.DATA;break}case q.EOF:{this._err(we.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(we.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=W.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case q.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=W.DATA;break}case q.NULL:{this._err(we.unexpectedNullCharacter);break}case q.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case q.RIGHT_SQUARE_BRACKET:{this.state=W.CDATA_SECTION_BRACKET;break}case q.EOF:{this._err(we.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===q.RIGHT_SQUARE_BRACKET?this.state=W.CDATA_SECTION_END:(this._emitChars("]"),this.state=W.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case q.GREATER_THAN_SIGN:{this.state=W.DATA;break}case q.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=W.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()&&Jw(this.preprocessor.peek(1))?W.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Jw(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===q.SEMICOLON&&this._err(we.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const g4=new Set([C.DD,C.DT,C.LI,C.OPTGROUP,C.OPTION,C.P,C.RB,C.RP,C.RT,C.RTC]),t3=new Set([...g4,C.CAPTION,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]),pp=new Set([C.APPLET,C.CAPTION,C.HTML,C.MARQUEE,C.OBJECT,C.TABLE,C.TD,C.TEMPLATE,C.TH]),hY=new Set([...pp,C.OL,C.UL]),pY=new Set([...pp,C.BUTTON]),n3=new Set([C.ANNOTATION_XML,C.MI,C.MN,C.MO,C.MS,C.MTEXT]),r3=new Set([C.DESC,C.FOREIGN_OBJECT,C.TITLE]),mY=new Set([C.TR,C.TEMPLATE,C.HTML]),gY=new Set([C.TBODY,C.TFOOT,C.THEAD,C.TEMPLATE,C.HTML]),bY=new Set([C.TABLE,C.TEMPLATE,C.HTML]),xY=new Set([C.TD,C.TH]);class yY{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=C.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===C.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Me.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])!==Me.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(Xb,Me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(xY,Me.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(bY,Me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(gY,Me.HTML)}clearBackToTableRowContext(){this.clearBackTo(mY,Me.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]===C.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]===C.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 Me.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Me.SVG:{if(r3.has(s))return!1;break}case Me.MATHML:{if(n3.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,pp)}hasInListItemScope(t){return this.hasInDynamicScope(t,hY)}hasInButtonScope(t){return this.hasInDynamicScope(t,pY)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Me.HTML:{if(Xb.has(n))return!0;if(pp.has(n))return!1;break}case Me.SVG:{if(r3.has(n))return!1;break}case Me.MATHML:{if(n3.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Me.HTML)switch(this.tagIDs[t]){case C.TBODY:case C.THEAD:case C.TFOOT:return!0;case C.TABLE:case C.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Me.HTML)switch(this.tagIDs[n]){case t:return!0;case C.OPTION:case C.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&g4.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&t3.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&t3.has(this.currentTagId);)this.pop()}}const C1=3;var Hs;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Hs||(Hs={}));const s3={type:Hs.Marker};class vY{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 u=0;u<this.entries.length;u++){const d=this.entries[u];if(d.type===Hs.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===a&&this.treeAdapter.getNamespaceURI(h)===l){const m=this.treeAdapter.getAttrList(h);m.length===s&&r.push({idx:u,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<C1)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<C1)return;const s=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const u=r[l];u.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=C1&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(s3)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Hs.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Hs.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(s3);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Hs.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Hs.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Hs.Element&&n.element===t)}}const ca={createDocument(){return{nodeName:"#document",mode:as.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};ca.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(ca.isTextNode(n)){n.value+=t;return}}ca.appendChild(e,ca.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ca.isTextNode(r)?r.value+=t:ca.insertBefore(e,ca.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}}},b4="html",EY="about:legacy-compat",TY="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",x4=["+//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//"],SY=[...x4,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],CY=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),y4=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],wY=[...y4,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function i3(e,t){return t.some(n=>e.startsWith(n))}function kY(e){return e.name===b4&&e.publicId===null&&(e.systemId===null||e.systemId===EY)}function NY(e){if(e.name!==b4)return as.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===TY)return as.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),CY.has(n))return as.QUIRKS;let r=t===null?SY:x4;if(i3(n,r))return as.QUIRKS;if(r=t===null?y4:wY,i3(n,r))return as.LIMITED_QUIRKS}return as.NO_QUIRKS}const a3={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},AY="definitionurl",_Y="definitionURL",RY=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])),IY=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Me.XMLNS}]]),OY=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])),MY=new Set([C.B,C.BIG,C.BLOCKQUOTE,C.BODY,C.BR,C.CENTER,C.CODE,C.DD,C.DIV,C.DL,C.DT,C.EM,C.EMBED,C.H1,C.H2,C.H3,C.H4,C.H5,C.H6,C.HEAD,C.HR,C.I,C.IMG,C.LI,C.LISTING,C.MENU,C.META,C.NOBR,C.OL,C.P,C.PRE,C.RUBY,C.S,C.SMALL,C.SPAN,C.STRONG,C.STRIKE,C.SUB,C.SUP,C.TABLE,C.TT,C.U,C.UL,C.VAR]);function LY(e){const t=e.tagID;return t===C.FONT&&e.attrs.some(({name:r})=>r===go.COLOR||r===go.SIZE||r===go.FACE)||MY.has(t)}function v4(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===AY){e.attrs[t].name=_Y;break}}function E4(e){for(let t=0;t<e.attrs.length;t++){const n=RY.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Qy(e){for(let t=0;t<e.attrs.length;t++){const n=IY.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 DY(e){const t=OY.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=mu(e.tagName))}function jY(e,t){return t===Me.MATHML&&(e===C.MI||e===C.MO||e===C.MN||e===C.MS||e===C.MTEXT)}function PY(e,t,n){if(t===Me.MATHML&&e===C.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===go.ENCODING){const s=n[r].value.toLowerCase();return s===a3.TEXT_HTML||s===a3.APPLICATION_XML}}return t===Me.SVG&&(e===C.FOREIGN_OBJECT||e===C.DESC||e===C.TITLE)}function BY(e,t,n,r){return(!r||r===Me.HTML)&&PY(e,t,n)||(!r||r===Me.MATHML)&&jY(e,t)}const zY="hidden",UY=8,HY=3;var re;(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"})(re||(re={}));const FY={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},T4=new Set([C.TABLE,C.TBODY,C.TFOOT,C.THEAD,C.TR]),o3={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ca,onParseError:null};class l3{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=re.INITIAL,this.originalInsertionMode=re.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={...o3,...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 fY(this.options,this),this.activeFormattingElements=new vY(this.treeAdapter),this.fragmentContextID=r?mu(this.treeAdapter.getTagName(r)):C.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new yY(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={...o3,...n};t??(t=r.treeAdapter.createElement(me.TEMPLATE,Me.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Me.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===C.TEMPLATE&&a.tmplInsertionModeStack.unshift(re.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:FY,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)===Me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Me.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=re.TEXT}switchToPlaintextParsing(){this.insertionMode=re.TEXT,this.originalInsertionMode=re.IN_BODY,this.tokenizer.state=Nn.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)===me.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Me.HTML))switch(this.fragmentContextID){case C.TITLE:case C.TEXTAREA:{this.tokenizer.state=Nn.RCDATA;break}case C.STYLE:case C.XMP:case C.IFRAME:case C.NOEMBED:case C.NOFRAMES:case C.NOSCRIPT:{this.tokenizer.state=Nn.RAWTEXT;break}case C.SCRIPT:{this.tokenizer.state=Nn.SCRIPT_DATA;break}case C.PLAINTEXT:{this.tokenizer.state=Nn.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(u=>this.treeAdapter.isDocumentTypeNode(u));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,Me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Me.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(me.HTML,Me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,C.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:h,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:m})}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===C.SVG&&this.treeAdapter.getTagName(n)===me.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===C.MGLYPH||t.tagID===C.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Me.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 BY(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Hs.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=re.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(C.P),this.openElements.popUntilTagNamePopped(C.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case C.TR:{this.insertionMode=re.IN_ROW;return}case C.TBODY:case C.THEAD:case C.TFOOT:{this.insertionMode=re.IN_TABLE_BODY;return}case C.CAPTION:{this.insertionMode=re.IN_CAPTION;return}case C.COLGROUP:{this.insertionMode=re.IN_COLUMN_GROUP;return}case C.TABLE:{this.insertionMode=re.IN_TABLE;return}case C.BODY:{this.insertionMode=re.IN_BODY;return}case C.FRAMESET:{this.insertionMode=re.IN_FRAMESET;return}case C.SELECT:{this._resetInsertionModeForSelect(t);return}case C.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case C.HTML:{this.insertionMode=this.headElement?re.AFTER_HEAD:re.BEFORE_HEAD;return}case C.TD:case C.TH:{if(t>0){this.insertionMode=re.IN_CELL;return}break}case C.HEAD:{if(t>0){this.insertionMode=re.IN_HEAD;return}break}}this.insertionMode=re.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===C.TEMPLATE)break;if(r===C.TABLE){this.insertionMode=re.IN_SELECT_IN_TABLE;return}}this.insertionMode=re.IN_SELECT}_isElementCausesFosterParenting(t){return T4.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 C.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case C.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 lY[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){xK(this,t);return}switch(this.insertionMode){case re.INITIAL:{xc(this,t);break}case re.BEFORE_HTML:{$c(this,t);break}case re.BEFORE_HEAD:{Vc(this,t);break}case re.IN_HEAD:{qc(this,t);break}case re.IN_HEAD_NO_SCRIPT:{Yc(this,t);break}case re.AFTER_HEAD:{Gc(this,t);break}case re.IN_BODY:case re.IN_CAPTION:case re.IN_CELL:case re.IN_TEMPLATE:{C4(this,t);break}case re.TEXT:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{w1(this,t);break}case re.IN_TABLE_TEXT:{R4(this,t);break}case re.IN_COLUMN_GROUP:{mp(this,t);break}case re.AFTER_BODY:{gp(this,t);break}case re.AFTER_AFTER_BODY:{Fh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bK(this,t);return}switch(this.insertionMode){case re.INITIAL:{xc(this,t);break}case re.BEFORE_HTML:{$c(this,t);break}case re.BEFORE_HEAD:{Vc(this,t);break}case re.IN_HEAD:{qc(this,t);break}case re.IN_HEAD_NO_SCRIPT:{Yc(this,t);break}case re.AFTER_HEAD:{Gc(this,t);break}case re.TEXT:{this._insertCharacters(t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{w1(this,t);break}case re.IN_COLUMN_GROUP:{mp(this,t);break}case re.AFTER_BODY:{gp(this,t);break}case re.AFTER_AFTER_BODY:{Fh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Wb(this,t);return}switch(this.insertionMode){case re.INITIAL:case re.BEFORE_HTML:case re.BEFORE_HEAD:case re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:case re.IN_BODY:case re.IN_TABLE:case re.IN_CAPTION:case re.IN_COLUMN_GROUP:case re.IN_TABLE_BODY:case re.IN_ROW:case re.IN_CELL:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:case re.IN_TEMPLATE:case re.IN_FRAMESET:case re.AFTER_FRAMESET:{Wb(this,t);break}case re.IN_TABLE_TEXT:{yc(this,t);break}case re.AFTER_BODY:{XY(this,t);break}case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{WY(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case re.INITIAL:{QY(this,t);break}case re.BEFORE_HEAD:case re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:{this._err(t,we.misplacedDoctype);break}case re.IN_TABLE_TEXT:{yc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,we.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?yK(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case re.INITIAL:{xc(this,t);break}case re.BEFORE_HTML:{ZY(this,t);break}case re.BEFORE_HEAD:{eG(this,t);break}case re.IN_HEAD:{Ns(this,t);break}case re.IN_HEAD_NO_SCRIPT:{rG(this,t);break}case re.AFTER_HEAD:{iG(this,t);break}case re.IN_BODY:{lr(this,t);break}case re.IN_TABLE:{su(this,t);break}case re.IN_TABLE_TEXT:{yc(this,t);break}case re.IN_CAPTION:{tK(this,t);break}case re.IN_COLUMN_GROUP:{ev(this,t);break}case re.IN_TABLE_BODY:{pm(this,t);break}case re.IN_ROW:{mm(this,t);break}case re.IN_CELL:{sK(this,t);break}case re.IN_SELECT:{M4(this,t);break}case re.IN_SELECT_IN_TABLE:{aK(this,t);break}case re.IN_TEMPLATE:{lK(this,t);break}case re.AFTER_BODY:{cK(this,t);break}case re.IN_FRAMESET:{dK(this,t);break}case re.AFTER_FRAMESET:{hK(this,t);break}case re.AFTER_AFTER_BODY:{mK(this,t);break}case re.AFTER_AFTER_FRAMESET:{gK(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?vK(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case re.INITIAL:{xc(this,t);break}case re.BEFORE_HTML:{JY(this,t);break}case re.BEFORE_HEAD:{tG(this,t);break}case re.IN_HEAD:{nG(this,t);break}case re.IN_HEAD_NO_SCRIPT:{sG(this,t);break}case re.AFTER_HEAD:{aG(this,t);break}case re.IN_BODY:{hm(this,t);break}case re.TEXT:{qG(this,t);break}case re.IN_TABLE:{pd(this,t);break}case re.IN_TABLE_TEXT:{yc(this,t);break}case re.IN_CAPTION:{nK(this,t);break}case re.IN_COLUMN_GROUP:{rK(this,t);break}case re.IN_TABLE_BODY:{Qb(this,t);break}case re.IN_ROW:{O4(this,t);break}case re.IN_CELL:{iK(this,t);break}case re.IN_SELECT:{L4(this,t);break}case re.IN_SELECT_IN_TABLE:{oK(this,t);break}case re.IN_TEMPLATE:{uK(this,t);break}case re.AFTER_BODY:{j4(this,t);break}case re.IN_FRAMESET:{fK(this,t);break}case re.AFTER_FRAMESET:{pK(this,t);break}case re.AFTER_AFTER_BODY:{Fh(this,t);break}}}onEof(t){switch(this.insertionMode){case re.INITIAL:{xc(this,t);break}case re.BEFORE_HTML:{$c(this,t);break}case re.BEFORE_HEAD:{Vc(this,t);break}case re.IN_HEAD:{qc(this,t);break}case re.IN_HEAD_NO_SCRIPT:{Yc(this,t);break}case re.AFTER_HEAD:{Gc(this,t);break}case re.IN_BODY:case re.IN_TABLE:case re.IN_CAPTION:case re.IN_COLUMN_GROUP:case re.IN_TABLE_BODY:case re.IN_ROW:case re.IN_CELL:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:{A4(this,t);break}case re.TEXT:{YG(this,t);break}case re.IN_TABLE_TEXT:{yc(this,t);break}case re.IN_TEMPLATE:{D4(this,t);break}case re.AFTER_BODY:case re.IN_FRAMESET:case re.AFTER_FRAMESET:case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{Jy(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 re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:case re.TEXT:case re.IN_COLUMN_GROUP:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:case re.IN_FRAMESET:case re.AFTER_FRAMESET:{this._insertCharacters(t);break}case re.IN_BODY:case re.IN_CAPTION:case re.IN_CELL:case re.IN_TEMPLATE:case re.AFTER_BODY:case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{S4(this,t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{w1(this,t);break}case re.IN_TABLE_TEXT:{_4(this,t);break}}}}function $Y(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):N4(e,t),n}function VY(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 qY(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 u=e.activeFormattingElements.getElementEntry(l),d=u&&a>=HY;!u||d?(d&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(l)):(l=YY(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function YY(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 GY(e,t,n){const r=e.treeAdapter.getTagName(t),s=mu(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===C.TEMPLATE&&a===Me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function KY(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 Zy(e,t){for(let n=0;n<UY;n++){const r=$Y(e,t);if(!r)break;const s=VY(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=qY(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&GY(e,l,a),KY(e,s,r)}}function Wb(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function XY(e,t){e._appendCommentNode(t,e.openElements.items[0])}function WY(e,t){e._appendCommentNode(t,e.document)}function Jy(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 QY(e,t){e._setDocumentType(t);const n=t.forceQuirks?as.QUIRKS:NY(t);kY(t)||e._err(t,we.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=re.BEFORE_HTML}function xc(e,t){e._err(t,we.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,as.QUIRKS),e.insertionMode=re.BEFORE_HTML,e._processToken(t)}function ZY(e,t){t.tagID===C.HTML?(e._insertElement(t,Me.HTML),e.insertionMode=re.BEFORE_HEAD):$c(e,t)}function JY(e,t){const n=t.tagID;(n===C.HTML||n===C.HEAD||n===C.BODY||n===C.BR)&&$c(e,t)}function $c(e,t){e._insertFakeRootElement(),e.insertionMode=re.BEFORE_HEAD,e._processToken(t)}function eG(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.HEAD:{e._insertElement(t,Me.HTML),e.headElement=e.openElements.current,e.insertionMode=re.IN_HEAD;break}default:Vc(e,t)}}function tG(e,t){const n=t.tagID;n===C.HEAD||n===C.BODY||n===C.HTML||n===C.BR?Vc(e,t):e._err(t,we.endTagWithoutMatchingOpenElement)}function Vc(e,t){e._insertFakeElement(me.HEAD,C.HEAD),e.headElement=e.openElements.current,e.insertionMode=re.IN_HEAD,e._processToken(t)}function Ns(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.TITLE:{e._switchToTextParsing(t,Nn.RCDATA);break}case C.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Nn.RAWTEXT):(e._insertElement(t,Me.HTML),e.insertionMode=re.IN_HEAD_NO_SCRIPT);break}case C.NOFRAMES:case C.STYLE:{e._switchToTextParsing(t,Nn.RAWTEXT);break}case C.SCRIPT:{e._switchToTextParsing(t,Nn.SCRIPT_DATA);break}case C.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=re.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(re.IN_TEMPLATE);break}case C.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:qc(e,t)}}function nG(e,t){switch(t.tagID){case C.HEAD:{e.openElements.pop(),e.insertionMode=re.AFTER_HEAD;break}case C.BODY:case C.BR:case C.HTML:{qc(e,t);break}case C.TEMPLATE:{Bo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Bo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==C.TEMPLATE&&e._err(t,we.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,we.endTagWithoutMatchingOpenElement)}function qc(e,t){e.openElements.pop(),e.insertionMode=re.AFTER_HEAD,e._processToken(t)}function rG(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.BASEFONT:case C.BGSOUND:case C.HEAD:case C.LINK:case C.META:case C.NOFRAMES:case C.STYLE:{Ns(e,t);break}case C.NOSCRIPT:{e._err(t,we.nestedNoscriptInHead);break}default:Yc(e,t)}}function sG(e,t){switch(t.tagID){case C.NOSCRIPT:{e.openElements.pop(),e.insertionMode=re.IN_HEAD;break}case C.BR:{Yc(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Yc(e,t){const n=t.type===Ct.EOF?we.openElementsLeftAfterEof:we.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=re.IN_HEAD,e._processToken(t)}function iG(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.BODY:{e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=re.IN_BODY;break}case C.FRAMESET:{e._insertElement(t,Me.HTML),e.insertionMode=re.IN_FRAMESET;break}case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{e._err(t,we.abandonedHeadElementChild),e.openElements.push(e.headElement,C.HEAD),Ns(e,t),e.openElements.remove(e.headElement);break}case C.HEAD:{e._err(t,we.misplacedStartTagForHeadElement);break}default:Gc(e,t)}}function aG(e,t){switch(t.tagID){case C.BODY:case C.HTML:case C.BR:{Gc(e,t);break}case C.TEMPLATE:{Bo(e,t);break}default:e._err(t,we.endTagWithoutMatchingOpenElement)}}function Gc(e,t){e._insertFakeElement(me.BODY,C.BODY),e.insertionMode=re.IN_BODY,fm(e,t)}function fm(e,t){switch(t.type){case Ct.CHARACTER:{C4(e,t);break}case Ct.WHITESPACE_CHARACTER:{S4(e,t);break}case Ct.COMMENT:{Wb(e,t);break}case Ct.START_TAG:{lr(e,t);break}case Ct.END_TAG:{hm(e,t);break}case Ct.EOF:{A4(e,t);break}}}function S4(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function C4(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function oG(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function lG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function uG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_FRAMESET)}function cG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function dG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Xb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Me.HTML)}function fG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function hG(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),n||(e.formElement=e.openElements.current))}function pG(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===C.LI&&s===C.LI||(n===C.DD||n===C.DT)&&(s===C.DD||s===C.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==C.ADDRESS&&s!==C.DIV&&s!==C.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML)}function mG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.tokenizer.state=Nn.PLAINTEXT}function gG(e,t){e.openElements.hasInScope(C.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1}function bG(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(me.A);n&&(Zy(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yG(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(C.NOBR)&&(Zy(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function vG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function EG(e,t){e.treeAdapter.getDocumentMode(e.document)!==as.QUIRKS&&e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=re.IN_TABLE}function w4(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function k4(e){const t=p4(e,go.TYPE);return t!=null&&t.toLowerCase()===zY}function TG(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Me.HTML),k4(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function SG(e,t){e._appendElement(t,Me.HTML),t.ackSelfClosing=!0}function CG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._appendElement(t,Me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wG(e,t){t.tagName=me.IMG,t.tagID=C.IMG,w4(e,t)}function kG(e,t){e._insertElement(t,Me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Nn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=re.TEXT}function NG(e,t){e.openElements.hasInButtonScope(C.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Nn.RAWTEXT)}function AG(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Nn.RAWTEXT)}function u3(e,t){e._switchToTextParsing(t,Nn.RAWTEXT)}function _G(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===re.IN_TABLE||e.insertionMode===re.IN_CAPTION||e.insertionMode===re.IN_TABLE_BODY||e.insertionMode===re.IN_ROW||e.insertionMode===re.IN_CELL?re.IN_SELECT_IN_TABLE:re.IN_SELECT}function RG(e,t){e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function IG(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Me.HTML)}function OG(e,t){e.openElements.hasInScope(C.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(C.RTC),e._insertElement(t,Me.HTML)}function MG(e,t){e._reconstructActiveFormattingElements(),v4(t),Qy(t),t.selfClosing?e._appendElement(t,Me.MATHML):e._insertElement(t,Me.MATHML),t.ackSelfClosing=!0}function LG(e,t){e._reconstructActiveFormattingElements(),E4(t),Qy(t),t.selfClosing?e._appendElement(t,Me.SVG):e._insertElement(t,Me.SVG),t.ackSelfClosing=!0}function c3(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Me.HTML)}function lr(e,t){switch(t.tagID){case C.I:case C.S:case C.B:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.SMALL:case C.STRIKE:case C.STRONG:{xG(e,t);break}case C.A:{bG(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{dG(e,t);break}case C.P:case C.DL:case C.OL:case C.UL:case C.DIV:case C.DIR:case C.NAV:case C.MAIN:case C.MENU:case C.ASIDE:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.DETAILS:case C.ADDRESS:case C.ARTICLE:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{cG(e,t);break}case C.LI:case C.DD:case C.DT:{pG(e,t);break}case C.BR:case C.IMG:case C.WBR:case C.AREA:case C.EMBED:case C.KEYGEN:{w4(e,t);break}case C.HR:{CG(e,t);break}case C.RB:case C.RTC:{IG(e,t);break}case C.RT:case C.RP:{OG(e,t);break}case C.PRE:case C.LISTING:{fG(e,t);break}case C.XMP:{NG(e,t);break}case C.SVG:{LG(e,t);break}case C.HTML:{oG(e,t);break}case C.BASE:case C.LINK:case C.META:case C.STYLE:case C.TITLE:case C.SCRIPT:case C.BGSOUND:case C.BASEFONT:case C.TEMPLATE:{Ns(e,t);break}case C.BODY:{lG(e,t);break}case C.FORM:{hG(e,t);break}case C.NOBR:{yG(e,t);break}case C.MATH:{MG(e,t);break}case C.TABLE:{EG(e,t);break}case C.INPUT:{TG(e,t);break}case C.PARAM:case C.TRACK:case C.SOURCE:{SG(e,t);break}case C.IMAGE:{wG(e,t);break}case C.BUTTON:{gG(e,t);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{vG(e,t);break}case C.IFRAME:{AG(e,t);break}case C.SELECT:{_G(e,t);break}case C.OPTION:case C.OPTGROUP:{RG(e,t);break}case C.NOEMBED:case C.NOFRAMES:{u3(e,t);break}case C.FRAMESET:{uG(e,t);break}case C.TEXTAREA:{kG(e,t);break}case C.NOSCRIPT:{e.options.scriptingEnabled?u3(e,t):c3(e,t);break}case C.PLAINTEXT:{mG(e,t);break}case C.COL:case C.TH:case C.TD:case C.TR:case C.HEAD:case C.FRAME:case C.TBODY:case C.TFOOT:case C.THEAD:case C.CAPTION:case C.COLGROUP:break;default:c3(e,t)}}function DG(e,t){if(e.openElements.hasInScope(C.BODY)&&(e.insertionMode=re.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function jG(e,t){e.openElements.hasInScope(C.BODY)&&(e.insertionMode=re.AFTER_BODY,j4(e,t))}function PG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function BG(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(C.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(C.FORM):n&&e.openElements.remove(n))}function zG(e){e.openElements.hasInButtonScope(C.P)||e._insertFakeElement(me.P,C.P),e._closePElement()}function UG(e){e.openElements.hasInListItemScope(C.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(C.LI),e.openElements.popUntilTagNamePopped(C.LI))}function HG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function FG(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function $G(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function VG(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(me.BR,C.BR),e.openElements.pop(),e.framesetOk=!1}function N4(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!==C.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 hm(e,t){switch(t.tagID){case C.A:case C.B:case C.I:case C.S:case C.U:case C.EM:case C.TT:case C.BIG:case C.CODE:case C.FONT:case C.NOBR:case C.SMALL:case C.STRIKE:case C.STRONG:{Zy(e,t);break}case C.P:{zG(e);break}case C.DL:case C.UL:case C.OL:case C.DIR:case C.DIV:case C.NAV:case C.PRE:case C.MAIN:case C.MENU:case C.ASIDE:case C.BUTTON:case C.CENTER:case C.FIGURE:case C.FOOTER:case C.HEADER:case C.HGROUP:case C.DIALOG:case C.ADDRESS:case C.ARTICLE:case C.DETAILS:case C.SEARCH:case C.SECTION:case C.SUMMARY:case C.LISTING:case C.FIELDSET:case C.BLOCKQUOTE:case C.FIGCAPTION:{PG(e,t);break}case C.LI:{UG(e);break}case C.DD:case C.DT:{HG(e,t);break}case C.H1:case C.H2:case C.H3:case C.H4:case C.H5:case C.H6:{FG(e);break}case C.BR:{VG(e);break}case C.BODY:{DG(e,t);break}case C.HTML:{jG(e,t);break}case C.FORM:{BG(e);break}case C.APPLET:case C.OBJECT:case C.MARQUEE:{$G(e,t);break}case C.TEMPLATE:{Bo(e,t);break}default:N4(e,t)}}function A4(e,t){e.tmplInsertionModeStack.length>0?D4(e,t):Jy(e,t)}function qG(e,t){var n;t.tagID===C.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function YG(e,t){e._err(t,we.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function w1(e,t){if(e.openElements.currentTagId!==void 0&&T4.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=re.IN_TABLE_TEXT,t.type){case Ct.CHARACTER:{R4(e,t);break}case Ct.WHITESPACE_CHARACTER:{_4(e,t);break}}else Ad(e,t)}function GG(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_CAPTION}function KG(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_COLUMN_GROUP}function XG(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.COLGROUP,C.COLGROUP),e.insertionMode=re.IN_COLUMN_GROUP,ev(e,t)}function WG(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_TABLE_BODY}function QG(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.TBODY,C.TBODY),e.insertionMode=re.IN_TABLE_BODY,pm(e,t)}function ZG(e,t){e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function JG(e,t){k4(t)?e._appendElement(t,Me.HTML):Ad(e,t),t.ackSelfClosing=!0}function eK(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function su(e,t){switch(t.tagID){case C.TD:case C.TH:case C.TR:{QG(e,t);break}case C.STYLE:case C.SCRIPT:case C.TEMPLATE:{Ns(e,t);break}case C.COL:{XG(e,t);break}case C.FORM:{eK(e,t);break}case C.TABLE:{ZG(e,t);break}case C.TBODY:case C.TFOOT:case C.THEAD:{WG(e,t);break}case C.INPUT:{JG(e,t);break}case C.CAPTION:{GG(e,t);break}case C.COLGROUP:{KG(e,t);break}default:Ad(e,t)}}function pd(e,t){switch(t.tagID){case C.TABLE:{e.openElements.hasInTableScope(C.TABLE)&&(e.openElements.popUntilTagNamePopped(C.TABLE),e._resetInsertionMode());break}case C.TEMPLATE:{Bo(e,t);break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TBODY:case C.TD:case C.TFOOT:case C.TH:case C.THEAD:case C.TR:break;default:Ad(e,t)}}function Ad(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,fm(e,t),e.fosterParentingEnabled=n}function _4(e,t){e.pendingCharacterTokens.push(t)}function R4(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function yc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ad(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const I4=new Set([C.CAPTION,C.COL,C.COLGROUP,C.TBODY,C.TD,C.TFOOT,C.TH,C.THEAD,C.TR]);function tK(e,t){const n=t.tagID;I4.has(n)?e.openElements.hasInTableScope(C.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_TABLE,su(e,t)):lr(e,t)}function nK(e,t){const n=t.tagID;switch(n){case C.CAPTION:case C.TABLE:{e.openElements.hasInTableScope(C.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(C.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_TABLE,n===C.TABLE&&pd(e,t));break}case C.BODY:case C.COL:case C.COLGROUP:case C.HTML:case C.TBODY:case C.TD:case C.TFOOT:case C.TH:case C.THEAD:case C.TR:break;default:hm(e,t)}}function ev(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.COL:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.TEMPLATE:{Ns(e,t);break}default:mp(e,t)}}function rK(e,t){switch(t.tagID){case C.COLGROUP:{e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=re.IN_TABLE);break}case C.TEMPLATE:{Bo(e,t);break}case C.COL:break;default:mp(e,t)}}function mp(e,t){e.openElements.currentTagId===C.COLGROUP&&(e.openElements.pop(),e.insertionMode=re.IN_TABLE,e._processToken(t))}function pm(e,t){switch(t.tagID){case C.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_ROW;break}case C.TH:case C.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(me.TR,C.TR),e.insertionMode=re.IN_ROW,mm(e,t);break}case C.CAPTION:case C.COL:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE,su(e,t));break}default:su(e,t)}}function Qb(e,t){const n=t.tagID;switch(t.tagID){case C.TBODY:case C.TFOOT:case C.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE);break}case C.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE,pd(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TD:case C.TH:case C.TR:break;default:pd(e,t)}}function mm(e,t){switch(t.tagID){case C.TH:case C.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Me.HTML),e.insertionMode=re.IN_CELL,e.activeFormattingElements.insertMarker();break}case C.CAPTION:case C.COL:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:case C.TR:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,pm(e,t));break}default:su(e,t)}}function O4(e,t){switch(t.tagID){case C.TR:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY);break}case C.TABLE:{e.openElements.hasInTableScope(C.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,Qb(e,t));break}case C.TBODY:case C.TFOOT:case C.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(C.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,Qb(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:case C.TD:case C.TH:break;default:pd(e,t)}}function sK(e,t){const n=t.tagID;I4.has(n)?(e.openElements.hasInTableScope(C.TD)||e.openElements.hasInTableScope(C.TH))&&(e._closeTableCell(),mm(e,t)):lr(e,t)}function iK(e,t){const n=t.tagID;switch(n){case C.TD:case C.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_ROW);break}case C.TABLE:case C.TBODY:case C.TFOOT:case C.THEAD:case C.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),O4(e,t));break}case C.BODY:case C.CAPTION:case C.COL:case C.COLGROUP:case C.HTML:break;default:hm(e,t)}}function M4(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.OPTION:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case C.OPTGROUP:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Me.HTML);break}case C.HR:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.INPUT:case C.KEYGEN:case C.TEXTAREA:case C.SELECT:{e.openElements.hasInSelectScope(C.SELECT)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),t.tagID!==C.SELECT&&e._processStartTag(t));break}case C.SCRIPT:case C.TEMPLATE:{Ns(e,t);break}}}function L4(e,t){switch(t.tagID){case C.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===C.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===C.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===C.OPTGROUP&&e.openElements.pop();break}case C.OPTION:{e.openElements.currentTagId===C.OPTION&&e.openElements.pop();break}case C.SELECT:{e.openElements.hasInSelectScope(C.SELECT)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode());break}case C.TEMPLATE:{Bo(e,t);break}}}function aK(e,t){const n=t.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),e._processStartTag(t)):M4(e,t)}function oK(e,t){const n=t.tagID;n===C.CAPTION||n===C.TABLE||n===C.TBODY||n===C.TFOOT||n===C.THEAD||n===C.TR||n===C.TD||n===C.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(C.SELECT),e._resetInsertionMode(),e.onEndTag(t)):L4(e,t)}function lK(e,t){switch(t.tagID){case C.BASE:case C.BASEFONT:case C.BGSOUND:case C.LINK:case C.META:case C.NOFRAMES:case C.SCRIPT:case C.STYLE:case C.TEMPLATE:case C.TITLE:{Ns(e,t);break}case C.CAPTION:case C.COLGROUP:case C.TBODY:case C.TFOOT:case C.THEAD:{e.tmplInsertionModeStack[0]=re.IN_TABLE,e.insertionMode=re.IN_TABLE,su(e,t);break}case C.COL:{e.tmplInsertionModeStack[0]=re.IN_COLUMN_GROUP,e.insertionMode=re.IN_COLUMN_GROUP,ev(e,t);break}case C.TR:{e.tmplInsertionModeStack[0]=re.IN_TABLE_BODY,e.insertionMode=re.IN_TABLE_BODY,pm(e,t);break}case C.TD:case C.TH:{e.tmplInsertionModeStack[0]=re.IN_ROW,e.insertionMode=re.IN_ROW,mm(e,t);break}default:e.tmplInsertionModeStack[0]=re.IN_BODY,e.insertionMode=re.IN_BODY,lr(e,t)}}function uK(e,t){t.tagID===C.TEMPLATE&&Bo(e,t)}function D4(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(C.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Jy(e,t)}function cK(e,t){t.tagID===C.HTML?lr(e,t):gp(e,t)}function j4(e,t){var n;if(t.tagID===C.HTML){if(e.fragmentContext||(e.insertionMode=re.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===C.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 gp(e,t)}function gp(e,t){e.insertionMode=re.IN_BODY,fm(e,t)}function dK(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.FRAMESET:{e._insertElement(t,Me.HTML);break}case C.FRAME:{e._appendElement(t,Me.HTML),t.ackSelfClosing=!0;break}case C.NOFRAMES:{Ns(e,t);break}}}function fK(e,t){t.tagID===C.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==C.FRAMESET&&(e.insertionMode=re.AFTER_FRAMESET))}function hK(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.NOFRAMES:{Ns(e,t);break}}}function pK(e,t){t.tagID===C.HTML&&(e.insertionMode=re.AFTER_AFTER_FRAMESET)}function mK(e,t){t.tagID===C.HTML?lr(e,t):Fh(e,t)}function Fh(e,t){e.insertionMode=re.IN_BODY,fm(e,t)}function gK(e,t){switch(t.tagID){case C.HTML:{lr(e,t);break}case C.NOFRAMES:{Ns(e,t);break}}}function bK(e,t){t.chars=pn,e._insertCharacters(t)}function xK(e,t){e._insertCharacters(t),e.framesetOk=!1}function P4(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function yK(e,t){if(LY(t))P4(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Me.MATHML?v4(t):r===Me.SVG&&(DY(t),E4(t)),Qy(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function vK(e,t){if(t.tagID===C.P||t.tagID===C.BR){P4(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)===Me.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}me.AREA,me.BASE,me.BASEFONT,me.BGSOUND,me.BR,me.COL,me.EMBED,me.FRAME,me.HR,me.IMG,me.INPUT,me.KEYGEN,me.LINK,me.META,me.PARAM,me.SOURCE,me.TRACK,me.WBR;const gm=B4("end"),Gs=B4("start");function B4(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 z4(e){const t=Gs(e),n=gm(e);if(t&&n)return{start:t,end:n}}const EK=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,TK=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),d3={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function U4(e,t){const n=OK(e),r=u4("type",{handlers:{root:SK,element:CK,text:wK,comment:F4,doctype:kK,raw:AK},unknown:_K}),s={parser:n?new l3(d3):l3.getFragmentParser(void 0,d3),handle(u){r(u,s)},stitches:!1,options:t||{}};r(e,s),gu(s,Gs());const a=n?s.parser.document:s.parser.getFragment(),l=Mq(a,{file:s.options.file});return s.stitches&&Ys(l,"comment",function(u,d,h){const m=u;if(m.value.stitch&&h&&d!==void 0){const p=h.children;return p[d]=m.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function H4(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function SK(e,t){H4(e.children,t)}function CK(e,t){RK(e,t),H4(e.children,t),IK(e,t)}function wK(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Ct.CHARACTER,chars:e.value,location:_d(e)};gu(t,Gs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function kK(e,t){const n={type:Ct.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:_d(e)};gu(t,Gs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function NK(e,t){t.stitches=!0;const n=MK(e);if("children"in e&&"children"in n){const r=U4({type:"root",children:e.children},t.options);n.children=r.children}F4({type:"comment",value:{stitch:n}},t)}function F4(e,t){const n=e.value,r={type:Ct.COMMENT,data:n,location:_d(e)};gu(t,Gs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function AK(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,$4(t,Gs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(EK,"&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 _K(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))NK(n,t);else{let r="";throw TK.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 gu(e,t){$4(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=Nn.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 $4(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 RK(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Nn.PLAINTEXT)return;gu(t,Gs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:co.html;s===co.html&&n==="svg"&&(s=co.svg);const a=Bq({...e,children:[]},{space:s===co.svg?"svg":"html"}),l={type:Ct.START_TAG,tagName:n,tagID:mu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:_d(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function IK(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Yq.includes(n)||t.parser.tokenizer.state===Nn.PLAINTEXT)return;gu(t,gm(e));const r={type:Ct.END_TAG,tagName:n,tagID:mu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:_d(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Nn.RCDATA||t.parser.tokenizer.state===Nn.RAWTEXT||t.parser.tokenizer.state===Nn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Nn.DATA)}function OK(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function _d(e){const t=Gs(e)||{line:void 0,column:void 0,offset:void 0},n=gm(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 MK(e){return"children"in e?wo({...e,children:[]}):wo(e)}function Zb(e){return function(t,n){return U4(t,{...e,file:n})}}const Ja=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ro={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ja,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ja],h2:[["className","sr-only"]],img:[...Ja,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ja,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ja],table:[...Ja],ul:[...Ja,["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"]},fa={}.hasOwnProperty;function LK(e,t){let n={type:"root",children:[]};const r={schema:t?{...ro,...t}:ro,stack:[]},s=V4(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function V4(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return DK(e,n);case"doctype":return jK(e,n);case"element":return PK(e,n);case"root":return BK(e,n);case"text":return zK(e,n)}}}function DK(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 Rd(a,t),a}}function jK(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Rd(n,t),n}}function PK(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=q4(e,t.children),s=UK(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&&fa.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let d=-1;for(a=!1;++d<u.length;)e.stack.includes(u[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 Rd(l,t),l}function BK(e,t){const r={type:"root",children:q4(e,t.children)};return Rd(r,t),r}function zK(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Rd(r,t),r}function q4(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=V4(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function UK(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&fa.call(r,n)?r[n]:void 0,l=r&&fa.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},d={};let h;for(h in u)if(fa.call(u,h)){const m=u[h];let p=f3(e,h3(a,h),h,m);p==null&&(p=f3(e,h3(l,h),h,m)),p!=null&&(d[h]=p)}if(s&&fa.call(s,n)){const m=s[n];for(h in m)fa.call(m,h)&&!fa.call(d,h)&&(d[h]=m[h])}return d}function f3(e,t,n,r){return t?Array.isArray(r)?HK(e,t,n,r):Y4(e,t,n,r):void 0}function HK(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const l=Y4(e,t,n,r[s]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function Y4(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&FK(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 FK(e,t,n){const r=e.schema.protocols&&fa.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("?"),u=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||u>-1&&a>u)return!0;let h=-1;for(;++h<r.length;){const m=r[h];if(a===m.length&&s.slice(0,m.length)===m)return!0}return!1}function Rd(e,t){const n=z4(t);t.data&&(e.data=wo(t.data)),n&&(e.position=n)}function h3(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 G4(e){return function(t){return LK(t,e)}}function p3(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 fr=Ia(/[A-Za-z]/),ir=Ia(/[\dA-Za-z]/),$K=Ia(/[#-'*+\--9=?A-Z^-~]/);function bp(e){return e!==null&&(e<32||e===127)}const Jb=Ia(/\d/),VK=Ia(/[\dA-Fa-f]/),qK=Ia(/[!-/:-@[-`{-~]/);function at(e){return e!==null&&e<-2}function sn(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const bm=Ia(/\p{P}|\p{S}/u),ko=Ia(/\s/);function Ia(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function YK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function GK(e,t,n){const s=lm((n||{}).ignore||[]),a=KK(t);let l=-1;for(;++l<a.length;)$y(e,"text",u);function u(h,m){let p=-1,b;for(;++p<m.length;){const x=m[p],E=b?b.children:void 0;if(s(x,E?E.indexOf(x):void 0,b))return;b=x}if(b)return d(h,m)}function d(h,m){const p=m[m.length-1],b=a[l][0],x=a[l][1];let E=0;const w=p.children.indexOf(h);let S=!1,k=[];b.lastIndex=0;let N=b.exec(h.value);for(;N;){const _=N.index,M={index:N.index,input:N.input,stack:[...m,h]};let R=x(...N,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=_+1:(E!==_&&k.push({type:"text",value:h.value.slice(E,_)}),Array.isArray(R)?k.push(...R):R&&k.push(R),E=_+N[0].length,S=!0),!b.global)break;N=b.exec(h.value)}return S?(E<h.value.length&&k.push({type:"text",value:h.value.slice(E)}),p.children.splice(w,1,...k)):k=[h],w+k.length}}function KK(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([XK(s[0]),WK(s[1])])}return t}function XK(e){return typeof e=="string"?new RegExp(YK(e),"g"):e}function WK(e){return typeof e=="function"?e:function(){return e}}const k1="phrasing",N1=["autolink","link","image","label"];function QK(){return{transforms:[sX],enter:{literalAutolink:JK,literalAutolinkEmail:A1,literalAutolinkHttp:A1,literalAutolinkWww:A1},exit:{literalAutolink:rX,literalAutolinkEmail:nX,literalAutolinkHttp:eX,literalAutolinkWww:tX}}}function ZK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:k1,notInConstruct:N1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:k1,notInConstruct:N1},{character:":",before:"[ps]",after:"\\/",inConstruct:k1,notInConstruct:N1}]}}function JK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function A1(e){this.config.enter.autolinkProtocol.call(this,e)}function eX(e){this.config.exit.autolinkProtocol.call(this,e)}function tX(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 nX(e){this.config.exit.autolinkEmail.call(this,e)}function rX(e){this.exit(e)}function sX(e){GK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iX],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,aX]],{ignore:["link","linkReference"]})}function iX(e,t,n,r,s){let a="";if(!K4(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!oX(n)))return!1;const l=lX(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function aX(e,t,n,r){return!K4(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function oX(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 lX(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=p3(e,"(");let a=p3(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 K4(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ko(n)||bm(n))&&(!t||n!==47)}function Ts(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}X4.peek=bX;function uX(){this.buffer()}function cX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function dX(){this.buffer()}function fX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ts(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pX(e){this.exit(e)}function mX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ts(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gX(e){this.exit(e)}function bX(){return"["}function X4(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function xX(){return{enter:{gfmFootnoteCallString:uX,gfmFootnoteCall:cX,gfmFootnoteDefinitionLabelString:dX,gfmFootnoteDefinition:fX},exit:{gfmFootnoteCallString:hX,gfmFootnoteCall:pX,gfmFootnoteDefinitionLabelString:mX,gfmFootnoteDefinition:gX}}}function yX(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:X4},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),m(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
570
- `:" ")+a.indentLines(a.containerFlow(r,u.current()),t?W4:vX))),h(),d}}function vX(e,t,n){return t===0?e:W4(e,t,n)}function W4(e,t,n){return(n?"":" ")+e}const EX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Q4.peek=kX;function TX(){return{canContainEols:["delete"],enter:{strikethrough:CX},exit:{strikethrough:wX}}}function SX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EX}],handlers:{delete:Q4}}}function CX(e){this.enter({type:"delete",children:[]},e)}function wX(e){this.exit(e)}function Q4(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 kX(){return"~"}function NX(e){return e.length}function AX(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||NX,a=[],l=[],u=[],d=[];let h=0,m=-1;for(;++m<e.length;){const A=[],w=[];let S=-1;for(e[m].length>h&&(h=e[m].length);++S<e[m].length;){const k=_X(e[m][S]);if(n.alignDelimiters!==!1){const N=s(k);w[S]=N,(d[S]===void 0||N>d[S])&&(d[S]=N)}A.push(k)}l[m]=A,u[m]=w}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)a[p]=m3(r[p]);else{const A=m3(r);for(;++p<h;)a[p]=A}p=-1;const b=[],x=[];for(;++p<h;){const A=a[p];let w="",S="";A===99?(w=":",S=":"):A===108?w=":":A===114&&(S=":");let k=n.alignDelimiters===!1?1:Math.max(1,d[p]-w.length-S.length);const N=w+"-".repeat(k)+S;n.alignDelimiters!==!1&&(k=w.length+k+S.length,k>d[p]&&(d[p]=k),x[p]=k),b[p]=N}l.splice(1,0,b),u.splice(1,0,x),m=-1;const E=[];for(;++m<l.length;){const A=l[m],w=u[m];p=-1;const S=[];for(;++p<h;){const k=A[p]||"";let N="",_="";if(n.alignDelimiters!==!1){const M=d[p]-(w[p]||0),R=a[p];R===114?N=" ".repeat(M):R===99?M%2?(N=" ".repeat(M/2+.5),_=" ".repeat(M/2-.5)):(N=" ".repeat(M/2),_=N):_=" ".repeat(M)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(N),S.push(k),n.alignDelimiters!==!1&&S.push(_),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&S.push("|")}E.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return E.join(`
571
- `)}function _X(e){return e==null?"":String(e)}function m3(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 RX(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()),IX);return s(),l}function IX(e,t,n){return">"+(n?"":" ")+e}function OX(e,t){return g3(e,t.inConstruct,!0)&&!g3(e,t.notInConstruct,!1)}function g3(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 b3(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
572
- `&&OX(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
573
- `}function MX(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 LX(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 DX(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 jX(e,t,n,r){const s=DX(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(LX(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(a,PX);return p(),b}const u=n.createTracker(r),d=s.repeat(Math.max(MX(a,s)+1,3)),h=n.enter("codeFenced");let m=u.move(d);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=u.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=u.move(" "),m+=u.move(n.safe(e.meta,{before:m,after:`
574
- `,encode:["`"],...u.current()})),p()}return m+=u.move(`
575
- `),a&&(m+=u.move(a+`
576
- `)),m+=u.move(d),h(),m}function PX(e,t,n){return(n?"":" ")+e}function tv(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 BX(e,t,n,r){const s=tv(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
577
- `,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),l(),h}function zX(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 md(e){return"&#x"+e.toString(16).toUpperCase()+";"}function iu(e){if(e===null||sn(e)||ko(e))return 1;if(bm(e))return 2}function xp(e,t,n){const r=iu(e),s=iu(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}}Z4.peek=UX;function Z4(e,t,n,r){const s=zX(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),m=xp(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=md(h)+d.slice(1));const p=d.charCodeAt(d.length-1),b=xp(r.after.charCodeAt(0),p,s);b.inside&&(d=d.slice(0,-1)+md(p));const x=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},u+d+x}function UX(e,t,n){return n.options.emphasis||"*"}const HX={};function nv(e,t){const n=HX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return J4(e,r,s)}function J4(e,t,n){if(FX(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 x3(e.children,t,n)}return Array.isArray(e)?x3(e,t,n):""}function x3(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=J4(e[s],t,n);return r.join("")}function FX(e){return!!(e&&typeof e=="object")}function $X(e,t){let n=!1;return Ys(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Vb}),!!((!e.depth||e.depth<3)&&nv(e)&&(t.options.setext||n))}function VX(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if($X(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
578
- `,after:`
579
- `});return p(),m(),b+`
580
- `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
581
- `))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
582
- `,...a.current()});return/^[\t ]/.test(h)&&(h=md(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}e6.peek=qX;function e6(e){return e.value||""}function qX(){return"<"}t6.peek=YX;function t6(e,t,n,r){const s=tv(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),h+=d.move(")"),l(),h}function YX(){return"!"}n6.peek=GX;function n6(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?d+=u.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function GX(){return"!"}r6.peek=KX;function r6(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],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function KX(){return"`"}function s6(e,t){const n=nv(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))}i6.peek=XX;function i6(e,t,n,r){const s=tv(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if(s6(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=m,p}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),u(),h}function XX(e,t,n){return s6(e,n)?"<":"["}a6.peek=WX;function a6(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?d+=u.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function WX(){return"["}function rv(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 QX(e){const t=rv(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 ZX(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 o6(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 JX(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?ZX(n):rv(n);const u=e.ordered?l==="."?")":".":QX(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.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),o6(n)===l&&m){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function eW(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 tW(e,t,n,r){const s=eW(n);let a=n.bulletCurrent||rv(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 u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),m);return d(),h;function m(p,b,x){return b?(x?"":" ".repeat(l))+p:(x?a:a+" ".repeat(l-a.length))+p}}function nW(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const rW=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function sW(e,t,n,r){return(e.children.some(function(l){return rW(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function iW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}l6.peek=aW;function l6(e,t,n,r){const s=iW(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),m=xp(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=md(h)+d.slice(1));const p=d.charCodeAt(d.length-1),b=xp(r.after.charCodeAt(0),p,s);b.inside&&(d=d.slice(0,-1)+md(p));const x=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},u+d+x}function aW(e,t,n){return n.options.strong||"*"}function oW(e,t,n,r){return n.safe(e.value,r)}function lW(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 uW(e,t,n){const r=(o6(n)+(n.options.ruleSpaces?" ":"")).repeat(lW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const u6={blockquote:RX,break:b3,code:jX,definition:BX,emphasis:Z4,hardBreak:b3,heading:VX,html:e6,image:t6,imageReference:n6,inlineCode:r6,link:i6,linkReference:a6,list:JX,listItem:tW,paragraph:nW,root:sW,strong:l6,text:oW,thematicBreak:uW},y3=document.createElement("i");function sv(e){const t="&"+e+";";y3.innerHTML=t;const n=y3.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function c6(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 cW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dW(e){return e.replace(cW,fW)}function fW(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return c6(n.slice(a?2:1),a?16:10)}return sv(n)||e}function hW(){return{enter:{table:pW,tableData:v3,tableHeader:v3,tableRow:gW},exit:{codeText:bW,table:mW,tableData:_1,tableHeader:_1,tableRow:_1}}}function pW(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 mW(e){this.exit(e),this.data.inTable=void 0}function gW(e){this.enter({type:"tableRow",children:[]},e)}function _1(e){this.exit(e)}function v3(e){this.enter({type:"tableCell",children:[]},e)}function bW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xW(e,t){return t==="|"?t:e}function yW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
583
- `,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:u}};function l(x,E,A,w){return h(m(x,A,w),x.align)}function u(x,E,A,w){const S=p(x,A,w),k=h([S]);return k.slice(0,k.indexOf(`
584
- `))}function d(x,E,A,w){const S=A.enter("tableCell"),k=A.enter("phrasing"),N=A.containerPhrasing(x,{...w,before:a,after:a});return k(),S(),N}function h(x,E){return AX(x,{align:E,alignDelimiters:r,padding:n,stringLength:s})}function m(x,E,A){const w=x.children;let S=-1;const k=[],N=E.enter("table");for(;++S<w.length;)k[S]=p(w[S],E,A);return N(),k}function p(x,E,A){const w=x.children;let S=-1;const k=[],N=E.enter("tableRow");for(;++S<w.length;)k[S]=d(w[S],x,E,A);return N(),k}function b(x,E,A){let w=u6.inlineCode(x,E,A);return A.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function vW(){return{exit:{taskListCheckValueChecked:E3,taskListCheckValueUnchecked:E3,paragraph:TW}}}function EW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SW}}}function E3(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function TW(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 u=s[a];if(u.type==="paragraph"){l=u;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 SW(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=u6.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+l}}function CW(){return[QK(),xX(),TX(),hW(),vW()]}function wW(e){return{extensions:[ZK(),yX(e),SX(),yW(e),EW()]}}function qr(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 os(e,t){return e.length>0?(qr(e,e.length,0,t),e):t}const T3={}.hasOwnProperty;function d6(e){const t={};let n=-1;for(;++n<e.length;)kW(t,e[n]);return t}function kW(e,t){let n;for(n in t){const s=(T3.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){T3.call(s,l)||(s[l]=[]);const u=a[l];NW(s[l],Array.isArray(u)?u:u?[u]:[])}}}function NW(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);qr(e,0,0,r)}const AW={tokenize:LW,partial:!0},f6={tokenize:DW,partial:!0},h6={tokenize:jW,partial:!0},p6={tokenize:PW,partial:!0},_W={tokenize:BW,partial:!0},m6={name:"wwwAutolink",tokenize:OW,previous:b6},g6={name:"protocolAutolink",tokenize:MW,previous:x6},Oi={name:"emailAutolink",tokenize:IW,previous:y6},Ks={};function RW(){return{text:Ks}}let eo=48;for(;eo<123;)Ks[eo]=Oi,eo++,eo===58?eo=65:eo===91&&(eo=97);Ks[43]=Oi;Ks[45]=Oi;Ks[46]=Oi;Ks[95]=Oi;Ks[72]=[Oi,g6];Ks[104]=[Oi,g6];Ks[87]=[Oi,m6];Ks[119]=[Oi,m6];function IW(e,t,n){const r=this;let s,a;return l;function l(p){return!ex(p)||!y6.call(r,r.previous)||iv(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return ex(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(_W,m,h)(p):p===45||p===95||ir(p)?(a=!0,e.consume(p),d):m(p)}function h(p){return e.consume(p),s=!0,d}function m(p){return a&&s&&fr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function OW(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!b6.call(r,r.previous)||iv(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(AW,e.attempt(f6,e.attempt(h6,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function MW(e,t,n){const r=this;let s="",a=!1;return l;function l(p){return(p===72||p===104)&&x6.call(r,r.previous)&&!iv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(fr(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?h:(a=!0,d)):n(p)}function h(p){return p===null||bp(p)||sn(p)||ko(p)||bm(p)?n(p):e.attempt(f6,e.attempt(h6,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function LW(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 DW(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(p6,d,u)(h):h===null||sn(h)||ko(h)||h!==45&&bm(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function jW(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(p6,t,a)(l):l===null||sn(l)||ko(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function PW(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||sn(u)||ko(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||sn(u)||ko(u)?t(u):r(u)}function a(u){return fr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):fr(u)?(e.consume(u),l):n(u)}}function BW(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return ir(a)?n(a):t(a)}}function b6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||sn(e)}function x6(e){return!fr(e)}function y6(e){return!(e===47||ex(e))}function ex(e){return e===43||e===45||e===46||e===95||ir(e)}function iv(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 bu(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ir(e.charCodeAt(n+1))&&ir(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 u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),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 xm(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 tx={name:"attention",resolveAll:zW,tokenize:UW};function zW(e,t){let n=-1,r,s,a,l,u,d,h,m;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 p={...e[r][1].end},b={...e[n][1].start};S3(p,-d),S3(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={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:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=os(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=os(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=os(h,xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=os(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=os(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,qr(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function UW(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=iu(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),m=iu(d),p=!m||m===2&&s||n.includes(d),b=!s||s===2&&m||n.includes(r);return h._open=!!(a===42?p:p&&(s||!b)),h._close=!!(a===42?b:b&&(m||!p)),t(d)}}function S3(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const HW={name:"autolink",tokenize:FW};function FW(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 fr(x)?(e.consume(x),l):x===64?n(x):h(x)}function l(x){return x===43||x===45||x===46||ir(x)?(r=1,u(x)):h(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||ir(x))&&r++<32?(e.consume(x),u):(r=0,h(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||bp(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),m):$K(x)?(e.consume(x),h):n(x)}function m(x){return ir(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),r=0,m):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||ir(x))&&r++<63){const E=x===45?b:p;return e.consume(x),E}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 _t(d)?(e.enter(n),u(d)):t(d)}function u(d){return _t(d)&&a++<s?(e.consume(d),u):(e.exit(n),t(d))}}const Id={partial:!0,tokenize:$W};function $W(e,t,n){return r;function r(a){return _t(a)?Pt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||at(a)?t(a):n(a)}}const v6={continuation:{tokenize:qW},exit:YW,name:"blockQuote",tokenize:VW};function VW(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return _t(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function qW(e,t,n){const r=this;return s;function s(l){return _t(l)?Pt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(v6,t,n)(l)}}function YW(e){e.exit("blockQuote")}const E6={name:"characterEscape",tokenize:GW};function GW(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 qK(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const T6={name:"characterReference",tokenize:KW};function KW(e,t,n){const r=this;let s=0,a,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=ir,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=VK,m):(e.enter("characterReferenceValue"),a=7,l=Jb,m(p))}function m(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return l===ir&&!sv(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<a?(e.consume(p),m):n(p)}}const C3={partial:!0,tokenize:WW},w3={concrete:!0,name:"codeFenced",tokenize:XW};function XW(e,t,n){const r=this,s={partial:!0,tokenize:M};let a=0,l=0,u;return d;function d(R){return h(R)}function h(R){const j=r.events[r.events.length-1];return a=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===u?(l++,e.consume(R),m):l<3?n(R):(e.exit("codeFencedFenceSequence"),_t(R)?Pt(e,p,"whitespace")(R):p(R))}function p(R){return R===null||at(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(C3,A,_)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||at(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(R)):_t(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,x,"whitespace")(R)):R===96&&R===u?n(R):(e.consume(R),b)}function x(R){return R===null||at(R)?p(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||at(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(R)):R===96&&R===u?n(R):(e.consume(R),E)}function A(R){return e.attempt(s,_,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return a>0&&_t(R)?Pt(e,k,"linePrefix",a+1)(R):k(R)}function k(R){return R===null||at(R)?e.check(C3,A,_)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||at(R)?(e.exit("codeFlowValue"),k(R)):(e.consume(R),N)}function _(R){return e.exit("codeFenced"),t(R)}function M(R,j,O){let H=0;return P;function P(V){return R.enter("lineEnding"),R.consume(V),R.exit("lineEnding"),Y}function Y(V){return R.enter("codeFencedFence"),_t(V)?Pt(R,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):X(V)}function X(V){return V===u?(R.enter("codeFencedFenceSequence"),Z(V)):O(V)}function Z(V){return V===u?(H++,R.consume(V),Z):H>=l?(R.exit("codeFencedFenceSequence"),_t(V)?Pt(R,ee,"whitespace")(V):ee(V)):O(V)}function ee(V){return V===null||at(V)?(R.exit("codeFencedFence"),j(V)):O(V)}}}function WW(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 R1={name:"codeIndented",tokenize:ZW},QW={partial:!0,tokenize:JW};function ZW(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),Pt(e,a,"linePrefix",5)(h)}function a(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):at(h)?e.attempt(QW,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||at(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function JW(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):at(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Pt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):at(l)?s(l):n(l)}}const eQ={name:"codeText",previous:nQ,resolve:tQ,tokenize:rQ};function tQ(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 nQ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rQ(e,t,n){let r=0,s,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):at(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||at(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class sQ{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&&vc(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),vc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vc(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);vc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vc(this.left,n.reverse())}}}function vc(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 S6(e){const t={};let n=-1,r,s,a,l,u,d,h;const m=new sQ(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.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,iQ(m,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.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={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return qr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function iQ(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 u=l.events,d=[],h={};let m,p,b=-1,x=n,E=0,A=0;const w=[A];for(;x;){for(;e.get(++s)[1]!==x;);a.push(s),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),p&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++b<u.length;)u[b][0]==="exit"&&u[b-1][0]==="enter"&&u[b][1].type===u[b-1][1].type&&u[b][1].start.line!==u[b][1].end.line&&(A=b+1,w.push(A),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),b=w.length;b--;){const S=u.slice(w[b],w[b+1]),k=a.pop();d.push([k,k+S.length-1]),e.splice(k,2,S)}for(d.reverse(),b=-1;++b<d.length;)h[E+d[b][0]]=E+d[b][1],E+=d[b][1]-d[b][0]-1;return h}const aQ={resolve:lQ,tokenize:uQ},oQ={partial:!0,tokenize:cQ};function lQ(e){return S6(e),e}function uQ(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):at(u)?e.check(oQ,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function cQ(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||at(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function C6(e,t,n,r,s,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(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||bp(S)?n(S):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),A(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(u),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(u),b(S)):S===null||S===60||at(S)?n(S):(e.consume(S),S===92?E:x)}function E(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function A(S){return!m&&(S===null||S===41||sn(S))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(S)):m<h&&S===40?(e.consume(S),m++,A):S===41?(e.consume(S),m--,A):S===null||S===32||S===40||bp(S)?n(S):(e.consume(S),S===92?w:A)}function w(S){return S===40||S===41||S===92?(e.consume(S),A):A(S)}}function w6(e,t,n,r,s,a){const l=this;let u=0,d;return h;function h(x){return e.enter(r),e.enter(s),e.consume(x),e.exit(s),e.enter(a),m}function m(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_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):at(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||at(x)||u++>999?(e.exit("chunkString"),m(x)):(e.consume(x),d||(d=!_t(x)),x===92?b:p)}function b(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function k6(e,t,n,r,s,a){let l;return u;function u(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),h(b))}function h(b){return b===l?(e.exit(a),d(l)):b===null?n(b):at(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Pt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||at(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?p:m)}function p(b){return b===l||b===92?(e.consume(b),m):m(b)}}function Kc(e,t){let n;return r;function r(s){return at(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):_t(s)?Pt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const dQ={name:"definition",tokenize:hQ},fQ={partial:!0,tokenize:pQ};function hQ(e,t,n){const r=this;let s;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return w6.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return s=Ts(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 sn(x)?Kc(e,h)(x):h(x)}function h(x){return C6(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(fQ,p,p)(x)}function p(x){return _t(x)?Pt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||at(x)?(e.exit("definition"),r.parser.defined.push(s),t(x)):n(x)}}function pQ(e,t,n){return r;function r(u){return sn(u)?Kc(e,s)(u):n(u)}function s(u){return k6(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return _t(u)?Pt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||at(u)?t(u):n(u)}}const mQ={name:"hardBreakEscape",tokenize:gQ};function gQ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return at(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const bQ={name:"headingAtx",resolve:xQ,tokenize:yQ};function xQ(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"},qr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function yQ(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||sn(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||at(m)?(e.exit("atxHeading"),t(m)):_t(m)?Pt(e,u,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),u(m))}function h(m){return m===null||m===35||sn(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),h)}}const vQ=["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"],k3=["pre","script","style","textarea"],EQ={concrete:!0,name:"htmlFlow",resolveTo:CQ,tokenize:wQ},TQ={partial:!0,tokenize:NQ},SQ={partial:!0,tokenize:kQ};function CQ(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 wQ(e,t,n){const r=this;let s,a,l,u,d;return h;function h(L){return m(L)}function m(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),p}function p(L){return L===33?(e.consume(L),b):L===47?(e.consume(L),a=!0,A):L===63?(e.consume(L),s=3,r.interrupt?t:D):fr(L)?(e.consume(L),l=String.fromCharCode(L),w):n(L)}function b(L){return L===45?(e.consume(L),s=2,x):L===91?(e.consume(L),s=5,u=0,E):fr(L)?(e.consume(L),s=4,r.interrupt?t:D):n(L)}function x(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function E(L){const te="CDATA[";return L===te.charCodeAt(u++)?(e.consume(L),u===te.length?r.interrupt?t:X:E):n(L)}function A(L){return fr(L)?(e.consume(L),l=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||sn(L)){const te=L===47,ne=l.toLowerCase();return!te&&!a&&k3.includes(ne)?(s=1,r.interrupt?t(L):X(L)):vQ.includes(l.toLowerCase())?(s=6,te?(e.consume(L),S):r.interrupt?t(L):X(L)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?k(L):N(L))}return L===45||ir(L)?(e.consume(L),l+=String.fromCharCode(L),w):n(L)}function S(L){return L===62?(e.consume(L),r.interrupt?t:X):n(L)}function k(L){return _t(L)?(e.consume(L),k):P(L)}function N(L){return L===47?(e.consume(L),P):L===58||L===95||fr(L)?(e.consume(L),_):_t(L)?(e.consume(L),N):P(L)}function _(L){return L===45||L===46||L===58||L===95||ir(L)?(e.consume(L),_):M(L)}function M(L){return L===61?(e.consume(L),R):_t(L)?(e.consume(L),M):N(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),d=L,j):_t(L)?(e.consume(L),R):O(L)}function j(L){return L===d?(e.consume(L),d=null,H):L===null||at(L)?n(L):(e.consume(L),j)}function O(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||sn(L)?M(L):(e.consume(L),O)}function H(L){return L===47||L===62||_t(L)?N(L):n(L)}function P(L){return L===62?(e.consume(L),Y):n(L)}function Y(L){return L===null||at(L)?X(L):_t(L)?(e.consume(L),Y):n(L)}function X(L){return L===45&&s===2?(e.consume(L),z):L===60&&s===1?(e.consume(L),G):L===62&&s===4?(e.consume(L),B):L===63&&s===3?(e.consume(L),D):L===93&&s===5?(e.consume(L),se):at(L)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(TQ,$,Z)(L)):L===null||at(L)?(e.exit("htmlFlowData"),Z(L)):(e.consume(L),X)}function Z(L){return e.check(SQ,ee,$)(L)}function ee(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),V}function V(L){return L===null||at(L)?Z(L):(e.enter("htmlFlowData"),X(L))}function z(L){return L===45?(e.consume(L),D):X(L)}function G(L){return L===47?(e.consume(L),l="",Q):X(L)}function Q(L){if(L===62){const te=l.toLowerCase();return k3.includes(te)?(e.consume(L),B):X(L)}return fr(L)&&l.length<8?(e.consume(L),l+=String.fromCharCode(L),Q):X(L)}function se(L){return L===93?(e.consume(L),D):X(L)}function D(L){return L===62?(e.consume(L),B):L===45&&s===2?(e.consume(L),D):X(L)}function B(L){return L===null||at(L)?(e.exit("htmlFlowData"),$(L)):(e.consume(L),B)}function $(L){return e.exit("htmlFlow"),t(L)}}function kQ(e,t,n){const r=this;return s;function s(l){return at(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 NQ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Id,t,n)}}const AQ={name:"htmlText",tokenize:_Q};function _Q(e,t,n){const r=this;let s,a,l;return u;function u(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),M):D===63?(e.consume(D),N):fr(D)?(e.consume(D),O):n(D)}function h(D){return D===45?(e.consume(D),m):D===91?(e.consume(D),a=0,E):fr(D)?(e.consume(D),k):n(D)}function m(D){return D===45?(e.consume(D),x):n(D)}function p(D){return D===null?n(D):D===45?(e.consume(D),b):at(D)?(l=p,G(D)):(e.consume(D),p)}function b(D){return D===45?(e.consume(D),x):p(D)}function x(D){return D===62?z(D):D===45?b(D):p(D)}function E(D){const B="CDATA[";return D===B.charCodeAt(a++)?(e.consume(D),a===B.length?A:E):n(D)}function A(D){return D===null?n(D):D===93?(e.consume(D),w):at(D)?(l=A,G(D)):(e.consume(D),A)}function w(D){return D===93?(e.consume(D),S):A(D)}function S(D){return D===62?z(D):D===93?(e.consume(D),S):A(D)}function k(D){return D===null||D===62?z(D):at(D)?(l=k,G(D)):(e.consume(D),k)}function N(D){return D===null?n(D):D===63?(e.consume(D),_):at(D)?(l=N,G(D)):(e.consume(D),N)}function _(D){return D===62?z(D):N(D)}function M(D){return fr(D)?(e.consume(D),R):n(D)}function R(D){return D===45||ir(D)?(e.consume(D),R):j(D)}function j(D){return at(D)?(l=j,G(D)):_t(D)?(e.consume(D),j):z(D)}function O(D){return D===45||ir(D)?(e.consume(D),O):D===47||D===62||sn(D)?H(D):n(D)}function H(D){return D===47?(e.consume(D),z):D===58||D===95||fr(D)?(e.consume(D),P):at(D)?(l=H,G(D)):_t(D)?(e.consume(D),H):z(D)}function P(D){return D===45||D===46||D===58||D===95||ir(D)?(e.consume(D),P):Y(D)}function Y(D){return D===61?(e.consume(D),X):at(D)?(l=Y,G(D)):_t(D)?(e.consume(D),Y):H(D)}function X(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),s=D,Z):at(D)?(l=X,G(D)):_t(D)?(e.consume(D),X):(e.consume(D),ee)}function Z(D){return D===s?(e.consume(D),s=void 0,V):D===null?n(D):at(D)?(l=Z,G(D)):(e.consume(D),Z)}function ee(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||sn(D)?H(D):(e.consume(D),ee)}function V(D){return D===47||D===62||sn(D)?H(D):n(D)}function z(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function G(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Q}function Q(D){return _t(D)?Pt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),l(D)}}const av={name:"labelEnd",resolveAll:MQ,resolveTo:LQ,tokenize:DQ},RQ={tokenize:jQ},IQ={tokenize:PQ},OQ={tokenize:BQ};function MQ(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&&qr(e,0,e.length,n),e}function LQ(e,t){let n=e.length,r=0,s,a,l,u;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}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=os(u,e.slice(a+1,a+r+3)),u=os(u,[["enter",m,t]]),u=os(u,xm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=os(u,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),u=os(u,e.slice(l+1)),u=os(u,[["exit",d,t]]),qr(e,a,e.length,u),e}function DQ(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 u;function u(b){return a?a._inactive?p(b):(l=r.parser.defined.includes(Ts(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(RQ,m,l?m:p)(b):b===91?e.attempt(IQ,m,l?h:p)(b):l?m(b):p(b)}function h(b){return e.attempt(OQ,m,p)(b)}function m(b){return t(b)}function p(b){return a._balanced=!0,n(b)}}function jQ(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return sn(p)?Kc(e,a)(p):a(p)}function a(p){return p===41?m(p):C6(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return sn(p)?Kc(e,d)(p):m(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?k6(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return sn(p)?Kc(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function PQ(e,t,n){const r=this;return s;function s(u){return w6.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Ts(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function BQ(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 zQ={name:"labelStartImage",resolveAll:av.resolveAll,tokenize:UQ};function UQ(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const HQ={name:"labelStartLink",resolveAll:av.resolveAll,tokenize:FQ};function FQ(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 I1={name:"lineEnding",tokenize:$Q};function $Q(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const $h={name:"thematicBreak",tokenize:VQ};function VQ(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||at(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),_t(h)?Pt(e,u,"whitespace")(h):u(h))}}const Nr={continuation:{tokenize:KQ},exit:WQ,name:"list",tokenize:GQ},qQ={partial:!0,tokenize:QQ},YQ={partial:!0,tokenize:XQ};function GQ(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 u;function u(x){const E=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Jb(x)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check($h,n,h)(x):h(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return Jb(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"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Id,r.interrupt?n:m,e.attempt(qQ,b,p))}function m(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function p(x){return _t(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 KQ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Id,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!_t(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(YQ,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pt(e,e.attempt(Nr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function XQ(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 WQ(e){e.exit(this.containerState.type)}function QQ(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!_t(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const N3={name:"setextUnderline",resolveTo:ZQ,tokenize:JQ};function ZQ(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 JQ(e,t,n){const r=this;let s;return a;function a(h){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),_t(h)?Pt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||at(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const eZ={tokenize:lZ,partial:!0};function tZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iZ,continuation:{tokenize:aZ},exit:oZ}},text:{91:{name:"gfmFootnoteCall",tokenize:sZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nZ,resolveTo:rZ}}}}function nZ(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 u;function u(d){if(!l||!l._balanced)return n(d);const h=Ts(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function rZ(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)},u=[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,...u),e}function sZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(a>999||p===93&&!l||p===null||p===91||sn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Ts(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return sn(p)||(l=!0),a++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function iZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(E)}function m(E){if(l>999||E===93&&!u||E===null||E===91||sn(E))return n(E);if(E===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return a=Ts(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return sn(E)||(u=!0),l++,e.consume(E),E===92?p:m}function p(E){return E===91||E===92||E===93?(e.consume(E),l++,m):m(E)}function b(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),s.includes(a)||s.push(a),Pt(e,x,"gfmFootnoteDefinitionWhitespace")):n(E)}function x(E){return t(E)}}function aZ(e,t,n){return e.check(Id,t,e.attempt(eZ,t,n))}function oZ(e){e.exit("gfmFootnoteDefinition")}function lZ(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 uZ(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,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",m,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",p,u]],x=u.parser.constructs.insideSpan.null;x&&qr(b,b.length,0,xm(x,l.slice(h+1,d),u)),qr(b,b.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",m,u]]),qr(l,h-1,d-h+3,b),d=h+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,u,d){const h=this.previous,m=this.events;let p=0;return b;function b(E){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(E):(l.enter("strikethroughSequenceTemporary"),x(E))}function x(E){const A=iu(h);if(E===126)return p>1?d(E):(l.consume(E),p++,x);if(p<2&&!n)return d(E);const w=l.exit("strikethroughSequenceTemporary"),S=iu(E);return w._open=!S||S===2&&!!A,w._close=!A||A===2&&!!S,u(E)}}}class cZ{constructor(){this.map=[]}add(t,n,r){dZ(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 dZ(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 fZ(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 hZ(){return{flow:{null:{name:"table",tokenize:pZ,resolveAll:mZ}}}}function pZ(e,t,n){const r=this;let s=0,a=0,l;return u;function u(P){let Y=r.events.length-1;for(;Y>-1;){const ee=r.events[Y][1].type;if(ee==="lineEnding"||ee==="linePrefix")Y--;else break}const X=Y>-1?r.events[Y][1].type:null,Z=X==="tableHead"||X==="tableRow"?R:d;return Z===R&&r.parser.lazy[r.now().line]?n(P):Z(P)}function d(P){return e.enter("tableHead"),e.enter("tableRow"),h(P)}function h(P){return P===124||(l=!0,a+=1),m(P)}function m(P){return P===null?n(P):at(P)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x):n(P):_t(P)?Pt(e,m,"whitespace")(P):(a+=1,l&&(l=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(P)))}function p(P){return P===null||P===124||sn(P)?(e.exit("data"),m(P)):(e.consume(P),P===92?b:p)}function b(P){return P===92||P===124?(e.consume(P),p):p(P)}function x(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),l=!1,_t(P)?Pt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):E(P))}function E(P){return P===45||P===58?w(P):P===124?(l=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),A):M(P)}function A(P){return _t(P)?Pt(e,w,"whitespace")(P):w(P)}function w(P){return P===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),S):P===45?(a+=1,S(P)):P===null||at(P)?_(P):M(P)}function S(P){return P===45?(e.enter("tableDelimiterFiller"),k(P)):M(P)}function k(P){return P===45?(e.consume(P),k):P===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(P))}function N(P){return _t(P)?Pt(e,_,"whitespace")(P):_(P)}function _(P){return P===124?E(P):P===null||at(P)?!l||s!==a?M(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):M(P)}function M(P){return n(P)}function R(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||at(P)?(e.exit("tableRow"),t(P)):_t(P)?Pt(e,j,"whitespace")(P):(e.enter("data"),O(P))}function O(P){return P===null||P===124||sn(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?H:O)}function H(P){return P===92||P===124?(e.consume(P),O):O(P)}}function mZ(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,m,p;const b=new cZ;for(;++n<e.length;){const x=e[n],E=x[1];x[0]==="enter"?E.type==="tableHead"?(u=!1,d!==0&&(A3(b,t,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",h,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",m,t]])),s=E.type==="tableDelimiterRow"?2:m?3:1):s&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Th(b,t,a,s,void 0,p),a=[0,0,0,0]),l[2]=n)):E.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=Th(b,t,a,s,void 0,p)),a=l,l=[a[1],n,0,0])):E.type==="tableHead"?(u=!0,d=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Th(b,t,a,s,n,p)):l[1]!==0&&(p=Th(b,t,l,s,n,p)),s=0):s&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&A3(b,t,d,h,m),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=fZ(t.events,n))}return e}function Th(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Ml(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Ml(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 h=Ml(t.events,n[2]),m=Ml(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,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 E=n[2]+1,A=n[3]-n[2]-1;e.add(E,A,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},Ml(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function A3(e,t,n,r,s){const a=[],l=Ml(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 Ml(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const gZ={name:"tasklistCheck",tokenize:xZ};function bZ(){return{text:{91:gZ}}}function xZ(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 sn(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"),u):n(d)}function u(d){return at(d)?t(d):_t(d)?e.check({tokenize:yZ},t,n)(d):n(d)}}function yZ(e,t,n){return Pt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function vZ(e){return d6([RW(),tZ(),uZ(e),hZ(),bZ()])}const EZ={};function TZ(e){const t=this,n=e||EZ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(vZ(n)),a.push(CW()),l.push(wW(n))}var SZ=Object.defineProperty,CZ=Object.defineProperties,wZ=Object.getOwnPropertyDescriptors,_3=Object.getOwnPropertySymbols,kZ=Object.prototype.hasOwnProperty,NZ=Object.prototype.propertyIsEnumerable,R3=(e,t,n)=>t in e?SZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N6=(e,t)=>{for(var n in t||(t={}))kZ.call(t,n)&&R3(e,n,t[n]);if(_3)for(var n of _3(t))NZ.call(t,n)&&R3(e,n,t[n]);return e},A6=(e,t)=>CZ(e,wZ(t)),xr=(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},AZ=(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},_Z=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]==="`"&&!AZ(e,n)&&(t+=1)}return t},Ea=(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},RZ=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,IZ=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(RZ,(t,n,r,s)=>xr(e,s)?t:`${n}\\>${r}`),OZ=/(\*\*)([^*]*\*?)$/,MZ=/(__)([^_]*?)$/,LZ=/(\*\*\*)([^*]*?)$/,DZ=/(\*)([^*]*?)$/,jZ=/(_)([^_]*?)$/,PZ=/(`)([^`]*?)$/,BZ=/(~~)([^~]*?)$/,zo=/^[\s_~*`]*$/,_6=/^[\s]*[-*+][\s]+$/,zZ=/[\p{L}\p{N}_]/u,UZ=/^```[^`\n]*```?$/,HZ=/^\*{4,}$/,FZ=/(__)([^_]+)_$/,$Z=/(~~)([^~]+)~$/,I3=/~~/g,Ta=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:zZ.test(e)},VZ=(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},R6=(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},ym=(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},qZ=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
585
- `)return!1}return!1},I6=(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]==="]"?qZ(e,t):!1;if(e[n]===`
586
- `)return!1}return!1},YZ=(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]===`
587
- `)return!1}return!1},ov=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
588
- `){r=d+1;break}let s=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
589
- `){s=d;break}let a=e.substring(r,s),l=0,u=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){u=!0;break}return l>=3&&!u},GZ=(e,t,n,r)=>n==="\\"||e.includes("$")&&ym(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&Ta(n)&&Ta(r)||(!n||n===" "||n===" "||n===`
590
- `)&&(!r||r===" "||r===" "||r===`
591
- `)),O6=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]:"";GZ(e,s,a,l)||(t+=1)}return t},KZ=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&ym(e,t)||I6(e,t)||YZ(e,t)||n==="_"||r==="_"||n&&r&&Ta(n)&&Ta(r)),XZ=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]:"";KZ(e,s,a,l)||(t+=1)}return t},WZ=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},lv=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},O3=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},QZ=(e,t,n)=>{if(!t||zo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
592
- `),s=r===-1?0:r+1,a=e.substring(s,n);return _6.test(a)&&t.includes(`
593
- `)?!0:ov(e,n,"*")},ZZ=e=>{let t=e.match(OZ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return xr(e,r)||Ea(e,r)||QZ(e,n,r)?e:lv(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},JZ=(e,t,n)=>{if(!t||zo.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
594
- `),s=r===-1?0:r+1,a=e.substring(s,n);return _6.test(a)&&t.includes(`
595
- `)?!0:ov(e,n,"_")},eJ=e=>{let t=e.match(MZ);if(!t){let s=e.match(FZ);if(s){let a=e.lastIndexOf(s[1]);if(!(xr(e,a)||Ea(e,a))&&O3(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return xr(e,r)||Ea(e,r)||JZ(e,n,r)?e:O3(e)%2===1?`${e}__`:e},tJ=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]!=="\\"&&!ym(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
596
- `)&&(!s||s===" "||s===" "||s===`
597
- `)||r&&s&&Ta(r)&&Ta(s))continue;return n}}return-1},nJ=e=>{if(!e.match(DZ))return e;let t=tJ(e);if(t===-1||xr(e,t)||Ea(e,t))return e;let n=e.substring(t+1);return!n||zo.test(n)?e:O6(e)%2===1?`${e}*`:e},M6=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]!=="\\"&&!ym(e,n)&&!I6(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&Ta(r)&&Ta(s))continue;return n}}return-1},rJ=e=>{let t=e.length;for(;t>0&&e[t-1]===`
598
- `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},sJ=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(lv(t)%2!==1)return null;let n=t.indexOf("**"),r=M6(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},iJ=e=>{if(!e.match(jZ))return e;let t=M6(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||zo.test(n)||xr(e,t)||Ea(e,t))return e;if(XZ(e)%2===1){let r=sJ(e);return r!==null?r:rJ(e)}return e},aJ=e=>{let t=lv(e),n=O6(e);return t%2===0&&n%2===0},oJ=(e,t,n)=>!t||zo.test(t)||xr(e,n)||Ea(e,n)?!0:ov(e,n,"*"),lJ=e=>{if(HZ.test(e))return e;let t=e.match(LZ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return oJ(e,n,r)?e:WZ(e)%2===1?aJ(e)?e:`${e}***`:e},uJ=/<[a-zA-Z/][^>]*$/,cJ=e=>{let t=e.match(uJ);return!t||t.index===void 0||xr(e,t.index)?e:e.substring(0,t.index).trimEnd()},dJ=e=>!e.match(UZ)||e.includes(`
599
- `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,fJ=e=>(e.match(/```/g)||[]).length%2===1,hJ=e=>{let t=dJ(e);if(t!==null)return t;let n=e.match(PZ);if(n&&!fJ(e)){let r=n[2];if(!r||zo.test(r))return e;if(_Z(e)%2===1)return`${e}\``}return e},L6=(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)==="```",pJ=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!L6(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},mJ=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!L6(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},gJ=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
600
- `,t)!==-1&&!e.endsWith(`
601
- `)?`${e}
602
- $$`:`${e}$$`},bJ=e=>pJ(e)%2===0?e:gJ(e),xJ=e=>mJ(e)%2===1?`${e}$`:e,yJ=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=VZ(e,t);if(r===-1||xr(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 u=e.substring(r+1,t);return n==="text-only"?`${l}${u}`:`${l}[${u}](streamdown:incomplete-link)`},M3=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!xr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=R6(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},vJ=(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=M3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(R6(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=M3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},D6=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!xr(e,n)){let r=yJ(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!xr(e,r)){let s=vJ(e,r,t);if(s!==null)return s}return e},EJ=/^-{1,2}$/,TJ=/^[\s]*-{1,2}[\s]+$/,SJ=/^={1,2}$/,CJ=/^[\s]*={1,2}[\s]+$/,wJ=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
603
- `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(EJ.test(s)&&!n.match(TJ)){let a=r.split(`
604
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(SJ.test(s)&&!n.match(CJ)){let a=r.split(`
605
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},kJ=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),NJ=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(kJ,(t,n)=>xr(e,n)?t:"\\~"),AJ=e=>{var t,n;let r=e.match(BZ);if(r){let s=r[2];if(!s||zo.test(s))return e;let a=e.lastIndexOf(r[1]);if(xr(e,a)||Ea(e,a))return e;if(((t=e.match(I3))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match($Z);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(xr(e,a)||Ea(e,a))return e;if(((n=e.match(I3))==null?void 0:n.length)%2===1)return`${e}~`}}return e},O1=e=>e!==!1,_J=e=>e===!0,dr={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},RJ=[{handler:{name:"singleTilde",handle:NJ,priority:dr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:IZ,priority:dr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:cJ,priority:dr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:wJ,priority:dr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:D6,priority:dr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:lJ,priority:dr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:ZZ,priority:dr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:eJ,priority:dr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:nJ,priority:dr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:iJ,priority:dr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:hJ,priority:dr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:AJ,priority:dr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:bJ,priority:dr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:xJ,priority:dr.INLINE_KATEX},optionKey:"inlineKatex"}],IJ=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return RJ.filter(({handler:r,optionKey:s})=>r.name==="links"?O1(e?.links)||O1(e?.images):r.name==="inlineKatex"?_J(e?.inlineKatex):O1(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:A6(N6({},r),{handle:a=>D6(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},OJ=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=IJ(t),a=((n=t?.handlers)!=null?n:[]).map(u=>{var d;return{handler:A6(N6({},u),{priority:(d=u.priority)!=null?d:dr.DEFAULT}),earlyReturn:void 0}}),l=[...s,...a].sort((u,d)=>{var h,m;return((h=u.handler.priority)!=null?h:0)-((m=d.handler.priority)!=null?m:0)});for(let{handler:u,earlyReturn:d}of l)if(r=u.handle(r),d!=null&&d(r))return r;return r},MJ=OJ;const LJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jJ={};function L3(e,t){return(jJ.jsx?DJ:LJ).test(e)}const PJ=/[ \t\n\f\r]/g;function BJ(e){return typeof e=="object"?e.type==="text"?D3(e.value):!1:D3(e)}function D3(e){return e.replace(PJ,"")===""}var Nl={},M1,j3;function zJ(){if(j3)return M1;j3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
606
- `,h="/",m="*",p="",b="comment",x="declaration";function E(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var k=1,N=1;function _(ee){var V=ee.match(t);V&&(k+=V.length);var z=ee.lastIndexOf(d);N=~z?ee.length-z:N+ee.length}function M(){var ee={line:k,column:N};return function(V){return V.position=new R(ee),H(),V}}function R(ee){this.start=ee,this.end={line:k,column:N},this.source=S.source}R.prototype.content=w;function j(ee){var V=new Error(S.source+":"+k+":"+N+": "+ee);if(V.reason=ee,V.filename=S.source,V.line=k,V.column=N,V.source=w,!S.silent)throw V}function O(ee){var V=ee.exec(w);if(V){var z=V[0];return _(z),w=w.slice(z.length),V}}function H(){O(n)}function P(ee){var V;for(ee=ee||[];V=Y();)V!==!1&&ee.push(V);return ee}function Y(){var ee=M();if(!(h!=w.charAt(0)||m!=w.charAt(1))){for(var V=2;p!=w.charAt(V)&&(m!=w.charAt(V)||h!=w.charAt(V+1));)++V;if(V+=2,p===w.charAt(V-1))return j("End of comment missing");var z=w.slice(2,V-2);return N+=2,_(z),w=w.slice(V),N+=2,ee({type:b,comment:z})}}function X(){var ee=M(),V=O(r);if(V){if(Y(),!O(s))return j("property missing ':'");var z=O(a),G=ee({type:x,property:A(V[0].replace(e,p)),value:z?A(z[0].replace(e,p)):p});return O(l),G}}function Z(){var ee=[];P(ee);for(var V;V=X();)V!==!1&&(ee.push(V),P(ee));return ee}return H(),Z()}function A(w){return w?w.replace(u,p):p}return M1=E,M1}var P3;function UJ(){if(P3)return Nl;P3=1;var e=Nl&&Nl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.default=n;const t=e(zJ());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;u?s(h,m,d):m&&(a=a||{},a[h]=m)}),a}return Nl}var Ec={},B3;function HJ(){if(B3)return Ec;B3=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},u=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return Ec.camelCase=d,Ec}var Tc,z3;function FJ(){if(z3)return Tc;z3=1;var e=Tc&&Tc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(UJ()),n=HJ();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,Tc=r,Tc}var $J=FJ();const VJ=Ap($J);function Xc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?U3(e.position):"start"in e||"end"in e?U3(e):"line"in e||"column"in e?nx(e):""}function nx(e){return H3(e&&e.line)+":"+H3(e&&e.column)}function U3(e){return nx(e&&e.start)+"-"+nx(e&&e.end)}function H3(e){return e&&typeof e=="number"?e:1}class ur 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 u=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=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Xc(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}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const uv={}.hasOwnProperty,qJ=new Map,YJ=/[A-Z]/g,GJ=new Set(["table","tbody","thead","tfoot","tr"]),KJ=new Set(["td","th"]),j6="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XJ(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=ree(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=nee(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"?Ra:Nd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=P6(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function P6(e,t,n){if(t.type==="element")return WJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JJ(e,t,n);if(t.type==="mdxjsEsm")return ZJ(e,t);if(t.type==="root")return eee(e,t,n);if(t.type==="text")return tee(e,t)}function WJ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ra,e.schema=s),e.ancestors.push(t);const a=z6(e,t.tagName,!1),l=see(e,t);let u=dv(e,t);return GJ.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!BJ(d):!0})),B6(e,l,a,t),cv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function QJ(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)}gd(e,t.position)}function ZJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gd(e,t.position)}function JJ(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ra,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:z6(e,t.name,!0),l=iee(e,t),u=dv(e,t);return B6(e,l,a,t),cv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function eee(e,t,n){const r={};return cv(r,dv(e,t)),e.create(t,e.Fragment,r,n)}function tee(e,t){return t.value}function B6(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nee(e,t,n){return r;function r(s,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function ree(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),d=Gs(r);return t(s,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function see(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&uv.call(t.properties,s)){const a=aee(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&KJ.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function iee(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 u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else gd(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 u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else gd(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function dv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:qJ;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 h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const u=P6(e,a,l);u!==void 0&&n.push(u)}return n}function aee(e,t,n){const r=dm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s4(n):i4(n)),r.property==="style"){let s=typeof n=="object"?n:oee(e,String(n));return e.stylePropertyNameCase==="css"&&(s=lee(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?xq[r.property]||r.property:r.attribute,n]}}function oee(e,t){try{return VJ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ur("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=j6+"#cannot-parse-style-attribute",s}}function z6(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 u=L3(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=L3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return uv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);gd(e)}function gd(e,t){const n=new ur("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=j6+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lee(e){const t={};let n;for(n in e)uv.call(e,n)&&(t[uee(n)]=e[n]);return t}function uee(e){let t=e.replace(YJ,cee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cee(e){return"-"+e.toLowerCase()}const L1={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"]},dee={tokenize:fee};function fee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return at(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const hee={tokenize:pee},F3={tokenize:mee};function pee(e){const t=this,n=[];let r=0,s,a,l;return u;function u(N){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,d,h)(N)}return h(N)}function d(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&k();const _=t.events.length;let M=_,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){R=t.events[M][1].end;break}S(r);let j=_;for(;j<t.events.length;)t.events[j][1].end={...R},j++;return qr(t.events,M+1,0,t.events.slice(_)),t.events.length=j,h(N)}return u(N)}function h(N){if(r===n.length){if(!s)return b(N);if(s.currentConstruct&&s.currentConstruct.concrete)return E(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(F3,m,p)(N)}function m(N){return s&&k(),S(r),b(N)}function p(N){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,E(N)}function b(N){return t.containerState={},e.attempt(F3,x,E)(N)}function x(N){return r++,n.push([t.currentConstruct,t.containerState]),b(N)}function E(N){if(N===null){s&&k(),S(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),A(N)}function A(N){if(N===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return at(N)?(e.consume(N),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(N),A)}function w(N,_){const M=t.sliceStream(N);if(_&&M.push(null),N.previous=a,a&&(a.next=N),a=N,s.defineSkip(N.start),s.write(M),t.parser.lazy[N.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<l&&(!s.events[R][1].end||s.events[R][1].end.offset>l))return;const j=t.events.length;let O=j,H,P;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(H){P=t.events[O][1].end;break}H=!0}for(S(r),R=j;R<t.events.length;)t.events[R][1].end={...P},R++;qr(t.events,O+1,0,t.events.slice(j)),t.events.length=R}}function S(N){let _=n.length;for(;_-- >N;){const M=n[_];t.containerState=M[1],M[0].exit.call(t,e)}n.length=N}function k(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function mee(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 gee={tokenize:bee};function bee(e){const t=this,n=e.attempt(Id,r,e.attempt(this.parser.constructs.flowInitial,s,Pt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(aQ,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 xee={resolveAll:H6()},yee=U6("string"),vee=U6("text");function U6(e){return{resolveAll:H6(e==="text"?Eee:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(m){return h(m)?a(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),a(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const p=s[m];let b=-1;if(p)for(;++b<p.length;){const x=p[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function H6(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 Eee(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,u=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const Tee={42:Nr,43:Nr,45:Nr,48:Nr,49:Nr,50:Nr,51:Nr,52:Nr,53:Nr,54:Nr,55:Nr,56:Nr,57:Nr,62:v6},See={91:dQ},Cee={[-2]:R1,[-1]:R1,32:R1},wee={35:bQ,42:$h,45:[N3,$h],60:EQ,61:N3,95:$h,96:w3,126:w3},kee={38:T6,92:E6},Nee={[-5]:I1,[-4]:I1,[-3]:I1,33:zQ,38:T6,42:tx,60:[HW,AQ],91:HQ,92:[mQ,E6],93:av,95:tx,96:eQ},Aee={null:[tx,xee]},_ee={null:[42,95]},Ree={null:[]},Iee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_ee,contentInitial:See,disable:Ree,document:Tee,flow:wee,flowInitial:Cee,insideSpan:Aee,string:kee,text:Nee},Symbol.toStringTag,{value:"Module"}));function Oee(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=[],u=[];const d={attempt:j(M),check:j(R),consume:k,enter:N,exit:_,interrupt:j(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,events:[],now:E,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:p};let m=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function p(Y){return l=os(l,Y),w(),l[l.length-1]!==null?[]:(O(t,0),h.events=xm(a,h.events,h),h.events)}function b(Y,X){return Lee(x(Y),X)}function x(Y){return Mee(l,Y)}function E(){const{_bufferIndex:Y,_index:X,line:Z,column:ee,offset:V}=r;return{_bufferIndex:Y,_index:X,line:Z,column:ee,offset:V}}function A(Y){s[Y.line]=Y.column,P()}function w(){let Y;for(;r._index<l.length;){const X=l[r._index];if(typeof X=="string")for(Y=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Y&&r._bufferIndex<X.length;)S(X.charCodeAt(r._bufferIndex));else S(X)}}function S(Y){m=m(Y)}function k(Y){at(Y)?(r.line++,r.column=1,r.offset+=Y===-3?2:1,P()):Y!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=Y}function N(Y,X){const Z=X||{};return Z.type=Y,Z.start=E(),h.events.push(["enter",Z,h]),u.push(Z),Z}function _(Y){const X=u.pop();return X.end=E(),h.events.push(["exit",X,h]),X}function M(Y,X){O(Y,X.from)}function R(Y,X){X.restore()}function j(Y,X){return Z;function Z(ee,V,z){let G,Q,se,D;return Array.isArray(ee)?$(ee):"tokenize"in ee?$([ee]):B(ee);function B(ce){return fe;function fe(de){const xe=de!==null&&ce[de],Fe=de!==null&&ce.null,De=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return $(De)(de)}}function $(ce){return G=ce,Q=0,ce.length===0?z:L(ce[Q])}function L(ce){return fe;function fe(de){return D=H(),se=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?ne():ce.tokenize.call(X?Object.assign(Object.create(h),X):h,d,te,ne)(de)}}function te(ce){return Y(se,D),V}function ne(ce){return D.restore(),++Q<G.length?L(G[Q]):z}}}function O(Y,X){Y.resolveAll&&!a.includes(Y)&&a.push(Y),Y.resolve&&qr(h.events,X,h.events.length-X,Y.resolve(h.events.slice(X),h)),Y.resolveTo&&(h.events=Y.resolveTo(h.events,h))}function H(){const Y=E(),X=h.previous,Z=h.currentConstruct,ee=h.events.length,V=Array.from(u);return{from:ee,restore:z};function z(){r=Y,h.previous=X,h.currentConstruct=Z,h.events.length=ee,u=V,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Mee(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 u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function Lee(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=`
607
- `;break}case-3:{l=`\r
608
- `;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 Dee(e){const r={constructs:d6([Iee,...(e||{}).extensions||[]]),content:s(dee),defined:[],document:s(hee),flow:s(gee),lazy:{},string:s(yee),text:s(vee)};return r;function s(a){return l;function l(u){return Oee(r,a,u)}}}function jee(e){for(;!S6(e););return e}const $3=/[\0\t\n\r]/g;function Pee(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const d=[];let h,m,p,b,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if($3.lastIndex=p,h=$3.exec(a),b=h&&h.index!==void 0?h.index:a.length,x=a.charCodeAt(b),!h){t=a.slice(p);break}if(x===10&&p===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<b&&(d.push(a.slice(p,b)),e+=b-p),x){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const F6={}.hasOwnProperty;function Bee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),zee(n)(jee(Dee(n).document().write(Pee()(e,t,!0))))}function zee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ee),autolinkProtocol:H,autolinkEmail:H,atxHeading:a(Xe),blockQuote:a(Fe),characterEscape:H,characterReference:H,codeFenced:a(De),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(De,l),codeText:a(Te,l),codeTextData:H,data:H,codeFlowValue:H,definition:a(Oe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ze),hardBreakEscape:a(Ye),hardBreakTrailing:a(Ye),htmlFlow:a(Le,l),htmlFlowData:H,htmlText:a(Le,l),htmlTextData:H,image:a(ke),label:l,link:a(Ee),listItem:a(je),listItemValue:b,listOrdered:a(Ie,p),listUnordered:a(Ie),paragraph:a(J),reference:L,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Xe),strong:a(pe),thematicBreak:a(ae)},exit:{atxHeading:d(),atxHeadingSequence:M,autolink:d(),autolinkEmail:xe,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:ce,characterReference:fe,codeFenced:d(w),codeFencedFence:A,codeFencedFenceInfo:x,codeFencedFenceMeta:E,codeFlowValue:P,codeIndented:d(S),codeText:d(V),codeTextData:P,data:P,definition:d(),definitionDestinationString:_,definitionLabelString:k,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(X),hardBreakTrailing:d(X),htmlFlow:d(Z),htmlFlowData:P,htmlText:d(ee),htmlTextData:P,image:d(G),label:se,labelText:Q,lineEnding:Y,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:te,resourceDestinationString:D,resourceTitleString:B,resource:$,setextHeading:d(O),setextHeadingLineSequence:j,setextHeadingText:R,strong:d(),thematicBreak:d()}};$6(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let F={type:"root",children:[]};const le={stack:[F],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:m,data:n},Ce=[];let _e=-1;for(;++_e<K.length;)if(K[_e][1].type==="listOrdered"||K[_e][1].type==="listUnordered")if(K[_e][0]==="enter")Ce.push(_e);else{const Ve=Ce.pop();_e=s(K,Ve,_e)}for(_e=-1;++_e<K.length;){const Ve=t[K[_e][0]];F6.call(Ve,K[_e][1].type)&&Ve[K[_e][1].type].call(Object.assign({sliceSerialize:K[_e][2].sliceSerialize},le),K[_e][1])}if(le.tokenStack.length>0){const Ve=le.tokenStack[le.tokenStack.length-1];(Ve[1]||V3).call(le,void 0,Ve[0])}for(F.position={start:aa(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:aa(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)F=t.transforms[_e](F)||F;return F}function s(K,F,le){let Ce=F-1,_e=-1,Ve=!1,Pe,We,lt,ct;for(;++Ce<=le;){const Ge=K[Ce];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?_e++:_e--,ct=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(Pe&&!ct&&!_e&&!lt&&(lt=Ce),ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ct=void 0}if(!_e&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||_e===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(Pe){let Rt=Ce;for(We=void 0;Rt--;){const jt=K[Rt];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;We&&(K[We][1].type="lineEndingBlank",Ve=!0),jt[1].type="lineEnding",We=Rt}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}lt&&(!We||lt<We)&&(Pe._spread=!0),Pe.end=Object.assign({},We?K[We][1].start:Ge[1].end),K.splice(We||Ce,0,["exit",Pe,Ge[2]]),Ce++,le++}if(Ge[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};Pe=Rt,K.splice(Ce,0,["enter",Rt,Ge[2]]),Ce++,le++,lt=void 0,ct=!0}}}return K[F][1]._spread=Ve,le}function a(K,F){return le;function le(Ce){u.call(this,K(Ce),Ce),F&&F.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(K,F,le){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([F,le||void 0]),K.position={start:aa(F.start),end:void 0}}function d(K){return F;function F(le){K&&K.call(this,le),h.call(this,le)}}function h(K,F){const le=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==K.type&&(F?F.call(this,K,Ce[0]):(Ce[1]||V3).call(this,K,Ce[0]));else throw new Error("Cannot close `"+K.type+"` ("+Xc({start:K.start,end:K.end})+"): it’s not open");le.position.end=aa(K.end)}function m(){return nv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(K){if(this.data.expectingFirstListItemValue){const F=this.stack[this.stack.length-2];F.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function x(){const K=this.resume(),F=this.stack[this.stack.length-1];F.lang=K}function E(){const K=this.resume(),F=this.stack[this.stack.length-1];F.meta=K}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const K=this.resume(),F=this.stack[this.stack.length-1];F.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const K=this.resume(),F=this.stack[this.stack.length-1];F.value=K.replace(/(\r?\n|\r)$/g,"")}function k(K){const F=this.resume(),le=this.stack[this.stack.length-1];le.label=F,le.identifier=Ts(this.sliceSerialize(K)).toLowerCase()}function N(){const K=this.resume(),F=this.stack[this.stack.length-1];F.title=K}function _(){const K=this.resume(),F=this.stack[this.stack.length-1];F.url=K}function M(K){const F=this.stack[this.stack.length-1];if(!F.depth){const le=this.sliceSerialize(K).length;F.depth=le}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function j(K){const F=this.stack[this.stack.length-1];F.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function H(K){const le=this.stack[this.stack.length-1].children;let Ce=le[le.length-1];(!Ce||Ce.type!=="text")&&(Ce=oe(),Ce.position={start:aa(K.start),end:void 0},le.push(Ce)),this.stack.push(Ce)}function P(K){const F=this.stack.pop();F.value+=this.sliceSerialize(K),F.position.end=aa(K.end)}function Y(K){const F=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=F.children[F.children.length-1];le.position.end=aa(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(F.type)&&(H.call(this,K),P.call(this,K))}function X(){this.data.atHardBreak=!0}function Z(){const K=this.resume(),F=this.stack[this.stack.length-1];F.value=K}function ee(){const K=this.resume(),F=this.stack[this.stack.length-1];F.value=K}function V(){const K=this.resume(),F=this.stack[this.stack.length-1];F.value=K}function z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=F,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function G(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const F=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=F,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function Q(K){const F=this.sliceSerialize(K),le=this.stack[this.stack.length-2];le.label=dW(F),le.identifier=Ts(F).toLowerCase()}function se(){const K=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=K.children;le.children=Ce}else le.alt=F}function D(){const K=this.resume(),F=this.stack[this.stack.length-1];F.url=K}function B(){const K=this.resume(),F=this.stack[this.stack.length-1];F.title=K}function $(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function te(K){const F=this.resume(),le=this.stack[this.stack.length-1];le.label=F,le.identifier=Ts(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function ne(K){this.data.characterReferenceType=K.type}function ce(K){const F=this.sliceSerialize(K),le=this.data.characterReferenceType;let Ce;le?(Ce=c6(F,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=sv(F);const _e=this.stack[this.stack.length-1];_e.value+=Ce}function fe(K){const F=this.stack.pop();F.position.end=aa(K.end)}function de(K){P.call(this,K);const F=this.stack[this.stack.length-1];F.url=this.sliceSerialize(K)}function xe(K){P.call(this,K);const F=this.stack[this.stack.length-1];F.url="mailto:"+this.sliceSerialize(K)}function Fe(){return{type:"blockquote",children:[]}}function De(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Xe(){return{type:"heading",depth:0,children:[]}}function Ye(){return{type:"break"}}function Le(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function Ee(){return{type:"link",title:null,url:"",children:[]}}function Ie(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function je(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function J(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function oe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function aa(e){return{line:e.line,column:e.column,offset:e.offset}}function $6(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$6(e,r):Uee(e,r)}}function Uee(e,t){let n;for(n in t)if(F6.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 V3(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Xc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Xc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Xc({start:t.start,end:t.end})+") is still open")}function Hee(e){const t=this;t.parser=n;function n(r){return Bee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Fee(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 $ee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
609
- `}]}function Vee(e,t){const n=t.value?t.value+`
610
- `:"",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 qee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=bu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function Kee(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 Xee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function V6(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 Wee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return V6(e,t);const s={src:bu(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 Qee(e,t){const n={src:bu(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 Zee(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 Jee(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return V6(e,t);const s={href:bu(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 ete(e,t){const n={href:bu(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 tte(e,t,n){const r=e.all(t),s=n?nte(n):q6(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(s||u!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
611
- `}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
612
- `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function nte(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=q6(n[r])}return t}function q6(e){const t=e.spread;return t??e.children.length>1}function rte(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 ste(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ite(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ate(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ote(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)},u=Gs(t.children[1]),d=gm(t.children[t.children.length-1]);u&&d&&(l.position={start:u,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 lte(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,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const p=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let E={type:"element",tagName:a,properties:b,children:[]};p&&(E.children=e.all(p),e.patch(p,E),E=e.applyData(p,E)),h.push(E)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function ute(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const q3=9,Y3=32;function cte(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(G3(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(G3(t.slice(s),s>0,!1)),a.join("")}function G3(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===q3||a===Y3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===q3||a===Y3;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function dte(e,t){const n={type:"text",value:cte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const hte={blockquote:Fee,break:$ee,code:Vee,delete:qee,emphasis:Yee,footnoteReference:Gee,heading:Kee,html:Xee,imageReference:Wee,image:Qee,inlineCode:Zee,linkReference:Jee,link:ete,listItem:tte,list:rte,paragraph:ste,root:ite,strong:ate,table:ote,tableCell:ute,tableRow:lte,text:dte,thematicBreak:fte,toml:Sh,yaml:Sh,definition:Sh,footnoteDefinition:Sh};function Sh(){}function pte(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 mte(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pte,r=e.options.footnoteBackLabel||mte,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),b=bu(p.toLowerCase());let x=0;const E=[],A=e.footnoteCounts.get(p);for(;A!==void 0&&++x<=A;){E.length>0&&E.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,x);typeof k=="string"&&(k={type:"text",value:k}),E.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(k)?k:[k]})}const w=m[m.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const k=w.children[w.children.length-1];k&&k.type==="text"?k.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...E)}else m.push(...E);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!0)};e.patch(h,S),u.push(S)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...wo(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
613
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
614
- `}]}}const rx={}.hasOwnProperty,bte={};function xte(e,t){const n=t||bte,r=new Map,s=new Map,a=new Map,l={...hte,...n.handlers},u={all:h,applyData:vte,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:yte,wrap:Tte};return Ys(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,b=String(m.identifier).toUpperCase();p.has(b)||p.set(b,m)}}),u;function d(m,p){const b=m.type,x=u.handlers[b];if(rx.call(u.handlers,b)&&x)return x(u,m,p);if(u.options.passThrough&&u.options.passThrough.includes(b)){if("children"in m){const{children:A,...w}=m,S=wo(w);return S.children=u.all(m),S}return wo(m)}return(u.options.unknownHandler||Ete)(u,m,p)}function h(m){const p=[];if("children"in m){const b=m.children;let x=-1;for(;++x<b.length;){const E=u.one(b[x],m);if(E){if(x&&b[x-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=K3(E.value)),!Array.isArray(E)&&E.type==="element")){const A=E.children[0];A&&A.type==="text"&&(A.value=K3(A.value))}Array.isArray(E)?p.push(...E):p.push(E)}}}return p}}function yte(e,t){e.position&&(t.position=z4(e))}function vte(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,wo(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function Ete(e,t){const n=t.data||{},r="value"in t&&!(rx.call(n,"hProperties")||rx.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 Tte(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
615
- `});++r<e.length;)r&&n.push({type:"text",value:`
616
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
617
- `}),n}function K3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function X3(e,t){const n=xte(e,t),r=n.one(e,void 0),s=gte(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
618
- `},s),a}function Ste(e,t){return e&&"run"in e?async function(n,r){const s=X3(n,{file:r,...t});await e.run(s,r)}:function(n,r){return X3(n,{file:r,...e||t})}}function W3(e){if(e)throw e}var D1,Q3;function Cte(){if(Q3)return D1;Q3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},u=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return D1=function d(){var h,m,p,b,x,E,A=arguments[0],w=1,S=arguments.length,k=!1;for(typeof A=="boolean"&&(k=A,A=arguments[1]||{},w=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});w<S;++w)if(h=arguments[w],h!=null)for(m in h)p=u(A,m),b=u(h,m),A!==b&&(k&&b&&(a(b)||(x=s(b)))?(x?(x=!1,E=p&&s(p)?p:[]):E=p&&a(p)?p:{},l(A,{name:m,newValue:d(k,E,b)})):typeof b<"u"&&l(A,{name:m,newValue:b}));return A},D1}var wte=Cte();const j1=Ap(wte);function sx(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 kte(){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);u(null,...s);function u(d,...h){const m=e[++a];let p=-1;if(d){l(d);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?Nte(m,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function Nte(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(s);try{d=e.apply(this,l)}catch(h){const m=h;if(u&&n)throw m;return s(m)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const Ps={basename:Ate,dirname:_te,extname:Rte,join:Ite,sep:"/"};function Ate(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Od(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,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function _te(e){if(Od(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 Rte(e){Od(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===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 Ite(...e){let t=-1,n;for(;++t<e.length;)Od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ote(n)}function Ote(e){Od(e);const t=e.codePointAt(0)===47;let n=Mte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Mte(e,t){let n="",r=0,s=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===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 u===46&&a>-1?a++:a=-1}return n}function Od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lte={cwd:Dte};function Dte(){return"/"}function ix(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jte(e){if(typeof e=="string")e=new URL(e);else if(!ix(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 Pte(e)}function Pte(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 P1=["history","path","basename","stem","extname","dirname"];class Bte{constructor(t){let n;t?ix(t)?n={path:t}:typeof t=="string"||zte(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Lte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<P1.length;){const a=P1[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)P1.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Ps.basename(this.path):void 0}set basename(t){z1(t,"basename"),B1(t,"basename"),this.path=Ps.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ps.dirname(this.path):void 0}set dirname(t){Z3(this.basename,"dirname"),this.path=Ps.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ps.extname(this.path):void 0}set extname(t){if(B1(t,"extname"),Z3(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=Ps.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ix(t)&&(t=jte(t)),z1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ps.basename(this.path,this.extname):void 0}set stem(t){z1(t,"stem"),B1(t,"stem"),this.path=Ps.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 ur(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 B1(e,t){if(e&&e.includes(Ps.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ps.sep+"`")}function z1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Z3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function zte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ute=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Hte={}.hasOwnProperty;class fv extends Ute{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=kte()}copy(){const t=new fv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(j1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(F1("data",this.frozen),this.namespace[t]=n,this):Hte.call(this.namespace,t)&&this.namespace[t]||void 0:t?(F1("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=Ch(t),r=this.parser||this.Parser;return U1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),U1("process",this.parser||this.Parser),H1("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Ch(t),d=r.parse(u);r.run(d,u,function(m,p,b){if(m||!p||!b)return h(m);const x=p,E=r.stringify(x,b);Vte(E)?b.value=E:b.result=E,h(m,b)});function h(m,p){m||!p?l(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),U1("processSync",this.parser||this.Parser),H1("processSync",this.compiler||this.Compiler),this.process(t,s),ek("processSync","process",n),r;function s(a,l){n=!0,W3(a),r=l}}run(t,n,r){J3(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,u){const d=Ch(n);s.run(t,d,h);function h(m,p,b){const x=p||t;m?u(m):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),ek("runSync","run",r),s;function a(l,u){W3(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Ch(n),s=this.compiler||this.Compiler;return H1("stringify",s),J3(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(F1("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;d(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");u(h.plugins),h.settings&&(s.settings=j1(!0,s.settings,h.settings))}function u(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===h){b=p;break}if(b===-1)r.push([h,...m]);else if(m.length>0){let[x,...E]=m;const A=r[b][1];sx(A)&&sx(x)&&(x=j1(!0,A,x)),r[b]=[h,x,...E]}}}}const Fte=new fv().freeze();function U1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function H1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function F1(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 J3(e){if(!sx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ek(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ch(e){return $te(e)?e:new Bte(e)}function $te(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Vte(e){return typeof e=="string"||qte(e)}function qte(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function hv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Uo=hv();function Y6(e){Uo=e}var so={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 Yte=(()=>{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)}}>`)},Gte=/^(?:[ \t]*(?:\n|$))+/,Kte=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xte=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Md=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wte=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,G6=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,K6=Bt(G6).replace(/bull/g,pv).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(),Qte=Bt(G6).replace(/bull/g,pv).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(),mv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zte=/^[^\n]+/,gv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jte=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ene=Bt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pv).getRegex(),vm="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",bv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tne=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",bv).replace("tag",vm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X6=Bt(mv).replace("hr",Md).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",vm).getRegex(),nne=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",X6).getRegex(),xv={blockquote:nne,code:Kte,def:Jte,fences:Xte,heading:Wte,hr:Md,html:tne,lheading:K6,list:ene,newline:Gte,paragraph:X6,table:so,text:Zte},tk=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Md).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",vm).getRegex(),rne={...xv,lheading:Qte,table:tk,paragraph:Bt(mv).replace("hr",Md).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tk).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",vm).getRegex()},sne={...xv,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bv).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:so,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(mv).replace("hr",Md).replace("heading",` *#{1,6} *[^
619
- ]`).replace("lheading",K6).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ine=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ane=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,W6=/^( {2,}|\\)\n(?!\s*$)/,one=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xu=/[\p{P}\p{S}]/u,Em=/[\s\p{P}\p{S}]/u,yv=/[^\s\p{P}\p{S}]/u,lne=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Em).getRegex(),Q6=/(?!~)[\p{P}\p{S}]/u,une=/(?!~)[\s\p{P}\p{S}]/u,cne=/(?:[^\s\p{P}\p{S}]|~)/u,dne=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yte?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Z6=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fne=Bt(Z6,"u").replace(/punct/g,xu).getRegex(),hne=Bt(Z6,"u").replace(/punct/g,Q6).getRegex(),J6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pne=Bt(J6,"gu").replace(/notPunctSpace/g,yv).replace(/punctSpace/g,Em).replace(/punct/g,xu).getRegex(),mne=Bt(J6,"gu").replace(/notPunctSpace/g,cne).replace(/punctSpace/g,une).replace(/punct/g,Q6).getRegex(),gne=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,yv).replace(/punctSpace/g,Em).replace(/punct/g,xu).getRegex(),bne=Bt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,xu).getRegex(),xne="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",yne=Bt(xne,"gu").replace(/notPunctSpace/g,yv).replace(/punctSpace/g,Em).replace(/punct/g,xu).getRegex(),vne=Bt(/\\(punct)/,"gu").replace(/punct/g,xu).getRegex(),Ene=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(),Tne=Bt(bv).replace("(?:-->|$)","-->").getRegex(),Sne=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",Tne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Cne=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",yp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),e5=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",yp).replace("ref",gv).getRegex(),t5=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",gv).getRegex(),wne=Bt("reflink|nolink(?!\\()","g").replace("reflink",e5).replace("nolink",t5).getRegex(),nk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vv={_backpedal:so,anyPunctuation:vne,autolink:Ene,blockSkip:dne,br:W6,code:ane,del:so,delLDelim:so,delRDelim:so,emStrongLDelim:fne,emStrongRDelimAst:pne,emStrongRDelimUnd:gne,escape:ine,link:Cne,nolink:t5,punctuation:lne,reflink:e5,reflinkSearch:wne,tag:Sne,text:one,url:so},kne={...vv,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",yp).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yp).getRegex()},ax={...vv,emStrongRDelimAst:mne,emStrongLDelim:hne,delLDelim:bne,delRDelim:yne,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",nk).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",nk).getRegex()},Nne={...ax,br:Bt(W6).replace("{2,}","*").getRegex(),text:Bt(ax.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wh={normal:xv,gfm:rne,pedantic:sne},Sc={normal:vv,gfm:ax,breaks:Nne,pedantic:kne},Ane={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rk=e=>Ane[e];function js(e,t){if(t){if(pr.escapeTest.test(e))return e.replace(pr.escapeReplace,rk)}else if(pr.escapeTestNoEncode.test(e))return e.replace(pr.escapeReplaceNoEncode,rk);return e}function sk(e){try{e=encodeURI(e).replace(pr.percentDecode,"%")}catch{return null}return e}function ik(e,t){let n=e.replace(pr.findPipe,(a,l,u)=>{let d=!1,h=l;for(;--h>=0&&u[h]==="\\";)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 Cc(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 _ne(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 Rne(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 ak(e,t,n,r,s){let a=t.href,l=t.title||null,u=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:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Ine(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
620
- `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[u]=l;return u.length>=s.length?a.slice(s.length):a}).join(`
621
- `)}var vp=class{options;rules;lexer;constructor(e){this.options=e||Uo}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:Cc(n,`
622
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Ine(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=Cc(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:Cc(t[0],`
623
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Cc(t[0],`
624
- `).split(`
625
- `),r="",s="",a=[];for(;n.length>0;){let l=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),l=!0;else if(!l)u.push(n[d]);else break;n=n.slice(d);let h=u.join(`
626
- `),m=h.replace(this.rules.other.blockquoteSetextReplace,`
627
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
628
- ${h}`:h,s=s?`${s}
629
- ${m}`:m;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,a,!0),this.lexer.state.top=p,n.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,E=x.raw+`
630
- `+n.join(`
631
- `),A=this.blockquote(E);a[a.length-1]=A,r=r.substring(0,r.length-x.raw.length)+A.raw,s=s.substring(0,s.length-x.text.length)+A.text;break}else if(b?.type==="list"){let x=b,E=x.raw+`
632
- `+n.join(`
633
- `),A=this.list(E);a[a.length-1]=A,r=r.substring(0,r.length-b.raw.length)+A.raw,s=s.substring(0,s.length-x.raw.length)+A.raw,n=E.substring(a.at(-1).raw.length).split(`
634
- `);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,h="",m="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let p=Rne(t[2].split(`
635
- `,1)[0],t[1].length),b=e.split(`
636
- `,1)[0],x=!p.trim(),E=0;if(this.options.pedantic?(E=2,m=p.trimStart()):x?E=t[1].length+1:(E=p.search(this.rules.other.nonSpaceChar),E=E>4?1:E,m=p.slice(E),E+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(h+=b+`
637
- `,e=e.substring(b.length+1),d=!0),!d){let A=this.rules.other.nextBulletRegex(E),w=this.rules.other.hrRegex(E),S=this.rules.other.fencesBeginRegex(E),k=this.rules.other.headingBeginRegex(E),N=this.rules.other.htmlBeginRegex(E),_=this.rules.other.blockquoteBeginRegex(E);for(;e;){let M=e.split(`
638
- `,1)[0],R;if(b=M,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),R=b):R=b.replace(this.rules.other.tabCharGlobal," "),S.test(b)||k.test(b)||N.test(b)||_.test(b)||A.test(b)||w.test(b))break;if(R.search(this.rules.other.nonSpaceChar)>=E||!b.trim())m+=`
639
- `+R.slice(E);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||k.test(p)||w.test(p))break;m+=`
640
- `+b}x=!b.trim(),h+=M+`
641
- `,e=e.substring(M.length+1),p=R.slice(E)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),s.raw+=h}let u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.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 m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let m={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=m.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=m.raw+d.tokens[0].raw,d.tokens[0].text=m.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(m)):d.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):d.tokens.unshift(m)}}if(!s.loose){let h=d.tokens.filter(p=>p.type==="space"),m=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=m}}if(s.loose)for(let d of s.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.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=ik(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
642
- `):[],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(ik(l,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),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)===`
643
- `?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=Cc(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=_ne(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)),ak(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 ak(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,u=s,d=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+s);(r=h.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]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){d+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+d);let m=[...r[0]][0].length,p=e.slice(0,s+r.index+m+l);if(Math.min(s,l)%2){let x=p.slice(1,-1);return{type:"em",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}let b=p.slice(2,-2);return{type:"strong",raw:p,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,u=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]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let h=[...r[0]][0].length,m=e.slice(0,s+r.index+h+l),p=m.slice(s,-s);return{type:"del",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}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}}}},ls=class ox{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Uo,this.options.tokenizer=this.options.tokenizer||new vp,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:wh.normal,inline:Sc.normal};this.options.pedantic?(n.block=wh.pedantic,n.inline=Sc.pedantic):this.options.gfm&&(n.block=wh.gfm,this.options.breaks?n.inline=Sc.breaks:n.inline=Sc.gfm),this.tokenizer.rules=n}static get rules(){return{block:wh,inline:Sc}}static lex(t,n){return new ox(n).lex(t)}static lexInline(t,n){return new ox(n).inlineTokens(t)}lex(t){t=t.replace(pr.carriageReturn,`
644
- `),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+=`
645
- `: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(`
646
- `)?"":`
647
- `)+s.raw,l.text+=`
648
- `+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(`
649
- `)?"":`
650
- `)+s.raw,l.text+=`
651
- `+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,u=t.slice(1),d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),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(`
652
- `)?"":`
653
- `)+s.raw,l.text+=`
654
- `+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(`
655
- `)?"":`
656
- `)+s.raw,l.text+=`
657
- `+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,u="";for(;t;){l||(u=""),l=!1;let d;if(this.options.extensions?.inline?.some(m=>(d=m.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 m=n.at(-1);d.type==="text"&&m?.type==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,u)){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,u)){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 h=t;if(this.options.extensions?.startInline){let m=1/0,p=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},p),typeof b=="number"&&b>=0&&(m=Math.min(m,b))}),m<1/0&&m>=0&&(h=t.substring(0,m+1))}if(d=this.tokenizer.inlineText(h)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(u=d.raw.slice(-1)),l=!0;let m=n.at(-1);m?.type==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Ep=class{options;parser;constructor(t){this.options=t||Uo}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(pr.notSpaceStart)?.[0],a=t.replace(pr.endingNewline,"")+`
658
- `;return s?'<pre><code class="language-'+js(s)+'">'+(r?a:js(a,!0))+`</code></pre>
659
- `:"<pre><code>"+(r?a:js(a,!0))+`</code></pre>
660
- `}blockquote({tokens:t}){return`<blockquote>
661
- ${this.parser.parse(t)}</blockquote>
662
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
663
- `}hr(t){return`<hr>
664
- `}list(t){let n=t.ordered,r=t.start,s="";for(let u=0;u<t.items.length;u++){let d=t.items[u];s+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
665
- `+s+"</"+a+`>
666
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
667
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
668
- `}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 u=0;u<l.length;u++)r+=this.tablecell(l[u]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
669
- <thead>
670
- `+n+`</thead>
671
- `+s+`</table>
672
- `}tablerow({text:t}){return`<tr>
673
- ${t}</tr>
674
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
675
- `}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>${js(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=sk(t);if(a===null)return s;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+js(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=sk(t);if(a===null)return js(r);t=a;let l=`<img src="${t}" alt="${js(r)}"`;return n&&(l+=` title="${js(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:js(t.text)}},Ev=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}},Es=class lx{options;renderer;textRenderer;constructor(t){this.options=t||Uo,this.options.renderer=this.options.renderer||new Ep,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ev}static parse(t,n){return new lx(n).parse(t)}static parseInline(t,n){return new lx(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,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";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 u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";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 u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},jc=class{options;block;constructor(e){this.options=e||Uo}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?ls.lex:ls.lexInline}provideParser(e=this.block){return e?Es.parse:Es.parseInline}},One=class{defaults=hv();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Es;Renderer=Ep;TextRenderer=Ev;Lexer=ls;Tokenizer=vp;Hooks=jc;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 u of l)r=r.concat(this.walkTokens(u.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 u=a[l].flat(1/0);r=r.concat(this.walkTokens(u,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(...u){let d=a.renderer.apply(this,u);return d===!1&&(d=l.apply(this,u)),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 Ep(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 u=l,d=r.renderer[u],h=a[u];a[u]=(...m)=>{let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p||""}}s.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new vp(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 u=l,d=r.tokenizer[u],h=a[u];a[u]=(...m)=>{let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p}}s.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new jc;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 u=l,d=r.hooks[u],h=a[u];jc.passThroughHooks.has(l)?a[u]=m=>{if(this.defaults.async&&jc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,m);return h.call(a,b)})();let p=d.call(a,m);return h.call(a,p)}:a[u]=(...m)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,m);return b===!1&&(b=await h.apply(a,m)),b})();let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p}}s.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(u){let d=[];return d.push(l.call(this,u)),a&&(d=d.concat(a.call(this,u))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return ls.lex(t,n??this.defaults)}parser(t,n){return Es.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 u=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?ls.lex:ls.lexInline)(u,a),h=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(h,a.walkTokens));let m=await(a.hooks?await a.hooks.provideParser(t):t?Es.parse:Es.parseInline)(h,a);return a.hooks?await a.hooks.postprocess(m):m})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let u=(a.hooks?a.hooks.provideLexer(t):t?ls.lex:ls.lexInline)(n,a);a.hooks&&(u=a.hooks.processAllTokens(u)),a.walkTokens&&this.walkTokens(u,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?Es.parse:Es.parseInline)(u,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(u){return l(u)}}}onError(t,n){return r=>{if(r.message+=`
676
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+js(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},No=new One;function Qt(e,t){return No.parse(e,t)}Qt.options=Qt.setOptions=function(e){return No.setOptions(e),Qt.defaults=No.defaults,Y6(Qt.defaults),Qt};Qt.getDefaults=hv;Qt.defaults=Uo;Qt.use=function(...e){return No.use(...e),Qt.defaults=No.defaults,Y6(Qt.defaults),Qt};Qt.walkTokens=function(e,t){return No.walkTokens(e,t)};Qt.parseInline=No.parseInline;Qt.Parser=Es;Qt.parser=Es.parse;Qt.Renderer=Ep;Qt.TextRenderer=Ev;Qt.Lexer=ls;Qt.lexer=ls.lex;Qt.Tokenizer=vp;Qt.Hooks=jc;Qt.parse=Qt;Qt.options;Qt.setOptions;Qt.use;Qt.walkTokens;Qt.parseInline;Es.parse;ls.lex;var Mne=300,Lne="300px",Dne=500;function jne(e={}){let{immediate:t=!1,debounceDelay:n=Mne,rootMargin:r=Lne,idleTimeout:s=Dne}=e,[a,l]=y.useState(!1),u=y.useRef(null),d=y.useRef(null),h=y.useRef(null),m=y.useMemo(()=>x=>{let E=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-E))})},1)},[]),p=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,E)=>window.requestIdleCallback(x,E):m,[m]),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=u.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null);let E=()=>{d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null)},A=N=>{h.current=p(_=>{_.timeRemaining()>0||_.didTimeout?(l(!0),N.disconnect()):h.current=p(()=>{l(!0),N.disconnect()},{timeout:s/2})},{timeout:s})},w=N=>{E(),d.current=window.setTimeout(()=>{var _,M;let R=N.takeRecords();(R.length===0||(M=(_=R.at(-1))==null?void 0:_.isIntersecting)!=null&&M)&&A(N)},n)},S=(N,_)=>{N.isIntersecting?w(_):E()},k=new IntersectionObserver(N=>{for(let _ of N)S(_,k)},{rootMargin:r,threshold:0});return k.observe(x),()=>{d.current&&clearTimeout(d.current),h.current&&b(h.current),k.disconnect()}},[t,n,r,s,b,p]),{shouldRender:a,containerRef:u}}var n5=/\s/,Pne=/^\s+$/,Bne=new Set(["code","pre","svg","math","annotation"]),zne=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Une=e=>e.some(t=>zne(t)&&Bne.has(t.tagName)),Hne=e=>{let t=[],n="",r=!1;for(let s of e){let a=n5.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},Fne=e=>{let t=[],n="";for(let r of e)n5.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},$ne=(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}]}},Vne=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(Une(t))return Dl;let l=a,u=l.children.indexOf(e);if(u===-1)return;let d=e.value;if(!d.trim()){s.count+=d.length;return}let h=n.sep==="char"?Fne(d):Hne(d),m=r.prevContentLength,p=h.map(b=>{let x=s.count;if(s.count+=b.length,Pne.test(b))return{type:"text",value:b};let E=m>0&&x<m,A=E?0:s.newIndex++*n.stagger;return $ne(b,n.animation,n.duration,n.easing,E,A)});return l.children.splice(u,1,...p),u+p.length},qne=0;function ux(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},u={prevContentLength:0,lastRenderCharCount:0},d=qne++,h=()=>m=>{let p={count:0,newIndex:0};$y(m,"text",(b,x)=>Vne(b,x,l,u,p)),u.lastRenderCharCount=p.count,u.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(m){u.prevContentLength=m},getLastRenderCharCount(){let m=u.lastRenderCharCount;return u.lastRenderCharCount=0,m}}}ux();var r5=y.createContext(!1),Yne=()=>y.useContext(r5),Tv=(...e)=>WN(Lp(e)),Gne=(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(" ")},Kne=e=>e?(...t)=>Gne(e,WN(Lp(t))):Tv,Yl=(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)},cx=y.createContext(Tv),wt=()=>y.useContext(cx),Xne=Tv("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"),Wne=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},Qne=y.memo(({children:e,result:t,language:n,className:r,startLine:s,lineNumbers:a=!0,...l})=>{let u=wt(),d=y.useMemo(()=>u(Xne),[u]),h=y.useMemo(()=>{let m={};return t.bg&&(m["--sdm-bg"]=t.bg),t.fg&&(m["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(m,Wne(t.rootStyle)),m},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:u(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:f.jsx("pre",{className:u(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:f.jsx("code",{className:a?u("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((m,p)=>f.jsx("span",{className:a?d:void 0,children:m.length===0||m.length===1&&m[0].content===""?`
677
- `:m.map((b,x)=>{let E={},A=!!b.bgColor;if(b.color&&(E["--sdm-c"]=b.color),b.bgColor&&(E["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[w,S]of Object.entries(b.htmlStyle))w==="color"?E["--sdm-c"]=S:w==="background-color"?(E["--sdm-tbg"]=S,A=!0):E[w]=S;return f.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",A&&"bg-[var(--sdm-tbg)]",A&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:E,...b.htmlAttrs,children:b.content},x)})},p))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Zne=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=wt();return f.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})},s5=y.createContext({code:""}),i5=()=>y.useContext(s5),Jne=({language:e})=>{let t=wt();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},ere=e=>{let t=e.length;for(;t>0&&e[t-1]===`
678
- `;)t--;return e.slice(0,t)},tre=y.lazy(()=>nu(()=>import("./highlighted-body-OFNGDK62-DHfwpfYy.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),nre=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,lineNumbers:l,...u})=>{let d=wt(),h=y.useMemo(()=>ere(e),[e]),m=y.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
679
- `).map(p=>[{content:p,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return f.jsx(s5.Provider,{value:{code:e},children:f.jsxs(Zne,{isIncomplete:s,language:t,children:[f.jsx(Jne,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.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,f.jsx(y.Suspense,{fallback:f.jsx(Qne,{className:n,language:t,lineNumbers:l,result:m,startLine:a,...u}),children:f.jsx(tre,{className:n,code:h,language:t,lineNumbers:l,raw:m,startLine:a,...u})})]})})},rre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),sre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),ire=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),are=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),ore=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),lre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),ure=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),cre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),dre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),fre=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.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"})}),Pc={CheckIcon:rre,CopyIcon:sre,DownloadIcon:ire,ExternalLinkIcon:cre,Loader2Icon:are,Maximize2Icon:ore,RotateCcwIcon:lre,XIcon:ure,ZoomInIcon:dre,ZoomOutIcon:fre},a5=y.createContext(Pc),hre=(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])},ok=({icons:e,children:t})=>{let n=y.useRef(e),r=y.useRef(e?{...Pc,...e}:Pc);hre(n.current,e)||(n.current=e,r.current=e?{...Pc,...e}:Pc);let s=r.current;return f.jsx(a5.Provider,{value:s,children:t})},As=()=>y.useContext(a5),o5={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"},dx=y.createContext(o5),Mi=()=>y.useContext(dx),lk=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...l})=>{let u=wt(),[d,h]=y.useState(!1),m=y.useRef(0),{code:p}=i5(),{isAnimating:b}=y.useContext(Gr),x=Mi(),E=a??p,A=async()=>{var k;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(E),h(!0),e?.(),m.current=window.setTimeout(()=>h(!1),n))}catch(N){t?.(N)}};y.useEffect(()=>()=>{window.clearTimeout(m.current)},[]);let w=As(),S=d?w.CheckIcon:w.CopyIcon;return f.jsx("button",{className:u("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:A,title:x.copyCode,type:"button",...l,children:r??f.jsx(S,{size:14})})},uk={"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"},pre=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...l})=>{let u=wt(),{code:d}=i5(),{isAnimating:h}=y.useContext(Gr),m=Mi(),p=As(),b=a??d,x=`file.${n&&n in uk?uk[n]:"txt"}`,E="text/plain",A=()=>{try{Yl(x,b,E),e?.()}catch(w){t?.(w)}};return f.jsx("button",{className:u("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:h,onClick:A,title:m.downloadFile,type:"button",...l,children:r??f.jsx(p.DownloadIcon,{size:14})})},ck=()=>{let{Loader2Icon:e}=As(),t=wt();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},mre=/\.[^/.]+$/,gre=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...l})=>{let{DownloadIcon:u}=As(),d=wt(),h=y.useRef(null),[m,p]=y.useState(!1),[b,x]=y.useState(!1),E=Mi(),A=l.width!=null||l.height!=null,w=(m||A)&&!b,S=b&&!A;y.useEffect(()=>{let M=h.current;if(M!=null&&M.complete){let R=M.naturalWidth>0;p(R),x(!R)}},[]);let k=y.useCallback(M=>{p(!0),x(!1),s?.(M)},[s]),N=y.useCallback(M=>{p(!1),x(!0),a?.(M)},[a]),_=async()=>{if(n)try{let M=await(await fetch(n)).blob(),R=new URL(n,window.location.origin).pathname.split("/").pop()||"",j=R.split(".").pop(),O=R.includes(".")&&j!==void 0&&j.length<=4,H="";if(O)H=R;else{let P=M.type,Y="png";P.includes("jpeg")||P.includes("jpg")?Y="jpg":P.includes("png")?Y="png":P.includes("svg")?Y="svg":P.includes("gif")?Y="gif":P.includes("webp")&&(Y="webp"),H=`${(r||R||"image").replace(mre,"")}.${Y}`}Yl(H,M,M.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:N,onLoad:k,ref:h,src:n,...l}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:E.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),w&&f.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:_,title:E.downloadImage,type:"button",children:f.jsx(u,{size:14})})]}):null},Wc=0,Sv=()=>{Wc+=1,Wc===1&&(document.body.style.overflow="hidden")},Cv=()=>{Wc=Math.max(0,Wc-1),Wc===0&&(document.body.style.overflow="")},bre=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:l,XIcon:u}=As(),d=wt(),[h,m]=y.useState(!1),p=Mi(),b=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},[e]),x=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){Sv();let E=A=>{A.key==="Escape"&&n()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),Cv()}}},[t,n]),t?f.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:E=>{E.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.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:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:[f.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:p.close,type:"button",children:f.jsx(u,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(l,{size:20}),f.jsx("span",{children:p.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:p.externalLinkWarning})]}),f.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}),f.jsxs("div",{className:d("flex gap-2"),children:[f.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:h?f.jsxs(f.Fragment,{children:[f.jsx(s,{size:14}),f.jsx("span",{children:p.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:p.copyLink})]})}),f.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:[f.jsx(l,{size:14}),f.jsx("span",{children:p.openLink})]})]})]})}):null},fx=y.createContext(null),wv=()=>y.useContext(fx),Boe=()=>{var e;let t=wv();return(e=t?.code)!=null?e:null},kv=()=>{var e;let t=wv();return(e=t?.mermaid)!=null?e:null},xre=e=>{var t;let n=wv();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},yre=(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))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let d=document.createElement("canvas"),h=u.width*r,m=u.height*r;d.width=h,d.height=m;let p=d.getContext("2d");if(!p){a(new Error("Failed to create 2D canvas context for PNG export"));return}p.drawImage(u,0,0,h,m),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}s(b)},"image/png")},u.onerror=()=>a(new Error("Failed to load SVG image")),u.src=l})},vre=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let l=wt(),[u,d]=y.useState(!1),h=y.useRef(null),{isAnimating:m}=y.useContext(Gr),p=As(),b=kv(),x=Mi(),E=async A=>{try{if(A==="mmd"){Yl("diagram.mmd",e,"text/plain"),d(!1),r?.(A);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let w=b.getMermaid(s),S=e.split("").reduce((_,M)=>(_<<5)-_+M.charCodeAt(0)|0,0),k=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:N}=await w.render(k,e);if(!N){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(A==="svg"){Yl("diagram.svg",N,"image/svg+xml"),d(!1),r?.(A);return}if(A==="png"){let _=await yre(N);Yl("diagram.png",_,"image/png"),r?.(A),d(!1);return}}catch(w){a?.(w)}};return y.useEffect(()=>{let A=w=>{let S=w.composedPath();h.current&&!S.includes(h.current)&&d(!1)};return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[]),f.jsxs("div",{className:l("relative"),ref:h,children:[f.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:m,onClick:()=>d(!u),title:x.downloadDiagram,type:"button",children:t??f.jsx(p.DownloadIcon,{size:14})}),u?f.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:[f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},Ere=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:l,XIcon:u}=As(),d=wt(),[h,m]=y.useState(!1),{isAnimating:p,controls:b}=y.useContext(Gr),x=Mi(),E=(()=>{if(typeof b=="boolean")return b;let w=b.mermaid;return w===!1?!1:w===!0||w===void 0?!0:w.panZoom!==!1})(),A=()=>{m(!h)};return y.useEffect(()=>{if(h){Sv();let w=S=>{S.key==="Escape"&&m(!1)};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w),Cv()}}},[h]),y.useEffect(()=>{h?n?.():r&&r()},[h,n,r]),f.jsxs(f.Fragment,{children:[f.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:p,onClick:A,title:x.viewFullscreen,type:"button",...a,children:f.jsx(l,{size:14})}),h?or.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:A,onKeyDown:w=>{w.key==="Escape"&&A()},role:"button",tabIndex:0,children:[f.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:A,title:x.exitFullscreen,type:"button",children:f.jsx(u,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),role:"presentation",children:f.jsx(F5,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:E})})]}),document.body):null]})},l5=e=>{var t,n;let r=[],s=[],a=e.querySelectorAll("thead th");for(let u of a)r.push(((t=u.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let u of l){let d=[],h=u.querySelectorAll("td");for(let m of h)d.push(((n=m.textContent)==null?void 0:n.trim())||"");s.push(d)}return{headers:r,rows:s}},u5=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1,h=!1;for(let m of u){if(m==='"'){d=!0,h=!0;break}(m===","||m===`
680
- `)&&(d=!0)}return d?h?`"${u.replace(/"/g,'""')}"`:`"${u}"`:u},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 u of n)a[l]=u.map(r).join(","),l+=1;return a.join(`
681
- `)},Tre=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1;for(let m of u)if(m===" "||m===`
682
- `||m==="\r"){d=!0;break}if(!d)return u;let h=[];for(let m of u)m===" "?h.push("\\t"):m===`
683
- `?h.push("\\n"):m==="\r"?h.push("\\r"):h.push(m);return h.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 u of n)a[l]=u.map(r).join(" "),l+=1;return a.join(`
684
- `)},$1=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("")},hx=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,a=t.map(u=>$1(u));r[s]=`| ${a.join(" | ")} |`,s+=1;let l=new Array(t.length);for(let u=0;u<t.length;u+=1)l[u]="---";r[s]=`| ${l.join(" | ")} |`,s+=1;for(let u of n)if(u.length<t.length){let d=new Array(t.length);for(let h=0;h<t.length;h+=1)d[h]=h<u.length?$1(u[h]):"";r[s]=`| ${d.join(" | ")} |`,s+=1}else{let d=u.map(h=>$1(h));r[s]=`| ${d.join(" | ")} |`,s+=1}return r.join(`
685
- `)},c5=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=wt(),[l,u]=y.useState(!1),[d,h]=y.useState(!1),m=y.useRef(null),p=y.useRef(0),{isAnimating:b}=y.useContext(Gr),x=Mi(),E=async S=>{var k,N;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.write)){r?.(new Error("Clipboard API not available"));return}try{let _=(N=m.current)==null?void 0:N.closest('[data-streamdown="table-wrapper"]'),M=_?.querySelector("table");if(!M){r?.(new Error("Table not found"));return}let R=l5(M),j=({csv:u5,tsv:Tre,md:hx}[S]||hx)(R),O=new ClipboardItem({"text/plain":new Blob([j],{type:"text/plain"}),"text/html":new Blob([M.outerHTML],{type:"text/html"})});await navigator.clipboard.write([O]),h(!0),u(!1),n?.(S),p.current=window.setTimeout(()=>h(!1),s)}catch(_){r?.(_)}};y.useEffect(()=>{let S=k=>{let N=k.composedPath();m.current&&!N.includes(m.current)&&u(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(p.current)}},[]);let A=As(),w=d?A.CheckIcon:A.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:m,children:[f.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:()=>u(!l),title:x.copyTable,type:"button",children:e??f.jsx(w,{height:14,width:14})}),l?f.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:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>E("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},d5=({children:e,className:t,onDownload:n,onError:r})=>{let s=wt(),[a,l]=y.useState(!1),u=y.useRef(null),{isAnimating:d}=y.useContext(Gr),h=Mi(),m=As(),p=b=>{var x;try{let E=(x=u.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),A=E?.querySelector("table");if(!A){r?.(new Error("Table not found"));return}let w=l5(A),S=b==="csv"?u5(w):hx(w);Yl(`table.${b==="csv"?"csv":"md"}`,S,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(E){r?.(E)}};return y.useEffect(()=>{let b=x=>{let E=x.composedPath();u.current&&!E.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),f.jsxs("div",{className:s("relative"),ref:u,children:[f.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:h.downloadTable,type:"button",children:e??f.jsx(m.DownloadIcon,{size:14})}),a?f.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:[f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},Sre=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=As(),l=wt(),[u,d]=y.useState(!1),{isAnimating:h}=y.useContext(Gr),m=Mi(),p=()=>{d(!0)},b=()=>{d(!1)};return y.useEffect(()=>{if(u){Sv();let x=E=>{E.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),Cv()}}},[u]),f.jsxs(f.Fragment,{children:[f.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:h,onClick:p,title:m.viewFullscreen,type:"button",children:f.jsx(s,{size:14})}),u?or.createPortal(f.jsx("div",{"aria-label":m.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:f.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(c5,{}):null,r?f.jsx(d5,{}):null,f.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:m.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},Cre=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...l})=>{let u=wt(),d=n&&r,h=n&&s,m=n&&a,p=d||h||m;return f.jsxs("div",{className:u("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[p?f.jsxs("div",{className:u("flex items-center justify-end gap-1"),children:[d?f.jsx(c5,{}):null,h?f.jsx(d5,{}):null,m?f.jsx(Sre,{showCopy:d,showDownload:h,children:e}):null]}):null,f.jsx("div",{className:u("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:u("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},wre=/startLine=(\d+)/,kre=/\bnoLineNumbers\b/,Nre=y.lazy(()=>nu(()=>Promise.resolve().then(()=>Doe),void 0).then(e=>({default:e.Mermaid}))),Are=/language-([^\s]+)/;function Tm(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 Sn(e,t){return e.className===t.className&&Tm(e.node,t.node)}var px=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,V1=(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},dk=(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},kh=(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},Nv=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Sn(e,t));Nv.displayName="MarkdownOl";var f5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Tm(e.node,t.node));f5.displayName="MarkdownLi";var h5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Sn(e,t));h5.displayName="MarkdownUl";var p5=y.memo(({className:e,node:t,...n})=>{let r=wt();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Sn(e,t));p5.displayName="MarkdownHr";var m5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Sn(e,t));m5.displayName="MarkdownStrong";var _re=({children:e,className:t,href:n,node:r,...s})=>{let a=wt(),{linkSafety:l}=y.useContext(Gr),[u,d]=y.useState(!1),h=n==="streamdown:incomplete-link",m=y.useCallback(async E=>{if(!(!(l!=null&&l.enabled&&n)||h)){if(E.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,h]),p=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=y.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:u,onClose:b,onConfirm:p};return l!=null&&l.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:m,type:"button",children:e}),l.renderModal?l.renderModal(x):f.jsx(bre,{...x})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},g5=y.memo(_re,(e,t)=>Sn(e,t)&&e.href===t.href);g5.displayName="MarkdownA";var b5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Sn(e,t));b5.displayName="MarkdownH1";var x5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Sn(e,t));x5.displayName="MarkdownH2";var y5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Sn(e,t));y5.displayName="MarkdownH3";var v5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Sn(e,t));v5.displayName="MarkdownH4";var E5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Sn(e,t));E5.displayName="MarkdownH5";var T5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Sn(e,t));T5.displayName="MarkdownH6";var S5=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=y.useContext(Gr),a=px(s,"table"),l=V1(s,"copy"),u=V1(s,"download"),d=V1(s,"fullscreen");return f.jsx(Cre,{className:t,showControls:a,showCopy:l,showDownload:u,showFullscreen:d,...r,children:e})},(e,t)=>Sn(e,t));S5.displayName="MarkdownTable";var C5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Sn(e,t));C5.displayName="MarkdownThead";var w5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Sn(e,t));w5.displayName="MarkdownTbody";var k5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Sn(e,t));k5.displayName="MarkdownTr";var N5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.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)=>Sn(e,t));N5.displayName="MarkdownTh";var A5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Sn(e,t));A5.displayName="MarkdownTd";var _5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.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)=>Sn(e,t));_5.displayName="MarkdownBlockquote";var R5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Sn(e,t));R5.displayName="MarkdownSup";var I5=y.memo(({children:e,className:t,node:n,...r})=>{let s=wt();return f.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Sn(e,t));I5.displayName="MarkdownSub";var O5=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=l=>{var u,d;if(!y.isValidElement(l))return!1;let h=Array.isArray(l.props.children)?l.props.children:[l.props.children],m=!1,p=!1;for(let b of h)if(b){if(typeof b=="string")b.trim()!==""&&(m=!0);else if(y.isValidElement(b))if(((u=b.props)==null?void 0:u["data-footnote-backref"])!==void 0)p=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let E of x){if(typeof E=="string"&&E.trim()!==""){m=!0;break}if(y.isValidElement(E)&&((d=E.props)==null?void 0:d["data-footnote-backref"])===void 0){m=!0;break}}}}return p&&!m},a=Array.isArray(e)?e.map(l=>{if(!y.isValidElement(l))return l;if(l.type===Nv){let u=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!s(d));return u.length===0?null:{...l,props:{...l.props,children:u}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Sn(e,t));O5.displayName="MarkdownSection";var Rre=({node:e,className:t,children:n,...r})=>{var s,a;let l=wt(),u=!("data-block"in r),{mermaid:d,controls:h,lineNumbers:m}=y.useContext(Gr),p=kv(),b=Yne(),x=t?.match(Are),E=(s=x?.at(1))!=null?s:"",A=xre(E);if(u)return f.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 w=(a=e?.properties)==null?void 0:a.metastring,S=w?.match(wre),k=S?Number.parseInt(S[1],10):void 0,N=k!==void 0&&k>=1?k:void 0,_=!(w&&kre.test(w))&&m!==!1,M="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?M=n.props.children:typeof n=="string"&&(M=n),A){let H=A.component;return f.jsx(y.Suspense,{fallback:f.jsx(ck,{}),children:f.jsx(H,{code:M,isIncomplete:b,language:E,meta:w})})}if(E==="mermaid"&&p){let H=px(h,"mermaid"),P=kh(h,"download"),Y=kh(h,"copy"),X=kh(h,"fullscreen"),Z=kh(h,"panZoom"),ee=H&&(P||Y||X);return f.jsx(y.Suspense,{fallback:f.jsx(ck,{}),children:f.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:[f.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),ee?f.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.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:[P?f.jsx(vre,{chart:M,config:d?.config}):null,Y?f.jsx(lk,{code:M}):null,X?f.jsx(Ere,{chart:M,config:d?.config}):null]})}):null,f.jsx("div",{className:l("rounded-md border border-border bg-background"),children:f.jsx(Nre,{chart:M,config:d?.config,showControls:Z})})]})})}let R=px(h,"code"),j=dk(h,"download"),O=dk(h,"copy");return f.jsx(nre,{className:t,code:M,isIncomplete:b,language:E,lineNumbers:_,startLine:N,children:R?f.jsxs(f.Fragment,{children:[j?f.jsx(pre,{code:M,language:E}):null,O?f.jsx(lk,{}):null]}):null})},M5=y.memo(Rre,(e,t)=>e.className===t.className&&Tm(e.node,t.node));M5.displayName="MarkdownCode";var L5=y.memo(gre,(e,t)=>e.className===t.className&&Tm(e.node,t.node));L5.displayName="MarkdownImg";var D5=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 f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Sn(e,t));D5.displayName="MarkdownParagraph";var Ire={ol:Nv,li:f5,ul:h5,hr:p5,strong:m5,a:g5,h1:b5,h2:x5,h3:y5,h4:v5,h5:E5,h6:T5,table:S5,thead:C5,tbody:w5,tr:k5,th:N5,td:A5,blockquote:_5,code:M5,img:L5,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:R5,sub:I5,p:D5,section:O5},Ore=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Mre=/\p{L}/u;function fk(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(Ore.test(n))return"rtl";if(Mre.test(n))return"ltr"}return"ltr"}var Lre=/^[ \t]{0,3}(`{3,}|~{3,})/,Dre=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,hk=e=>{let t=e.split(`
686
- `),n=null,r=0;for(let s of t){let a=Lre.exec(s);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],u=l[0],d=l.length;u===n&&d>=r&&(n=null,r=0)}}return n!==null},jre=e=>{let t=e.split(`
687
- `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&Dre.test(r))return!0}return!1},Pre=()=>e=>{Ys(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},pk=[],mk={allowDangerousHtml:!0},Nh=new WeakMap,Bre=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 m="default";return this.keyCache.set(e,m),m}let a=m=>{if(!m||m.length===0)return"";let p="";for(let b=0;b<m.length;b+=1){let x=m[b];if(b>0&&(p+=","),Array.isArray(x)){let[E,A]=x;if(typeof E=="function"){let w=Nh.get(E);w||(w=E.name,Nh.set(E,w)),p+=w}else p+=String(E);p+=":",p+=JSON.stringify(A)}else if(typeof x=="function"){let E=Nh.get(x);E||(E=x.name,Nh.set(x,E)),p+=E}else p+=String(x)}return p},l=a(n),u=a(r),d=s?JSON.stringify(s):"",h=`${u}::${l}::${d}`;return this.keyCache.set(e,h),h}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()}},gk=new Bre,j5=e=>{let t=zre(e),n=e.children||"",r=t.runSync(t.parse(n),n);return Yre(r,e)},zre=e=>{let t=gk.get(e);if(t)return t;let n=Hre(e);return gk.set(e,n),n},Ure=e=>e.some(t=>Array.isArray(t)?t[0]===Zb:t===Zb),Hre=e=>{let t=e.rehypePlugins||pk,n=e.remarkPlugins||pk,r=Ure(t)?n:[...n,Pre],s=e.remarkRehypeOptions?{...mk,...e.remarkRehypeOptions}:mk;return Fte().use(Hee).use(r).use(Ste,s).use(t)},Fre=e=>e,$re=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Vre=(e,t)=>{var n;for(let r in L1)if(Object.hasOwn(L1,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=L1[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},qre=(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},Yre=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:a,unwrapDisallowed:l,urlTransform:u}=t;if(n||r||s||a||u){let d=u||Fre;Ys(e,(h,m,p)=>{if(h.type==="raw"&&p&&typeof m=="number")return $re(p,m,a,h.value),m;if(h.type==="element"&&(Vre(h,d),qre(h,m,p,r,s,n)&&p&&typeof m=="number"))return l&&h.children?p.children.splice(m,1,...h.children):p.children.splice(m,1),m})}return XJ(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},Gre=/\[\^[\w-]{1,200}\](?!:)/,Kre=/\[\^[\w-]{1,200}\]:/,Xre=/<(\w+)[\s>]/,Wre=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bk=new Map,xk=new Map,Qre=e=>{let t=e.toLowerCase(),n=bk.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return bk.set(t,r),r},Zre=e=>{let t=e.toLowerCase(),n=xk.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return xk.set(t,r),r},yk=(e,t)=>{if(Wre.has(t.toLowerCase()))return 0;let n=e.match(Qre(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},vk=(e,t)=>{let n=e.match(Zre(t));return n?n.length:0},Jre=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},ese=e=>{let t=Gre.test(e),n=Kre.test(e);if(t||n)return[e];let r=ls.lex(e,{gfm:!0}),s=[],a=[],l=!1;for(let u of r){let d=u.raw,h=s.length;if(a.length>0){s[h-1]+=d;let m=a.at(-1),p=yk(d,m),b=vk(d,m);for(let x=0;x<p;x+=1)a.push(m);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===m&&a.pop();continue}if(u.type==="html"&&u.block){let m=d.match(Xre);if(m){let p=m[1],b=yk(d,p),x=vk(d,p);b>x&&a.push(p)}}if(h>0&&!l){let m=s[h-1];if(Jre(m)%2===1){s[h-1]=m+d;continue}}s.push(d),u.type!=="space"&&(l=u.type==="code")}return s},tse=(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,u,d)=>{if(!u.includes(`
688
-
689
- `))return l+u+d;let h=u.replace(/\n\n/g,`
690
- <!---->
691
- `),m=(h.startsWith(`
692
- `)?"":`
693
- `)+h+(h.endsWith(`
694
- `)?"":`
695
- `);return`${l}${m}${d}
696
-
697
- `})}return n},nse=/([\\`*_~[\]|])/g,rse=e=>e.replace(nse,"\\$1"),sse=(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,u,d)=>{let h=rse(u).replace(/\n\n/g,"&#10;&#10;");return l+h+d})}return n},P5=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(P5).join(""):"",ise=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Ys(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=P5(r);r.children=s?[{type:"text",value:s}]:[]}})},ase=()=>e=>{Ys(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})})},ose=/^[ \t]*<[\w!/?-]/,lse=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,use=e=>typeof e!="string"||e.length===0||!ose.test(e)?e:e.replace(lse,"$1"),Ek,Tk,Sk,Ck,Vh={...ro,protocols:{...ro.protocols,href:[...(Tk=(Ek=ro.protocols)==null?void 0:Ek.href)!=null?Tk:[],"tel"]},attributes:{...ro.attributes,code:[...(Ck=(Sk=ro.attributes)==null?void 0:Sk.code)!=null?Ck:[],"metastring"]}},mx={raw:Zb,sanitize:[G4,Vh],harden:[sq,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},cse={gfm:[TZ,{}],codeMeta:ase},wk=Object.values(mx),dse=Object.values(cse),fse={block:" ▋",circle:" ●"},B5=["github-light","github-dark"],z5={enabled:!0},hse={shikiTheme:B5,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:z5},Gr=y.createContext(hse),U5=y.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:a,animatePlugin:l,...u})=>{if(l){let m=l.getLastRenderCharCount();l.setPrevContentLength(m)}let d=typeof e=="string"&&n?use(e):e,h=f.jsx(j5,{...u,children:d});return f.jsx(r5.Provider,{value:s,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:h}):h})},(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)});U5.displayName="Block";var H5=y.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:l=wk,remarkPlugins:u=dse,className:d,shikiTheme:h=B5,mermaid:m,controls:p=!0,isAnimating:b=!1,animated:x,BlockComponent:E=U5,parseMarkdownIntoBlocksFn:A=ese,caret:w,plugins:S,remend:k,linkSafety:N=z5,lineNumbers:_=!0,allowedTags:M,literalTagContent:R,translations:j,icons:O,prefix:H,onAnimationStart:P,onAnimationEnd:Y,...X})=>{let Z=y.useId(),[ee,V]=y.useTransition(),z=y.useMemo(()=>Kne(H),[H]),G=y.useRef(null),Q=y.useRef(P),se=y.useRef(Y);Q.current=P,se.current=Y,y.useEffect(()=>{var ke,Ee,Ie;if(t==="static")return;let je=G.current;if(G.current=b,je===null){b&&((ke=Q.current)==null||ke.call(Q));return}b&&!je?(Ee=Q.current)==null||Ee.call(Q):!b&&je&&((Ie=se.current)==null||Ie.call(se))},[b,t]);let D=y.useMemo(()=>M?Object.keys(M):[],[M]),B=y.useMemo(()=>{if(typeof e!="string")return"";let ke=t==="streaming"&&r?MJ(e,k):e;return R&&R.length>0&&(ke=sse(ke,R)),D.length>0&&(ke=tse(ke,D)),ke},[e,t,r,k,D,R]),$=y.useMemo(()=>A(B),[B,A]),[L,te]=y.useState($);y.useEffect(()=>{t==="streaming"&&!xe?V(()=>{te($)}):te($)},[$,t]);let ne=t==="streaming"?L:$,ce=y.useMemo(()=>n==="auto"?ne.map(fk):void 0,[ne,n]),fe=y.useMemo(()=>ne.map((ke,Ee)=>`${Z}-${Ee}`),[ne.length,Z]),de=y.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),xe=y.useMemo(()=>de?de==="true"?ux():ux(x):null,[de]),Fe=y.useMemo(()=>{var ke,Ee;return{shikiTheme:(Ee=(ke=S?.code)==null?void 0:ke.getThemes())!=null?Ee:h,controls:p,isAnimating:b,lineNumbers:_,mode:t,mermaid:m,linkSafety:N}},[h,p,b,_,t,m,N,S?.code]),De=y.useMemo(()=>j?JSON.stringify(j):"",[j]),Te=y.useMemo(()=>({...o5,...j}),[De]),Oe=y.useMemo(()=>{let{inlineCode:ke,...Ee}=a??{},Ie={...Ire,...Ee};if(ke){let je=Ie.code;Ie.code=J=>"data-block"in J?je?y.createElement(je,J):null:y.createElement(ke,J)}return Ie},[a]),ze=y.useMemo(()=>{let ke=[];return S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsBefore]),ke=[...ke,...u],S!=null&&S.cjk&&(ke=[...ke,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(ke=[...ke,S.math.remarkPlugin]),ke},[u,S?.math,S?.cjk]),Xe=y.useMemo(()=>{var ke;let Ee=l;if(M&&Object.keys(M).length>0&&l===wk){let Ie={...Vh,tagNames:[...(ke=Vh.tagNames)!=null?ke:[],...Object.keys(M)],attributes:{...Vh.attributes,...M}};Ee=[mx.raw,[G4,Ie],mx.harden]}return R&&R.length>0&&(Ee=[...Ee,[ise,R]]),S!=null&&S.math&&(Ee=[...Ee,S.math.rehypePlugin]),xe&&b&&(Ee=[...Ee,xe.rehypePlugin]),Ee},[l,S?.math,xe,b,M,R]),Ye=y.useMemo(()=>{if(!b||ne.length===0)return!1;let ke=ne.at(-1);return hk(ke)||jre(ke)},[b,ne]),Le=y.useMemo(()=>w&&b&&!Ye?{"--streamdown-caret":`"${fse[w]}"`}:void 0,[w,b,Ye]);return t==="static"?f.jsx(dx.Provider,{value:Te,children:f.jsx(fx.Provider,{value:S??null,children:f.jsx(Gr.Provider,{value:Fe,children:f.jsx(ok,{icons:O,children:f.jsx(cx.Provider,{value:z,children:f.jsx("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?fk(B):n,children:f.jsx(j5,{components:Oe,rehypePlugins:Xe,remarkPlugins:ze,...X,children:B})})})})})})}):f.jsx(dx.Provider,{value:Te,children:f.jsx(fx.Provider,{value:S??null,children:f.jsx(Gr.Provider,{value:Fe,children:f.jsx(ok,{icons:O,children:f.jsx(cx.Provider,{value:z,children:f.jsxs("div",{className:z("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",w&&!Ye?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:Le,children:[ne.length===0&&w&&b&&f.jsx("span",{}),ne.map((ke,Ee)=>{var Ie;let je=Ee===ne.length-1,J=b&&je&&hk(ke);return f.jsx(E,{animatePlugin:xe,components:Oe,content:ke,dir:(Ie=ce?.[Ee])!=null?Ie:n!=="auto"?n:void 0,index:Ee,isIncomplete:J,rehypePlugins:Xe,remarkPlugins:ze,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...X},fe[Ee])})]})})})})})})},(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);H5.displayName="Streamdown";var pse=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:l=1,fullscreen:u=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:h,ZoomOutIcon:m}=As(),p=wt(),b=y.useRef(null),x=y.useRef(null),[E,A]=y.useState(l),[w,S]=y.useState({x:0,y:0}),[k,N]=y.useState(!1),[_,M]=y.useState({x:0,y:0}),[R,j]=y.useState({x:0,y:0}),O=y.useCallback(z=>{A(G=>Math.max(n,Math.min(r,G+z)))},[n,r]),H=y.useCallback(()=>{O(s)},[O,s]),P=y.useCallback(()=>{O(-s)},[O,s]),Y=y.useCallback(()=>{A(l),S({x:0,y:0})},[l]),X=y.useCallback(z=>{z.preventDefault();let G=z.deltaY>0?-s:s;O(G)},[O,s]),Z=y.useCallback(z=>{if(z.button!==0||z.isPrimary===!1)return;N(!0),M({x:z.clientX,y:z.clientY}),j(w);let G=z.currentTarget;G instanceof HTMLElement&&G.setPointerCapture(z.pointerId)},[w]),ee=y.useCallback(z=>{if(!k)return;z.preventDefault();let G=z.clientX-_.x,Q=z.clientY-_.y;S({x:R.x+G,y:R.y+Q})},[k,_,R]),V=y.useCallback(z=>{N(!1);let G=z.currentTarget;G instanceof HTMLElement&&G.releasePointerCapture(z.pointerId)},[]);return y.useEffect(()=>{let z=b.current;if(z)return z.addEventListener("wheel",X,{passive:!1}),()=>{z.removeEventListener("wheel",X)}},[X]),y.useEffect(()=>{let z=x.current;if(z&&k)return document.body.style.userSelect="none",z.addEventListener("pointermove",ee,{passive:!1}),z.addEventListener("pointerup",V),z.addEventListener("pointercancel",V),()=>{document.body.style.userSelect="",z.removeEventListener("pointermove",ee),z.removeEventListener("pointerup",V),z.removeEventListener("pointercancel",V)}},[k,ee,V]),f.jsxs("div",{className:p("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:k?"grabbing":"grab"},children:[a?f.jsxs("div",{className:p("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",u?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{className:p("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:E>=r,onClick:H,title:"Zoom in",type:"button",children:f.jsx(h,{size:16})}),f.jsx("button",{className:p("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:E<=n,onClick:P,title:"Zoom out",type:"button",children:f.jsx(m,{size:16})}),f.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:Y,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.jsx("div",{className:p("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:Z,ref:x,role:"application",style:{transform:`translate(${w.x}px, ${w.y}px) scale(${E})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},F5=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=wt(),[l,u]=y.useState(null),[d,h]=y.useState(!1),[m,p]=y.useState(""),[b,x]=y.useState(""),[E,A]=y.useState(0),{mermaid:w}=y.useContext(Gr),S=kv(),k=w?.errorComponent,{shouldRender:N,containerRef:_}=jne({immediate:r});if(y.useEffect(()=>{if(N){if(!S){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{u(null),h(!0);let R=S.getMermaid(n),j=e.split("").reduce((P,Y)=>(P<<5)-P+Y.charCodeAt(0)|0,0),O=`mermaid-${Math.abs(j)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:H}=await R.render(O,e);p(H),x(H)}catch(R){if(!(b||m)){let j=R instanceof Error?R.message:"Failed to render Mermaid chart";u(j)}}finally{h(!1)}})()}},[e,n,E,N,S]),!(N||m||b))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:_});if(d&&!m&&!b)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:_,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!m&&!b){let R=()=>A(j=>j+1);return k?f.jsx("div",{ref:_,children:f.jsx(k,{chart:e,error:l,retry:R})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:_,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let M=m||b;return f.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:_,children:f.jsx(pse,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:M},role:"img"})})})};const mse=["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(" "),q1=e=>function({className:n}){return f.jsx("span",{"aria-hidden":!0,className:ye("font-mono text-body-sm leading-5",n),children:e})},gse={DownloadIcon:q1("⤓"),CopyIcon:q1("⧉"),CheckIcon:q1("✓")},Av=y.memo(function({children:t,streaming:n,className:r}){const s=Xr();return f.jsx(H5,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],icons:s?gse:void 0,className:ye("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",s&&mse,r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),xa="pl-[calc(0.875rem+0.5rem)]",bse={check:["[ ]","[x]"],radio:["( )","(•)"]};function $5({options:e,focused:t,onFocus:n,onChoose:r,active:s=!0,label:a,className:l}){const u=y.useRef([]);y.useEffect(()=>{s&&u.current[t]?.focus()},[s,t]);const d=h=>{e.length>0&&n((t+h+e.length)%e.length)};return f.jsx("div",{role:"group","aria-label":a,className:ye("flex flex-col",l),onKeyDown:h=>{if(h.key==="ArrowDown"){d(1),h.preventDefault();return}if(h.key==="ArrowUp"){d(-1),h.preventDefault();return}const m=Number(h.key);Number.isInteger(m)&&m>=1&&m<=Math.min(e.length,9)&&(n(m-1),r(m-1),h.preventDefault())},children:e.map((h,m)=>{const p=m===t;return f.jsxs("div",{className:"flex flex-col",children:[f.jsxs("button",{ref:b=>{u.current[m]=b},type:"button",tabIndex:p?0:-1,"aria-pressed":h.checked,onFocus:()=>n(m),onClick:()=>r(m),className:ye("flex w-full items-baseline gap-2 text-left outline-none",p?"bg-surface-hover":"hover:bg-surface-hover/60"),children:[f.jsx(Or,{className:p?"text-fg-1":void 0,children:p?"❯":" "}),f.jsx("span",{className:"shrink-0 font-mono text-label leading-5 text-fg-4",children:m+1}),h.checked!==void 0?f.jsx("span",{className:ye("shrink-0 font-mono text-label leading-5",h.checked?"text-accent":"text-fg-4"),children:bse[h.marker??"check"][h.checked?1:0]}):null,f.jsxs("span",{className:ye("min-w-0 flex-1 text-body-sm leading-5",h.danger?"text-danger":"text-fg-1"),children:[h.label,h.description?f.jsxs("span",{className:"text-fg-4",children:[" — ",h.description]}):null]})]}),h.detail?f.jsx("div",{className:xa,children:h.detail}):null]},h.key)})})}function V5({children:e}){return f.jsx("div",{className:ye(xa,"text-label leading-5 text-fg-4"),children:e})}function q5({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:s}){return f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-3",children:"›"}),f.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 _v({code:e,label:t,language:n,className:r}){return f.jsxs("div",{className:ye("min-w-0",r),children:[f.jsx("span",{className:"block truncate text-label leading-5 text-fg-4",children:t}),f.jsx(Av,{children:xse(e,n)})]})}function xse(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??""}
698
- ${e}
699
- ${r}`}function yse({request:e,onApprove:t,onDeny:n,className:r}){const s=Xr(),[a,l]=y.useState(!1),[u,d]=y.useState(!1),[h,m]=y.useState(""),[p,b]=y.useState(0),x=S=>{const k=h.trim();n(e.id,k||void 0,S||void 0),m(""),d(!1)},E=Fb(e.input),A=VR(e.toolName),w=e.title??e.displayName??"Permission needed";if(s){const S=[{key:"allow",label:"Allow"},{key:"deny",label:"Deny",description:"the turn continues",detail:u?f.jsx(q5,{value:h,onChange:m,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 f.jsxs("div",{"data-slot":"permission-prompt",className:ye("w-full",r),onKeyDown:k=>{k.key==="Escape"&&(k.preventDefault(),x(!1))},children:[f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-warning",children:"!"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm leading-5 font-medium text-fg-1",children:w})]}),e.description?f.jsx("div",{className:ye(xa,"text-label leading-5 text-fg-3"),children:e.description}):null,e.decisionReason?f.jsx("div",{className:ye(xa,"text-label leading-5 text-fg-4"),children:e.decisionReason}):null,f.jsxs("button",{type:"button",onClick:()=>l(k=>!k),className:"flex w-full items-baseline gap-2 text-left outline-none hover:bg-surface-hover/60",children:[f.jsx(Or,{className:"text-fg-4",children:"⎿"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-label leading-5 text-fg-4",children:[f.jsx("span",{className:"font-medium text-fg-2",children:e.toolName}),E?`(${E})`:null]})]}),a?f.jsx("div",{className:xa,children:f.jsx(_v,{code:JSON.stringify(e.input,null,2),language:"json",label:"Input"})}):null,f.jsx($5,{label:w,options:S,focused:p,onFocus:b,active:!u,onChoose:k=>{k===0?t(e.id):k===1?d(!0):x(!0)}}),f.jsx(V5,{children:"↑↓ move · 1–3 choose · esc deny"})]})}return f.jsxs("div",{"data-slot":"permission-prompt",className:ye("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(z_,{className:"mt-0.5 size-4 shrink-0 text-warning"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?f.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?f.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,f.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[f.jsx(A,{className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),E?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:E}):null]}),f.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?f.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]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[f.jsx(tt,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),f.jsx(tt,{size:"sm",variant:"outline",onClick:()=>d(S=>!S),children:"Deny"}),f.jsx(tt,{size:"sm",variant:"outline",onClick:()=>x(!0),children:"Deny & stop"})]})]}),u?f.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[f.jsx(Yt,{autoFocus:!0,value:h,onChange:S=>m(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"}),f.jsx(tt,{size:"sm",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),f.jsx(tt,{size:"sm",variant:"destructive",onClick:()=>x(!1),children:"Deny"})]}):null]})}const kk=[{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 Y5(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 vse=e=>e.some(t=>t.multiSelect===!0),Al={labels:[],other:"",otherActive:!1};function Nk(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function Ese({request:e,onAnswer:t,onDismiss:n,className:r}){const s=Xr(),a=Y5(e.input),[l,u]=y.useState(()=>a.map(()=>Al)),[d,h]=y.useState(()=>a.map(()=>0)),[m,p]=y.useState(0),b=(w,S)=>{u(k=>k.map((N,_)=>_===w?{...N,...S}:N))},x=(w,S,k)=>{const N=l[w]??Al;k?b(w,{labels:N.labels.includes(S)?N.labels.filter(_=>_!==S):[...N.labels,S]}):b(w,{labels:N.labels[0]===S?[]:[S],otherActive:!1})},E=a.every((w,S)=>Nk(l[S]??Al)!==""),A=()=>{const w={};a.forEach((S,k)=>{w[S.question]=Nk(l[k]??Al)}),t(e.id,{...e.input,answers:w})};if(s){const w=()=>n(e.id,"Question dismissed by user");return f.jsxs("div",{"data-slot":"question-prompt",className:ye("flex w-full flex-col gap-2",r),onKeyDown:S=>{if(S.key==="Escape"){S.preventDefault(),w();return}S.key==="Enter"&&(S.metaKey||S.ctrlKey)&&E&&(S.preventDefault(),A())},children:[a.map((S,k)=>{const N=l[k]??Al,_=d[k]??0,M=S.multiSelect===!0,R=[...S.options.map((j,O)=>{const H=N.labels.includes(j.label);return{key:j.label,label:j.label,description:j.description,detail:j.preview&&(H||_===O)?f.jsx(_v,{code:j.preview,label:"Preview"}):void 0,checked:H,marker:M?"check":"radio"}}),{key:"__other",label:"Other…",checked:N.otherActive,marker:M?"check":"radio",detail:N.otherActive?f.jsx(q5,{value:N.other,onChange:j=>b(k,{other:j}),onSubmit:()=>{E&&A()},onCancel:()=>b(k,{otherActive:!1,other:""}),placeholder:"Type your own answer"}):void 0}];return f.jsxs("div",{className:"flex flex-col",children:[f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-3",children:"?"}),f.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-1",children:[S.header?f.jsxs("span",{className:"text-fg-4",children:[S.header," · "]}):null,f.jsx("span",{className:"font-medium",children:S.question})]})]}),f.jsx($5,{label:S.question,options:R,focused:_,active:m===k&&!N.otherActive,onFocus:j=>{p(k),h(O=>O.map((H,P)=>P===k?j:H))},onChoose:j=>{if(j===S.options.length){b(k,{otherActive:!N.otherActive});return}const O=S.options[j];O&&x(k,O.label,M)}})]},k)}),f.jsx("div",{className:ye(xa,"flex flex-col"),children:f.jsx("button",{type:"button",disabled:!E,onClick:A,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"})}),f.jsxs(V5,{children:["↑↓ move · ",vse(a)?"space/1–9 toggle":"1–9 choose"," · ⌘⏎ answer · esc dismiss"]})]})}return f.jsx("div",{"data-slot":"question-prompt",className:ye("rounded-lg border border-info/40 bg-info-bg p-3",r),children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(F_,{className:"mt-0.5 size-4 shrink-0 text-info"}),f.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[a.map((w,S)=>{const k=l[S]??Al;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[w.header?f.jsx(gn,{variant:"info",children:w.header}):null,f.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:w.question})]}),f.jsxs("div",{className:"flex flex-col gap-1",children:[w.options.map(N=>{const _=k.labels.includes(N.label);return f.jsxs("button",{type:"button",onClick:()=>x(S,N.label,w.multiSelect===!0),className:ye("rounded-md border px-2.5 py-1.5 text-left transition-colors",_?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[f.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:N.label}),N.description?f.jsx("span",{className:"block text-label text-fg-4",children:N.description}):null,_&&N.preview?f.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:N.preview}):null]},N.label)}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>b(S,{otherActive:!k.otherActive}),className:ye("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",k.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…"}),k.otherActive?f.jsx(Yt,{autoFocus:!0,value:k.other,onChange:N=>b(S,{other:N.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},S)}),f.jsx("div",{children:f.jsx(tt,{size:"sm",onClick:A,disabled:!E,children:"Answer"})})]}),f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:f.jsx(Cs,{className:"size-3.5"})})]})})}function Tse({state:e,client:t,sessionId:n,open:r,onOpenChange:s}){const a=e.session,l=e.permissionMode?XV(e.permissionMode):void 0;return f.jsx(fs,{open:r,onOpenChange:s,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Session info",description:a?.title}),f.jsx(ms,{children:f.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[f.jsxs("div",{className:"pb-2",children:[f.jsx(sr,{label:"Engine",children:e.engine??"claude"}),a?.profile?f.jsx(sr,{label:"Profile",children:a.profile}):null,e.model?f.jsx(sr,{label:"Model",mono:!0,children:e.model}):null,l?f.jsx(sr,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?f.jsx(sr,{label:"Credentials",children:a.apiKeySource}):null]}),f.jsxs("div",{className:"py-2",children:[e.cwd?f.jsx(Y1,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?f.jsx(Y1,{label:"Engine session id",value:e.sdkSessionId}):null,a?f.jsx(Y1,{label:"Gateway session id",value:a.id}):null]}),f.jsxs("div",{className:"py-2",children:[a?.createdAt?f.jsx(sr,{label:"Started",children:fu(a.createdAt)}):null,a?.numTurns!==void 0?f.jsx(sr,{label:"Turns",children:a.numTurns}):null,f.jsx(sr,{label:"Cost",mono:!0,children:va(e.totalCostUsd)})]}),e.capabilities.vfs?f.jsx(Sse,{client:t,sessionId:n,open:r}):null]})})]})})}function Y1({label:e,value:t}){return f.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-label text-fg-3",children:e}),f.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),f.jsx(ud,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function Sse({client:e,sessionId:t,open:n}){const[r,s]=y.useState(),[a,l]=y.useState(!1);return y.useEffect(()=>{if(!n||!t)return;let u=!1;return l(!0),e.listSessionFiles(t).then(d=>{u||s(d)}).catch(()=>{u||s([])}).finally(()=>{u||l(!1)}),()=>{u=!0}},[e,t,n]),f.jsxs("div",{className:"pt-3",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?f.jsx("div",{className:"py-3 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):r?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(u=>f.jsx("li",{children:f.jsxs("a",{href:t?e.sessionFileUrl(t,u.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[f.jsx(P_,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:u.path}),f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:Co(u.bytes)})]})},u.path))}):f.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const Cse={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 wse(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 G5=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",kse=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function Nse({usage:e}){return f.jsx(Uy,{content:f.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:kse(t.color)?{backgroundColor:t.color}:void 0}),f.jsx("span",{className:"flex-1",children:t.name}),f.jsx("span",{className:"font-mono text-fg-3",children:cs(t.tokens)})]},t.name)),f.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[f.jsx("span",{children:"Total"}),f.jsxs("span",{className:"font-mono text-fg-3",children:[cs(e.totalTokens)," / ",cs(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:f.jsxs("span",{className:ye("inline-flex cursor-default items-center gap-1 font-mono text-label",G5(e.percentage)),children:["Ctx ",cs(e.totalTokens)]})})}function Ak({label:e,info:t,now:n}){const r=t.utilization,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return f.jsx(Uy,{content:f.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{children:[e," usage"]}),f.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),s!==void 0?f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{children:"Resets in"}),f.jsx("span",{className:"font-mono text-fg-3",children:Hb(s,n)})]}):null,t.isUsingOverage?f.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?f.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:f.jsxs("span",{className:ye("cursor-default font-mono text-label whitespace-nowrap",t.status==="rejected"?"text-danger":G5(r??0)),children:[f.jsx(hR,{value:r??0,className:"mr-1 inline-block align-middle"}),e,r!==void 0?` ${r.toFixed(0)}%`:"",s!==void 0?f.jsxs("span",{className:"text-fg-4",children:[" · ",Hb(s,n)]}):null]})})}function G1({onClick:e,hint:t,children:n}){return e?f.jsx("button",{type:"button",onClick:e,"aria-label":t,className:"rounded-md py-0.5 leading-4 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover",children:n}):f.jsx(f.Fragment,{children:n})}function Ase({state:e,connected:t,connection:n,onOpenStatus:r,onOpenContext:s,onOpenUsage:a,controls:l,actions:u,placement:d="top",className:h}){const m=Cse[e.status],p=wse(),b=e.rateLimits?.five_hour,x=e.rateLimits?.seven_day,E=n??(t===!1?"reconnecting":"live");return f.jsxs("div",{"data-slot":"status-bar",className:ye("flex h-[38px] items-baseline gap-2 border-border bg-surface p-1.5",d==="bottom"?"border-t":"border-b",h),children:[f.jsx(G1,{onClick:r,hint:"Session info",children:E==="live"?f.jsxs(gn,{variant:m.variant,dot:!m.busy,className:"items-baseline",children:[m.busy?f.jsx(xn,{className:"size-3 self-center text-current"}):null,m.label]}):f.jsxs(gn,{variant:E==="offline"?"danger":"warning",dot:!1,className:"items-baseline",children:[E==="offline"?f.jsx(mU,{className:"size-3 self-center text-current"}):f.jsx(em,{className:"size-3 animate-spin self-center text-current"}),E==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?f.jsx(G1,{onClick:s,hint:"Context breakdown",children:f.jsx(Nse,{usage:e.contextUsage})}):null,b||x?f.jsx(G1,{onClick:a,hint:"Plan usage",children:f.jsxs("span",{className:"inline-flex items-baseline gap-2",children:[b?f.jsx(Ak,{label:"Session",info:b,now:p}):null,x?f.jsx(Ak,{label:"Weekly",info:x,now:p}):null]})}):null,l,f.jsx("span",{className:"flex-1"}),f.jsx("span",{className:"font-mono text-label text-fg-3",children:va(e.totalCostUsd)}),u]})}function _se(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,a,l){if(typeof a=="string"){const u=a.charCodeAt(0);if(u>=48&&u<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let h=s[d];if(!h){const m=t[d*2];h=s[d]={index:d,key:n(d),start:m,size:t[d*2+1],end:m+t[d*2+1],lane:0}}return h}}if(a==="length")return e}return Reflect.get(s,a,l)}})}function _l(e,t,n){let r=n.initialDeps??[],s,a=!0;function l(){const u=e();return(u.length!==r.length||u.some((h,m)=>r[m]!==h))&&(r=u,s=t(...u),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1),s}return l.updateDeps=u=>{r=u},l}function _k(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Rse=(e,t)=>Math.abs(e-t)<1.01,Ise=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let wc;const K1=()=>{if(wc!==void 0)return wc;if(typeof navigator>"u")return wc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return wc=!0;const e=navigator.maxTouchPoints;return wc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Rk=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ose=e=>e,Mse=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},Lse=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=l=>{const{width:u,height:d}=l;t({width:Math.round(u),height:Math.round(d)})};if(s(Rk(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(Rk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},Tp={passive:!0},Dse=typeof window>"u"?!0:"onscrollend"in window,jse=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const a=e.options.useScrollendEvent&&Dse;let l=0;const u=a?null:Ise(s,()=>t(l,!1),e.options.isScrollingResetDelay),d=p=>()=>{l=n(r),u?.(),t(l,p)},h=d(!0),m=d(!1);return r.addEventListener("scroll",h,Tp),a&&r.addEventListener("scrollend",m,Tp),()=>{r.removeEventListener("scroll",h),a&&r.removeEventListener("scrollend",m)}},Pse=(e,t)=>jse(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),Bse=(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"]},zse=(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})},Use=zse;class Hse{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 u=a.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[h,m]of this.elementsCache)if(m===u){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,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:Ose,rangeExtractor:Mse,onChange:()=>{},measureElement:Bse,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 u=null,d=null,h=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const b=l.count,x=a.count,E=this.getMeasurements(),A=b>0?((r=E[0])==null?void 0:r.key)??l.getItemKey(0):null,w=b>0?((s=E[b-1])==null?void 0:s.key)??l.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(a.getItemKey(0)!==A||a.getItemKey(x-1)!==w)){h=!0;const N=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??E[0]:null;N&&(u=[N.key,this.getScrollOffset()-N.start]);const _=a.followOnAppend===!0?"auto":a.followOnAppend||null;_&&x>b&&this.isAtEnd(l.scrollEndThreshold)&&(b===0||a.getItemKey(x-1)!==w)&&(d=_)}}this.options=a,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let m=!1,p=0;if(u&&this.scrollOffset!==null){const[b,x]=u,E=this.getMeasurements(),{count:A,getItemKey:w}=this.options;let S=0;for(;S<A&&w(S)!==b;)S++;if(S<A){const k=E[S];if(k){const N=Math.max(0,k.start+x);N!==this.scrollOffset&&(p=N-this.scrollOffset,this.scrollOffset=N,m=!0)}}}(m||d)&&(this.pendingScrollAnchor=[m?u[0]:null,m?u[1]:0,d,p])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=_l(()=>(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 u=this.getScrollOffset();this.scrollDirection=l?u===a?this.scrollDirection:u<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)},u=()=>{this._iosTouching=!1,!(!K1()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,Tp),a.addEventListener("touchend",u,Tp),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",u),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,u,d]=s;a!==null&&!u&&(K1()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},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=_l(()=>[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,u,d,h)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h}),{key:!1}),this.getMeasurements=_l(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h},m)=>{const p=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),u===1){const S=n*2;let k=this._flatMeasurements;if(!k||k.length<S){const M=new Float64Array(S);k&&b>0&&M.set(k.subarray(0,b*2)),k=M,this._flatMeasurements=k}let N;if(b===0)N=r+s;else{const M=b-1;N=k[M*2]+k[M*2+1]+h}for(let M=b;M<n;M++){const R=a(M),j=p.get(R),O=typeof j=="number"?j:this.options.estimateSize(M);k[M*2]=N,k[M*2+1]=O,N+=O+h}const _=_se(n,k,a);return this.measurementsCache=_,_}const x=this.measurementsCache.slice(0,b),E=new Array(u).fill(void 0),A=new Float64Array(u);let w=0;for(let S=0;S<b;S++){const k=x[S];k&&(E[k.lane]===void 0&&w++,E[k.lane]=S,A[k.lane]=k.end)}for(let S=b;S<n;S++){const k=a(S),N=this.laneAssignments.get(S);let _,M;const R=d==="estimate"||p.has(k);if(N!==void 0&&this.options.lanes>1){_=N;const P=E[_],Y=P!==void 0?x[P]:void 0;M=Y?Y.end+h:r+s}else if(w===u){let P=0,Y=A[0],X=E[0];for(let Z=1;Z<u;Z++){const ee=A[Z];(ee<Y||ee===Y&&E[Z]<X)&&(P=Z,Y=ee,X=E[Z])}_=P,M=Y+h,R&&this.laneAssignments.set(S,_)}else _=S%this.options.lanes,M=r+s,R&&this.laneAssignments.set(S,_);const j=p.get(k),O=typeof j=="number"?j:this.options.estimateSize(S),H=M+O;x[S]={index:S,start:M,size:O,end:H,key:k,lane:_},E[_]===void 0&&w++,E[_]=S,A[_]=H}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_l(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>n.length===0||r===0?(this.range=null,null):(this.range=$se(n,r,s,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_l(()=>{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),u=Math.min(this.options.count-1,s+a);return n>=l&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,u)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(u))});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,u,d;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)d=this.options.getItemKey(n),u=h[n*2],l=h[n*2+1];else{const b=this.measurementsCache[n];if(!b)return;d=b.key,u=b.start,l=b.size}const m=this.itemSizeCache.get(d)??l,p=r-m;if(p!==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,E=this.getScrollOffset()+this.scrollAdjustments,w=!this.itemSizeCache.has(d)?u<E:u+m<=E&&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:u,size:l,end:u+l,lane:0},p,this):w);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let k=!1;b?k=this.applyScrollAdjustment(this.getTotalSize()-x):S&&(k=this.applyScrollAdjustment(p)),this.notify(k)}},this.getVirtualItems=_l(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,l=n.length;a<l;a++){const u=n[a],d=r[u];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=K5(0,r.length-1,a?u=>s[u*2]:u=>_k(r[u]).start,n);return _k(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 u=this.getMaxScrollOffset();return Math.max(Math.min(u,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 u=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,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,u]=a,d=this.now();this.scrollState={index:n,align:u,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(u=>u===null);){const u=r[l];a[u.lane]===null&&(a[u.lane]=u.end),l--}s=Math.max(...a.filter(u=>u!==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:K1()&&(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&&Rse(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 u=this.getSize()||600,d=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&d>u;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const K5=(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 Fse(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 $se(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 h=Fse(s,a,n);let m=h;const p=n+t;for(;m<a&&s[m*2]+s[m*2+1]<p;)m++;return{startIndex:h,endIndex:m}}let u=K5(0,a,h=>e[h].start,n),d=u;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const h=Array(r).fill(0);for(;d<a&&h.some(p=>p<n+t);){const p=e[d];h[p.lane]=p.end,d++}const m=Array(r).fill(n+t);for(;u>=0&&m.some(p=>p>=n);){const p=e[u];m[p.lane]=p.start,u--}u=Math.max(0,u-u%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:u,endIndex:d}}const X1=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Vse({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=y.useReducer(m=>m+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=m=>{const p=a.current;if(!p.enabled||!p.container)return;const b=m.getTotalSize();if(b!==p.lastSize){p.lastSize=b;const x=m.options.horizontal?"width":"height";p.container.style[x]=`${b}px`}},u=m=>{const p=a.current;if(!p.enabled||!p.container)return;l(m);const b=!!m.options.horizontal,x=p.mode==="transform",E=b?"left":"top",A=m.options.scrollMargin,w=m.getVirtualItems();for(const S of w){const k=S.start-A,N=m.elementsCache.get(S.key);N&&p.lastPositions.get(N)!==k&&(p.lastPositions.set(N,k),x?N.style.transform=b?`translate3d(${k}px, 0, 0)`:`translate3d(0, ${k}px, 0)`:N.style[E]=`${k}px`)}},d={...r,onChange:(m,p)=>{var b;const x=a.current;let E=!0;if(x.enabled){u(m);const A=m.range,w=x.prevRange;E=!w||w.isScrolling!==m.isScrolling||w.startIndex!==A?.startIndex||w.endIndex!==A?.endIndex,E&&(x.prevRange=A?{startIndex:A.startIndex,endIndex:A.endIndex,isScrolling:m.isScrolling}:null)}E&&(e&&p?or.flushSync(s):s()),(b=r.onChange)==null||b.call(r,m,p)}},[h]=y.useState(()=>{const m=new Hse(d);return Object.assign(m,{containerRef:p=>{const b=a.current;if(b.container=p,b.lastSize=null,p&&b.enabled){const x=m.getTotalSize();b.lastSize=x;const E=m.options.horizontal?"width":"height";p.style[E]=`${x}px`}}})});return h.setOptions(d),X1(()=>h._didMount(),[]),X1(()=>(l(h),h._willUpdate())),X1(()=>{u(h)}),h}function qse(e){return Vse({observeElementRect:Lse,observeElementOffset:Pse,scrollToFn:Use,...e})}/*!---------------------------------------------------------------------------------------------
700
- * Copyright (c) StackBlitz. All rights reserved.
701
- * Licensed under the MIT License. See License.txt in the project root for license information.
702
- *--------------------------------------------------------------------------------------------*/const Yse={damping:.7,stiffness:.05,mass:1.25},Gse=70,Kse=1e3/60,Xse=350;let Sm=!1;globalThis.document?.addEventListener("mousedown",()=>{Sm=!0});globalThis.document?.addEventListener("mouseup",()=>{Sm=!1});globalThis.document?.addEventListener("click",()=>{Sm=!1});const Wse=(e={})=>{const[t,n]=y.useState(!1),[r,s]=y.useState(e.initial!==!1),[a,l]=y.useState(!1),u=y.useRef(null);u.current=e;const d=y.useCallback(()=>{if(!Sm)return!1;const k=window.getSelection();if(!k||!k.rangeCount)return!1;const N=k.getRangeAt(0);return N.commonAncestorContainer.contains(w.current)||w.current?.contains(N.commonAncestorContainer)},[]),h=y.useCallback(k=>{p.isAtBottom=k,s(k)},[]),m=y.useCallback(k=>{p.escapedFromLock=k,n(k)},[]),p=y.useMemo(()=>{let k;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return w.current?.scrollTop??0},set scrollTop(N){if(w.current){const{scrollBehavior:_}=getComputedStyle(w.current);_!=="auto"&&(w.current.style.scrollBehavior="auto"),w.current.scrollTop=N,p.ignoreScrollToTop=w.current.scrollTop,_!=="auto"&&(w.current.style.scrollBehavior=_)}},get targetScrollTop(){return!w.current||!S.current?0:w.current.scrollHeight-1-w.current.clientHeight},get calculatedTargetScrollTop(){if(!w.current||!S.current)return 0;const{targetScrollTop:N}=this;if(!e.targetScrollTop)return N;if(k?.targetScrollTop===N)return k.calculatedScrollTop;const _=Math.max(Math.min(e.targetScrollTop(N,{scrollElement:w.current,contentElement:S.current}),N),0);return k={targetScrollTop:N,calculatedScrollTop:_},requestAnimationFrame(()=>{k=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Gse}}},[]),b=y.useCallback((k={})=>{typeof k=="string"&&(k={animation:k}),k.preserveScrollPosition||h(!0);const N=Date.now()+(Number(k.wait)||0),_=Q1(u.current,k.animation),{ignoreEscapes:M=!1}=k;let R,j=p.calculatedTargetScrollTop;k.duration instanceof Promise?k.duration.finally(()=>{R=Date.now()}):R=N+(k.duration??0);const O=async()=>{const H=new Promise(requestAnimationFrame).then(()=>{if(!p.isAtBottom)return p.animation=void 0,!1;const{scrollTop:P}=p,Y=performance.now(),X=(Y-(p.lastTick??Y))/Kse;if(p.animation||(p.animation={behavior:_,promise:H,ignoreEscapes:M}),p.animation.behavior===_&&(p.lastTick=Y),d()||N>Date.now())return O();if(P<Math.min(j,p.calculatedTargetScrollTop)){if(p.animation?.behavior===_){if(_==="instant")return p.scrollTop=p.calculatedTargetScrollTop,O();p.velocity=(_.damping*p.velocity+_.stiffness*p.scrollDifference)/_.mass,p.accumulated+=p.velocity*X,p.scrollTop+=p.accumulated,p.scrollTop!==P&&(p.accumulated=0)}return O()}return R>Date.now()?(j=p.calculatedTargetScrollTop,O()):(p.animation=void 0,p.scrollTop<p.calculatedTargetScrollTop?b({animation:Q1(u.current,u.current.resize),ignoreEscapes:M,duration:Math.max(0,R-Date.now())||void 0}):p.isAtBottom)});return H.then(P=>(requestAnimationFrame(()=>{p.animation||(p.lastTick=void 0,p.velocity=0)}),P))};return k.wait!==!0&&(p.animation=void 0),p.animation?.behavior===_?p.animation.promise:O()},[h,d,p]),x=y.useCallback(()=>{m(!0),h(!1)},[m,h]),E=y.useCallback(({target:k})=>{if(k!==w.current)return;const{scrollTop:N,ignoreScrollToTop:_}=p;let{lastScrollTop:M=N}=p;p.lastScrollTop=N,p.ignoreScrollToTop=void 0,_&&_>N&&(M=_),l(p.isNearBottom),setTimeout(()=>{if(p.resizeDifference||N===_)return;if(d()){m(!0),h(!1);return}const R=N>M,j=N<M;if(p.animation?.ignoreEscapes){p.scrollTop=M;return}j&&(m(!0),h(!1)),R&&m(!1),!p.escapedFromLock&&p.isNearBottom&&h(!0)},1)},[m,h,d,p]),A=y.useCallback(({target:k,deltaY:N})=>{let _=k;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===w.current&&N<0&&w.current.scrollHeight>w.current.clientHeight&&!p.animation?.ignoreEscapes&&(m(!0),h(!1))},[m,h,p]),w=Ik(k=>{w.current?.removeEventListener("scroll",E),w.current?.removeEventListener("wheel",A),k?.addEventListener("scroll",E,{passive:!0}),k?.addEventListener("wheel",A,{passive:!0})},[]),S=Ik(k=>{if(p.resizeObserver?.disconnect(),p.resizeObserver=void 0,!k)return;let N;p.resizeObserver=new ResizeObserver(([_])=>{const{height:M}=_.contentRect,R=M-(N??M);if(p.resizeDifference=R,p.scrollTop>p.targetScrollTop&&(p.scrollTop=p.targetScrollTop),l(p.isNearBottom),R>=0){const j=Q1(u.current,N?u.current.resize:u.current.initial);b({animation:j,wait:!0,preserveScrollPosition:!0,duration:j==="instant"?void 0:Xse})}else p.isNearBottom&&(m(!1),h(!0));N=M,requestAnimationFrame(()=>{setTimeout(()=>{p.resizeDifference===R&&(p.resizeDifference=0)},1)})}),p.resizeObserver?.observe(k)},[]);return{contentRef:S,scrollRef:w,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:p}};function Ik(e,t){const n=y.useCallback(r=>(n.current=r,e(r)),t);return n}const W1=new Map;function Q1(...e){const t={...Yse};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 W1.has(r)||W1.set(r,Object.freeze(t)),n?"instant":W1.get(r)}/*!---------------------------------------------------------------------------------------------
703
- * Copyright (c) StackBlitz. All rights reserved.
704
- * Licensed under the MIT License. See License.txt in the project root for license information.
705
- *--------------------------------------------------------------------------------------------*/const X5=y.createContext(null),Qse=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Sp({instance:e,children:t,resize:n,initial:r,mass:s,damping:a,stiffness:l,targetScrollTop:u,contextRef:d,...h}){const m=y.useRef(null),p=y.useCallback((M,R)=>(_?.targetScrollTop??u)?.(M,R)??M,[u]),b=Wse({mass:s,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:p}),{scrollRef:x,contentRef:E,scrollToBottom:A,stopScroll:w,isAtBottom:S,escapedFromLock:k,state:N}=e??b,_=y.useMemo(()=>({scrollToBottom:A,stopScroll:w,scrollRef:x,isAtBottom:S,escapedFromLock:k,contentRef:E,state:N,get targetScrollTop(){return m.current},set targetScrollTop(M){m.current=M}}),[A,S,E,x,w,k,N]);return y.useImperativeHandle(d,()=>_,[_]),Qse(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),y.createElement(X5.Provider,{value:_},y.createElement("div",{...h},typeof t=="function"?t(_):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const a=Rv();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})(Sp||(Sp={}));function Rv(){const e=y.useContext(X5);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function Zse({className:e,children:t,resize:n="smooth",...r}){return f.jsx(Sp,{"data-slot":"conversation",className:ye("relative flex-1 overflow-y-auto",e),initial:"instant",resize:n,role:"log",...r,children:t})}function Jse({className:e,children:t,...n}){return f.jsx(Sp.Content,{"data-slot":"conversation-content",className:ye("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 eie({className:e}){const{isAtBottom:t,scrollToBottom:n}=Rv();return t?null:f.jsx(tt,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:ye("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n(),children:f.jsx(nB,{className:"size-4"})})}function tie({item:e,href:t,className:n}){const r=Xr(),s=e.path.split("/").pop()||e.path;return r?f.jsxs("div",{"data-slot":"file-delivered",className:ye("flex w-full items-baseline gap-2",n),children:[f.jsx(Or,{className:"text-fg-4",children:"◇"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5",children:[f.jsx("span",{className:"font-medium text-fg-1",children:s}),f.jsxs("span",{className:"text-fg-4",children:[" · ",Co(e.bytes),e.description?` · ${e.description}`:""]})]}),t?f.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]}):f.jsxs("div",{"data-slot":"file-delivered",className:ye("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[f.jsx(Iy,{className:"size-4 shrink-0 text-fg-3"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:s}),f.jsxs("div",{className:"truncate text-label text-fg-4",children:[Co(e.bytes),e.description?` · ${e.description}`:""]})]}),t?f.jsxs("a",{href:t,download:s,className:ye("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:[f.jsx(P_,{className:"size-3.5"}),"Download"]}):null]})}const Cp=["⋄","◇","◈","◆"],nie=150,rie=Cp[Cp.length-1];function sie(){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 W5(e){const t=sie(),n=e&&!t,[r,s]=y.useState(0);return y.useEffect(()=>{if(!n)return;const a=setInterval(()=>s(l=>l+1),nie);return()=>clearInterval(a)},[n]),n?Cp[r%Cp.length]:rie}const Z1=["Working","Thinking","Churning","Pondering","Whirring","Computing","Percolating","Tinkering","Deliberating","Simmering","Crunching","Noodling"],iie=4e3;function aie({label:e,startedAt:t,tokens:n,className:r}){const s=Xr(),a=W5(s);if(!s)return f.jsxs("div",{"data-slot":"loader",className:ye("flex items-center gap-2 py-1 text-body-sm text-fg-4",r),children:[f.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(h=>f.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${h*160}ms`}},h))}),e?f.jsx("span",{children:e}):null]});const l=t===void 0?void 0:Date.now()-t,u=e??Z1[Math.floor((l??0)/iie)%Z1.length]??Z1[0],d=[l!==void 0?Ub(l):void 0,n!==void 0?`↓ ${cs(n)}`:void 0].filter(Boolean);return f.jsxs("div",{"data-slot":"loader",className:ye("flex items-baseline gap-2",r),children:[f.jsx(Or,{className:s?"text-fg-3":"text-accent",children:a}),f.jsxs("span",{className:"min-w-0 flex-1 text-body-sm leading-5 text-fg-3",children:[u,"…"," ",d.length?f.jsxs("span",{className:"text-label text-fg-4",children:["(",d.join(" · "),")"]}):null]})]})}function Ok({from:e,className:t,children:n,...r}){const s=Xr();return f.jsx("div",{"data-slot":"message","data-from":e,className:ye("flex w-full",s?ye("flex-row gap-2",e==="user"&&"-mx-1 rounded-sm bg-surface px-1"):"flex-col items-start gap-1",t),...r,children:s?f.jsxs(f.Fragment,{children:[f.jsx(Or,{className:e==="user"?"text-accent":"text-fg-3",children:e==="user"?"❯":"●"}),f.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:n})]}):n})}function Mk({className:e,...t}){const n=Xr();return f.jsx("div",{"data-slot":"message-content",className:ye("min-w-0",n?ye("w-full text-fg-1",CV,"in-data-[from=user]:whitespace-pre-wrap"):ye("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-bl-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 oie({text:e,className:t}){const n=tV(e);if(n.length===0)return f.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(f.jsx("span",{className:ye("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)),f.jsx("span",{className:t,children:r.map((a,l)=>f.jsx(y.Fragment,{children:a},l))})}function lie({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const s=Xr(),[a,l]=y.useState(n??t),u=y.useRef(!1);y.useEffect(()=>{if(!u.current)if(t)l(!0);else{const h=setTimeout(()=>l(!1),600);return()=>clearTimeout(h)}},[t]);const d=e.trim()!=="";return!d&&!t?null:f.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:ye("w-full",r),children:[f.jsxs("button",{type:"button",disabled:!d,onClick:()=>{u.current=!0,l(h=>!h)},className:ye("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?f.jsx(Or,{className:"text-fg-4",children:"✻"}):f.jsx(cB,{className:"size-3.5"}),f.jsx("span",{className:ye(s&&"leading-5"),children:t?"Thinking…":"Thought process"}),d&&!s?f.jsx(D_,{className:ye("size-3.5 transition-transform",a&&"rotate-180")}):null]}),a&&d?f.jsx("div",{className:ye("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:f.jsx(Av,{streaming:t,children:e})}):null]})}function uie({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:s}){const a=[{icon:yz,text:"Tell the agent what to do."},...t?[{icon:rU,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:nm,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:aB,text:"Type @ to search this project’s files."}]:[]];return f.jsxs("div",{className:ye("flex flex-col items-center gap-4 py-10",s),children:[f.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:f.jsx(Ib,{className:"size-5"})}),e?f.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,f.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>f.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[f.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),f.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const Lk=2e3,cie=new Set(["CodexImageGeneration","CodexImageView"]),die=e=>{if(!cie.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},fie={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}},hie={running:"text-info",pending:"text-info",deferred:"text-accent",settled:"text-fg-4",failed:"text-danger"},pie={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 mie(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 pie[r]}function gie({item:e,hostImage:t,className:n}){const r=Xr(),[s,a]=y.useState(!1),[l,u]=y.useState(!1),d=die(e),h=e.status??(e.result===void 0?"running":"settled"),m=fie[h],p=h==="failed"||e.result?.isError===!0,b=W5(r&&m.busy),x=VR(e.name),E=e.result?.text??"",A=!l&&E.length>Lk,w=A?E.slice(0,Lk):E,S=r?"plain":"panel",k=r?yie:xie,N=s?f.jsxs("div",{className:ye("flex flex-col",r?"gap-1 py-1":"gap-2 border-t border-border p-2.5"),children:[f.jsx(k,{code:JSON.stringify(e.input,null,2),language:"json",label:"Parameters",variant:S}),e.logs?.length?f.jsx(k,{code:e.logs.join(`
706
- `),label:"Logs",variant:S}):null,e.result!==void 0?f.jsxs("div",{children:[f.jsx(k,{code:w||"(empty result)",language:mie(e),label:p?"Error":"Result",variant:S,className:ye(p&&(r?"[&_pre]:text-danger":"border-danger/40 [&_pre]:text-danger"))}),A?f.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>u(!0),children:["Show all ",E.length.toLocaleString()," chars"]}):null]}):null]}):null,_=d&&t?f.jsx(vie,{path:d,load:t,lines:r}):null;return r?f.jsxs("div",{"data-slot":"tool-call","data-state":h,className:ye("w-full",n),children:[f.jsxs("button",{type:"button",onClick:()=>a(M=>!M),className:"flex w-full items-baseline gap-2 text-left outline-none",children:[f.jsx(Or,{className:h==="settled"&&!p&&QV(e.name)?"text-success":hie[h],children:m.busy?b:"●"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate text-body-sm leading-5 text-fg-3",children:[f.jsx("span",{className:"font-medium text-fg-1",children:e.name}),f.jsxs("span",{className:"text-fg-4",children:["(",Fb(e.input),")"]})]}),e.backend&&e.backend!=="server"?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:e.backend}):null,h==="deferred"?f.jsx(dw,{className:"size-3 shrink-0 self-center text-fg-4"}):null,p&&!m.busy?f.jsx("span",{className:"shrink-0 text-label text-danger",children:"error"}):null]}),!s&&E?f.jsxs("div",{className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-4",children:"⎿"}),f.jsx("span",{className:ye("min-w-0 flex-1 truncate text-label leading-5",p?"text-danger":"text-fg-4"),children:bie(E)})]}):null,_,N?f.jsx("div",{className:xa,children:N}):null]}):f.jsxs("div",{"data-slot":"tool-call","data-state":h,className:ye("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[f.jsxs("button",{type:"button",onClick:()=>a(M=>!M),className:ye("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:[f.jsx(x,{className:"size-3.5 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?f.jsx(gn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:Fb(e.input)}),f.jsxs(gn,{variant:m.variant,dot:!m.busy,className:"shrink-0 gap-1",children:[m.busy?f.jsx(xn,{className:"size-3 text-current"}):null,h==="deferred"?f.jsx(dw,{className:"size-3 text-current"}):null,m.label]}),f.jsx(D_,{className:ye("size-3.5 shrink-0 text-fg-4 transition-transform",s&&"rotate-180")})]}),_,N]})}function bie(e){const t=e.split(`
707
- `).find(s=>s.trim()!=="")??"",n=e.trimEnd().split(`
708
- `).length-1,r=t.trim();return n>0?`${r} (+${n} lines)`:r}function xie({code:e,label:t,variant:n,className:r}){return f.jsx(fR,{code:e,label:t,variant:n,className:r})}function yie({code:e,label:t,language:n,className:r}){return f.jsx(_v,{code:e,label:t,language:n,className:r})}function vie({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?f.jsx("div",{className:ye(n?ye("py-1",xa):"border-t border-border p-2.5"),children:f.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 Eie({item:e}){return Xr()?f.jsxs("div",{"data-slot":"turn-result",className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:"text-fg-4",children:"·"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("span",{className:ye("text-label leading-5",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",Ub(e.durationMs)," ·"," ",va(e.totalCostUsd)]}),e.errors?.length?f.jsx("ul",{className:"flex flex-col",children:e.errors.map((n,r)=>f.jsx("li",{className:"text-label leading-5 break-words text-danger",children:n},r))}):null]})]}):f.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:ye("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",Ub(e.durationMs)," ·"," ",va(e.totalCostUsd)]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?f.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((n,r)=>f.jsx("li",{className:"text-label break-words text-danger",children:n},r))}):null]})}function Tie({item:e}){return Xr()?f.jsxs("div",{"data-slot":"notice",className:"flex items-baseline gap-2",children:[f.jsx(Or,{className:e.level==="error"?"text-danger":"text-fg-4",children:"!"}),f.jsx("span",{className:ye("min-w-0 flex-1 text-body-sm leading-5",e.level==="error"?"text-danger":"text-fg-3"),children:e.text})]}):f.jsx("div",{"data-slot":"notice",className:ye("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 Sie({item:e,fileUrl:t,attachmentUrl:n,hostImage:r}){switch(e.kind){case"user":return f.jsxs(Ok,{from:"user",children:[e.attachments?.length?f.jsx(Aie,{attachments:e.attachments,attachmentUrl:n}):null,e.text?f.jsx(Mk,{children:f.jsx(oie,{text:e.text})}):null]});case"assistant_text":return f.jsx(Ok,{from:"assistant",children:f.jsx(Mk,{children:f.jsx(Av,{streaming:e.streaming,children:e.text})})});case"thinking":return f.jsx(lie,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return f.jsx(gie,{item:e,hostImage:r});case"turn_result":return f.jsx(Eie,{item:e});case"notice":return f.jsx(Tie,{item:e});case"file_delivered":return f.jsx(tie,{item:e,href:t?.(e.path)});default:return null}}function Cie({line:e,since:t}){const n=Xr(),r=t===void 0?void 0:fu(t),s=r?`${e} · last here ${r}`:e;return n?f.jsxs("div",{"data-slot":"recap",className:"flex items-baseline gap-2 py-0.5",children:[f.jsx(Or,{className:"text-fg-3",children:"※"}),f.jsxs("span",{className:"min-w-0 flex-1 text-label leading-5 text-fg-3",children:[f.jsx("span",{className:"text-fg-2",children:"recap:"})," ",s]})]}):f.jsxs("div",{"data-slot":"recap",className:"flex items-center gap-2 py-1",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:"font-mono text-label text-fg-3",children:["※ recap: ",s]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]})}function wie(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 kie(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 Nie(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 Aie({attachments:e,attachmentUrl:t}){return f.jsx("div",{className:"mb-1 flex flex-wrap justify-start gap-1.5",children:e.map(n=>{const r=t?.(n.id);return n.mediaType.startsWith("image/")&&r?f.jsx("img",{src:r,alt:n.name,className:"size-20 rounded-md border border-border object-cover"},n.id):f.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:n.name},n.id)})})}function _ie(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 Rie({rows:e,boundary:t,since:n,lines:r,gap:s,fileUrl:a,attachmentUrl:l,hostImage:u,jumpToRecapRef:d}){const h=Rv(),[m,p]=y.useState(null);y.useEffect(()=>{p(h.scrollRef.current)},[h.scrollRef]);const b=qse({count:e.length,getScrollElement:()=>(m&&b.scrollElement!==m&&(b.scrollOffset=m.scrollTop),m),estimateSize:()=>(r?32:100)+s.px,overscan:8,getItemKey:E=>e[E].key,useFlushSync:!0});b.shouldAdjustScrollPositionOnItemSizeChange=(E,A,w)=>{if(h.state.isAtBottom)return!1;const S=(w.scrollOffset??0)+w.scrollAdjustments;return w.itemSizeCache.has(E.key)?E.end<=S&&w.scrollDirection!=="backward":E.start<S};const x=y.useRef(void 0);return y.useEffect(()=>()=>clearTimeout(x.current),[]),y.useEffect(()=>{if(d)return d.current=()=>{const E=e.findIndex(w=>w.key==="recap");if(E<0)return;h.stopScroll(),clearTimeout(x.current);const A=w=>{const S=m?.querySelector('[data-slot="recap"]');if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}w>=6||(b.scrollToIndex(E,{align:"center",behavior:"smooth"}),x.current=setTimeout(()=>A(w+1),300))};A(0)},()=>{d.current=null}}),f.jsx("div",{"data-slot":"transcript-rows",className:"relative w-full",style:{height:b.getTotalSize()},children:b.getVirtualItems().map(E=>{const A=e[E.index];return f.jsx("div",{ref:b.measureElement,"data-index":E.index,className:ye("absolute inset-x-0 top-0",E.index>0&&s.className),style:{transform:`translateY(${E.start}px)`},children:"item"in A?f.jsx("div",{className:ye(r&&"-mx-1 rounded-sm px-1 py-0.5 transition-colors hover:bg-surface-hover",t!==void 0&&A.index<t&&"opacity-45",_ie(A.item,r)),children:f.jsx(Sie,{item:A.item,fileUrl:a,attachmentUrl:l,hostImage:u})}):f.jsx(Cie,{line:A.line,since:n})},A.key)})})}function Iie({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:s,variant:a="cards",density:l="comfortable",catchUp:u,jumpToRecapRef:d,className:h}){const m=a==="lines",p=SV[a][l],b=kie(e.status),x=wie(e.items.length,e.status),E=u&&u.from>0&&u.from<e.items.length?u.from:void 0,A=y.useMemo(()=>E===void 0?void 0:yV(xV(e,E)),[e,E]),w=y.useMemo(()=>{const S=[];for(const[k,N]of e.items.entries())k===E&&A&&S.push({key:"recap",line:A}),S.push({key:`${N.kind}:${N.id}`,item:N,index:k});return S},[e.items,E,A]);return f.jsx(zR,{value:a,children:f.jsxs(Zse,{className:h,resize:x?"smooth":"instant",children:[f.jsxs(Jse,{className:ye(m&&"gap-0 px-2 py-1.5"),children:[e.items.length===0&&e.status!=="starting"?f.jsx(uie,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(S=>S.enabled),canBrowseFiles:r}):f.jsx(Rie,{rows:w,boundary:E,since:u?.since,lines:m,gap:p,fileUrl:t,attachmentUrl:n,hostImage:s,jumpToRecapRef:d}),Nie(e)?f.jsx(aie,{label:e.status==="starting"?"Starting session…":void 0,startedAt:b,tokens:e.contextUsage?.totalTokens,className:ye(m&&"py-0.5")}):null]}),f.jsx(eie,{})]})})}function Oie(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 Mie=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function Lie({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:s,open:a,onOpenChange:l}){const u=Oie(a);return f.jsx(fs,{open:a,onOpenChange:l,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?f.jsx(gn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),f.jsxs(ms,{children:[e.length===0?f.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.`}):f.jsx("div",{className:"flex flex-col gap-5",children:e.map(({key:d,info:h})=>f.jsx(Die,{windowKey:d,info:h,now:u},d))}),f.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[f.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),f.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:va(r)})]}),s?f.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",NV(s,u)]}):null]})]})})}function Die({windowKey:e,info:t,now:n}){const r=t.utilization??0,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0,a=kV(e),l=s!==void 0?(s-n)/1e3:void 0,u=a!==void 0&&l!==void 0&&l>0&&l<a?(a-l)/a:void 0;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:wV(e)}),f.jsxs("span",{className:ye("shrink-0 font-mono text-body-sm font-medium",t.status==="rejected"?"text-danger":"text-fg-1"),children:[r.toFixed(0),"% used"]})]}),f.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[f.jsx("div",{className:ye("h-full rounded-full",Mie(r)),style:{width:`${Math.min(100,Math.max(2,r))}%`}}),u!==void 0?f.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,u*100))}%`}}):null]}),f.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[s!==void 0?f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(zz,{className:"size-3"})," Resets in ",Hb(s,n)]}):null,t.isUsingOverage?f.jsx("span",{className:"text-warning",children:"overage"}):null,t.status==="rejected"?f.jsx("span",{className:"text-danger",children:"limit reached"}):null]})]})}const jie=["button","a","input","textarea","select","summary","img",'[contenteditable="true"]','[role="button"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'].join(",");function Pie({client:e,sessionId:t,header:n,panelSurface:r="internal",statusSurface:s="internal",statusPlacement:a="top",onOpenPanel:l,onVitals:u,transcriptVariant:d="cards",transcriptDensity:h="comfortable",transcriptFont:m="sans",controlsSurface:p="internal",onControls:b,focusComposerOnClick:x=!1,unseen:E,readOnly:A=!1,toolHost:w,className:S}){const k=r==="external",N=s==="external",_=p==="status"&&!N,M=p==="external"||_,[R,j]=y.useState(void 0),[O,H]=y.useState(),{state:P,connection:Y,protocolMismatch:X,models:Z,effectiveModel:ee,handle:V,send:z,approve:G,deny:Q,interrupt:se,setModel:D,setPermissionMode:B,reconnectNow:$}=q$(e,t,{onProtocolError:j});y.useEffect(()=>j(void 0),[t]);const[L,te]=y.useState(!1);y.useEffect(()=>{te(!1)},[t]);const[ne]=y.useState(E),ce=L?void 0:ne,fe=ce?Math.max(0,P.items.length-ce.itemCount):0,de=y.useCallback(Pe=>{k?l?.(Pe):H(Pe)},[k,l]);y.useEffect(()=>{const Pe=()=>{document.visibilityState==="visible"&&$()};return document.addEventListener("visibilitychange",Pe),()=>document.removeEventListener("visibilitychange",Pe)},[$]),bV(V,w===!1?{enabled:!1}:w);const xe=P.capabilities,Fe=y.useRef(u);Fe.current=u;const De=ee??P.model,Te=y.useMemo(()=>WV(xe.permissionModes,P.session?.canBypassPermissions),[xe.permissionModes,P.session?.canBypassPermissions]);y.useEffect(()=>{Fe.current?.({status:P.status,connection:Y,engine:P.engine,capabilities:P.capabilities,model:De,models:Z,permissionMode:P.permissionMode,permissionModes:Te,cwd:P.cwd,contextUsage:P.contextUsage,rateLimits:P.rateLimits,itemCount:P.items.length})},[P.status,Y,P.engine,P.capabilities,De,Z,P.permissionMode,Te,P.cwd,P.contextUsage,P.rateLimits,P.items.length]);const Oe=y.useRef(b);Oe.current=b;const ze=y.useRef({setModel:D,setPermissionMode:B,interrupt:se});ze.current={setModel:D,setPermissionMode:B,interrupt:se};const Xe=y.useRef({setModel:Pe=>ze.current.setModel(Pe),setPermissionMode:Pe=>ze.current.setPermissionMode(Pe),interrupt:()=>ze.current.interrupt(),focusComposer:()=>J.current?.focus()});y.useEffect(()=>{const Pe=Oe.current;return Pe?.(Xe.current),()=>Pe?.(void 0)},[t]);const Ye=P.status==="running"||P.status==="awaiting_approval",Le=P.status==="failed"||P.status==="closed",ke=X$(e,t,{capabilities:xe,engine:P.engine}),Ee=DR(e,P.cwd),Ie=y.useMemo(()=>H$(P),[P]),je=Bie(e,t,P.producedFiles),J=y.useRef(null),pe=y.useRef(null),oe=y.useMemo(()=>{if(P.commands)return P.commands.some(Pe=>Pe.name==="model")?P.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...P.commands]},[P.commands]),ae=(Pe,We)=>{if(We.length===0){const lt=/^\/model\s+(\S+)$/.exec(Pe);if(lt){D(lt[1]);return}if(xe.mcpStatus&&Pe.trim()==="/mcp"){de("mcp");return}}te(!0),z(Pe,We)},K=f.jsxs(lH,{children:[f.jsx(uH,{render:f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:f.jsx(PB,{className:"size-4"})})}),f.jsxs(cH,{children:[xe.contextUsage?f.jsxs(wl,{onClick:()=>de("context"),children:[f.jsx(pB,{className:"size-3.5 text-fg-3"})," Context"]}):null,xe.rateLimits?f.jsxs(wl,{onClick:()=>de("usage"),children:[f.jsx(ez,{className:"size-3.5 text-fg-3"})," Usage"]}):null,f.jsxs(wl,{onClick:()=>de("info"),children:[f.jsx(cz,{className:"size-3.5 text-fg-3"})," Session info"]}),xe.mcpStatus?f.jsxs(wl,{onClick:()=>de("mcp"),children:[f.jsx(Ly,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,xe.skillsList?f.jsxs(wl,{onClick:()=>de("skills"),children:[f.jsx(nm,{className:"size-3.5 text-fg-3"})," Skills"]}):null,Ee.available?f.jsxs(wl,{onClick:()=>de("files"),children:[f.jsx(XB,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),F=k?null:K,le=typeof n=="function",Ce=f.jsxs(f.Fragment,{children:[Z.length?f.jsx($R,{models:Z,model:ee,onModelChange:D,disabled:Le,className:_?"h-5":void 0}):null,P.permissionMode?f.jsx(Fy,{mode:P.permissionMode,onModeChange:B,modes:xe.permissionModes,canBypass:P.session?.canBypassPermissions,disabled:Le,className:_?"h-5":void 0}):null]}),_e=N?null:f.jsx(Ase,{state:P,connection:Y,placement:a,controls:_&&!A?Ce:void 0,onOpenStatus:k&&!l?void 0:()=>de("info"),onOpenContext:k&&!l?void 0:()=>de("context"),onOpenUsage:k&&!l?void 0:()=>de("usage"),actions:le?void 0:F}),Ve=Pe=>{!x||A||Pe.target?.closest(jie)||window.getSelection()?.isCollapsed!==!1&&J.current?.focus()};return f.jsx(zR,{value:d,children:f.jsx(TV,{value:h,children:f.jsxs("div",{"data-slot":"session-panel","data-agent-font":m,onClick:Ve,className:ye("flex h-full min-h-0 flex-col overflow-hidden bg-bg",S),children:[le?n({actions:F}):n,a==="top"?_e:null,X!==void 0?f.jsxs(Dk,{level:"warning",children:["Server speaks protocol v",X,", this build renders v",LR,". Some events may not render."]}):null,R?f.jsx(Dk,{level:"error",onDismiss:()=>j(void 0),children:R}):null,f.jsx(Iie,{state:P,fileUrl:t?Pe=>e.sessionFileUrl(t,Pe):void 0,attachmentUrl:t?Pe=>e.attachmentUrl(t,Pe):void 0,canBrowseFiles:Ee.available,hostImage:je,variant:d,density:h,catchUp:ce&&fe>0?{from:ce.itemCount,since:ce.since}:void 0,jumpToRecapRef:pe}),ce&&fe>0?f.jsx("div",{className:"px-3 pb-1",children:f.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:[f.jsx("span",{"aria-hidden":!0,className:ye("select-none",d==="lines"?"text-fg-3":"text-accent"),children:"※"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[fe," new ",fe===1?"row":"rows",ce.since!==void 0?" since you were last here":""]}),f.jsx("button",{type:"button",onClick:()=>pe.current?.(),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"jump"}),f.jsx("button",{type:"button",onClick:()=>te(!0),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"dismiss"})]})}):null,!A&&xe.interactiveApprovals&&P.pendingApprovals.length>0?f.jsx("div",{className:"px-3 pb-2",children:f.jsx("div",{className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-2",children:P.pendingApprovals.map(Pe=>Pe.toolName==="AskUserQuestion"&&Y5(Pe.input).length>0?f.jsx(Ese,{request:Pe,onAnswer:G,onDismiss:We=>Q(We,"Question dismissed by user")},Pe.id):f.jsx(yse,{request:Pe,onApprove:G,onDeny:Q},Pe.id))})}):null,A?null:f.jsx(IV,{ref:J,onSend:ae,onInterrupt:se,busy:Ye,disabled:Le||!t,commands:xe.slashCommands?oe:void 0,skills:xe.skillsList?P.skills:void 0,attachments:ke,onSearchFiles:Ee.available?(Pe,We)=>Ee.search(Pe,{...We,limit:8}):void 0,layout:M?"inline":"stacked",toolbar:M?void 0:Ce}),a==="bottom"?_e:null,k?null:f.jsxs(f.Fragment,{children:[f.jsx(Tse,{state:P,client:e,sessionId:t,open:O==="info",onOpenChange:Pe=>H(Pe?"info":void 0)}),f.jsx(jV,{usage:P.contextUsage,open:O==="context",onOpenChange:Pe=>H(Pe?"context":void 0)}),f.jsx(Lie,{rateLimits:Ie,subscriptionType:P.subscriptionType,engine:P.engine??"claude",totalCostUsd:P.totalCostUsd,updatedAt:P.rateLimitsUpdatedAt,open:O==="usage",onOpenChange:Pe=>H(Pe?"usage":void 0)}),f.jsx(zV,{client:e,sessionId:t,canManageServers:xe.mcpServerActions,open:O==="mcp",onOpenChange:Pe=>H(Pe?"mcp":void 0)}),f.jsx(VV,{skills:P.skills,open:O==="skills",onOpenChange:Pe=>H(Pe?"skills":void 0),onUse:Pe=>J.current?.insertText(UR(Pe))}),f.jsx(PV,{client:e,cwd:P.cwd,open:O==="files",onOpenChange:Pe=>H(Pe?"files":void 0)})]})]})})})}function Bie(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],u=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(u);if(d)return d;const h=l&&t?e.readProducedFile(t,l.fileId).then(m=>{if(m.size===0)return;const p=URL.createObjectURL(m);return s.current.push(p),p}).catch(()=>{}):e.readHostFile(a).then(m=>{if(m.encoding!=="base64")return;const p=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=zie[p];return b?`data:${b};base64,${m.content}`:void 0}).catch(()=>{});return r.current.set(u,h),h},[e,t,n])}const zie={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function Dk({level:e,onDismiss:t,children:n}){return f.jsx("div",{className:"px-3 pt-2",children:f.jsxs("div",{role:"alert",className:ye("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:[f.jsx(ql,{className:"mt-0.5 size-3.5 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?f.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:f.jsx(Cs,{className:"size-3.5"})}):null]})})}function Q5(e){return ye("px-2 py-1.5 hover:bg-row-hover",e?"mr-1 ml-0 rounded-r-md border-l-4 border-l-accent":"mx-1 rounded-md")}function Uie({rows:e,config:t,onConfigChange:n,scope:r,activeId:s,onSelect:a,onDelete:l,onRename:u,emptyState:d,showControls:h=!0,className:m}){const p=y.useMemo(()=>OR(e,t,r),[e,t,r]),b=y.useMemo(()=>_$(p,t),[p,t]),x=R$(t,r,p.length,e.length),E=y.useMemo(()=>T$(e),[e]),A=y.useMemo(()=>{const S=new Map;for(const k of e)S.set(k.hostId,k.hostName);return[...S].map(([k,N])=>({id:k,name:N}))},[e]),w=S=>n({...t,...S});return f.jsxs("div",{"data-slot":"session-browser",className:ye("flex flex-col gap-3",m),children:[f.jsxs("div",{className:ye("flex flex-col gap-1.5 px-2",!h&&"hidden"),children:[f.jsxs("div",{className:"relative",children:[f.jsx(tm,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:t.search,onChange:S=>w({search:S.target.value}),placeholder:"Search sessions","aria-label":"Search sessions",className:"pl-8"})]}),f.jsx(kc,{label:"State",children:f.jsx(J1,{label:"State",value:t.states,options:AR.map(S=>({value:S,label:_R[S]})),onChange:S=>w({states:S})})}),E.length>1?f.jsx(kc,{label:"Engine",children:f.jsx(J1,{label:"Engine",value:t.adapters,options:E.map(S=>({value:S,label:S})),onChange:S=>w({adapters:S})})}):null,A.length>1?f.jsx(kc,{label:"Gateway",children:f.jsx(J1,{label:"Gateway",value:t.gateways,options:A.map(S=>({value:S.id,label:S.name})),onChange:S=>w({gateways:S})})}):null,f.jsx(kc,{label:"Group",children:f.jsx(jk,{label:"Group",value:t.groupBy,options:[{value:"none",label:"No grouping"},{value:"state",label:"By state"},{value:"adapter",label:"By engine"},...A.length>1?[{value:"gateway",label:"By gateway"}]:[]],onChange:S=>w({groupBy:S})})}),f.jsx(kc,{label:"Sort",children:f.jsx(jk,{label:"Sort",value:t.sortBy,options:[{value:"recent",label:"Recent"},{value:"name",label:"Name"},{value:"state",label:"State"},...A.length>1?[{value:"gateway",label:"Gateway"}]:[]],onChange:S=>w({sortBy:S})})})]}),x?f.jsxs("div",{className:"flex items-center gap-2 px-3 text-label text-fg-4",children:[f.jsxs("span",{children:[x.shown," of ",x.total,x.causes.length?` · ${x.causes.join(" · ")}`:null]}),f.jsx("button",{type:"button",className:"text-fg-3 underline underline-offset-2 hover:text-fg-1",onClick:()=>n(Rw(t)),children:"Show all"})]}):null,e.length===0?d??f.jsx(Vr,{icon:f.jsx(Rb,{}),title:"No sessions yet"}):p.length===0?I$(t)?f.jsx(Vr,{icon:f.jsx(V_,{}),title:"No matches",description:"No session matches the current search and filters.",action:"Clear filters",onAction:()=>n(Rw(t))}):f.jsx(Vr,{icon:f.jsx(Rb,{}),title:"Nothing here",description:"No session to show."}):f.jsx("div",{className:"flex flex-col gap-4",children:b.map(S=>f.jsxs("div",{className:"flex flex-col gap-1",children:[t.groupBy!=="none"&&S.label?f.jsxs("div",{className:"flex items-baseline gap-2 px-3 text-label font-medium text-fg-4",children:[f.jsx("span",{className:"uppercase tracking-wide",children:S.label}),f.jsx("span",{className:"text-fg-4/70",children:S.rows.length})]}):null,S.rows.map(k=>f.jsx(Hie,{row:k,active:k.info.id===s,showGateway:A.length>1,onSelect:a,onDelete:l,onRename:u},`${k.hostId}:${k.info.id}`))]},S.key))})]})}function Hie({row:e,active:t,showGateway:n,onSelect:r,onDelete:s,onRename:a}){const{info:l}=e,[u,d]=y.useState(!1),h=l.cwd.split("/").filter(Boolean).pop()??l.cwd,m=[n?e.hostName:void 0,_V(l.model),h,l.profile?`@${l.profile}`:void 0,va(l.totalCostUsd)].filter(Boolean);return f.jsxs("div",{"data-slot":"session-row","data-active":t||void 0,onClick:()=>!u&&r?.(e),className:ye("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",Q5(t===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[u&&a?f.jsx(Fie,{initial:l.title??"",onCommit:p=>{d(!1),a(e,p)},onCancel:()=>d(!1)}):f.jsx("button",{type:"button",className:ye("min-w-0 flex-1 truncate text-left text-body-sm outline-none",t?"font-medium text-fg-1":"text-fg-2"),children:tu(l)}),e.unseen>0?f.jsx("span",{title:`${e.unseen} new`,className:"shrink-0 rounded-full bg-accent px-1.5 text-label text-accent-fg",children:e.unseen}):null,f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:fu(l.lastActivityAt??l.createdAt)}),f.jsx(Z5,{row:e})]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",tabIndex:-1,className:"min-w-0 flex-1 truncate text-left font-mono outline-none",children:m.join(" · ")}),a&&!u?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Rename session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:p=>{p.stopPropagation(),d(!0)},children:f.jsx(Az,{className:"size-3 text-fg-3"})}):null,s?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:p=>{p.stopPropagation(),s(e)},children:f.jsx(Sd,{className:"size-3 text-fg-3"})}):null]})]})}function Z5({row:e}){const{info:t}=e;if(t.pendingPermissionCount>0||t.status==="awaiting_approval")return f.jsx(lB,{className:"size-3.5 shrink-0 animate-pulse text-warning"});if(t.status==="running"||t.status==="starting")return f.jsx(xn,{className:"size-3.5 shrink-0 text-info"});switch(t.status){case"failed":return f.jsx(TB,{className:"size-3.5 shrink-0 text-danger"});case"closed":return f.jsx(AB,{className:"size-3.5 shrink-0 text-fg-4"});case"parked":return f.jsx(kB,{className:"size-3.5 shrink-0 text-fg-3"});default:return f.jsx($_,{className:"size-3.5 shrink-0 text-fg-4"})}}function Fie({initial:e,onCommit:t,onCancel:n}){const[r,s]=y.useState(e),a=y.useRef(null);return y.useEffect(()=>{a.current?.select()},[]),f.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 kc({label:e,children:t}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{"aria-hidden":!0,className:"w-14 shrink-0 truncate text-label text-fg-3",children:e}),f.jsx("div",{className:"min-w-0 flex-1",children:t})]})}function J1({label:e,value:t,options:n,onChange:r}){return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Ai,{multiple:!0,value:t,onValueChange:s=>r(s),children:[f.jsx(Ri,{"aria-label":e,className:"min-w-0 flex-1",children:f.jsx(_i,{children:t.length===0?"All":t.length===1?n.find(s=>s.value===t[0])?.label??"All":`${t.length} selected`})}),f.jsx(Ii,{children:n.map(s=>f.jsx(qs,{value:s.value,children:f.jsx(Vs,{children:s.label})},s.value))})]}),t.length>0?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":`Clear ${e}`,onClick:()=>r([]),children:f.jsx(Cs,{className:"size-3 text-fg-4"})}):null]})}function jk({label:e,value:t,options:n,onChange:r}){return f.jsxs(Ai,{value:t,onValueChange:s=>r(s),children:[f.jsx(Ri,{"aria-label":e,className:"w-full min-w-0",children:f.jsx(_i,{children:n.find(s=>s.value===t)?.label??e})}),f.jsx(Ii,{children:n.map(s=>f.jsx(qs,{value:s.value,children:f.jsx(Vs,{children:s.label})},s.value))})]})}const $ie={claude:{title:"Claude",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"},codex:{title:"OpenAI",d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"},gemini:{title:"Gemini",d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"},deepseek:{title:"DeepSeek",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"},moonshot:{title:"Moonshot",d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}};function Vie(e,t){if(e==="claude")return"claude";if(e==="codex")return"codex";const n=t?.toLowerCase()??"";if(n){if(n.includes("gemini"))return"gemini";if(n.includes("deepseek"))return"deepseek";if(n.includes("moonshot")||n.includes("kimi"))return"moonshot";if(n.includes("claude"))return"claude";if(n.startsWith("gpt")||n.startsWith("o1")||n.startsWith("o3")||n.includes("openai"))return"codex"}}function J5({engine:e,model:t,className:n}){const r=$ie[Vie(e,t)??""];return r?f.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",role:"img","aria-label":r.title,className:ye("size-3 shrink-0 text-fg-3",n),children:[f.jsx("title",{children:r.title}),f.jsx("path",{d:r.d})]}):f.jsx("span",{"aria-hidden":!0,title:e,className:ye("shrink-0 text-fg-3",n),children:"·"})}function eI(){const[e,t]=y.useState(_x());return f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(rL()),children:e==="dark"?f.jsx(uU,{className:"size-4"}):f.jsx($_,{className:"size-4"})})}const tI=[{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"}],nI="workerdeck.transcript-density";function Iv(){return localStorage.getItem(nI)==="compact"?"compact":"comfortable"}function qie(e){localStorage.setItem(nI,e)}const rI="workerdeck.transcript-variant";function Ov(){return localStorage.getItem(rI)==="lines"?"lines":"cards"}function Yie(e){localStorage.setItem(rI,e)}const sI="workerdeck.transcript-font";function Mv(){return localStorage.getItem(sI)==="mono"?"mono":"sans"}function Gie(e){localStorage.setItem(sI,e)}function eb({label:e,options:t,read:n,write:r}){const[s,a]=y.useState(n);return f.jsxs(Ai,{value:s,onValueChange:l=>{a(l),r(l)},children:[f.jsx(Ri,{"aria-label":e,className:"min-w-40",children:f.jsx(_i,{children:t.find(l=>l.value===s)?.label})}),f.jsx(Ii,{children:t.map(l=>f.jsx(qs,{value:l.value,children:f.jsx(Vs,{children:l.label})},l.value))})]})}function Kie({title:e,children:t}){return f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-label font-medium tracking-wide text-fg-3 uppercase",children:e}),t]})}function Xie({open:e,onOpenChange:t}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"md",className:"w-[min(30rem,calc(100vw-2rem))]",children:[f.jsx(ps,{title:"Settings",description:"Preferences held by this browser. What a run defaults to lives on its profile; server policy lives where the gateway runs."}),f.jsx(ms,{children:f.jsx("div",{className:"flex flex-col gap-6",children:f.jsxs(Kie,{title:"Appearance",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),f.jsx(eI,{})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view style"}),f.jsx(eb,{label:"Agent view style",options:[{value:"cards",label:"Cards"},{value:"lines",label:"Lines"}],read:Ov,write:Yie})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view density"}),f.jsx(eb,{label:"Agent view density",options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}],read:Iv,write:qie})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view font"}),f.jsx(eb,{label:"Agent view font",options:[{value:"sans",label:"Regular"},{value:"mono",label:"Monospace"}],read:Mv,write:Gie})]})]})})})]})})}function iI({className:e}){return f.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[f.jsx("path",{d:"M12 3 20.5 7.75 12 12.5 3.5 7.75Z"}),f.jsx("path",{d:"M3.5 12.25 12 17l8.5-4.75"}),f.jsx("path",{d:"M3.5 16.5 12 21.25l8.5-4.75"}),f.jsx("path",{d:"M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z",fill:"#2fbf71",stroke:"none"})]})}const aI="workerdeck.hosts.v1",gx=e=>`workerdeck.host.${e}.key`,oI="gateway";let ds={hosts:[],ready:!1};const bx=new Set;function Lv(e){ds=e,xx.clear();for(const t of bx)t()}function Dv(){try{const e=localStorage.getItem(aI),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(({implicit:n,...r})=>r):[]}catch{return[]}}function lI(e){try{localStorage.setItem(aI,JSON.stringify(e.filter(t=>!t.implicit)))}catch{}}function Wie(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function uI(e){try{return localStorage.getItem(gx(e))??""}catch{return""}}function cI(e,t){try{t===""?localStorage.removeItem(gx(e)):localStorage.setItem(gx(e),t)}catch{}}const xx=new Map;function bd(e){const t=xx.get(e);if(t)return t;const n=ds.hosts.find(a=>a.id===e);if(!n)return;const r=Hy(n);if(r===void 0)return;const s=new aV({baseUrl:r,...n.implicit?{}:rV({baseUrl:r,key:uI(n.id)})});return xx.set(e,s),s}function Cm(){return ds.hosts.find(e=>e.implicit)??ds.hosts[0]}function Qie(){const e=Cm();return e?bd(e.id):void 0}function dI(e){return nV(e)}function Zie(e,t){const n=Dv(),r=n.some(s=>s.id===e.id)?n.map(s=>s.id===e.id?e:s):[...n,e];lI(r),cI(e.id,t),Lv({...ds,hosts:[...ds.hosts.filter(s=>s.implicit),...r]})}function Jie(e){const t=Dv().filter(n=>n.id!==e);lI(t),cI(e,""),Lv({...ds,hosts:[...ds.hosts.filter(n=>n.implicit),...t]})}async function eae(){try{const e=await fetch(`${location.origin}/auth/status`,{headers:{accept:"application/json"}});if(!e.ok||!e.headers.get("content-type")?.includes("application/json"))return!1;const t=await e.json();return typeof t=="object"&&t!==null&&"enabled"in t}catch{return!1}}let Pk=!1;function fI(){if(Pk)return;Pk=!0;const e=Dv();ds={hosts:e,ready:!1},eae().then(t=>{Lv({hosts:t?[{id:oI,name:"This gateway",baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function hI(e){return fI(),bx.add(e),()=>bx.delete(e)}function jv(){return y.useSyncExternalStore(hI,()=>ds,()=>ds)}function tae(){return fI(),ds.hosts}function nae(e){return hI(e)}function pI({host:e,submitLabel:t="Save",onSaved:n,actions:r}){const[s,a]=y.useState(e.name),[l,u]=y.useState(e.baseUrl),[d,h]=y.useState(()=>uI(e.id)),m=()=>{if(Hy({baseUrl:l})===void 0){an.error("That address is not a URL");return}if(!s.trim()){an.error("Give the gateway a name");return}const p={id:e.id,name:s.trim(),baseUrl:l.trim()};Zie(p,d),n(p)};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Name"}),f.jsx(Yt,{value:s,onChange:p=>a(p.target.value),placeholder:"Mac mini"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Address"}),f.jsx(Yt,{value:l,onChange:p=>u(p.target.value),placeholder:"http://toby.ts.net:8787",spellCheck:!1,className:"font-mono"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Auth key"}),f.jsx(Yt,{type:"password",value:d,onChange:p=>h(p.target.value),placeholder:"Leave empty for an unauthenticated gateway",spellCheck:!1}),f.jsx("span",{className:"text-label text-fg-4",children:"Stored in this browser’s local storage, and sent on the WebSocket URL when attaching. Use a gateway you control, over a network you trust."})]}),f.jsxs("div",{className:"mt-1 flex justify-end gap-2",children:[r,f.jsx(tt,{onClick:m,children:t})]})]})}function rae({open:e,onOpenChange:t,onCreated:n}){const[r,s]=y.useState(()=>Bk());return f.jsx(fs,{open:e,onOpenChange:a=>{a&&s(Bk()),t(a)},children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Add gateway",description:"A workerdeck gateway you run — typically over Tailscale."}),f.jsx(ms,{children:f.jsx(pI,{host:r,submitLabel:"Add gateway",onSaved:n,actions:f.jsx(tt,{variant:"outline",onClick:()=>t(!1),children:"Cancel"})})})]})})}function Bk(){return{id:Wie(),name:"",baseUrl:""}}function mI({host:e,onClose:t,onRemoved:n}){return f.jsx(fs,{open:!0,onOpenChange:r=>!r&&t(),children:f.jsxs(hs,{children:[f.jsx(ps,{title:`Remove ${e.name}?`,description:"Its auth key is deleted from this browser. The gateway itself keeps running."}),f.jsx(ms,{children:f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(tt,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(tt,{variant:"destructive",onClick:()=>{Jie(e.id),n()},children:"Remove"})]})})]})})}const gI=240,bI=520,yx=300,xI=e=>e==="sessions"?"workerdeck.sessions-sidebar-width":`workerdeck.${e}-sidebar-width`,yI=e=>e==="sessions"?"workerdeck.sessions-sidebar-collapsed":`workerdeck.${e}-sidebar-collapsed`;function sae(e){try{const t=Number(localStorage.getItem(xI(e)));return t?Math.min(bI,Math.max(gI,t)):yx}catch{return yx}}function iae(e,t){try{localStorage.setItem(xI(e),String(t))}catch{}}function aae(e){try{return localStorage.getItem(yI(e))==="1"}catch{return!1}}function oae(e,t){try{localStorage.setItem(yI(e),t?"1":"0")}catch{}}const vI="workerdeck.sessions-filters-shown";function lae(){try{return localStorage.getItem(vI)==="1"}catch{return!1}}function uae(e){try{localStorage.setItem(vI,e?"1":"0")}catch{}}function wm({section:e,title:t,badge:n,actions:r,children:s,rail:a,railActions:l}){const[u,d]=y.useState(()=>sae(e)),[h,m]=y.useState(()=>aae(e)),p=b=>{m(b),oae(e,b)};return h?f.jsxs("div",{className:"flex min-h-0 w-11 shrink-0 flex-col items-center gap-1 border-r border-border bg-sidebar py-1.5",children:[f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>p(!1),children:f.jsx(My,{className:"size-4"})}),l,a?f.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center gap-0.5 overflow-y-auto pt-1",children:a}):null]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{width:u},className:"flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar",children:[f.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-1 pr-1 pl-3",children:[f.jsx("span",{className:"truncate text-label font-medium tracking-wide text-fg-3 uppercase",children:t}),n,f.jsx("span",{className:"flex-1"}),f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>p(!0),children:f.jsx(Oy,{className:"size-3.5"})}),r]}),s]}),f.jsx(Mb,{orientation:"vertical",value:u,onValueChange:b=>{d(b),iae(e,b)},min:gI,max:bI,defaultValue:yx,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function km({children:e,className:t}){return f.jsx("div",{className:ye("min-h-0 flex-1 overflow-y-auto pb-2",t),children:e})}function Pv({title:e,status:t,description:n,actions:r,active:s,onSelect:a,onDoubleClick:l}){return f.jsxs("div",{"data-slot":"sidebar-row","data-active":s||void 0,onClick:a,onDoubleClick:l,className:ye("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",Q5(s===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{type:"button",className:ye("min-w-0 flex-1 truncate text-left text-body-sm outline-none",s?"font-medium text-fg-1":"text-fg-2"),children:e}),t]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",tabIndex:-1,className:"flex min-w-0 flex-1 items-center gap-1.5 truncate text-left font-mono outline-none",children:n}),r]})]})}function EI({label:e,onClick:t,children:n}){return f.jsx("button",{type:"button","aria-label":e,title:e,onClick:r=>{r.stopPropagation(),t()},className:"flex size-5 shrink-0 items-center justify-center rounded text-fg-3 opacity-0 transition-opacity outline-none hover:bg-surface-hover hover:text-fg-1 group-hover:opacity-100",children:n})}const zk="workerdeck.watermarks.v1",vx=new Set;let Ex=0;const cae={read:()=>{try{const e=localStorage.getItem(zk);return e?JSON.parse(e):void 0}catch{return}},write:e=>{try{localStorage.setItem(zk,JSON.stringify(e))}catch{}Ex+=1;for(const t of vx)t()}},wp=new L$(cae);function dae(e){return vx.add(e),()=>vx.delete(e)}function fae(){return y.useSyncExternalStore(dae,()=>Ex,()=>Ex),{unseenFor:y.useCallback((t,n)=>D$(wp.get(t,n.id),{activityCount:n.activityCount,turns:n.numTurns}),[]),watermarks:wp}}function hae(e,t){const n=wp.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function pae(e,t){const n=y.useRef({});return y.useCallback(r=>{!t||document.hidden||(n.current={...n.current,...r},wp.mark(e,t,n.current))},[e,t])}const mae=5e3,gae=1200,bae=700;let Qc={snapshots:[],loaded:!1};const Tx=new Set;function xae(e){Qc=e;for(const t of Tx)t()}let tb,TI=0,nb;function Zc(){return tb??=(async()=>{TI=Date.now();try{const e=tae(),t=new Map(Qc.snapshots.map(r=>[r.host.id,r])),n=await Promise.all(e.map(async r=>{const s=bd(r.id);if(!s)return{host:r,sessions:[],error:"unusable address"};try{return{host:r,sessions:await s.listSessions()}}catch(a){return{host:r,sessions:t.get(r.id)?.sessions??[],error:a instanceof Error?a.message:String(a)}}}));xae({snapshots:n,loaded:!0})}finally{tb=void 0}})(),tb}function yae(){if(nb!==void 0)return;const e=Math.max(0,bae-(Date.now()-TI));nb=setTimeout(()=>{nb=void 0,Zc()},e)}function vae(e){return Tx.add(e),()=>Tx.delete(e)}let Ah,Uk;function Eae(e){const t=e?gae:mae;Ah!==void 0&&Uk===t||(Ah!==void 0&&clearInterval(Ah),Uk=t,Ah=setInterval(()=>void Zc(),t))}function Ld(){const e=y.useSyncExternalStore(vae,()=>Qc,()=>Qc);y.useEffect(()=>nae(()=>void Zc()),[]);const t=e.snapshots.some(n=>n.sessions.some(r=>{const s=RR(r);return s==="working"||s==="attention"}));return y.useEffect(()=>{Eae(t),Qc.loaded||Zc()},[t]),{...e,refresh:Zc}}function Tae(e){const{unseenFor:t}=fae();return y.useMemo(()=>e.flatMap(({host:n,sessions:r})=>r.filter(s=>!S$(s)).map(s=>({hostId:n.id,hostName:n.name,local:dI(n),adapter:s.engine??"claude",state:RR(s),info:s,unseen:t(n.id,s)}))),[e,t])}function Sae(){const e=ws(),t=yd({select:p=>p.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=jv(),{snapshots:s}=Ld(),[a,l]=y.useState(!1),[u,d]=y.useState(),h=s.filter(p=>p.error===void 0).length,m=f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Add gateway",onClick:()=>l(!0),children:f.jsx(Mo,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsx(wm,{section:"gateways",title:"Gateways",badge:r&&n.length>0?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[h,"/",n.length]}):void 0,actions:m,railActions:m,children:f.jsxs(km,{children:[r&&n.length===0?f.jsx(Vr,{icon:f.jsx(Yz,{}),title:"No gateways yet",description:f.jsxs(f.Fragment,{children:["Add one with ",f.jsx(Do,{children:"+"})," above."]})}):null,n.map(p=>{const b=s.find(E=>E.host.id===p.id),x=b===void 0?"pending":b.error?"error":"ok";return f.jsx(Pv,{active:p.id===t,onSelect:()=>void e({to:"/gateways/$hostId",params:{hostId:p.id}}),title:p.name,status:f.jsxs(f.Fragment,{children:[p.implicit?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:"this page"}):null,f.jsx("span",{"aria-hidden":!0,title:b?.error??(x==="ok"?"Connected":"Connecting…"),className:ye("size-1.5 shrink-0 rounded-full",x==="ok"?"bg-success":x==="error"?"bg-danger":"bg-fg-4")})]}),description:p.baseUrl,actions:p.implicit?null:f.jsx(EI,{label:`Remove ${p.name}`,onClick:()=>d(p),children:f.jsx(Sd,{className:"size-3"})})},p.id)})]})}),u?f.jsx(mI,{host:u,onClose:()=>d(void 0),onRemoved:()=>{const p=u.id===t;d(void 0),p&&e({to:"/gateways"})}}):null,f.jsx(rae,{open:a,onOpenChange:l,onCreated:p=>{l(!1),e({to:"/gateways/$hostId",params:{hostId:p.id}})}})]})}function SI({value:e,onChange:t,models:n=tI,className:r}){return f.jsx($R,{variant:"form",models:n,model:e||void 0,onModelChange:s=>t(s??""),className:r})}function Cae({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),f.jsxs(Ai,{items:e.map(s=>({value:s.name,label:s.name})),value:t,onValueChange:s=>n(s),children:[f.jsx(Ri,{className:r,children:f.jsx(_i,{})}),f.jsx(Ii,{children:e.map(s=>f.jsx(qs,{value:s.name,children:f.jsx(Vs,{children:f.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))})]})]})}function Mr(){return Qie()}function CI(e,t,n){const r=e?.capabilities??om[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 h=e.provider;a=(h?.models?.length?h.models:h?.model?[h.model]:[]).map(p=>({value:p,displayName:p})),l=h?.model}else a=tI.filter(h=>h.value!=="default");const u=a.find(h=>h.value===n||h.resolvedModel===n),d=u||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:(u?u.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}const Sx={profiles:[]};let Cx,rb;const wx=new Set;async function Hk(){const e=await(Mr()?.listProfiles().catch(()=>Sx)??Promise.resolve(Sx));Cx=e;for(const t of wx)t(e);return e}function Bv(){const[e,t]=y.useState(Cx??Sx);y.useEffect(()=>(wx.add(t),Cx||(rb??=Hk()),()=>{wx.delete(t)}),[]);const n=y.useCallback(async()=>{rb=Hk(),await rb},[]);return{...e,refresh:n}}function wae(){return Bv().profiles}const Fk="workerdeck.last-profile";function kae(){const e=wae(),[t,n]=y.useState(()=>localStorage.getItem(Fk)??""),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(Fk,l)}}}const kx="workerdeck.last-cwd";function Nae(e){const[t,n]=y.useState([]);return y.useEffect(()=>{Mr()?.listHostRoots().then(r=>n(r.roots.map(s=>s.path))).catch(()=>n([]))},[]),y.useMemo(()=>{const r=localStorage.getItem(kx),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])}const Aae={session:"default",job:"acceptEdits"};function wI(e){const[t,n]=y.useState(()=>localStorage.getItem(kx)??""),[r,s]=y.useState(""),[a,l]=y.useState(""),[u,d]=y.useState(void 0),[h,m]=y.useState(""),{profiles:p,profile:b,selected:x,select:E}=kae(),A=u??x?.defaults?.permissionMode??Aae[e],w=CI(x,A,a),S=N=>({cwd:w.capabilities.hostCwd===!1?void 0:t.trim(),profile:b||void 0,prompt:N.prompt,permissionMode:w.mode,model:w.model.trim()||void 0,resume:N.resume,reasoningEffort:h&&w.reasoningEfforts.includes(h)?h:void 0,...w.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:N.allowBypass||void 0}:{}}),k=N=>localStorage.setItem(kx,t.trim()||N);return{cwd:t,setCwd:n,prompt:r,setPrompt:s,mode:w.mode,setMode:d,model:a,setModel:l,effort:h,setEffort:m,profiles:p,profile:b,selectProfile:E,engine:w,sessionFields:S,rememberCwd:k}}function kI({form:e,sessions:t,promptLabel:n,promptPlaceholder:r="e.g. /verify-content 42, or a task description",extras:s,actions:a,onProfileChange:l}){const u=Nae(t),d=y.useId(),{engine:h}=e;return f.jsxs(f.Fragment,{children:[h.capabilities.hostCwd!==!1&&f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),f.jsx(Yt,{value:e.cwd,list:d,onChange:m=>e.setCwd(m.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"}),f.jsx("datalist",{id:d,children:u.map(m=>f.jsx("option",{value:m},m))})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:n}),f.jsx(QN,{value:e.prompt,onChange:m=>e.setPrompt(m.target.value),rows:2,placeholder:r})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(Cae,{profiles:e.profiles,value:e.profile,onChange:m=>{e.selectProfile(m),l?.(m)},className:"min-w-32"}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),f.jsx(Fy,{variant:"form",mode:h.mode,onModeChange:e.setMode,modes:h.modes,className:"min-w-44"})]}),s,f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),f.jsx(SI,{value:h.model,onChange:e.setModel,models:h.models,className:"min-w-40"})]}),h.reasoningEfforts.length>0?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),f.jsxs(Ai,{items:[{value:"default",label:"Default"},...h.reasoningEfforts.map(m=>({value:m,label:m}))],value:e.effort||"default",onValueChange:m=>e.setEffort(m==="default"?"":String(m)),children:[f.jsx(Ri,{className:"min-w-28",children:f.jsx(_i,{})}),f.jsx(Ii,{children:["default",...h.reasoningEfforts].map(m=>f.jsx(qs,{value:m,children:f.jsx(Vs,{children:m})},m))})]})]}):null,a]})]})}const _ae=15e3;let xi={jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0};const Nx=new Set;function bo(e){xi={...xi,...e};for(const t of Nx)t()}let sb;function kp(){return sb??=(async()=>{try{const e=Mr();if(!e)return;const[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);bo({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){const t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?bo({enabled:!1,error:void 0}):bo({error:t})}finally{sb=void 0}})(),sb}let Ax=0,ib,Np;function Rae(e){return Nx.add(e),++Ax===1&&(kp(),ib=setInterval(()=>void kp(),_ae)),()=>{Nx.delete(e),--Ax===0&&(clearInterval(ib),ib=void 0,Np?.(),Np=void 0,bo({live:!1}))}}function Iae(){if(Np||!xi.enabled||xi.stats===void 0||Ax===0)return;const e=Mr();if(!e)return;const t=e.attachQueue(),n=[t.on("attached",()=>void kp()),t.on("stats",r=>bo({stats:r})),t.on("connectionChange",r=>bo({live:r})),t.on("event",r=>{bo({jobs:xi.jobs.some(s=>s.id===r.job.id)?xi.jobs.map(s=>s.id===r.job.id?r.job:s):[...xi.jobs,r.job]})})];Np=()=>{for(const r of n)r();t.detach()}}function zv(){const e=y.useSyncExternalStore(Rae,()=>xi,()=>xi);return y.useEffect(Iae,[e.enabled,e.stats]),{...e,refresh:kp}}function Oae({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return f.jsxs("div",{className:"flex flex-wrap items-center justify-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:[f.jsxs("span",{children:["Running ",f.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),f.jsxs("span",{children:["Queued ",f.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?f.jsxs("span",{children:["Parked ",f.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?f.jsx(hR,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",f.jsxs("span",{className:"font-mono text-fg-1",children:[cs(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${cs(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?f.jsxs("span",{children:["Per-job cap ",f.jsx("span",{className:"font-mono text-fg-1",children:cs(e.sessionTokenLimit)})]}):null,e.paused?f.jsx(gn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function Mae({onScheduled:e}){const{snapshots:t}=Ld(),n=t.find(k=>k.host.id===Cm()?.id)?.sessions??[],r=wI("job"),[s,a]=y.useState("auto"),[l,u]=y.useState(!1),[d,h]=y.useState(""),[m,p]=y.useState(""),[b,x]=y.useState(""),[E,A]=y.useState(!1),{engine:w}=r,S=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){an.error("Working directory and prompt are required");return}const k=d.trim()?Number(d.trim()):void 0;if(k!==void 0&&(!Number.isFinite(k)||k<=0)){an.error("Max tokens must be a positive number");return}const N=m.trim()?Number(m.trim()):void 0;if(N!==void 0&&(!Number.isInteger(N)||N<1)){an.error("Attempts must be a whole number of at least 1");return}A(!0);try{r.rememberCwd(r.cwd.trim()),await Mr().createJob({session:{...r.sessionFields({allowBypass:l}),prompt:r.prompt.trim(),questionBehavior:w.capabilities.interactiveApprovals?s:void 0},maxTokens:k,attempts:N,webhook:b.trim()?{url:b.trim()}:void 0}),r.setPrompt(""),an.success("Job scheduled"),e()}catch(_){an.error(_ instanceof Error?_.message:"Failed to schedule job")}finally{A(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(kI,{form:r,sessions:n,promptLabel:"Prompt (the task — runs unattended)",extras:w.capabilities.interactiveApprovals?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),f.jsxs(Ai,{items:kk.map(k=>({value:k.value,label:k.label})),value:s,onValueChange:k=>a(k),children:[f.jsx(Ri,{className:"min-w-36",children:f.jsx(_i,{})}),f.jsx(Ii,{children:kk.map(k=>f.jsx(qs,{value:k.value,children:f.jsx(Vs,{children:`${k.label} — ${k.description}`})},k.value))})]})]}):null,actions:f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),f.jsx(Yt,{value:d,onChange:k=>h(k.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),f.jsx(Yt,{value:m,onChange:k=>p(k.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),f.jsx(Yt,{value:b,onChange:k=>x(k.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),f.jsxs(tt,{className:"ml-auto",onClick:()=>void S(),disabled:E,children:[E?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(Mo,{className:"size-4"}),"Schedule"]})]})}),w.capabilities.settingSources?f.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:[f.jsx("input",{type:"checkbox",checked:l,onChange:k=>u(k.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",f.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",f.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,f.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — the job's page is read-only, so answer them from the session itself, 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"," ",f.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})}function Lae({open:e,onOpenChange:t,onScheduled:n}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"Schedule a job",description:"A one-shot run the queue executes unattended."}),f.jsx(ms,{children:e?f.jsx(Mae,{onScheduled:n}):null})]})})}function Dae(){const{stats:e,enabled:t,error:n}=zv();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[n?f.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"," ",f.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,t?f.jsxs(f.Fragment,{children:[f.jsx(Vr,{icon:f.jsx(H_,{}),title:"No job selected",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or schedule one with ",f.jsx(Do,{children:"+"})," above."]})}),e?f.jsx("div",{className:"mt-2 w-full max-w-xl",children:f.jsx(Oae,{stats:e})}):null]}):f.jsxs(f.Fragment,{children:[f.jsx(fB,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"The server has no job queue configured."}),f.jsxs("p",{className:"max-w-md text-label text-fg-4",children:["Pass ",f.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",f.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})}const NI={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"}},jae=["queued","running","parked"];function Pae(){const e=ws(),t=yd({select:w=>w.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:s,refresh:a}=zv(),[l,u]=y.useState(!1),[d,h]=y.useState(""),[m,p]=y.useState(!1),b=d.trim().toLowerCase(),x=[...n].sort((w,S)=>S.createdAt-w.createdAt).filter(w=>(!m||jae.includes(w.status))&&(!b||w.prompt.toLowerCase().includes(b)||w.cwd.toLowerCase().includes(b)||(w.profile?.toLowerCase().includes(b)??!1)||w.id.startsWith(b))),E=n.length-x.length,A=r?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Schedule a job",onClick:()=>u(!0),children:f.jsx(Mo,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(wm,{section:"jobs",title:"Jobs",badge:r?f.jsx("span",{"aria-hidden":!0,title:s?"Streaming over the queue socket":"Polling",className:ye("size-1.5 shrink-0 rounded-full",s?"bg-success":"bg-fg-4")}):void 0,actions:f.jsxs(f.Fragment,{children:[f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:f.jsx(em,{className:"size-3.5"})}),A]}),railActions:A,children:r?f.jsxs(f.Fragment,{children:[n.length>0?f.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[f.jsx(Yt,{value:d,onChange:w=>h(w.target.value),placeholder:"Search jobs","aria-label":"Search jobs",className:"h-7 min-w-0 flex-1 text-body-sm"}),f.jsx(tt,{variant:m?"default":"outline",size:"xs","aria-pressed":m,onClick:()=>p(!m),children:"Active"})]}):null,f.jsxs(km,{children:[n.length===0?f.jsx(Vr,{icon:f.jsx(hw,{}),title:"No jobs yet",description:f.jsxs(f.Fragment,{children:["Schedule one with ",f.jsx(Do,{children:"+"})," above."]})}):x.length===0?f.jsx(Vr,{icon:f.jsx(V_,{}),title:"No matches",description:"No job matches the active filter.",action:"Show all",onAction:()=>p(!1)}):null,x.map(w=>f.jsx(Bae,{job:w,active:w.id===t,onOpen:()=>void e({to:"/jobs/$jobId",params:{jobId:w.id}}),onChanged:()=>void a()},w.id)),E>0?f.jsxs("p",{className:"px-1 pt-2 text-center text-label text-fg-4",children:[x.length," of ",n.length]}):null]})]}):f.jsx(Vr,{icon:f.jsx(hw,{}),title:"No job queue",description:"This gateway runs without one, so there is nothing to schedule against."})}),f.jsx(Lae,{open:l,onOpenChange:u,onScheduled:()=>{u(!1),a()}})]})}function Bae({job:e,active:t,onOpen:n,onChanged:r}){const s=NI[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=[fu(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split("/").filter(Boolean).pop()??e.cwd];return e.profile&&l.push(`@${e.profile}`),e.usage.totalCostUsd>0&&l.push(va(e.usage.totalCostUsd)),f.jsx(Pv,{active:t,onSelect:n,title:e.prompt,status:f.jsxs(gn,{variant:s.variant,dot:!s.busy,className:"shrink-0",children:[s.busy?f.jsx(xn,{className:"size-3 text-current"}):null,s.label]}),description:l.join(" · "),actions:a?f.jsx(EI,{label:"Cancel job",onClick:()=>{Mr()?.cancelJob(e.id).then(r).catch(u=>an.error(u instanceof Error?u.message:"Cancel failed"))},children:f.jsx(Cs,{className:"size-3"})}):null})}const zae=["web_search","download","web_fetch","deliver_file"],_h=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function vs({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Uae({onCreated:e}){const[t,n]=y.useState("provider"),[r,s]=y.useState(""),[a,l]=y.useState(""),[u,d]=y.useState(""),[h,m]=y.useState(""),[p,b]=y.useState(""),[x,E]=y.useState(""),[A,w]=y.useState(""),[S,k]=y.useState([]),[N,_]=y.useState(""),[M,R]=y.useState(""),[j,O]=y.useState(!1),H=t==="provider",P=async()=>{if(!r.trim()){an.error("Name is required");return}const Y={name:r.trim(),engine:t};if(a.trim()&&(Y.description=a.trim()),H){Y.provider={id:u.trim(),model:h.trim()||void 0,models:_h(p).length>0?_h(p):void 0,apiKeyEnv:x.trim()||void 0};const X={};S.length>0&&(X.capabilities=S),_h(N).length>0&&(X.mcpServers=_h(N)),M.trim()&&(X.instructions=M.trim()),Object.keys(X).length>0&&(Y.session=X)}else Y.configDir=A.trim();O(!0);try{await Mr().createProfile(Y),an.success(`Profile '${Y.name}' created`),e(Y.name)}catch(X){an.error(X instanceof Error?X.message:"Failed to create profile")}finally{O(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Engine",children:f.jsxs(Ai,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:Y=>n(Y),children:[f.jsx(Ri,{className:"min-w-32",children:f.jsx(_i,{})}),f.jsxs(Ii,{children:[f.jsx(qs,{value:"provider",children:f.jsx(Vs,{children:"provider — model-agnostic engine"})}),f.jsx(qs,{value:"claude",children:f.jsx(Vs,{children:"claude — Agent SDK + config dir"})})]})]})}),f.jsx(vs,{label:"Name",children:f.jsx(Yt,{value:r,onChange:Y=>s(Y.target.value),placeholder:"kimi"})}),f.jsx(vs,{label:"Description (optional)",children:f.jsx(Yt,{value:a,onChange:Y=>l(Y.target.value),placeholder:"what this profile is for"})})]}),H?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Provider id",children:f.jsx(Yt,{value:u,onChange:Y=>d(Y.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),f.jsx(vs,{label:"Default model",children:f.jsx(Yt,{value:h,onChange:Y=>m(Y.target.value),placeholder:"kimi-k3",className:"font-mono"})}),f.jsx(vs,{label:"Models offered (comma-separated)",children:f.jsx(Yt,{value:p,onChange:Y=>b(Y.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),f.jsx(vs,{label:"API key variable",children:f.jsx(Yt,{value:x,onChange:Y=>E(Y.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Capabilities granted",children:f.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:zae.map(Y=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:S.includes(Y),onChange:X=>k(Z=>X.target.checked?[...Z,Y]:Z.filter(ee=>ee!==Y)),className:"size-3.5 accent-(--color-fg-1)"}),f.jsx("code",{className:"font-mono text-label",children:Y})]},Y))})}),f.jsx(vs,{label:"MCP servers (names, comma-separated)",children:f.jsx(Yt,{value:N,onChange:Y=>_(Y.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),f.jsx(vs,{label:"Instructions (optional)",children:f.jsx(Yt,{value:M,onChange:Y=>R(Y.target.value),placeholder:"prepended to the session's system prompt"})}),f.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."})]}):f.jsxs(f.Fragment,{children:[f.jsx(vs,{label:"Config directory",children:f.jsx(Yt,{value:A,onChange:Y=>w(Y.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),f.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",f.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."]})]}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(tt,{onClick:()=>void P(),disabled:j,children:[j?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(Mo,{className:"size-4"}),"Create profile"]})})]})}function Hae({open:e,onOpenChange:t,onCreated:n}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"New profile",description:"What a session runs as — a Claude config directory, or a model provider."}),f.jsx(ms,{children:e?f.jsx(Uae,{onCreated:n}):null})]})})}function Fae(){const e=ws(),t=yd({select:d=>d.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:s}=Bv(),[a,l]=y.useState(!1),u=r?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"New profile",onClick:()=>l(!0),children:f.jsx(Mo,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(wm,{section:"profiles",title:"Profiles",badge:n.length>0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:n.length}):void 0,actions:u,railActions:u,children:f.jsxs(km,{children:[n.length===0?f.jsx(Vr,{icon:f.jsx(az,{}),title:r?"No profiles yet":"No profiles",description:r?f.jsxs(f.Fragment,{children:["Add one with ",f.jsx(Do,{children:"+"})," above."]}):"This gateway declares none, and this login may not add them."}):null,n.map(d=>f.jsx(Pv,{active:d.name===t,onSelect:()=>void e({to:"/profiles/$profileName",params:{profileName:d.name}}),title:d.name,status:d.managed?null:f.jsx(gn,{variant:"neutral",className:"shrink-0",children:"declared"}),description:f.jsxs(f.Fragment,{children:[f.jsx(J5,{engine:d.engine??"claude",model:d.defaults?.model??d.provider?.model,className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"min-w-0 truncate",children:d.configDir??(d.provider?`${d.provider.id}${d.provider.model?` · ${d.provider.model}`:""}`:d.engine??"claude")})]})},d.name))]})}),f.jsx(Hae,{open:a,onOpenChange:l,onCreated:d=>{l(!1),s(),e({to:"/profiles/$profileName",params:{profileName:d}})}})]})}function $ae({sessions:e,onCreated:t}){const n=wI("session"),[r,s]=y.useState(!1),[a,l]=y.useState(),[u,d]=y.useState(!1),{engine:h}=n,m=async b=>{const x=b?.cwd??n.cwd.trim();if(!x){an.error("Working directory is required");return}s(!0);try{n.rememberCwd(x);const E=await Mr().createSession({...n.sessionFields({prompt:b?void 0:n.prompt.trim()||void 0,resume:b?.sessionId,allowBypass:!0}),cwd:x});t(E.id)}catch(E){an.error(E instanceof Error?E.message:"Failed to create session")}finally{s(!1)}},p=async()=>{if(!n.cwd.trim()){an.error("Set a working directory first — resumable sessions are listed per project");return}d(!0);try{l(await Mr().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(b){an.error(b instanceof Error?b.message:"Failed to list resumable sessions")}finally{d(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(kI,{form:n,sessions:e,promptLabel:"Initial prompt (optional)",onProfileChange:()=>l(void 0),actions:f.jsxs(tt,{className:"ml-auto",onClick:()=>void m(),disabled:r,children:[r?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(Mo,{className:"size-4"}),"Create"]})}),h.capabilities.listSessions?f.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),f.jsxs(tt,{variant:"ghost",size:"xs",onClick:()=>void p(),disabled:u,children:[u?f.jsx(xn,{className:"size-3 text-current"}):f.jsx(sz,{className:"size-3"}),a?"Reload":"Browse"]})]}),a!==void 0?a.length===0?f.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):f.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:a.map(b=>f.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-body-sm text-fg-1",children:b.customTitle??b.summary}),f.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[b.gitBranch?f.jsx("span",{className:"truncate",children:b.gitBranch}):null,f.jsx("span",{className:"shrink-0",children:fu(b.lastModified)})]})]}),f.jsx(tt,{variant:"outline",size:"xs",onClick:()=>void m(b),disabled:r,children:"Resume"})]},b.sessionId))}):null]}):null]})}function Vae({open:e,onOpenChange:t,sessions:n,onCreated:r}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"New session",description:"Pick a directory and an engine."}),f.jsx(ms,{children:f.jsx($ae,{sessions:n,onCreated:r})})]})})}function qae(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(Vr,{icon:f.jsx(iI,{}),title:"No session open",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or start a new one with ",f.jsx(Do,{children:"+"})," above."]})})})}const $k="workerdeck.view-config";function Yae(){const[e,t]=y.useState(()=>{try{const r=localStorage.getItem($k),s=r?JSON.parse(r):{};return{...Pb,...s,search:"",scoped:!1}}catch{return{...Pb,scoped:!1}}}),n=y.useCallback(r=>{t(r);try{localStorage.setItem($k,JSON.stringify(r))}catch{}},[]);return[e,n]}function Gae(){const e=ws(),t=yd({select:N=>N.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),{snapshots:n,refresh:r}=Ld(),s=Tae(n),a=n.filter(N=>N.error!==void 0),l=Cm(),u=n.find(N=>N.host.id===l?.id)?.sessions??[],d=N=>{l&&e({to:"/sessions/$hostId/$sessionId",params:{hostId:l.id,sessionId:N}})},[h,m]=Yae(),[p,b]=y.useState(!1),[x,E]=y.useState(lae),A=y.useMemo(()=>OR(s,h),[s,h]),w=N=>void e({to:"/sessions/$hostId/$sessionId",params:{hostId:N.hostId,sessionId:N.info.id}}),S=(N,_)=>{bd(N.hostId)?.updateSession(N.info.id,{title:_||null}).then(()=>r()).catch(M=>an.error(M instanceof Error?M.message:"Rename failed"))},k=f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"New session",onClick:()=>b(!0),children:f.jsx(Mo,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsxs(wm,{section:"sessions",title:"Sessions",railActions:k,actions:f.jsxs(f.Fragment,{children:[f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":x?"Hide filters":"Show filters","aria-pressed":x,onClick:()=>{E(!x),uae(!x)},children:f.jsx(ZB,{className:ye("size-3.5",x&&"fill-current text-fg-1")})}),f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:f.jsx(em,{className:"size-3.5"})}),k]}),rail:A.map(N=>f.jsxs("button",{type:"button",title:`${tu(N.info)} — ${N.state}`,"aria-label":tu(N.info),onClick:()=>w(N),className:ye("flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5",N.info.id===t?"border-l-accent bg-row-active":"border-l-transparent hover:bg-row-hover"),children:[f.jsx(J5,{engine:N.adapter,model:N.info.model,className:"size-4"}),f.jsx(Z5,{row:N})]},N.info.id)),children:[a.map(({host:N,error:_})=>f.jsxs("div",{className:"mx-2 mb-2 rounded-md bg-danger-bg px-2 py-1.5 text-label text-danger",children:["Can’t reach ",N.name,": ",_]},N.id)),f.jsx(km,{children:f.jsx(Uie,{rows:s,config:h,onConfigChange:m,showControls:x,activeId:t,onSelect:w,onRename:S,onDelete:N=>{bd(N.hostId)?.deleteSession(N.info.id).then(()=>r()).catch(_=>an.error(_ instanceof Error?_.message:"Delete failed"))},emptyState:f.jsx(Vr,{icon:f.jsx(Rb,{}),title:"No sessions yet",description:f.jsxs(f.Fragment,{children:["Start one with ",f.jsx(Do,{children:"+"})," above."]})})})})]}),f.jsx(Vae,{open:p,onOpenChange:b,sessions:u,onCreated:N=>{b(!1),d(N),r()}})]})}const Vk=[{id:"sessions",label:"Sessions",icon:iU,path:"/sessions",sidebar:Gae},{id:"gateways",label:"Gateways",icon:Ly,path:"/gateways",sidebar:Sae},{id:"jobs",label:"Jobs",icon:H_,path:"/jobs",sidebar:Pae},{id:"profiles",label:"Profiles",icon:jy,path:"/profiles",sidebar:Fae}],qk="workerdeck.sidebar-collapsed";function Kae({children:e}){const t=yd({select:p=>p.location.pathname}),n=[...Vk].sort((p,b)=>b.path.length-p.path.length).find(p=>t.startsWith(p.path)),r=n?.sidebar,[s,a]=y.useState(!1),[l,u]=y.useState(()=>{try{return localStorage.getItem(qk)==="1"}catch{return!1}}),d=()=>{u(p=>{try{localStorage.setItem(qk,p?"0":"1")}catch{}return!p})},h="flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1",m=p=>ye("flex items-center rounded-md text-body-sm transition-colors outline-none",l?"justify-center p-2":"gap-2 px-2 py-1.5",p?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-row-hover hover:text-fg-1");return f.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[f.jsxs("aside",{className:ye("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",l?"w-14 items-center":"w-52"),children:[f.jsxs("div",{className:ye("flex items-center py-2",l?"justify-center":"gap-2 px-2"),children:[f.jsx(iI,{className:"size-4 shrink-0 text-fg-1"}),!l&&f.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),f.jsx("nav",{className:ye("mt-1 flex flex-1 flex-col gap-0.5",l&&"items-center"),children:Vk.map(p=>f.jsxs(Mp,{to:p.path,title:l?p.label:void 0,"aria-label":p.label,onClick:b=>{p.id===n?.id&&b.preventDefault()},className:m(p.id===n?.id),children:[f.jsx(p.icon,{className:"size-4 shrink-0"}),!l&&p.label]},p.id))}),f.jsxs("div",{className:ye("mt-1 grid place-items-center gap-1",l?"grid-rows-3":"grid-cols-3"),children:[f.jsx("button",{type:"button",onClick:()=>a(!0),title:"Settings","aria-label":"Settings",className:h,children:f.jsx(Kz,{className:"size-4"})}),f.jsx(eI,{}),f.jsx("button",{type:"button",onClick:d,title:l?"Expand sidebar":"Collapse sidebar","aria-label":l?"Expand sidebar":"Collapse sidebar",className:h,children:l?f.jsx(My,{className:"size-4"}):f.jsx(Oy,{className:"size-4"})})]})]}),f.jsxs("div",{className:"frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl",children:[r?f.jsx(r,{},n?.id):null,f.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:e??f.jsx(MN,{})})]}),f.jsx(Xie,{open:s,onOpenChange:a})]})}function Uv({crumbs:e,actions:t,children:n}){return f.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3",children:[f.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-1",children:e.map((r,s)=>f.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[s>0?f.jsx(Td,{"aria-hidden":!0,className:"size-3 shrink-0 text-fg-4"}):null,r.to?f.jsx(Mp,{to:r.to,className:"shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1",children:r.label}):f.jsx("span",{"aria-current":"page",className:"min-w-0 truncate text-body-sm font-medium text-fg-1",title:r.label,children:r.label})]},r.label))}),n,f.jsx("span",{className:"flex-1"}),t]})}function AI({children:e}){return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:e})})}function Nc({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function Xae(){const{hostId:e}=au({from:"/gateways/$hostId"}),t=ws(),{hosts:n,ready:r}=jv(),{snapshots:s}=Ld(),[a,l]=y.useState(!1),u=n.find(m=>m.id===e),d=s.find(m=>m.host.id===e);if(y.useEffect(()=>{!r||u||t({to:"/gateways"})},[r,u,t]),!u)return null;const h=d===void 0?"pending":d.error?"error":"ok";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(Uv,{crumbs:[{label:"Gateways",to:"/gateways"},{label:u.name}],actions:u.implicit?null:f.jsxs(tt,{variant:"outline",size:"xs",onClick:()=>l(!0),children:[f.jsx(Sd,{className:"size-3"}),"Remove"]}),children:f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:u.baseUrl,children:u.baseUrl})}),f.jsxs(AI,{children:[f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Connection"})}),f.jsxs(Hl,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Nc,{label:"Status",children:h==="ok"?f.jsx(gn,{variant:"success",dot:!0,children:"Connected"}):h==="error"?f.jsx(gn,{variant:"danger",dot:!0,children:"Unreachable"}):f.jsx(gn,{variant:"neutral",dot:!0,children:"Connecting…"})}),d?.error?f.jsx(Nc,{label:"Last error",children:f.jsx("span",{className:"text-danger",children:d.error})}):null,f.jsx(Nc,{label:"Live sessions",children:d?d.sessions.length:f.jsx("span",{className:"text-fg-4",children:"—"})}),f.jsx(Nc,{label:"Reachability",children:dI(u)?"This machine (loopback)":"Remote"}),f.jsx(Nc,{label:"Credential",children:u.implicit?f.jsx("span",{className:"text-fg-4",children:"the login cookie it set — same origin"}):f.jsx("span",{className:"text-fg-4",children:"an auth key held in this browser"})})]})]}),u.implicit?f.jsx("p",{className:"text-label text-fg-4",children:"This is the gateway that served the page. Its address is this origin and its credential is the cookie it already set, so there is nothing here to change — and nothing to remove, since removing it would just be closing the tab."}):f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Settings"})}),f.jsx(Hl,{children:f.jsx(pI,{host:u,onSaved:m=>an.success(`Saved ${m.name}`)},u.id)})]}),a?f.jsx(mI,{host:u,onClose:()=>l(!1),onRemoved:()=>{l(!1),t({to:"/gateways"})}}):null]})]})}function Wae(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(Vr,{icon:f.jsx(Ly,{}),title:"No gateway selected",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or add one with ",f.jsx(Do,{children:"+"})," above."]})})})}function Qae({files:e,activePath:t,onActivate:n,onClose:r,className:s}){return f.jsx(_H,{delay:500,closeDelay:0,children:f.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:ye("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",s),children:e.map(a=>f.jsx(Zae,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const u=e.findIndex(h=>h.path===a.path),d=e[u+l];d&&n(d.path)}},a.path))})})}function Zae({file:e,active:t,onActivate:n,onClose:r,onArrow:s}){const a=dd(e),l=y.useRef(null);y.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const u=d=>{d.button===1&&(d.preventDefault(),r())};return f.jsxs(Uy,{side:"bottom",render:f.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:u,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:ye("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:f.jsxs("span",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?f.jsx("span",{className:"text-fg-4",children:Co(e.bytes)}):null]}),children:[f.jsx("span",{className:ye("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?f.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,f.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:ye("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:[f.jsx("span",{className:ye("block",a&&"group-hover:hidden"),children:a?f.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):f.jsx(Cs,{className:"size-3"})}),a?f.jsx("span",{className:"hidden group-hover:block",children:f.jsx(Cs,{className:"size-3"})}):null]})]})}const _I=12;function Jae({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:s,style:a,className:l}){const[u,d]=y.useState(""),[h,m]=y.useState(),p=u.trim().length>0;return y.useEffect(()=>{if(!t?.available)return;const b=u.trim();if(!b){m(void 0);return}const x=new AbortController,E=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(A=>{x.signal.aborted||m(A)})},150);return()=>{x.abort(),clearTimeout(E)}},[t,u]),f.jsxs("div",{"data-slot":"file-tree",style:a,className:ye("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[f.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?f.jsxs("div",{className:"relative min-w-0 flex-1",children:[f.jsx(tm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Yt,{value:u,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),p?f.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:f.jsx(Cs,{className:"size-3.5"})}):null]}):f.jsx("span",{className:"min-w-0 flex-1 truncate px-1 font-mono text-label text-fg-4",children:e.root}),f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:f.jsx(em,{className:"size-3.5 text-fg-3"})}),s?f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:s,children:f.jsx(Oy,{className:"size-3.5 text-fg-3"})}):null]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?f.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):p?h===void 0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):h.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):f.jsx("ul",{children:h.map(b=>f.jsx("li",{children:f.jsx(Yk,{label:eoe(b.relative),detail:toe(b.relative),title:b.relative,icon:f.jsx(Jp,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?f.jsx("div",{className:"py-6 text-center",children:f.jsx(xn,{className:"size-4 text-fg-4"})}):e.rows.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):f.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>f.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[f.jsx(Yk,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?f.jsx(xn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?f.jsx(qB,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(B_,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(noe,{type:b.entry.type}),chevron:b.entry.type==="dir"?f.jsx(Td,{className:ye("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?f.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*_I+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function Yk({label:e,detail:t,title:n,icon:r,chevron:s,indent:a=0,active:l,onClick:u}){const d=y.useRef(null);return y.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),f.jsxs("button",{ref:d,type:"button",onClick:u,title:n??e,style:{paddingLeft:a*_I+4},className:ye("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:[f.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:s}),r,f.jsx("span",{className:"shrink-0 truncate font-mono text-label",children:e}),t?f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:t}):null]})}function eoe(e){return e.slice(e.lastIndexOf("/")+1)}function toe(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function noe({type:e}){return e==="symlink"?f.jsx(U_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(Jp,{className:"size-3.5 shrink-0 text-fg-4"})}function roe({path:e,value:t,onChange:n,onSave:r,readOnly:s,className:a}){const l=y.useRef(null),u=y.useRef(null),d=y.useRef(null),[h,m]=y.useState(!1),p=soe(),b=y.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},y.useEffect(()=>{let x=!1;return ioe().then(E=>{if(x||!l.current)return;d.current=E;const A=E.editor.create(l.current,{value:t,language:Xk(e),readOnly:s,automaticLayout:!0,theme:Gk(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});u.current=A,A.onDidChangeModelContent(()=>{b.current.onChange?.(A.getValue())}),A.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KeyS,()=>{b.current.onSave?.()}),m(!0)}),()=>{x=!0,u.current?.dispose(),u.current=null,m(!1)}},[]),y.useEffect(()=>{const x=d.current,E=u.current;if(!x||!E||!h)return;const A=x.Uri.parse(`workerdeck://host${e}`),w=x.editor.getModel(A)??x.editor.createModel(t,Xk(e),A);E.getModel()!==w&&E.setModel(w)},[e,h,t]),y.useEffect(()=>{const x=u.current;if(!x||!h)return;const E=x.getModel();!E||E.getValue()===t||E.pushEditOperations([],[{range:E.getFullModelRange(),text:t}],()=>null)},[t,h]),y.useEffect(()=>{h&&u.current?.updateOptions({readOnly:s})},[s,h]),y.useEffect(()=>{h&&d.current?.editor.setTheme(Gk(p))},[p,h]),f.jsxs("div",{className:ye("relative min-h-0 min-w-0 flex-1",a),children:[f.jsx("div",{ref:l,className:"absolute inset-0"}),h?null:f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:f.jsx(xn,{className:"size-4 text-fg-4"})})]})}function soe(){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 Gk(e){return e==="light"?"wd-light":"wd-dark"}let Kk;function ioe(){return Kk??=(async()=>{const e=await nu(()=>import("./index-BlST7WCb.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})(),Kk}function Xk(e){const t=e.slice(e.lastIndexOf("/")+1),n=aoe[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return ooe[r]??"plaintext"}const aoe={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},ooe={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 loe({file:e,canWrite:t,onChange:n,onSave:r,onRevert:s,onReload:a,onOverwrite:l,onDismissConflict:u,className:d}){return e?f.jsxs("div",{"data-slot":"file-viewer",className:ye("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?f.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:[f.jsx(ql,{className:"size-3.5 shrink-0 text-warning"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),f.jsx(tt,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),f.jsx(tt,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),f.jsx(tt,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):e.saveError?f.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[f.jsx(ql,{className:"size-3.5 shrink-0 text-danger"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),f.jsx(tt,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?f.jsx(ab,{children:f.jsx(xn,{className:"size-4 text-fg-4"})}):e.status==="error"?f.jsxs(ab,{children:[f.jsx(ql,{className:"size-4 text-danger"}),f.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?f.jsxs(ab,{children:[f.jsx(HB,{className:"size-4 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),f.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):f.jsx(roe,{path:e.path,value:zb(e),readOnly:!t,onChange:n?h=>n(e.path,h):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||dd(e)||!t)?f.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?f.jsxs(f.Fragment,{children:[f.jsx(xn,{className:"size-3 text-fg-4"}),f.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),f.jsx("span",{className:"flex-1"}),f.jsx(tt,{variant:"ghost",size:"xs",onClick:()=>s?.(e.path),children:"Revert"}),f.jsxs(tt,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",f.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):f.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function ab({children:e}){return f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const uoe=180,coe=520,doe=220,Wk=120;function RI({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:s,transcriptFont:a,statusPlacement:l,controlsSurface:u,unseen:d,readOnly:h,onVitals:m,defaultRailWidth:p=260,defaultRailCollapsed:b,onRailChange:x,className:E}){const{info:A}=jR(e,t),w=A?.cwd,S=cV(e,w),k=DR(e,w),N=fV(e),{canWrite:_}=uV(e);y.useEffect(()=>{if(!N.hasUnsaved)return;const L=te=>te.preventDefault();return window.addEventListener("beforeunload",L),()=>window.removeEventListener("beforeunload",L)},[N.hasUnsaved]);const M=hoe(),[R,j]=y.useState(b??!1),[O,H]=y.useState(p),P=y.useRef(x);P.current=x,y.useEffect(()=>{P.current?.({width:O,collapsed:R})},[O,R]);const[Y,X]=y.useState(360),Z=N.files.length>0,ee=!M,V=S.available&&!R;y.useEffect(()=>{ee&&j(!0)},[ee]);const z=y.useCallback(L=>{const te=N.files.find(ne=>ne.path===L);if(te&&dd(te)){const ne=te.name;if(!window.confirm(`${ne} has unsaved changes. Close it and lose them?`))return}N.close(L)},[N]),G=y.useRef(null),Q=foe(G),se=Math.max(Wk,Q-doe),[D,B]=y.useState(null),$=n===void 0||D===null?void 0:typeof n=="function"?L=>or.createPortal(n(L),D):or.createPortal(n,D);return f.jsxs("div",{"data-slot":"session-workspace",className:ye("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",E),children:[n!==void 0?f.jsx("div",{ref:B,className:"shrink-0"}):null,f.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[V?f.jsx(Jae,{tree:S,search:k,activePath:N.activePath,onOpenFile:N.open,onCollapse:()=>j(!0),style:{width:ee?Math.min(O,320):O},className:ye("shrink-0 border-r border-border",ee&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):S.available?f.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>j(!1),children:f.jsx(My,{className:"size-4 text-fg-3"})})}):null,V&&!ee?f.jsx(Mb,{orientation:"vertical",value:O,onValueChange:H,min:uoe,max:coe,defaultValue:p,"aria-label":"Resize the file tree"}):null,f.jsxs("div",{ref:G,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[Z?f.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(Y,se||Y)},children:[f.jsx(Qae,{files:N.files,activePath:N.activePath,onActivate:N.activate,onClose:z}),f.jsx(loe,{file:N.active,canWrite:_,onChange:N.edit,onSave:L=>void N.save(L),onRevert:N.revert,onReload:N.reload,onOverwrite:L=>void N.overwrite(L),onDismissConflict:N.dismissConflict})]}):null,Z?f.jsx(Mb,{orientation:"horizontal",value:Math.min(Y,se||Y),onValueChange:X,min:Wk,max:se,"aria-label":"Resize the open file"}):null,f.jsx(Pie,{client:e,sessionId:t,header:$,transcriptVariant:r,transcriptDensity:s,transcriptFont:a,controlsSurface:u,statusPlacement:l,unseen:d,readOnly:h,onVitals:m,className:"min-h-0 flex-1"})]}),ee&&V?f.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>j(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function foe(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 hoe(){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 II="workerdeck.rail",Qk={width:260,collapsed:!1};function OI(){try{const e=localStorage.getItem(II),t=e?JSON.parse(e):{};return{width:Math.min(520,Math.max(180,Number(t.width)||Qk.width)),collapsed:t.collapsed===!0}}catch{return Qk}}function MI(e){try{localStorage.setItem(II,JSON.stringify(e))}catch{}}function poe(){const{jobId:e}=au({from:"/jobs/$jobId"}),t=ws(),{jobs:n,refresh:r}=zv(),{snapshots:s}=Ld(),a=n.find(w=>w.id===e),l=Mr(),u=Cm()?.id,d=a?.sessionId!==void 0&&(s.find(w=>w.host.id===u)?.sessions.some(w=>w.id===a.sessionId)??!1),[h,m]=y.useState(!1);y.useEffect(()=>{n.length>0&&m(!0)},[n.length]),y.useEffect(()=>{!h||a||(an.error("That job is no longer in the queue"),t({to:"/jobs"}))},[h,a,t]);const[p]=y.useState(Iv),[b]=y.useState(Ov),[x]=y.useState(Mv),[E]=y.useState(OI);if(!a)return null;const A=f.jsx(Zk,{job:a,onChanged:()=>void r()});return!l||!d||!a.sessionId?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[A,f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx("p",{className:"text-body-sm text-fg-3",children:a.sessionId?"This job’s session is no longer on the gateway.":"This job never got as far as a session."}),f.jsx("p",{className:"max-w-md text-label text-fg-4",children:"The queue keeps the job record — status, usage, error — but the transcript lives with the session, and that one has been closed or swept."})]})]}):f.jsx(RI,{client:l,sessionId:a.sessionId,readOnly:!0,transcriptVariant:b,transcriptDensity:p,transcriptFont:x,statusPlacement:"bottom",defaultRailWidth:E.width,defaultRailCollapsed:E.collapsed,onRailChange:MI,header:({actions:w})=>f.jsx(Zk,{job:a,onChanged:()=>void r(),actions:w})},a.sessionId)}function Zk({job:e,onChanged:t,actions:n}){const r=NI[e.status],s=e.status==="queued"||e.status==="running"||e.status==="parked",a=async()=>{try{await Mr().cancelJob(e.id),t()}catch(l){an.error(l instanceof Error?l.message:"Cancel failed")}};return f.jsxs(Uv,{crumbs:[{label:"Jobs",to:"/jobs"},{label:e.prompt}],actions:f.jsxs(f.Fragment,{children:[f.jsx(gn,{variant:"neutral",className:"shrink-0",children:"read-only"}),f.jsx(ud,{value:e.id,"aria-label":"Copy job id"}),s?f.jsxs(tt,{variant:"outline",size:"xs",onClick:()=>void a(),children:[f.jsx(Cs,{className:"size-3"}),"Cancel"]}):null,n]}),children:[f.jsxs(gn,{variant:r.variant,dot:!r.busy,className:"shrink-0",children:[r.busy?f.jsx(xn,{className:"size-3 text-current"}):null,r.label]}),f.jsxs("div",{className:"flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4",children:[f.jsx("span",{className:"truncate",children:e.cwd}),e.profile?f.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,f.jsx("span",{className:"shrink-0",children:fu(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?f.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?f.jsxs("span",{className:"shrink-0",children:[cs(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?f.jsx("span",{className:"shrink-0",children:va(e.usage.totalCostUsd)}):null,e.error?f.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]})}const moe=["web_search","download","web_fetch","deliver_file"],Rh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function oa({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function goe({profile:e,onSaved:t}){const n=e.engine==="provider",[r,s]=y.useState(e.description??""),[a,l]=y.useState(e.defaults?.model??""),[u,d]=y.useState(e.defaults?.permissionMode),[h,m]=y.useState(e.provider?.model??""),[p,b]=y.useState((e.provider?.models??[]).join(", ")),[x,E]=y.useState(e.session?.capabilities),[A,w]=y.useState((e.session?.mcpServers??[]).join(", ")),[S,k]=y.useState(e.session?.instructions??""),[N,_]=y.useState(!1),M=CI(e,u??"default",a),R=M.models.map(O=>O.value==="default"?{...O,displayName:"Unset",description:e.defaultModel??"whatever the engine's own config picks"}:O),j=async()=>{const O={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:u}};n&&(O.provider={...e.provider,id:e.provider?.id??"",model:h.trim()||void 0,models:Rh(p).length>0?Rh(p):void 0},O.session={capabilities:x,mcpServers:Rh(A).length>0?Rh(A):void 0,instructions:S.trim()||void 0}),_(!0);try{t(await Mr().updateProfile(e.name,O)),an.success("Profile saved")}catch(H){an.error(H instanceof Error?H.message:"Failed to save profile")}finally{_(!1)}};return f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Edit profile"})}),f.jsxs(Hl,{className:"flex flex-col gap-3",children:[f.jsx(oa,{label:"Description",children:f.jsx(Yt,{value:r,onChange:O=>s(O.target.value)})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(oa,{label:"Default model",children:R.length>1?f.jsx(SI,{value:a,onChange:l,models:R}):f.jsx(Yt,{value:a,onChange:O=>l(O.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),f.jsx(oa,{label:"Default permission mode",children:f.jsx(Fy,{variant:"form",mode:u,onModeChange:d,modes:M.modes})})]}),n?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(oa,{label:"Default model id",children:f.jsx(Yt,{value:h,onChange:O=>m(O.target.value),className:"font-mono"})}),f.jsx(oa,{label:"Models offered (comma-separated)",children:f.jsx(Yt,{value:p,onChange:O=>b(O.target.value),className:"font-mono"})})]}),f.jsx(oa,{label:"Capabilities granted",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:x===void 0,onChange:O=>E(O.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),moe.map(O=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(O)??!1,onChange:H=>E(P=>H.target.checked?[...P??[],O]:(P??[]).filter(Y=>Y!==O)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),f.jsx("code",{className:"font-mono text-label",children:O})]},O))]})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(oa,{label:"MCP servers (names, comma-separated)",children:f.jsx(Yt,{value:A,onChange:O=>w(O.target.value),className:"font-mono"})}),f.jsx(oa,{label:"Instructions",children:f.jsx(Yt,{value:S,onChange:O=>k(O.target.value)})})]})]}):null,f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.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."}),f.jsxs(tt,{onClick:()=>void j(),disabled:N,children:[N?f.jsx(xn,{className:"size-3.5 text-current"}):f.jsx(Fz,{className:"size-4"}),"Save"]})]})]})]})}function boe(e){window.location.href=`vscode://file${e}`}function xoe(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(Vr,{icon:f.jsx(jy,{}),title:"No profile selected",description:"A profile is what a session runs as — its config directory and credentials, or a model provider."})})}function Mn({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function la({items:e,empty:t}){return e.length===0?f.jsx("span",{className:"text-fg-4",children:t}):f.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>f.jsx(gn,{variant:"neutral",children:n},n))})}function yoe(){const{profileName:e}=au({from:"/profiles/$profileName"}),t=ws(),{refresh:n}=Bv(),[r,s]=y.useState(),[a,l]=y.useState();y.useEffect(()=>{let m=!0;return Mr()?.getProfile(e).then(p=>{m&&s(p)}).catch(p=>{m&&l(p instanceof Error?p.message:"Failed to load profile")}),()=>{m=!1}},[e]);const u=r?.profile,d=r?.config,h=async()=>{try{await Mr().deleteProfile(e),await n(),an.success(`Profile '${e}' deleted`),t({to:"/profiles"})}catch(m){an.error(m instanceof Error?m.message:"Delete failed")}};return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(Uv,{crumbs:[{label:"Profiles",to:"/profiles"},{label:e}],actions:f.jsxs(f.Fragment,{children:[u?.configDir?f.jsxs(tt,{variant:"outline",size:"xs",onClick:()=>boe(u.configDir),children:[f.jsx(j_,{className:"size-3"}),"Open in VSCode"]}):null,u?.managed?f.jsxs(tt,{variant:"outline",size:"xs",onClick:()=>void h(),children:[f.jsx(Sd,{className:"size-3"}),"Delete"]}):null]}),children:u?.description?f.jsx("span",{className:"min-w-0 truncate text-label text-fg-4",children:u.description}):null}),f.jsxs(AI,{children:[a?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:a}):null,!r&&!a?f.jsx(xn,{className:"mx-auto size-5 text-fg-4"}):null,u&&d?f.jsxs(f.Fragment,{children:[f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Worker defaults"})}),f.jsxs(Hl,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Mn,{label:"Engine",children:f.jsx(gn,{variant:"neutral",children:u.engine??"claude"})}),u.engine==="provider"?f.jsx(Mn,{label:"Provider",children:f.jsx("span",{className:"font-mono text-label",children:u.provider?.id})}):f.jsx(Mn,{label:"Config directory",children:f.jsx("span",{className:"font-mono text-label",children:u.configDir})}),f.jsx(Mn,{label:"Default model",children:u.defaults?.model??u.provider?.model??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),f.jsx(Mn,{label:"Default permission mode",children:u.defaults?.permissionMode??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),u.engine==="provider"?f.jsxs(f.Fragment,{children:[f.jsx(Mn,{label:"Models offered",children:f.jsx(la,{items:u.provider?.models??[],empty:"the default model only"})}),f.jsx(Mn,{label:"API key variable",children:u.provider?.apiKeyEnv?f.jsx("span",{className:"font-mono text-label",children:u.provider.apiKeyEnv}):f.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),u.engine==="provider"?f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Session grants"})}),f.jsxs(Hl,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Mn,{label:"Capabilities",children:f.jsx(la,{items:u.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),f.jsx(Mn,{label:"MCP servers",children:f.jsx(la,{items:u.session?.mcpServers??[],empty:"not declared — every connected server"})}),f.jsx(Mn,{label:"Instructions",children:u.session?.instructions?`${u.session.instructions.length} characters`:f.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,u.engine==="provider"?null:f.jsxs(Bl,{children:[f.jsx(zl,{children:f.jsx(Ul,{children:"Claude Code configuration"})}),f.jsxs(Hl,{className:"flex flex-col divide-y divide-border",children:[d.settings?f.jsxs(f.Fragment,{children:[f.jsx(Mn,{label:"Model (settings.json)",children:d.settings.model??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Mn,{label:"Default permission mode",children:d.settings.defaultPermissionMode??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Mn,{label:"Permission rules",children:f.jsx("span",{className:"font-mono text-label",children:d.settings.permissionRules?`${d.settings.permissionRules.allow} allow · ${d.settings.permissionRules.ask} ask · ${d.settings.permissionRules.deny} deny`:"—"})}),f.jsx(Mn,{label:"Env vars (names only)",children:f.jsx(la,{items:d.settings.envKeys??[],empty:"none"})}),f.jsx(Mn,{label:"Hooks",children:f.jsx(la,{items:d.settings.hooks??[],empty:"none"})})]}):f.jsx(Mn,{label:"settings.json",children:f.jsx("span",{className:"text-fg-4",children:"not found"})}),f.jsx(Mn,{label:"User memory (CLAUDE.md)",children:d.hasUserMemory?"present":f.jsx("span",{className:"text-fg-4",children:"none"})}),f.jsx(Mn,{label:"Skills",children:f.jsx(la,{items:d.skills,empty:"none"})}),f.jsx(Mn,{label:"Agents",children:f.jsx(la,{items:d.agents,empty:"none"})}),f.jsx(Mn,{label:"Commands",children:f.jsx(la,{items:d.commands,empty:"none"})})]})]}),u.managed?f.jsx(goe,{profile:u,onSaved:m=>s({...r,profile:m})}):null,f.jsxs("p",{className:"text-label text-fg-4",children:[u.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"," ",f.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 voe(){const{hostId:e,sessionId:t}=au({from:"/sessions/$hostId/$sessionId"}),{ready:n}=jv(),r=ws(),s=bd(e);return y.useEffect(()=>{!n||s||(an.error("That gateway is not configured here"),r({to:"/sessions"}))},[n,s,r]),s?f.jsx(Eoe,{hostId:e,sessionId:t,client:s},`${e}:${t}`):null}function Eoe({hostId:e,sessionId:t,client:n}){const r=ws(),{info:s,error:a}=jR(n,t),l=pae(e,t),[u]=y.useState(()=>hae(e,t)),[d]=y.useState(Iv),[h]=y.useState(Ov),[m]=y.useState(Mv),[p]=y.useState(OI);y.useEffect(()=>{a&&(an.error("Session not found"),r({to:"/sessions"}))},[a,r]);const b=async()=>{try{await n.deleteSession(t)}catch{}r({to:"/sessions"})},x=s?.cwd?.split("/").filter(Boolean).pop();return f.jsx(RI,{client:n,sessionId:t,transcriptVariant:h,transcriptDensity:d,transcriptFont:m,statusPlacement:"bottom",controlsSurface:"status",defaultRailWidth:p.width,defaultRailCollapsed:p.collapsed,onRailChange:MI,unseen:u,onVitals:E=>{l({itemCount:E.itemCount,activity:s?.activityCount,turns:s?.numTurns}),yae()},header:({actions:E})=>f.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[f.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:s?.title??x??t.slice(0,8)}),s?.engine&&s.engine!=="claude"?f.jsx(gn,{variant:"neutral",className:"shrink-0",children:s.engine}):null,s?.cwd?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:s.cwd,children:s.cwd}):null,f.jsx("span",{className:"flex-1"}),f.jsx(ud,{value:t,"aria-label":"Copy session id"}),f.jsxs(MU,{children:[f.jsx(LU,{render:f.jsx(tt,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:f.jsx(Sd,{className:"size-4 text-fg-3"})})}),f.jsxs(jU,{children:[f.jsx(PU,{children:"Close this session?"}),f.jsx(BU,{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."}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsx(DU,{render:f.jsx(tt,{variant:"outline",children:"Cancel"})}),f.jsx(tt,{variant:"destructive",onClick:()=>void b(),children:"Close session"})]})]})]}),E]})},t)}const gs=I8({component:Kae}),Toe=ks({getParentRoute:()=>gs,path:"/",beforeLoad:()=>{throw Rp({to:"/sessions"})}}),Soe=ks({getParentRoute:()=>gs,path:"/sessions",component:qae}),Coe=ks({getParentRoute:()=>gs,path:"/sessions/$hostId/$sessionId",component:voe}),woe=ks({getParentRoute:()=>gs,path:"/sessions/$sessionId",beforeLoad:({params:e})=>{throw Rp({to:"/sessions/$hostId/$sessionId",params:{hostId:oI,sessionId:e.sessionId}})}}),koe=ks({getParentRoute:()=>gs,path:"/gateways",component:Wae}),Noe=ks({getParentRoute:()=>gs,path:"/gateways/$hostId",component:Xae}),Aoe=ks({getParentRoute:()=>gs,path:"/jobs",component:Dae}),_oe=ks({getParentRoute:()=>gs,path:"/jobs/$jobId",component:poe}),Roe=ks({getParentRoute:()=>gs,path:"/profiles",component:xoe}),Ioe=ks({getParentRoute:()=>gs,path:"/profiles/$profileName",component:yoe}),Ooe=ks({getParentRoute:()=>gs,path:"/settings",beforeLoad:()=>{throw Rp({to:"/sessions"})}}),Moe=V8({routeTree:gs.addChildren([Toe,Soe,Coe,woe,koe,Noe,Aoe,_oe,Roe,Ioe,Ooe]),history:XL()});function Loe(){return f.jsxs(f.Fragment,{children:[f.jsx(G8,{router:Moe}),f.jsx(sF,{})]})}tN();const LI=document.getElementById("root");if(!LI)throw new Error("Root element #root not found");tL.createRoot(LI).render(f.jsx(y.StrictMode,{children:f.jsx(Loe,{})}));const Doe=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:F5},Symbol.toStringTag,{value:"Module"}));export{Qne as A,Boe as L,Gr as R,nu as _,f as j,y as r};